@ohos-npm-ports/nx 23.1.1-beta.1 → 24.0.3-1
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 +6 -9
- package/dist/bin/init-local.js +10 -6
- package/dist/bin/nx-cloud.js +9 -0
- package/dist/bin/nx.js +1 -0
- package/dist/bin/post-install.js +5 -3
- package/dist/nx-cloud-internals.d.ts +2 -0
- package/dist/nx-cloud-internals.js +15 -0
- package/dist/plugins/package-json.js +1 -1
- package/dist/release/changelog-renderer/index.d.ts +4 -0
- package/dist/release/changelog-renderer/index.js +21 -6
- package/dist/release/index.d.ts +1 -1
- package/dist/src/adapter/ngcli-adapter.js +62 -3
- package/dist/src/ai/clone-ai-config-repo.js +49 -12
- package/dist/src/ai/constants.d.ts +15 -0
- package/dist/src/ai/constants.js +17 -1
- package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +69 -10
- package/dist/src/ai/utils.d.ts +13 -0
- package/dist/src/ai/utils.js +29 -0
- package/dist/src/analytics/analytics.js +2 -4
- package/dist/src/command-line/add/add.d.ts +2 -0
- package/dist/src/command-line/add/add.js +30 -3
- package/dist/src/command-line/affected/affected.js +71 -9
- package/dist/src/command-line/affected/command-object.js +1 -1
- package/dist/src/command-line/completion/command-object.js +7 -12
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +40 -41
- package/dist/src/command-line/format/format.js +67 -100
- package/dist/src/command-line/generate/generate.js +35 -35
- package/dist/src/command-line/graph/graph.d.ts +31 -0
- package/dist/src/command-line/graph/graph.js +150 -29
- package/dist/src/command-line/import/import.js +30 -40
- package/dist/src/command-line/init/ai-agent-prompts.js +5 -11
- package/dist/src/command-line/init/command-object.js +0 -10
- package/dist/src/command-line/init/configure-plugins.js +4 -1
- package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +12 -35
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +38 -86
- package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +8 -24
- 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 -18
- package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -3
- 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 +5 -0
- package/dist/src/command-line/init/implementation/format.d.ts +18 -0
- package/dist/src/command-line/init/implementation/format.js +113 -0
- package/dist/src/command-line/init/implementation/utils.d.ts +0 -1
- package/dist/src/command-line/init/implementation/utils.js +13 -16
- package/dist/src/command-line/init/init-v1.js +15 -18
- package/dist/src/command-line/init/init-v2.js +81 -76
- 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 +127 -0
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +25 -3
- package/dist/src/command-line/migrate/agentic/definitions.js +56 -62
- 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 +7 -30
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +11 -62
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +38 -47
- package/dist/src/command-line/migrate/agentic/handoff.js +133 -104
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +2 -0
- package/dist/src/command-line/migrate/agentic/instruction-files.js +20 -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 +34 -0
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +214 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +32 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.js +284 -0
- 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/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 +6 -0
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +81 -0
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +0 -15
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +3 -100
- package/dist/src/command-line/migrate/agentic/select.d.ts +16 -2
- package/dist/src/command-line/migrate/agentic/select.js +63 -35
- 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 +33 -47
- package/dist/src/command-line/migrate/agentic/types.js +36 -0
- 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 +8 -0
- package/dist/src/command-line/migrate/command-object.js +27 -3
- 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 +34 -9
- package/dist/src/command-line/migrate/execute-migration.js +176 -44
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +78 -1
- package/dist/src/command-line/migrate/migrate-analytics.js +165 -2
- package/dist/src/command-line/migrate/migrate-commits.d.ts +61 -18
- package/dist/src/command-line/migrate/migrate-commits.js +204 -25
- package/dist/src/command-line/migrate/migrate-config.d.ts +16 -12
- package/dist/src/command-line/migrate/migrate-config.js +40 -18
- package/dist/src/command-line/migrate/migrate-output.d.ts +39 -10
- package/dist/src/command-line/migrate/migrate-output.js +45 -14
- package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
- package/dist/src/command-line/migrate/migrate-ui-api.js +16 -7
- package/dist/src/command-line/migrate/migrate.d.ts +39 -84
- package/dist/src/command-line/migrate/migrate.js +1012 -464
- 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/prompt-files.js +2 -9
- package/dist/src/command-line/migrate/resolve-package-version.d.ts +2 -4
- package/dist/src/command-line/migrate/resolve-package-version.js +8 -62
- package/dist/src/command-line/migrate/run/agent-output.d.ts +33 -0
- package/dist/src/command-line/migrate/run/agent-output.js +93 -0
- 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 +159 -0
- package/dist/src/command-line/migrate/run/broker.js +616 -0
- package/dist/src/command-line/migrate/run/clean-retry.d.ts +12 -0
- package/dist/src/command-line/migrate/run/clean-retry.js +101 -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 +229 -0
- package/dist/src/command-line/migrate/run/give-up.d.ts +42 -0
- package/dist/src/command-line/migrate/run/give-up.js +151 -0
- package/dist/src/command-line/migrate/run/index.d.ts +14 -0
- package/dist/src/command-line/migrate/run/index.js +57 -0
- package/dist/src/command-line/migrate/run/issues.d.ts +127 -0
- package/dist/src/command-line/migrate/run/issues.js +1126 -0
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +135 -0
- package/dist/src/command-line/migrate/run/orchestrator.js +2536 -0
- package/dist/src/command-line/migrate/run/run-id.d.ts +8 -0
- package/dist/src/command-line/migrate/run/run-id.js +26 -0
- package/dist/src/command-line/migrate/run/run-state.d.ts +233 -0
- package/dist/src/command-line/migrate/run/run-state.js +708 -0
- package/dist/src/command-line/migrate/run/runbook.d.ts +19 -0
- package/dist/src/command-line/migrate/run/runbook.js +215 -0
- package/dist/src/command-line/migrate/run/state-lock.d.ts +81 -0
- package/dist/src/command-line/migrate/run/state-lock.js +294 -0
- package/dist/src/command-line/migrate/run/state-machine.d.ts +133 -0
- package/dist/src/command-line/migrate/run/state-machine.js +631 -0
- package/dist/src/command-line/migrate/run/util.d.ts +66 -0
- package/dist/src/command-line/migrate/run/util.js +196 -0
- package/dist/src/command-line/migrate/run/worker.d.ts +16 -0
- package/dist/src/command-line/migrate/run/worker.js +845 -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 +10 -0
- package/dist/src/command-line/migrate/sort-migrations.js +21 -0
- package/dist/src/command-line/migrate/step-actions.d.ts +5 -0
- package/dist/src/command-line/migrate/step-actions.js +18 -0
- package/dist/src/command-line/migrate/text.d.ts +24 -0
- package/dist/src/command-line/migrate/text.js +51 -0
- package/dist/src/command-line/migrate/version-skew-guard.d.ts +60 -0
- package/dist/src/command-line/migrate/version-skew-guard.js +177 -0
- package/dist/src/command-line/migrate/workspace-installation.d.ts +15 -0
- package/dist/src/command-line/migrate/workspace-installation.js +73 -0
- package/dist/src/command-line/nx-cloud/complete-run/command-object.js +1 -1
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +37 -42
- package/dist/src/command-line/nx-cloud/fix-ci/command-object.js +1 -1
- package/dist/src/command-line/nx-cloud/logout/command-object.js +11 -2
- package/dist/src/command-line/nx-cloud/record/command-object.js +1 -1
- package/dist/src/command-line/nx-cloud/start-ci-run/command-object.js +1 -1
- 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 +29 -26
- package/dist/src/command-line/release/config/config.d.ts +1 -0
- package/dist/src/command-line/release/config/config.js +48 -9
- 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 +11 -3
- package/dist/src/command-line/release/release.js +8 -19
- package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
- package/dist/src/command-line/release/utils/git.js +9 -8
- package/dist/src/command-line/release/utils/interpolate-release-config.d.ts +6 -0
- package/dist/src/command-line/release/utils/interpolate-release-config.js +39 -0
- package/dist/src/command-line/release/utils/release-graph.d.ts +23 -0
- package/dist/src/command-line/release/utils/release-graph.js +82 -21
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +26 -36
- package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +21 -31
- 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/utils/resolve-changelog-renderer.js +2 -2
- package/dist/src/command-line/release/utils/resolve-semver-specifier.js +19 -41
- package/dist/src/command-line/release/utils/shared.js +10 -10
- package/dist/src/command-line/release/utils/version-plan-utils.d.ts +3 -12
- package/dist/src/command-line/release/utils/version-plan-utils.js +33 -55
- 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 +30 -2
- package/dist/src/command-line/release/version/version-actions.js +13 -3
- package/dist/src/command-line/release/version.js +15 -8
- package/dist/src/command-line/report/report.d.ts +2 -0
- package/dist/src/command-line/report/report.js +28 -1
- package/dist/src/command-line/reset/reset.js +87 -80
- package/dist/src/command-line/run/executor-utils.js +1 -0
- package/dist/src/command-line/run/run-one.d.ts +20 -1
- package/dist/src/command-line/run/run-one.js +159 -6
- package/dist/src/command-line/run/run.js +2 -1
- package/dist/src/command-line/run-many/run-many.js +7 -12
- package/dist/src/command-line/show/command-object.js +1 -1
- package/dist/src/command-line/show/projects.js +54 -1
- package/dist/src/command-line/show/show-target/info.d.ts +11 -2
- package/dist/src/command-line/show/show-target/info.js +100 -15
- package/dist/src/command-line/show/show-target/inputs.js +10 -2
- package/dist/src/command-line/show/show-target/utils.js +1 -0
- package/dist/src/command-line/watch/command-object.js +3 -22
- package/dist/src/command-line/watch/watch.d.ts +0 -7
- package/dist/src/command-line/watch/watch.js +14 -1
- package/dist/src/command-line/yargs-utils/shared-options.d.ts +5 -1
- package/dist/src/command-line/yargs-utils/shared-options.js +40 -4
- package/dist/src/config/misc-interfaces.d.ts +37 -7
- package/dist/src/config/nx-json.d.ts +22 -11
- package/dist/src/config/task-graph.d.ts +1 -1
- package/dist/src/config/workspace-json-project-json.d.ts +111 -1
- package/dist/src/core/graph/favicon.ico +0 -0
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/runtime.js +1 -1
- package/dist/src/core/graph/styles.css +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +76 -9
- package/dist/src/daemon/client/client.js +455 -107
- package/dist/src/daemon/client/daemon-environment.d.ts +62 -0
- package/dist/src/daemon/client/daemon-environment.js +257 -5
- package/dist/src/daemon/client/daemon-socket-messenger.d.ts +2 -2
- package/dist/src/daemon/client/daemon-socket-messenger.js +14 -5
- package/dist/src/daemon/is-v8-serializer-enabled.d.ts +2 -2
- package/dist/src/daemon/is-v8-serializer-enabled.js +2 -2
- package/dist/src/daemon/message-types/daemon-message.d.ts +33 -0
- package/dist/src/daemon/message-types/daemon-message.js +48 -0
- 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/sandbox-socket-hint.d.ts +27 -0
- package/dist/src/daemon/sandbox-socket-hint.js +136 -0
- package/dist/src/daemon/server/client-socket-context.d.ts +1 -1
- package/dist/src/daemon/server/client-socket-context.js +2 -3
- package/dist/src/daemon/server/dotenv-graph-changes.d.ts +97 -0
- package/dist/src/daemon/server/dotenv-graph-changes.js +284 -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-client-env.d.ts +8 -0
- package/dist/src/daemon/server/handle-client-env.js +113 -0
- 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-process-in-background.js +21 -9
- package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +4 -0
- package/dist/src/daemon/server/handle-select-affected-tasks.js +34 -0
- package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
- package/dist/src/daemon/server/handle-watch-events.d.ts +10 -0
- package/dist/src/daemon/server/handle-watch-events.js +85 -0
- package/dist/src/daemon/server/latest-nx.js +5 -2
- package/dist/src/daemon/server/native-js-loader.d.ts +1 -0
- package/dist/src/daemon/server/native-js-loader.js +21 -0
- 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 +36 -0
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +231 -50
- 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 +3 -1
- package/dist/src/daemon/server/server.js +125 -100
- package/dist/src/daemon/server/shutdown-utils.d.ts +6 -6
- package/dist/src/daemon/server/shutdown-utils.js +13 -32
- package/dist/src/daemon/server/start.d.ts +1 -0
- package/dist/src/daemon/server/start.js +2 -0
- 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/daemon/socket-utils.d.ts +32 -10
- package/dist/src/daemon/socket-utils.js +61 -56
- package/dist/src/daemon/tmp-dir.d.ts +59 -4
- package/dist/src/daemon/tmp-dir.js +223 -29
- package/dist/src/devkit-exports.d.ts +9 -1
- package/dist/src/devkit-exports.js +12 -1
- package/dist/src/devkit-internals.d.ts +114 -10
- package/dist/src/devkit-internals.js +251 -7
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +5 -2
- package/dist/src/executors/run-commands/run-commands.impl.js +61 -21
- package/dist/src/executors/run-commands/running-tasks.d.ts +15 -5
- package/dist/src/executors/run-commands/running-tasks.js +206 -129
- package/dist/src/executors/run-commands/schema.json +2 -2
- 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/hasher/check-task-files.js +5 -8
- 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/file-hasher.js +9 -7
- 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 +32 -17
- package/dist/src/hasher/native-task-hasher-impl.d.ts +20 -4
- package/dist/src/hasher/native-task-hasher-impl.js +77 -9
- package/dist/src/hasher/task-hasher.d.ts +26 -7
- package/dist/src/hasher/task-hasher.js +31 -9
- package/dist/src/hasher/task-planning-context.d.ts +13 -0
- package/dist/src/hasher/task-planning-context.js +12 -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 +11 -0
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +245 -0
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +50 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.js +15 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.md +30 -0
- package/dist/src/migrations/update-24-0-0/find-custom-hashers.d.ts +3 -0
- package/dist/src/migrations/update-24-0-0/find-custom-hashers.js +100 -0
- package/dist/src/migrations/update-24-0-0/find-custom-hashers.md +63 -0
- package/dist/src/migrations/update-24-0-0/move-custom-hashers-to-inputs.md +146 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.d.ts +3 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.js +130 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.md +62 -0
- package/dist/src/native/index.d.ts +831 -36
- package/dist/src/native/index.js +85 -42
- package/dist/src/native/native-bindings.js +23 -1
- 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.openharmony-arm64.node +0 -0
- package/dist/src/native/nx.wasi-browser.js +1 -0
- package/dist/src/native/nx.wasi.cjs +1 -0
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/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 +18 -11
- package/dist/src/nx-cloud/update-manager.d.ts +19 -0
- package/dist/src/nx-cloud/update-manager.js +250 -56
- package/dist/src/nx-cloud/utilities/client.d.ts +2 -1
- package/dist/src/nx-cloud/utilities/client.js +6 -1
- package/dist/src/nx-cloud/utilities/get-cloud-options.js +5 -2
- 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/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 +22 -14
- package/dist/src/plugins/js/index.js +45 -64
- package/dist/src/plugins/js/lock-file/bun-parser.js +43 -10
- package/dist/src/plugins/js/lock-file/lock-file.d.ts +50 -8
- package/dist/src/plugins/js/lock-file/lock-file.js +198 -22
- package/dist/src/plugins/js/lock-file/npm-parser.js +10 -3
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +417 -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 +331 -0
- package/dist/src/plugins/js/lock-file/pruned-output.js +1465 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +3 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +28 -5
- 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 +79 -27
- package/dist/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +2 -1
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +24 -18
- package/dist/src/plugins/js/utils/register.d.ts +11 -0
- package/dist/src/plugins/js/utils/register.js +65 -16
- package/dist/src/plugins/js/utils/typescript.js +3 -2
- 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 +15 -1
- package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.js +6 -19
- 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 +106 -0
- package/dist/src/project-graph/affected/affected-tasks.js +410 -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 +17 -1
- package/dist/src/project-graph/error-types.js +71 -7
- 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 +29 -1
- package/dist/src/project-graph/plugins/get-plugins.js +165 -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/enabled.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 +41 -0
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +189 -34
- 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 +19 -5
- package/dist/src/project-graph/plugins/isolation/messaging.js +4 -3
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +85 -10
- package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -2
- package/dist/src/project-graph/plugins/loaded-nx-plugin.js +63 -7
- 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 +90 -44
- package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +7 -0
- package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +19 -7
- package/dist/src/project-graph/utils/project-configuration/target-defaults.js +47 -21
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +95 -3
- 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/project-graph/utils/project-configuration-utils.js +2 -2
- package/dist/src/project-graph/utils/retrieve-workspace-files.js +29 -8
- 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 +32 -8
- package/dist/src/tasks-runner/create-task-graph.js +106 -28
- package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.d.ts +4 -1
- package/dist/src/tasks-runner/forked-process-task-runner.js +26 -16
- package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
- package/dist/src/tasks-runner/init-tasks-runner.js +133 -38
- package/dist/src/tasks-runner/is-tui-enabled.js +5 -2
- package/dist/src/tasks-runner/life-cycle.d.ts +13 -3
- package/dist/src/tasks-runner/life-cycle.js +16 -2
- package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +34 -13
- package/dist/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +26 -5
- package/dist/src/tasks-runner/life-cycles/performance-analysis.d.ts +5 -2
- package/dist/src/tasks-runner/life-cycles/performance-analysis.js +13 -7
- package/dist/src/tasks-runner/life-cycles/performance-life-cycle.d.ts +4 -3
- package/dist/src/tasks-runner/life-cycles/performance-life-cycle.js +9 -2
- package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +12 -0
- package/dist/src/tasks-runner/life-cycles/performance-report.js +62 -3
- 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 +103 -6
- 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 +116 -17
- 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 +150 -0
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -11
- package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +76 -39
- 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/pseudo-ipc.d.ts +1 -0
- package/dist/src/tasks-runner/pseudo-ipc.js +18 -13
- package/dist/src/tasks-runner/pseudo-terminal.d.ts +18 -4
- package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
- package/dist/src/tasks-runner/readiness/executor-ready-signal.d.ts +7 -0
- package/dist/src/tasks-runner/readiness/executor-ready-signal.js +43 -0
- package/dist/src/tasks-runner/readiness/probes.d.ts +14 -0
- package/dist/src/tasks-runner/readiness/probes.js +101 -0
- package/dist/src/tasks-runner/readiness/ready-signal-server.d.ts +18 -0
- package/dist/src/tasks-runner/readiness/ready-signal-server.js +72 -0
- package/dist/src/tasks-runner/readiness/ready-signal.d.ts +33 -0
- package/dist/src/tasks-runner/readiness/ready-signal.js +92 -0
- package/dist/src/tasks-runner/readiness/ready-when.d.ts +84 -0
- package/dist/src/tasks-runner/readiness/ready-when.js +371 -0
- package/dist/src/tasks-runner/readiness/startup-host.d.ts +1 -0
- package/dist/src/tasks-runner/readiness/startup-host.js +32 -0
- package/dist/src/tasks-runner/run-command.d.ts +47 -7
- package/dist/src/tasks-runner/run-command.js +146 -87
- package/dist/src/tasks-runner/run-outcome.d.ts +16 -0
- package/dist/src/tasks-runner/run-outcome.js +39 -0
- package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +130 -1
- package/dist/src/tasks-runner/running-tasks/batch-process.js +267 -9
- package/dist/src/tasks-runner/running-tasks/node-child-process.js +5 -4
- package/dist/src/tasks-runner/running-tasks/running-task.d.ts +1 -1
- package/dist/src/tasks-runner/running-tasks/shared-running-task.d.ts +1 -0
- package/dist/src/tasks-runner/running-tasks/shared-running-task.js +12 -1
- package/dist/src/tasks-runner/task-env.d.ts +35 -0
- package/dist/src/tasks-runner/task-env.js +81 -7
- package/dist/src/tasks-runner/task-graph-utils.d.ts +9 -6
- package/dist/src/tasks-runner/task-graph-utils.js +17 -12
- 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 +201 -16
- package/dist/src/tasks-runner/task-orchestrator.js +1216 -205
- package/dist/src/tasks-runner/tasks-runner.d.ts +2 -0
- package/dist/src/tasks-runner/tasks-schedule.d.ts +18 -1
- package/dist/src/tasks-runner/tasks-schedule.js +63 -6
- 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/tokens.d.ts +54 -0
- package/dist/src/tasks-runner/tokens.js +161 -0
- package/dist/src/tasks-runner/utils.d.ts +40 -6
- package/dist/src/tasks-runner/utils.js +160 -71
- package/dist/src/ultracache/ci-status.d.ts +24 -0
- package/dist/src/ultracache/ci-status.js +87 -0
- package/dist/src/ultracache/config.d.ts +21 -0
- package/dist/src/ultracache/config.js +29 -0
- package/dist/src/ultracache/fetch.d.ts +23 -0
- package/dist/src/ultracache/fetch.js +44 -0
- package/dist/src/ultracache/overrides.d.ts +17 -0
- package/dist/src/ultracache/overrides.js +65 -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/acknowledge-build-scripts.d.ts +34 -1
- package/dist/src/utils/acknowledge-build-scripts.js +171 -32
- 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.js +4 -7
- package/dist/src/utils/assert-workspace-validity.js +7 -2
- package/dist/src/utils/cache-directory.d.ts +62 -3
- package/dist/src/utils/cache-directory.js +276 -25
- 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 +105 -1
- package/dist/src/utils/chunkify.d.ts +1 -1
- package/dist/src/utils/chunkify.js +3 -2
- 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/consume-messages-from-socket.d.ts +42 -7
- package/dist/src/utils/consume-messages-from-socket.js +273 -38
- 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 +10 -16
- 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/find-matching-projects.js +9 -6
- package/dist/src/utils/formatters/index.d.ts +19 -0
- package/dist/src/utils/formatters/index.js +79 -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 +18 -0
- package/dist/src/utils/formatters/prettier.js +179 -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-utils.d.ts +64 -2
- package/dist/src/utils/git-utils.js +560 -41
- package/dist/src/utils/git-worktrees.d.ts +30 -0
- package/dist/src/utils/git-worktrees.js +212 -0
- package/dist/src/utils/handle-errors.js +5 -43
- package/dist/src/utils/has-nx-js-plugin.d.ts +1 -1
- package/dist/src/utils/has-nx-js-plugin.js +1 -1
- package/dist/src/utils/http-client.d.ts +27 -0
- package/dist/src/utils/http-client.js +193 -0
- package/dist/src/utils/ignore.d.ts +170 -1
- package/dist/src/utils/ignore.js +263 -11
- package/dist/src/utils/installation-directory.d.ts +8 -0
- package/dist/src/utils/installation-directory.js +13 -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/kill-child-on-host-exit.d.ts +7 -0
- package/dist/src/utils/kill-child-on-host-exit.js +42 -0
- package/dist/src/utils/long-running-target.d.ts +8 -0
- package/dist/src/utils/long-running-target.js +17 -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/behavior/pnpm.js +17 -9
- package/dist/src/utils/min-release-age/packument.js +2 -2
- 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/nx-console-prompt.js +3 -6
- package/dist/src/utils/nx-tmp-dir.d.ts +23 -0
- package/dist/src/utils/nx-tmp-dir.js +45 -0
- package/dist/src/utils/output.d.ts +173 -0
- package/dist/src/utils/output.js +313 -5
- package/dist/src/utils/owned-private-dir.d.ts +129 -0
- package/dist/src/utils/owned-private-dir.js +310 -0
- package/dist/src/utils/package-json.d.ts +27 -0
- package/dist/src/utils/package-json.js +62 -8
- 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 +37 -3
- package/dist/src/utils/package-manager.js +373 -69
- package/dist/src/utils/params.d.ts +7 -1
- package/dist/src/utils/params.js +65 -7
- package/dist/src/utils/path.d.ts +6 -0
- package/dist/src/utils/path.js +15 -0
- package/dist/src/utils/perf-hooks.d.ts +1 -0
- package/dist/src/utils/permission-errors.d.ts +11 -0
- package/dist/src/utils/permission-errors.js +17 -0
- package/dist/src/utils/plugins/core-plugins.js +9 -1
- package/dist/src/utils/plugins/plugin-capabilities.js +7 -2
- package/dist/src/utils/progress-topics.d.ts +1 -0
- package/dist/src/utils/progress-topics.js +1 -0
- 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/prompt-helpers.d.ts +53 -0
- package/dist/src/utils/prompt-helpers.js +111 -0
- package/dist/src/utils/provenance.js +26 -18
- 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 +100 -0
- package/dist/src/utils/serialize-overrides-into-command-line.js +2 -4
- package/dist/src/utils/shell-quoting.d.ts +22 -0
- package/dist/src/utils/shell-quoting.js +46 -0
- package/dist/src/utils/socket-refused-exit-code.d.ts +15 -0
- package/dist/src/utils/socket-refused-exit-code.js +18 -0
- package/dist/src/utils/spawn-without-terminal.d.ts +27 -0
- package/dist/src/utils/spawn-without-terminal.js +110 -0
- package/dist/src/utils/string-similarity.d.ts +38 -0
- package/dist/src/utils/string-similarity.js +108 -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-context.d.ts +51 -3
- package/dist/src/utils/workspace-context.js +174 -10
- 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 +25 -5
- package/package.json +36 -57
- package/schemas/migrations-schema.json +11 -0
- package/schemas/nx-schema.json +169 -9
- package/schemas/project-schema.json +147 -2
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +0 -56
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +0 -66
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +0 -49
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +0 -53
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +0 -26
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +0 -27
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +0 -46
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -90
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -58
- package/dist/src/command-line/migrate/agentic/run-step.js +0 -123
- package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -33
- package/dist/src/command-line/migrate/agentic/runner.js +0 -444
- 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/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/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +0 -9
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +0 -18
- 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 -44
- 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/tasks-runner/legacy-depends-on-warning.d.ts +0 -18
- package/dist/src/tasks-runner/legacy-depends-on-warning.js +0 -109
- package/dist/src/utils/collapse-expanded-outputs.d.ts +0 -10
- package/dist/src/utils/collapse-expanded-outputs.js +0 -72
- 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
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<p
|
|
1
|
+
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-
|
|
4
|
-
<img alt="Nx
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo-light.svg">
|
|
4
|
+
<img alt="Nx Logo" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.svg" width="140">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[]()
|
|
10
|
+
[](<>)
|
|
11
11
|
[](https://www.npmjs.com/package/nx)
|
|
12
|
-
[]()
|
|
12
|
+
[](<>)
|
|
13
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
14
14
|
[](https://go.nx.dev/community)
|
|
15
|
-
[](https://nx.dev/nx-cloud)
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
@@ -60,6 +60,3 @@ npx nx@latest init
|
|
|
60
60
|
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
|
61
61
|
- [Blog Posts About Nx](https://nx.dev/blog)
|
|
62
62
|
|
|
63
|
-
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
64
|
-
width="100%" alt="Nx - Smart Monorepos · Fast Builds"></a></p>
|
|
65
|
-
|
package/dist/bin/init-local.js
CHANGED
|
@@ -6,9 +6,10 @@ const perf_hooks_1 = require("perf_hooks");
|
|
|
6
6
|
const nx_commands_1 = require("../src/command-line/nx-commands");
|
|
7
7
|
const strip_indents_1 = require("../src/utils/strip-indents");
|
|
8
8
|
const client_1 = require("../src/daemon/client/client");
|
|
9
|
-
const
|
|
9
|
+
const prompt_helpers_1 = require("../src/utils/prompt-helpers");
|
|
10
10
|
const output_1 = require("../src/utils/output");
|
|
11
11
|
const analytics_1 = require("../src/analytics");
|
|
12
|
+
const is_ci_1 = require("../src/utils/is-ci");
|
|
12
13
|
/**
|
|
13
14
|
* Nx is being run inside a workspace.
|
|
14
15
|
*
|
|
@@ -119,6 +120,11 @@ function shouldDelegateToAngularCLI() {
|
|
|
119
120
|
return commands.indexOf(command) > -1;
|
|
120
121
|
}
|
|
121
122
|
async function ensureNxConsoleInstalledViaDaemon() {
|
|
123
|
+
// Asking the daemon makes a fresh daemon install nx@latest in the background,
|
|
124
|
+
// so skip it whenever the prompt could not be shown anyway.
|
|
125
|
+
if (!process.stdout.isTTY || (0, is_ci_1.isCI)()) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
122
128
|
// Only proceed if daemon is available
|
|
123
129
|
if (!client_1.daemonClient.enabled() || !(await client_1.daemonClient.isServerAvailable())) {
|
|
124
130
|
return;
|
|
@@ -126,7 +132,7 @@ async function ensureNxConsoleInstalledViaDaemon() {
|
|
|
126
132
|
// Get status from daemon
|
|
127
133
|
const status = await client_1.daemonClient.getNxConsoleStatus();
|
|
128
134
|
// If we should prompt the user
|
|
129
|
-
if (status.shouldPrompt
|
|
135
|
+
if (status.shouldPrompt) {
|
|
130
136
|
output_1.output.log({
|
|
131
137
|
title: "Install Nx's official editor extension to:",
|
|
132
138
|
bodyLines: [
|
|
@@ -136,11 +142,9 @@ async function ensureNxConsoleInstalledViaDaemon() {
|
|
|
136
142
|
],
|
|
137
143
|
});
|
|
138
144
|
try {
|
|
139
|
-
const
|
|
140
|
-
type: 'confirm',
|
|
141
|
-
name: 'shouldInstallNxConsole',
|
|
145
|
+
const shouldInstallNxConsole = await (0, prompt_helpers_1.confirmationPrompt)({
|
|
142
146
|
message: 'Install Nx Console? (you can uninstall anytime)',
|
|
143
|
-
|
|
147
|
+
onCancel: () => false,
|
|
144
148
|
});
|
|
145
149
|
// Set preference and install if user said yes
|
|
146
150
|
const result = await client_1.daemonClient.setNxConsolePreferenceAndInstall(shouldInstallNxConsole);
|
package/dist/bin/nx-cloud.js
CHANGED
|
@@ -12,6 +12,15 @@ Promise.resolve().then(async () => invokeCommandWithNxCloudClient(options));
|
|
|
12
12
|
async function invokeCommandWithNxCloudClient(options) {
|
|
13
13
|
try {
|
|
14
14
|
const client = await (0, client_1.getCloudClient)(options);
|
|
15
|
+
if (client.runCLI) {
|
|
16
|
+
return client
|
|
17
|
+
.runCLI(process.argv.slice(2))
|
|
18
|
+
.then((exitCode) => process.exit(typeof exitCode === 'number' ? exitCode : 0))
|
|
19
|
+
.catch((e) => {
|
|
20
|
+
console.error(e);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
15
24
|
client.invoke(command);
|
|
16
25
|
}
|
|
17
26
|
catch (e) {
|
package/dist/bin/nx.js
CHANGED
package/dist/bin/post-install.js
CHANGED
|
@@ -9,6 +9,8 @@ const get_cloud_options_1 = require("../src/nx-cloud/utilities/get-cloud-options
|
|
|
9
9
|
const nx_cloud_utils_1 = require("../src/utils/nx-cloud-utils");
|
|
10
10
|
const nx_json_1 = require("../src/config/nx-json");
|
|
11
11
|
const logger_1 = require("../src/utils/logger");
|
|
12
|
+
const package_json_1 = require("../src/utils/package-json");
|
|
13
|
+
const installation_directory_1 = require("../src/utils/installation-directory");
|
|
12
14
|
// The post install is not critical, to avoid any chance that it may hang
|
|
13
15
|
// we will kill this process after 30 seconds.
|
|
14
16
|
const postinstallTimeout = setTimeout(() => {
|
|
@@ -36,9 +38,9 @@ const postinstallTimeout = setTimeout(() => {
|
|
|
36
38
|
}
|
|
37
39
|
})();
|
|
38
40
|
function isMainNxPackage() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
// A plain `require.resolve('nx', { paths })` self-references this package,
|
|
42
|
+
// so every installed nx copy would pass.
|
|
43
|
+
const mainNxPath = (0, package_json_1.resolveWithoutCachePollution)('nx', (0, installation_directory_1.getNxRequirePaths)(workspace_root_1.workspaceRoot));
|
|
42
44
|
const thisNxPath = require.resolve('nx');
|
|
43
45
|
return mainNxPath === thisNxPath;
|
|
44
46
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Nx internals for the Nx Cloud client, loaded as `nx/nx-cloud-internals`; not
|
|
3
|
+
// a public API. The client probes these exports to tell what this nx supports,
|
|
4
|
+
// so keep them stable.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TASK_GRAPH_FORMAT = exports.openUltracacheConfigurations = exports.importUltracacheConfigurations = void 0;
|
|
7
|
+
var store_1 = require("./src/ultracache/store");
|
|
8
|
+
Object.defineProperty(exports, "importUltracacheConfigurations", { enumerable: true, get: function () { return store_1.importUltracacheConfigurations; } });
|
|
9
|
+
Object.defineProperty(exports, "openUltracacheConfigurations", { enumerable: true, get: function () { return store_1.openUltracacheConfigurations; } });
|
|
10
|
+
// Nx Cloud reads it to pick the task-graph shape it hands this nx. Bump it when
|
|
11
|
+
// the shape changes in a way Cloud must handle.
|
|
12
|
+
// 1: `dependencies` and `continuousDependencies` edges are task ids (implied
|
|
13
|
+
// when the export is absent)
|
|
14
|
+
// 2: edges are objects (`{ id, waitFor?, inputs? }`)
|
|
15
|
+
exports.TASK_GRAPH_FORMAT = 2;
|
|
@@ -29,7 +29,7 @@ const plugin = {
|
|
|
29
29
|
const patterns = (0, package_json_1.buildPackageJsonPatterns)(context.workspaceRoot, (f) => (0, fileutils_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, f)));
|
|
30
30
|
const isInPackageJsonWorkspaces = (0, package_json_1.buildPackageJsonWorkspacesMatcher)(patterns);
|
|
31
31
|
const packageManagerCommand = (0, package_manager_1.getPackageManagerCommand)((0, package_manager_1.detectPackageManager)(context.workspaceRoot), context.workspaceRoot);
|
|
32
|
-
const result = (0, plugins_1.createNodesFromFiles)((packageJsonPath) => (0, package_json_1.createNodeFromPackageJson)(packageJsonPath, workspace_root_1.workspaceRoot, cache, isInPackageJsonWorkspaces(packageJsonPath), packageManagerCommand), configFiles, options, context);
|
|
32
|
+
const result = (0, plugins_1.createNodesFromFiles)((packageJsonPath) => (0, package_json_1.createNodeFromPackageJson)(packageJsonPath, workspace_root_1.workspaceRoot, cache, isInPackageJsonWorkspaces(packageJsonPath), packageManagerCommand, context.nxJsonConfiguration), configFiles, options, context);
|
|
33
33
|
writeCache();
|
|
34
34
|
return result;
|
|
35
35
|
},
|
|
@@ -106,5 +106,9 @@ export default class DefaultChangelogRenderer {
|
|
|
106
106
|
protected groupChangesByScope(changes: ChangelogChange[]): Record<string, ChangelogChange[]>;
|
|
107
107
|
protected extractBreakingChangeExplanation(message: string): string | null;
|
|
108
108
|
private isBreakingChangeBoundary;
|
|
109
|
+
protected isAiAgentAuthor(author: {
|
|
110
|
+
name: string;
|
|
111
|
+
email: string;
|
|
112
|
+
}): boolean;
|
|
109
113
|
protected formatName(name?: string): string;
|
|
110
114
|
}
|
|
@@ -3,6 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const semver_1 = require("semver");
|
|
4
4
|
// Stripped from breaking change explanations (e.g. bot/session markers).
|
|
5
5
|
const HtmlCommentRegex = /<!--[\s\S]*?-->/g;
|
|
6
|
+
// Keyed on email: agent display names track model versions (e.g. "Claude Opus
|
|
7
|
+
// 5 (1M context)"), and a human contributor can share a name with an agent.
|
|
8
|
+
const AiAgentAuthorEmails = new Set([
|
|
9
|
+
'noreply@anthropic.com',
|
|
10
|
+
'claude@anthropic.com',
|
|
11
|
+
'amp@ampcode.com',
|
|
12
|
+
'cursoragent@cursor.com',
|
|
13
|
+
'openhands@all-hands.dev',
|
|
14
|
+
'opendevin@all-hands.dev',
|
|
15
|
+
]);
|
|
16
|
+
// The Copilot coding agent's trailer is not always [bot]-suffixed.
|
|
17
|
+
const CopilotAuthorEmailRegex = /^(?:\d+\+)?copilot@users\.noreply\.github\.com$/;
|
|
6
18
|
class DefaultChangelogRenderer {
|
|
7
19
|
/**
|
|
8
20
|
* A ChangelogRenderer class takes in the determined changes and other relevant metadata
|
|
@@ -212,15 +224,14 @@ class DefaultChangelogRenderer {
|
|
|
212
224
|
}
|
|
213
225
|
for (const author of change.authors) {
|
|
214
226
|
const name = this.formatName(author.name);
|
|
215
|
-
if (!name || name.includes('[bot]')) {
|
|
227
|
+
if (!name || name.includes('[bot]') || this.isAiAgentAuthor(author)) {
|
|
216
228
|
continue;
|
|
217
229
|
}
|
|
218
|
-
if (_authors.has(name)) {
|
|
219
|
-
|
|
220
|
-
entry.email.add(author.email);
|
|
230
|
+
if (!_authors.has(name)) {
|
|
231
|
+
_authors.set(name, { email: new Set() });
|
|
221
232
|
}
|
|
222
|
-
|
|
223
|
-
_authors.
|
|
233
|
+
if (author.email) {
|
|
234
|
+
_authors.get(name).email.add(author.email);
|
|
224
235
|
}
|
|
225
236
|
}
|
|
226
237
|
}
|
|
@@ -372,6 +383,10 @@ class DefaultChangelogRenderer {
|
|
|
372
383
|
// Git metadata delimiter following the body
|
|
373
384
|
trimmed === '"');
|
|
374
385
|
}
|
|
386
|
+
isAiAgentAuthor(author) {
|
|
387
|
+
const email = (author.email || '').trim().toLowerCase();
|
|
388
|
+
return (AiAgentAuthorEmails.has(email) || CopilotAuthorEmailRegex.test(email));
|
|
389
|
+
}
|
|
375
390
|
formatName(name = '') {
|
|
376
391
|
return name
|
|
377
392
|
.split(' ')
|
package/dist/release/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @public Programmatic API for nx release
|
|
3
3
|
*/
|
|
4
|
-
export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, VersionActions, AfterAllProjectsVersioned, } from '../src/command-line/release';
|
|
4
|
+
export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, VersionActions, AfterAllProjectsVersioned, ResolveVersionForDependency, } from '../src/command-line/release';
|
|
@@ -31,6 +31,7 @@ const executor_utils_1 = require("../command-line/run/executor-utils");
|
|
|
31
31
|
const plugins_1 = require("../project-graph/plugins");
|
|
32
32
|
const schema_utils_1 = require("../config/schema-utils");
|
|
33
33
|
const handle_import_1 = require("../utils/handle-import");
|
|
34
|
+
const prompt_helpers_1 = require("../utils/prompt-helpers");
|
|
34
35
|
const target_merging_1 = require("../project-graph/utils/project-configuration/target-merging");
|
|
35
36
|
function getProjectGraph() {
|
|
36
37
|
try {
|
|
@@ -252,8 +253,7 @@ async function createRecorder(host, record, logger) {
|
|
|
252
253
|
else if (event.kind === 'rename') {
|
|
253
254
|
record.loggingQueue.push(`${pc.blue('RENAME')} ${eventPath} => ${event.to}`);
|
|
254
255
|
// Surface as DELETE source + CREATE destination so downstream consumers
|
|
255
|
-
//
|
|
256
|
-
// both endpoints.
|
|
256
|
+
// see both endpoints.
|
|
257
257
|
const toPath = event.to.startsWith('/') ? event.to.slice(1) : event.to;
|
|
258
258
|
record.changes?.push({ type: 'DELETE', path: eventPath, content: null });
|
|
259
259
|
record.changes?.push(emptyFileChange('CREATE', toPath));
|
|
@@ -653,8 +653,66 @@ function createPromptProvider() {
|
|
|
653
653
|
return { ...question, type: definition.type };
|
|
654
654
|
}
|
|
655
655
|
});
|
|
656
|
-
|
|
656
|
+
// Angular hands over a whole form at once; clack asks one question at a
|
|
657
|
+
// time, so they are run in order and the answers reassembled.
|
|
658
|
+
return (async () => {
|
|
659
|
+
const answers = {};
|
|
660
|
+
for (const question of questions) {
|
|
661
|
+
answers[question.name] = await askSchematicQuestion(question);
|
|
662
|
+
}
|
|
663
|
+
return answers;
|
|
664
|
+
})();
|
|
657
665
|
};
|
|
666
|
+
async function askSchematicQuestion(question) {
|
|
667
|
+
const validate = question.validate
|
|
668
|
+
? (value) => {
|
|
669
|
+
const result = question.validate(value);
|
|
670
|
+
if (result === true)
|
|
671
|
+
return undefined;
|
|
672
|
+
return typeof result === 'string' ? result : 'Invalid value';
|
|
673
|
+
}
|
|
674
|
+
: undefined;
|
|
675
|
+
const choices = (question.choices ?? []).map((c) => typeof c === 'string' ? { value: c } : { value: c.name, label: c.message });
|
|
676
|
+
switch (question.type) {
|
|
677
|
+
case 'confirm':
|
|
678
|
+
return (0, prompt_helpers_1.confirmationPrompt)({
|
|
679
|
+
message: question.message,
|
|
680
|
+
initial: question.initial !== false,
|
|
681
|
+
});
|
|
682
|
+
case 'select':
|
|
683
|
+
return (0, prompt_helpers_1.selectPrompt)({
|
|
684
|
+
message: question.message,
|
|
685
|
+
choices,
|
|
686
|
+
initial: question.initial,
|
|
687
|
+
});
|
|
688
|
+
case 'multiselect':
|
|
689
|
+
return (0, prompt_helpers_1.multiselectPrompt)({
|
|
690
|
+
message: question.message,
|
|
691
|
+
choices,
|
|
692
|
+
initialValues: question.initial,
|
|
693
|
+
});
|
|
694
|
+
case 'numeral': {
|
|
695
|
+
// No numeric prompt; the answer is parsed back so callers still get a
|
|
696
|
+
// number rather than the typed string.
|
|
697
|
+
const answer = await (0, prompt_helpers_1.textPrompt)({
|
|
698
|
+
message: question.message,
|
|
699
|
+
initialValue: question.initial === undefined
|
|
700
|
+
? undefined
|
|
701
|
+
: String(question.initial),
|
|
702
|
+
validate: (value) => value !== '' && !Number.isNaN(Number(value))
|
|
703
|
+
? validate?.(value)
|
|
704
|
+
: 'Please enter a number',
|
|
705
|
+
});
|
|
706
|
+
return Number(answer);
|
|
707
|
+
}
|
|
708
|
+
default:
|
|
709
|
+
return (0, prompt_helpers_1.textPrompt)({
|
|
710
|
+
message: question.message,
|
|
711
|
+
initialValue: question.initial,
|
|
712
|
+
validate,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
}
|
|
658
716
|
}
|
|
659
717
|
async function runMigration(root, packageName, migrationName, projects, isVerbose, projectGraph) {
|
|
660
718
|
const logger = (0, exports.getLogger)(isVerbose);
|
|
@@ -932,6 +990,7 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
|
|
|
932
990
|
const batchImplementationFactory = executorConfig.batchImplementation
|
|
933
991
|
? this.getImplementationFactory(executorConfig.batchImplementation, executorsDir, nodeModule)
|
|
934
992
|
: null;
|
|
993
|
+
// TODO(v25): remove custom hasher support.
|
|
935
994
|
const hasherFactory = executorConfig.hasher
|
|
936
995
|
? this.getImplementationFactory(executorConfig.hasher, executorsDir, nodeModule)
|
|
937
996
|
: null;
|
|
@@ -7,18 +7,59 @@ const os_1 = require("os");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const REPO_URL = 'https://github.com/nrwl/nx-ai-agents-config';
|
|
9
9
|
const CACHE_DIR = (0, path_1.join)((0, os_1.tmpdir)(), 'nx-ai-agents-config');
|
|
10
|
+
// `git rev-parse --local-env-vars`, plus GIT_NAMESPACE and the indexed
|
|
11
|
+
// GIT_CONFIG_KEY_<n> / GIT_CONFIG_VALUE_<n> pairs. Hooks export GIT_INDEX_FILE;
|
|
12
|
+
// inheriting it makes `git clone` rewrite the caller's index.
|
|
13
|
+
const GIT_LOCAL_REPO_ENV_VARS = new Set([
|
|
14
|
+
'GIT_ALTERNATE_OBJECT_DIRECTORIES',
|
|
15
|
+
'GIT_COMMON_DIR',
|
|
16
|
+
'GIT_CONFIG',
|
|
17
|
+
'GIT_CONFIG_COUNT',
|
|
18
|
+
'GIT_CONFIG_PARAMETERS',
|
|
19
|
+
'GIT_DIR',
|
|
20
|
+
'GIT_GRAFT_FILE',
|
|
21
|
+
'GIT_IMPLICIT_WORK_TREE',
|
|
22
|
+
'GIT_INDEX_FILE',
|
|
23
|
+
'GIT_NAMESPACE',
|
|
24
|
+
'GIT_NO_REPLACE_OBJECTS',
|
|
25
|
+
'GIT_OBJECT_DIRECTORY',
|
|
26
|
+
'GIT_PREFIX',
|
|
27
|
+
'GIT_REPLACE_REF_BASE',
|
|
28
|
+
'GIT_SHALLOW_FILE',
|
|
29
|
+
'GIT_WORK_TREE',
|
|
30
|
+
]);
|
|
31
|
+
function isGitLocalRepoEnvVar(key) {
|
|
32
|
+
const upper = key.toUpperCase();
|
|
33
|
+
return (GIT_LOCAL_REPO_ENV_VARS.has(upper) ||
|
|
34
|
+
upper.startsWith('GIT_CONFIG_KEY_') ||
|
|
35
|
+
upper.startsWith('GIT_CONFIG_VALUE_'));
|
|
36
|
+
}
|
|
37
|
+
function environmentWithoutGitLocalRepoVars() {
|
|
38
|
+
const env = { ...process.env };
|
|
39
|
+
for (const key of Object.keys(env)) {
|
|
40
|
+
if (isGitLocalRepoEnvVar(key)) {
|
|
41
|
+
delete env[key];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return env;
|
|
45
|
+
}
|
|
46
|
+
function execGitWithoutLocalRepoEnv(command, timeout) {
|
|
47
|
+
return (0, child_process_1.execSync)(command, {
|
|
48
|
+
encoding: 'utf-8',
|
|
49
|
+
env: environmentWithoutGitLocalRepoVars(),
|
|
50
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
51
|
+
timeout,
|
|
52
|
+
windowsHide: true,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
10
55
|
/**
|
|
11
56
|
* Get the latest commit hash from the remote repository.
|
|
12
57
|
* Uses `git ls-remote` to fetch the HEAD commit hash without cloning.
|
|
13
58
|
*/
|
|
14
59
|
function getLatestCommitHash() {
|
|
15
60
|
try {
|
|
16
|
-
const output = (
|
|
17
|
-
|
|
18
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
19
|
-
timeout: 30000, // 30 second timeout
|
|
20
|
-
windowsHide: true,
|
|
21
|
-
});
|
|
61
|
+
const output = execGitWithoutLocalRepoEnv(`git ls-remote ${REPO_URL} HEAD`, 30000 // 30 second timeout
|
|
62
|
+
);
|
|
22
63
|
const hash = output.split('\t')[0];
|
|
23
64
|
if (!hash || hash.length < 10) {
|
|
24
65
|
throw new Error('Invalid commit hash received');
|
|
@@ -43,12 +84,8 @@ function cloneRepo(targetPath) {
|
|
|
43
84
|
if ((0, fs_1.existsSync)(tempPath)) {
|
|
44
85
|
(0, fs_1.rmSync)(tempPath, { recursive: true, force: true });
|
|
45
86
|
}
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
49
|
-
timeout: 120000, // 2 minute timeout for clone
|
|
50
|
-
windowsHide: true,
|
|
51
|
-
});
|
|
87
|
+
execGitWithoutLocalRepoEnv(`git clone --depth 1 ${REPO_URL} "${tempPath}"`, 120000 // 2 minute timeout for clone
|
|
88
|
+
);
|
|
52
89
|
// Remove .git directory after clone
|
|
53
90
|
const gitDir = (0, path_1.join)(tempPath, '.git');
|
|
54
91
|
if ((0, fs_1.existsSync)(gitDir)) {
|
|
@@ -29,3 +29,18 @@ export declare const nxMcpTomlHeader = "[mcp_servers.\"nx-mcp\"]";
|
|
|
29
29
|
* For Nx < 22, uses 'nx-mcp'
|
|
30
30
|
*/
|
|
31
31
|
export declare function getNxMcpTomlConfig(nxVersion: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* The Nx runtime roots as they belong in a *committed* sandbox allowlist.
|
|
34
|
+
*
|
|
35
|
+
* `~/.nx` is the literal tilde rather than an expanded `NX_HOME_TMP_DIR`: the
|
|
36
|
+
* sandbox expands it per user, which is the property that makes the entry worth
|
|
37
|
+
* committing at all. An absolute home would pin the file to whoever ran the
|
|
38
|
+
* generator.
|
|
39
|
+
*
|
|
40
|
+
* Both are listed because socket resolution walks a chain — `/tmp/.nx` first,
|
|
41
|
+
* `~/.nx` when a peer already owns the shared container. Allowing only the first
|
|
42
|
+
* leaves every user on a machine where someone else got there first silently
|
|
43
|
+
* uncovered. Windows resolves `NX_TMP_DIR` to a machine-specific `%TMP%` and has
|
|
44
|
+
* no sandbox to configure, so the POSIX root is the one that belongs here.
|
|
45
|
+
*/
|
|
46
|
+
export declare const NX_ALLOWLIST_ROOTS: readonly ["/tmp/.nx", "~/.nx"];
|
package/dist/src/ai/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nxMcpTomlHeader = exports.analyticsDomain = exports.getAgentRulesWrapped = exports.rulesRegex = exports.nxRulesMarkerCommentEnd = exports.nxRulesMarkerCommentDescription = exports.nxRulesMarkerCommentStart = void 0;
|
|
3
|
+
exports.NX_ALLOWLIST_ROOTS = exports.nxMcpTomlHeader = exports.analyticsDomain = exports.getAgentRulesWrapped = exports.rulesRegex = exports.nxRulesMarkerCommentEnd = exports.nxRulesMarkerCommentDescription = exports.nxRulesMarkerCommentStart = void 0;
|
|
4
4
|
exports.agentsMdPath = agentsMdPath;
|
|
5
5
|
exports.geminiMdPath = geminiMdPath;
|
|
6
6
|
exports.parseGeminiSettings = parseGeminiSettings;
|
|
@@ -13,6 +13,7 @@ exports.getNxMcpTomlConfig = getNxMcpTomlConfig;
|
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const semver_1 = require("semver");
|
|
15
15
|
const fileutils_1 = require("../utils/fileutils");
|
|
16
|
+
const nx_tmp_dir_1 = require("../utils/nx-tmp-dir");
|
|
16
17
|
const get_agent_rules_1 = require("./set-up-ai-agents/get-agent-rules");
|
|
17
18
|
function agentsMdPath(root) {
|
|
18
19
|
return (0, path_1.join)(root, 'AGENTS.md');
|
|
@@ -74,3 +75,18 @@ command = "npx"
|
|
|
74
75
|
args = ${args}
|
|
75
76
|
`;
|
|
76
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The Nx runtime roots as they belong in a *committed* sandbox allowlist.
|
|
80
|
+
*
|
|
81
|
+
* `~/.nx` is the literal tilde rather than an expanded `NX_HOME_TMP_DIR`: the
|
|
82
|
+
* sandbox expands it per user, which is the property that makes the entry worth
|
|
83
|
+
* committing at all. An absolute home would pin the file to whoever ran the
|
|
84
|
+
* generator.
|
|
85
|
+
*
|
|
86
|
+
* Both are listed because socket resolution walks a chain — `/tmp/.nx` first,
|
|
87
|
+
* `~/.nx` when a peer already owns the shared container. Allowing only the first
|
|
88
|
+
* leaves every user on a machine where someone else got there first silently
|
|
89
|
+
* uncovered. Windows resolves `NX_TMP_DIR` to a machine-specific `%TMP%` and has
|
|
90
|
+
* no sandbox to configure, so the POSIX root is the one that belongs here.
|
|
91
|
+
*/
|
|
92
|
+
exports.NX_ALLOWLIST_ROOTS = [nx_tmp_dir_1.NX_TMP_DIR_POSIX, '~/.nx'];
|
|
@@ -7,9 +7,11 @@ const fs_1 = require("fs");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const semver_1 = require("semver");
|
|
9
9
|
const smol_toml_1 = tslib_1.__importDefault(require("smol-toml"));
|
|
10
|
-
const
|
|
10
|
+
const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
|
|
11
11
|
const generate_files_1 = require("../../generators/utils/generate-files");
|
|
12
12
|
const json_1 = require("../../generators/utils/json");
|
|
13
|
+
const nx_json_1 = require("../../generators/utils/nx-json");
|
|
14
|
+
const analytics_enabled_1 = require("../../utils/analytics-enabled");
|
|
13
15
|
const native_1 = require("../../native");
|
|
14
16
|
const package_json_1 = require("../../utils/package-json");
|
|
15
17
|
const package_manager_1 = require("../../utils/package-manager");
|
|
@@ -71,6 +73,8 @@ function normalizeOptions(options) {
|
|
|
71
73
|
async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
72
74
|
const hasAgent = (agent) => options.agents.includes(agent);
|
|
73
75
|
const nxVersion = (0, installed_nx_version_1.getInstalledNxVersion)() ?? getDeclaredNxVersionOrDefault();
|
|
76
|
+
const analyticsEnabled = (0, analytics_enabled_1.isAnalyticsEnabled)((0, nx_json_1.readNxJson)(tree));
|
|
77
|
+
let addedAnalyticsDomain = false;
|
|
74
78
|
const agentsMd = (0, constants_1.agentsMdPath)(options.directory);
|
|
75
79
|
// write AGENTS.md for most agents
|
|
76
80
|
if (hasAgent('cursor') ||
|
|
@@ -81,12 +85,15 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
81
85
|
}
|
|
82
86
|
if (hasAgent('claude')) {
|
|
83
87
|
const claudePath = (0, path_1.join)(options.directory, 'CLAUDE.md');
|
|
84
|
-
writeAgentRules(tree, claudePath, options.writeNxCloudRules);
|
|
88
|
+
writeAgentRules(tree, importsAgentsMd(tree, claudePath) ? agentsMd : claudePath, options.writeNxCloudRules);
|
|
85
89
|
// Configure Claude plugin via marketplace (plugin includes MCP server)
|
|
86
90
|
const claudeSettingsPath = (0, path_1.join)(options.directory, '.claude', 'settings.json');
|
|
87
91
|
if (!tree.exists(claudeSettingsPath)) {
|
|
88
92
|
(0, json_1.writeJson)(tree, claudeSettingsPath, {});
|
|
89
93
|
}
|
|
94
|
+
const allowedDomains = (0, json_1.readJson)(tree, claudeSettingsPath).sandbox?.network?.allowedDomains;
|
|
95
|
+
addedAnalyticsDomain =
|
|
96
|
+
analyticsEnabled && !allowedDomains?.includes(constants_1.analyticsDomain);
|
|
90
97
|
(0, json_1.updateJson)(tree, claudeSettingsPath, (json) => ({
|
|
91
98
|
...json,
|
|
92
99
|
extraKnownMarketplaces: {
|
|
@@ -103,17 +110,41 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
103
110
|
...json.enabledPlugins,
|
|
104
111
|
'nx@nx-claude-plugins': true,
|
|
105
112
|
},
|
|
106
|
-
// Allow Nx
|
|
113
|
+
// Allow Nx unix socket usage (daemon, plugin workers, forked processes)
|
|
114
|
+
// through Claude Code's sandbox, and analytics requests when the
|
|
115
|
+
// workspace has them on. Nx also copies its native binary into a cache
|
|
116
|
+
// under the same fixed tmp root before loading it, so the read/write
|
|
117
|
+
// grants cover that too. The root is a fixed /tmp path on macOS and
|
|
118
|
+
// Linux, so these entries are machine-independent and safe to commit.
|
|
107
119
|
sandbox: {
|
|
108
120
|
...json.sandbox,
|
|
121
|
+
filesystem: {
|
|
122
|
+
...json.sandbox?.filesystem,
|
|
123
|
+
allowRead: withEntries(json.sandbox?.filesystem?.allowRead, ...constants_1.NX_ALLOWLIST_ROOTS),
|
|
124
|
+
// Covers the whole tmp root, not just the socket dir: the native
|
|
125
|
+
// binary cache lives under it too, and without the cache a running
|
|
126
|
+
// daemon keeps an open handle on the binding inside node_modules,
|
|
127
|
+
// which blocks reinstalling or rebuilding dependencies. What keeps
|
|
128
|
+
// users apart is not this allowlist but the 0700 per-uid directories
|
|
129
|
+
// Nx verifies on every use (see ensureOwnedPrivateDir).
|
|
130
|
+
allowWrite: withEntries(json.sandbox?.filesystem?.allowWrite, ...constants_1.NX_ALLOWLIST_ROOTS),
|
|
131
|
+
},
|
|
109
132
|
network: {
|
|
110
133
|
...json.sandbox?.network,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
constants_1.analyticsDomain,
|
|
116
|
-
|
|
134
|
+
// Egress follows the workspace's analytics opt-in (#36663). The
|
|
135
|
+
// socket grant does not: Nx needs its sockets either way.
|
|
136
|
+
...(analyticsEnabled
|
|
137
|
+
? {
|
|
138
|
+
allowedDomains: withEntries(json.sandbox?.network?.allowedDomains, constants_1.analyticsDomain),
|
|
139
|
+
}
|
|
140
|
+
: {}),
|
|
141
|
+
// Covers binding as well as connecting, so a fresh daemon, a plugin
|
|
142
|
+
// worker and a forked task can each create their own socket under
|
|
143
|
+
// these roots. Deliberately scoped rather than `allowAllUnixSockets`,
|
|
144
|
+
// which grants connect access to every socket on the machine —
|
|
145
|
+
// including the Docker and SSH-agent sockets — and grants nothing
|
|
146
|
+
// extra for creating Nx's own.
|
|
147
|
+
allowUnixSockets: withEntries(json.sandbox?.network?.allowUnixSockets, ...constants_1.NX_ALLOWLIST_ROOTS),
|
|
117
148
|
},
|
|
118
149
|
},
|
|
119
150
|
}));
|
|
@@ -234,11 +265,20 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
234
265
|
(0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.nx/polygraph');
|
|
235
266
|
(0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.claude/worktrees');
|
|
236
267
|
(0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.claude/settings.local.json');
|
|
237
|
-
await (0,
|
|
268
|
+
await (0, format_changed_files_1.formatChangedFiles)(tree);
|
|
238
269
|
// we use the check variable to determine if we should actually make changes or just report what would be changed
|
|
239
270
|
return async (check = false) => {
|
|
240
271
|
const messages = [];
|
|
241
272
|
const errors = [];
|
|
273
|
+
if (addedAnalyticsDomain) {
|
|
274
|
+
messages.push({
|
|
275
|
+
title: `Allowed ${constants_1.analyticsDomain} through Claude Code's sandbox network filter`,
|
|
276
|
+
bodyLines: [
|
|
277
|
+
`Nx sends analytics there because this workspace sets "analytics": true in nx.json.`,
|
|
278
|
+
`Set it to false to opt out, then remove the domain from .claude/settings.json.`,
|
|
279
|
+
],
|
|
280
|
+
});
|
|
281
|
+
}
|
|
242
282
|
if (hasAgent('copilot')) {
|
|
243
283
|
try {
|
|
244
284
|
if ((await (0, native_1.isEditorInstalled)(0 /* SupportedEditor.VSCode */)) &&
|
|
@@ -300,6 +340,25 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
300
340
|
};
|
|
301
341
|
};
|
|
302
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* The user's existing entries in their original order, plus any of `values`
|
|
345
|
+
* they do not already have. A Set does the deduping, so re-running the
|
|
346
|
+
* generator is a no-op rather than a growing list.
|
|
347
|
+
*/
|
|
348
|
+
function withEntries(existing, ...values) {
|
|
349
|
+
return [...new Set([...(existing ?? []), ...values])];
|
|
350
|
+
}
|
|
351
|
+
function importsAgentsMd(tree, claudePath) {
|
|
352
|
+
if (!tree.exists(claudePath)) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
const nxBlock = tree.read(claudePath, 'utf-8').match(constants_1.rulesRegex)?.[0];
|
|
356
|
+
return (nxBlock
|
|
357
|
+
?.replace(constants_1.nxRulesMarkerCommentStart, '')
|
|
358
|
+
.replace(constants_1.nxRulesMarkerCommentEnd, '')
|
|
359
|
+
.replace(constants_1.nxRulesMarkerCommentDescription, '')
|
|
360
|
+
.trim() === '@AGENTS.md');
|
|
361
|
+
}
|
|
303
362
|
function writeAgentRules(tree, path, writeNxCloudRules) {
|
|
304
363
|
if (!tree.exists(path)) {
|
|
305
364
|
// File doesn't exist - create with h1 header (standalone content)
|
package/dist/src/ai/utils.d.ts
CHANGED
|
@@ -18,3 +18,16 @@ export declare function getAgentConfigurations(agentsToConsider: Agent[], worksp
|
|
|
18
18
|
disabledAgents: AgentConfiguration[];
|
|
19
19
|
}>;
|
|
20
20
|
export declare function configureAgents(agents: Agent[], workspaceRoot: string, useLatest?: boolean): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Explains a permission error thrown while writing agent configuration files.
|
|
23
|
+
*
|
|
24
|
+
* The errno alone does not identify the cause. Agent harnesses (e.g. Claude
|
|
25
|
+
* Code) deny writes to their own settings files from sandboxed shell commands,
|
|
26
|
+
* so `nx configure-ai-agents` run through an agent's bash tool fails with EPERM
|
|
27
|
+
* where the same command succeeds in a terminal — but a root-owned
|
|
28
|
+
* `.claude/settings.json` left by an earlier `sudo nx`, or a read-only
|
|
29
|
+
* checkout, produces the same errno with an unrelated remedy. The sandbox
|
|
30
|
+
* explanation is therefore only offered where a sandbox or an agent is
|
|
31
|
+
* actually detected, and the underlying message is kept either way.
|
|
32
|
+
*/
|
|
33
|
+
export declare function agentConfigWriteBlockedLines(error: unknown): string[];
|