nx 21.0.4-beta.0 → 21.1.0-beta.1
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/package.json +11 -11
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/yargs-utils/shared-options.js +13 -4
- package/src/core/graph/main.js +1 -1
- package/src/native/index.d.ts +1 -1
- package/src/native/index.js +8 -3
- package/src/native/nx.wasi-browser.js +41 -37
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/run-command.js +1 -1
- package/src/tasks-runner/running-tasks/node-child-process.js +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.0
|
3
|
+
"version": "21.1.0-beta.1",
|
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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.0
|
87
|
-
"@nx/nx-darwin-x64": "21.0
|
88
|
-
"@nx/nx-freebsd-x64": "21.0
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.0
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.0
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.0
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.0
|
93
|
-
"@nx/nx-linux-x64-musl": "21.0
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.0
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.0
|
86
|
+
"@nx/nx-darwin-arm64": "21.1.0-beta.1",
|
87
|
+
"@nx/nx-darwin-x64": "21.1.0-beta.1",
|
88
|
+
"@nx/nx-freebsd-x64": "21.1.0-beta.1",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.1.0-beta.1",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.1.0-beta.1",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.1.0-beta.1",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.1.0-beta.1",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.1.0-beta.1",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.1.0-beta.1",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.1.0-beta.1"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -38,7 +38,7 @@ async function initHandler(options) {
|
|
38
38
|
await (0, react_1.addNxToCraRepo)(options);
|
39
39
|
(0, utils_1.printFinalMessage)({
|
40
40
|
learnMoreLink: options.integrated
|
41
|
-
? 'https://nx.dev/tutorials/
|
41
|
+
? 'https://nx.dev/getting-started/tutorials/react-monorepo-tutorial'
|
42
42
|
: 'https://nx.dev/getting-started/tutorials/react-standalone-tutorial',
|
43
43
|
});
|
44
44
|
return;
|
@@ -17,6 +17,7 @@ exports.parseCSV = parseCSV;
|
|
17
17
|
exports.readParallelFromArgsAndEnv = readParallelFromArgsAndEnv;
|
18
18
|
const nx_json_1 = require("../../config/nx-json");
|
19
19
|
const is_tui_enabled_1 = require("../../tasks-runner/is-tui-enabled");
|
20
|
+
const node_os_1 = require("node:os");
|
20
21
|
exports.defaultYargsParserConfiguration = {
|
21
22
|
'strip-dashed': true,
|
22
23
|
'unknown-options-as-args': true,
|
@@ -304,15 +305,15 @@ function readParallelFromArgsAndEnv(args) {
|
|
304
305
|
else if (args['parallel'] === 'true' ||
|
305
306
|
args['parallel'] === true ||
|
306
307
|
args['parallel'] === '' ||
|
307
|
-
//
|
308
|
+
// don't require passing --parallel if NX_PARALLEL is set, but allow overriding it
|
308
309
|
(process.env.NX_PARALLEL && args['parallel'] === undefined)) {
|
309
|
-
return
|
310
|
+
return concurrency(args['maxParallel'] ||
|
310
311
|
args['max-parallel'] ||
|
311
312
|
process.env.NX_PARALLEL ||
|
312
|
-
3);
|
313
|
+
'3');
|
313
314
|
}
|
314
315
|
else if (args['parallel'] !== undefined) {
|
315
|
-
return
|
316
|
+
return concurrency(args['parallel']);
|
316
317
|
}
|
317
318
|
}
|
318
319
|
const coerceTuiAutoExit = (value) => {
|
@@ -328,3 +329,11 @@ const coerceTuiAutoExit = (value) => {
|
|
328
329
|
}
|
329
330
|
throw new Error(`Invalid value for --tui-auto-exit: ${value}`);
|
330
331
|
};
|
332
|
+
function concurrency(val) {
|
333
|
+
let parallel = typeof val === 'number' ? val : parseInt(val);
|
334
|
+
if (typeof val === 'string' && val.at(-1) === '%') {
|
335
|
+
const maxCores = (0, node_os_1.availableParallelism)?.() ?? (0, node_os_1.cpus)().length;
|
336
|
+
parallel = (maxCores * parallel) / 100;
|
337
|
+
}
|
338
|
+
return Math.max(1, Math.floor(parallel));
|
339
|
+
}
|