nx 17.3.1 → 17.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/init-local.js +1 -34
- package/package.json +14 -14
- package/src/command-line/init/implementation/utils.js +1 -0
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/nx-commands.js +1 -0
- package/src/command-line/run/command-object.d.ts +4 -0
- package/src/command-line/run/command-object.js +10 -1
- package/src/command-line/run/run-one.js +2 -2
- package/src/command-line/yargs-utils/shared-options.js +4 -1
- package/src/core/graph/main.js +1 -1
- package/src/executors/run-script/run-script.impl.js +40 -14
- package/src/plugins/package-json-workspaces/create-nodes.js +23 -2
- package/src/plugins/target-defaults/target-defaults-plugin.js +28 -22
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +2 -4
- package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +1 -2
- package/src/utils/output.d.ts +3 -0
- package/src/utils/output.js +35 -2
- package/src/utils/package-json.d.ts +1 -2
package/bin/init-local.js
CHANGED
|
@@ -37,8 +37,7 @@ function initLocal(workspace) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
|
|
41
|
-
nx_commands_1.commandsObject.parse(newArgs);
|
|
40
|
+
nx_commands_1.commandsObject.parse(process.argv.slice(2));
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
catch (e) {
|
|
@@ -78,38 +77,6 @@ function rewriteTargetsAndProjects(args) {
|
|
|
78
77
|
return newArgs;
|
|
79
78
|
}
|
|
80
79
|
exports.rewriteTargetsAndProjects = rewriteTargetsAndProjects;
|
|
81
|
-
function rewritePositionalArguments(args) {
|
|
82
|
-
const relevantPositionalArgs = [];
|
|
83
|
-
const rest = [];
|
|
84
|
-
for (let i = 2; i < args.length; i++) {
|
|
85
|
-
if (args[i] === '--') {
|
|
86
|
-
rest.push(...args.slice(i + 1));
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
else if (!args[i].startsWith('-')) {
|
|
90
|
-
relevantPositionalArgs.push(args[i]);
|
|
91
|
-
if (relevantPositionalArgs.length === 2) {
|
|
92
|
-
rest.push(...args.slice(i + 1));
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
rest.push(args[i]);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (relevantPositionalArgs.length === 1) {
|
|
101
|
-
return [
|
|
102
|
-
'run',
|
|
103
|
-
`${wrapIntoQuotesIfNeeded(relevantPositionalArgs[0])}`,
|
|
104
|
-
...rest,
|
|
105
|
-
];
|
|
106
|
-
}
|
|
107
|
-
return [
|
|
108
|
-
'run',
|
|
109
|
-
`${relevantPositionalArgs[1]}:${wrapIntoQuotesIfNeeded(relevantPositionalArgs[0])}`,
|
|
110
|
-
...rest,
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
80
|
function wrapIntoQuotesIfNeeded(arg) {
|
|
114
81
|
return arg.indexOf(':') > -1 ? `"${arg}"` : arg;
|
|
115
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.2",
|
|
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": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
37
37
|
"@yarnpkg/parsers": "3.0.0-rc.46",
|
|
38
38
|
"@zkochan/js-yaml": "0.0.6",
|
|
39
|
-
"axios": "^1.
|
|
39
|
+
"axios": "^1.6.0",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
41
41
|
"cli-cursor": "3.1.0",
|
|
42
42
|
"cli-spinners": "2.6.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"minimatch": "9.0.3",
|
|
56
56
|
"npm-run-path": "^4.0.1",
|
|
57
57
|
"open": "^8.4.0",
|
|
58
|
-
"semver": "7.5.3",
|
|
58
|
+
"semver": "^7.5.3",
|
|
59
59
|
"string-width": "^4.2.3",
|
|
60
60
|
"strong-log-transformer": "^2.1.0",
|
|
61
61
|
"tar-stream": "~2.2.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"yargs-parser": "21.1.1",
|
|
67
67
|
"node-machine-id": "1.1.12",
|
|
68
68
|
"ora": "5.3.0",
|
|
69
|
-
"@nrwl/tao": "17.3.
|
|
69
|
+
"@nrwl/tao": "17.3.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@swc-node/register": "^1.6.7",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"optionalDependencies": {
|
|
84
|
-
"@nx/nx-darwin-x64": "17.3.
|
|
85
|
-
"@nx/nx-darwin-arm64": "17.3.
|
|
86
|
-
"@nx/nx-linux-x64-gnu": "17.3.
|
|
87
|
-
"@nx/nx-linux-x64-musl": "17.3.
|
|
88
|
-
"@nx/nx-win32-x64-msvc": "17.3.
|
|
89
|
-
"@nx/nx-linux-arm64-gnu": "17.3.
|
|
90
|
-
"@nx/nx-linux-arm64-musl": "17.3.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "17.3.
|
|
92
|
-
"@nx/nx-win32-arm64-msvc": "17.3.
|
|
93
|
-
"@nx/nx-freebsd-x64": "17.3.
|
|
84
|
+
"@nx/nx-darwin-x64": "17.3.2",
|
|
85
|
+
"@nx/nx-darwin-arm64": "17.3.2",
|
|
86
|
+
"@nx/nx-linux-x64-gnu": "17.3.2",
|
|
87
|
+
"@nx/nx-linux-x64-musl": "17.3.2",
|
|
88
|
+
"@nx/nx-win32-x64-msvc": "17.3.2",
|
|
89
|
+
"@nx/nx-linux-arm64-gnu": "17.3.2",
|
|
90
|
+
"@nx/nx-linux-arm64-musl": "17.3.2",
|
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "17.3.2",
|
|
92
|
+
"@nx/nx-win32-arm64-msvc": "17.3.2",
|
|
93
|
+
"@nx/nx-freebsd-x64": "17.3.2"
|
|
94
94
|
},
|
|
95
95
|
"nx-migrations": {
|
|
96
96
|
"migrations": "./migrations.json",
|
|
@@ -18,6 +18,7 @@ function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scr
|
|
|
18
18
|
// eslint-disable-next-line no-empty
|
|
19
19
|
}
|
|
20
20
|
catch { }
|
|
21
|
+
nxJson.$schema = './node_modules/nx/schemas/nx-schema.json';
|
|
21
22
|
nxJson.targetDefaults ??= {};
|
|
22
23
|
if (topologicalTargets.length > 0) {
|
|
23
24
|
for (const scriptName of topologicalTargets) {
|
|
@@ -114,5 +114,5 @@ function setupDotNxInstallation(version) {
|
|
|
114
114
|
}
|
|
115
115
|
(0, add_nx_scripts_1.generateDotNxSetup)(version);
|
|
116
116
|
// invokes the wrapper, thus invoking the initial installation process
|
|
117
|
-
(0, child_process_2.runNxSync)('');
|
|
117
|
+
(0, child_process_2.runNxSync)('--version');
|
|
118
118
|
}
|
|
@@ -68,6 +68,7 @@ exports.commandsObject = yargs
|
|
|
68
68
|
.command(command_object_16.yargsShowCommand)
|
|
69
69
|
.command(command_object_2.yargsViewLogsCommand)
|
|
70
70
|
.command(command_object_17.yargsWatchCommand)
|
|
71
|
+
.command(command_object_14.yargsNxInfixCommand)
|
|
71
72
|
.scriptName('nx')
|
|
72
73
|
.help()
|
|
73
74
|
// NOTE: we handle --version in nx.ts, this just tells yargs that the option exists
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.yargsRunCommand = void 0;
|
|
3
|
+
exports.yargsNxInfixCommand = exports.yargsRunCommand = void 0;
|
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
|
5
5
|
exports.yargsRunCommand = {
|
|
6
6
|
command: 'run [project][:target][:configuration] [_..]',
|
|
@@ -14,3 +14,12 @@ exports.yargsRunCommand = {
|
|
|
14
14
|
builder: (yargs) => (0, shared_options_1.withRunOneOptions)((0, shared_options_1.withBatch)(yargs)),
|
|
15
15
|
handler: async (args) => (await Promise.resolve().then(() => require('./run-one'))).runOne(process.cwd(), (0, shared_options_1.withOverrides)(args)),
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Handles the infix notation for running a target.
|
|
19
|
+
*/
|
|
20
|
+
exports.yargsNxInfixCommand = {
|
|
21
|
+
...exports.yargsRunCommand,
|
|
22
|
+
command: '$0 <target> [project] [_..]',
|
|
23
|
+
describe: 'Run a target for a project',
|
|
24
|
+
handler: async (args) => (await Promise.resolve().then(() => require('./run-one'))).runOne(process.cwd(), (0, shared_options_1.withOverrides)(args, 0)),
|
|
25
|
+
};
|
|
@@ -77,7 +77,7 @@ function parseRunOneOptions(cwd, parsedArgs, projectGraph, nxJson) {
|
|
|
77
77
|
let project;
|
|
78
78
|
let target;
|
|
79
79
|
let configuration;
|
|
80
|
-
if (parsedArgs['project:target:configuration']
|
|
80
|
+
if (parsedArgs['project:target:configuration']?.indexOf(':') > -1) {
|
|
81
81
|
// run case
|
|
82
82
|
[project, target, configuration] = (0, split_target_1.splitTarget)(parsedArgs['project:target:configuration'], projectGraph);
|
|
83
83
|
// this is to account for "nx npmsript:dev"
|
|
@@ -87,7 +87,7 @@ function parseRunOneOptions(cwd, parsedArgs, projectGraph, nxJson) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
target = parsedArgs['project:target:configuration'];
|
|
90
|
+
target = parsedArgs.target ?? parsedArgs['project:target:configuration'];
|
|
91
91
|
}
|
|
92
92
|
if (parsedArgs.project) {
|
|
93
93
|
project = parsedArgs.project;
|
|
@@ -273,7 +273,10 @@ function parseCSV(args) {
|
|
|
273
273
|
return [];
|
|
274
274
|
}
|
|
275
275
|
if (Array.isArray(args)) {
|
|
276
|
-
|
|
276
|
+
// If parseCSV is used on `type: 'array'`, the first option may be something like ['a,b,c'].
|
|
277
|
+
return args.length === 1 && args[0].includes(',')
|
|
278
|
+
? parseCSV(args[0])
|
|
279
|
+
: args;
|
|
277
280
|
}
|
|
278
281
|
const items = args.split(',');
|
|
279
282
|
return items.map((i) => i.startsWith('"') && i.endsWith('"') ? i.slice(1, -1) : i);
|