nx 19.2.2 → 19.3.0-canary.20240606-bccb2c5
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/post-install.js +3 -1
- package/migrations.json +0 -6
- package/package.json +12 -12
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +13 -38
- package/src/command-line/init/implementation/utils.js +2 -15
- package/src/command-line/release/version.d.ts +1 -1
- package/src/command-line/yargs-utils/shared-options.d.ts +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.js +2 -0
- package/src/executors/run-commands/run-commands.impl.d.ts +1 -1
- package/src/executors/run-commands/run-commands.impl.js +11 -17
- package/src/hasher/file-hasher.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -3
- package/src/plugins/package-json-workspaces/create-nodes.js +1 -10
- package/src/project-graph/error-types.js +0 -10
- package/src/project-graph/plugins/internal-api.js +1 -1
- package/src/project-graph/utils/normalize-project-nodes.js +6 -24
- package/src/project-graph/utils/project-configuration-utils.js +1 -9
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
- package/src/tasks-runner/create-task-graph.js +33 -32
- package/src/utils/ab-testing.d.ts +1 -1
- package/src/utils/find-matching-projects.js +1 -13
package/bin/post-install.js
CHANGED
@@ -14,6 +14,7 @@ const workspace_context_1 = require("../src/utils/workspace-context");
|
|
14
14
|
const logger_1 = require("../src/utils/logger");
|
15
15
|
(async () => {
|
16
16
|
const start = new Date();
|
17
|
+
let errored = false;
|
17
18
|
try {
|
18
19
|
(0, workspace_context_1.setupWorkspaceContext)(workspace_root_1.workspaceRoot);
|
19
20
|
if (isMainNxPackage() && (0, fileutils_1.fileExists)((0, path_1.join)(workspace_root_1.workspaceRoot, 'nx.json'))) {
|
@@ -38,12 +39,13 @@ const logger_1 = require("../src/utils/logger");
|
|
38
39
|
}
|
39
40
|
}
|
40
41
|
catch (e) {
|
42
|
+
errored = true;
|
41
43
|
logger_1.logger.verbose(e);
|
42
44
|
}
|
43
45
|
finally {
|
44
46
|
const end = new Date();
|
45
47
|
logger_1.logger.verbose(`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`);
|
46
|
-
process.exit(0);
|
48
|
+
process.exit(errored ? 1 : 0);
|
47
49
|
}
|
48
50
|
})();
|
49
51
|
function isMainNxPackage() {
|
package/migrations.json
CHANGED
@@ -77,12 +77,6 @@
|
|
77
77
|
"version": "19.2.0-beta.2",
|
78
78
|
"description": "Updates the default workspace data directory to .nx/workspace-data",
|
79
79
|
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory"
|
80
|
-
},
|
81
|
-
"19-2-2-update-nx-wrapper": {
|
82
|
-
"cli": "nx",
|
83
|
-
"version": "19.2.2-beta.0",
|
84
|
-
"description": "Updates the nx wrapper.",
|
85
|
-
"implementation": "./src/migrations/update-17-3-0/update-nxw"
|
86
80
|
}
|
87
81
|
}
|
88
82
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.3.0-canary.20240606-bccb2c5",
|
4
4
|
"private": false,
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
6
6
|
"repository": {
|
@@ -70,7 +70,7 @@
|
|
70
70
|
"yargs-parser": "21.1.1",
|
71
71
|
"node-machine-id": "1.1.12",
|
72
72
|
"ora": "5.3.0",
|
73
|
-
"@nrwl/tao": "19.
|
73
|
+
"@nrwl/tao": "19.3.0-canary.20240606-bccb2c5"
|
74
74
|
},
|
75
75
|
"peerDependencies": {
|
76
76
|
"@swc-node/register": "^1.8.0",
|
@@ -85,16 +85,16 @@
|
|
85
85
|
}
|
86
86
|
},
|
87
87
|
"optionalDependencies": {
|
88
|
-
"@nx/nx-darwin-x64": "19.
|
89
|
-
"@nx/nx-darwin-arm64": "19.
|
90
|
-
"@nx/nx-linux-x64-gnu": "19.
|
91
|
-
"@nx/nx-linux-x64-musl": "19.
|
92
|
-
"@nx/nx-win32-x64-msvc": "19.
|
93
|
-
"@nx/nx-linux-arm64-gnu": "19.
|
94
|
-
"@nx/nx-linux-arm64-musl": "19.
|
95
|
-
"@nx/nx-linux-arm-gnueabihf": "19.
|
96
|
-
"@nx/nx-win32-arm64-msvc": "19.
|
97
|
-
"@nx/nx-freebsd-x64": "19.
|
88
|
+
"@nx/nx-darwin-x64": "19.3.0-canary.20240606-bccb2c5",
|
89
|
+
"@nx/nx-darwin-arm64": "19.3.0-canary.20240606-bccb2c5",
|
90
|
+
"@nx/nx-linux-x64-gnu": "19.3.0-canary.20240606-bccb2c5",
|
91
|
+
"@nx/nx-linux-x64-musl": "19.3.0-canary.20240606-bccb2c5",
|
92
|
+
"@nx/nx-win32-x64-msvc": "19.3.0-canary.20240606-bccb2c5",
|
93
|
+
"@nx/nx-linux-arm64-gnu": "19.3.0-canary.20240606-bccb2c5",
|
94
|
+
"@nx/nx-linux-arm64-musl": "19.3.0-canary.20240606-bccb2c5",
|
95
|
+
"@nx/nx-linux-arm-gnueabihf": "19.3.0-canary.20240606-bccb2c5",
|
96
|
+
"@nx/nx-win32-arm64-msvc": "19.3.0-canary.20240606-bccb2c5",
|
97
|
+
"@nx/nx-freebsd-x64": "19.3.0-canary.20240606-bccb2c5"
|
98
98
|
},
|
99
99
|
"nx-migrations": {
|
100
100
|
"migrations": "./migrations.json",
|
@@ -11,36 +11,17 @@ const nxWrapperPath = (p = path) => p.join('.nx', 'nxw.js');
|
|
11
11
|
exports.nxWrapperPath = nxWrapperPath;
|
12
12
|
const NODE_MISSING_ERR = 'Nx requires NodeJS to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ .';
|
13
13
|
const NPM_MISSING_ERR = 'Nx requires npm to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ .';
|
14
|
-
const BATCH_SCRIPT_CONTENTS =
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
`IF %ERRORLEVEL% NEQ 0 (ECHO ${NPM_MISSING_ERR} & GOTO exit)`,
|
26
|
-
// Executes the nx wrapper script
|
27
|
-
`node ${path.win32.join('%path_to_root%', (0, exports.nxWrapperPath)(path.win32))} %*`,
|
28
|
-
// Exits with the same error code as the previous command
|
29
|
-
`:exit`,
|
30
|
-
` cmd /c exit /b %ERRORLEVEL%`,
|
31
|
-
].join('\r\n');
|
32
|
-
const SHELL_SCRIPT_CONTENTS = [
|
33
|
-
// Execute in bash
|
34
|
-
`#!/bin/bash`,
|
35
|
-
// Checks if node is available
|
36
|
-
`command -v node >/dev/null 2>&1 || { echo >&2 "${NODE_MISSING_ERR}"; exit 1; }`,
|
37
|
-
// Checks if npm is available
|
38
|
-
`command -v npm >/dev/null 2>&1 || { echo >&2 "${NPM_MISSING_ERR}"; exit 1; }`,
|
39
|
-
// Gets the path to the root of the project
|
40
|
-
`path_to_root=$(dirname $BASH_SOURCE)`,
|
41
|
-
// Executes the nx wrapper script
|
42
|
-
`node ${path.posix.join('$path_to_root', (0, exports.nxWrapperPath)(path.posix))} $@`,
|
43
|
-
].join('\n');
|
14
|
+
const BATCH_SCRIPT_CONTENTS = `set path_to_root=%~dp0
|
15
|
+
WHERE node >nul 2>nul
|
16
|
+
IF %ERRORLEVEL% NEQ 0 (ECHO ${NODE_MISSING_ERR}; EXIT 1)
|
17
|
+
WHERE npm >nul 2>nul
|
18
|
+
IF %ERRORLEVEL% NEQ 0 (ECHO ${NPM_MISSING_ERR}; EXIT 1)
|
19
|
+
node ${path.win32.join('%path_to_root%', (0, exports.nxWrapperPath)(path.win32))} %*`;
|
20
|
+
const SHELL_SCRIPT_CONTENTS = `#!/bin/bash
|
21
|
+
command -v node >/dev/null 2>&1 || { echo >&2 "${NODE_MISSING_ERR}"; exit 1; }
|
22
|
+
command -v npm >/dev/null 2>&1 || { echo >&2 "${NPM_MISSING_ERR}"; exit 1; }
|
23
|
+
path_to_root=$(dirname $BASH_SOURCE)
|
24
|
+
node ${path.posix.join('$path_to_root', (0, exports.nxWrapperPath)(path.posix))} $@`;
|
44
25
|
function generateDotNxSetup(version) {
|
45
26
|
const host = new tree_1.FsTree(process.cwd(), false, '.nx setup');
|
46
27
|
writeMinimalNxJson(host, version);
|
@@ -73,14 +54,8 @@ function writeMinimalNxJson(host, version) {
|
|
73
54
|
}
|
74
55
|
exports.writeMinimalNxJson = writeMinimalNxJson;
|
75
56
|
function updateGitIgnore(host) {
|
76
|
-
|
77
|
-
|
78
|
-
contents = [contents, '.nx/installation'].join('\n');
|
79
|
-
}
|
80
|
-
if (!contents.includes('.nx/cache')) {
|
81
|
-
contents = [contents, '.nx/cache'].join('\n');
|
82
|
-
}
|
83
|
-
host.write('.gitignore', contents);
|
57
|
+
const contents = host.read('.gitignore', 'utf-8') ?? '';
|
58
|
+
host.write('.gitignore', [contents, '.nx/installation', '.nx/cache'].join('\n'));
|
84
59
|
}
|
85
60
|
exports.updateGitIgnore = updateGitIgnore;
|
86
61
|
// Gets the sanitized contents for nxw.js
|
@@ -98,23 +98,10 @@ function updateGitIgnore(root) {
|
|
98
98
|
const ignorePath = (0, path_1.join)(root, '.gitignore');
|
99
99
|
try {
|
100
100
|
let contents = (0, fs_1.readFileSync)(ignorePath, 'utf-8');
|
101
|
-
const lines = contents.split('\n');
|
102
|
-
let sepIncluded = false;
|
103
101
|
if (!contents.includes('.nx/cache')) {
|
104
|
-
|
105
|
-
|
106
|
-
sepIncluded = true;
|
107
|
-
}
|
108
|
-
lines.push('.nx/cache');
|
109
|
-
}
|
110
|
-
if (!contents.includes('.nx/workspace-data')) {
|
111
|
-
if (!sepIncluded) {
|
112
|
-
lines.push('\n');
|
113
|
-
sepIncluded = true;
|
114
|
-
}
|
115
|
-
lines.push('.nx/workspace-data');
|
102
|
+
contents = [contents, '', '.nx/cache'].join('\n');
|
103
|
+
(0, fs_1.writeFileSync)(ignorePath, contents, 'utf-8');
|
116
104
|
}
|
117
|
-
(0, fs_1.writeFileSync)(ignorePath, lines.join('\n'), 'utf-8');
|
118
105
|
}
|
119
106
|
catch { }
|
120
107
|
}
|
@@ -18,7 +18,7 @@ export interface ReleaseVersionGeneratorSchema {
|
|
18
18
|
currentVersionResolverMetadata?: Record<string, unknown>;
|
19
19
|
fallbackCurrentVersionResolver?: 'disk';
|
20
20
|
firstRelease?: boolean;
|
21
|
-
versionPrefix?:
|
21
|
+
versionPrefix?: typeof validReleaseVersionPrefixes[number];
|
22
22
|
skipLockFileUpdate?: boolean;
|
23
23
|
installArgs?: string;
|
24
24
|
installIgnoreScripts?: boolean;
|
@@ -57,7 +57,7 @@ export declare function withOverrides<T extends {
|
|
57
57
|
__overrides_unparsed__: string[];
|
58
58
|
};
|
59
59
|
declare const allOutputStyles: readonly ["dynamic", "static", "stream", "stream-without-prefixes", "compact"];
|
60
|
-
export type OutputStyle =
|
60
|
+
export type OutputStyle = typeof allOutputStyles[number];
|
61
61
|
export declare function withOutputStyleOption(yargs: Argv, choices?: ReadonlyArray<OutputStyle>): Argv<{
|
62
62
|
"output-style": string;
|
63
63
|
}>;
|