nx 23.2.0-beta.0 → 23.2.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/init-local.js +3 -5
- package/dist/bin/nx.js +3 -1
- package/dist/release/changelog-renderer/index.js +4 -5
- package/dist/release/index.d.ts +1 -1
- package/dist/src/adapter/ngcli-adapter.js +60 -1
- package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +35 -15
- package/dist/src/analytics/analytics.d.ts +6 -0
- package/dist/src/analytics/analytics.js +16 -10
- package/dist/src/analytics/index.d.ts +1 -1
- package/dist/src/analytics/index.js +2 -1
- package/dist/src/command-line/add/add.js +5 -0
- package/dist/src/command-line/affected/affected.js +1 -0
- package/dist/src/command-line/completion/command-object.js +7 -12
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +19 -25
- package/dist/src/command-line/format/format.js +84 -101
- package/dist/src/command-line/generate/generate.js +35 -35
- package/dist/src/command-line/graph/graph.d.ts +1 -0
- package/dist/src/command-line/graph/graph.js +15 -6
- package/dist/src/command-line/import/import.js +30 -40
- package/dist/src/command-line/init/ai-agent-prompts.d.ts +1 -1
- package/dist/src/command-line/init/ai-agent-prompts.js +12 -17
- package/dist/src/command-line/init/command-object.js +14 -4
- package/dist/src/command-line/init/configure-plugins.js +4 -1
- package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +12 -32
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +17 -21
- package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +8 -21
- package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +3 -17
- package/dist/src/command-line/init/implementation/angular/index.js +10 -15
- package/dist/src/command-line/init/implementation/angular/integrated-workspace.js +2 -5
- package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +5 -0
- package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +8 -2
- package/dist/src/command-line/init/implementation/check-compatible-with-plugins.js +2 -0
- package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +9 -1
- package/dist/src/command-line/init/implementation/format.d.ts +18 -0
- package/dist/src/command-line/init/implementation/format.js +114 -0
- package/dist/src/command-line/init/implementation/utils.js +8 -0
- package/dist/src/command-line/init/init-v1.js +15 -18
- package/dist/src/command-line/init/init-v2.js +40 -57
- package/dist/src/command-line/migrate/agentic/definitions.js +36 -9
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +37 -22
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +30 -39
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +7 -7
- package/dist/src/command-line/migrate/agentic/handoff.js +13 -10
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +7 -12
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +7 -0
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +10 -0
- package/dist/src/command-line/migrate/agentic/run-step.js +1 -0
- package/dist/src/command-line/migrate/agentic/runner.js +24 -24
- package/dist/src/command-line/migrate/agentic/select.d.ts +10 -2
- package/dist/src/command-line/migrate/agentic/select.js +30 -32
- package/dist/src/command-line/migrate/agentic/types.d.ts +33 -3
- package/dist/src/command-line/migrate/agentic/types.js +35 -0
- package/dist/src/command-line/migrate/command-object.d.ts +6 -0
- package/dist/src/command-line/migrate/command-object.js +19 -1
- package/dist/src/command-line/migrate/execute-migration.d.ts +91 -0
- package/dist/src/command-line/migrate/execute-migration.js +474 -0
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +35 -0
- package/dist/src/command-line/migrate/migrate-analytics.js +64 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +38 -8
- package/dist/src/command-line/migrate/migrate-commits.js +130 -15
- package/dist/src/command-line/migrate/migrate-config.d.ts +13 -12
- package/dist/src/command-line/migrate/migrate-config.js +22 -14
- package/dist/src/command-line/migrate/migrate-output.d.ts +45 -7
- package/dist/src/command-line/migrate/migrate-output.js +52 -8
- package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
- package/dist/src/command-line/migrate/migrate-ui-api.js +33 -19
- package/dist/src/command-line/migrate/migrate.d.ts +29 -113
- package/dist/src/command-line/migrate/migrate.js +666 -664
- package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
- package/dist/src/command-line/migrate/multi-major.js +7 -10
- package/dist/src/command-line/migrate/resolve-package-version.js +4 -8
- package/dist/src/command-line/migrate/run/agent-output.d.ts +20 -0
- package/dist/src/command-line/migrate/run/agent-output.js +65 -0
- package/dist/src/command-line/migrate/run/index.d.ts +9 -0
- package/dist/src/command-line/migrate/run/index.js +23 -0
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +20 -0
- package/dist/src/command-line/migrate/run/orchestrator.js +1200 -0
- package/dist/src/command-line/migrate/run/run-id.d.ts +16 -0
- package/dist/src/command-line/migrate/run/run-id.js +56 -0
- package/dist/src/command-line/migrate/run/run-state.d.ts +157 -0
- package/dist/src/command-line/migrate/run/run-state.js +438 -0
- package/dist/src/command-line/migrate/run/state-lock.d.ts +25 -0
- package/dist/src/command-line/migrate/run/state-lock.js +76 -0
- package/dist/src/command-line/migrate/run/state-machine.d.ts +84 -0
- package/dist/src/command-line/migrate/run/state-machine.js +315 -0
- package/dist/src/command-line/migrate/run/util.d.ts +59 -0
- package/dist/src/command-line/migrate/run/util.js +148 -0
- package/dist/src/command-line/migrate/run/worker.d.ts +16 -0
- package/dist/src/command-line/migrate/run/worker.js +682 -0
- package/dist/src/command-line/migrate/run-migration-process.js +6 -5
- package/dist/src/command-line/migrate/safe-prompt.d.ts +14 -26
- package/dist/src/command-line/migrate/safe-prompt.js +32 -43
- package/dist/src/command-line/migrate/sort-migrations.d.ts +16 -0
- package/dist/src/command-line/migrate/sort-migrations.js +32 -0
- package/dist/src/command-line/migrate/step-actions.d.ts +5 -0
- package/dist/src/command-line/migrate/step-actions.js +12 -0
- package/dist/src/command-line/migrate/text.d.ts +18 -0
- package/dist/src/command-line/migrate/text.js +26 -0
- package/dist/src/command-line/migrate/version-skew-guard.d.ts +60 -0
- package/dist/src/command-line/migrate/version-skew-guard.js +175 -0
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +17 -21
- package/dist/src/command-line/nx-cloud/connect/view-logs.js +2 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.d.ts +2 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +16 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.d.ts +4 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.js +13 -0
- package/dist/src/command-line/nx-commands.js +26 -24
- package/dist/src/command-line/release/changelog.js +11 -17
- package/dist/src/command-line/release/index.d.ts +1 -1
- package/dist/src/command-line/release/plan.js +15 -28
- package/dist/src/command-line/release/publish.js +5 -0
- package/dist/src/command-line/release/release.js +6 -17
- package/dist/src/command-line/release/utils/git.js +1 -1
- package/dist/src/command-line/release/utils/release-graph.d.ts +20 -2
- package/dist/src/command-line/release/utils/release-graph.js +81 -21
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +17 -23
- package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +14 -23
- package/dist/src/command-line/release/utils/resolve-semver-specifier.js +19 -41
- package/dist/src/command-line/release/utils/shared.d.ts +2 -2
- package/dist/src/command-line/release/version/release-group-processor.d.ts +24 -0
- package/dist/src/command-line/release/version/release-group-processor.js +80 -6
- package/dist/src/command-line/release/version/resolve-current-version.js +7 -10
- package/dist/src/command-line/release/version/version-actions.d.ts +27 -2
- package/dist/src/command-line/release/version/version-actions.js +9 -1
- package/dist/src/command-line/release/version.js +10 -6
- package/dist/src/command-line/reset/reset.js +6 -1
- package/dist/src/command-line/run/run-one.js +1 -0
- package/dist/src/command-line/run-many/run-many.js +1 -0
- package/dist/src/command-line/show/show-target/inputs.js +50 -153
- package/dist/src/command-line/show/show-target/outputs.js +48 -173
- package/dist/src/command-line/show/show-target/utils.d.ts +28 -0
- package/dist/src/command-line/show/show-target/utils.js +83 -3
- package/dist/src/command-line/watch/watch.js +13 -0
- package/dist/src/command-line/yargs-utils/shared-options.d.ts +2 -2
- package/dist/src/command-line/yargs-utils/shared-options.js +3 -1
- package/dist/src/commands-runner/create-command-graph.js +5 -0
- package/dist/src/config/misc-interfaces.d.ts +19 -7
- package/dist/src/config/nx-json.d.ts +5 -3
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +52 -1
- package/dist/src/daemon/client/client.js +160 -36
- package/dist/src/daemon/client/daemon-environment.d.ts +17 -0
- package/dist/src/daemon/client/daemon-environment.js +110 -2
- package/dist/src/daemon/client/daemon-socket-messenger.js +4 -0
- package/dist/src/daemon/message-types/daemon-message.d.ts +32 -0
- package/dist/src/daemon/message-types/daemon-message.js +25 -0
- package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +5 -0
- package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +16 -0
- package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +1 -1
- package/dist/src/daemon/server/latest-nx.js +5 -2
- package/dist/src/daemon/server/server.js +31 -4
- package/dist/src/daemon/server/shutdown-utils.d.ts +5 -0
- package/dist/src/daemon/server/shutdown-utils.js +11 -4
- package/dist/src/daemon/socket-utils.d.ts +1 -0
- package/dist/src/daemon/socket-utils.js +24 -3
- package/dist/src/daemon/tmp-dir.d.ts +43 -3
- package/dist/src/daemon/tmp-dir.js +437 -15
- package/dist/src/devkit-internals.d.ts +105 -8
- package/dist/src/devkit-internals.js +223 -7
- package/dist/src/executors/run-commands/running-tasks.js +46 -29
- package/dist/src/generators/internal-utils/format-changed-files.d.ts +24 -0
- package/dist/src/generators/internal-utils/format-changed-files.js +163 -0
- package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +15 -0
- package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.js +21 -3
- package/dist/src/generators/tree.d.ts +4 -2
- package/dist/src/generators/utils/nx-json.js +13 -3
- package/dist/src/hasher/check-task-files.d.ts +86 -0
- package/dist/src/hasher/check-task-files.js +378 -0
- package/dist/src/migrations/update-15-0-0/prefix-outputs.js +2 -2
- package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.js +2 -2
- package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +2 -2
- package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.js +2 -2
- package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +2 -2
- package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +2 -2
- package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +2 -2
- package/dist/src/migrations/update-17-2-0/move-default-base.js +2 -2
- package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +2 -2
- package/dist/src/migrations/update-19-2-4/set-project-name.js +2 -2
- package/dist/src/migrations/update-20-0-0/move-use-daemon-process.js +2 -2
- package/dist/src/migrations/update-20-0-1/use-legacy-cache.js +2 -2
- package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.js +2 -2
- package/dist/src/migrations/update-21-0-0/release-version-config-changes.js +2 -2
- package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +2 -2
- package/dist/src/migrations/update-21-0-0/remove-legacy-cache.js +2 -2
- package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.js +2 -2
- package/dist/src/migrations/update-22-0-0/release-version-config-changes.js +2 -2
- package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +2 -2
- package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.js +2 -2
- package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.js +2 -2
- package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.js +2 -2
- package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +2 -2
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +12 -0
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +250 -0
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +50 -0
- package/dist/src/native/index.d.ts +37 -4
- package/dist/src/native/index.js +71 -28
- package/dist/src/native/native-bindings.js +3 -0
- package/dist/src/native/native-file-cache-location.d.ts +17 -1
- package/dist/src/native/native-file-cache-location.js +86 -12
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +3 -3
- package/dist/src/nx-cloud/utilities/get-cloud-options.js +5 -2
- package/dist/src/nx-cloud/utilities/onboarding.js +5 -2
- package/dist/src/nx-cloud/utilities/url-shorten.d.ts +1 -4
- package/dist/src/nx-cloud/utilities/url-shorten.js +9 -8
- package/dist/src/plugins/js/lock-file/bun-parser.js +43 -10
- package/dist/src/plugins/js/lock-file/lock-file.d.ts +46 -4
- package/dist/src/plugins/js/lock-file/lock-file.js +192 -15
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +420 -64
- package/dist/src/plugins/js/lock-file/project-graph-pruning.d.ts +25 -1
- package/dist/src/plugins/js/lock-file/project-graph-pruning.js +92 -12
- package/dist/src/plugins/js/lock-file/pruned-output.d.ts +330 -0
- package/dist/src/plugins/js/lock-file/pruned-output.js +1441 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +1 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +9 -5
- package/dist/src/plugins/js/project-graph/affected/npm-packages.js +51 -20
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +14 -4
- package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.js +2 -2
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +5 -2
- package/dist/src/project-graph/build-project-graph.js +7 -1
- package/dist/src/project-graph/error-types.d.ts +12 -1
- package/dist/src/project-graph/error-types.js +27 -2
- package/dist/src/project-graph/file-utils.js +6 -1
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +1 -0
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +18 -1
- package/dist/src/project-graph/plugins/isolation/messaging.d.ts +16 -3
- package/dist/src/project-graph/plugins/isolation/messaging.js +3 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +58 -8
- package/dist/src/project-graph/plugins/loaded-nx-plugin.js +1 -0
- package/dist/src/project-graph/project-graph.js +23 -0
- package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts +1 -0
- package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.js +16 -2
- package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +12 -8
- package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +30 -21
- package/dist/src/project-graph/utils/project-configuration/source-maps.d.ts +12 -5
- package/dist/src/project-graph/utils/project-configuration/source-maps.js +21 -7
- package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +1 -1
- package/dist/src/project-graph/utils/project-configuration/target-defaults.js +26 -27
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +50 -8
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +149 -6
- package/dist/src/project-graph/utils/project-configuration/utils.d.ts +15 -0
- package/dist/src/project-graph/utils/project-configuration/utils.js +42 -6
- package/dist/src/project-graph/utils/project-configuration-utils.d.ts +15 -12
- package/dist/src/project-graph/utils/project-configuration-utils.js +79 -99
- package/dist/src/tasks-runner/is-tui-enabled.js +3 -1
- package/dist/src/tasks-runner/life-cycle.d.ts +2 -2
- package/dist/src/tasks-runner/life-cycle.js +2 -2
- package/dist/src/tasks-runner/life-cycles/performance-analysis.d.ts +9 -4
- package/dist/src/tasks-runner/life-cycles/performance-life-cycle.js +5 -4
- package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +28 -8
- package/dist/src/tasks-runner/life-cycles/performance-report.js +117 -30
- package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +26 -1
- package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +99 -5
- package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +26 -0
- package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +113 -17
- package/dist/src/tasks-runner/pseudo-terminal.d.ts +17 -3
- package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
- package/dist/src/tasks-runner/run-command.js +28 -35
- package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +55 -0
- package/dist/src/tasks-runner/running-tasks/batch-process.js +161 -8
- package/dist/src/tasks-runner/task-env.d.ts +9 -0
- package/dist/src/tasks-runner/task-env.js +31 -4
- package/dist/src/tasks-runner/task-orchestrator.d.ts +72 -1
- package/dist/src/tasks-runner/task-orchestrator.js +182 -18
- package/dist/src/tasks-runner/utils.js +2 -6
- package/dist/src/utils/acknowledge-build-scripts.js +7 -5
- package/dist/src/utils/analytics-enabled.d.ts +7 -0
- package/dist/src/utils/analytics-enabled.js +11 -0
- package/dist/src/utils/analytics-prompt.d.ts +0 -6
- package/dist/src/utils/analytics-prompt.js +4 -58
- package/dist/src/utils/assert-workspace-validity.js +7 -2
- package/dist/src/utils/catalog/bun-manager-utils.d.ts +8 -0
- package/dist/src/utils/catalog/bun-manager-utils.js +174 -0
- package/dist/src/utils/catalog/bun-manager.d.ts +28 -0
- package/dist/src/utils/catalog/bun-manager.js +130 -0
- package/dist/src/utils/catalog/index.d.ts +1 -1
- package/dist/src/utils/catalog/index.js +1 -1
- package/dist/src/utils/catalog/manager-factory.js +3 -0
- package/dist/src/utils/catalog/manager-utils.d.ts +8 -1
- package/dist/src/utils/catalog/manager-utils.js +9 -4
- package/dist/src/utils/catalog/manager.d.ts +13 -1
- package/dist/src/utils/catalog/manager.js +30 -0
- package/dist/src/utils/catalog/pnpm-manager.d.ts +2 -1
- package/dist/src/utils/catalog/pnpm-manager.js +3 -0
- package/dist/src/utils/catalog/types.d.ts +4 -0
- package/dist/src/utils/catalog/yarn-manager.d.ts +6 -2
- package/dist/src/utils/catalog/yarn-manager.js +23 -32
- package/dist/src/utils/child-process.d.ts +31 -1
- package/dist/src/utils/child-process.js +103 -0
- package/dist/src/utils/chunkify.d.ts +7 -1
- package/dist/src/utils/chunkify.js +10 -3
- package/dist/src/utils/command-line-utils.js +30 -20
- package/dist/src/utils/exit-codes.d.ts +9 -0
- package/dist/src/utils/exit-codes.js +19 -0
- package/dist/src/utils/fileutils.d.ts +5 -0
- package/dist/src/utils/fileutils.js +7 -2
- package/dist/src/utils/formatters/index.d.ts +13 -0
- package/dist/src/utils/formatters/index.js +74 -0
- package/dist/src/utils/formatters/oxfmt.d.ts +32 -0
- package/dist/src/utils/formatters/oxfmt.js +764 -0
- package/dist/src/utils/formatters/prettier.d.ts +26 -0
- package/dist/src/utils/formatters/prettier.js +201 -0
- package/dist/src/utils/formatters/shared.d.ts +5 -0
- package/dist/src/utils/formatters/shared.js +8 -0
- package/dist/src/utils/git-revision.d.ts +12 -0
- package/dist/src/utils/git-revision.js +25 -0
- package/dist/src/utils/git-utils.d.ts +48 -2
- package/dist/src/utils/git-utils.js +220 -14
- package/dist/src/utils/git-worktrees.d.ts +30 -0
- package/dist/src/utils/git-worktrees.js +212 -0
- package/dist/src/utils/ignore.d.ts +170 -1
- package/dist/src/utils/ignore.js +263 -11
- package/dist/src/utils/long-running-target.d.ts +10 -0
- package/dist/src/utils/long-running-target.js +19 -0
- package/dist/src/utils/min-release-age/behavior/bun.js +7 -11
- package/dist/src/utils/min-release-age/behavior/npm.js +5 -2
- package/dist/src/utils/min-release-age/packument.js +1 -1
- package/dist/src/utils/nx-console-prompt.js +3 -6
- package/dist/src/utils/nx-tmp-dir.d.ts +18 -0
- package/dist/src/utils/nx-tmp-dir.js +40 -0
- package/dist/src/utils/output.d.ts +153 -0
- package/dist/src/utils/output.js +289 -5
- package/dist/src/utils/owned-private-dir.d.ts +132 -0
- package/dist/src/utils/owned-private-dir.js +323 -0
- package/dist/src/utils/package-json.d.ts +2 -0
- package/dist/src/utils/package-json.js +11 -7
- package/dist/src/utils/package-manager-config/bunfig.d.ts +14 -0
- package/dist/src/utils/package-manager-config/bunfig.js +49 -0
- package/dist/src/utils/package-manager-config/npmrc.d.ts +23 -0
- package/dist/src/utils/package-manager-config/npmrc.js +124 -0
- package/dist/src/utils/package-manager-config/pnpm-config.d.ts +17 -0
- package/dist/src/utils/package-manager-config/pnpm-config.js +60 -0
- package/dist/src/utils/package-manager.d.ts +23 -2
- package/dist/src/utils/package-manager.js +268 -44
- package/dist/src/utils/params.d.ts +7 -1
- package/dist/src/utils/params.js +64 -6
- package/dist/src/utils/plugins/core-plugins.js +4 -0
- package/dist/src/utils/prompt-helpers.d.ts +53 -0
- package/dist/src/utils/prompt-helpers.js +111 -0
- package/dist/src/utils/provenance.js +6 -14
- package/dist/src/utils/registry-config/bun.d.ts +2 -0
- package/dist/src/utils/registry-config/bun.js +257 -0
- package/dist/src/utils/registry-config/index.d.ts +13 -0
- package/dist/src/utils/registry-config/index.js +102 -0
- package/dist/src/utils/registry-config/pnpm.d.ts +2 -0
- package/dist/src/utils/registry-config/pnpm.js +1551 -0
- package/dist/src/utils/registry-config/utils.d.ts +195 -0
- package/dist/src/utils/registry-config/utils.js +496 -0
- package/dist/src/utils/registry-config/yarn-berry.d.ts +2 -0
- package/dist/src/utils/registry-config/yarn-berry.js +612 -0
- package/dist/src/utils/registry-config/yarn-classic.d.ts +2 -0
- package/dist/src/utils/registry-config/yarn-classic.js +1001 -0
- package/dist/src/utils/safe-spawn.d.ts +24 -0
- package/dist/src/utils/safe-spawn.js +104 -0
- package/dist/src/utils/shell-quoting.d.ts +15 -0
- package/dist/src/utils/shell-quoting.js +35 -0
- package/dist/src/utils/wait-for-socket-connection.d.ts +11 -0
- package/dist/src/utils/wait-for-socket-connection.js +14 -8
- package/dist/src/utils/workspace-id.d.ts +20 -0
- package/dist/src/utils/workspace-id.js +54 -0
- package/dist/src/utils/write-formatted-json-file.d.ts +3 -2
- package/dist/src/utils/write-formatted-json-file.js +5 -4
- package/migrations.json +6 -0
- package/package.json +29 -19
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +0 -19
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +0 -81
- package/dist/src/utils/is-using-prettier.d.ts +0 -3
- package/dist/src/utils/is-using-prettier.js +0 -62
- package/dist/src/utils/min-release-age/npmrc.d.ts +0 -15
- package/dist/src/utils/min-release-age/npmrc.js +0 -45
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BatchProcess = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
const native_1 = require("../../native");
|
|
7
|
+
const cache_directory_1 = require("../../utils/cache-directory");
|
|
5
8
|
const exit_codes_1 = require("../../utils/exit-codes");
|
|
9
|
+
const output_1 = require("../../utils/output");
|
|
6
10
|
const batch_messages_1 = require("../batch/batch-messages");
|
|
7
11
|
class BatchProcess {
|
|
8
12
|
constructor(childProcess, executorName) {
|
|
@@ -12,6 +16,18 @@ class BatchProcess {
|
|
|
12
16
|
this.batchResultsCallbacks = [];
|
|
13
17
|
this.taskResultsCallbacks = [];
|
|
14
18
|
this.outputCallbacks = [];
|
|
19
|
+
/**
|
|
20
|
+
* Set once the capture is released. A chunk can still arrive after that —
|
|
21
|
+
* stdout delivers past the exit event — and reopening then would mint a
|
|
22
|
+
* second numbered file that nothing ever cleans up.
|
|
23
|
+
*/
|
|
24
|
+
this.capturedOutputDiscarded = false;
|
|
25
|
+
/**
|
|
26
|
+
* Set when writing the capture failed. Distinct from discarded: the bytes
|
|
27
|
+
* already on disk are still the best record of the batch, so the file is kept
|
|
28
|
+
* and rendered, while everything after the failure goes live to the terminal.
|
|
29
|
+
*/
|
|
30
|
+
this.capturedOutputFailed = false;
|
|
15
31
|
this.childProcess.on('message', (message) => {
|
|
16
32
|
switch (message.type) {
|
|
17
33
|
case batch_messages_1.BatchMessageType.CompleteTask: {
|
|
@@ -47,24 +63,39 @@ class BatchProcess {
|
|
|
47
63
|
// Capture stdout output
|
|
48
64
|
if (this.childProcess.stdout) {
|
|
49
65
|
this.childProcess.stdout.on('data', (chunk) => {
|
|
50
|
-
const
|
|
51
|
-
//
|
|
52
|
-
|
|
66
|
+
const text = chunk.toString();
|
|
67
|
+
// When batch output is being folded, the live copy is suppressed to
|
|
68
|
+
// keep each group contiguous; it is retained (see capturedOutputPath)
|
|
69
|
+
// for the renderings that need it. Otherwise, maintain
|
|
70
|
+
// current terminal output behavior. These chunks are forwarded raw and
|
|
71
|
+
// routinely end mid-line, so they go through `output` to keep its line
|
|
72
|
+
// tracking accurate for whatever prints next.
|
|
73
|
+
if ((0, output_1.shouldGroupBatchOutput)()) {
|
|
74
|
+
this.capture(chunk);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
output_1.output.writeTaskOutputChunk(chunk);
|
|
78
|
+
}
|
|
53
79
|
// Notify callbacks for TUI
|
|
54
80
|
for (const cb of this.outputCallbacks) {
|
|
55
|
-
cb(
|
|
81
|
+
cb(text);
|
|
56
82
|
}
|
|
57
83
|
});
|
|
58
84
|
}
|
|
59
85
|
// Capture stderr output
|
|
60
86
|
if (this.childProcess.stderr) {
|
|
61
87
|
this.childProcess.stderr.on('data', (chunk) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
const text = chunk.toString();
|
|
89
|
+
if ((0, output_1.shouldGroupBatchOutput)()) {
|
|
90
|
+
this.capture(chunk, process.stderr);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// Maintain current terminal output behavior
|
|
94
|
+
output_1.output.writeTaskOutputChunk(chunk, process.stderr);
|
|
95
|
+
}
|
|
65
96
|
// Notify callbacks for TUI
|
|
66
97
|
for (const cb of this.outputCallbacks) {
|
|
67
|
-
cb(
|
|
98
|
+
cb(text);
|
|
68
99
|
}
|
|
69
100
|
});
|
|
70
101
|
}
|
|
@@ -81,6 +112,127 @@ class BatchProcess {
|
|
|
81
112
|
onOutput(cb) {
|
|
82
113
|
this.outputCallbacks.push(cb);
|
|
83
114
|
}
|
|
115
|
+
capture(chunk, stream = process.stdout) {
|
|
116
|
+
// Only a released capture stops recording; a handed-over one keeps
|
|
117
|
+
// appending until the fold is rendered.
|
|
118
|
+
if (this.capturedOutputDiscarded) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this.capturedOutputFailed) {
|
|
122
|
+
// Capture is over, but the output is not optional. Everything from here
|
|
123
|
+
// goes straight to the terminal, on the stream it arrived on.
|
|
124
|
+
output_1.output.writeTaskOutputChunk(chunk, stream);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
// Hoisted so the catch can tell how much of this chunk reached the file: a
|
|
128
|
+
// `writeSync` that fails partway leaves a prefix on disk, and replaying the
|
|
129
|
+
// whole chunk live would print that prefix twice - once now, once when the
|
|
130
|
+
// fold reads the file.
|
|
131
|
+
const bytes = typeof chunk === 'string' ? Buffer.from(chunk) : chunk;
|
|
132
|
+
let written = 0;
|
|
133
|
+
try {
|
|
134
|
+
if (this.capturedOutputFd === undefined) {
|
|
135
|
+
const dir = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'batch-outputs');
|
|
136
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
137
|
+
const name = `${this.executorName.replace(/[^a-zA-Z0-9]+/g, '-')}-${process.pid}-${++BatchProcess.capturedOutputCount}.log`;
|
|
138
|
+
const path = (0, path_1.join)(dir, name);
|
|
139
|
+
// Assigned only once the file is actually open, so a path always names
|
|
140
|
+
// an fd rather than a file that failed to open.
|
|
141
|
+
const fd = (0, fs_1.openSync)(path, 'w');
|
|
142
|
+
this.capturedOutputPath = path;
|
|
143
|
+
this.capturedOutputFd = fd;
|
|
144
|
+
}
|
|
145
|
+
// Written synchronously so the file is complete the moment the batch ends,
|
|
146
|
+
// with no flush to sequence against the read that renders the fold.
|
|
147
|
+
while (written < bytes.length) {
|
|
148
|
+
written += (0, fs_1.writeSync)(this.capturedOutputFd, bytes, written);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
// This runs inside a stream 'data' handler, where a throw is an uncaught
|
|
153
|
+
// exception rather than something the orchestrator's try can see - so a
|
|
154
|
+
// full disk or a read-only data directory would take down a run that
|
|
155
|
+
// otherwise had nothing wrong with it. The capture is an optimization
|
|
156
|
+
// that the common path discards anyway, so give it up and put the bytes
|
|
157
|
+
// back on the terminal instead of losing both them and the run.
|
|
158
|
+
// Latch on a flag of its own rather than reusing the discard flag: that
|
|
159
|
+
// one makes `capture` return early, which would drop every later chunk
|
|
160
|
+
// on the floor - captured nowhere and printed nowhere.
|
|
161
|
+
this.capturedOutputFailed = true;
|
|
162
|
+
// Close the fd but keep the file. Whatever was written before the failure
|
|
163
|
+
// is still the head of the batch's log, which is where a compiler's first
|
|
164
|
+
// non-cascading errors live; unlinking it here would throw away the most
|
|
165
|
+
// useful bytes precisely when the disk is in trouble.
|
|
166
|
+
this.closeCapturedOutput();
|
|
167
|
+
// Forward only what did not reach the file, and do it before warning.
|
|
168
|
+
// `output.warn` writes to the terminal as well, so if that is the thing
|
|
169
|
+
// failing, the bytes this handler was handed must already be out - losing
|
|
170
|
+
// the warning is survivable, losing task output is what this path exists
|
|
171
|
+
// to prevent.
|
|
172
|
+
const unwritten = bytes.subarray(written);
|
|
173
|
+
if (unwritten.length > 0) {
|
|
174
|
+
output_1.output.writeTaskOutputChunk(unwritten, stream);
|
|
175
|
+
}
|
|
176
|
+
output_1.output.warn({
|
|
177
|
+
title: `Could not capture batch output for ${this.executorName}`,
|
|
178
|
+
bodyLines: [
|
|
179
|
+
e.message,
|
|
180
|
+
'Streaming the rest of it live instead; the fold holds what was captured first.',
|
|
181
|
+
],
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Path to the file holding everything held back from the live stream under
|
|
187
|
+
* log grouping, or undefined if nothing was captured. Used to render the whole
|
|
188
|
+
* batch as one fold, so output no task claimed is not lost.
|
|
189
|
+
*
|
|
190
|
+
* The file is deliberately left open rather than closed here. A worker's
|
|
191
|
+
* stdout can deliver after its exit event — which is what `getResults()`
|
|
192
|
+
* settles on — and leaving the fd open keeps such a chunk appending to this
|
|
193
|
+
* same file instead of minting a second numbered one that nothing cleans up.
|
|
194
|
+
* The caller reads the file once, synchronously, while rendering the fold, so
|
|
195
|
+
* anything arriving after that read is not shown; writes are unbuffered, so
|
|
196
|
+
* the read always sees a complete prefix of what has arrived by then.
|
|
197
|
+
*/
|
|
198
|
+
getCapturedOutputPath() {
|
|
199
|
+
return this.capturedOutputPath;
|
|
200
|
+
}
|
|
201
|
+
/** Releases the capture file. Safe to call more than once. */
|
|
202
|
+
discardCapturedOutput() {
|
|
203
|
+
this.capturedOutputDiscarded = true;
|
|
204
|
+
this.releaseCapturedOutput();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Closes the fd and unlinks the file, leaving no path behind for a caller to
|
|
208
|
+
* read. Tolerates a partially-initialized capture, since it also runs when
|
|
209
|
+
* opening or writing the file is what failed.
|
|
210
|
+
*/
|
|
211
|
+
releaseCapturedOutput() {
|
|
212
|
+
this.closeCapturedOutput();
|
|
213
|
+
if (this.capturedOutputPath) {
|
|
214
|
+
try {
|
|
215
|
+
(0, fs_1.rmSync)(this.capturedOutputPath, { force: true });
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// `force` covers a missing file but not a locked one: on Windows an fd
|
|
219
|
+
// that failed to close still holds a share lock. This runs from
|
|
220
|
+
// `runBatch`'s finally, where throwing would replace the batch's real
|
|
221
|
+
// result with a cleanup error, so a stale file is the lesser outcome.
|
|
222
|
+
}
|
|
223
|
+
this.capturedOutputPath = undefined;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/** Closes the fd, keeping the file and its path readable. */
|
|
227
|
+
closeCapturedOutput() {
|
|
228
|
+
if (this.capturedOutputFd !== undefined) {
|
|
229
|
+
try {
|
|
230
|
+
(0, fs_1.closeSync)(this.capturedOutputFd);
|
|
231
|
+
}
|
|
232
|
+
catch { }
|
|
233
|
+
this.capturedOutputFd = undefined;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
84
236
|
async getResults() {
|
|
85
237
|
return Promise.race([
|
|
86
238
|
new Promise((_, rej) => {
|
|
@@ -108,3 +260,4 @@ class BatchProcess {
|
|
|
108
260
|
}
|
|
109
261
|
}
|
|
110
262
|
exports.BatchProcess = BatchProcess;
|
|
263
|
+
BatchProcess.capturedOutputCount = 0;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ProjectGraph } from '../config/project-graph';
|
|
2
2
|
import { Task } from '../config/task-graph';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the FORCE_COLOR value for forked child processes.
|
|
5
|
+
*
|
|
6
|
+
* When the user sets FORCE_COLOR=0, bin/nx.ts deletes it from process.env
|
|
7
|
+
* (workaround for picocolors treating "0" as truthy) and saves the original
|
|
8
|
+
* value in NX_ORIGINAL_FORCE_COLOR. Without this check, the undefined
|
|
9
|
+
* FORCE_COLOR would default to 'true', re-enabling colors in all children.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getForceColorForChild(): string;
|
|
3
12
|
export declare function getEnvVariablesForBatchProcess(skipNxCache: boolean, captureStderr: boolean): NodeJS.ProcessEnv;
|
|
4
13
|
export declare function getTaskSpecificEnv(task: Task, graph: ProjectGraph): NodeJS.ProcessEnv;
|
|
5
14
|
export declare function getEnvVariablesForTask(task: Task, taskSpecificEnv: NodeJS.ProcessEnv, forceColor: string, skipNxCache: boolean, captureStderr: boolean, outputPath: string, streamOutput: boolean): NodeJS.ProcessEnv;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getForceColorForChild = getForceColorForChild;
|
|
3
4
|
exports.getEnvVariablesForBatchProcess = getEnvVariablesForBatchProcess;
|
|
4
5
|
exports.getTaskSpecificEnv = getTaskSpecificEnv;
|
|
5
6
|
exports.getEnvVariablesForTask = getEnvVariablesForTask;
|
|
@@ -11,13 +12,33 @@ const dotenv_expand_1 = require("dotenv-expand");
|
|
|
11
12
|
const node_path_1 = require("node:path");
|
|
12
13
|
const workspace_root_1 = require("../utils/workspace-root");
|
|
13
14
|
const task_env_paths_1 = require("./task-env-paths");
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the FORCE_COLOR value for forked child processes.
|
|
17
|
+
*
|
|
18
|
+
* When the user sets FORCE_COLOR=0, bin/nx.ts deletes it from process.env
|
|
19
|
+
* (workaround for picocolors treating "0" as truthy) and saves the original
|
|
20
|
+
* value in NX_ORIGINAL_FORCE_COLOR. Without this check, the undefined
|
|
21
|
+
* FORCE_COLOR would default to 'true', re-enabling colors in all children.
|
|
22
|
+
*/
|
|
23
|
+
function getForceColorForChild() {
|
|
24
|
+
if (process.env.FORCE_COLOR !== undefined) {
|
|
25
|
+
return process.env.FORCE_COLOR;
|
|
26
|
+
}
|
|
27
|
+
if (process.env.NX_ORIGINAL_FORCE_COLOR === '0') {
|
|
28
|
+
return '0';
|
|
29
|
+
}
|
|
30
|
+
return 'true';
|
|
31
|
+
}
|
|
14
32
|
function getEnvVariablesForBatchProcess(skipNxCache, captureStderr) {
|
|
15
|
-
|
|
33
|
+
const res = {
|
|
16
34
|
// User Process Env Variables override Dotenv Variables
|
|
17
35
|
...process.env,
|
|
18
36
|
// Nx Env Variables overrides everything
|
|
19
|
-
...getNxEnvVariablesForForkedProcess(
|
|
37
|
+
...getNxEnvVariablesForForkedProcess(getForceColorForChild(), skipNxCache, captureStderr),
|
|
20
38
|
};
|
|
39
|
+
// NX_ORIGINAL_FORCE_COLOR is an internal signal and should not leak into child processes
|
|
40
|
+
delete res.NX_ORIGINAL_FORCE_COLOR;
|
|
41
|
+
return res;
|
|
21
42
|
}
|
|
22
43
|
// The orchestrator now calls this eagerly during the coordinator pre-hash
|
|
23
44
|
// in addition to processTask (and again in hashBatchTasks), so the same
|
|
@@ -58,6 +79,9 @@ function getEnvVariablesForTask(task, taskSpecificEnv, forceColor, skipNxCache,
|
|
|
58
79
|
}
|
|
59
80
|
// we don't reset NX_BASE or NX_HEAD because those are set by the user and should be preserved
|
|
60
81
|
delete res.NX_SET_CLI;
|
|
82
|
+
// NX_ORIGINAL_FORCE_COLOR is an internal signal used by getForceColorForChild()
|
|
83
|
+
// and should not leak into child processes
|
|
84
|
+
delete res.NX_ORIGINAL_FORCE_COLOR;
|
|
61
85
|
return res;
|
|
62
86
|
}
|
|
63
87
|
function getNxEnvVariablesForForkedProcess(forceColor, skipNxCache, captureStderr, outputPath, streamOutput) {
|
|
@@ -142,10 +166,13 @@ function getOwnerTargetForTask(task, graph) {
|
|
|
142
166
|
for (const targets of Object.values(project.data.metadata.targetGroups)) {
|
|
143
167
|
if (targets.includes(task.target.target)) {
|
|
144
168
|
for (const target of targets) {
|
|
145
|
-
|
|
169
|
+
// a target group can name a target the project does not define —
|
|
170
|
+
// inference plugins build the group and the targets separately, so
|
|
171
|
+
// the two can disagree. skip the phantom rather than dereferencing it.
|
|
172
|
+
if (project.data.targets[target]?.metadata?.nonAtomizedTarget) {
|
|
146
173
|
return [
|
|
147
174
|
target,
|
|
148
|
-
project.data.targets[target]
|
|
175
|
+
project.data.targets[target]?.metadata?.nonAtomizedTarget,
|
|
149
176
|
];
|
|
150
177
|
}
|
|
151
178
|
}
|
|
@@ -35,11 +35,18 @@ export declare class TaskOrchestrator {
|
|
|
35
35
|
private reverseTaskDeps;
|
|
36
36
|
private initializingTaskIds;
|
|
37
37
|
private processedTasks;
|
|
38
|
+
private cacheMissedHashes;
|
|
38
39
|
private completedTasks;
|
|
39
40
|
private waitingForTasks;
|
|
40
41
|
private pendingDiscreteWorkers;
|
|
41
42
|
private groups;
|
|
42
43
|
private continuousTasksStarted;
|
|
44
|
+
/**
|
|
45
|
+
* How many folds each batch id has rendered. A batch that reports a strict
|
|
46
|
+
* subset of its tasks is re-run under the same id, so one id can produce more
|
|
47
|
+
* than one fold and the redirect lines have to point at the right one.
|
|
48
|
+
*/
|
|
49
|
+
private batchFoldRenders;
|
|
43
50
|
private bailed;
|
|
44
51
|
private resolveStopPromise;
|
|
45
52
|
private stopRequested;
|
|
@@ -100,7 +107,9 @@ export declare class TaskOrchestrator {
|
|
|
100
107
|
* The coordinator relies on this running unconditionally (when cache
|
|
101
108
|
* is enabled): tasks dispatched in step 5 via runTaskDirectly skip
|
|
102
109
|
* their own cache lookup on the assumption that this has already
|
|
103
|
-
* confirmed them as misses.
|
|
110
|
+
* confirmed them as misses. Excluding cacheMissedHashes preserves that
|
|
111
|
+
* invariant — every dispatched hash was queried exactly once — but
|
|
112
|
+
* don't add other length-based bails.
|
|
104
113
|
*/
|
|
105
114
|
private resolveCachedTasksBulk;
|
|
106
115
|
/**
|
|
@@ -115,6 +124,68 @@ export declare class TaskOrchestrator {
|
|
|
115
124
|
private hashBatchTasks;
|
|
116
125
|
applyFromCacheOrRunBatch(doNotSkipCache: boolean, batch: Batch, groupId: number): Promise<TaskResult[]>;
|
|
117
126
|
private runBatch;
|
|
127
|
+
/**
|
|
128
|
+
* Rendering a batch's output must never change the batch's results. A throw
|
|
129
|
+
* from the printer would otherwise land in `runBatch`'s own error handling:
|
|
130
|
+
* on the resolved path it rewrites every task to `failure` with the printer's
|
|
131
|
+
* stack as its output — reporting a green build red to the life cycles and Nx
|
|
132
|
+
* Cloud — and on the crash path it escapes `runBatch`, replacing the built
|
|
133
|
+
* failure results with the printer's error. Both call sites degrade to a
|
|
134
|
+
* warning here instead.
|
|
135
|
+
*/
|
|
136
|
+
private renderBatchOutputSafely;
|
|
137
|
+
/**
|
|
138
|
+
* Prints a completed batch's output once, under log grouping. Live forwarding
|
|
139
|
+
* was suppressed while grouping, so this is the only copy — which is why the
|
|
140
|
+
* requested output style has to reach this path rather than stopping at the
|
|
141
|
+
* life cycle.
|
|
142
|
+
*
|
|
143
|
+
* Two things are rendered, and they answer different questions.
|
|
144
|
+
*
|
|
145
|
+
* Every task always renders through the life cycle, exactly as in a non-batch
|
|
146
|
+
* run - failures in full, successes collapsed to a line for run-many, plus the
|
|
147
|
+
* initiating project in full for run-one. That is what attributes output to a
|
|
148
|
+
* task, and it is the only place some of it exists: `@nx/jest` synthesizes
|
|
149
|
+
* each task's `terminalOutput` from an aggregated result and never writes
|
|
150
|
+
* those per-project summaries to the worker's stdio at all.
|
|
151
|
+
*
|
|
152
|
+
* The worker's whole captured log is rendered as a fold above them when the
|
|
153
|
+
* run asked for full output, or when any task failed or was stopped. A
|
|
154
|
+
* diagnostic that explains a failure is routinely one no task claimed:
|
|
155
|
+
* `@nx/maven`'s batch impl writes its exit-code dump and failed-task outputs
|
|
156
|
+
* to the worker's stderr via `console.error`, and the Maven JVM it spawns
|
|
157
|
+
* points slf4j at `System.out` because its own stderr carries the result
|
|
158
|
+
* protocol - two layers, two streams, both captured and neither attributed to
|
|
159
|
+
* a task - and `@nx/gradle` emits configuration-phase errors before the first
|
|
160
|
+
* `> Task :x:y` header tells it which task to attribute to. Both catch their
|
|
161
|
+
* own crash and backfill task results, so the batch resolves and lands here
|
|
162
|
+
* rather than in the caller's failure path.
|
|
163
|
+
*
|
|
164
|
+
* Rendering both duplicates some bytes, deliberately. `@nx/maven` and
|
|
165
|
+
* `@nx/gradle` tee each task's output into the worker's stdio on the way to
|
|
166
|
+
* `terminalOutput`, so a failing task's body appears in the fold and again in
|
|
167
|
+
* its own block. That is bounded on the default style, where successes
|
|
168
|
+
* collapse to a line each and a crashed batch backfills a short
|
|
169
|
+
* `e.toString()` rather than a body, so the case with the largest fold
|
|
170
|
+
* duplicates the least. Under a full-output style it is not bounded: every
|
|
171
|
+
* task prints in full beside a log that already contains it, which is the
|
|
172
|
+
* price of that style asking for everything. What it buys either way is
|
|
173
|
+
* attribution the fold cannot express. The
|
|
174
|
+
* alternative, letting the fold replace per-task rendering, silently dropped
|
|
175
|
+
* `@nx/jest`'s summaries and is what this shape exists to avoid.
|
|
176
|
+
*
|
|
177
|
+
* A batch that never reported results is handled by the caller instead.
|
|
178
|
+
*/
|
|
179
|
+
private printGroupedBatchOutput;
|
|
180
|
+
/**
|
|
181
|
+
* Renders a batch's whole output as one fold, plus — unless `redirectLines`
|
|
182
|
+
* is off — a line per task pointing at it. The fold is labelled with the
|
|
183
|
+
* executor and a run-unique id (the same
|
|
184
|
+
* executor can run more than one batch), rather than an arbitrary task. Safe
|
|
185
|
+
* to write to `output` directly: grouping implies GitHub Actions implies a
|
|
186
|
+
* non-TTY, static lifecycle.
|
|
187
|
+
*/
|
|
188
|
+
private printBatchFold;
|
|
118
189
|
/**
|
|
119
190
|
* Bulk-resolve cache hits for a set of tasks: fetch cached entries,
|
|
120
191
|
* copy outputs as needed, fire lifecycle, and return the TaskResults
|