@depup/nx 23.1.0-depup.3 → 23.1.1-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +14 -12
  2. package/changes.json +24 -16
  3. package/dist/bin/nx.js +2 -1
  4. package/dist/src/ai/configure-ai-agents-disclaimer.d.ts +5 -0
  5. package/dist/src/ai/configure-ai-agents-disclaimer.js +31 -0
  6. package/dist/src/analytics/analytics.d.ts +6 -0
  7. package/dist/src/analytics/analytics.js +16 -8
  8. package/dist/src/analytics/index.d.ts +1 -1
  9. package/dist/src/analytics/index.js +2 -1
  10. package/dist/src/command-line/add/add.js +8 -1
  11. package/dist/src/command-line/graph/graph.d.ts +1 -0
  12. package/dist/src/command-line/graph/graph.js +15 -6
  13. package/dist/src/command-line/import/import.js +1 -1
  14. package/dist/src/command-line/init/ai-agent-prompts.d.ts +1 -1
  15. package/dist/src/command-line/init/ai-agent-prompts.js +7 -6
  16. package/dist/src/command-line/init/command-object.js +10 -2
  17. package/dist/src/command-line/init/configure-plugins.js +3 -2
  18. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +4 -2
  19. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +4 -3
  20. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +4 -3
  21. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +4 -3
  22. package/dist/src/command-line/init/implementation/angular/index.js +4 -2
  23. package/dist/src/command-line/init/implementation/angular/integrated-workspace.js +2 -5
  24. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +3 -0
  25. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +4 -1
  26. package/dist/src/command-line/init/implementation/utils.d.ts +3 -3
  27. package/dist/src/command-line/init/implementation/utils.js +22 -3
  28. package/dist/src/command-line/migrate/execute-migration.d.ts +72 -0
  29. package/dist/src/command-line/migrate/execute-migration.js +389 -0
  30. package/dist/src/command-line/migrate/migrate-ui-api.js +17 -12
  31. package/dist/src/command-line/migrate/migrate.d.ts +1 -45
  32. package/dist/src/command-line/migrate/migrate.js +33 -376
  33. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +1 -1
  34. package/dist/src/command-line/nx-cloud/connect/view-logs.js +2 -0
  35. package/dist/src/command-line/release/utils/git.js +6 -2
  36. package/dist/src/command-line/release/utils/release-graph.d.ts +2 -2
  37. package/dist/src/command-line/release/utils/remote-release-clients/github.js +1 -1
  38. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +1 -1
  39. package/dist/src/command-line/release/utils/shared.d.ts +2 -2
  40. package/dist/src/command-line/show/show-target/info.js +11 -2
  41. package/dist/src/command-line/show/show-target/inputs.js +50 -153
  42. package/dist/src/command-line/show/show-target/outputs.js +48 -173
  43. package/dist/src/command-line/show/show-target/utils.d.ts +28 -0
  44. package/dist/src/command-line/show/show-target/utils.js +83 -3
  45. package/dist/src/command-line/yargs-utils/shared-options.d.ts +1 -1
  46. package/dist/src/commands-runner/create-command-graph.js +5 -0
  47. package/dist/src/config/nx-json.d.ts +5 -3
  48. package/dist/src/core/graph/main.js +1 -1
  49. package/dist/src/daemon/client/client.d.ts +0 -2
  50. package/dist/src/daemon/client/client.js +17 -19
  51. package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +1 -1
  52. package/dist/src/daemon/server/server.js +7 -4
  53. package/dist/src/devkit-internals.d.ts +3 -0
  54. package/dist/src/devkit-internals.js +10 -1
  55. package/dist/src/generators/utils/nx-json.js +13 -3
  56. package/dist/src/hasher/check-task-files.d.ts +86 -0
  57. package/dist/src/hasher/check-task-files.js +378 -0
  58. package/dist/src/native/index.d.ts +21 -2
  59. package/dist/src/native/native-bindings.js +2 -0
  60. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  61. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  62. package/dist/src/plugins/js/lock-file/npm-parser.js +71 -27
  63. package/dist/src/plugins/js/lock-file/pnpm-parser.js +50 -17
  64. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +1 -1
  65. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +3 -0
  66. package/dist/src/plugins/js/lock-file/yarn-parser.js +32 -5
  67. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +12 -4
  68. package/dist/src/plugins/js/utils/register.d.ts +18 -0
  69. package/dist/src/plugins/js/utils/register.js +81 -0
  70. package/dist/src/plugins/js/utils/typescript.d.ts +9 -0
  71. package/dist/src/plugins/js/utils/typescript.js +15 -0
  72. package/dist/src/project-graph/build-project-graph.js +7 -1
  73. package/dist/src/project-graph/error-types.js +41 -1
  74. package/dist/src/project-graph/file-utils.js +6 -1
  75. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +4 -0
  76. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +1 -0
  77. package/dist/src/project-graph/plugins/transpiler.js +4 -0
  78. package/dist/src/project-graph/project-graph.js +3 -0
  79. package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts +10 -12
  80. package/dist/src/project-graph/utils/project-configuration/name-substitution-manager.js +93 -63
  81. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +5 -8
  82. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +11 -14
  83. package/dist/src/project-graph/utils/project-configuration/source-maps.d.ts +12 -5
  84. package/dist/src/project-graph/utils/project-configuration/source-maps.js +21 -7
  85. package/dist/src/project-graph/utils/project-configuration/target-defaults.d.ts +1 -1
  86. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +26 -27
  87. package/dist/src/project-graph/utils/project-configuration/target-merging.js +50 -8
  88. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +16 -3
  89. package/dist/src/project-graph/utils/project-configuration/utils.d.ts +15 -0
  90. package/dist/src/project-graph/utils/project-configuration/utils.js +42 -6
  91. package/dist/src/project-graph/utils/project-configuration-utils.d.ts +15 -12
  92. package/dist/src/project-graph/utils/project-configuration-utils.js +79 -101
  93. package/dist/src/tasks-runner/life-cycles/performance-analysis.d.ts +11 -4
  94. package/dist/src/tasks-runner/life-cycles/performance-analysis.js +15 -6
  95. package/dist/src/tasks-runner/life-cycles/performance-life-cycle.js +5 -4
  96. package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +18 -8
  97. package/dist/src/tasks-runner/life-cycles/performance-report.js +66 -29
  98. package/dist/src/tasks-runner/run-command.js +4 -2
  99. package/dist/src/tasks-runner/task-env.d.ts +9 -0
  100. package/dist/src/tasks-runner/task-env.js +26 -2
  101. package/dist/src/tasks-runner/task-orchestrator.d.ts +4 -1
  102. package/dist/src/tasks-runner/task-orchestrator.js +23 -10
  103. package/dist/src/utils/acknowledge-build-scripts.d.ts +13 -0
  104. package/dist/src/utils/acknowledge-build-scripts.js +102 -0
  105. package/dist/src/utils/analytics-prompt.d.ts +0 -6
  106. package/dist/src/utils/analytics-prompt.js +0 -51
  107. package/dist/src/utils/catalog/manager-utils.d.ts +1 -2
  108. package/dist/src/utils/catalog/manager-utils.js +22 -5
  109. package/dist/src/utils/catalog/pnpm-manager.d.ts +1 -0
  110. package/dist/src/utils/catalog/pnpm-manager.js +3 -15
  111. package/dist/src/utils/catalog/yarn-manager.d.ts +1 -0
  112. package/dist/src/utils/catalog/yarn-manager.js +3 -15
  113. package/dist/src/utils/command-line-utils.js +30 -20
  114. package/dist/src/utils/git-revision.d.ts +12 -0
  115. package/dist/src/utils/git-revision.js +25 -0
  116. package/dist/src/utils/git-utils.d.ts +16 -3
  117. package/dist/src/utils/git-utils.js +146 -52
  118. package/dist/src/utils/min-release-age/behavior/pnpm.js +9 -7
  119. package/dist/src/utils/package-json.js +11 -7
  120. package/dist/src/utils/package-manager.d.ts +3 -1
  121. package/dist/src/utils/package-manager.js +28 -4
  122. package/dist/src/utils/provenance.js +12 -2
  123. package/dist/src/utils/workspace-id.d.ts +20 -0
  124. package/dist/src/utils/workspace-id.js +54 -0
  125. package/migrations.json +7 -1
  126. package/package.json +47 -34
  127. package/dist/src/migrations/update-17-3-0/nx-release-path.d.ts +0 -3
  128. package/dist/src/migrations/update-17-3-0/nx-release-path.js +0 -47
package/README.md CHANGED
@@ -13,10 +13,10 @@ npm install @depup/nx
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [nx](https://www.npmjs.com/package/nx) @ 23.1.0 |
17
- | Processed | 2026-07-28 |
16
+ | Original | [nx](https://www.npmjs.com/package/nx) @ 23.1.1 |
17
+ | Processed | 2026-07-31 |
18
18
  | Smoke test | failed |
19
- | Deps updated | 69 |
19
+ | Deps updated | 71 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
@@ -26,7 +26,7 @@ npm install @depup/nx
26
26
  | @emnapi/runtime | 1.4.5 | ^1.11.3 |
27
27
  | @emnapi/wasi-threads | 1.0.4 | ^2.0.1 |
28
28
  | @jest/diff-sequences | 30.0.1 | ^30.4.0 |
29
- | @napi-rs/wasm-runtime | 0.2.4 | ^1.2.0 |
29
+ | @napi-rs/wasm-runtime | 0.2.4 | ^1.2.1 |
30
30
  | @tybys/wasm-util | 0.9.0 | ^0.10.3 |
31
31
  | @zkochan/js-yaml | 0.0.7 | ^0.0.11 |
32
32
  | agent-base | 6.0.2 | ^9.0.0 |
@@ -34,10 +34,10 @@ npm install @depup/nx
34
34
  | ansi-styles | 4.3.0 | ^7.0.0 |
35
35
  | argparse | 2.0.1 | ^3.0.0 |
36
36
  | asynckit | 0.4.0 | ^0.5.0 |
37
- | axios | 1.16.1 | ^1.18.1 |
37
+ | axios | 1.18.1 | ^1.19.0 |
38
38
  | balanced-match | 4.0.3 | ^4.0.4 |
39
- | bl | 4.1.0 | ^7.0.10 |
40
- | brace-expansion | 5.0.6 | ^5.0.8 |
39
+ | bl | 4.1.0 | ^7.0.12 |
40
+ | brace-expansion | 5.0.8 | ^5.0.9 |
41
41
  | buffer | 5.7.1 | ^6.0.3 |
42
42
  | chalk | 4.1.2 | ^6.0.0 |
43
43
  | cli-cursor | 3.1.0 | ^5.0.0 |
@@ -46,10 +46,11 @@ npm install @depup/nx
46
46
  | clone | 1.0.4 | ^2.1.2 |
47
47
  | color-convert | 2.0.1 | ^3.1.3 |
48
48
  | color-name | 1.1.4 | ^2.1.1 |
49
+ | default-browser | 5.2.1 | ^5.5.0 |
50
+ | default-browser-id | 5.0.0 | ^5.0.1 |
49
51
  | defaults | 1.0.4 | ^3.0.0 |
50
- | define-lazy-prop | 2.0.0 | ^3.0.0 |
51
52
  | dotenv | 16.4.7 | ^17.4.2 |
52
- | dotenv-expand | 12.0.3 | ^13.0.0 |
53
+ | dotenv-expand | 12.0.3 | ^1000.0.0 |
53
54
  | ejs | 5.0.1 | ^6.0.1 |
54
55
  | emoji-regex | 8.0.0 | ^10.6.0 |
55
56
  | enquirer | 2.3.6 | ^2.4.1 |
@@ -60,11 +61,11 @@ npm install @depup/nx
60
61
  | has-flag | 4.0.0 | ^5.0.1 |
61
62
  | https-proxy-agent | 5.0.1 | ^9.1.0 |
62
63
  | ignore | 7.0.5 | ^7.0.6 |
63
- | is-docker | 2.2.1 | ^4.0.0 |
64
+ | is-docker | 3.0.0 | ^4.0.0 |
64
65
  | is-fullwidth-code-point | 3.0.0 | ^5.1.0 |
65
66
  | is-interactive | 1.0.0 | ^2.0.0 |
66
67
  | is-unicode-supported | 0.1.0 | ^2.1.0 |
67
- | is-wsl | 2.2.0 | ^3.1.1 |
68
+ | is-wsl | 3.1.0 | ^3.1.1 |
68
69
  | isexe | 2.0.0 | ^4.0.0 |
69
70
  | lines-and-columns | 2.0.3 | ^2.0.4 |
70
71
  | log-symbols | 4.1.0 | ^7.0.1 |
@@ -74,11 +75,12 @@ npm install @depup/nx
74
75
  | minimatch | 10.2.5 | ^10.2.6 |
75
76
  | npm-run-path | 4.0.1 | ^6.0.0 |
76
77
  | onetime | 5.1.2 | ^8.0.0 |
77
- | open | 8.4.2 | ^11.0.0 |
78
+ | open | 10.1.0 | ^11.0.0 |
78
79
  | ora | 5.4.1 | ^9.4.1 |
79
80
  | path-key | 3.1.1 | ^4.0.0 |
80
81
  | readable-stream | 3.6.2 | ^4.7.0 |
81
82
  | restore-cursor | 3.1.0 | ^5.1.0 |
83
+ | run-applescript | 7.0.0 | ^7.1.0 |
82
84
  | semver | 7.8.4 | ^7.8.5 |
83
85
  | signal-exit | 3.0.7 | ^4.1.0 |
84
86
  | smol-toml | 1.6.1 | ^1.7.1 |
package/changes.json CHANGED
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "@napi-rs/wasm-runtime": {
20
20
  "from": "0.2.4",
21
- "to": "^1.2.0"
21
+ "to": "^1.2.1"
22
22
  },
23
23
  "@tybys/wasm-util": {
24
24
  "from": "0.9.0",
@@ -49,8 +49,8 @@
49
49
  "to": "^0.5.0"
50
50
  },
51
51
  "axios": {
52
- "from": "1.16.1",
53
- "to": "^1.18.1"
52
+ "from": "1.18.1",
53
+ "to": "^1.19.0"
54
54
  },
55
55
  "balanced-match": {
56
56
  "from": "4.0.3",
@@ -58,11 +58,11 @@
58
58
  },
59
59
  "bl": {
60
60
  "from": "4.1.0",
61
- "to": "^7.0.10"
61
+ "to": "^7.0.12"
62
62
  },
63
63
  "brace-expansion": {
64
- "from": "5.0.6",
65
- "to": "^5.0.8"
64
+ "from": "5.0.8",
65
+ "to": "^5.0.9"
66
66
  },
67
67
  "buffer": {
68
68
  "from": "5.7.1",
@@ -96,21 +96,25 @@
96
96
  "from": "1.1.4",
97
97
  "to": "^2.1.1"
98
98
  },
99
+ "default-browser": {
100
+ "from": "5.2.1",
101
+ "to": "^5.5.0"
102
+ },
103
+ "default-browser-id": {
104
+ "from": "5.0.0",
105
+ "to": "^5.0.1"
106
+ },
99
107
  "defaults": {
100
108
  "from": "1.0.4",
101
109
  "to": "^3.0.0"
102
110
  },
103
- "define-lazy-prop": {
104
- "from": "2.0.0",
105
- "to": "^3.0.0"
106
- },
107
111
  "dotenv": {
108
112
  "from": "16.4.7",
109
113
  "to": "^17.4.2"
110
114
  },
111
115
  "dotenv-expand": {
112
116
  "from": "12.0.3",
113
- "to": "^13.0.0"
117
+ "to": "^1000.0.0"
114
118
  },
115
119
  "ejs": {
116
120
  "from": "5.0.1",
@@ -153,7 +157,7 @@
153
157
  "to": "^7.0.6"
154
158
  },
155
159
  "is-docker": {
156
- "from": "2.2.1",
160
+ "from": "3.0.0",
157
161
  "to": "^4.0.0"
158
162
  },
159
163
  "is-fullwidth-code-point": {
@@ -169,7 +173,7 @@
169
173
  "to": "^2.1.0"
170
174
  },
171
175
  "is-wsl": {
172
- "from": "2.2.0",
176
+ "from": "3.1.0",
173
177
  "to": "^3.1.1"
174
178
  },
175
179
  "isexe": {
@@ -209,7 +213,7 @@
209
213
  "to": "^8.0.0"
210
214
  },
211
215
  "open": {
212
- "from": "8.4.2",
216
+ "from": "10.1.0",
213
217
  "to": "^11.0.0"
214
218
  },
215
219
  "ora": {
@@ -228,6 +232,10 @@
228
232
  "from": "3.1.0",
229
233
  "to": "^5.1.0"
230
234
  },
235
+ "run-applescript": {
236
+ "from": "7.0.0",
237
+ "to": "^7.1.0"
238
+ },
231
239
  "semver": {
232
240
  "from": "7.8.4",
233
241
  "to": "^7.8.5"
@@ -277,6 +285,6 @@
277
285
  "to": "^22.0.0"
278
286
  }
279
287
  },
280
- "timestamp": "2026-07-28T16:37:21.462Z",
281
- "totalUpdated": 69
288
+ "timestamp": "2026-07-31T00:41:25.101Z",
289
+ "totalUpdated": 71
282
290
  }
package/dist/bin/nx.js CHANGED
@@ -5,6 +5,7 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const tslib_1 = require("tslib");
7
7
  if (process.env.FORCE_COLOR === '0') {
8
+ process.env.NX_ORIGINAL_FORCE_COLOR = '0';
8
9
  process.env.NO_COLOR = '1';
9
10
  delete process.env.FORCE_COLOR;
10
11
  }
@@ -258,7 +259,7 @@ function warnIfUsingOutdatedGlobalInstall(globalNxVersion, localNxVersion) {
258
259
  `Your repository uses a higher version of Nx (${localNxVersion}) than your global CLI version (${globalNxVersion})`,
259
260
  ]
260
261
  : [];
261
- bodyLines.push('For more information, see https://nx.dev/more-concepts/global-nx');
262
+ bodyLines.push('For more information, see https://nx.dev/docs/getting-started/installation#global-installation');
262
263
  output_1.output.warn({
263
264
  title: `It's time to update Nx 🎉`,
264
265
  bodyLines,
@@ -0,0 +1,5 @@
1
+ import { AgentStatusInfo } from '../daemon/message-types/configure-ai-agents';
2
+ /**
3
+ * Whether to show the "configure-ai-agents is outdated" banner after a task run.
4
+ */
5
+ export declare function shouldPrintConfigureAiAgentsDisclaimer(outdatedAgents: AgentStatusInfo[], workspaceRoot: string): boolean;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldPrintConfigureAiAgentsDisclaimer = shouldPrintConfigureAiAgentsDisclaimer;
4
+ const fs_1 = require("fs");
5
+ const detect_ai_agent_1 = require("./detect-ai-agent");
6
+ const constants_1 = require("./constants");
7
+ /**
8
+ * Whether to show the "configure-ai-agents is outdated" banner after a task run.
9
+ */
10
+ function shouldPrintConfigureAiAgentsDisclaimer(outdatedAgents, workspaceRoot) {
11
+ if (outdatedAgents.length === 0) {
12
+ return false;
13
+ }
14
+ const detectedAgent = (0, detect_ai_agent_1.detectAiAgent)();
15
+ if (detectedAgent) {
16
+ return outdatedAgents.some((agent) => agent.name === detectedAgent);
17
+ }
18
+ // Unsupported agents (e.g. qwen) cannot be configured via `nx configure-ai-agents`.
19
+ // If the repo already has Nx rules in AGENTS.md, skip the misleading warning.
20
+ const agentsMd = (0, constants_1.agentsMdPath)(workspaceRoot);
21
+ if (!(0, fs_1.existsSync)(agentsMd)) {
22
+ return true;
23
+ }
24
+ try {
25
+ const content = (0, fs_1.readFileSync)(agentsMd, 'utf-8');
26
+ return !constants_1.rulesRegex.test(content);
27
+ }
28
+ catch {
29
+ return true;
30
+ }
31
+ }
@@ -1,6 +1,12 @@
1
1
  import type { EventDimensions } from '../native';
2
2
  export declare const customDimensions: EventDimensions;
3
3
  export type EventParameters = Partial<Record<EventDimensions[keyof EventDimensions], string | number | boolean>>;
4
+ /**
5
+ * Fraction of sessions that report perf spans. Stamping this rate on a
6
+ * measure's detail (as the sampleRate dimension) opts it into sampling; see
7
+ * is_sampled_in in native/telemetry/service.rs. Multiply GA counts by 1/rate.
8
+ */
9
+ export declare const PERF_SPAN_SAMPLE_RATE = 0.1;
4
10
  export declare function startAnalytics(): Promise<void>;
5
11
  export declare function reportNxAddCommand(packageName: string, version: string): void;
6
12
  export declare function reportNxGenerateCommand(generator: string): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customDimensions = void 0;
3
+ exports.PERF_SPAN_SAMPLE_RATE = exports.customDimensions = void 0;
4
4
  exports.startAnalytics = startAnalytics;
5
5
  exports.reportNxAddCommand = reportNxAddCommand;
6
6
  exports.reportNxGenerateCommand = reportNxGenerateCommand;
@@ -19,7 +19,7 @@ const os = tslib_1.__importStar(require("os"));
19
19
  const crypto_1 = require("crypto");
20
20
  const machine_id_cache_1 = require("../utils/machine-id-cache");
21
21
  const is_ci_1 = require("../utils/is-ci");
22
- const analytics_prompt_1 = require("../utils/analytics-prompt");
22
+ const workspace_id_1 = require("../utils/workspace-id");
23
23
  const db_connection_1 = require("../utils/db-connection");
24
24
  // Conditionally import telemetry functions only on non-WASM platforms
25
25
  let initializeTelemetry;
@@ -42,6 +42,12 @@ exports.customDimensions = native_1.IS_WASM
42
42
  ? null
43
43
  : (getEventDimensions?.() ?? null);
44
44
  let _telemetryInitialized = false;
45
+ /**
46
+ * Fraction of sessions that report perf spans. Stamping this rate on a
47
+ * measure's detail (as the sampleRate dimension) opts it into sampling; see
48
+ * is_sampled_in in native/telemetry/service.rs. Multiply GA counts by 1/rate.
49
+ */
50
+ exports.PERF_SPAN_SAMPLE_RATE = 0.1;
45
51
  async function startAnalytics() {
46
52
  // Analytics not supported on WASM
47
53
  if (native_1.IS_WASM) {
@@ -52,17 +58,20 @@ async function startAnalytics() {
52
58
  // detection, machine id, telemetry init) may throw past this boundary -
53
59
  // on any failure, continue without telemetry.
54
60
  try {
55
- if (!isAnalyticsEnabled()) {
61
+ const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
62
+ if (!isAnalyticsEnabled(nxJson)) {
56
63
  return;
57
64
  }
58
- const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
59
- const workspaceId = (0, analytics_prompt_1.generateWorkspaceId)();
65
+ const workspaceId = (0, workspace_id_1.generateWorkspaceId)(workspace_root_1.workspaceRoot, nxJson);
60
66
  if (!workspaceId) {
61
67
  // Not a git repo — no telemetry
62
68
  return;
63
69
  }
64
70
  const isNxCloud = !!(nxJson?.nxCloudId ?? nxJson?.nxCloudAccessToken);
65
- const userId = await getTelemetryUserId(workspaceId);
71
+ // A CI fleet is not a user: shared images bake in /etc/machine-id, so a
72
+ // uid would collapse whole fleets into one GA "user" (and trip per-user
73
+ // collection caps). GA falls back to cid = workspace for CI traffic.
74
+ const userId = (0, is_ci_1.isCI)() ? undefined : await getTelemetryUserId(workspaceId);
66
75
  const packageManagerInfo = getPackageManagerInfo();
67
76
  const nodeVersion = (0, semver_1.parse)(process.version);
68
77
  const nodeVersionString = nodeVersion
@@ -226,8 +235,7 @@ function getPackageManagerInfo() {
226
235
  version: (0, package_manager_1.getPackageManagerVersion)(pm),
227
236
  };
228
237
  }
229
- function isAnalyticsEnabled() {
230
- const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
238
+ function isAnalyticsEnabled(nxJson) {
231
239
  return nxJson?.analytics === true;
232
240
  }
233
241
  // Mix workspace id in: shared Docker images (Gitpod, Cypress, etc.) bake
@@ -1 +1 @@
1
- export { customDimensions, EventParameters, startAnalytics, reportNxAddCommand, reportNxGenerateCommand, reportCommandRunEvent, reportEvent, flushAnalytics, } from './analytics';
1
+ export { customDimensions, EventParameters, PERF_SPAN_SAMPLE_RATE, startAnalytics, reportNxAddCommand, reportNxGenerateCommand, reportCommandRunEvent, reportEvent, flushAnalytics, } from './analytics';
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flushAnalytics = exports.reportEvent = exports.reportCommandRunEvent = exports.reportNxGenerateCommand = exports.reportNxAddCommand = exports.startAnalytics = exports.customDimensions = void 0;
3
+ exports.flushAnalytics = exports.reportEvent = exports.reportCommandRunEvent = exports.reportNxGenerateCommand = exports.reportNxAddCommand = exports.startAnalytics = exports.PERF_SPAN_SAMPLE_RATE = exports.customDimensions = void 0;
4
4
  var analytics_1 = require("./analytics");
5
5
  Object.defineProperty(exports, "customDimensions", { enumerable: true, get: function () { return analytics_1.customDimensions; } });
6
+ Object.defineProperty(exports, "PERF_SPAN_SAMPLE_RATE", { enumerable: true, get: function () { return analytics_1.PERF_SPAN_SAMPLE_RATE; } });
6
7
  Object.defineProperty(exports, "startAnalytics", { enumerable: true, get: function () { return analytics_1.startAnalytics; } });
7
8
  Object.defineProperty(exports, "reportNxAddCommand", { enumerable: true, get: function () { return analytics_1.reportNxAddCommand; } });
8
9
  Object.defineProperty(exports, "reportNxGenerateCommand", { enumerable: true, get: function () { return analytics_1.reportNxGenerateCommand; } });
@@ -38,9 +38,16 @@ async function installPackage(pkgName, version, nxJson) {
38
38
  const pmv = (0, package_manager_1.getPackageManagerVersion)(pm);
39
39
  const pmc = (0, package_manager_1.getPackageManagerCommand)(pm);
40
40
  // if we explicitly specify latest in yarn berry, it won't resolve the version
41
- const command = pm === 'yarn' && (0, semver_1.gte)(pmv, '2.0.0') && version === 'latest'
41
+ let command = pm === 'yarn' && (0, semver_1.gte)(pmv, '2.0.0') && version === 'latest'
42
42
  ? `${pmc.addDev} ${pkgName}`
43
43
  : `${pmc.addDev} ${pkgName}@${version}`;
44
+ // pnpm 11+ fails the install when the plugin's own dependency tree
45
+ // carries unacknowledged build scripts, and the plugin's generators can
46
+ // only record allowBuilds decisions after this install. Warn and skip
47
+ // for this one install, like pnpm 10 did.
48
+ if (pm === 'pnpm' && (0, semver_1.gte)(pmv, '11.0.0')) {
49
+ command += ' --config.strictDepBuilds=false';
50
+ }
44
51
  await new Promise((resolve) => (0, child_process_1.exec)(command, {
45
52
  windowsHide: true,
46
53
  }, (error, stdout, stderr) => {
@@ -50,6 +50,7 @@ export declare function generateGraph(args: {
50
50
  exclude?: string[];
51
51
  affected?: boolean;
52
52
  }, affectedProjects: string[]): Promise<void>;
53
+ export declare function getExpandedTaskInputs(depGraphClientResponse: ProjectGraphClientResponse, expandedTaskInputsCache: Map<string, Record<string, string[]>>, taskId: string): Promise<Record<string, string[]>>;
53
54
  /**
54
55
  * The data type that `nx graph --file graph.json` or `nx build --graph graph.json` contains
55
56
  */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateGraph = generateGraph;
4
+ exports.getExpandedTaskInputs = getExpandedTaskInputs;
4
5
  const tslib_1 = require("tslib");
5
6
  const crypto_1 = require("crypto");
6
7
  const node_child_process_1 = require("node:child_process");
@@ -9,7 +10,6 @@ const daemon_socket_messenger_1 = require("../../daemon/client/daemon-socket-mes
9
10
  const http = tslib_1.__importStar(require("node:http"));
10
11
  const minimatch_1 = require("minimatch");
11
12
  const node_url_1 = require("node:url");
12
- const open_1 = tslib_1.__importDefault(require("open"));
13
13
  const node_path_1 = require("node:path");
14
14
  const net = tslib_1.__importStar(require("node:net"));
15
15
  const node_perf_hooks_1 = require("node:perf_hooks");
@@ -34,6 +34,7 @@ const create_task_hasher_1 = require("../../hasher/create-task-hasher");
34
34
  const task_env_1 = require("../../tasks-runner/task-env");
35
35
  const error_types_1 = require("../../project-graph/error-types");
36
36
  const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
37
+ const split_target_1 = require("../../utils/split-target");
37
38
  // maps file extention to MIME types
38
39
  const mimeType = {
39
40
  '.ico': 'image/x-icon',
@@ -349,7 +350,11 @@ async function generateGraph(args, affectedProjects) {
349
350
  title: `Project graph started at ${url.toString()}`,
350
351
  });
351
352
  if (args.open) {
352
- (0, open_1.default)(url.toString());
353
+ new Function('return import("open")')()
354
+ .then((m) => m.default(url.toString()))
355
+ .catch(() => {
356
+ // Ignore errors when opening browser (e.g. no browser available)
357
+ });
353
358
  }
354
359
  return new Promise((res) => {
355
360
  app.once('close', res);
@@ -438,7 +443,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
438
443
  node_perf_hooks_1.performance.mark('task input generation:start');
439
444
  const taskId = parsedUrl.searchParams.get('taskId');
440
445
  res.writeHead(200, { 'Content-Type': 'application/json' });
441
- const inputs = await getExpandedTaskInputs(taskId);
446
+ const inputs = await getExpandedTaskInputs(currentProjectGraphClientResponse, expandedTaskInputsCache, taskId);
442
447
  node_perf_hooks_1.performance.mark('task input generation:end');
443
448
  res.end(JSON.stringify({ [taskId]: inputs }));
444
449
  node_perf_hooks_1.performance.measure('task input generation', 'task input generation:start', 'task input generation:end');
@@ -823,19 +828,23 @@ async function createTaskGraphForTargetsAndProjects(targetNames, projectNames, c
823
828
  };
824
829
  }
825
830
  }
826
- async function getExpandedTaskInputs(taskId) {
831
+ async function getExpandedTaskInputs(depGraphClientResponse, expandedTaskInputsCache, taskId) {
827
832
  // Check cache first
828
833
  if (expandedTaskInputsCache.has(taskId)) {
829
834
  return expandedTaskInputsCache.get(taskId);
830
835
  }
831
836
  // Use the optimized version that only creates the specific task graph needed
832
- const [projectName, targetName, configuration] = taskId.split(':');
837
+ // Use colon-aware splitting so that target names containing colons
838
+ // (e.g. "test:integration") are parsed correctly instead of being
839
+ // mistaken for a target + configuration pair.
840
+ const projectNodes = Object.fromEntries(depGraphClientResponse.projects.map((p) => [p.name, p]));
841
+ const [projectName, targetName, configuration] = (0, split_target_1.splitTargetFromNodes)(taskId, projectNodes, { silent: true });
833
842
  const taskGraphResponse = await createTaskGraphForTargetsAndProjects([targetName], [projectName], configuration);
834
843
  const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
835
844
  const inputs = taskGraphResponse.plans?.[taskId];
836
845
  let result = {};
837
846
  if (inputs) {
838
- result = expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name === projectName), allWorkspaceFiles, currentProjectGraphClientResponse);
847
+ result = expandInputs(inputs, depGraphClientResponse.projects.find((p) => p.name === projectName), allWorkspaceFiles, depGraphClientResponse);
839
848
  }
840
849
  // Cache the result
841
850
  expandedTaskInputsCache.set(taskId, result);
@@ -489,7 +489,7 @@ async function runInstallDestinationRepo(packageManager, destinationGitClient) {
489
489
  output_1.output.log({
490
490
  title: 'Installing dependencies for imported code',
491
491
  });
492
- (0, utils_1.runInstall)(workspace_root_1.workspaceRoot, (0, package_manager_1.getPackageManagerCommand)(packageManager));
492
+ (0, utils_1.runInstall)(workspace_root_1.workspaceRoot, packageManager, (0, package_manager_1.getPackageManagerCommand)(packageManager));
493
493
  await destinationGitClient.amendCommit();
494
494
  }
495
495
  catch (e) {
@@ -1,2 +1,2 @@
1
1
  import { Agent } from '../../ai/utils';
2
- export declare function determineAiAgents(aiAgents?: Agent[], interactive?: boolean): Promise<Agent[]>;
2
+ export declare function determineAiAgents(aiAgents?: (Agent | 'none')[], interactive?: boolean): Promise<Agent[]>;
@@ -8,16 +8,17 @@ const utils_1 = require("../../ai/utils");
8
8
  const detect_ai_agent_1 = require("../../ai/detect-ai-agent");
9
9
  const pc = tslib_1.__importStar(require("picocolors"));
10
10
  async function determineAiAgents(aiAgents, interactive) {
11
- if (interactive === false || (0, is_ci_1.isCI)()) {
12
- if (aiAgents) {
13
- return aiAgents;
11
+ if (aiAgents) {
12
+ const filtered = aiAgents.filter((a) => a !== 'none');
13
+ if (filtered.length > 0) {
14
+ return filtered;
14
15
  }
16
+ return [];
17
+ }
18
+ if (interactive === false || (0, is_ci_1.isCI)()) {
15
19
  const detected = (0, detect_ai_agent_1.detectAiAgent)();
16
20
  return detected ? [detected] : [];
17
21
  }
18
- if (aiAgents) {
19
- return aiAgents;
20
- }
21
22
  return await aiAgentsPrompt();
22
23
  }
23
24
  async function aiAgentsPrompt() {
@@ -64,8 +64,16 @@ async function withInitOptions(yargs) {
64
64
  .option('aiAgents', {
65
65
  type: 'array',
66
66
  string: true,
67
- description: 'List of AI agents to set up.',
68
- choices: ['claude', 'codex', 'copilot', 'cursor', 'gemini', 'opencode'],
67
+ description: 'List of AI agents to set up. Use "none" to skip.',
68
+ choices: [
69
+ 'claude',
70
+ 'codex',
71
+ 'copilot',
72
+ 'cursor',
73
+ 'gemini',
74
+ 'opencode',
75
+ 'none',
76
+ ],
69
77
  })
70
78
  .option('plugins', {
71
79
  type: 'string',
@@ -25,8 +25,9 @@ function installPluginPackages(repoRoot, pmc = (0, package_manager_1.getPackageM
25
25
  return;
26
26
  }
27
27
  if ((0, fs_1.existsSync)((0, path_1.join)(repoRoot, 'package.json'))) {
28
- (0, utils_1.addDepsToPackageJson)(repoRoot, plugins);
29
- (0, utils_1.runInstall)(repoRoot, pmc);
28
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
29
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager, plugins);
30
+ (0, utils_1.runInstall)(repoRoot, packageManager, pmc);
30
31
  }
31
32
  else {
32
33
  const nxJson = (0, configuration_1.readNxJson)(repoRoot);
@@ -7,6 +7,7 @@ const ignore = require("ignore");
7
7
  const path_1 = require("path");
8
8
  const fileutils_1 = require("../../../utils/fileutils");
9
9
  const output_1 = require("../../../utils/output");
10
+ const package_manager_1 = require("../../../utils/package-manager");
10
11
  const utils_1 = require("./utils");
11
12
  const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
12
13
  async function addNxToMonorepo(options, guided = true) {
@@ -76,9 +77,10 @@ async function addNxToMonorepo(options, guided = true) {
76
77
  }
77
78
  (0, utils_1.createNxJsonFile)(repoRoot, targetDefaults, cacheableOperations, scriptOutputs);
78
79
  (0, utils_1.updateGitIgnore)(repoRoot);
79
- (0, utils_1.addDepsToPackageJson)(repoRoot);
80
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
81
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager);
80
82
  output_1.output.log({ title: '📦 Installing dependencies' });
81
- (0, utils_1.runInstall)(repoRoot);
83
+ (0, utils_1.runInstall)(repoRoot, packageManager);
82
84
  if (nxCloudChoice === 'yes') {
83
85
  output_1.output.log({ title: '🛠️ Setting up Nx Cloud' });
84
86
  await (0, utils_1.initCloud)('nx-init-monorepo');
@@ -86,9 +86,10 @@ async function addNxToNest(options, packageJson) {
86
86
  : 'skip';
87
87
  }
88
88
  (0, utils_1.createNxJsonFile)(repoRoot, [], [...cacheableOperations, ...nestCacheableScripts], scriptOutputs);
89
- const pmc = (0, package_manager_1.getPackageManagerCommand)();
89
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
90
+ const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
90
91
  (0, utils_1.updateGitIgnore)(repoRoot);
91
- (0, utils_1.addDepsToPackageJson)(repoRoot);
92
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager);
92
93
  addNestPluginToPackageJson(repoRoot);
93
94
  (0, utils_1.markRootPackageJsonAsNxProjectLegacy)(repoRoot, cacheableOperations, pmc);
94
95
  createProjectJson(repoRoot, packageJson, nestCLIConfiguration);
@@ -98,7 +99,7 @@ async function addNxToNest(options, packageJson) {
98
99
  updateTsConfig(repoRoot, nestCLIConfiguration.sourceRoot);
99
100
  }
100
101
  output_1.output.log({ title: '📦 Installing dependencies' });
101
- (0, utils_1.runInstall)(repoRoot);
102
+ (0, utils_1.runInstall)(repoRoot, packageManager, pmc);
102
103
  if (nxCloudChoice === 'yes') {
103
104
  output_1.output.log({ title: '🛠️ Setting up Nx Cloud' });
104
105
  await (0, utils_1.initCloud)('nx-init-nest');
@@ -61,9 +61,10 @@ async function addNxToNpmRepo(options, guided = true) {
61
61
  : 'skip';
62
62
  }
63
63
  (0, utils_1.createNxJsonFile)(repoRoot, [], cacheableOperations, scriptOutputs);
64
- const pmc = (0, package_manager_1.getPackageManagerCommand)();
64
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
65
+ const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
65
66
  (0, utils_1.updateGitIgnore)(repoRoot);
66
- (0, utils_1.addDepsToPackageJson)(repoRoot);
67
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager);
67
68
  if (options.legacy) {
68
69
  (0, utils_1.markRootPackageJsonAsNxProjectLegacy)(repoRoot, cacheableOperations, pmc);
69
70
  }
@@ -71,7 +72,7 @@ async function addNxToNpmRepo(options, guided = true) {
71
72
  (0, utils_1.markPackageJsonAsNxProject)((0, path_1.join)(repoRoot, 'package.json'));
72
73
  }
73
74
  output_1.output.log({ title: '📦 Installing dependencies' });
74
- (0, utils_1.runInstall)(repoRoot, pmc);
75
+ (0, utils_1.runInstall)(repoRoot, packageManager, pmc);
75
76
  if (nxCloudChoice === 'yes') {
76
77
  output_1.output.log({ title: '🛠️ Setting up Nx Cloud' });
77
78
  await (0, utils_1.initCloud)('nx-init-npm-repo');
@@ -42,9 +42,10 @@ async function addNxToTurborepo(_options) {
42
42
  // Apply fallback JSON write
43
43
  (0, fileutils_1.writeJsonFile)(nxJsonPath, nxJson);
44
44
  }
45
- const pmc = (0, package_manager_1.getPackageManagerCommand)();
45
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
46
+ const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
46
47
  (0, utils_1.updateGitIgnore)(repoRoot);
47
- (0, utils_1.addDepsToPackageJson)(repoRoot);
48
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager);
48
49
  output_1.output.log({ title: '📦 Installing dependencies' });
49
- (0, utils_1.runInstall)(repoRoot, pmc);
50
+ (0, utils_1.runInstall)(repoRoot, packageManager, pmc);
50
51
  }
@@ -7,6 +7,7 @@ const fileutils_1 = require("../../../../utils/fileutils");
7
7
  const versions_1 = require("../../../../utils/versions");
8
8
  const object_sort_1 = require("../../../../utils/object-sort");
9
9
  const output_1 = require("../../../../utils/output");
10
+ const package_manager_1 = require("../../../../utils/package-manager");
10
11
  const package_json_1 = require("../../../../utils/package-json");
11
12
  const utils_1 = require("../utils");
12
13
  const integrated_workspace_1 = require("./integrated-workspace");
@@ -86,9 +87,10 @@ async function collectCacheableOperations(options) {
86
87
  return cacheableOperations;
87
88
  }
88
89
  function installDependencies() {
89
- (0, utils_1.addDepsToPackageJson)(repoRoot);
90
+ const packageManager = (0, package_manager_1.detectPackageManager)(repoRoot);
91
+ (0, utils_1.addDepsToPackageJson)(repoRoot, packageManager);
90
92
  addPluginDependencies();
91
- (0, utils_1.runInstall)(repoRoot);
93
+ (0, utils_1.runInstall)(repoRoot, packageManager);
92
94
  }
93
95
  function addPluginDependencies() {
94
96
  const packageJsonPath = (0, path_1.join)(repoRoot, 'package.json');
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupIntegratedWorkspace = setupIntegratedWorkspace;
4
- const child_process_1 = require("child_process");
5
- const package_manager_1 = require("../../../../utils/package-manager");
4
+ const child_process_1 = require("../../../../utils/child-process");
6
5
  function setupIntegratedWorkspace() {
7
- const pmc = (0, package_manager_1.getPackageManagerCommand)();
8
- (0, child_process_1.execSync)(`${pmc.exec} nx g @nx/angular:ng-add`, {
6
+ (0, child_process_1.runNxSync)(`g @nx/angular:ng-add`, {
9
7
  stdio: [0, 1, 2],
10
- windowsHide: true,
11
8
  });
12
9
  }
@@ -107,6 +107,9 @@ async function getLegacyMigrationFunctionIfApplicable(repoRoot, options) {
107
107
  unscopedPkgName,
108
108
  }, pmc);
109
109
  output_1.output.log({ title: '📝 Setting up workspace' });
110
+ // Intentionally not runNxSync: legacyMigrationCommand is either the Angular
111
+ // CLI (`ng g ...:ng-add`) or a version-pinned `nx@<version> init`, neither
112
+ // of which is the local nx that runNxSync would resolve.
110
113
  (0, child_process_1.execSync)(`${pmc.exec} ${legacyMigrationCommand}`, {
111
114
  stdio: [0, 1, 2],
112
115
  windowsHide: true,