@depup/nx 23.2.1-depup.7 → 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 +8 -19
- package/changes.json +10 -54
- 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 +38 -100
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e
|
|
1
|
+
(()=>{"use strict";var e={};const r={};function t(n){const o=r[n];if(void 0!==o)return o.exports;const i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}t.m=e,(()=>{const e=[];t.O=(r,n,o,i)=>{if(n){i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];return void(e[l]=[n,o,i])}let a=1/0;for(l=0;l<e.length;l++){let[n,o,i]=e[l],u=!0;for(var c=0;c<n.length;c++)(!1&i||a>=i)&&Object.keys(t.O).every(e=>t.O[e](n[c]))?n.splice(c--,1):(u=!1,i<a&&(a=i));if(u){e.splice(l--,1);const t=o();void 0!==t&&(r=t)}}return r}})(),t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var o=r[n++],i=r[n++];t.o(e,o)?0===i&&n++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.dn=e=>{var r=Object.getOwnPropertyDescriptor(e,"name");(!r||!r.writable&&r.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={121:0};t.O.j=r=>0===e[r];const r=(r,n)=>{let[o,i,l]=n;var a,c,u=0;if(o.some(r=>0!==e[r])){for(a in i)t.o(i,a)&&(t.m[a]=i[a]);if(l)var f=l(t)}for(r&&r(n);u<o.length;u++)c=o[u],t.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return t.O(f)},n=self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[]).push([[869],{
|
|
1
|
+
"use strict";(self.webpackChunk_nx_graph_client=self.webpackChunk_nx_graph_client||[]).push([[869],{4091(){}},e=>{var n;n=4091,e(e.s=n)}]);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
2
|
import { FileData, ProjectGraph } from '../../config/project-graph';
|
|
3
3
|
import { Task, TaskGraph } from '../../config/task-graph';
|
|
4
|
+
import type { UltracacheConfigurationVersion } from '../message-types/ultracache-configuration-version';
|
|
4
5
|
import { Hash } from '../../hasher/task-hasher';
|
|
5
|
-
import { NxWorkspaceFiles, TaskRun, TaskTarget } from '../../native';
|
|
6
|
-
import {
|
|
6
|
+
import { NxWorkspaceFiles, TaskOutputs, TaskRun, TaskTarget } from '../../native';
|
|
7
|
+
import { PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
|
|
8
|
+
import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
|
|
7
9
|
import { ConfigurationSourceMaps } from '../../project-graph/utils/project-configuration/source-maps';
|
|
8
10
|
import type { FlushSyncGeneratorChangesResult, SyncGeneratorRunResult } from '../../utils/sync-generators';
|
|
9
11
|
import { type ConfigureAiAgentsStatusResponse } from '../message-types/configure-ai-agents';
|
|
12
|
+
import { type SelectAffectedTasksResponse } from '../message-types/select-affected-tasks';
|
|
13
|
+
import type { AffectedTasksRequest } from '../../project-graph/affected/affected-tasks';
|
|
14
|
+
import type { NxPluginCapabilities } from '../../project-graph/plugins/nx-plugin-capabilities';
|
|
10
15
|
import { type NxConsoleStatusResponse, type SetNxConsolePreferenceAndInstallResponse } from '../message-types/nx-console';
|
|
11
16
|
/** A refused connect: the errno, and the path it was made against. */
|
|
12
17
|
type ConnectRefusal = {
|
|
@@ -56,7 +61,8 @@ export declare class DaemonClient {
|
|
|
56
61
|
sourceMaps: ConfigurationSourceMaps;
|
|
57
62
|
}>;
|
|
58
63
|
getAllFileData(): Promise<FileData[]>;
|
|
59
|
-
hashTasks(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean): Promise<Hash[]>;
|
|
64
|
+
hashTasks(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean, ultracacheConfigurationsVersion?: UltracacheConfigurationVersion): Promise<Hash[]>;
|
|
65
|
+
hashTasksUpfront(runnerOptions: any, tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd: string, collectInputs?: boolean, ultracacheConfigurationsVersion?: UltracacheConfigurationVersion): Promise<Record<string, Hash>>;
|
|
60
66
|
registerFileWatcher(config: {
|
|
61
67
|
watchProjects: string[] | 'all';
|
|
62
68
|
includeGlobalWorkspaceFiles?: boolean;
|
|
@@ -74,10 +80,7 @@ export declare class DaemonClient {
|
|
|
74
80
|
} | null) => void): Promise<UnregisterCallback>;
|
|
75
81
|
private reconnectProjectGraphListener;
|
|
76
82
|
processInBackground(requirePath: string, data: any): Promise<any>;
|
|
77
|
-
recordOutputsHashBatch(entries:
|
|
78
|
-
outputs: string[];
|
|
79
|
-
hash: string;
|
|
80
|
-
}[]): Promise<any>;
|
|
83
|
+
recordOutputsHashBatch(entries: TaskOutputs[]): Promise<any>;
|
|
81
84
|
outputsHashesMatchBatch(entries: {
|
|
82
85
|
outputs: string[];
|
|
83
86
|
hash: string;
|
|
@@ -98,9 +101,12 @@ export declare class DaemonClient {
|
|
|
98
101
|
globalGenerators: string[];
|
|
99
102
|
taskGenerators: string[];
|
|
100
103
|
}>;
|
|
104
|
+
getPluginCapabilities(): Promise<NxPluginCapabilities[]>;
|
|
105
|
+
/** Selection runs where hashing does, so the plans it builds are reused. */
|
|
106
|
+
selectAffectedTasks(request: AffectedTasksRequest): Promise<SelectAffectedTasksResponse>;
|
|
101
107
|
updateWorkspaceContext(createdFiles: string[], updatedFiles: string[], deletedFiles: string[]): Promise<void>;
|
|
102
108
|
runPreTasksExecution(context: PreTasksExecutionContext): Promise<NodeJS.ProcessEnv[]>;
|
|
103
|
-
runPostTasksExecution(context:
|
|
109
|
+
runPostTasksExecution(context: MaybeStubbedPostTasksExecutionContext): Promise<void>;
|
|
104
110
|
getNxConsoleStatus(): Promise<NxConsoleStatusResponse>;
|
|
105
111
|
setNxConsolePreferenceAndInstall(preference: boolean): Promise<SetNxConsolePreferenceAndInstallResponse>;
|
|
106
112
|
getConfigureAiAgentsStatus(): Promise<ConfigureAiAgentsStatusResponse>;
|
|
@@ -11,6 +11,7 @@ const path_1 = require("path");
|
|
|
11
11
|
const perf_hooks_1 = require("perf_hooks");
|
|
12
12
|
const configuration_1 = require("../../config/configuration");
|
|
13
13
|
const nx_json_1 = require("../../config/nx-json");
|
|
14
|
+
const prune_task_graph_1 = require("../../tasks-runner/prune-task-graph");
|
|
14
15
|
const native_1 = require("../../native");
|
|
15
16
|
const error_types_1 = require("../../project-graph/error-types");
|
|
16
17
|
const typescript_1 = require("../../plugins/js/utils/typescript");
|
|
@@ -34,6 +35,8 @@ const get_context_file_data_1 = require("../message-types/get-context-file-data"
|
|
|
34
35
|
const get_files_in_directory_1 = require("../message-types/get-files-in-directory");
|
|
35
36
|
const get_nx_workspace_files_1 = require("../message-types/get-nx-workspace-files");
|
|
36
37
|
const get_registered_sync_generators_1 = require("../message-types/get-registered-sync-generators");
|
|
38
|
+
const get_plugin_capabilities_1 = require("../message-types/get-plugin-capabilities");
|
|
39
|
+
const select_affected_tasks_1 = require("../message-types/select-affected-tasks");
|
|
37
40
|
const get_sync_generator_changes_1 = require("../message-types/get-sync-generator-changes");
|
|
38
41
|
const hash_glob_1 = require("../message-types/hash-glob");
|
|
39
42
|
const nx_console_1 = require("../message-types/nx-console");
|
|
@@ -74,6 +77,14 @@ exports.WatcherFailedError = WatcherFailedError;
|
|
|
74
77
|
* re-dialing once this many land back to back without a message in between.
|
|
75
78
|
*/
|
|
76
79
|
const MAX_CONSECUTIVE_FRAMING_FAILURES = 3;
|
|
80
|
+
// Task results get written back onto these task objects as the run
|
|
81
|
+
// progresses — hash/hashDetails/timestamps by hashing and the orchestrator,
|
|
82
|
+
// terminalOutput by the Nx Cloud life cycle (untyped) — so a later message
|
|
83
|
+
// would otherwise re-ship every earlier result.
|
|
84
|
+
function withoutTaskResults(tasks, taskGraph) {
|
|
85
|
+
const pruned = (0, prune_task_graph_1.pruneTaskGraph)(taskGraph);
|
|
86
|
+
return { tasks: tasks.map((t) => pruned.tasks[t.id]), taskGraph: pruned };
|
|
87
|
+
}
|
|
77
88
|
class DaemonClient {
|
|
78
89
|
constructor() {
|
|
79
90
|
// Tracks the spinner owned by the in-flight request so streamed
|
|
@@ -200,24 +211,28 @@ class DaemonClient {
|
|
|
200
211
|
async getAllFileData() {
|
|
201
212
|
return await this.sendToDaemonViaQueue({ type: 'REQUEST_FILE_DATA' });
|
|
202
213
|
}
|
|
203
|
-
hashTasks(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs) {
|
|
204
|
-
// Task results get written back onto these task objects as the run
|
|
205
|
-
// progresses — hash/hashDetails/timestamps by hashing and the
|
|
206
|
-
// orchestrator, terminalOutput by the Nx Cloud life cycle (untyped) —
|
|
207
|
-
// so a later message would otherwise re-ship every earlier result.
|
|
208
|
-
const trimmedTasks = {};
|
|
209
|
-
for (const [id, t] of Object.entries(taskGraph.tasks)) {
|
|
210
|
-
const { hash, hashDetails, startTime, endTime, terminalOutput, ...strippedTask } = t;
|
|
211
|
-
trimmedTasks[id] = strippedTask;
|
|
212
|
-
}
|
|
214
|
+
hashTasks(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurationsVersion) {
|
|
213
215
|
return this.sendToDaemonViaQueue({
|
|
214
216
|
type: 'HASH_TASKS',
|
|
215
217
|
runnerOptions,
|
|
216
218
|
perTaskEnvs,
|
|
217
|
-
tasks
|
|
218
|
-
|
|
219
|
+
...withoutTaskResults(tasks, taskGraph),
|
|
220
|
+
cwd,
|
|
221
|
+
collectInputs,
|
|
222
|
+
// An External cannot cross the socket: the version names the stored set
|
|
223
|
+
// to hash from. Absent means native hashing.
|
|
224
|
+
ultracacheConfigurationsVersion,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
hashTasksUpfront(runnerOptions, tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurationsVersion) {
|
|
228
|
+
return this.sendToDaemonViaQueue({
|
|
229
|
+
type: 'HASH_TASKS_UPFRONT',
|
|
230
|
+
runnerOptions,
|
|
231
|
+
perTaskEnvs,
|
|
232
|
+
...withoutTaskResults(tasks, taskGraph),
|
|
219
233
|
cwd,
|
|
220
234
|
collectInputs,
|
|
235
|
+
ultracacheConfigurationsVersion,
|
|
221
236
|
});
|
|
222
237
|
}
|
|
223
238
|
async registerFileWatcher(config, callback) {
|
|
@@ -709,6 +724,20 @@ class DaemonClient {
|
|
|
709
724
|
};
|
|
710
725
|
return this.sendToDaemonViaQueue(message);
|
|
711
726
|
}
|
|
727
|
+
getPluginCapabilities() {
|
|
728
|
+
const message = {
|
|
729
|
+
type: get_plugin_capabilities_1.GET_PLUGIN_CAPABILITIES,
|
|
730
|
+
};
|
|
731
|
+
return this.sendToDaemonViaQueue(message);
|
|
732
|
+
}
|
|
733
|
+
/** Selection runs where hashing does, so the plans it builds are reused. */
|
|
734
|
+
selectAffectedTasks(request) {
|
|
735
|
+
const message = {
|
|
736
|
+
type: select_affected_tasks_1.SELECT_AFFECTED_TASKS,
|
|
737
|
+
request,
|
|
738
|
+
};
|
|
739
|
+
return this.sendToDaemonViaQueue(message);
|
|
740
|
+
}
|
|
712
741
|
updateWorkspaceContext(createdFiles, updatedFiles, deletedFiles) {
|
|
713
742
|
const message = {
|
|
714
743
|
type: update_workspace_context_1.UPDATE_WORKSPACE_CONTEXT,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const GET_PLUGIN_CAPABILITIES: 'GET_PLUGIN_CAPABILITIES';
|
|
2
|
+
export type HandleGetPluginCapabilitiesMessage = {
|
|
3
|
+
type: typeof GET_PLUGIN_CAPABILITIES;
|
|
4
|
+
};
|
|
5
|
+
export declare function isHandleGetPluginCapabilitiesMessage(message: unknown): message is HandleGetPluginCapabilitiesMessage;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_PLUGIN_CAPABILITIES = void 0;
|
|
4
|
+
exports.isHandleGetPluginCapabilitiesMessage = isHandleGetPluginCapabilitiesMessage;
|
|
5
|
+
exports.GET_PLUGIN_CAPABILITIES = 'GET_PLUGIN_CAPABILITIES';
|
|
6
|
+
function isHandleGetPluginCapabilitiesMessage(message) {
|
|
7
|
+
return (typeof message === 'object' &&
|
|
8
|
+
message !== null &&
|
|
9
|
+
'type' in message &&
|
|
10
|
+
message['type'] === exports.GET_PLUGIN_CAPABILITIES);
|
|
11
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreTasksExecutionContext } from '../../project-graph/plugins';
|
|
2
|
+
import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
|
|
2
3
|
export declare const PRE_TASKS_EXECUTION: 'PRE_TASKS_EXECUTION';
|
|
3
4
|
export declare const POST_TASKS_EXECUTION: 'POST_TASKS_EXECUTION';
|
|
4
5
|
export type HandlePreTasksExecutionMessage = {
|
|
@@ -7,7 +8,7 @@ export type HandlePreTasksExecutionMessage = {
|
|
|
7
8
|
};
|
|
8
9
|
export type HandlePostTasksExecutionMessage = {
|
|
9
10
|
type: typeof POST_TASKS_EXECUTION;
|
|
10
|
-
context:
|
|
11
|
+
context: MaybeStubbedPostTasksExecutionContext;
|
|
11
12
|
};
|
|
12
13
|
export declare function isHandlePreTasksExecutionMessage(message: unknown): message is HandlePreTasksExecutionMessage;
|
|
13
14
|
export declare function isHandlePostTasksExecutionMessage(message: unknown): message is HandlePostTasksExecutionMessage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ProjectGraph } from '../../config/project-graph';
|
|
2
|
+
import type { TaskGraph } from '../../config/task-graph';
|
|
3
|
+
import type { TaskSelection } from '../../tasks-runner/run-command';
|
|
4
|
+
import type { AffectedTasksRequest } from '../../project-graph/affected/affected-tasks';
|
|
5
|
+
import type { InternedExplanation } from '../../project-graph/affected/affected-reasons';
|
|
6
|
+
export declare const SELECT_AFFECTED_TASKS: 'SELECT_AFFECTED_TASKS';
|
|
7
|
+
export type HandleSelectAffectedTasksMessage = {
|
|
8
|
+
type: typeof SELECT_AFFECTED_TASKS;
|
|
9
|
+
request: AffectedTasksRequest;
|
|
10
|
+
};
|
|
11
|
+
export type SelectAffectedTasksResponse = {
|
|
12
|
+
/** The graph selection ran against, for the command to run with. */
|
|
13
|
+
projectGraph: ProjectGraph;
|
|
14
|
+
affectedTaskIds: string[];
|
|
15
|
+
taskGraph: TaskGraph;
|
|
16
|
+
/** Without a planning context: the plans stay in the daemon. */
|
|
17
|
+
taskSelection: TaskSelection;
|
|
18
|
+
/** Interned, so it stays small on the wire; the client hydrates it. */
|
|
19
|
+
explanation?: InternedExplanation;
|
|
20
|
+
};
|
|
21
|
+
export declare function isHandleSelectAffectedTasksMessage(message: unknown): message is HandleSelectAffectedTasksMessage;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SELECT_AFFECTED_TASKS = void 0;
|
|
4
|
+
exports.isHandleSelectAffectedTasksMessage = isHandleSelectAffectedTasksMessage;
|
|
5
|
+
exports.SELECT_AFFECTED_TASKS = 'SELECT_AFFECTED_TASKS';
|
|
6
|
+
function isHandleSelectAffectedTasksMessage(message) {
|
|
7
|
+
return (typeof message === 'object' &&
|
|
8
|
+
message !== null &&
|
|
9
|
+
'type' in message &&
|
|
10
|
+
message['type'] === exports.SELECT_AFFECTED_TASKS);
|
|
11
|
+
}
|
|
@@ -16,7 +16,7 @@ export interface DotEnvChangeClassification {
|
|
|
16
16
|
*
|
|
17
17
|
* Only the workspace root and project roots invalidate: getEnvPathsForTask
|
|
18
18
|
* loads dotenv files from those, never from an arbitrary subdirectory (e.g. one
|
|
19
|
-
* under node_modules), and the
|
|
19
|
+
* under node_modules), and the raw-event stream spans the whole workspace root.
|
|
20
20
|
* An unclassified event is not necessarily irrelevant, though: the graph it was
|
|
21
21
|
* classified against can predate the file's project root (none is committed
|
|
22
22
|
* during the initial computation, and a replaced graph lacks a project that
|
|
@@ -34,7 +34,7 @@ function isDotEnvName(name) {
|
|
|
34
34
|
*
|
|
35
35
|
* Only the workspace root and project roots invalidate: getEnvPathsForTask
|
|
36
36
|
* loads dotenv files from those, never from an arbitrary subdirectory (e.g. one
|
|
37
|
-
* under node_modules), and the
|
|
37
|
+
* under node_modules), and the raw-event stream spans the whole workspace root.
|
|
38
38
|
* An unclassified event is not necessarily irrelevant, though: the graph it was
|
|
39
39
|
* classified against can predate the file's project root (none is committed
|
|
40
40
|
* during the initial computation, and a replaced graph lacks a project that
|
|
@@ -138,7 +138,7 @@ function isDotEnvUnderRoot(path, roots) {
|
|
|
138
138
|
}
|
|
139
139
|
// Paths of dotenv-shaped events whose graph refresh is not provably scheduled:
|
|
140
140
|
// paths under no known root on arrival (the next graph may know the root) and
|
|
141
|
-
// edits to tracked files (the
|
|
141
|
+
// edits to tracked files (the file-change stream schedules the refresh, but a
|
|
142
142
|
// computation already in flight may have read the file before the edit). Each
|
|
143
143
|
// maps to the recomputation generation current at queue time, so the pre-serve
|
|
144
144
|
// replay can prove whether a computation started before the event arrived.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleGetPluginCapabilities = handleGetPluginCapabilities;
|
|
4
|
+
const nx_json_1 = require("../../config/nx-json");
|
|
5
|
+
const get_plugins_1 = require("../../project-graph/plugins/get-plugins");
|
|
6
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
|
7
|
+
async function handleGetPluginCapabilities() {
|
|
8
|
+
const plugins = await (0, get_plugins_1.getPlugins)((0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot), workspace_root_1.workspaceRoot);
|
|
9
|
+
return {
|
|
10
|
+
response: plugins.map((plugin) => plugin.capabilities()),
|
|
11
|
+
description: 'handleGetPluginCapabilities',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { Task, TaskGraph } from '../../config/task-graph';
|
|
2
|
-
|
|
2
|
+
import type { UltracacheConfigurationVersion } from '../message-types/ultracache-configuration-version';
|
|
3
|
+
interface HashTasksPayload {
|
|
3
4
|
runnerOptions: any;
|
|
4
5
|
tasks: Task[];
|
|
5
6
|
taskGraph: TaskGraph;
|
|
6
7
|
perTaskEnvs: Record<string, NodeJS.ProcessEnv>;
|
|
7
8
|
cwd: string;
|
|
8
9
|
collectInputs?: boolean;
|
|
9
|
-
|
|
10
|
+
ultracacheConfigurationsVersion?: UltracacheConfigurationVersion;
|
|
11
|
+
}
|
|
12
|
+
export declare function handleHashTasks(payload: HashTasksPayload): Promise<{
|
|
10
13
|
response: import("../../hasher/task-hasher").Hash[];
|
|
11
14
|
description: string;
|
|
12
15
|
}>;
|
|
16
|
+
export declare function handleHashTasksUpfront(payload: HashTasksPayload): Promise<{
|
|
17
|
+
response: Record<string, import("../../hasher/task-hasher").Hash>;
|
|
18
|
+
description: string;
|
|
19
|
+
}>;
|
|
20
|
+
export {};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleHashTasks = handleHashTasks;
|
|
4
|
+
exports.handleHashTasksUpfront = handleHashTasksUpfront;
|
|
4
5
|
const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
|
|
5
6
|
const task_hasher_1 = require("../../hasher/task-hasher");
|
|
6
7
|
const configuration_1 = require("../../config/configuration");
|
|
8
|
+
const ultracache_configuration_state_1 = require("./ultracache-configuration-state");
|
|
9
|
+
const planning_context_1 = require("./planning-context");
|
|
7
10
|
/**
|
|
8
11
|
* We use this not to recreated hasher for every hash operation
|
|
9
12
|
* TaskHasher has a cache inside, so keeping it around results in faster performance
|
|
10
13
|
*/
|
|
11
14
|
let storedProjectGraph = null;
|
|
12
15
|
let storedHasher = null;
|
|
13
|
-
async function
|
|
16
|
+
async function getHasher(runnerOptions) {
|
|
14
17
|
const { error, projectGraph, rustReferences } = await (0, project_graph_incremental_recomputation_1.getCachedSerializedProjectGraphPromise)();
|
|
15
18
|
if (error) {
|
|
16
19
|
throw error;
|
|
@@ -18,11 +21,23 @@ async function handleHashTasks(payload) {
|
|
|
18
21
|
const nxJson = (0, configuration_1.readNxJson)();
|
|
19
22
|
if (projectGraph !== storedProjectGraph) {
|
|
20
23
|
storedProjectGraph = projectGraph;
|
|
21
|
-
storedHasher = new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences,
|
|
24
|
+
storedHasher = new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences, runnerOptions, (0, planning_context_1.planningContextFor)(projectGraph, nxJson));
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
return storedHasher;
|
|
27
|
+
}
|
|
28
|
+
async function handleHashTasks(payload) {
|
|
29
|
+
const hasher = await getHasher(payload.runnerOptions);
|
|
30
|
+
const response = await hasher.hashTasks(payload.tasks, payload.taskGraph, payload.perTaskEnvs, payload.cwd, payload.collectInputs, (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(payload.ultracacheConfigurationsVersion));
|
|
24
31
|
return {
|
|
25
32
|
response,
|
|
26
33
|
description: 'handleHashTasks',
|
|
27
34
|
};
|
|
28
35
|
}
|
|
36
|
+
async function handleHashTasksUpfront(payload) {
|
|
37
|
+
const hasher = await getHasher(payload.runnerOptions);
|
|
38
|
+
const response = await hasher.hashTasksUpfront(payload.tasks, payload.taskGraph, payload.perTaskEnvs, payload.cwd, payload.collectInputs, (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(payload.ultracacheConfigurationsVersion));
|
|
39
|
+
return {
|
|
40
|
+
response,
|
|
41
|
+
description: 'handleHashTasksUpfront',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleSelectAffectedTasks = handleSelectAffectedTasks;
|
|
4
|
+
const configuration_1 = require("../../config/configuration");
|
|
5
|
+
const affected_tasks_1 = require("../../project-graph/affected/affected-tasks");
|
|
6
|
+
const ultracache_configuration_state_1 = require("./ultracache-configuration-state");
|
|
7
|
+
const planning_context_1 = require("./planning-context");
|
|
8
|
+
const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
|
|
9
|
+
async function handleSelectAffectedTasks(request) {
|
|
10
|
+
const { error, projectGraph } = await (0, project_graph_incremental_recomputation_1.getCachedSerializedProjectGraphPromise)();
|
|
11
|
+
if (error) {
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
const nxJson = (0, configuration_1.readNxJson)();
|
|
15
|
+
const selection = await (0, affected_tasks_1.selectAffectedTasks)(projectGraph, nxJson, (0, planning_context_1.planningContextFor)(projectGraph, nxJson), request, {
|
|
16
|
+
ultracacheConfigurations: (0, ultracache_configuration_state_1.getUltracacheConfigurationsForVersion)(request.ultracacheConfigurationsVersion),
|
|
17
|
+
});
|
|
18
|
+
const response = {
|
|
19
|
+
projectGraph,
|
|
20
|
+
affectedTaskIds: [...selection.affectedTaskIds],
|
|
21
|
+
taskGraph: selection.taskGraph,
|
|
22
|
+
taskSelection: selection.taskSelection,
|
|
23
|
+
explanation: selection.explanation,
|
|
24
|
+
};
|
|
25
|
+
return { response, description: 'handleSelectAffectedTasks' };
|
|
26
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
|
|
2
|
+
import type { MaybeStubbedPostTasksExecutionContext } from '../../project-graph/plugins/task-results-stub';
|
|
2
3
|
export declare function handleRunPreTasksExecution(context: PreTasksExecutionContext): Promise<{
|
|
3
4
|
response: NodeJS.ProcessEnv[];
|
|
4
5
|
description: string;
|
|
@@ -8,7 +9,7 @@ export declare function handleRunPreTasksExecution(context: PreTasksExecutionCon
|
|
|
8
9
|
error: any;
|
|
9
10
|
description: string;
|
|
10
11
|
}>;
|
|
11
|
-
export declare function handleRunPostTasksExecution(context:
|
|
12
|
+
export declare function handleRunPostTasksExecution(context: MaybeStubbedPostTasksExecutionContext): Promise<{
|
|
12
13
|
error?: undefined;
|
|
13
14
|
response: string;
|
|
14
15
|
description: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WatchEventsListener } from '../../utils/workspace-context';
|
|
2
2
|
/**
|
|
3
|
-
* The error a native
|
|
3
|
+
* The error a native watch failure delivered, if one has. Such an
|
|
4
4
|
* error is terminal (the native watch loop exits after delivering it), so the
|
|
5
5
|
* gitignored dotenv edits only that watcher reports stop arriving and a warm
|
|
6
6
|
* graph would go stale silently. The server fails requests closed on it, like
|
|
7
7
|
* a workspace watcher error.
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
10
|
-
export declare const
|
|
9
|
+
export declare function getWatchTerminalError(): Error | undefined;
|
|
10
|
+
export declare const handleWatchEvents: WatchEventsListener;
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.handleWatchEvents = void 0;
|
|
4
|
+
exports.getWatchTerminalError = getWatchTerminalError;
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
6
|
const dotenv_graph_changes_1 = require("./dotenv-graph-changes");
|
|
7
|
-
const outputs_tracking_1 = require("./outputs-tracking");
|
|
8
7
|
const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
|
9
|
+
const workspace_context_1 = require("../../utils/workspace-context");
|
|
10
|
+
let watchTerminalError;
|
|
11
11
|
/**
|
|
12
|
-
* The error a native
|
|
12
|
+
* The error a native watch failure delivered, if one has. Such an
|
|
13
13
|
* error is terminal (the native watch loop exits after delivering it), so the
|
|
14
14
|
* gitignored dotenv edits only that watcher reports stop arriving and a warm
|
|
15
15
|
* graph would go stale silently. The server fails requests closed on it, like
|
|
16
16
|
* a workspace watcher error.
|
|
17
17
|
*/
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function getWatchTerminalError() {
|
|
19
|
+
return watchTerminalError;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const handleWatchEvents = async (err, changeEvents) => {
|
|
22
22
|
try {
|
|
23
23
|
if (err || !changeEvents || !changeEvents.length) {
|
|
24
24
|
let error = typeof err === 'string' ? new Error(err) : err;
|
|
25
|
-
logger_1.serverLogger.watcherLog('Unexpected
|
|
25
|
+
logger_1.serverLogger.watcherLog('Unexpected watch error', error.message);
|
|
26
26
|
console.error(error);
|
|
27
|
-
outputsWatcherError = error;
|
|
28
|
-
(0, outputs_tracking_1.disableOutputsTracking)();
|
|
29
27
|
if (err) {
|
|
30
28
|
// A native error is terminal: the watch loop has exited, so the
|
|
31
29
|
// gitignored dotenv edits only this watcher reports stop arriving and
|
|
@@ -34,32 +32,40 @@ const handleOutputsChanges = async (err, changeEvents) => {
|
|
|
34
32
|
// that silently goes stale. The original error is preserved so an
|
|
35
33
|
// inotify_add_watch failure still makes the client disable the daemon
|
|
36
34
|
// and rebuild without it.
|
|
37
|
-
|
|
35
|
+
watchTerminalError = error;
|
|
38
36
|
}
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
39
|
+
if (changeEvents.some((event) => event.type === 'rescan')) {
|
|
40
|
+
// Dropped events cannot be classified: any gitignored dotenv file may
|
|
41
|
+
// have changed unseen. Recorded outputs are compared by stamp, so they
|
|
42
|
+
// need nothing.
|
|
43
|
+
logger_1.serverLogger.watcherLog('The watch reported dropped events; invalidating the graph cache.');
|
|
44
|
+
(0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
41
47
|
// A dotenv change that a task chain loads must refresh the graph so
|
|
42
|
-
// createNodes re-resolves config reading process.env.
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// would discard that recomputation at commit and force a second one. It is
|
|
48
|
-
// queued instead of dropped: the two watchers deliver independently, so a
|
|
48
|
+
// createNodes re-resolves config reading process.env. A change to a file
|
|
49
|
+
// the file-change stream covers already schedules a recomputation that
|
|
50
|
+
// reads the new content; invalidating for it here too would discard that
|
|
51
|
+
// recomputation at commit and force a second one. It is
|
|
52
|
+
// queued instead of dropped: the two streams deliver independently, so a
|
|
49
53
|
// computation already in flight may have read the file before the edit,
|
|
50
|
-
// and only the pre-serve replay can prove that. The
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
// invalidation
|
|
54
|
-
//
|
|
55
|
-
// here cannot trip the outputs-tracking kill switch below, which belongs
|
|
56
|
-
// to an unrelated subsystem, and it fails safe by invalidating: a stale
|
|
54
|
+
// and only the pre-serve replay can prove that. The context answers from
|
|
55
|
+
// the files the watch keeps, so a path it does not hold is gitignored,
|
|
56
|
+
// already deleted, or not yet ingested, and each of those needs the
|
|
57
|
+
// invalidation. A missing context answers with nothing, which invalidates
|
|
58
|
+
// too. Its own try/catch so a fault fails safe by invalidating: a stale
|
|
57
59
|
// graph on a dotenv edit is the bug this prevents.
|
|
58
60
|
try {
|
|
59
61
|
const { invalidating, unclassified } = (0, dotenv_graph_changes_1.classifyDotEnvChanges)(changeEvents, project_graph_incremental_recomputation_1.currentProjectGraph);
|
|
60
62
|
const generation = (0, project_graph_incremental_recomputation_1.getRecomputationGeneration)();
|
|
61
63
|
(0, dotenv_graph_changes_1.queuePendingDotEnvEvents)(unclassified.map((event) => event.path), generation);
|
|
62
|
-
|
|
64
|
+
// Skips the napi call, which takes the files mutex and can wait out a
|
|
65
|
+
// re-walk, for the common batch that classifies nothing.
|
|
66
|
+
const knownInvalidating = invalidating.length
|
|
67
|
+
? (0, workspace_context_1.trackedFilesInContext)(workspace_root_1.workspaceRoot, invalidating)
|
|
68
|
+
: [];
|
|
63
69
|
(0, dotenv_graph_changes_1.queuePendingDotEnvEvents)(knownInvalidating, generation);
|
|
64
70
|
if (knownInvalidating.length < invalidating.length) {
|
|
65
71
|
(0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
|
|
@@ -70,17 +76,10 @@ const handleOutputsChanges = async (err, changeEvents) => {
|
|
|
70
76
|
console.error(e);
|
|
71
77
|
(0, project_graph_incremental_recomputation_1.invalidateGraphCache)();
|
|
72
78
|
}
|
|
73
|
-
if (outputsWatcherError) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
logger_1.serverLogger.watcherLog('Processing file changes in outputs');
|
|
77
|
-
(0, outputs_tracking_1.processFileChangesInOutputs)(changeEvents);
|
|
78
79
|
}
|
|
79
80
|
catch (err) {
|
|
80
|
-
logger_1.serverLogger.watcherLog(`Unexpected
|
|
81
|
+
logger_1.serverLogger.watcherLog(`Unexpected watch error`, err.message);
|
|
81
82
|
console.error(err);
|
|
82
|
-
outputsWatcherError = err;
|
|
83
|
-
(0, outputs_tracking_1.disableOutputsTracking)();
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
|
-
exports.
|
|
85
|
+
exports.handleWatchEvents = handleWatchEvents;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function _recordOutputsHash(outputs: string[], hash: string): void;
|
|
3
|
-
export declare function _outputsHashesMatch(outputs: string[], hash: string): boolean;
|
|
4
|
-
export declare function processFileChangesInOutputs(changeEvents: WatchEvent[], now?: number): void;
|
|
1
|
+
import type { TaskOutputs } from '../../native';
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* for uncached entries.
|
|
3
|
+
* Whether the on-disk outputs of each entry are still what the daemon
|
|
4
|
+
* recorded for its hash, so the cache copy can be skipped.
|
|
9
5
|
*/
|
|
10
|
-
export declare function outputsHashesMatchBatch(entries:
|
|
11
|
-
outputs: string[];
|
|
12
|
-
hash: string;
|
|
13
|
-
}[]): boolean[];
|
|
6
|
+
export declare function outputsHashesMatchBatch(entries: TaskOutputs[]): boolean[];
|
|
14
7
|
/**
|
|
15
|
-
* Record
|
|
16
|
-
* outputsHashesMatchBatch calls can skip redundant cache copies.
|
|
17
|
-
* Uses Rayon-parallel filesystem scanning.
|
|
8
|
+
* Record each entry's outputs (the files it carries, or else what is on disk)
|
|
9
|
+
* so future outputsHashesMatchBatch calls can skip redundant cache copies.
|
|
18
10
|
*/
|
|
19
|
-
export declare function recordOutputsHashBatch(entries:
|
|
20
|
-
outputs: string[];
|
|
21
|
-
hash: string;
|
|
22
|
-
}[]): void;
|
|
23
|
-
export declare function disableOutputsTracking(): void;
|
|
11
|
+
export declare function recordOutputsHashBatch(entries: TaskOutputs[]): void;
|