nx 21.1.0-beta.0 → 21.1.0-canary.20250507-30a7709
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/nx.js +20 -1
- package/package.json +11 -11
- package/src/command-line/affected/command-object.js +1 -1
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/yargs-utils/shared-options.js +4 -13
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/executors/run-commands/running-tasks.js +1 -1
- package/src/executors/run-script/run-script.impl.js +1 -2
- package/src/native/index.d.ts +1 -5
- package/src/native/native-bindings.js +0 -2
- package/src/native/nx.wasi-browser.js +37 -41
- package/src/native/nx.wasi.cjs +37 -41
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -1
- package/src/tasks-runner/forked-process-task-runner.d.ts +0 -1
- package/src/tasks-runner/forked-process-task-runner.js +12 -15
- package/src/tasks-runner/life-cycle.d.ts +2 -2
- package/src/tasks-runner/life-cycle.js +2 -2
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +9 -23
- package/src/tasks-runner/pseudo-terminal.d.ts +1 -1
- package/src/tasks-runner/pseudo-terminal.js +13 -5
- package/src/tasks-runner/run-command.js +4 -15
- package/src/tasks-runner/task-orchestrator.js +2 -9
- package/src/utils/exit-codes.d.ts +0 -4
- package/src/utils/exit-codes.js +0 -16
- package/src/utils/find-matching-projects.js +1 -1
package/bin/nx.js
CHANGED
@@ -17,6 +17,7 @@ const perf_hooks_1 = require("perf_hooks");
|
|
17
17
|
const workspace_context_1 = require("../src/utils/workspace-context");
|
18
18
|
const client_1 = require("../src/daemon/client/client");
|
19
19
|
const db_connection_1 = require("../src/utils/db-connection");
|
20
|
+
const exit_codes_1 = require("../src/utils/exit-codes");
|
20
21
|
// In case Nx Cloud forcibly exits while the TUI is running, ensure the terminal is restored etc.
|
21
22
|
process.on('exit', (...args) => {
|
22
23
|
if (typeof globalThis.tuiOnProcessExit === 'function') {
|
@@ -220,7 +221,25 @@ const getLatestVersionOfNx = ((fn) => {
|
|
220
221
|
let cache = null;
|
221
222
|
return () => cache || (cache = fn());
|
222
223
|
})(_getLatestVersionOfNx);
|
223
|
-
|
224
|
+
function nxCleanup(signal) {
|
224
225
|
(0, db_connection_1.removeDbConnections)();
|
226
|
+
if (signal) {
|
227
|
+
process.exit((0, exit_codes_1.signalToCode)(signal));
|
228
|
+
}
|
229
|
+
else {
|
230
|
+
process.exit();
|
231
|
+
}
|
232
|
+
}
|
233
|
+
process.on('exit', () => {
|
234
|
+
nxCleanup();
|
235
|
+
});
|
236
|
+
process.on('SIGINT', () => {
|
237
|
+
nxCleanup('SIGINT');
|
238
|
+
});
|
239
|
+
process.on('SIGTERM', () => {
|
240
|
+
nxCleanup('SIGTERM');
|
241
|
+
});
|
242
|
+
process.on('SIGHUP', () => {
|
243
|
+
nxCleanup('SIGHUP');
|
225
244
|
});
|
226
245
|
main();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.1.0-
|
3
|
+
"version": "21.1.0-canary.20250507-30a7709",
|
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.1.0-
|
87
|
-
"@nx/nx-darwin-x64": "21.1.0-
|
88
|
-
"@nx/nx-freebsd-x64": "21.1.0-
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.1.0-
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.1.0-
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.1.0-
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.1.0-
|
93
|
-
"@nx/nx-linux-x64-musl": "21.1.0-
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.1.0-
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.1.0-
|
86
|
+
"@nx/nx-darwin-arm64": "21.1.0-canary.20250507-30a7709",
|
87
|
+
"@nx/nx-darwin-x64": "21.1.0-canary.20250507-30a7709",
|
88
|
+
"@nx/nx-freebsd-x64": "21.1.0-canary.20250507-30a7709",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.1.0-canary.20250507-30a7709",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.1.0-canary.20250507-30a7709",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.1.0-canary.20250507-30a7709",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.1.0-canary.20250507-30a7709",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.1.0-canary.20250507-30a7709",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.1.0-canary.20250507-30a7709",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.1.0-canary.20250507-30a7709"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -6,7 +6,7 @@ const documentation_1 = require("../yargs-utils/documentation");
|
|
6
6
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
7
7
|
exports.yargsAffectedCommand = {
|
8
8
|
command: 'affected',
|
9
|
-
describe: 'Run target for affected projects.
|
9
|
+
describe: 'Run target for affected projects.',
|
10
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTuiOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs))))))
|
11
11
|
.option('all', {
|
12
12
|
type: 'boolean',
|
@@ -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/
|
41
|
+
? 'https://nx.dev/tutorials/2-react-monorepo/1r-introduction/1-welcome'
|
42
42
|
: 'https://nx.dev/getting-started/tutorials/react-standalone-tutorial',
|
43
43
|
});
|
44
44
|
return;
|
@@ -17,7 +17,6 @@ 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");
|
21
20
|
exports.defaultYargsParserConfiguration = {
|
22
21
|
'strip-dashed': true,
|
23
22
|
'unknown-options-as-args': true,
|
@@ -305,15 +304,15 @@ function readParallelFromArgsAndEnv(args) {
|
|
305
304
|
else if (args['parallel'] === 'true' ||
|
306
305
|
args['parallel'] === true ||
|
307
306
|
args['parallel'] === '' ||
|
308
|
-
//
|
307
|
+
// dont require passing --parallel if NX_PARALLEL is set, but allow overriding it
|
309
308
|
(process.env.NX_PARALLEL && args['parallel'] === undefined)) {
|
310
|
-
return
|
309
|
+
return Number(args['maxParallel'] ||
|
311
310
|
args['max-parallel'] ||
|
312
311
|
process.env.NX_PARALLEL ||
|
313
|
-
|
312
|
+
3);
|
314
313
|
}
|
315
314
|
else if (args['parallel'] !== undefined) {
|
316
|
-
return
|
315
|
+
return Number(args['parallel']);
|
317
316
|
}
|
318
317
|
}
|
319
318
|
const coerceTuiAutoExit = (value) => {
|
@@ -329,11 +328,3 @@ const coerceTuiAutoExit = (value) => {
|
|
329
328
|
}
|
330
329
|
throw new Error(`Invalid value for --tui-auto-exit: ${value}`);
|
331
330
|
};
|
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
|
-
}
|