nx 22.1.0-canary.20251111-647d751 → 22.1.0-canary.20251114-b3e6b03
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.d.ts.map +1 -1
- package/bin/init-local.js +40 -2
- package/executors.json +16 -16
- package/generators.json +13 -13
- package/migrations.json +143 -143
- package/package.json +14 -11
- package/presets/npm.json +4 -4
- package/schemas/nx-schema.json +1285 -1285
- package/schemas/project-schema.json +359 -359
- package/schemas/workspace-schema.json +165 -165
- package/src/ai/set-up-ai-agents/schema.json +31 -31
- package/src/command-line/add/add.d.ts.map +1 -1
- package/src/command-line/add/add.js +5 -2
- package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
- package/src/command-line/configure-ai-agents/configure-ai-agents.js +3 -1
- package/src/command-line/init/command-object.d.ts.map +1 -1
- package/src/command-line/init/command-object.js +10 -0
- package/src/command-line/init/init-v2.d.ts +1 -1
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +29 -1
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +2 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/daemon/client/client.d.ts +3 -0
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +14 -0
- package/src/daemon/message-types/nx-console.d.ts +18 -0
- package/src/daemon/message-types/nx-console.d.ts.map +1 -0
- package/src/daemon/message-types/nx-console.js +19 -0
- package/src/daemon/server/handle-nx-console.d.ts +4 -0
- package/src/daemon/server/handle-nx-console.d.ts.map +1 -0
- package/src/daemon/server/handle-nx-console.js +54 -0
- package/src/daemon/server/nx-console-operations.d.ts +31 -0
- package/src/daemon/server/nx-console-operations.d.ts.map +1 -0
- package/src/daemon/server/nx-console-operations.js +135 -0
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +12 -0
- package/src/daemon/server/shutdown-utils.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +3 -0
- package/src/devkit-internals.d.ts +1 -1
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +2 -1
- package/src/executors/noop/schema.json +8 -8
- package/src/executors/run-commands/schema.json +187 -187
- package/src/executors/run-script/schema.json +25 -25
- package/src/native/index.d.ts +37 -34
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasi-browser.js +53 -45
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +38 -38
- package/src/tasks-runner/process-metrics-service.d.ts +2 -2
- package/src/tasks-runner/process-metrics-service.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +10 -3
- package/src/utils/package-json.d.ts +4 -0
- package/src/utils/package-json.d.ts.map +1 -1
- package/src/utils/package-json.js +45 -11
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNxConsoleStatus = getNxConsoleStatus;
|
|
4
|
+
exports.handleNxConsolePreferenceAndInstall = handleNxConsolePreferenceAndInstall;
|
|
5
|
+
exports.cleanupLatestNxInstallation = cleanupLatestNxInstallation;
|
|
6
|
+
exports.getNxConsoleStatusImpl = getNxConsoleStatusImpl;
|
|
7
|
+
exports.handleNxConsolePreferenceAndInstallImpl = handleNxConsolePreferenceAndInstallImpl;
|
|
8
|
+
const devkit_internals_1 = require("../../devkit-internals");
|
|
9
|
+
const os_1 = require("os");
|
|
10
|
+
const native_1 = require("../../native");
|
|
11
|
+
const logger_1 = require("./logger");
|
|
12
|
+
// Module-level state - persists across invocations within daemon lifecycle
|
|
13
|
+
let latestNxTmpPath = null;
|
|
14
|
+
let cleanupFn = null;
|
|
15
|
+
const log = (...messageParts) => {
|
|
16
|
+
logger_1.serverLogger.log('[NX-CONSOLE]:', ...messageParts);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Gets the Nx Console status (whether we should prompt the user to install).
|
|
20
|
+
* Uses latest Nx version if available, falls back to local implementation.
|
|
21
|
+
*
|
|
22
|
+
* @returns boolean indicating whether we should prompt the user
|
|
23
|
+
*/
|
|
24
|
+
async function getNxConsoleStatus({ inner, } = {}) {
|
|
25
|
+
// Use local implementation if explicitly requested
|
|
26
|
+
if (process.env.NX_USE_LOCAL === 'true' || inner === true) {
|
|
27
|
+
log('Using local implementation (NX_USE_LOCAL=true or inner call)');
|
|
28
|
+
return await getNxConsoleStatusImpl();
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
// If we don't have a tmp path yet, pull latest Nx
|
|
32
|
+
if (latestNxTmpPath === null) {
|
|
33
|
+
log('Pulling latest Nx (latest) to check console status...');
|
|
34
|
+
const packageInstallResults = await (0, devkit_internals_1.installPackageToTmpAsync)('nx', 'latest');
|
|
35
|
+
latestNxTmpPath = packageInstallResults.tempDir;
|
|
36
|
+
cleanupFn = packageInstallResults.cleanup;
|
|
37
|
+
log('Successfully pulled latest Nx to', latestNxTmpPath);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
log('Reusing cached Nx installation from', latestNxTmpPath);
|
|
41
|
+
}
|
|
42
|
+
// Try to use the cached tmp path
|
|
43
|
+
const modulePath = require.resolve('nx/src/daemon/server/nx-console-operations.js', { paths: [latestNxTmpPath] });
|
|
44
|
+
const module = await Promise.resolve(`${modulePath}`).then(s => require(s));
|
|
45
|
+
const result = await module.getNxConsoleStatus({ inner: true });
|
|
46
|
+
log('Console status check completed, shouldPrompt:', result);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
// If tmp path failed (e.g., directory was deleted), fall back to local immediately
|
|
51
|
+
log('Failed to use latest Nx, falling back to local implementation. Error:', error.message);
|
|
52
|
+
return await getNxConsoleStatusImpl();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Handles user preference submission and installs Nx Console if requested.
|
|
57
|
+
* Uses latest Nx version if available, falls back to local implementation.
|
|
58
|
+
*
|
|
59
|
+
* @param preference - whether the user wants to install Nx Console
|
|
60
|
+
* @returns object indicating whether installation succeeded
|
|
61
|
+
*/
|
|
62
|
+
async function handleNxConsolePreferenceAndInstall({ preference, inner, }) {
|
|
63
|
+
log('Handling user preference:', preference);
|
|
64
|
+
// Use local implementation if explicitly requested
|
|
65
|
+
if (process.env.NX_USE_LOCAL === 'true' || inner === true) {
|
|
66
|
+
log('Using local implementation (NX_USE_LOCAL=true or inner call)');
|
|
67
|
+
return await handleNxConsolePreferenceAndInstallImpl(preference);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
// If we don't have a tmp path yet, pull latest Nx
|
|
71
|
+
if (latestNxTmpPath === null) {
|
|
72
|
+
log('Pulling latest Nx (latest) to handle preference and install...');
|
|
73
|
+
const packageInstallResults = await (0, devkit_internals_1.installPackageToTmpAsync)('nx', 'latest');
|
|
74
|
+
latestNxTmpPath = packageInstallResults.tempDir;
|
|
75
|
+
cleanupFn = packageInstallResults.cleanup;
|
|
76
|
+
log('Successfully pulled latest Nx to', latestNxTmpPath);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
log('Reusing cached Nx installation from', latestNxTmpPath);
|
|
80
|
+
}
|
|
81
|
+
// Try to use the cached tmp path
|
|
82
|
+
const modulePath = require.resolve('nx/src/daemon/server/nx-console-operations.js', { paths: [latestNxTmpPath] });
|
|
83
|
+
const module = await Promise.resolve(`${modulePath}`).then(s => require(s));
|
|
84
|
+
const result = await module.handleNxConsolePreferenceAndInstall({
|
|
85
|
+
preference,
|
|
86
|
+
inner: true,
|
|
87
|
+
});
|
|
88
|
+
log('Preference saved and installation', result.installed ? 'succeeded' : 'skipped/failed');
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
// If tmp path failed (e.g., directory was deleted), fall back to local immediately
|
|
93
|
+
log('Failed to use latest Nx, falling back to local implementation. Error:', error.message);
|
|
94
|
+
return await handleNxConsolePreferenceAndInstallImpl(preference);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Clean up the latest Nx installation on daemon shutdown.
|
|
99
|
+
*/
|
|
100
|
+
function cleanupLatestNxInstallation() {
|
|
101
|
+
if (cleanupFn) {
|
|
102
|
+
log('Cleaning up latest Nx installation from', latestNxTmpPath);
|
|
103
|
+
cleanupFn();
|
|
104
|
+
}
|
|
105
|
+
latestNxTmpPath = null;
|
|
106
|
+
cleanupFn = null;
|
|
107
|
+
}
|
|
108
|
+
async function getNxConsoleStatusImpl() {
|
|
109
|
+
// If no cached preference, read from disk
|
|
110
|
+
const preferences = new native_1.NxConsolePreferences((0, os_1.homedir)());
|
|
111
|
+
const preference = preferences.getAutoInstallPreference();
|
|
112
|
+
const canInstallConsole = (0, native_1.canInstallNxConsole)();
|
|
113
|
+
// If user previously opted in but extension is not installed,
|
|
114
|
+
// they must have manually uninstalled it - respect that choice
|
|
115
|
+
if (preference === true && canInstallConsole) {
|
|
116
|
+
const preferences = new native_1.NxConsolePreferences((0, os_1.homedir)());
|
|
117
|
+
preferences.setAutoInstallPreference(false);
|
|
118
|
+
return false; // Don't prompt
|
|
119
|
+
}
|
|
120
|
+
// Noop if can't install
|
|
121
|
+
if (!canInstallConsole) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
// Prompt if we can install and user hasn't answered yet
|
|
125
|
+
return typeof preference !== 'boolean';
|
|
126
|
+
}
|
|
127
|
+
async function handleNxConsolePreferenceAndInstallImpl(preference) {
|
|
128
|
+
const preferences = new native_1.NxConsolePreferences((0, os_1.homedir)());
|
|
129
|
+
preferences.setAutoInstallPreference(preference);
|
|
130
|
+
let installed = false;
|
|
131
|
+
if (preference) {
|
|
132
|
+
installed = (0, native_1.installNxConsole)();
|
|
133
|
+
}
|
|
134
|
+
return { installed };
|
|
135
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAgKnD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACtC,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CAAa,CAAC;AAyRlD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EAClC,IAAI,EAAE,MAAM,GAAG,IAAI,iBAyBpB;AAoMD,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAqEnD"}
|
|
@@ -54,6 +54,8 @@ const handle_flush_sync_generator_changes_to_disk_1 = require("./handle-flush-sy
|
|
|
54
54
|
const run_tasks_execution_hooks_1 = require("../message-types/run-tasks-execution-hooks");
|
|
55
55
|
const handle_tasks_execution_hooks_1 = require("./handle-tasks-execution-hooks");
|
|
56
56
|
const register_project_graph_listener_1 = require("../message-types/register-project-graph-listener");
|
|
57
|
+
const nx_console_1 = require("../message-types/nx-console");
|
|
58
|
+
const handle_nx_console_1 = require("./handle-nx-console");
|
|
57
59
|
const v8_1 = require("v8");
|
|
58
60
|
let performanceObserver;
|
|
59
61
|
let workspaceWatcherError;
|
|
@@ -193,6 +195,12 @@ async function handleMessage(socket, data) {
|
|
|
193
195
|
else if ((0, run_tasks_execution_hooks_1.isHandlePostTasksExecutionMessage)(payload)) {
|
|
194
196
|
await handleResult(socket, run_tasks_execution_hooks_1.POST_TASKS_EXECUTION, () => (0, handle_tasks_execution_hooks_1.handleRunPostTasksExecution)(payload.context), mode);
|
|
195
197
|
}
|
|
198
|
+
else if ((0, nx_console_1.isHandleGetNxConsoleStatusMessage)(payload)) {
|
|
199
|
+
await handleResult(socket, nx_console_1.GET_NX_CONSOLE_STATUS, () => (0, handle_nx_console_1.handleGetNxConsoleStatus)(), mode);
|
|
200
|
+
}
|
|
201
|
+
else if ((0, nx_console_1.isHandleSetNxConsolePreferenceAndInstallMessage)(payload)) {
|
|
202
|
+
await handleResult(socket, nx_console_1.SET_NX_CONSOLE_PREFERENCE_AND_INSTALL, () => (0, handle_nx_console_1.handleSetNxConsolePreferenceAndInstall)(payload.preference), mode);
|
|
203
|
+
}
|
|
196
204
|
else {
|
|
197
205
|
await (0, shutdown_utils_1.respondWithErrorAndExit)(socket, `Invalid payload from the client`, new Error(`Unsupported payload sent to daemon server: ${unparsedPayload}`));
|
|
198
206
|
}
|
|
@@ -416,6 +424,10 @@ async function startServer() {
|
|
|
416
424
|
(0, project_graph_incremental_recomputation_1.registerProjectGraphRecomputationListener)(sync_generators_1.collectAndScheduleSyncGenerators);
|
|
417
425
|
// trigger an initial project graph recomputation
|
|
418
426
|
(0, project_graph_incremental_recomputation_1.addUpdatedAndDeletedFiles)([], [], []);
|
|
427
|
+
// Kick off Nx Console check in background to prime the cache
|
|
428
|
+
(0, handle_nx_console_1.handleGetNxConsoleStatus)().catch(() => {
|
|
429
|
+
// Ignore errors, this is a background operation
|
|
430
|
+
});
|
|
419
431
|
return resolve(server);
|
|
420
432
|
}
|
|
421
433
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shutdown-utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/shutdown-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAI1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"shutdown-utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/shutdown-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAI1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAU5C,eAAO,MAAM,4BAA4B,EAAG,QAAiB,CAAC;AAI9D,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,QAErD;AAED,wBAAgB,kBAAkB,YAEjC;AAID,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,QAE3D;AAED,wBAAgB,wBAAwB,YAEvC;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,wBAAsB,8BAA8B,CAAC,EACnD,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE,oCAAoC,iBAsCtC;AAID,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAK3D;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,oBAcpB;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,iBAsBb"}
|
|
@@ -17,6 +17,7 @@ const error_types_1 = require("../../project-graph/error-types");
|
|
|
17
17
|
const db_connection_1 = require("../../utils/db-connection");
|
|
18
18
|
const get_plugins_1 = require("../../project-graph/plugins/get-plugins");
|
|
19
19
|
const consume_messages_from_socket_1 = require("../../utils/consume-messages-from-socket");
|
|
20
|
+
const nx_console_operations_1 = require("./nx-console-operations");
|
|
20
21
|
exports.SERVER_INACTIVITY_TIMEOUT_MS = 10800000; // 10800000 ms = 3 hours
|
|
21
22
|
let watcherInstance;
|
|
22
23
|
function storeWatcherInstance(instance) {
|
|
@@ -53,6 +54,8 @@ async function handleServerProcessTermination({ server, reason, sockets, }) {
|
|
|
53
54
|
(0, cache_1.deleteDaemonJsonProcessCache)();
|
|
54
55
|
(0, get_plugins_1.cleanupPlugins)();
|
|
55
56
|
(0, db_connection_1.removeDbConnections)();
|
|
57
|
+
// Clean up Nx Console latest installation
|
|
58
|
+
(0, nx_console_operations_1.cleanupLatestNxInstallation)();
|
|
56
59
|
logger_1.serverLogger.log(`Server stopped because: "${reason}"`);
|
|
57
60
|
}
|
|
58
61
|
finally {
|
|
@@ -15,7 +15,7 @@ export { splitTarget } from './utils/split-target';
|
|
|
15
15
|
export { combineOptionsForExecutor } from './utils/params';
|
|
16
16
|
export { sortObjectByKeys } from './utils/object-sort';
|
|
17
17
|
export { stripIndent } from './utils/logger';
|
|
18
|
-
export { readModulePackageJson, installPackageToTmp, } from './utils/package-json';
|
|
18
|
+
export { readModulePackageJson, installPackageToTmp, installPackageToTmpAsync, } from './utils/package-json';
|
|
19
19
|
export { splitByColons } from './utils/split-target';
|
|
20
20
|
export { hashObject } from './hasher/file-hasher';
|
|
21
21
|
export { hashWithWorkspaceContext, hashMultiGlobWithWorkspaceContext, } from './utils/workspace-context';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devkit-internals.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-internals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gDAAgD,EAAE,MAAM,gDAAgD,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EACL,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"devkit-internals.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-internals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gDAAgD,EAAE,MAAM,gDAAgD,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EACL,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kDAAkD,EAClD,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/src/devkit-internals.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signalToCode = exports.globalSpinner = exports.readYamlFile = exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.getIgnoreObjectForTree = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
|
3
|
+
exports.signalToCode = exports.globalSpinner = exports.readYamlFile = exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmpAsync = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.getIgnoreObjectForTree = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Note to developers: STOP! These exports are available via requireNx in @nx/devkit.
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "stripIndent", { enumerable: true, get: function
|
|
|
36
36
|
var package_json_1 = require("./utils/package-json");
|
|
37
37
|
Object.defineProperty(exports, "readModulePackageJson", { enumerable: true, get: function () { return package_json_1.readModulePackageJson; } });
|
|
38
38
|
Object.defineProperty(exports, "installPackageToTmp", { enumerable: true, get: function () { return package_json_1.installPackageToTmp; } });
|
|
39
|
+
Object.defineProperty(exports, "installPackageToTmpAsync", { enumerable: true, get: function () { return package_json_1.installPackageToTmpAsync; } });
|
|
39
40
|
var split_target_2 = require("./utils/split-target");
|
|
40
41
|
Object.defineProperty(exports, "splitByColons", { enumerable: true, get: function () { return split_target_2.splitByColons; } });
|
|
41
42
|
var file_hasher_1 = require("./hasher/file-hasher");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "Noop",
|
|
4
|
+
"description": "An executor that does nothing.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"outputCapture": "pipe",
|
|
8
|
+
"properties": {},
|
|
9
|
+
"additionalProperties": true
|
|
10
10
|
}
|
|
@@ -1,198 +1,198 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"type": "object",
|
|
30
|
-
"properties": {
|
|
31
|
-
"command": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "Command to run in child process."
|
|
34
|
-
},
|
|
35
|
-
"forwardAllArgs": {
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"description": "Whether arguments should be forwarded when interpolation is not present."
|
|
38
|
-
},
|
|
39
|
-
"prefix": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"description": "Prefix in front of every line out of the output"
|
|
42
|
-
},
|
|
43
|
-
"prefixColor": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"description": "Color of the prefix",
|
|
46
|
-
"enum": [
|
|
47
|
-
"black",
|
|
48
|
-
"red",
|
|
49
|
-
"green",
|
|
50
|
-
"yellow",
|
|
51
|
-
"blue",
|
|
52
|
-
"magenta",
|
|
53
|
-
"cyan",
|
|
54
|
-
"white"
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
"color": {
|
|
58
|
-
"type": "string",
|
|
59
|
-
"description": "Color of the output",
|
|
60
|
-
"enum": [
|
|
61
|
-
"black",
|
|
62
|
-
"red",
|
|
63
|
-
"green",
|
|
64
|
-
"yellow",
|
|
65
|
-
"blue",
|
|
66
|
-
"magenta",
|
|
67
|
-
"cyan",
|
|
68
|
-
"white"
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
"bgColor": {
|
|
72
|
-
"type": "string",
|
|
73
|
-
"description": "Background color of the output",
|
|
74
|
-
"enum": [
|
|
75
|
-
"bgBlack",
|
|
76
|
-
"bgRed",
|
|
77
|
-
"bgGreen",
|
|
78
|
-
"bgYellow",
|
|
79
|
-
"bgBlue",
|
|
80
|
-
"bgMagenta",
|
|
81
|
-
"bgCyan",
|
|
82
|
-
"bgWhite"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"description": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
"additionalProperties": false,
|
|
91
|
-
"required": ["command"]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"type": "string"
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
"x-priority": "important"
|
|
99
|
-
},
|
|
100
|
-
"command": {
|
|
101
|
-
"oneOf": [
|
|
102
|
-
{
|
|
103
|
-
"type": "array",
|
|
104
|
-
"description": "Command to run in child process, but divided into parts.",
|
|
105
|
-
"items": {
|
|
106
|
-
"type": "string"
|
|
107
|
-
},
|
|
108
|
-
"x-priority": "important"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"type": "string",
|
|
112
|
-
"description": "Command to run in child process."
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"type": "string",
|
|
116
|
-
"description": "Command to run in child process.",
|
|
117
|
-
"x-priority": "important"
|
|
118
|
-
},
|
|
119
|
-
"parallel": {
|
|
120
|
-
"type": "boolean",
|
|
121
|
-
"description": "Run commands in parallel.",
|
|
122
|
-
"default": true,
|
|
123
|
-
"x-priority": "important"
|
|
124
|
-
},
|
|
125
|
-
"readyWhen": {
|
|
126
|
-
"description": "String or array of strings to appear in `stdout` or `stderr` that indicate that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete.",
|
|
127
|
-
"oneOf": [
|
|
128
|
-
{ "type": "string" },
|
|
129
|
-
{ "type": "array", "items": { "type": "string" } }
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
"args": {
|
|
133
|
-
"oneOf": [
|
|
134
|
-
{
|
|
135
|
-
"type": "array",
|
|
136
|
-
"items": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"type": "string"
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
"description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
|
|
145
|
-
},
|
|
146
|
-
"envFile": {
|
|
147
|
-
"type": "string",
|
|
148
|
-
"description": "You may specify a custom .env file path."
|
|
149
|
-
},
|
|
150
|
-
"color": {
|
|
151
|
-
"type": "boolean",
|
|
152
|
-
"description": "Use colors when showing output of command.",
|
|
153
|
-
"default": false
|
|
154
|
-
},
|
|
155
|
-
"cwd": {
|
|
156
|
-
"type": "string",
|
|
157
|
-
"description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
|
|
158
|
-
},
|
|
159
|
-
"env": {
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "Run Commands",
|
|
4
|
+
"description": "Run any custom commands with Nx.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"outputCapture": "pipe",
|
|
8
|
+
"presets": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Arguments forwarding",
|
|
11
|
+
"keys": ["commands"]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Custom done conditions",
|
|
15
|
+
"keys": ["commands", "readyWhen"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Setting the cwd",
|
|
19
|
+
"keys": ["commands", "cwd"]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"commands": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "Commands to run in child process.",
|
|
26
|
+
"items": {
|
|
27
|
+
"oneOf": [
|
|
28
|
+
{
|
|
160
29
|
"type": "object",
|
|
161
|
-
"
|
|
162
|
-
|
|
163
|
-
"type": "string"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
30
|
+
"properties": {
|
|
31
|
+
"command": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Command to run in child process."
|
|
34
|
+
},
|
|
35
|
+
"forwardAllArgs": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "Whether arguments should be forwarded when interpolation is not present."
|
|
38
|
+
},
|
|
39
|
+
"prefix": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Prefix in front of every line out of the output"
|
|
42
|
+
},
|
|
43
|
+
"prefixColor": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Color of the prefix",
|
|
46
|
+
"enum": [
|
|
47
|
+
"black",
|
|
48
|
+
"red",
|
|
49
|
+
"green",
|
|
50
|
+
"yellow",
|
|
51
|
+
"blue",
|
|
52
|
+
"magenta",
|
|
53
|
+
"cyan",
|
|
54
|
+
"white"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"color": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Color of the output",
|
|
60
|
+
"enum": [
|
|
61
|
+
"black",
|
|
62
|
+
"red",
|
|
63
|
+
"green",
|
|
64
|
+
"yellow",
|
|
65
|
+
"blue",
|
|
66
|
+
"magenta",
|
|
67
|
+
"cyan",
|
|
68
|
+
"white"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"bgColor": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Background color of the output",
|
|
74
|
+
"enum": [
|
|
75
|
+
"bgBlack",
|
|
76
|
+
"bgRed",
|
|
77
|
+
"bgGreen",
|
|
78
|
+
"bgYellow",
|
|
79
|
+
"bgBlue",
|
|
80
|
+
"bgMagenta",
|
|
81
|
+
"bgCyan",
|
|
82
|
+
"bgWhite"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"description": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
|
|
88
|
+
}
|
|
174
89
|
},
|
|
175
|
-
"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"
|
|
180
|
-
|
|
90
|
+
"additionalProperties": false,
|
|
91
|
+
"required": ["command"]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"x-priority": "important"
|
|
99
|
+
},
|
|
100
|
+
"command": {
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "array",
|
|
104
|
+
"description": "Command to run in child process, but divided into parts.",
|
|
105
|
+
"items": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"x-priority": "important"
|
|
181
109
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"hidden": true
|
|
110
|
+
{
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "Command to run in child process."
|
|
186
113
|
}
|
|
114
|
+
],
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "Command to run in child process.",
|
|
117
|
+
"x-priority": "important"
|
|
118
|
+
},
|
|
119
|
+
"parallel": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"description": "Run commands in parallel.",
|
|
122
|
+
"default": true,
|
|
123
|
+
"x-priority": "important"
|
|
124
|
+
},
|
|
125
|
+
"readyWhen": {
|
|
126
|
+
"description": "String or array of strings to appear in `stdout` or `stderr` that indicate that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete.",
|
|
127
|
+
"oneOf": [
|
|
128
|
+
{ "type": "string" },
|
|
129
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
130
|
+
]
|
|
187
131
|
},
|
|
188
|
-
"
|
|
189
|
-
|
|
132
|
+
"args": {
|
|
133
|
+
"oneOf": [
|
|
190
134
|
{
|
|
191
|
-
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"type": "string"
|
|
138
|
+
}
|
|
192
139
|
},
|
|
193
140
|
{
|
|
194
|
-
|
|
141
|
+
"type": "string"
|
|
195
142
|
}
|
|
196
|
-
|
|
197
|
-
|
|
143
|
+
],
|
|
144
|
+
"description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
|
|
145
|
+
},
|
|
146
|
+
"envFile": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"description": "You may specify a custom .env file path."
|
|
149
|
+
},
|
|
150
|
+
"color": {
|
|
151
|
+
"type": "boolean",
|
|
152
|
+
"description": "Use colors when showing output of command.",
|
|
153
|
+
"default": false
|
|
154
|
+
},
|
|
155
|
+
"cwd": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
|
|
158
|
+
},
|
|
159
|
+
"env": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"description": "Environment variables that will be made available to the commands. This property has priority over the `.env` files.",
|
|
162
|
+
"additionalProperties": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"__unparsed__": {
|
|
167
|
+
"hidden": true,
|
|
168
|
+
"type": "array",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"$default": {
|
|
173
|
+
"$source": "unparsed"
|
|
174
|
+
},
|
|
175
|
+
"x-priority": "internal"
|
|
176
|
+
},
|
|
177
|
+
"forwardAllArgs": {
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"description": "Whether arguments should be forwarded when interpolation is not present.",
|
|
180
|
+
"default": true
|
|
181
|
+
},
|
|
182
|
+
"tty": {
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"description": "Whether commands should be run with a tty terminal",
|
|
185
|
+
"hidden": true
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": true,
|
|
189
|
+
"oneOf": [
|
|
190
|
+
{
|
|
191
|
+
"required": ["commands"]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"required": ["command"]
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"examplesFile": "../../../docs/run-commands-examples.md"
|
|
198
198
|
}
|