@depup/nx 23.2.1-depup.8 → 23.3.0-depup.0
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/README.md +7 -18
- package/changes.json +9 -53
- package/dist/bin/init-local.js +7 -1
- package/dist/nx-cloud-internals.d.ts +1 -0
- package/dist/nx-cloud-internals.js +9 -0
- package/dist/plugins/package-json.js +1 -1
- package/dist/src/command-line/add/add.js +5 -1
- package/dist/src/command-line/affected/affected.js +70 -9
- package/dist/src/command-line/affected/command-object.js +1 -1
- package/dist/src/command-line/format/format.js +2 -18
- package/dist/src/command-line/graph/graph.d.ts +31 -0
- package/dist/src/command-line/graph/graph.js +113 -20
- package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +0 -3
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +0 -3
- package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +0 -3
- package/dist/src/command-line/init/implementation/angular/index.js +0 -3
- package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +0 -3
- package/dist/src/command-line/init/implementation/format.js +2 -3
- package/dist/src/command-line/init/implementation/utils.d.ts +0 -1
- package/dist/src/command-line/init/implementation/utils.js +6 -9
- package/dist/src/command-line/init/init-v2.js +0 -3
- package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +25 -0
- package/dist/src/command-line/migrate/agentic/capture-generator-output.js +121 -5
- package/dist/src/command-line/migrate/agentic/close-agent-session.d.ts +21 -0
- package/dist/src/command-line/migrate/agentic/close-agent-session.js +126 -0
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +24 -0
- package/dist/src/command-line/migrate/agentic/definitions.js +79 -20
- package/dist/src/command-line/migrate/agentic/format-command.d.ts +14 -0
- package/dist/src/command-line/migrate/agentic/format-command.js +44 -0
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +3 -3
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +3 -3
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +50 -17
- package/dist/src/command-line/migrate/agentic/handoff.js +166 -24
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +23 -0
- package/dist/src/command-line/migrate/agentic/instruction-files.js +41 -0
- package/dist/src/command-line/migrate/agentic/master/invocations.d.ts +12 -0
- package/dist/src/command-line/migrate/agentic/master/invocations.js +54 -0
- package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +16 -0
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +175 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +31 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.js +222 -0
- package/dist/src/command-line/migrate/agentic/prompts/final-validation.d.ts +13 -0
- package/dist/src/command-line/migrate/agentic/prompts/final-validation.js +41 -0
- package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +17 -0
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +90 -0
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +4 -3
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +25 -1
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +57 -34
- package/dist/src/command-line/migrate/agentic/run-step.js +28 -4
- package/dist/src/command-line/migrate/agentic/runner.d.ts +3 -15
- package/dist/src/command-line/migrate/agentic/runner.js +57 -239
- package/dist/src/command-line/migrate/agentic/terminal-repair.d.ts +1 -0
- package/dist/src/command-line/migrate/agentic/terminal-repair.js +27 -0
- package/dist/src/command-line/migrate/agentic/types.d.ts +23 -8
- package/dist/src/command-line/migrate/agentic/types.js +10 -7
- package/dist/src/command-line/migrate/agentic/windows-cmd.d.ts +33 -0
- package/dist/src/command-line/migrate/agentic/windows-cmd.js +88 -0
- package/dist/src/command-line/migrate/command-object.d.ts +2 -0
- package/dist/src/command-line/migrate/command-object.js +11 -1
- package/dist/src/command-line/migrate/deferred-output.d.ts +44 -0
- package/dist/src/command-line/migrate/deferred-output.js +92 -0
- package/dist/src/command-line/migrate/execute-migration.d.ts +9 -3
- package/dist/src/command-line/migrate/execute-migration.js +53 -16
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +34 -9
- package/dist/src/command-line/migrate/migrate-analytics.js +71 -10
- package/dist/src/command-line/migrate/migrate-commits.d.ts +5 -4
- package/dist/src/command-line/migrate/migrate-commits.js +16 -6
- package/dist/src/command-line/migrate/migrate-config.d.ts +5 -2
- package/dist/src/command-line/migrate/migrate-config.js +19 -11
- package/dist/src/command-line/migrate/migrate-output.d.ts +3 -7
- package/dist/src/command-line/migrate/migrate-output.js +3 -7
- package/dist/src/command-line/migrate/migrate.d.ts +3 -0
- package/dist/src/command-line/migrate/migrate.js +183 -46
- package/dist/src/command-line/migrate/resolve-package-version.js +2 -19
- package/dist/src/command-line/migrate/run/agent-output.d.ts +11 -0
- package/dist/src/command-line/migrate/run/agent-output.js +21 -2
- package/dist/src/command-line/migrate/run/agent-work-payload.d.ts +37 -0
- package/dist/src/command-line/migrate/run/agent-work-payload.js +156 -0
- package/dist/src/command-line/migrate/run/atomic-write.d.ts +8 -0
- package/dist/src/command-line/migrate/run/atomic-write.js +17 -0
- package/dist/src/command-line/migrate/run/broker.d.ts +150 -0
- package/dist/src/command-line/migrate/run/broker.js +568 -0
- package/dist/src/command-line/migrate/run/clean-retry.d.ts +12 -0
- package/dist/src/command-line/migrate/run/clean-retry.js +99 -0
- package/dist/src/command-line/migrate/run/existing-run-report.d.ts +55 -0
- package/dist/src/command-line/migrate/run/existing-run-report.js +227 -0
- package/dist/src/command-line/migrate/run/give-up.d.ts +41 -0
- package/dist/src/command-line/migrate/run/give-up.js +148 -0
- package/dist/src/command-line/migrate/run/index.d.ts +9 -6
- package/dist/src/command-line/migrate/run/index.js +21 -2
- package/dist/src/command-line/migrate/run/issues.d.ts +127 -0
- package/dist/src/command-line/migrate/run/issues.js +1121 -0
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +59 -1
- package/dist/src/command-line/migrate/run/orchestrator.js +1529 -457
- package/dist/src/command-line/migrate/run/run-id.d.ts +0 -8
- package/dist/src/command-line/migrate/run/run-id.js +0 -30
- package/dist/src/command-line/migrate/run/run-state.d.ts +77 -17
- package/dist/src/command-line/migrate/run/run-state.js +263 -32
- package/dist/src/command-line/migrate/run/runbook.d.ts +18 -0
- package/dist/src/command-line/migrate/run/runbook.js +118 -0
- package/dist/src/command-line/migrate/run/state-lock.d.ts +33 -2
- package/dist/src/command-line/migrate/run/state-lock.js +128 -2
- package/dist/src/command-line/migrate/run/state-machine.d.ts +50 -1
- package/dist/src/command-line/migrate/run/state-machine.js +339 -26
- package/dist/src/command-line/migrate/run/util.d.ts +3 -1
- package/dist/src/command-line/migrate/run/util.js +24 -3
- package/dist/src/command-line/migrate/run/worker.js +290 -129
- package/dist/src/command-line/migrate/step-actions.d.ts +1 -1
- package/dist/src/command-line/migrate/step-actions.js +7 -1
- package/dist/src/command-line/migrate/text.d.ts +6 -0
- package/dist/src/command-line/migrate/text.js +25 -0
- package/dist/src/command-line/migrate/version-skew-guard.js +2 -0
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +5 -11
- package/dist/src/command-line/release/publish.js +11 -8
- package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
- package/dist/src/command-line/release/utils/release-graph.js +1 -1
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +5 -8
- package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +3 -3
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +4 -2
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +37 -3
- package/dist/src/command-line/release/version/version-actions.d.ts +3 -0
- package/dist/src/command-line/reset/reset.js +10 -4
- package/dist/src/command-line/run/run-one.js +5 -1
- package/dist/src/command-line/run-many/run-many.js +6 -12
- package/dist/src/command-line/show/command-object.js +1 -1
- package/dist/src/command-line/show/projects.js +52 -1
- package/dist/src/command-line/yargs-utils/shared-options.d.ts +5 -1
- package/dist/src/command-line/yargs-utils/shared-options.js +38 -4
- package/dist/src/config/task-graph.d.ts +1 -1
- package/dist/src/config/workspace-json-project-json.d.ts +23 -1
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/runtime.js +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +14 -8
- package/dist/src/daemon/client/client.js +41 -12
- package/dist/src/daemon/message-types/get-plugin-capabilities.d.ts +5 -0
- package/dist/src/daemon/message-types/get-plugin-capabilities.js +11 -0
- package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +3 -2
- package/dist/src/daemon/message-types/select-affected-tasks.d.ts +21 -0
- package/dist/src/daemon/message-types/select-affected-tasks.js +11 -0
- package/dist/src/daemon/message-types/ultracache-configuration-version.d.ts +8 -0
- package/dist/src/daemon/message-types/ultracache-configuration-version.js +2 -0
- package/dist/src/daemon/server/dotenv-graph-changes.d.ts +1 -1
- package/dist/src/daemon/server/dotenv-graph-changes.js +2 -2
- package/dist/src/daemon/server/handle-get-plugin-capabilities.d.ts +2 -0
- package/dist/src/daemon/server/handle-get-plugin-capabilities.js +13 -0
- package/dist/src/daemon/server/handle-hash-tasks.d.ts +10 -2
- package/dist/src/daemon/server/handle-hash-tasks.js +18 -3
- package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +3 -0
- package/dist/src/daemon/server/handle-select-affected-tasks.js +26 -0
- package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
- package/dist/src/daemon/server/{handle-outputs-changes.d.ts → handle-watch-events.d.ts} +4 -4
- package/dist/src/daemon/server/{handle-outputs-changes.js → handle-watch-events.js} +36 -37
- package/dist/src/daemon/server/outputs-tracking.d.ts +7 -19
- package/dist/src/daemon/server/outputs-tracking.js +7 -107
- package/dist/src/daemon/server/planning-context.d.ts +8 -0
- package/dist/src/daemon/server/planning-context.js +18 -0
- package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +22 -7
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +104 -74
- package/dist/src/daemon/server/restart-checks.d.ts +22 -0
- package/dist/src/daemon/server/restart-checks.js +77 -0
- package/dist/src/daemon/server/server.d.ts +1 -0
- package/dist/src/daemon/server/server.js +54 -30
- package/dist/src/daemon/server/shutdown-utils.d.ts +0 -5
- package/dist/src/daemon/server/shutdown-utils.js +3 -26
- package/dist/src/daemon/server/ultracache-configuration-state.d.ts +7 -0
- package/dist/src/daemon/server/ultracache-configuration-state.js +36 -0
- package/dist/src/devkit-internals.d.ts +3 -1
- package/dist/src/devkit-internals.js +8 -3
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -1
- package/dist/src/executors/run-commands/run-commands.impl.js +19 -5
- package/dist/src/executors/run-commands/running-tasks.d.ts +5 -4
- package/dist/src/executors/run-commands/running-tasks.js +13 -13
- package/dist/src/hasher/create-task-hasher.d.ts +8 -1
- package/dist/src/hasher/create-task-hasher.js +13 -3
- package/dist/src/hasher/hash-plan-inspector.js +2 -2
- package/dist/src/hasher/hash-task.d.ts +2 -2
- package/dist/src/hasher/hash-task.js +28 -17
- package/dist/src/hasher/native-task-hasher-impl.d.ts +20 -4
- package/dist/src/hasher/native-task-hasher-impl.js +75 -9
- package/dist/src/hasher/task-hasher.d.ts +24 -7
- package/dist/src/hasher/task-hasher.js +27 -8
- package/dist/src/hasher/task-planning-context.d.ts +13 -0
- package/dist/src/hasher/task-planning-context.js +12 -0
- package/dist/src/native/index.d.ts +582 -21
- package/dist/src/native/index.js +3 -3
- package/dist/src/native/native-bindings.js +13 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/native/transform-objects.d.ts +11 -2
- package/dist/src/native/transform-objects.js +46 -0
- package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +15 -8
- package/dist/src/nx-cloud/update-manager.d.ts +3 -0
- package/dist/src/nx-cloud/update-manager.js +19 -13
- package/dist/src/nx-cloud/utilities/client.d.ts +1 -1
- package/dist/src/nx-cloud/utilities/client.js +1 -1
- package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +2 -1
- package/dist/src/nx-cloud/utilities/nx-cloud-http-client.d.ts +5 -0
- package/dist/src/nx-cloud/utilities/nx-cloud-http-client.js +16 -0
- package/dist/src/nx-cloud/utilities/url-shorten.js +17 -10
- package/dist/src/plugins/js/index.js +45 -64
- package/dist/src/plugins/js/lock-file/lock-file.d.ts +4 -4
- package/dist/src/plugins/js/lock-file/lock-file.js +6 -7
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -1
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +2 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +22 -0
- package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +10 -2
- package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +51 -29
- package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +10 -2
- package/dist/src/plugins/js/project-graph/affected/npm-packages.js +32 -11
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +22 -18
- package/dist/src/plugins/js/utils/register.js +13 -4
- package/dist/src/plugins/package-json/create-nodes.d.ts +2 -2
- package/dist/src/plugins/package-json/create-nodes.js +13 -13
- package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +14 -0
- package/dist/src/project-graph/affected/affected-project-graph.js +5 -18
- package/dist/src/project-graph/affected/affected-projects.d.ts +7 -0
- package/dist/src/project-graph/affected/affected-projects.js +42 -0
- package/dist/src/project-graph/affected/affected-reasons.d.ts +116 -0
- package/dist/src/project-graph/affected/affected-reasons.js +459 -0
- package/dist/src/project-graph/affected/affected-tasks.d.ts +103 -0
- package/dist/src/project-graph/affected/affected-tasks.js +386 -0
- package/dist/src/project-graph/affected/print-explanation.d.ts +11 -0
- package/dist/src/project-graph/affected/print-explanation.js +44 -0
- package/dist/src/project-graph/error-types.d.ts +5 -0
- package/dist/src/project-graph/error-types.js +44 -5
- package/dist/src/project-graph/file-utils.d.ts +2 -0
- package/dist/src/project-graph/file-utils.js +12 -3
- package/dist/src/project-graph/nx-deps-cache.d.ts +5 -2
- package/dist/src/project-graph/nx-deps-cache.js +4 -4
- package/dist/src/project-graph/plugins/get-plugins.d.ts +3 -1
- package/dist/src/project-graph/plugins/get-plugins.js +60 -82
- package/dist/src/project-graph/plugins/in-process-loader.d.ts +1 -1
- package/dist/src/project-graph/plugins/in-process-loader.js +1 -4
- package/dist/src/project-graph/plugins/isolation/index.d.ts +1 -1
- package/dist/src/project-graph/plugins/isolation/index.js +3 -1
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +8 -0
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +42 -6
- package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.d.ts +10 -1
- package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.js +67 -17
- package/dist/src/project-graph/plugins/isolation/messaging.d.ts +3 -2
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +5 -1
- package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -2
- package/dist/src/project-graph/plugins/loaded-nx-plugin.js +14 -1
- package/dist/src/project-graph/plugins/nx-plugin-capabilities.d.ts +6 -0
- package/dist/src/project-graph/plugins/nx-plugin-capabilities.js +28 -0
- package/dist/src/project-graph/plugins/task-results-stub.d.ts +50 -0
- package/dist/src/project-graph/plugins/task-results-stub.js +111 -0
- package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -2
- package/dist/src/project-graph/plugins/tasks-execution-hooks.js +14 -1
- package/dist/src/project-graph/project-graph.js +43 -42
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +83 -0
- package/dist/src/project-graph/utils/project-configuration/utils.d.ts +1 -0
- package/dist/src/project-graph/utils/project-configuration/utils.js +1 -0
- package/dist/src/tasks-runner/batch/run-batch.js +15 -0
- package/dist/src/tasks-runner/cache.d.ts +37 -2
- package/dist/src/tasks-runner/cache.js +42 -1
- package/dist/src/tasks-runner/create-task-graph.d.ts +24 -1
- package/dist/src/tasks-runner/create-task-graph.js +57 -2
- package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.js +11 -10
- package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
- package/dist/src/tasks-runner/init-tasks-runner.js +15 -7
- package/dist/src/tasks-runner/is-tui-enabled.js +4 -3
- package/dist/src/tasks-runner/life-cycle.d.ts +7 -0
- package/dist/src/tasks-runner/life-cycle.js +7 -0
- package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.d.ts +35 -0
- package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +146 -0
- package/dist/src/tasks-runner/prune-task-graph.d.ts +17 -0
- package/dist/src/tasks-runner/prune-task-graph.js +45 -0
- package/dist/src/tasks-runner/run-command.d.ts +41 -5
- package/dist/src/tasks-runner/run-command.js +98 -22
- package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +93 -19
- package/dist/src/tasks-runner/running-tasks/batch-process.js +184 -88
- package/dist/src/tasks-runner/task-io-service.d.ts +11 -3
- package/dist/src/tasks-runner/task-io-service.js +14 -5
- package/dist/src/tasks-runner/task-orchestrator.d.ts +71 -4
- package/dist/src/tasks-runner/task-orchestrator.js +266 -66
- package/dist/src/tasks-runner/tasks-runner.d.ts +2 -0
- package/dist/src/tasks-runner/terminal-output-path.d.ts +11 -0
- package/dist/src/tasks-runner/terminal-output-path.js +18 -0
- package/dist/src/tasks-runner/utils.d.ts +5 -0
- package/dist/src/tasks-runner/utils.js +14 -2
- package/dist/src/ultracache/config.d.ts +21 -0
- package/dist/src/ultracache/config.js +29 -0
- package/dist/src/ultracache/fetch.d.ts +21 -0
- package/dist/src/ultracache/fetch.js +43 -0
- package/dist/src/ultracache/overrides.d.ts +17 -0
- package/dist/src/ultracache/overrides.js +61 -0
- package/dist/src/ultracache/report.d.ts +13 -0
- package/dist/src/ultracache/report.js +62 -0
- package/dist/src/ultracache/store.d.ts +41 -0
- package/dist/src/ultracache/store.js +158 -0
- package/dist/src/utils/ab-testing.d.ts +4 -1
- package/dist/src/utils/ab-testing.js +22 -19
- package/dist/src/utils/chunkify.d.ts +1 -7
- package/dist/src/utils/chunkify.js +2 -8
- package/dist/src/utils/command-line-utils.d.ts +20 -0
- package/dist/src/utils/command-line-utils.js +10 -3
- package/dist/src/utils/create-cli-options.d.ts +6 -0
- package/dist/src/utils/create-cli-options.js +29 -0
- package/dist/src/utils/db-connection.d.ts +2 -0
- package/dist/src/utils/db-connection.js +2 -0
- package/dist/src/utils/formatters/index.d.ts +6 -0
- package/dist/src/utils/formatters/index.js +5 -0
- package/dist/src/utils/formatters/prettier.d.ts +0 -8
- package/dist/src/utils/formatters/prettier.js +4 -26
- package/dist/src/utils/git-utils.d.ts +19 -0
- package/dist/src/utils/git-utils.js +97 -39
- package/dist/src/utils/handle-errors.js +5 -43
- package/dist/src/utils/http-client.d.ts +27 -0
- package/dist/src/utils/http-client.js +193 -0
- package/dist/src/utils/installed-nx-version.js +2 -48
- package/dist/src/utils/json-diff.d.ts +4 -2
- package/dist/src/utils/json-diff.js +6 -94
- package/dist/src/utils/min-release-age/packument.js +1 -1
- package/dist/src/utils/nx-cloud-utils.d.ts +2 -0
- package/dist/src/utils/nx-cloud-utils.js +6 -1
- package/dist/src/utils/output.d.ts +22 -3
- package/dist/src/utils/output.js +28 -5
- package/dist/src/utils/package-json.d.ts +25 -0
- package/dist/src/utils/package-json.js +49 -6
- package/dist/src/utils/package-manager.d.ts +6 -0
- package/dist/src/utils/package-manager.js +10 -0
- package/dist/src/utils/plugins/plugin-capabilities.js +7 -2
- package/dist/src/utils/project-graph-utils.d.ts +2 -0
- package/dist/src/utils/project-graph-utils.js +12 -0
- package/dist/src/utils/provenance.js +20 -4
- package/dist/src/utils/serialize-overrides-into-command-line.js +2 -4
- package/dist/src/utils/workspace-context.d.ts +51 -3
- package/dist/src/utils/workspace-context.js +174 -10
- package/package.json +36 -98
- package/schemas/nx-schema.json +38 -0
- package/schemas/project-schema.json +35 -0
- package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +0 -9
- package/dist/src/daemon/server/file-watching/route-workspace-changes.js +0 -76
- package/dist/src/daemon/server/watcher.d.ts +0 -18
- package/dist/src/daemon/server/watcher.js +0 -126
- package/dist/src/nx-cloud/utilities/axios.d.ts +0 -4
- package/dist/src/nx-cloud/utilities/axios.js +0 -17
- package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +0 -2
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +0 -47
- package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +0 -4
- package/dist/src/project-graph/affected/locators/workspace-json-changes.js +0 -47
- package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +0 -3
- package/dist/src/project-graph/affected/locators/workspace-projects.js +0 -74
- package/dist/src/utils/collapse-expanded-outputs.d.ts +0 -10
- package/dist/src/utils/collapse-expanded-outputs.js +0 -72
|
@@ -13,6 +13,23 @@ export type TaskWithCachedResult = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function dbCacheEnabled(): boolean;
|
|
15
15
|
export declare function getCache(options: DefaultTasksRunnerOptions): DbCache | Cache;
|
|
16
|
+
/**
|
|
17
|
+
* Collects the batch worker logs written by `batchOutputPathForKey`.
|
|
18
|
+
*
|
|
19
|
+
* Guarded rather than called straight through: `cache.rs` is
|
|
20
|
+
* `#[cfg(not(target_arch = "wasm32"))]`, so this export does not exist in the
|
|
21
|
+
* WASM binding and calling it there is a `TypeError`. Every other native cache
|
|
22
|
+
* entry point is kept off that path by `dbCacheEnabled()`; this one is a free
|
|
23
|
+
* function, so it needs its own guard. The logs are collected on the next
|
|
24
|
+
* non-WASM run.
|
|
25
|
+
*/
|
|
26
|
+
export declare function sweepBatchOutputs(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Where a batch worker's own log lives. Mirrors `batch_outputs_path` in
|
|
29
|
+
* cache.rs, which is what sweeps the directory — the same mirroring
|
|
30
|
+
* `terminalOutputPathForHash` does for `get_task_outputs_path_internal`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function batchOutputPathForKey(key: string): string;
|
|
16
33
|
export declare class DbCache {
|
|
17
34
|
private readonly options;
|
|
18
35
|
private nxJson;
|
|
@@ -31,8 +48,18 @@ export declare class DbCache {
|
|
|
31
48
|
}>>;
|
|
32
49
|
getUsedCacheSpace(): number;
|
|
33
50
|
private applyRemoteCacheResults;
|
|
34
|
-
put(task: Task, terminalOutput: string | null, outputs: string[], code: number): Promise<
|
|
35
|
-
|
|
51
|
+
put(task: Task, terminalOutput: string | null, outputs: string[], code: number): Promise<import("../native").OutputFile[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Register terminal outputs that were written outside of `put` — uncacheable
|
|
54
|
+
* tasks, and cacheable ones run with `--skip-nx-cache`. `removeOldCacheRecords`
|
|
55
|
+
* only collects hashes it finds in the database, so without this the files
|
|
56
|
+
* would never be cleaned up.
|
|
57
|
+
*/
|
|
58
|
+
recordTerminalOutputs(records: {
|
|
59
|
+
hash: string;
|
|
60
|
+
size: number;
|
|
61
|
+
}[]): void;
|
|
62
|
+
copyFilesFromCache(_: string, cachedResult: CachedResult, outputs: string[]): Promise<import("../native").OutputFile[]>;
|
|
36
63
|
removeOldCacheRecords(): void;
|
|
37
64
|
temporaryOutputPath(task: Task): string;
|
|
38
65
|
private getRemoteCache;
|
|
@@ -63,6 +90,14 @@ export declare class Cache {
|
|
|
63
90
|
put(task: Task, terminalOutput: string | null, outputs: string[], code: number): Promise<void>;
|
|
64
91
|
copyFilesFromCache(hash: string, cachedResult: CachedResult, outputs: string[]): Promise<void>;
|
|
65
92
|
temporaryOutputPath(task: Task): string;
|
|
93
|
+
/**
|
|
94
|
+
* No-op: the legacy cache has no database to record against, and its
|
|
95
|
+
* collection is directory-based rather than driven by cache records.
|
|
96
|
+
*/
|
|
97
|
+
recordTerminalOutputs(_records: {
|
|
98
|
+
hash: string;
|
|
99
|
+
size: number;
|
|
100
|
+
}[]): void;
|
|
66
101
|
private expandOutputsInWorkspace;
|
|
67
102
|
private expandOutputsInCache;
|
|
68
103
|
private _expandOutputs;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Cache = exports.DbCache = void 0;
|
|
4
4
|
exports.dbCacheEnabled = dbCacheEnabled;
|
|
5
5
|
exports.getCache = getCache;
|
|
6
|
+
exports.sweepBatchOutputs = sweepBatchOutputs;
|
|
7
|
+
exports.batchOutputPathForKey = batchOutputPathForKey;
|
|
6
8
|
exports.resolveMaxCacheSize = resolveMaxCacheSize;
|
|
7
9
|
exports.parseMaxCacheSize = parseMaxCacheSize;
|
|
8
10
|
exports.formatCacheSize = formatCacheSize;
|
|
@@ -54,6 +56,30 @@ function getCache(options) {
|
|
|
54
56
|
})
|
|
55
57
|
: new Cache(options);
|
|
56
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Collects the batch worker logs written by `batchOutputPathForKey`.
|
|
61
|
+
*
|
|
62
|
+
* Guarded rather than called straight through: `cache.rs` is
|
|
63
|
+
* `#[cfg(not(target_arch = "wasm32"))]`, so this export does not exist in the
|
|
64
|
+
* WASM binding and calling it there is a `TypeError`. Every other native cache
|
|
65
|
+
* entry point is kept off that path by `dbCacheEnabled()`; this one is a free
|
|
66
|
+
* function, so it needs its own guard. The logs are collected on the next
|
|
67
|
+
* non-WASM run.
|
|
68
|
+
*/
|
|
69
|
+
function sweepBatchOutputs() {
|
|
70
|
+
if (native_1.IS_WASM) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
(0, native_1.sweepBatchOutputs)(cache_directory_1.cacheDir);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Where a batch worker's own log lives. Mirrors `batch_outputs_path` in
|
|
77
|
+
* cache.rs, which is what sweeps the directory — the same mirroring
|
|
78
|
+
* `terminalOutputPathForHash` does for `get_task_outputs_path_internal`.
|
|
79
|
+
*/
|
|
80
|
+
function batchOutputPathForKey(key) {
|
|
81
|
+
return (0, path_1.join)(cache_directory_1.cacheDir, 'batchOutputs', `${key}.log`);
|
|
82
|
+
}
|
|
57
83
|
class DbCache {
|
|
58
84
|
constructor(options) {
|
|
59
85
|
this.options = options;
|
|
@@ -153,14 +179,24 @@ class DbCache {
|
|
|
153
179
|
}
|
|
154
180
|
async put(task, terminalOutput, outputs, code) {
|
|
155
181
|
return tryAndRetry(async () => {
|
|
156
|
-
const expandedOutputs = this.cache.put(task.hash, terminalOutput, outputs, code);
|
|
182
|
+
const { expandedOutputs, files } = this.cache.put(task.hash, terminalOutput, outputs, code);
|
|
157
183
|
// Notify TaskIOService of actual output files
|
|
158
184
|
(0, task_io_service_1.getTaskIOService)().notifyTaskOutputs(task.id, expandedOutputs);
|
|
159
185
|
if (this.remoteCache) {
|
|
160
186
|
await this.remoteCache.store(task.hash, this.cache.cacheDirectory, terminalOutput, code);
|
|
161
187
|
}
|
|
188
|
+
return files;
|
|
162
189
|
});
|
|
163
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Register terminal outputs that were written outside of `put` — uncacheable
|
|
193
|
+
* tasks, and cacheable ones run with `--skip-nx-cache`. `removeOldCacheRecords`
|
|
194
|
+
* only collects hashes it finds in the database, so without this the files
|
|
195
|
+
* would never be cleaned up.
|
|
196
|
+
*/
|
|
197
|
+
recordTerminalOutputs(records) {
|
|
198
|
+
this.cache.recordTerminalOutputs(records);
|
|
199
|
+
}
|
|
164
200
|
copyFilesFromCache(_, cachedResult, outputs) {
|
|
165
201
|
return tryAndRetry(async () => this.cache.copyFilesFromCache(cachedResult, outputs));
|
|
166
202
|
}
|
|
@@ -421,6 +457,11 @@ class Cache {
|
|
|
421
457
|
temporaryOutputPath(task) {
|
|
422
458
|
return (0, path_1.join)(this.terminalOutputsDir, task.hash);
|
|
423
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* No-op: the legacy cache has no database to record against, and its
|
|
462
|
+
* collection is directory-based rather than driven by cache records.
|
|
463
|
+
*/
|
|
464
|
+
recordTerminalOutputs(_records) { }
|
|
424
465
|
async expandOutputsInWorkspace(outputs) {
|
|
425
466
|
return this._expandOutputs(outputs, workspace_root_1.workspaceRoot);
|
|
426
467
|
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';
|
|
2
2
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
3
3
|
import { TargetDependencies } from '../config/nx-json';
|
|
4
|
+
/**
|
|
5
|
+
* For each task, the overrides every `dependsOn` edge into it would give it,
|
|
6
|
+
* whether or not that edge created the task. `from` is the task the edge
|
|
7
|
+
* leaves; an edge crossing a project without the target is recorded against
|
|
8
|
+
* the task it started from.
|
|
9
|
+
*/
|
|
10
|
+
export type DependencyOverrides = Record<string, Array<{
|
|
11
|
+
from: string;
|
|
12
|
+
overrides: Record<string, unknown>;
|
|
13
|
+
}>>;
|
|
4
14
|
export declare class ProcessTasks {
|
|
5
15
|
private readonly extraTargetDependencies;
|
|
6
16
|
private readonly projectGraph;
|
|
17
|
+
private readonly recordDependencyOverrides;
|
|
7
18
|
private readonly seen;
|
|
8
19
|
readonly tasks: {
|
|
9
20
|
[id: string]: Task;
|
|
@@ -14,18 +25,30 @@ export declare class ProcessTasks {
|
|
|
14
25
|
readonly continuousDependencies: {
|
|
15
26
|
[k: string]: string[];
|
|
16
27
|
};
|
|
28
|
+
readonly dependencyOverrides: DependencyOverrides;
|
|
17
29
|
private readonly allTargetNames;
|
|
18
|
-
constructor(extraTargetDependencies: TargetDependencies, projectGraph: ProjectGraph);
|
|
30
|
+
constructor(extraTargetDependencies: TargetDependencies, projectGraph: ProjectGraph, recordDependencyOverrides?: boolean);
|
|
19
31
|
processTasks(projectNames: string[], targets: string[], configuration: string, overrides: Record<string, unknown>, excludeTaskDependencies: boolean): string[];
|
|
20
32
|
processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides: Record<string, unknown>): void;
|
|
21
33
|
private processTasksForMultipleProjects;
|
|
22
34
|
private processTasksForSingleProject;
|
|
23
35
|
private processTasksForDependencies;
|
|
36
|
+
private recordEdge;
|
|
24
37
|
private createDummyTask;
|
|
25
38
|
createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides: Record<string, unknown>): Task;
|
|
26
39
|
resolveConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string | undefined): string;
|
|
27
40
|
}
|
|
28
41
|
export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Record<string, unknown>, excludeTaskDependencies?: boolean): TaskGraph;
|
|
42
|
+
/** `createTaskGraph`, plus the overrides each dependency edge would give. */
|
|
43
|
+
export declare function createTaskGraphWithDependencyOverrides(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Record<string, unknown>, excludeTaskDependencies?: boolean): {
|
|
44
|
+
taskGraph: TaskGraph;
|
|
45
|
+
dependencyOverrides: DependencyOverrides;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* `taskGraph` pruned to `keep`, as if built from `initial` alone: a kept dependency
|
|
49
|
+
* takes the overrides its edges give it. Undefined when those edges disagree or are missing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function filterTaskGraphToSelection(projectGraph: ProjectGraph, taskGraph: TaskGraph, dependencyOverrides: DependencyOverrides, initial: Set<string>, keep: Set<string>): TaskGraph | undefined;
|
|
29
52
|
/**
|
|
30
53
|
* This function is used to filter out the dummy tasks from the dependencies
|
|
31
54
|
* It will manipulate the dependencies object in place
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessTasks = void 0;
|
|
4
4
|
exports.createTaskGraph = createTaskGraph;
|
|
5
|
+
exports.createTaskGraphWithDependencyOverrides = createTaskGraphWithDependencyOverrides;
|
|
6
|
+
exports.filterTaskGraphToSelection = filterTaskGraphToSelection;
|
|
5
7
|
exports.filterDummyTasks = filterDummyTasks;
|
|
6
8
|
exports.getNonDummyDeps = getNonDummyDeps;
|
|
7
9
|
const utils_1 = require("./utils");
|
|
@@ -10,13 +12,15 @@ const output_1 = require("../utils/output");
|
|
|
10
12
|
const task_graph_utils_1 = require("./task-graph-utils");
|
|
11
13
|
const DUMMY_TASK_TARGET = '__nx_dummy_task__';
|
|
12
14
|
class ProcessTasks {
|
|
13
|
-
constructor(extraTargetDependencies, projectGraph) {
|
|
15
|
+
constructor(extraTargetDependencies, projectGraph, recordDependencyOverrides = false) {
|
|
14
16
|
this.extraTargetDependencies = extraTargetDependencies;
|
|
15
17
|
this.projectGraph = projectGraph;
|
|
18
|
+
this.recordDependencyOverrides = recordDependencyOverrides;
|
|
16
19
|
this.seen = new Set();
|
|
17
20
|
this.tasks = {};
|
|
18
21
|
this.dependencies = {};
|
|
19
22
|
this.continuousDependencies = {};
|
|
23
|
+
this.dependencyOverrides = {};
|
|
20
24
|
const allTargetNames = new Set();
|
|
21
25
|
for (const projectName in projectGraph.nodes) {
|
|
22
26
|
const project = projectGraph.nodes[projectName];
|
|
@@ -126,6 +130,7 @@ class ProcessTasks {
|
|
|
126
130
|
this.processTask(newTask, newTask.target.project, configuration, overrides);
|
|
127
131
|
}
|
|
128
132
|
if (task.id !== selfTaskId) {
|
|
133
|
+
this.recordEdge(task, selfTaskId, taskOverrides);
|
|
129
134
|
if (this.tasks[selfTaskId].continuous) {
|
|
130
135
|
this.continuousDependencies[task.id].push(selfTaskId);
|
|
131
136
|
}
|
|
@@ -149,6 +154,7 @@ class ProcessTasks {
|
|
|
149
154
|
const depTargetId = (0, utils_1.createTaskId)(depProject.name, dependencyConfig.target, resolvedConfiguration);
|
|
150
155
|
const depTargetConfiguration = this.projectGraph.nodes[depProject.name].data.targets[dependencyConfig.target];
|
|
151
156
|
if (task.id !== depTargetId) {
|
|
157
|
+
this.recordEdge(task, depTargetId, taskOverrides);
|
|
152
158
|
if (depTargetConfiguration.continuous) {
|
|
153
159
|
this.continuousDependencies[task.id].push(depTargetId);
|
|
154
160
|
}
|
|
@@ -172,6 +178,7 @@ class ProcessTasks {
|
|
|
172
178
|
dependencyConfig.target +
|
|
173
179
|
DUMMY_TASK_TARGET, undefined);
|
|
174
180
|
this.dependencies[task.id].push(dummyId);
|
|
181
|
+
this.continuousDependencies[task.id].push(dummyId);
|
|
175
182
|
this.dependencies[dummyId] ??= [];
|
|
176
183
|
this.continuousDependencies[dummyId] ??= [];
|
|
177
184
|
const noopTask = this.createDummyTask(dummyId, task);
|
|
@@ -179,6 +186,14 @@ class ProcessTasks {
|
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
}
|
|
189
|
+
recordEdge(task, dependencyId, overrides) {
|
|
190
|
+
if (!this.recordDependencyOverrides) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// A dummy task keeps its creator's target, so `from` is the real task the edge started from.
|
|
194
|
+
const from = (0, utils_1.createTaskId)(task.target.project, task.target.target, task.target.configuration);
|
|
195
|
+
(this.dependencyOverrides[dependencyId] ??= []).push({ from, overrides });
|
|
196
|
+
}
|
|
182
197
|
createDummyTask(id, task) {
|
|
183
198
|
return {
|
|
184
199
|
...task,
|
|
@@ -207,6 +222,7 @@ class ProcessTasks {
|
|
|
207
222
|
cache: project.data.targets[target].cache ?? false,
|
|
208
223
|
parallelism: project.data.targets[target].parallelism ?? true,
|
|
209
224
|
continuous: project.data.targets[target].continuous ?? false,
|
|
225
|
+
ultracache: project.data.targets[target].ultracache,
|
|
210
226
|
};
|
|
211
227
|
}
|
|
212
228
|
resolveConfiguration(project, target, configuration) {
|
|
@@ -219,7 +235,46 @@ class ProcessTasks {
|
|
|
219
235
|
}
|
|
220
236
|
exports.ProcessTasks = ProcessTasks;
|
|
221
237
|
function createTaskGraph(projectGraph, extraTargetDependencies, projectNames, targets, configuration, overrides, excludeTaskDependencies = false) {
|
|
222
|
-
|
|
238
|
+
return buildTaskGraph(new ProcessTasks(extraTargetDependencies, projectGraph), projectNames, targets, configuration, overrides, excludeTaskDependencies);
|
|
239
|
+
}
|
|
240
|
+
/** `createTaskGraph`, plus the overrides each dependency edge would give. */
|
|
241
|
+
function createTaskGraphWithDependencyOverrides(projectGraph, extraTargetDependencies, projectNames, targets, configuration, overrides, excludeTaskDependencies = false) {
|
|
242
|
+
const p = new ProcessTasks(extraTargetDependencies, projectGraph, true);
|
|
243
|
+
const taskGraph = buildTaskGraph(p, projectNames, targets, configuration, overrides, excludeTaskDependencies);
|
|
244
|
+
return { taskGraph, dependencyOverrides: p.dependencyOverrides };
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* `taskGraph` pruned to `keep`, as if built from `initial` alone: a kept dependency
|
|
248
|
+
* takes the overrides its edges give it. Undefined when those edges disagree or are missing.
|
|
249
|
+
*/
|
|
250
|
+
function filterTaskGraphToSelection(projectGraph, taskGraph, dependencyOverrides, initial, keep) {
|
|
251
|
+
const tasks = {};
|
|
252
|
+
for (const id of keep) {
|
|
253
|
+
const task = taskGraph.tasks[id];
|
|
254
|
+
if (initial.has(id)) {
|
|
255
|
+
tasks[id] = { ...task };
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
const edges = dependencyOverrides[id] ?? [];
|
|
259
|
+
if (!edges.length) {
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
const first = JSON.stringify(edges[0].overrides);
|
|
263
|
+
if (edges.some((e) => JSON.stringify(e.overrides) !== first)) {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
const project = projectGraph.nodes[task.target.project];
|
|
267
|
+
const overrides = interpolateOverrides(edges[0].overrides, project.name, project.data);
|
|
268
|
+
tasks[id] = {
|
|
269
|
+
...task,
|
|
270
|
+
overrides,
|
|
271
|
+
outputs: (0, utils_1.getOutputs)(projectGraph.nodes, task.target, overrides),
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const pruned = (0, utils_1.removeTasksFromTaskGraph)(taskGraph, Object.keys(taskGraph.tasks).filter((id) => !keep.has(id)));
|
|
275
|
+
return { ...pruned, tasks };
|
|
276
|
+
}
|
|
277
|
+
function buildTaskGraph(p, projectNames, targets, configuration, overrides, excludeTaskDependencies) {
|
|
223
278
|
const roots = p.processTasks(projectNames, targets, configuration, overrides, excludeTaskDependencies);
|
|
224
279
|
return {
|
|
225
280
|
roots,
|
|
@@ -68,7 +68,7 @@ const defaultTasksRunner = async (tasks, options, context) => {
|
|
|
68
68
|
};
|
|
69
69
|
exports.defaultTasksRunner = defaultTasksRunner;
|
|
70
70
|
async function runAllTasks(options, context) {
|
|
71
|
-
const orchestrator = new task_orchestrator_1.TaskOrchestrator(context.hasher, context.initiatingProject, context.initiatingTasks, context.projectGraph, context.taskGraph, context.nxJson, options, context.nxArgs?.nxBail, context.daemon, context.nxArgs?.
|
|
71
|
+
const orchestrator = new task_orchestrator_1.TaskOrchestrator(context.hasher, context.initiatingProject, context.initiatingTasks, context.projectGraph, context.taskGraph, context.nxJson, options, context.nxArgs?.nxBail, context.daemon, context.nxArgs?.specifiedOutputStyle, context.nxArgs?.resolvedOutputStyle ?? 'static-failures-only', context.taskGraph, context.deferredTaskIds);
|
|
72
72
|
return orchestrator.run();
|
|
73
73
|
}
|
|
74
74
|
exports.default = exports.defaultTasksRunner;
|
|
@@ -17,7 +17,7 @@ export declare class ForkedProcessTaskRunner {
|
|
|
17
17
|
private pseudoTerminals;
|
|
18
18
|
constructor(options: DefaultTasksRunnerOptions, tuiEnabled: boolean);
|
|
19
19
|
init(): Promise<void>;
|
|
20
|
-
forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }: Batch, projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<BatchProcess>;
|
|
20
|
+
forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }: Batch, projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, env: NodeJS.ProcessEnv, printsOutput?: boolean): Promise<BatchProcess>;
|
|
21
21
|
cleanUpBatchProcesses(): void;
|
|
22
22
|
forkProcessLegacy(task: Task, { temporaryOutputPath, streamOutput, pipeOutput, taskGraph, env, }: {
|
|
23
23
|
temporaryOutputPath: string;
|
|
@@ -5,6 +5,7 @@ const child_process_1 = require("child_process");
|
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const output_1 = require("../utils/output");
|
|
8
|
+
const prune_task_graph_1 = require("./prune-task-graph");
|
|
8
9
|
const strip_indents_1 = require("../utils/strip-indents");
|
|
9
10
|
const batch_messages_1 = require("./batch/batch-messages");
|
|
10
11
|
const process_metrics_service_1 = require("./process-metrics-service");
|
|
@@ -29,7 +30,7 @@ class ForkedProcessTaskRunner {
|
|
|
29
30
|
this.setupProcessEventListeners();
|
|
30
31
|
}
|
|
31
32
|
// TODO: vsavkin delegate terminal output printing
|
|
32
|
-
async forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }, projectGraph, fullTaskGraph, env) {
|
|
33
|
+
async forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }, projectGraph, fullTaskGraph, env, printsOutput = true) {
|
|
33
34
|
const count = Object.keys(batchTaskGraph.tasks).length;
|
|
34
35
|
if (count > 1) {
|
|
35
36
|
output_1.output.logSingleLine(`Running ${output_1.output.bold(count)} ${output_1.output.bold('tasks')} with ${output_1.output.bold(executorName)}`);
|
|
@@ -50,7 +51,7 @@ class ForkedProcessTaskRunner {
|
|
|
50
51
|
const taskIds = Object.keys(batchTaskGraph.tasks);
|
|
51
52
|
(0, process_metrics_service_1.getProcessMetricsService)().registerBatch(batchId, taskIds, p.pid);
|
|
52
53
|
}
|
|
53
|
-
const cp = new batch_process_1.BatchProcess(p, executorName);
|
|
54
|
+
const cp = new batch_process_1.BatchProcess(p, executorName, printsOutput, batchId);
|
|
54
55
|
this.processes.add(cp);
|
|
55
56
|
cp.onExit(() => {
|
|
56
57
|
this.processes.delete(cp);
|
|
@@ -60,8 +61,8 @@ class ForkedProcessTaskRunner {
|
|
|
60
61
|
type: batch_messages_1.BatchMessageType.RunTasks,
|
|
61
62
|
executorName,
|
|
62
63
|
projectGraph,
|
|
63
|
-
batchTaskGraph,
|
|
64
|
-
fullTaskGraph,
|
|
64
|
+
batchTaskGraph: (0, prune_task_graph_1.pruneTaskGraph)(batchTaskGraph),
|
|
65
|
+
fullTaskGraph: (0, prune_task_graph_1.pruneTaskGraph)(fullTaskGraph),
|
|
65
66
|
});
|
|
66
67
|
return cp;
|
|
67
68
|
}
|
|
@@ -143,12 +144,12 @@ class ForkedProcessTaskRunner {
|
|
|
143
144
|
// Register forked process for metrics collection
|
|
144
145
|
const pid = p.getPid();
|
|
145
146
|
if (pid) {
|
|
146
|
-
(0, task_io_service_1.registerTaskProcessStart)(task
|
|
147
|
+
(0, task_io_service_1.registerTaskProcessStart)(task, pid);
|
|
147
148
|
}
|
|
148
149
|
p.send({
|
|
149
150
|
targetDescription: task.target,
|
|
150
151
|
overrides: task.overrides,
|
|
151
|
-
taskGraph,
|
|
152
|
+
taskGraph: (0, prune_task_graph_1.pruneTaskGraph)(taskGraph),
|
|
152
153
|
isVerbose: this.verbose,
|
|
153
154
|
});
|
|
154
155
|
this.processes.add(p);
|
|
@@ -180,13 +181,13 @@ class ForkedProcessTaskRunner {
|
|
|
180
181
|
});
|
|
181
182
|
// Register forked process for metrics collection
|
|
182
183
|
if (p.pid) {
|
|
183
|
-
(0, task_io_service_1.registerTaskProcessStart)(task
|
|
184
|
+
(0, task_io_service_1.registerTaskProcessStart)(task, p.pid);
|
|
184
185
|
}
|
|
185
186
|
// Send message to run the executor
|
|
186
187
|
p.send({
|
|
187
188
|
targetDescription: task.target,
|
|
188
189
|
overrides: task.overrides,
|
|
189
|
-
taskGraph,
|
|
190
|
+
taskGraph: (0, prune_task_graph_1.pruneTaskGraph)(taskGraph),
|
|
190
191
|
isVerbose: this.verbose,
|
|
191
192
|
});
|
|
192
193
|
const cp = new node_child_process_1.NodeChildProcessWithNonDirectOutput(p, {
|
|
@@ -223,7 +224,7 @@ class ForkedProcessTaskRunner {
|
|
|
223
224
|
});
|
|
224
225
|
// Register forked process for metrics collection
|
|
225
226
|
if (p.pid) {
|
|
226
|
-
(0, task_io_service_1.registerTaskProcessStart)(task
|
|
227
|
+
(0, task_io_service_1.registerTaskProcessStart)(task, p.pid);
|
|
227
228
|
}
|
|
228
229
|
const cp = new node_child_process_1.NodeChildProcessWithDirectOutput(p, temporaryOutputPath);
|
|
229
230
|
this.processes.add(cp);
|
|
@@ -231,7 +232,7 @@ class ForkedProcessTaskRunner {
|
|
|
231
232
|
p.send({
|
|
232
233
|
targetDescription: task.target,
|
|
233
234
|
overrides: task.overrides,
|
|
234
|
-
taskGraph,
|
|
235
|
+
taskGraph: (0, prune_task_graph_1.pruneTaskGraph)(taskGraph),
|
|
235
236
|
isVerbose: this.verbose,
|
|
236
237
|
});
|
|
237
238
|
cp.onExit((code, signal) => {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { NxJsonConfiguration } from '../config/nx-json';
|
|
2
2
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
3
3
|
import { LifeCycle, TaskResult } from './life-cycle';
|
|
4
|
+
import type { UltracacheConfigurations } from '../native';
|
|
4
5
|
import type { ProjectGraph } from '../config/project-graph';
|
|
5
6
|
import { RunningTask } from './running-tasks/running-task';
|
|
6
|
-
export declare function runDiscreteTasks(tasks: Task[], projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle
|
|
7
|
-
|
|
7
|
+
export declare function runDiscreteTasks(tasks: Task[], projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle,
|
|
8
|
+
/** The set to hash from, e.g. from `importUltracacheConfigurations`; omitted hashes natively. */
|
|
9
|
+
ultracacheConfigurations?: UltracacheConfigurations): Promise<Array<Promise<TaskResult[]>>>;
|
|
10
|
+
export declare function runContinuousTasks(tasks: Task[], projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, nxJson: NxJsonConfiguration, lifeCycle: LifeCycle,
|
|
11
|
+
/** The set to hash from, e.g. from `importUltracacheConfigurations`; omitted hashes natively. */
|
|
12
|
+
ultracacheConfigurations?: UltracacheConfigurations): Promise<Record<string, Promise<RunningTask>>>;
|
|
@@ -11,7 +11,7 @@ const create_task_hasher_1 = require("../hasher/create-task-hasher");
|
|
|
11
11
|
const client_1 = require("../daemon/client/client");
|
|
12
12
|
const shared_running_task_1 = require("./running-tasks/shared-running-task");
|
|
13
13
|
const task_results_life_cycle_1 = require("./life-cycles/task-results-life-cycle");
|
|
14
|
-
async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle) {
|
|
14
|
+
async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle, ultracacheConfigurations) {
|
|
15
15
|
(0, dotenv_1.loadRootEnvFiles)();
|
|
16
16
|
const invokeRunnerTerminalLifecycle = new invoke_runner_terminal_output_life_cycle_1.InvokeRunnerTerminalOutputLifeCycle(tasks);
|
|
17
17
|
const taskResultsLifecycle = new task_results_life_cycle_1.TaskResultsLifeCycle();
|
|
@@ -21,7 +21,6 @@ async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, li
|
|
|
21
21
|
lifeCycle,
|
|
22
22
|
]);
|
|
23
23
|
const { runnerOptions: options } = (0, run_command_1.getRunner)({}, nxJson);
|
|
24
|
-
let hasher = (0, create_task_hasher_1.createTaskHasher)(projectGraph, nxJson, options);
|
|
25
24
|
const taskGraph = {
|
|
26
25
|
roots: tasks.map((task) => task.id),
|
|
27
26
|
tasks: tasks.reduce((acc, task) => {
|
|
@@ -37,13 +36,18 @@ async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, li
|
|
|
37
36
|
return acc;
|
|
38
37
|
}, {}),
|
|
39
38
|
};
|
|
39
|
+
const hasher = (0, create_task_hasher_1.createTaskHasher)(projectGraph, nxJson, options, ultracacheConfigurations);
|
|
40
40
|
const nxArgs = {
|
|
41
41
|
...options,
|
|
42
42
|
parallel: tasks.length,
|
|
43
43
|
lifeCycle: compositedLifeCycle,
|
|
44
44
|
};
|
|
45
45
|
(0, run_command_1.setEnvVarsBasedOnArgs)(nxArgs, true);
|
|
46
|
-
const orchestrator = new task_orchestrator_1.TaskOrchestrator(hasher, null, tasks, projectGraph, taskGraph, nxJson, nxArgs, false, client_1.daemonClient,
|
|
46
|
+
const orchestrator = new task_orchestrator_1.TaskOrchestrator(hasher, null, tasks, projectGraph, taskGraph, nxJson, nxArgs, false, client_1.daemonClient,
|
|
47
|
+
// No argv on this path, so the output-style middleware never ran and both
|
|
48
|
+
// fields are unset - this always renders `static-failures-only`. `nx.json`'s
|
|
49
|
+
// `outputStyle` does not reach them; it merges under its own name.
|
|
50
|
+
nxArgs.specifiedOutputStyle, nxArgs.resolvedOutputStyle ?? 'static-failures-only', fullTaskGraph);
|
|
47
51
|
await orchestrator.init();
|
|
48
52
|
orchestrator.processAllScheduledTasks();
|
|
49
53
|
return orchestrator;
|
|
@@ -53,8 +57,10 @@ async function createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, li
|
|
|
53
57
|
function logDisposeFailure(e) {
|
|
54
58
|
console.error('Failed to dispose the task orchestrator:', e);
|
|
55
59
|
}
|
|
56
|
-
async function runDiscreteTasks(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle
|
|
57
|
-
|
|
60
|
+
async function runDiscreteTasks(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle,
|
|
61
|
+
/** The set to hash from, e.g. from `importUltracacheConfigurations`; omitted hashes natively. */
|
|
62
|
+
ultracacheConfigurations) {
|
|
63
|
+
const orchestrator = await createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle, ultracacheConfigurations);
|
|
58
64
|
let groupId = 0;
|
|
59
65
|
let nextBatch = orchestrator.nextBatch();
|
|
60
66
|
const batchResults = [];
|
|
@@ -92,8 +98,10 @@ async function runDiscreteTasks(tasks, projectGraph, fullTaskGraph, nxJson, life
|
|
|
92
98
|
.catch(logDisposeFailure);
|
|
93
99
|
return results;
|
|
94
100
|
}
|
|
95
|
-
async function runContinuousTasks(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle
|
|
96
|
-
|
|
101
|
+
async function runContinuousTasks(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle,
|
|
102
|
+
/** The set to hash from, e.g. from `importUltracacheConfigurations`; omitted hashes natively. */
|
|
103
|
+
ultracacheConfigurations) {
|
|
104
|
+
const orchestrator = await createOrchestrator(tasks, projectGraph, fullTaskGraph, nxJson, lifeCycle, ultracacheConfigurations);
|
|
97
105
|
const runningTasks = tasks.reduce((current, task, index) => {
|
|
98
106
|
current[task.id] = orchestrator.startContinuousTask(task, index);
|
|
99
107
|
return current;
|
|
@@ -39,12 +39,13 @@ function shouldUseTui(nxJson, nxArgs, skipCapabilityCheck = process.env.NX_TUI_S
|
|
|
39
39
|
if (!isCapable) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
-
if ((0, output_1.isStaticOutputStyle)(nxArgs.
|
|
43
|
-
['stream', 'stream-without-prefixes', 'dynamic-legacy'].includes(nxArgs.
|
|
42
|
+
if ((0, output_1.isStaticOutputStyle)(nxArgs.specifiedOutputStyle) ||
|
|
43
|
+
['summary', 'stream', 'stream-without-prefixes', 'dynamic-legacy'].includes(nxArgs.specifiedOutputStyle)) {
|
|
44
44
|
// If the user has specified a non-TUI output style, we disable the TUI
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
|
-
if (nxArgs.
|
|
47
|
+
if (nxArgs.specifiedOutputStyle === 'dynamic' ||
|
|
48
|
+
nxArgs.specifiedOutputStyle === 'tui') {
|
|
48
49
|
return true;
|
|
49
50
|
}
|
|
50
51
|
// The environment variable takes precedence over the nx.json config, but
|
|
@@ -53,6 +53,12 @@ export interface LifeCycle {
|
|
|
53
53
|
setEstimatedTaskTimings?(timings: Record<string, number>): void;
|
|
54
54
|
registerRunningBatch?(batchId: string, batchInfo: BatchInfo): void;
|
|
55
55
|
appendBatchOutput?(batchId: string, output: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* The batch worker's own log is on disk and worth reading — its tasks did not
|
|
58
|
+
* all succeed. One log per worker, so this is addressed once for the batch
|
|
59
|
+
* rather than copied into any task's output.
|
|
60
|
+
*/
|
|
61
|
+
batchOutputAvailable?(batchId: string, path: string): void;
|
|
56
62
|
setBatchStatus?(batchId: string, status: BatchStatus): void;
|
|
57
63
|
/**
|
|
58
64
|
* Set a clickable Nx Cloud link in the terminal UI: `label` is the text
|
|
@@ -81,6 +87,7 @@ export declare class CompositeLifeCycle implements LifeCycle {
|
|
|
81
87
|
setEstimatedTaskTimings(timings: Record<string, number>): void;
|
|
82
88
|
registerRunningBatch(batchId: string, batchInfo: BatchInfo): void;
|
|
83
89
|
appendBatchOutput(batchId: string, output: string): void;
|
|
90
|
+
batchOutputAvailable(batchId: string, path: string): void;
|
|
84
91
|
setBatchStatus(batchId: string, status: BatchStatus): void;
|
|
85
92
|
setCloudLink(label: string, url: string): Promise<void>;
|
|
86
93
|
}
|
|
@@ -130,6 +130,13 @@ class CompositeLifeCycle {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
+
batchOutputAvailable(batchId, path) {
|
|
134
|
+
for (let l of this.lifeCycles) {
|
|
135
|
+
if (l.batchOutputAvailable) {
|
|
136
|
+
l.batchOutputAvailable(batchId, path);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
133
140
|
setBatchStatus(batchId, status) {
|
|
134
141
|
for (let l of this.lifeCycles) {
|
|
135
142
|
if (l.setBatchStatus) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Task } from '../../config/task-graph';
|
|
2
|
+
import type { LifeCycle, TaskResult } from '../life-cycle';
|
|
3
|
+
/**
|
|
4
|
+
* Prints a run as a handful of lines rather than a transcript: counts, then one
|
|
5
|
+
* line per failure naming the file that holds its output. Task output stops
|
|
6
|
+
* being a stream to read and becomes an artifact to address, so the size of this
|
|
7
|
+
* renderer's output depends on how many tasks failed, never on how loud they
|
|
8
|
+
* were.
|
|
9
|
+
*
|
|
10
|
+
* Selected by `--output-style=summary`, and by default when Nx is driven by an
|
|
11
|
+
* AI agent, which otherwise reads thousands of lines of passing output to find
|
|
12
|
+
* the one failure.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SummaryTerminalOutputLifeCycle implements LifeCycle {
|
|
15
|
+
private readonly tasks;
|
|
16
|
+
private readonly failed;
|
|
17
|
+
private readonly stopped;
|
|
18
|
+
private readonly completed;
|
|
19
|
+
private succeeded;
|
|
20
|
+
private cached;
|
|
21
|
+
private cloudLink;
|
|
22
|
+
private readonly batchLogs;
|
|
23
|
+
constructor(tasks: Task[]);
|
|
24
|
+
setCloudLink(label: string, url: string): void;
|
|
25
|
+
batchOutputAvailable(batchId: string, path: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Nothing is printed as tasks complete. A summary that interleaved with
|
|
28
|
+
* progress would be a transcript again.
|
|
29
|
+
*/
|
|
30
|
+
printTaskTerminalOutput(): void;
|
|
31
|
+
endTasks(taskResults: TaskResult[]): void;
|
|
32
|
+
endCommand(): void;
|
|
33
|
+
private countsLine;
|
|
34
|
+
private failureBlock;
|
|
35
|
+
}
|