@ohos-ports/nx 23.3.0-beta.3 → 24.0.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/dist/bin/nx.js +2 -2
- package/dist/bin/post-install.js +5 -3
- package/dist/nx-cloud-internals.d.ts +1 -0
- package/dist/nx-cloud-internals.js +7 -1
- package/dist/src/adapter/ngcli-adapter.js +2 -2
- package/dist/src/ai/clone-ai-config-repo.js +49 -12
- package/dist/src/command-line/add/add.d.ts +2 -0
- package/dist/src/command-line/add/add.js +24 -6
- package/dist/src/command-line/affected/affected.js +2 -2
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +1 -13
- package/dist/src/command-line/graph/graph.js +38 -10
- package/dist/src/command-line/init/command-object.js +0 -12
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +21 -62
- package/dist/src/command-line/init/init-v2.js +1 -3
- package/dist/src/command-line/migrate/agentic/close-agent-session.d.ts +1 -1
- package/dist/src/command-line/migrate/agentic/close-agent-session.js +4 -3
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +1 -3
- package/dist/src/command-line/migrate/agentic/definitions.js +5 -97
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +7 -45
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +9 -51
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +1 -43
- package/dist/src/command-line/migrate/agentic/handoff.js +3 -119
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/instruction-files.js +6 -27
- package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +19 -1
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +88 -49
- package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +1 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.js +86 -24
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +2 -2
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +2 -2
- package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +1 -12
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +8 -17
- 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 +12 -6
- package/dist/src/command-line/migrate/agentic/select.js +38 -8
- package/dist/src/command-line/migrate/agentic/types.d.ts +9 -68
- package/dist/src/command-line/migrate/agentic/types.js +6 -8
- package/dist/src/command-line/migrate/command-object.js +6 -10
- package/dist/src/command-line/migrate/execute-migration.d.ts +6 -6
- package/dist/src/command-line/migrate/execute-migration.js +25 -15
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +18 -1
- package/dist/src/command-line/migrate/migrate-analytics.js +38 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +29 -17
- package/dist/src/command-line/migrate/migrate-commits.js +86 -32
- package/dist/src/command-line/migrate/migrate-config.d.ts +6 -6
- package/dist/src/command-line/migrate/migrate-config.js +12 -6
- package/dist/src/command-line/migrate/migrate-output.d.ts +1 -6
- package/dist/src/command-line/migrate/migrate-output.js +1 -10
- package/dist/src/command-line/migrate/migrate.d.ts +6 -30
- package/dist/src/command-line/migrate/migrate.js +257 -255
- package/dist/src/command-line/migrate/resolve-package-version.d.ts +2 -4
- package/dist/src/command-line/migrate/resolve-package-version.js +2 -35
- package/dist/src/command-line/migrate/run/agent-output.d.ts +2 -0
- package/dist/src/command-line/migrate/run/agent-output.js +9 -0
- package/dist/src/command-line/migrate/run/broker.d.ts +14 -5
- package/dist/src/command-line/migrate/run/broker.js +69 -21
- package/dist/src/command-line/migrate/run/clean-retry.js +4 -2
- package/dist/src/command-line/migrate/run/existing-run-report.d.ts +1 -1
- package/dist/src/command-line/migrate/run/existing-run-report.js +7 -5
- package/dist/src/command-line/migrate/run/give-up.d.ts +4 -3
- package/dist/src/command-line/migrate/run/give-up.js +8 -5
- package/dist/src/command-line/migrate/run/index.d.ts +7 -5
- package/dist/src/command-line/migrate/run/index.js +16 -1
- package/dist/src/command-line/migrate/run/issues.js +7 -2
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +61 -4
- package/dist/src/command-line/migrate/run/orchestrator.js +397 -133
- package/dist/src/command-line/migrate/run/run-state.d.ts +17 -1
- package/dist/src/command-line/migrate/run/run-state.js +41 -2
- package/dist/src/command-line/migrate/run/runbook.d.ts +1 -0
- package/dist/src/command-line/migrate/run/runbook.js +115 -18
- package/dist/src/command-line/migrate/run/state-lock.d.ts +29 -4
- package/dist/src/command-line/migrate/run/state-lock.js +102 -10
- package/dist/src/command-line/migrate/run/state-machine.js +4 -1
- package/dist/src/command-line/migrate/run/util.d.ts +7 -2
- package/dist/src/command-line/migrate/run/util.js +30 -3
- package/dist/src/command-line/migrate/run/worker.d.ts +1 -1
- package/dist/src/command-line/migrate/run/worker.js +252 -250
- package/dist/src/command-line/migrate/sort-migrations.d.ts +1 -7
- package/dist/src/command-line/migrate/sort-migrations.js +1 -12
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +17 -12
- package/dist/src/command-line/release/changelog.js +9 -6
- 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/release.js +2 -2
- package/dist/src/command-line/release/utils/git.js +8 -7
- 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 +5 -0
- package/dist/src/command-line/release/utils/release-graph.js +1 -0
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +5 -6
- package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +5 -6
- package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +2 -2
- 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/version-actions.js +2 -1
- package/dist/src/command-line/release/version.js +5 -2
- package/dist/src/command-line/repair/repair.js +1 -1
- package/dist/src/command-line/report/report.js +1 -1
- package/dist/src/command-line/reset/reset.js +58 -62
- 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 +153 -5
- package/dist/src/command-line/run/run.js +2 -1
- package/dist/src/command-line/show/projects.js +5 -3
- package/dist/src/command-line/show/show-target/info.d.ts +10 -1
- 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 +1 -1
- package/dist/src/command-line/yargs-utils/shared-options.js +1 -1
- package/dist/src/config/misc-interfaces.d.ts +18 -0
- 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 +88 -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 +15 -0
- package/dist/src/daemon/client/client.js +181 -71
- package/dist/src/daemon/client/daemon-socket-messenger.d.ts +1 -1
- package/dist/src/daemon/client/daemon-socket-messenger.js +2 -2
- package/dist/src/daemon/server/client-socket-context.js +1 -1
- package/dist/src/daemon/server/handle-configure-ai-agents.js +2 -2
- package/dist/src/daemon/server/handle-process-in-background.js +21 -9
- package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +2 -1
- package/dist/src/daemon/server/handle-select-affected-tasks.js +21 -13
- 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/nx-console-operations.js +2 -2
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +4 -8
- package/dist/src/daemon/server/server.d.ts +2 -1
- package/dist/src/daemon/server/server.js +17 -4
- package/dist/src/daemon/server/shutdown-utils.js +1 -4
- package/dist/src/daemon/server/start.d.ts +1 -0
- package/dist/src/daemon/server/start.js +2 -0
- package/dist/src/daemon/socket-utils.d.ts +11 -9
- package/dist/src/daemon/socket-utils.js +31 -61
- package/dist/src/daemon/tmp-dir.d.ts +19 -14
- package/dist/src/daemon/tmp-dir.js +142 -354
- package/dist/src/devkit-exports.d.ts +9 -1
- package/dist/src/devkit-exports.js +12 -1
- package/dist/src/devkit-internals.d.ts +6 -5
- package/dist/src/devkit-internals.js +13 -4
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +4 -2
- package/dist/src/executors/run-commands/run-commands.impl.js +53 -27
- package/dist/src/executors/run-commands/running-tasks.d.ts +13 -4
- package/dist/src/executors/run-commands/running-tasks.js +148 -95
- package/dist/src/executors/run-commands/schema.json +1 -1
- package/dist/src/hasher/check-task-files.js +5 -8
- package/dist/src/hasher/file-hasher.js +9 -7
- package/dist/src/hasher/hash-task.js +4 -0
- package/dist/src/hasher/native-task-hasher-impl.js +3 -1
- package/dist/src/hasher/task-hasher.d.ts +2 -0
- package/dist/src/hasher/task-hasher.js +4 -1
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +1 -2
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +6 -11
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +2 -2
- 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/assert-supported-platform.js +1 -1
- package/dist/src/native/index.d.ts +238 -18
- package/dist/src/native/index.js +6 -1
- package/dist/src/native/native-bindings.js +15 -6
- 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/nx-cloud/update-manager.d.ts +14 -0
- package/dist/src/nx-cloud/update-manager.js +237 -50
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +3 -4
- package/dist/src/plugins/js/lock-file/pruned-output.d.ts +2 -2
- package/dist/src/plugins/js/lock-file/pruned-output.js +4 -4
- package/dist/src/plugins/js/utils/register.js +9 -4
- package/dist/src/project-graph/affected/affected-tasks.d.ts +9 -6
- package/dist/src/project-graph/affected/affected-tasks.js +31 -7
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +7 -0
- package/dist/src/project-graph/plugins/loaded-nx-plugin.js +49 -6
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +1 -1
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +12 -133
- package/dist/src/project-graph/utils/project-configuration-utils.js +2 -2
- package/dist/src/project-graph/utils/retrieve-workspace-files.js +27 -6
- package/dist/src/tasks-runner/create-task-graph.d.ts +8 -7
- package/dist/src/tasks-runner/create-task-graph.js +50 -27
- package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
- package/dist/src/tasks-runner/init-tasks-runner.js +116 -59
- package/dist/src/tasks-runner/life-cycle.d.ts +4 -1
- package/dist/src/tasks-runner/life-cycle.js +7 -0
- 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/static-run-many-terminal-output-life-cycle.js +5 -2
- package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +4 -1
- package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +5 -1
- package/dist/src/tasks-runner/pseudo-ipc.d.ts +1 -0
- package/dist/src/tasks-runner/pseudo-ipc.js +4 -0
- package/dist/src/tasks-runner/pseudo-terminal.d.ts +1 -1
- package/dist/src/tasks-runner/pseudo-terminal.js +2 -2
- 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 +6 -2
- package/dist/src/tasks-runner/run-command.js +21 -31
- 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.js +6 -0
- 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/task-env.d.ts +10 -0
- package/dist/src/tasks-runner/task-env.js +37 -5
- 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-orchestrator.d.ts +62 -18
- package/dist/src/tasks-runner/task-orchestrator.js +750 -150
- package/dist/src/tasks-runner/tasks-runner.d.ts +1 -1
- 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/tokens.d.ts +54 -0
- package/dist/src/tasks-runner/tokens.js +161 -0
- package/dist/src/tasks-runner/utils.d.ts +35 -6
- package/dist/src/tasks-runner/utils.js +149 -68
- 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 +3 -3
- package/dist/src/ultracache/config.js +4 -4
- package/dist/src/ultracache/fetch.d.ts +2 -0
- package/dist/src/ultracache/fetch.js +1 -0
- package/dist/src/ultracache/overrides.js +4 -0
- 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/child-process.js +2 -1
- package/dist/src/utils/find-matching-projects.js +9 -6
- package/dist/src/utils/git-utils.d.ts +12 -5
- package/dist/src/utils/git-utils.js +69 -11
- package/dist/src/utils/long-running-target.d.ts +1 -3
- package/dist/src/utils/long-running-target.js +1 -3
- package/dist/src/utils/nx-package-group.js +1 -1
- package/dist/src/utils/output.d.ts +4 -3
- package/dist/src/utils/output.js +4 -3
- package/dist/src/utils/owned-private-dir.d.ts +1 -17
- package/dist/src/utils/owned-private-dir.js +10 -62
- package/dist/src/utils/package-json.js +1 -1
- package/dist/src/utils/package-manager.d.ts +8 -0
- package/dist/src/utils/package-manager.js +65 -8
- package/dist/src/utils/perf-hooks.d.ts +1 -0
- package/dist/src/utils/plugins/core-plugins.js +5 -1
- package/dist/src/utils/progress-topics.d.ts +1 -0
- package/dist/src/utils/progress-topics.js +1 -0
- package/dist/src/utils/safe-spawn.js +1 -5
- package/dist/src/utils/shell-quoting.d.ts +8 -1
- package/dist/src/utils/shell-quoting.js +12 -1
- 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/versions.js +1 -1
- package/migrations.json +20 -6
- package/package.json +15 -24
- package/schemas/migrations-schema.json +11 -0
- package/schemas/nx-schema.json +133 -11
- package/schemas/project-schema.json +114 -4
- 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 -67
- 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 -70
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -113
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -68
- package/dist/src/command-line/migrate/agentic/run-step.js +0 -148
- package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/runner.js +0 -262
- 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/tasks-runner/legacy-depends-on-warning.d.ts +0 -18
- package/dist/src/tasks-runner/legacy-depends-on-warning.js +0 -109
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
|
@@ -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/nx.js
CHANGED
|
@@ -198,13 +198,13 @@ function resolveNx(workspace) {
|
|
|
198
198
|
const installPath = (0, installation_directory_1.getNxInstallationPath)(root);
|
|
199
199
|
if ((0, fs_1.existsSync)(installPath)) {
|
|
200
200
|
const installRequire = (0, module_1.createRequire)((0, path_1.join)(installPath, 'package.json'));
|
|
201
|
-
return installRequire.resolve('
|
|
201
|
+
return installRequire.resolve('nx/bin/nx.js');
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
catch { }
|
|
205
205
|
// check for root install
|
|
206
206
|
const rootRequire = (0, module_1.createRequire)((0, path_1.join)(root, 'package.json'));
|
|
207
|
-
return rootRequire.resolve('
|
|
207
|
+
return rootRequire.resolve('nx/bin/nx.js');
|
|
208
208
|
}
|
|
209
209
|
function isNxCloudCommand(command) {
|
|
210
210
|
const nxCloudCommands = [
|
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
|
}
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
// a public API. The client probes these exports to tell what this nx supports,
|
|
4
4
|
// so keep them stable.
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.openUltracacheConfigurations = exports.importUltracacheConfigurations = void 0;
|
|
6
|
+
exports.TASK_GRAPH_FORMAT = exports.openUltracacheConfigurations = exports.importUltracacheConfigurations = void 0;
|
|
7
7
|
var store_1 = require("./src/ultracache/store");
|
|
8
8
|
Object.defineProperty(exports, "importUltracacheConfigurations", { enumerable: true, get: function () { return store_1.importUltracacheConfigurations; } });
|
|
9
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;
|
|
@@ -253,8 +253,7 @@ async function createRecorder(host, record, logger) {
|
|
|
253
253
|
else if (event.kind === 'rename') {
|
|
254
254
|
record.loggingQueue.push(`${pc.blue('RENAME')} ${eventPath} => ${event.to}`);
|
|
255
255
|
// Surface as DELETE source + CREATE destination so downstream consumers
|
|
256
|
-
//
|
|
257
|
-
// both endpoints.
|
|
256
|
+
// see both endpoints.
|
|
258
257
|
const toPath = event.to.startsWith('/') ? event.to.slice(1) : event.to;
|
|
259
258
|
record.changes?.push({ type: 'DELETE', path: eventPath, content: null });
|
|
260
259
|
record.changes?.push(emptyFileChange('CREATE', toPath));
|
|
@@ -991,6 +990,7 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
|
|
|
991
990
|
const batchImplementationFactory = executorConfig.batchImplementation
|
|
992
991
|
? this.getImplementationFactory(executorConfig.batchImplementation, executorsDir, nodeModule)
|
|
993
992
|
: null;
|
|
993
|
+
// TODO(v25): remove custom hasher support.
|
|
994
994
|
const hasherFactory = executorConfig.hasher
|
|
995
995
|
? this.getImplementationFactory(executorConfig.hasher, executorsDir, nodeModule)
|
|
996
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)) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type NxJsonConfiguration } from '../../config/nx-json';
|
|
1
2
|
import type { AddOptions } from './command-object';
|
|
2
3
|
export declare function addHandler(options: AddOptions): Promise<number>;
|
|
4
|
+
export declare function installPackage(pkgName: string, version: string, nxJson: NxJsonConfiguration): Promise<void>;
|
|
3
5
|
export declare const coreNxPluginVersions: Map<string, string>;
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.coreNxPluginVersions = void 0;
|
|
4
4
|
exports.addHandler = addHandler;
|
|
5
|
+
exports.installPackage = installPackage;
|
|
5
6
|
const child_process_1 = require("child_process");
|
|
6
7
|
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = require("path");
|
|
7
9
|
const nx_json_1 = require("../../config/nx-json");
|
|
8
10
|
const child_process_2 = require("../../utils/child-process");
|
|
9
11
|
const fileutils_1 = require("../../utils/fileutils");
|
|
10
12
|
const logger_1 = require("../../utils/logger");
|
|
11
13
|
const output_1 = require("../../utils/output");
|
|
12
14
|
const package_manager_1 = require("../../utils/package-manager");
|
|
15
|
+
const acknowledge_build_scripts_1 = require("../../utils/acknowledge-build-scripts");
|
|
13
16
|
const handle_errors_1 = require("../../utils/handle-errors");
|
|
14
17
|
const versions_1 = require("../../utils/versions");
|
|
15
18
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
@@ -48,13 +51,19 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
48
51
|
: `${pmc.addDev} ${pkgName}@${version}`;
|
|
49
52
|
// pnpm 11+ fails the install when the plugin's own dependency tree
|
|
50
53
|
// carries unacknowledged build scripts, and the plugin's generators can
|
|
51
|
-
// only record allowBuilds decisions after this install.
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
+
// only record allowBuilds decisions after this install. A plugin that
|
|
55
|
+
// declares them in its package.json keeps the install strict; otherwise
|
|
56
|
+
// warn and skip for this one install, like pnpm 10 did. pnpm 12 gave
|
|
57
|
+
// `--config` a meaning of its own and takes the setting from the
|
|
58
|
+
// environment instead.
|
|
54
59
|
const env = { ...process.env };
|
|
60
|
+
let restorePnpmWorkspace;
|
|
55
61
|
if (pm === 'pnpm' && (0, semver_1.gte)(pmv, '11.0.0')) {
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
restorePnpmWorkspace = snapshotFile((0, path_1.join)(workspace_root_1.workspaceRoot, 'pnpm-workspace.yaml'));
|
|
63
|
+
if (!(await (0, acknowledge_build_scripts_1.acknowledgeDeclaredBuildScripts)(workspace_root_1.workspaceRoot, pm, pkgName, version))) {
|
|
64
|
+
command += ' --config.strictDepBuilds=false';
|
|
65
|
+
env.PNPM_CONFIG_STRICT_DEP_BUILDS = 'false';
|
|
66
|
+
}
|
|
58
67
|
}
|
|
59
68
|
await new Promise((resolve) => (0, child_process_1.exec)(command, {
|
|
60
69
|
windowsHide: true,
|
|
@@ -70,6 +79,9 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
70
79
|
output_1.output.error({
|
|
71
80
|
title: `Failed to install ${pkgName}. Please check the error above for more details.`,
|
|
72
81
|
});
|
|
82
|
+
// The decisions the plugin declared were recorded for a plugin
|
|
83
|
+
// that never installed; put the file back.
|
|
84
|
+
restorePnpmWorkspace?.();
|
|
73
85
|
process.exit(1);
|
|
74
86
|
}
|
|
75
87
|
return resolve();
|
|
@@ -97,6 +109,12 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
97
109
|
}
|
|
98
110
|
spinner.succeed();
|
|
99
111
|
}
|
|
112
|
+
function snapshotFile(path) {
|
|
113
|
+
const before = (0, fs_1.existsSync)(path) ? (0, fs_1.readFileSync)(path, 'utf-8') : null;
|
|
114
|
+
return () => before === null
|
|
115
|
+
? (0, fs_1.rmSync)(path, { force: true })
|
|
116
|
+
: (0, fs_1.writeFileSync)(path, before);
|
|
117
|
+
}
|
|
100
118
|
async function initializePlugin(pkgName, options, nxJson) {
|
|
101
119
|
let updatePackageScripts = false;
|
|
102
120
|
if (exports.coreNxPluginVersions.has(pkgName) &&
|
|
@@ -133,7 +151,7 @@ function parsePackageSpecifier(packageSpecifier) {
|
|
|
133
151
|
const version = packageSpecifier.substring(i + 1);
|
|
134
152
|
return [pkgName, version];
|
|
135
153
|
}
|
|
136
|
-
exports.coreNxPluginVersions = require(require.resolve('
|
|
154
|
+
exports.coreNxPluginVersions = require(require.resolve('nx/package.json'))['nx-migrations'].packageGroup.reduce((map, entry) => {
|
|
137
155
|
const packageName = typeof entry === 'string' ? entry : entry.package;
|
|
138
156
|
const version = typeof entry === 'string' ? versions_1.nxVersion : entry.version;
|
|
139
157
|
return map.set(packageName, version);
|
|
@@ -30,12 +30,12 @@ async function affected(command, args, extraTargetDependencies = {}, extraOption
|
|
|
30
30
|
await (0, connect_to_nx_cloud_1.connectToNxCloudIfExplicitlyAsked)(nxArgs);
|
|
31
31
|
// Task selection needs a target to select against, so `nx graph --affected`
|
|
32
32
|
// and the deprecated print-affected stay project-grained.
|
|
33
|
-
const useTasks = (0, affected_tasks_1.selectsAffectedTasks)() &&
|
|
33
|
+
const useTasks = (0, affected_tasks_1.selectsAffectedTasks)(nxJson) &&
|
|
34
34
|
command === 'affected' &&
|
|
35
35
|
!!nxArgs.targets?.length;
|
|
36
36
|
if ((0, affected_reasons_1.isExplaining)(nxArgs.explain) && !useTasks) {
|
|
37
37
|
throw new Error((0, affected_reasons_1.explainUnavailable)([
|
|
38
|
-
!(0, affected_tasks_1.selectsAffectedTasks)() &&
|
|
38
|
+
!(0, affected_tasks_1.selectsAffectedTasks)(nxJson) && (0, affected_tasks_1.taskGranularityRequirement)(),
|
|
39
39
|
!nxArgs.targets?.length && 'targets passed with --targets (-t)',
|
|
40
40
|
].filter(Boolean)));
|
|
41
41
|
}
|
|
@@ -47,7 +47,7 @@ async function configureAiAgentsHandler(args, inner = false) {
|
|
|
47
47
|
await (0, provenance_1.ensurePackageHasProvenance)('nx', 'latest');
|
|
48
48
|
const packageInstallResults = (0, package_json_1.installPackageToTmp)('nx', 'latest', (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot));
|
|
49
49
|
cleanup = packageInstallResults.cleanup;
|
|
50
|
-
let modulePath = require.resolve('
|
|
50
|
+
let modulePath = require.resolve('nx/src/command-line/configure-ai-agents/configure-ai-agents.js', { paths: [packageInstallResults.tempDir] });
|
|
51
51
|
const module = await (0, handle_import_1.handleImport)(modulePath);
|
|
52
52
|
await module.configureAiAgentsHandler(args, true);
|
|
53
53
|
cleanup();
|
|
@@ -64,18 +64,6 @@ async function configureAiAgentsHandler(args, inner = false) {
|
|
|
64
64
|
await resetDaemonAgentStatus();
|
|
65
65
|
}
|
|
66
66
|
async function configureAiAgentsHandlerImpl(options) {
|
|
67
|
-
// Node 24's stricter readline throws ERR_USE_AFTER_CLOSE when a prompt
|
|
68
|
-
// library operates on a closed interface. Added for enquirer, which nx no
|
|
69
|
-
// longer uses; verify against Node 24 before removing.
|
|
70
|
-
// TODO(v24): drop if @clack/prompts proves not to need it.
|
|
71
|
-
process.on('uncaughtException', (error) => {
|
|
72
|
-
if (error &&
|
|
73
|
-
typeof error === 'object' &&
|
|
74
|
-
'code' in error &&
|
|
75
|
-
error['code'] === 'ERR_USE_AFTER_CLOSE')
|
|
76
|
-
return;
|
|
77
|
-
throw error;
|
|
78
|
-
});
|
|
79
67
|
const normalizedOptions = normalizeOptions(options);
|
|
80
68
|
const { nonConfiguredAgents, partiallyConfiguredAgents, fullyConfiguredAgents, disabledAgents, } = await (0, utils_1.getAgentConfigurations)(normalizedOptions.agents, workspace_root_1.workspaceRoot);
|
|
81
69
|
if (disabledAgents.length > 0) {
|
|
@@ -39,6 +39,8 @@ const create_task_hasher_1 = require("../../hasher/create-task-hasher");
|
|
|
39
39
|
const task_env_1 = require("../../tasks-runner/task-env");
|
|
40
40
|
const error_types_1 = require("../../project-graph/error-types");
|
|
41
41
|
const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
|
|
42
|
+
const ci_status_1 = require("../../ultracache/ci-status");
|
|
43
|
+
const utils_2 = require("../show/show-target/utils");
|
|
42
44
|
const split_target_1 = require("../../utils/split-target");
|
|
43
45
|
// maps file extention to MIME types
|
|
44
46
|
const mimeType = {
|
|
@@ -372,11 +374,9 @@ async function generateGraph(args, affectedProjects) {
|
|
|
372
374
|
title: `Project graph started at ${url.toString()}`,
|
|
373
375
|
});
|
|
374
376
|
if (args.open) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
// Ignore errors when opening browser (e.g. no browser available)
|
|
379
|
-
});
|
|
377
|
+
// Best-effort: openUrl never throws, returning false if no opener could be
|
|
378
|
+
// spawned. The URL is printed above, so a failure is silent.
|
|
379
|
+
(0, native_1.openUrl)(url.toString());
|
|
380
380
|
}
|
|
381
381
|
return new Promise((res) => {
|
|
382
382
|
app.once('close', res);
|
|
@@ -614,7 +614,7 @@ function createProjectGraphListener() {
|
|
|
614
614
|
fileName: e.file ?? e.cause?.errors?.[0]?.location?.file,
|
|
615
615
|
}));
|
|
616
616
|
}
|
|
617
|
-
const { projectGraphClientResponse, sourceMapResponse } = transformProjectGraphToClientResponse(projectGraph, sourceMaps, errors, currentProjectGraphClientResponse.affected, isFilteredGraph ? currentProjectGraphClientResponse.focus : null, isFilteredGraph ? currentProjectGraphClientResponse.exclude : []);
|
|
617
|
+
const { projectGraphClientResponse, sourceMapResponse } = transformProjectGraphToClientResponse(projectGraph, sourceMaps, errors, currentProjectGraphClientResponse.affected, isFilteredGraph ? currentProjectGraphClientResponse.focus : null, isFilteredGraph ? currentProjectGraphClientResponse.exclude : [], await (0, ci_status_1.isUltracacheOnInCI)((0, configuration_1.readNxJson)()));
|
|
618
618
|
if (projectGraphClientResponse.hash !==
|
|
619
619
|
currentProjectGraphClientResponse.hash &&
|
|
620
620
|
sourceMapResponse) {
|
|
@@ -643,14 +643,41 @@ function createProjectGraphListener() {
|
|
|
643
643
|
}
|
|
644
644
|
}, 500));
|
|
645
645
|
}
|
|
646
|
-
|
|
646
|
+
/** The graph's nodes, with `ultracacheInCI` set to each target's Ultracache mode in CI. */
|
|
647
|
+
function markTargetsHashedFromUltracacheInCI(graph) {
|
|
648
|
+
return Object.values(graph.nodes).map((node) => {
|
|
649
|
+
const targets = Object.entries(node.data.targets ?? {});
|
|
650
|
+
const modes = new Map(targets.flatMap(([name, target]) => {
|
|
651
|
+
const mode = (0, ci_status_1.ultracacheModeInCI)(target, (0, utils_2.hasCustomHasher)(node.name, name, graph));
|
|
652
|
+
return mode ? [[name, mode]] : [];
|
|
653
|
+
}));
|
|
654
|
+
if (!modes.size) {
|
|
655
|
+
return node;
|
|
656
|
+
}
|
|
657
|
+
return {
|
|
658
|
+
...node,
|
|
659
|
+
data: {
|
|
660
|
+
...node.data,
|
|
661
|
+
targets: Object.fromEntries(targets.map(([name, target]) => [
|
|
662
|
+
name,
|
|
663
|
+
modes.has(name)
|
|
664
|
+
? { ...target, ultracacheInCI: modes.get(name) }
|
|
665
|
+
: target,
|
|
666
|
+
])),
|
|
667
|
+
},
|
|
668
|
+
};
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
function transformProjectGraphToClientResponse(projectGraph, sourceMaps, errors, affected = [], focus = null, exclude = [], ultracacheOnInCI = false) {
|
|
647
672
|
node_perf_hooks_1.performance.mark('project graph transform:start');
|
|
648
673
|
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
|
649
674
|
// Apply focus and exclude filters
|
|
650
675
|
graph = filterGraph(graph, focus, exclude);
|
|
651
676
|
const fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap || {};
|
|
652
677
|
const layout = (0, configuration_1.workspaceLayout)();
|
|
653
|
-
const projects =
|
|
678
|
+
const projects = ultracacheOnInCI
|
|
679
|
+
? markTargetsHashedFromUltracacheInCI(graph)
|
|
680
|
+
: Object.values(graph.nodes);
|
|
654
681
|
const dependencies = graph.dependencies;
|
|
655
682
|
const nxJson = (0, configuration_1.readNxJson)();
|
|
656
683
|
const connectedToCloud = (0, nx_cloud_utils_1.isNxCloudUsed)(nxJson);
|
|
@@ -713,7 +740,7 @@ async function createProjectGraphAndSourceMapClientResponse(affected = [], focus
|
|
|
713
740
|
}
|
|
714
741
|
node_perf_hooks_1.performance.mark('project graph watch calculation:end');
|
|
715
742
|
node_perf_hooks_1.performance.mark('project graph response generation:start');
|
|
716
|
-
let { projectGraphClientResponse, sourceMapResponse } = transformProjectGraphToClientResponse(projectGraph, sourceMaps, errors, affected, focus, exclude);
|
|
743
|
+
let { projectGraphClientResponse, sourceMapResponse } = transformProjectGraphToClientResponse(projectGraph, sourceMaps, errors, affected, focus, exclude, await (0, ci_status_1.isUltracacheOnInCI)((0, configuration_1.readNxJson)()));
|
|
717
744
|
node_perf_hooks_1.performance.mark('project graph response generation:end');
|
|
718
745
|
node_perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
|
|
719
746
|
node_perf_hooks_1.performance.measure('project graph response generation', 'project graph response generation:start', 'project graph response generation:end');
|
|
@@ -969,7 +996,8 @@ function expandInputs(inputs, project, allWorkspaceFiles, depGraphClientResponse
|
|
|
969
996
|
}
|
|
970
997
|
});
|
|
971
998
|
const workspaceRootsExpanded = getExpandedWorkspaceRoots(workspaceRootInputs, allWorkspaceFiles);
|
|
972
|
-
const
|
|
999
|
+
const projectRoots = depGraphClientResponse.projects.map((p) => p.data.root);
|
|
1000
|
+
const filesExpanded = filesInputs.flatMap((globs) => (0, native_1.expandFilesInput)(workspace_root_1.workspaceRoot, globs, projectRoots));
|
|
973
1001
|
const otherInputsExpanded = otherInputs.map((input) => {
|
|
974
1002
|
if (input === 'TsConfig') {
|
|
975
1003
|
return (0, node_path_1.relative)(workspace_root_1.workspaceRoot, (0, typescript_1.getRootTsConfigPath)());
|
|
@@ -17,18 +17,6 @@ exports.yargsInitCommand = {
|
|
|
17
17
|
return withInitOptions(yargs);
|
|
18
18
|
},
|
|
19
19
|
handler: async (args) => {
|
|
20
|
-
// Node 24's stricter readline throws ERR_USE_AFTER_CLOSE when a prompt
|
|
21
|
-
// library operates on a closed interface. Added for enquirer, which nx no
|
|
22
|
-
// longer uses; verify against Node 24 before removing.
|
|
23
|
-
// TODO(v24): drop if @clack/prompts proves not to need it.
|
|
24
|
-
process.on('uncaughtException', (error) => {
|
|
25
|
-
if (error &&
|
|
26
|
-
typeof error === 'object' &&
|
|
27
|
-
'code' in error &&
|
|
28
|
-
error['code'] === 'ERR_USE_AFTER_CLOSE')
|
|
29
|
-
return;
|
|
30
|
-
throw error;
|
|
31
|
-
});
|
|
32
20
|
const useV2 = await isInitV2();
|
|
33
21
|
if (useV2) {
|
|
34
22
|
await require('./init-v2').initHandler(args);
|
|
@@ -120,61 +120,28 @@ function createProjectJson(repoRoot, packageJson, nestCLIOptions) {
|
|
|
120
120
|
buildTarget: `${packageName}:build`,
|
|
121
121
|
},
|
|
122
122
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
extractLicenses: true,
|
|
138
|
-
inspect: false,
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
json.targets['serve'] = {
|
|
143
|
-
...json.targets['serve'],
|
|
144
|
-
configurations: {
|
|
145
|
-
production: {
|
|
146
|
-
buildTarget: `${packageName}:build:production`,
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
json.targets['build'] = {
|
|
153
|
-
executor: '@nx/js:tsc',
|
|
154
|
-
outputs: ['{options.outputPath}'],
|
|
155
|
-
options: {
|
|
156
|
-
outputPath: `dist/${packageName}`,
|
|
157
|
-
main: (0, path_1.join)(nestCLIOptions.sourceRoot, nestCLIOptions.entryFile),
|
|
158
|
-
tsConfig: 'tsconfig.build.json',
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
json.targets['serve'] = {
|
|
162
|
-
...json.targets['serve'],
|
|
163
|
-
configurations: {
|
|
164
|
-
debug: {
|
|
165
|
-
inspect: 'inspect',
|
|
166
|
-
},
|
|
123
|
+
json.targets['build'] = {
|
|
124
|
+
executor: '@nx/js:tsc',
|
|
125
|
+
outputs: ['{options.outputPath}'],
|
|
126
|
+
options: {
|
|
127
|
+
outputPath: `dist/${packageName}`,
|
|
128
|
+
main: (0, path_1.join)(nestCLIOptions.sourceRoot, nestCLIOptions.entryFile),
|
|
129
|
+
tsConfig: 'tsconfig.build.json',
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
json.targets['serve'] = {
|
|
133
|
+
...json.targets['serve'],
|
|
134
|
+
configurations: {
|
|
135
|
+
debug: {
|
|
136
|
+
inspect: 'inspect',
|
|
167
137
|
},
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
// if we're using nrwl/js, then we add nrwl/js analyzeSourceFiles to nx.json
|
|
141
|
+
addNrwlJsPluginsConfig(repoRoot);
|
|
172
142
|
// lint
|
|
173
143
|
json.targets['lint'] = {
|
|
174
|
-
|
|
175
|
-
options: {
|
|
176
|
-
lintFilePatterns: ['./src', './test'],
|
|
177
|
-
},
|
|
144
|
+
command: 'eslint ./src ./test',
|
|
178
145
|
};
|
|
179
146
|
// test and e2e
|
|
180
147
|
addJestTargets(repoRoot, packageName, json, packageJson);
|
|
@@ -236,19 +203,11 @@ function addJestTargets(repoRoot, packageName, projectJson, packageJson) {
|
|
|
236
203
|
(0, node_fs_1.writeFileSync)(e2eTestConfigPath, `export default ${JSON.stringify(e2eTestOptions, null, 2)}`, 'utf8');
|
|
237
204
|
(0, format_1.recordInitWrite)(e2eTestConfigPath);
|
|
238
205
|
projectJson.targets['test'] = {
|
|
239
|
-
|
|
206
|
+
command: `jest --config ${unitTestConfigPath} --passWithNoTests`,
|
|
240
207
|
outputs: [`{workspaceRoot}/coverage/${packageName}`],
|
|
241
|
-
options: {
|
|
242
|
-
passWithNoTests: true,
|
|
243
|
-
jestConfig: unitTestConfigPath,
|
|
244
|
-
},
|
|
245
208
|
};
|
|
246
209
|
projectJson.targets['e2e'] = {
|
|
247
|
-
|
|
248
|
-
options: {
|
|
249
|
-
passWithNoTests: true,
|
|
250
|
-
jestConfig: e2eTestConfigPath,
|
|
251
|
-
},
|
|
210
|
+
command: `jest --config ${e2eTestConfigPath} --passWithNoTests`,
|
|
252
211
|
};
|
|
253
212
|
// remove jest options from package.json
|
|
254
213
|
delete packageJson['jest'];
|
|
@@ -48,7 +48,7 @@ async function initHandler(options, inner = false) {
|
|
|
48
48
|
await (0, provenance_1.ensurePackageHasProvenance)('nx', 'latest');
|
|
49
49
|
const packageInstallResults = (0, package_json_1.installPackageToTmp)('nx', 'latest', (0, package_manager_1.detectPackageManager)(process.cwd()));
|
|
50
50
|
cleanup = packageInstallResults.cleanup;
|
|
51
|
-
let modulePath = require.resolve('
|
|
51
|
+
let modulePath = require.resolve('nx/src/command-line/init/init-v2.js', {
|
|
52
52
|
paths: [packageInstallResults.tempDir],
|
|
53
53
|
});
|
|
54
54
|
const module = await (0, handle_import_1.handleImport)(modulePath);
|
|
@@ -442,7 +442,6 @@ function getPluginReason(plugin) {
|
|
|
442
442
|
'@nx/next': 'next.js detected in dependencies',
|
|
443
443
|
'@nx/nuxt': 'nuxt detected in dependencies',
|
|
444
444
|
'@nx/react-native': 'react-native detected in dependencies',
|
|
445
|
-
'@nx/remix': '@remix-run/dev detected in dependencies',
|
|
446
445
|
'@nx/rsbuild': '@rsbuild/core detected in dependencies',
|
|
447
446
|
'@nx/react': '@react-router/dev detected in dependencies',
|
|
448
447
|
'@nx/gradle': 'gradlew detected in workspace',
|
|
@@ -493,7 +492,6 @@ const npmPackageToPluginMap = {
|
|
|
493
492
|
next: '@nx/next',
|
|
494
493
|
nuxt: '@nx/nuxt',
|
|
495
494
|
'react-native': '@nx/react-native',
|
|
496
|
-
'@remix-run/dev': '@nx/remix',
|
|
497
495
|
'@rsbuild/core': '@nx/rsbuild',
|
|
498
496
|
'@react-router/dev': '@nx/react',
|
|
499
497
|
};
|
|
@@ -18,4 +18,4 @@ export declare function waitForExit(child: ChildProcess): Promise<ExitInfo>;
|
|
|
18
18
|
* orphan the agent. `taskkill` failures are swallowed.
|
|
19
19
|
*/
|
|
20
20
|
export declare function closeAgentSession(child: ChildProcess, exitPromise: Promise<ExitInfo>, gracefulExitMs: number, forceKillWaitMs: number): Promise<void>;
|
|
21
|
-
export declare function raceWithTimeout(promise: Promise<unknown>, timeoutMs: number): Promise<
|
|
21
|
+
export declare function raceWithTimeout(promise: Promise<unknown>, timeoutMs: number): Promise<boolean>;
|
|
@@ -109,13 +109,14 @@ async function forceKillWindowsTree(child, exitPromise, forceKillWaitMs) {
|
|
|
109
109
|
}
|
|
110
110
|
await raceWithTimeout(exitPromise, forceKillWaitMs);
|
|
111
111
|
}
|
|
112
|
+
// True when `promise` resolves before the timeout.
|
|
112
113
|
async function raceWithTimeout(promise, timeoutMs) {
|
|
113
114
|
let timer;
|
|
114
115
|
try {
|
|
115
|
-
await Promise.race([
|
|
116
|
-
promise,
|
|
116
|
+
return await Promise.race([
|
|
117
|
+
promise.then(() => true),
|
|
117
118
|
new Promise((resolve) => {
|
|
118
|
-
timer = setTimeout(resolve, timeoutMs);
|
|
119
|
+
timer = setTimeout(() => resolve(false), timeoutMs);
|
|
119
120
|
}),
|
|
120
121
|
]);
|
|
121
122
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentDefinition
|
|
1
|
+
import { AgentDefinition } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Pre-authorizes the handoff write. Claude Code's default permission mode
|
|
4
4
|
* asks before a file write it has no allow rule for, so without this every
|
|
@@ -24,7 +24,5 @@ export declare const claudeCodeDefinition: AgentDefinition;
|
|
|
24
24
|
* back before it reaches the command line.
|
|
25
25
|
*/
|
|
26
26
|
export declare function encodeTomlString(value: string): string;
|
|
27
|
-
export declare const codexDefinition: AgentDefinition;
|
|
28
27
|
export declare const opencodeDefinition: AgentDefinition;
|
|
29
28
|
export declare const AGENT_DEFINITIONS: readonly AgentDefinition[];
|
|
30
|
-
export declare function getAgentDefinition(id: AgentId): AgentDefinition | undefined;
|