nx 23.0.0-beta.2 → 23.0.0-beta.21
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/dist/bin/init-local.js +11 -20
- package/dist/bin/nx.d.ts +1 -0
- package/dist/bin/nx.js +28 -2
- package/dist/plugins/package-json.js +4 -2
- package/dist/src/adapter/ngcli-adapter.d.ts +2 -1
- package/dist/src/adapter/ngcli-adapter.js +25 -2
- package/dist/src/ai/clone-ai-config-repo.js +20 -3
- package/dist/src/analytics/analytics.js +10 -1
- package/dist/src/command-line/add/completion.d.ts +1 -0
- package/dist/src/command-line/add/completion.js +15 -0
- package/dist/src/command-line/affected/completion.d.ts +1 -0
- package/dist/src/command-line/affected/completion.js +15 -0
- package/dist/src/command-line/completion/argv-layout.d.ts +6 -0
- package/dist/src/command-line/completion/argv-layout.js +19 -0
- package/dist/src/command-line/completion/command-completions.d.ts +19 -0
- package/dist/src/command-line/completion/command-completions.js +120 -0
- package/dist/src/command-line/completion/command-handlers.d.ts +30 -0
- package/dist/src/command-line/completion/command-handlers.js +69 -0
- package/dist/src/command-line/completion/command-object.d.ts +10 -0
- package/dist/src/command-line/completion/command-object.js +95 -0
- package/dist/src/command-line/completion/completion-providers.d.ts +21 -0
- package/dist/src/command-line/completion/completion-providers.js +194 -0
- package/dist/src/command-line/completion/infix-targets.d.ts +1 -0
- package/dist/src/command-line/completion/infix-targets.js +48 -0
- package/dist/src/command-line/completion/metadata.d.ts +22 -0
- package/dist/src/command-line/completion/metadata.js +71 -0
- package/dist/src/command-line/completion/registrations.d.ts +9 -0
- package/dist/src/command-line/completion/registrations.js +16 -0
- package/dist/src/command-line/completion/scripts/bash.sh +51 -0
- package/dist/src/command-line/completion/scripts/fish.fish +47 -0
- package/dist/src/command-line/completion/scripts/powershell.ps1 +52 -0
- package/dist/src/command-line/completion/scripts/zsh.zsh +69 -0
- package/dist/src/command-line/completion/scripts.d.ts +18 -0
- package/dist/src/command-line/completion/scripts.js +140 -0
- package/dist/src/command-line/completion/trigger.d.ts +3 -0
- package/dist/src/command-line/completion/trigger.js +21 -0
- package/dist/src/command-line/completion/value-completions.d.ts +3 -0
- package/dist/src/command-line/completion/value-completions.js +21 -0
- package/dist/src/command-line/examples.js +1 -1
- package/dist/src/command-line/format/format.js +15 -5
- package/dist/src/command-line/generate/completion.d.ts +1 -0
- package/dist/src/command-line/generate/completion.js +9 -0
- package/dist/src/command-line/graph/completion.d.ts +1 -0
- package/dist/src/command-line/graph/completion.js +13 -0
- package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +14 -18
- package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +1 -0
- package/dist/src/command-line/init/implementation/utils.d.ts +7 -1
- package/dist/src/command-line/init/implementation/utils.js +51 -14
- package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +22 -0
- package/dist/src/command-line/migrate/agentic/capture-generator-output.js +100 -0
- package/dist/src/command-line/migrate/agentic/cli-args.d.ts +12 -0
- package/dist/src/command-line/migrate/agentic/cli-args.js +38 -0
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +6 -0
- package/dist/src/command-line/migrate/agentic/definitions.js +98 -0
- package/dist/src/command-line/migrate/agentic/detect-installed.d.ts +10 -0
- package/dist/src/command-line/migrate/agentic/detect-installed.js +68 -0
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +46 -0
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +87 -0
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +63 -0
- package/dist/src/command-line/migrate/agentic/handoff.js +183 -0
- package/dist/src/command-line/migrate/agentic/inception.d.ts +9 -0
- package/dist/src/command-line/migrate/agentic/inception.js +15 -0
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +22 -0
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +50 -0
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +51 -0
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +65 -0
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +44 -0
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +52 -0
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +21 -0
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +26 -0
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +18 -0
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +130 -0
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +46 -0
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +88 -0
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +51 -0
- package/dist/src/command-line/migrate/agentic/run-step.js +121 -0
- package/dist/src/command-line/migrate/agentic/runner.d.ts +33 -0
- package/dist/src/command-line/migrate/agentic/runner.js +442 -0
- package/dist/src/command-line/migrate/agentic/select.d.ts +14 -0
- package/dist/src/command-line/migrate/agentic/select.js +150 -0
- package/dist/src/command-line/migrate/agentic/types.d.ts +102 -0
- package/dist/src/command-line/migrate/agentic/types.js +2 -0
- package/dist/src/command-line/migrate/command-object.d.ts +1 -0
- package/dist/src/command-line/migrate/command-object.js +32 -7
- package/dist/src/command-line/migrate/migrate-commits.d.ts +50 -0
- package/dist/src/command-line/migrate/migrate-commits.js +102 -0
- package/dist/src/command-line/migrate/migrate-output.d.ts +180 -0
- package/dist/src/command-line/migrate/migrate-output.js +258 -0
- package/dist/src/command-line/migrate/migrate.d.ts +122 -12
- package/dist/src/command-line/migrate/migrate.js +1036 -217
- package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
- package/dist/src/command-line/migrate/migration-shape.js +13 -0
- package/dist/src/command-line/migrate/multi-major.d.ts +30 -0
- package/dist/src/command-line/migrate/multi-major.js +185 -0
- package/dist/src/command-line/migrate/prompt-files.d.ts +31 -0
- package/dist/src/command-line/migrate/prompt-files.js +141 -0
- package/dist/src/command-line/migrate/run-migration-process.js +28 -6
- package/dist/src/command-line/migrate/safe-prompt.d.ts +28 -0
- package/dist/src/command-line/migrate/safe-prompt.js +49 -0
- package/dist/src/command-line/migrate/update-filters.d.ts +11 -0
- package/dist/src/command-line/migrate/update-filters.js +44 -0
- package/dist/src/command-line/migrate/version-utils.d.ts +6 -0
- package/dist/src/command-line/migrate/version-utils.js +59 -0
- package/dist/src/command-line/nx-commands.js +9 -0
- package/dist/src/command-line/release/config/config.d.ts +3 -6
- package/dist/src/command-line/release/config/config.js +77 -45
- package/dist/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/dist/src/command-line/release/config/use-legacy-versioning.js +8 -0
- package/dist/src/command-line/release/utils/release-graph.js +2 -3
- package/dist/src/command-line/release/utils/repository-git-tags.js +1 -1
- package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +7 -19
- package/dist/src/command-line/release/version/resolve-current-version.js +1 -1
- package/dist/src/command-line/release/version/version-actions.js +3 -7
- package/dist/src/command-line/report/report.js +2 -2
- package/dist/src/command-line/run/completion.d.ts +1 -0
- package/dist/src/command-line/run/completion.js +7 -0
- package/dist/src/command-line/run-many/completion.d.ts +1 -0
- package/dist/src/command-line/run-many/completion.js +13 -0
- package/dist/src/command-line/show/completion.d.ts +1 -0
- package/dist/src/command-line/show/completion.js +27 -0
- package/dist/src/command-line/show/show-target/info.d.ts +1 -0
- package/dist/src/command-line/show/show-target/info.js +100 -19
- package/dist/src/command-line/watch/command-object.js +24 -4
- package/dist/src/command-line/watch/completion.d.ts +1 -0
- package/dist/src/command-line/watch/completion.js +10 -0
- package/dist/src/command-line/watch/watch.d.ts +7 -0
- package/dist/src/command-line/watch/watch.js +1 -1
- package/dist/src/config/misc-interfaces.d.ts +25 -2
- package/dist/src/config/nx-json.d.ts +43 -56
- package/dist/src/config/schema-utils.d.ts +21 -0
- package/dist/src/config/schema-utils.js +92 -18
- package/dist/src/config/task-graph.d.ts +4 -107
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.css +2 -3
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +1 -1
- package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +1 -1
- package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +1 -1
- package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +9 -0
- package/dist/src/daemon/server/file-watching/route-workspace-changes.js +76 -0
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +45 -11
- package/dist/src/daemon/server/server.js +4 -43
- package/dist/src/daemon/server/start.d.ts +1 -1
- package/dist/src/daemon/server/start.js +2 -0
- package/dist/src/devkit-exports.d.ts +2 -2
- package/dist/src/devkit-internals.d.ts +5 -1
- package/dist/src/devkit-internals.js +17 -1
- package/dist/src/executors/run-commands/running-tasks.d.ts +7 -0
- package/dist/src/executors/run-commands/running-tasks.js +178 -105
- package/dist/src/executors/run-script/run-script.impl.js +3 -10
- package/dist/src/executors/utils/convert-nx-executor.js +1 -1
- package/dist/src/hasher/hash-plan-inspector.d.ts +1 -1
- package/dist/src/hasher/task-hasher.js +6 -4
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +0 -3
- package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +6 -2
- package/dist/src/migrations/update-17-0-0/move-cache-directory.md +31 -0
- package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +20 -4
- package/dist/src/migrations/update-20-0-0/move-use-daemon-process.md +27 -0
- package/dist/src/migrations/update-20-0-1/use-legacy-cache.md +24 -0
- package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.md +49 -0
- package/dist/src/migrations/update-21-0-0/release-version-config-changes.md +54 -0
- package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.md +28 -0
- package/dist/src/migrations/update-21-0-0/remove-legacy-cache.md +22 -0
- package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.md +11 -0
- package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.d.ts +2 -0
- package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +16 -0
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +18 -0
- package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.d.ts +35 -0
- package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.js +139 -0
- package/dist/src/migrations/update-23-0-0/convert-target-defaults-to-array.md +66 -0
- package/dist/src/native/index.d.ts +79 -2
- package/dist/src/native/native-bindings.js +3 -0
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/lock-file/npm-parser.js +37 -19
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +51 -4
- package/dist/src/plugins/js/lock-file/project-graph-pruning.js +12 -4
- package/dist/src/plugins/js/utils/packages.js +1 -1
- package/dist/src/plugins/js/utils/register.d.ts +103 -14
- package/dist/src/plugins/js/utils/register.js +434 -39
- package/dist/src/plugins/js/utils/typescript.d.ts +7 -0
- package/dist/src/plugins/js/utils/typescript.js +39 -0
- package/dist/src/plugins/package-json/create-nodes.d.ts +3 -2
- package/dist/src/plugins/package-json/create-nodes.js +7 -5
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +2 -1
- package/dist/src/project-graph/build-project-graph.d.ts +5 -0
- package/dist/src/project-graph/build-project-graph.js +6 -2
- package/dist/src/project-graph/file-map-utils.d.ts +5 -0
- package/dist/src/project-graph/file-map-utils.js +10 -1
- package/dist/src/project-graph/plugins/get-plugins.d.ts +7 -2
- package/dist/src/project-graph/plugins/get-plugins.js +8 -5
- package/dist/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +2 -0
- package/dist/src/project-graph/plugins/resolve-plugin.d.ts +7 -4
- package/dist/src/project-graph/plugins/resolve-plugin.js +152 -33
- package/dist/src/project-graph/plugins/tasks-execution-hooks.js +4 -2
- package/dist/src/project-graph/plugins/transpiler.d.ts +12 -0
- package/dist/src/project-graph/plugins/transpiler.js +37 -0
- package/dist/src/project-graph/plugins/utils.js +13 -7
- package/dist/src/project-graph/project-graph.js +1 -1
- package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +95 -4
- package/dist/src/project-graph/utils/project-configuration/target-defaults.js +515 -68
- package/dist/src/project-graph/utils/project-configuration-utils.d.ts +13 -5
- package/dist/src/project-graph/utils/project-configuration-utils.js +14 -6
- package/dist/src/project-graph/utils/retrieve-workspace-files.js +1 -1
- package/dist/src/tasks-runner/create-task-graph.d.ts +4 -4
- package/dist/src/tasks-runner/create-task-graph.js +1 -1
- package/dist/src/tasks-runner/default-tasks-runner.d.ts +0 -2
- package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.js +11 -6
- package/dist/src/tasks-runner/init-tasks-runner.d.ts +0 -15
- package/dist/src/tasks-runner/init-tasks-runner.js +0 -63
- package/dist/src/tasks-runner/legacy-depends-on-warning.d.ts +18 -0
- package/dist/src/tasks-runner/legacy-depends-on-warning.js +109 -0
- package/dist/src/tasks-runner/life-cycle.d.ts +7 -8
- package/dist/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +6 -6
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +13 -2
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -5
- package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +11 -2
- package/dist/src/tasks-runner/pseudo-terminal.d.ts +1 -1
- package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
- package/dist/src/tasks-runner/run-command.js +8 -11
- package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +1 -1
- package/dist/src/tasks-runner/running-tasks/batch-process.js +3 -5
- package/dist/src/tasks-runner/running-tasks/node-child-process.d.ts +2 -2
- package/dist/src/tasks-runner/running-tasks/node-child-process.js +5 -7
- package/dist/src/tasks-runner/task-env.d.ts +1 -1
- package/dist/src/tasks-runner/task-env.js +6 -1
- package/dist/src/tasks-runner/task-orchestrator.d.ts +11 -1
- package/dist/src/tasks-runner/task-orchestrator.js +112 -38
- package/dist/src/tasks-runner/tasks-schedule.js +3 -3
- package/dist/src/tasks-runner/utils.d.ts +7 -8
- package/dist/src/tasks-runner/utils.js +23 -27
- package/dist/src/utils/child-process.js +2 -2
- package/dist/src/utils/compile-cache.d.ts +24 -0
- package/dist/src/utils/compile-cache.js +49 -0
- package/dist/src/utils/enable-compile-cache.d.ts +1 -0
- package/dist/src/utils/enable-compile-cache.js +7 -0
- package/dist/src/utils/fileutils.d.ts +0 -8
- package/dist/src/utils/fileutils.js +0 -40
- package/dist/src/utils/git-utils.d.ts +15 -0
- package/dist/src/utils/git-utils.js +138 -0
- package/dist/src/utils/handle-import.d.ts +4 -1
- package/dist/src/utils/handle-import.js +56 -2
- package/dist/src/utils/has-nx-js-plugin.d.ts +9 -0
- package/dist/src/utils/has-nx-js-plugin.js +24 -0
- package/dist/src/utils/installed-nx-version.d.ts +14 -4
- package/dist/src/utils/installed-nx-version.js +54 -7
- package/dist/src/utils/logger.d.ts +12 -1
- package/dist/src/utils/logger.js +57 -36
- package/dist/src/utils/nx-key.d.ts +0 -1
- package/dist/src/utils/nx-key.js +20 -23
- package/dist/src/utils/nx-package-group.d.ts +8 -0
- package/dist/src/utils/nx-package-group.js +15 -0
- package/dist/src/utils/output.d.ts +3 -2
- package/dist/src/utils/output.js +29 -28
- package/dist/src/utils/package-json.d.ts +14 -1
- package/dist/src/utils/package-json.js +20 -21
- package/dist/src/utils/perf-logging.js +3 -1
- package/dist/src/utils/plugin-cache-utils.d.ts +13 -4
- package/dist/src/utils/plugin-cache-utils.js +23 -13
- package/dist/src/utils/plugins/local-plugins.d.ts +18 -0
- package/dist/src/utils/plugins/local-plugins.js +30 -0
- package/dist/src/utils/tar.d.ts +8 -0
- package/dist/src/utils/tar.js +44 -0
- package/migrations.json +16 -0
- package/package.json +28 -28
- package/schemas/nx-schema.json +114 -80
- package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +0 -7
- package/dist/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +0 -155
- package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +0 -16
- package/dist/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +0 -121
|
@@ -169,11 +169,19 @@ function mergeCreateNodesResultsFromSinglePlugin(pluginResults, mergeFn, nodesMa
|
|
|
169
169
|
/**
|
|
170
170
|
* Merges create nodes results into a single rootMap.
|
|
171
171
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
172
|
+
* Specified plugin results are merged once into the manager. Default
|
|
173
|
+
* plugin results are first staged into an intermediate rootMap (with
|
|
174
|
+
* `'...'` spreads deferred) so that synthesis can read each layer's
|
|
175
|
+
* contribution without re-running the merge. The synthetic result from
|
|
176
|
+
* `createTargetDefaultsResults` is then merged into the manager, and
|
|
177
|
+
* the staged intermediate is replayed on top — that replay is where
|
|
178
|
+
* deferred spreads expand against the final (specified + synth) base.
|
|
179
|
+
*
|
|
180
|
+
* Synthesis itself doesn't materialize a second rootMap. Per
|
|
181
|
+
* (root, target) it does an on-the-fly merge of the two layered
|
|
182
|
+
* contributions to learn the eventual executor/command, then matches
|
|
183
|
+
* defaults against that merged shape. This keeps specified-plugin
|
|
184
|
+
* merge work to a single pass.
|
|
177
185
|
*/
|
|
178
186
|
function mergeCreateNodesResults(specifiedResults, defaultResults, nxJsonConfiguration, workspaceRoot, errors) {
|
|
179
187
|
perf_hooks_1.performance.mark('createNodes:merge - start');
|
|
@@ -194,7 +202,7 @@ function mergeCreateNodesResults(specifiedResults, defaultResults, nxJsonConfigu
|
|
|
194
202
|
for (const pluginResults of defaultResults) {
|
|
195
203
|
mergeCreateNodesResultsFromSinglePlugin(pluginResults, mergeToIntermediate, nodesManager, intermediateDefaultRootMap, externalNodes, errors);
|
|
196
204
|
}
|
|
197
|
-
const targetDefaultsResults = (0, target_defaults_1.createTargetDefaultsResults)(nodesManager.getRootMap(), intermediateDefaultRootMap, nxJsonConfiguration);
|
|
205
|
+
const targetDefaultsResults = (0, target_defaults_1.createTargetDefaultsResults)(nodesManager.getRootMap(), intermediateDefaultRootMap, nxJsonConfiguration, configurationSourceMaps, defaultConfigurationSourceMaps);
|
|
198
206
|
if (targetDefaultsResults.length > 0) {
|
|
199
207
|
mergeCreateNodesResultsFromSinglePlugin(targetDefaultsResults, mergeToManager, nodesManager, nodesManager.getRootMap(), externalNodes, errors);
|
|
200
208
|
}
|
|
@@ -65,7 +65,7 @@ async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, n
|
|
|
65
65
|
(typeof p === 'object' && p.plugin === angular_json_1.NX_ANGULAR_JSON_PLUGIN_NAME))) {
|
|
66
66
|
pluginsToLoad.push((0, path_1.join)(__dirname, '../../adapter/angular-json'));
|
|
67
67
|
}
|
|
68
|
-
const separatedPlugins = await (0, get_plugins_1.getPluginsSeparated)(workspaceRoot);
|
|
68
|
+
const separatedPlugins = await (0, get_plugins_1.getPluginsSeparated)(nxJson, workspaceRoot);
|
|
69
69
|
const res = await retrieveProjectConfigurations(separatedPlugins, workspaceRoot, nxJson);
|
|
70
70
|
return res;
|
|
71
71
|
}
|
|
@@ -16,16 +16,16 @@ export declare class ProcessTasks {
|
|
|
16
16
|
};
|
|
17
17
|
private readonly allTargetNames;
|
|
18
18
|
constructor(extraTargetDependencies: TargetDependencies, projectGraph: ProjectGraph);
|
|
19
|
-
processTasks(projectNames: string[], targets: string[], configuration: string, overrides:
|
|
20
|
-
processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides:
|
|
19
|
+
processTasks(projectNames: string[], targets: string[], configuration: string, overrides: Record<string, unknown>, excludeTaskDependencies: boolean): string[];
|
|
20
|
+
processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides: Record<string, unknown>): void;
|
|
21
21
|
private processTasksForMultipleProjects;
|
|
22
22
|
private processTasksForSingleProject;
|
|
23
23
|
private processTasksForDependencies;
|
|
24
24
|
private createDummyTask;
|
|
25
|
-
createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides:
|
|
25
|
+
createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides: Record<string, unknown>): Task;
|
|
26
26
|
resolveConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string | undefined): string;
|
|
27
27
|
}
|
|
28
|
-
export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides:
|
|
28
|
+
export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Record<string, unknown>, excludeTaskDependencies?: boolean): TaskGraph;
|
|
29
29
|
export declare function mapTargetDefaultsToDependencies(defaults: TargetDefaults | undefined): TargetDependencies;
|
|
30
30
|
/**
|
|
31
31
|
* This function is used to filter out the dummy tasks from the dependencies
|
|
@@ -205,7 +205,7 @@ class ProcessTasks {
|
|
|
205
205
|
projectRoot: project.data.root,
|
|
206
206
|
overrides: interpolatedOverrides,
|
|
207
207
|
outputs: (0, utils_1.getOutputs)(this.projectGraph.nodes, qualifiedTarget, interpolatedOverrides),
|
|
208
|
-
cache: project.data.targets[target].cache,
|
|
208
|
+
cache: project.data.targets[target].cache ?? false,
|
|
209
209
|
parallelism: project.data.targets[target].parallelism ?? true,
|
|
210
210
|
continuous: project.data.targets[target].continuous ?? false,
|
|
211
211
|
};
|
|
@@ -12,8 +12,6 @@ export declare abstract class RemoteCacheV2 {
|
|
|
12
12
|
}
|
|
13
13
|
export interface DefaultTasksRunnerOptions {
|
|
14
14
|
parallel?: number;
|
|
15
|
-
cacheableOperations?: string[];
|
|
16
|
-
cacheableTargets?: string[];
|
|
17
15
|
runtimeCacheInputs?: string[];
|
|
18
16
|
cacheDirectory?: string;
|
|
19
17
|
remoteCache?: RemoteCache;
|
|
@@ -37,6 +37,6 @@ export declare class ForkedProcessTaskRunner {
|
|
|
37
37
|
private forkProcessWithPrefixAndNotTTY;
|
|
38
38
|
private forkProcessDirectOutputCapture;
|
|
39
39
|
private writeTerminalOutput;
|
|
40
|
-
cleanup(signal?: NodeJS.Signals): void
|
|
40
|
+
cleanup(signal?: NodeJS.Signals): Promise<void>;
|
|
41
41
|
private setupProcessEventListeners;
|
|
42
42
|
}
|
|
@@ -264,10 +264,8 @@ class ForkedProcessTaskRunner {
|
|
|
264
264
|
writeTerminalOutput(outputPath, content) {
|
|
265
265
|
(0, fs_1.writeFileSync)(outputPath, content);
|
|
266
266
|
}
|
|
267
|
-
cleanup(signal) {
|
|
268
|
-
this.processes.
|
|
269
|
-
p.kill(signal);
|
|
270
|
-
});
|
|
267
|
+
async cleanup(signal) {
|
|
268
|
+
await Promise.all([...this.processes].map((p) => p.kill(signal)));
|
|
271
269
|
this.cleanUpBatchProcesses();
|
|
272
270
|
}
|
|
273
271
|
setupProcessEventListeners() {
|
|
@@ -283,12 +281,19 @@ class ForkedProcessTaskRunner {
|
|
|
283
281
|
};
|
|
284
282
|
// When the nx process gets a message, it will be sent into the task's process
|
|
285
283
|
process.on('message', messageHandler);
|
|
286
|
-
// Terminate any task processes on exit
|
|
284
|
+
// Terminate any task processes on exit (sync, last resort).
|
|
285
|
+
// cleanup() is async but the initial signal dispatch is synchronous
|
|
286
|
+
// (killProcessTreeGraceful snapshots and signals before the async
|
|
287
|
+
// grace period). The grace period won't complete here, but each
|
|
288
|
+
// child also has its own sync exit handler as a final fallback.
|
|
287
289
|
process.once('exit', () => {
|
|
288
290
|
this.cleanup();
|
|
289
291
|
process.off('message', messageHandler);
|
|
290
292
|
});
|
|
291
|
-
//
|
|
293
|
+
// No SIGINT/SIGTERM/SIGHUP handlers here. The orchestrator's
|
|
294
|
+
// setupSignalHandlers() owns signal dispatch and calls FPTR.cleanup()
|
|
295
|
+
// in the direct path; in the forked path the process is detached
|
|
296
|
+
// and never receives these signals from the OS.
|
|
292
297
|
}
|
|
293
298
|
}
|
|
294
299
|
exports.ForkedProcessTaskRunner = ForkedProcessTaskRunner;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import type { NxJsonConfiguration } from '../config/nx-json';
|
|
2
|
-
import { NxArgs } from '../utils/command-line-utils';
|
|
3
2
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
4
3
|
import { LifeCycle, TaskResult } from './life-cycle';
|
|
5
4
|
import type { ProjectGraph } from '../config/project-graph';
|
|
6
5
|
import { RunningTask } from './running-tasks/running-task';
|
|
7
|
-
/**
|
|
8
|
-
* This function is deprecated. Do not use this
|
|
9
|
-
* @deprecated This function is deprecated. Do not use this
|
|
10
|
-
*/
|
|
11
|
-
export declare function initTasksRunner(nxArgs: NxArgs): Promise<{
|
|
12
|
-
invoke: (opts: {
|
|
13
|
-
tasks: Task[];
|
|
14
|
-
parallel: number;
|
|
15
|
-
}) => Promise<{
|
|
16
|
-
status: NodeJS.Process["exitCode"];
|
|
17
|
-
taskGraph: TaskGraph;
|
|
18
|
-
taskResults: Record<string, TaskResult>;
|
|
19
|
-
}>;
|
|
20
|
-
}>;
|
|
21
6
|
export declare function runDiscreteTasks(tasks: Task[], projectGraph: ProjectGraph, taskGraphForHashing: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle): Promise<Array<Promise<TaskResult[]>>>;
|
|
22
7
|
export declare function runContinuousTasks(tasks: Task[], projectGraph: ProjectGraph, taskGraphForHashing: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle): Promise<Record<string, Promise<RunningTask>>>;
|
|
@@ -1,78 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initTasksRunner = initTasksRunner;
|
|
4
3
|
exports.runDiscreteTasks = runDiscreteTasks;
|
|
5
4
|
exports.runContinuousTasks = runContinuousTasks;
|
|
6
|
-
const nx_json_1 = require("../config/nx-json");
|
|
7
|
-
const project_graph_1 = require("../project-graph/project-graph");
|
|
8
5
|
const run_command_1 = require("./run-command");
|
|
9
6
|
const invoke_runner_terminal_output_life_cycle_1 = require("./life-cycles/invoke-runner-terminal-output-life-cycle");
|
|
10
|
-
const perf_hooks_1 = require("perf_hooks");
|
|
11
|
-
const utils_1 = require("./utils");
|
|
12
7
|
const dotenv_1 = require("../utils/dotenv");
|
|
13
8
|
const life_cycle_1 = require("./life-cycle");
|
|
14
9
|
const task_orchestrator_1 = require("./task-orchestrator");
|
|
15
10
|
const create_task_hasher_1 = require("../hasher/create-task-hasher");
|
|
16
11
|
const client_1 = require("../daemon/client/client");
|
|
17
12
|
const task_results_life_cycle_1 = require("./life-cycles/task-results-life-cycle");
|
|
18
|
-
/**
|
|
19
|
-
* This function is deprecated. Do not use this
|
|
20
|
-
* @deprecated This function is deprecated. Do not use this
|
|
21
|
-
*/
|
|
22
|
-
async function initTasksRunner(nxArgs) {
|
|
23
|
-
perf_hooks_1.performance.mark('init-local');
|
|
24
|
-
(0, dotenv_1.loadRootEnvFiles)();
|
|
25
|
-
const nxJson = (0, nx_json_1.readNxJson)();
|
|
26
|
-
if (nxArgs.verbose) {
|
|
27
|
-
process.env.NX_VERBOSE_LOGGING = 'true';
|
|
28
|
-
}
|
|
29
|
-
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
|
30
|
-
return {
|
|
31
|
-
invoke: async (opts) => {
|
|
32
|
-
perf_hooks_1.performance.mark('code-loading:end');
|
|
33
|
-
// TODO: This polyfills the outputs if someone doesn't pass a task with outputs. Remove this in Nx 20
|
|
34
|
-
opts.tasks.forEach((t) => {
|
|
35
|
-
if (!t.outputs) {
|
|
36
|
-
t.outputs = (0, utils_1.getOutputs)(projectGraph.nodes, t.target, t.overrides);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const lifeCycle = new invoke_runner_terminal_output_life_cycle_1.InvokeRunnerTerminalOutputLifeCycle(opts.tasks);
|
|
40
|
-
const taskGraph = {
|
|
41
|
-
roots: opts.tasks.map((task) => task.id),
|
|
42
|
-
tasks: opts.tasks.reduce((acc, task) => {
|
|
43
|
-
acc[task.id] = task;
|
|
44
|
-
return acc;
|
|
45
|
-
}, {}),
|
|
46
|
-
dependencies: opts.tasks.reduce((acc, task) => {
|
|
47
|
-
acc[task.id] = [];
|
|
48
|
-
return acc;
|
|
49
|
-
}, {}),
|
|
50
|
-
continuousDependencies: opts.tasks.reduce((acc, task) => {
|
|
51
|
-
acc[task.id] = [];
|
|
52
|
-
return acc;
|
|
53
|
-
}, {}),
|
|
54
|
-
};
|
|
55
|
-
const taskResults = await (0, run_command_1.invokeTasksRunner)({
|
|
56
|
-
tasks: opts.tasks,
|
|
57
|
-
projectGraph,
|
|
58
|
-
taskGraph,
|
|
59
|
-
lifeCycle,
|
|
60
|
-
nxJson,
|
|
61
|
-
nxArgs: { ...nxArgs, parallel: opts.parallel },
|
|
62
|
-
loadDotEnvFiles: true,
|
|
63
|
-
initiatingProject: null,
|
|
64
|
-
initiatingTasks: [],
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
status: Object.values(taskResults).some((taskResult) => taskResult.status === 'failure' || taskResult.status === 'skipped')
|
|
68
|
-
? 1
|
|
69
|
-
: 0,
|
|
70
|
-
taskGraph,
|
|
71
|
-
taskResults,
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
13
|
async function createOrchestrator(tasks, projectGraph, taskGraphForHashing, nxJson, lifeCycle) {
|
|
77
14
|
(0, dotenv_1.loadRootEnvFiles)();
|
|
78
15
|
const invokeRunnerTerminalLifecycle = new invoke_runner_terminal_output_life_cycle_1.InvokeRunnerTerminalOutputLifeCycle(tasks);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TargetDependencyConfig } from '../config/workspace-json-project-json';
|
|
2
|
+
type LegacyValue = 'self' | 'dependencies';
|
|
3
|
+
type LegacyEntry = TargetDependencyConfig & {
|
|
4
|
+
projects: LegacyValue;
|
|
5
|
+
};
|
|
6
|
+
export interface LegacyDependsOnViolation {
|
|
7
|
+
index: number;
|
|
8
|
+
originalEntry: LegacyEntry;
|
|
9
|
+
}
|
|
10
|
+
export interface LegacyDependsOnLocation {
|
|
11
|
+
ownerTarget?: string;
|
|
12
|
+
index?: number;
|
|
13
|
+
legacyViolations?: LegacyDependsOnViolation[];
|
|
14
|
+
}
|
|
15
|
+
export declare function warnLegacyDependsOnMagicString(currentProject: string | undefined, dependencyConfig: TargetDependencyConfig, location: LegacyDependsOnLocation | undefined): void;
|
|
16
|
+
export declare function flushLegacyDependsOnViolations(project: string, ownerTarget: string, violations: LegacyDependsOnViolation[], projectRoot: string | undefined): void;
|
|
17
|
+
export declare function __resetForTests(): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warnLegacyDependsOnMagicString = warnLegacyDependsOnMagicString;
|
|
4
|
+
exports.flushLegacyDependsOnViolations = flushLegacyDependsOnViolations;
|
|
5
|
+
exports.__resetForTests = __resetForTests;
|
|
6
|
+
const nx_deps_cache_1 = require("../project-graph/nx-deps-cache");
|
|
7
|
+
const source_maps_1 = require("../project-graph/utils/project-configuration/source-maps");
|
|
8
|
+
const output_1 = require("../utils/output");
|
|
9
|
+
const warned = new Set();
|
|
10
|
+
const isInternal = (p) => !p || p.startsWith('nx/');
|
|
11
|
+
// Callers gate this on `dependencyConfig.projects` already being a legacy value;
|
|
12
|
+
// the inner cast snapshots that runtime guarantee into the type system.
|
|
13
|
+
function warnLegacyDependsOnMagicString(currentProject, dependencyConfig, location) {
|
|
14
|
+
const violation = {
|
|
15
|
+
index: location?.index ?? -1,
|
|
16
|
+
originalEntry: { ...dependencyConfig },
|
|
17
|
+
};
|
|
18
|
+
// Collector-aware caller (`getDependencyConfigs`) batches violations so the
|
|
19
|
+
// warning can group all offending entries for a single target. External
|
|
20
|
+
// callers fall through to an immediate per-entry warning.
|
|
21
|
+
if (location?.legacyViolations)
|
|
22
|
+
return void location.legacyViolations.push(violation);
|
|
23
|
+
flushLegacyDependsOnViolations(currentProject ?? '<unknown>', location?.ownerTarget ?? '<unknown>', [violation], undefined);
|
|
24
|
+
}
|
|
25
|
+
function flushLegacyDependsOnViolations(project, ownerTarget, violations, projectRoot) {
|
|
26
|
+
if (violations.length === 0)
|
|
27
|
+
return;
|
|
28
|
+
// Read source maps fresh each flush so daemon-cached maps don't go stale;
|
|
29
|
+
// only runs when violations exist, which is rare.
|
|
30
|
+
let sourceMaps = null;
|
|
31
|
+
try {
|
|
32
|
+
sourceMaps = (0, nx_deps_cache_1.readSourceMapsCache)();
|
|
33
|
+
}
|
|
34
|
+
catch { } // best-effort context
|
|
35
|
+
const map = projectRoot && sourceMaps ? sourceMaps[projectRoot] : undefined;
|
|
36
|
+
const arrayKey = `targets.${ownerTarget}.dependsOn`;
|
|
37
|
+
const items = violations.map((v) => {
|
|
38
|
+
const info = map
|
|
39
|
+
? (0, source_maps_1.readArrayItemSourceInfo)(map, arrayKey, v.index)
|
|
40
|
+
: undefined;
|
|
41
|
+
return {
|
|
42
|
+
...v,
|
|
43
|
+
value: v.originalEntry.projects,
|
|
44
|
+
plugin: info?.[1],
|
|
45
|
+
file: info?.[0] ?? undefined,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const shared = (key) => items.every((i) => i[key] === items[0][key]) ? items[0][key] : null;
|
|
49
|
+
const value = shared('value');
|
|
50
|
+
const plugin = shared('plugin');
|
|
51
|
+
const file = shared('file');
|
|
52
|
+
// External-plugin warnings are workspace-wide (the plugin's behavior, not a
|
|
53
|
+
// specific config): dedupe per (plugin, value) so the user sees one warning
|
|
54
|
+
// per offending plugin, not one per affected target.
|
|
55
|
+
const dedupeKey = plugin && !isInternal(plugin) && value
|
|
56
|
+
? `plugin::${plugin}::${value}`
|
|
57
|
+
: `target::${project}::${ownerTarget}`;
|
|
58
|
+
if (warned.has(dedupeKey))
|
|
59
|
+
return;
|
|
60
|
+
warned.add(dedupeKey);
|
|
61
|
+
const n = items.length;
|
|
62
|
+
const word = n === 1 ? 'entry' : 'entries';
|
|
63
|
+
const deprecation = 'This is deprecated and will be removed in Nx v24 —';
|
|
64
|
+
let phrase;
|
|
65
|
+
if (value) {
|
|
66
|
+
phrase = `projects: '${value}'`;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const self = items.filter((i) => i.value === 'self').length;
|
|
70
|
+
phrase = `legacy projects values (${self} 'self', ${n - self} 'dependencies')`;
|
|
71
|
+
}
|
|
72
|
+
let title;
|
|
73
|
+
let suppressBody = false;
|
|
74
|
+
if (plugin && !isInternal(plugin)) {
|
|
75
|
+
// Single external plugin: same plugin emits the same value across projects.
|
|
76
|
+
title = `The ${plugin} plugin infers dependsOn entries using ${phrase}. ${deprecation} please upgrade ${plugin} to a version that doesn't emit this.`;
|
|
77
|
+
suppressBody = true;
|
|
78
|
+
}
|
|
79
|
+
else if (plugin && isInternal(plugin) && file) {
|
|
80
|
+
// Single hand-authored config file — lead with the file path.
|
|
81
|
+
title = `${file} defines ${project}:${ownerTarget} with ${n} dependsOn ${word} using ${phrase}. ${deprecation} run 'nx repair' to fix this.`;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Mixed sources or no source-map info — tailor advice to what's offending.
|
|
85
|
+
const offending = Array.from(new Set(items
|
|
86
|
+
.filter((i) => i.plugin && !isInternal(i.plugin))
|
|
87
|
+
.map((i) => i.plugin)));
|
|
88
|
+
const origin = plugin
|
|
89
|
+
? ` (set by ${plugin}${file ? ` in ${file}` : ''})`
|
|
90
|
+
: '';
|
|
91
|
+
const advice = offending.length
|
|
92
|
+
? `run 'nx repair' for hand-authored entries and upgrade ${offending.join(', ')} for plugin-inferred entries`
|
|
93
|
+
: `run 'nx repair' to fix`;
|
|
94
|
+
title = `${project}:${ownerTarget} has ${n} dependsOn ${word} using ${phrase}${origin}. ${deprecation} ${advice}.`;
|
|
95
|
+
}
|
|
96
|
+
const bodyLines = suppressBody
|
|
97
|
+
? []
|
|
98
|
+
: items.map((i) => {
|
|
99
|
+
const src = i.plugin && !plugin
|
|
100
|
+
? ` from ${i.plugin}${i.file ? ` in ${i.file}` : ''}`
|
|
101
|
+
: '';
|
|
102
|
+
return ` - ${JSON.stringify(i.originalEntry)} (${i.index}${src})`;
|
|
103
|
+
});
|
|
104
|
+
output_1.output.warn({ title, bodyLines });
|
|
105
|
+
}
|
|
106
|
+
// Test-only: clears the process-wide dedupe set.
|
|
107
|
+
function __resetForTests() {
|
|
108
|
+
warned.clear();
|
|
109
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { Task } from '../config/task-graph';
|
|
2
|
-
import { BatchInfo, BatchStatus, ExternalObject, TaskStatus as NativeTaskStatus } from '../native';
|
|
2
|
+
import { BatchInfo, BatchStatus, ExternalObject, TaskResult, TaskStatus as NativeTaskStatus } from '../native';
|
|
3
3
|
import { TaskStatus } from './tasks-runner';
|
|
4
4
|
/**
|
|
5
|
-
* The result of a completed {@link Task}
|
|
5
|
+
* The result of a completed {@link Task}.
|
|
6
|
+
*
|
|
7
|
+
* Defined as a Rust struct in `packages/nx/src/native/tasks/types.rs` and
|
|
8
|
+
* exposed to TypeScript via NAPI. Re-exported here so existing imports
|
|
9
|
+
* keep working.
|
|
6
10
|
*
|
|
7
11
|
* Task timing information (start and end timestamps) is available
|
|
8
12
|
* on the {@link Task} object itself via {@link Task.startTime} and
|
|
9
13
|
* {@link Task.endTime}.
|
|
10
14
|
*/
|
|
11
|
-
export
|
|
12
|
-
task: Task;
|
|
13
|
-
status: TaskStatus;
|
|
14
|
-
code: number;
|
|
15
|
-
terminalOutput?: string;
|
|
16
|
-
}
|
|
15
|
+
export type { TaskResult };
|
|
17
16
|
/**
|
|
18
17
|
* A map of {@link TaskResult} keyed by the ID of the completed {@link Task}s
|
|
19
18
|
*/
|
|
@@ -13,9 +13,10 @@ class InvokeRunnerTerminalOutputLifeCycle {
|
|
|
13
13
|
output_1.output.log({
|
|
14
14
|
color: 'cyan',
|
|
15
15
|
title: `Running ${this.tasks.length} tasks:`,
|
|
16
|
-
bodyLines: this.tasks.map((task) =>
|
|
17
|
-
|
|
18
|
-
: ''}`
|
|
16
|
+
bodyLines: this.tasks.map((task) => {
|
|
17
|
+
const unparsed = (0, utils_1.getUnparsedOverrideArgs)(task);
|
|
18
|
+
return `- Task ${task.id} ${unparsed.length > 0 ? `Overrides: ${unparsed.join(' ')}` : ''}`;
|
|
19
|
+
}),
|
|
19
20
|
});
|
|
20
21
|
output_1.output.addVerticalSeparatorWithoutNewLines('cyan');
|
|
21
22
|
}
|
|
@@ -24,9 +25,8 @@ class InvokeRunnerTerminalOutputLifeCycle {
|
|
|
24
25
|
const taskIds = this.tasks.map((task) => {
|
|
25
26
|
const cached = this.cachedTasks.indexOf(task) !== -1;
|
|
26
27
|
const failed = this.failedTasks.indexOf(task) !== -1;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
: ''} ${cached ? 'CACHED' : ''} ${failed ? 'FAILED' : ''}`;
|
|
28
|
+
const unparsed = (0, utils_1.getUnparsedOverrideArgs)(task);
|
|
29
|
+
return `- Task ${task.id} ${unparsed.length > 0 ? `Overrides: ${unparsed.join(' ')}` : ''} ${cached ? 'CACHED' : ''} ${failed ? 'FAILED' : ''}`;
|
|
30
30
|
});
|
|
31
31
|
if (this.failedTasks.length === 0) {
|
|
32
32
|
output_1.output.addVerticalSeparatorWithoutNewLines('green');
|
|
@@ -61,11 +61,22 @@ class LegacyTaskHistoryLifeCycle {
|
|
|
61
61
|
}
|
|
62
62
|
printFlakyTasksMessage() {
|
|
63
63
|
if (this.flakyTasks?.length > 0) {
|
|
64
|
+
const MAX_VISIBLE_FLAKY = 5;
|
|
65
|
+
const visibleFlaky = this.flakyTasks.length > MAX_VISIBLE_FLAKY + 1
|
|
66
|
+
? this.flakyTasks.slice(0, MAX_VISIBLE_FLAKY)
|
|
67
|
+
: this.flakyTasks;
|
|
68
|
+
const hiddenCount = this.flakyTasks.length - visibleFlaky.length;
|
|
69
|
+
const flakyRows = visibleFlaky.map((t) => ` ${t}`);
|
|
70
|
+
if (hiddenCount > 0) {
|
|
71
|
+
flakyRows.push(` ${hiddenCount} more...`);
|
|
72
|
+
}
|
|
64
73
|
output_1.output.warn({
|
|
65
|
-
title: `Nx detected ${this.flakyTasks.length === 1
|
|
74
|
+
title: `Nx detected ${this.flakyTasks.length === 1
|
|
75
|
+
? 'a flaky task'
|
|
76
|
+
: `${this.flakyTasks.length} flaky tasks`}`,
|
|
66
77
|
bodyLines: [
|
|
67
78
|
,
|
|
68
|
-
...
|
|
79
|
+
...flakyRows,
|
|
69
80
|
...((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
|
|
70
81
|
? []
|
|
71
82
|
: [
|
|
@@ -79,14 +79,25 @@ class TaskHistoryLifeCycle {
|
|
|
79
79
|
}
|
|
80
80
|
printFlakyTasksMessage() {
|
|
81
81
|
if (this.flakyTasks?.length > 0) {
|
|
82
|
+
const MAX_VISIBLE_FLAKY = 5;
|
|
83
|
+
const visibleFlaky = this.flakyTasks.length > MAX_VISIBLE_FLAKY + 1
|
|
84
|
+
? this.flakyTasks.slice(0, MAX_VISIBLE_FLAKY)
|
|
85
|
+
: this.flakyTasks;
|
|
86
|
+
const hiddenCount = this.flakyTasks.length - visibleFlaky.length;
|
|
87
|
+
const flakyRows = visibleFlaky.map((hash) => {
|
|
88
|
+
const taskRun = this.taskRuns.get(hash);
|
|
89
|
+
return ` ${(0, serialize_target_1.serializeTarget)(taskRun.target.project, taskRun.target.target, taskRun.target.configuration)}`;
|
|
90
|
+
});
|
|
91
|
+
if (hiddenCount > 0) {
|
|
92
|
+
flakyRows.push(` ${hiddenCount} more...`);
|
|
93
|
+
}
|
|
82
94
|
output_1.output.warn({
|
|
83
|
-
title: `Nx detected ${this.flakyTasks.length === 1
|
|
95
|
+
title: `Nx detected ${this.flakyTasks.length === 1
|
|
96
|
+
? 'a flaky task'
|
|
97
|
+
: `${this.flakyTasks.length} flaky tasks`}`,
|
|
84
98
|
bodyLines: [
|
|
85
99
|
,
|
|
86
|
-
...
|
|
87
|
-
const taskRun = this.taskRuns.get(hash);
|
|
88
|
-
return ` ${(0, serialize_target_1.serializeTarget)(taskRun.target.project, taskRun.target.target, taskRun.target.configuration)}`;
|
|
89
|
-
}),
|
|
100
|
+
...flakyRows,
|
|
90
101
|
...((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
|
|
91
102
|
? []
|
|
92
103
|
: [
|
|
@@ -67,6 +67,12 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
|
|
|
67
67
|
displayStoppedTasks.add(taskId);
|
|
68
68
|
inProgressTasks.delete(taskId);
|
|
69
69
|
}
|
|
70
|
+
else if (taskStatus === 2 /* NativeTaskStatus.Skipped */) {
|
|
71
|
+
// Skipped tasks don't get an endTasks() call; clear them here so the run
|
|
72
|
+
// summary doesn't treat them as still-in-progress and report Cancelled.
|
|
73
|
+
tasksToTaskStatus[taskId] = 'skipped';
|
|
74
|
+
inProgressTasks.delete(taskId);
|
|
75
|
+
}
|
|
70
76
|
};
|
|
71
77
|
lifeCycle.endTasks = (taskResults) => {
|
|
72
78
|
for (const { task, status, terminalOutput } of taskResults) {
|
|
@@ -132,10 +138,13 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
|
|
|
132
138
|
(0, task_history_life_cycle_1.getTasksHistoryLifeCycle)().printFlakyTasksMessage();
|
|
133
139
|
};
|
|
134
140
|
const printRunOneSummary = ({ failure, cancelled, }) => {
|
|
135
|
-
//
|
|
136
|
-
// above the summary, since run-one should print all task results.
|
|
141
|
+
// Print task outputs in completion order above the summary.
|
|
137
142
|
for (const taskId of taskIdsInTheOrderTheyStart) {
|
|
138
143
|
const taskStatus = tasksToTaskStatus[taskId];
|
|
144
|
+
// Skipped tasks never ran; don't print a misleading `> nx run` header.
|
|
145
|
+
if (taskStatus === 'skipped') {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
139
148
|
const terminalOutput = getTerminalOutput(taskId);
|
|
140
149
|
output_1.output.logCommandOutput(taskId, taskStatus, terminalOutput);
|
|
141
150
|
}
|
|
@@ -45,7 +45,7 @@ export declare class PseudoTtyProcess implements RunningTask {
|
|
|
45
45
|
onExit(callback: (code: number, terminalOutput: string) => void): void;
|
|
46
46
|
onOutput(callback: (message: string) => void): void;
|
|
47
47
|
getPid(): number | undefined;
|
|
48
|
-
kill(s?: NodeJS.Signals): void
|
|
48
|
+
kill(s?: NodeJS.Signals): Promise<void>;
|
|
49
49
|
getParserAndWriter(): import("../native").ExternalObject<[import("../native").ParserArc, import("../native").WriterArc]>;
|
|
50
50
|
}
|
|
51
51
|
export declare class PseudoTtyProcessWithSend extends PseudoTtyProcess {
|
|
@@ -41,9 +41,14 @@ class PseudoTerminal {
|
|
|
41
41
|
this.initialized = true;
|
|
42
42
|
}
|
|
43
43
|
shutdown(code) {
|
|
44
|
+
// Called from process.on('exit') — must be synchronous/best-effort.
|
|
45
|
+
// Use fire-and-forget killProcessTree, not the async graceful variant.
|
|
44
46
|
for (const cp of this.childProcesses) {
|
|
45
47
|
try {
|
|
46
|
-
cp.
|
|
48
|
+
const pid = cp.getPid();
|
|
49
|
+
if (pid) {
|
|
50
|
+
(0, native_1.killProcessTree)(pid, (0, exit_codes_1.codeToSignal)(code));
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
53
|
catch { }
|
|
49
54
|
}
|
|
@@ -110,17 +115,24 @@ class PseudoTtyProcess {
|
|
|
110
115
|
getPid() {
|
|
111
116
|
return this.childProcess.getPid();
|
|
112
117
|
}
|
|
113
|
-
kill(s) {
|
|
118
|
+
async kill(s) {
|
|
114
119
|
if (this.isAlive) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
this.isAlive = false;
|
|
121
|
+
const pid = this.childProcess.getPid();
|
|
122
|
+
// Gracefully kill the entire process tree. This snapshots the tree
|
|
123
|
+
// BEFORE sending signals, so even if the root exits quickly from
|
|
124
|
+
// the signal, all descendants are already tracked and will be
|
|
125
|
+
// cleaned up (including any reparented to init/PID 1).
|
|
126
|
+
if (pid) {
|
|
127
|
+
await (0, native_1.killProcessTreeGraceful)(pid, s || 'SIGTERM');
|
|
121
128
|
}
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
else {
|
|
130
|
+
try {
|
|
131
|
+
this.childProcess.kill(s || 'SIGTERM');
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// child may have already exited
|
|
135
|
+
}
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
138
|
}
|
|
@@ -22,6 +22,7 @@ const project_graph_1 = require("../project-graph/project-graph");
|
|
|
22
22
|
const handle_errors_1 = require("../utils/handle-errors");
|
|
23
23
|
const is_ci_1 = require("../utils/is-ci");
|
|
24
24
|
const nx_cloud_utils_1 = require("../utils/nx-cloud-utils");
|
|
25
|
+
const logger_1 = require("../utils/logger");
|
|
25
26
|
const nx_key_1 = require("../utils/nx-key");
|
|
26
27
|
const output_1 = require("../utils/output");
|
|
27
28
|
const sync_generators_1 = require("../utils/sync-generators");
|
|
@@ -324,6 +325,10 @@ async function runCommand(projectsToRun, currentProjectGraph, { nxJson }, nxArgs
|
|
|
324
325
|
return status;
|
|
325
326
|
}
|
|
326
327
|
async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
|
|
328
|
+
// Kick off the license lookup in the background so it overlaps with task
|
|
329
|
+
// execution. The log itself is deferred to the print site below so it
|
|
330
|
+
// never lands in the middle of task output.
|
|
331
|
+
const nxKeyPromise = (0, nx_key_1.getNxKeyInformation)().catch(() => null);
|
|
327
332
|
const projectNames = projectsToRun.map((t) => t.name);
|
|
328
333
|
const projectNameSet = new Set(projectNames);
|
|
329
334
|
const { projectGraph, taskGraph } = await ensureWorkspaceIsInSyncAndGetGraphs(currentProjectGraph, nxJson, projectNames, nxArgs, overrides, extraTargetDependencies, extraOptions);
|
|
@@ -348,7 +353,9 @@ async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }
|
|
|
348
353
|
printSummary();
|
|
349
354
|
}
|
|
350
355
|
await printConfigureAiAgentsDisclaimer();
|
|
351
|
-
await
|
|
356
|
+
const nxKey = await nxKeyPromise;
|
|
357
|
+
if (nxKey)
|
|
358
|
+
logger_1.logger.log((0, nx_key_1.createNxKeyLicenseeInformation)(nxKey));
|
|
352
359
|
return {
|
|
353
360
|
taskResults,
|
|
354
361
|
completed: didCommandComplete(tasks, taskResults),
|
|
@@ -826,12 +833,6 @@ function getTasksRunnerPath(runner, nxJson) {
|
|
|
826
833
|
: defaultTasksRunnerPath;
|
|
827
834
|
}
|
|
828
835
|
function getRunnerOptions(runner, nxJson, nxArgs, isCloudDefault) {
|
|
829
|
-
const defaultCacheableOperations = [];
|
|
830
|
-
for (const key in nxJson.targetDefaults) {
|
|
831
|
-
if (nxJson.targetDefaults[key].cache) {
|
|
832
|
-
defaultCacheableOperations.push(key);
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
836
|
const result = {
|
|
836
837
|
...nxJson.tasksRunnerOptions?.[runner]?.options,
|
|
837
838
|
...nxArgs,
|
|
@@ -858,10 +859,6 @@ function getRunnerOptions(runner, nxJson, nxArgs, isCloudDefault) {
|
|
|
858
859
|
if (nxJson.cacheDirectory) {
|
|
859
860
|
result.cacheDirectory ??= nxJson.cacheDirectory;
|
|
860
861
|
}
|
|
861
|
-
if (defaultCacheableOperations.length) {
|
|
862
|
-
result.cacheableOperations ??= [];
|
|
863
|
-
result.cacheableOperations = result.cacheableOperations.concat(defaultCacheableOperations);
|
|
864
|
-
}
|
|
865
862
|
if (nxJson.useDaemonProcess !== undefined) {
|
|
866
863
|
result.useDaemonProcess ??= nxJson.useDaemonProcess;
|
|
867
864
|
}
|