-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NA): ensure scripts run with --preserve-symlinks (#94046)
* chore(NA): ensure scripts run with --preserve-symlinks * chore(NA): run webpack configs with symlinks: false * chore(NA): fix pkg json load on kbn test * chore(NA): add script into setup node env * chore(NA): fix kbn test for relative improt * chore(NA): fix change on docs * chore(NA): move ensure node preserve symlinks into setup node env * chore(NA): update changed docs * chore(NA): update jest unit test * chore(NA): fix wrapper script exit code * chore(NA): updated generated plugin list docs * fix(NA): make functional test runner use kbn utils repo_root * chore(NA): fix eslint imports * chore(NA): missing react correct config on eslint package * chore(NA): use correct value to make test pass locally * chore(NA): fix jest tests * chore(NA): try remove extra preserve symlinks * chore(NA): fix windows environment * chore(NA): fix kbn-optimizer to run with preserve-symlinks * chore(NA): fix integration jest test for kbn/optimizer * chore(NA): remove require.resolve from eslintrc.js * chore(NA): avoid load json file * chore(NA): move kbn/utils import into kbn/dev-utils * chore(NA): use correct dependencies on eslint config package Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
511accd
commit daa0f22
Showing
30 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ module.exports = { | |
|
||
resolve: { | ||
extensions: ['.ts', '.js'], | ||
symlinks: false, | ||
}, | ||
|
||
module: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
(function () { | ||
var cp = require('child_process'); | ||
|
||
var preserveSymlinksOption = '--preserve-symlinks'; | ||
var preserveSymlinksMainOption = '--preserve-symlinks-main'; | ||
var nodeOptions = (process && process.env && process.env.NODE_OPTIONS) || []; | ||
var nodeExecArgv = (process && process.execArgv) || []; | ||
|
||
var isPreserveSymlinksPresent = | ||
nodeOptions.includes(preserveSymlinksOption) || nodeExecArgv.includes(preserveSymlinksOption); | ||
var isPreserveSymlinksMainPresent = | ||
nodeOptions.includes(preserveSymlinksMainOption) || | ||
nodeExecArgv.includes(preserveSymlinksMainOption); | ||
|
||
if (isPreserveSymlinksPresent && isPreserveSymlinksMainPresent) { | ||
return; | ||
} | ||
|
||
var nodeArgv = (process && process.argv) || []; | ||
var isFirstArgNode = nodeArgv.length > 0 && nodeArgv[0].includes('node') ? nodeArgv[0] : null; | ||
if (!isFirstArgNode) { | ||
return; | ||
} | ||
|
||
var missingNodeArgs = []; | ||
if (!isPreserveSymlinksMainPresent) { | ||
missingNodeArgs.push(preserveSymlinksMainOption); | ||
} | ||
|
||
if (!isPreserveSymlinksPresent) { | ||
missingNodeArgs.push(preserveSymlinksOption); | ||
} | ||
|
||
var nodeArgs = nodeExecArgv.concat(missingNodeArgs); | ||
var restArgs = nodeArgv.length >= 2 ? nodeArgv.slice(1, nodeArgv.length) : []; | ||
|
||
var getExitCodeFromSpawnResult = function (spawnResult) { | ||
if (spawnResult.status !== null) { | ||
return spawnResult.status; | ||
} | ||
|
||
if (spawnResult.signal !== null) { | ||
return 128 + spawnResult.signal; | ||
} | ||
|
||
if (spawnResult.error) { | ||
return 1; | ||
} | ||
|
||
return 0; | ||
}; | ||
|
||
var spawnResult = cp.spawnSync(nodeArgv[0], nodeArgs.concat(restArgs), { stdio: 'inherit' }); | ||
process.exit(getExitCodeFromSpawnResult(spawnResult)); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters