nx 24.0.2 → 24.0.3

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 (47) hide show
  1. package/dist/bin/nx-cloud.js +9 -0
  2. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +12 -1
  3. package/dist/src/command-line/migrate/migrate-analytics.js +2 -2
  4. package/dist/src/command-line/migrate/migrate.d.ts +3 -0
  5. package/dist/src/command-line/migrate/migrate.js +34 -15
  6. package/dist/src/command-line/migrate/workspace-installation.d.ts +15 -0
  7. package/dist/src/command-line/migrate/workspace-installation.js +73 -0
  8. package/dist/src/command-line/nx-cloud/complete-run/command-object.js +1 -1
  9. package/dist/src/command-line/nx-cloud/fix-ci/command-object.js +1 -1
  10. package/dist/src/command-line/nx-cloud/logout/command-object.js +11 -2
  11. package/dist/src/command-line/nx-cloud/record/command-object.js +1 -1
  12. package/dist/src/command-line/nx-cloud/start-ci-run/command-object.js +1 -1
  13. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +1 -1
  14. package/dist/src/command-line/release/changelog.js +6 -2
  15. package/dist/src/command-line/release/version/version-actions.js +2 -1
  16. package/dist/src/command-line/show/show-target/info.d.ts +1 -1
  17. package/dist/src/command-line/show/show-target/info.js +4 -4
  18. package/dist/src/core/graph/favicon.ico +0 -0
  19. package/dist/src/core/graph/main.js +1 -1
  20. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +3 -1
  21. package/dist/src/executors/run-commands/running-tasks.js +7 -0
  22. package/dist/src/executors/run-commands/schema.json +1 -1
  23. package/dist/src/native/index.js +12 -17
  24. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  25. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  26. package/dist/src/nx-cloud/update-manager.d.ts +2 -0
  27. package/dist/src/nx-cloud/utilities/client.d.ts +1 -0
  28. package/dist/src/nx-cloud/utilities/client.js +5 -0
  29. package/dist/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +2 -1
  30. package/dist/src/plugins/js/utils/register.js +3 -2
  31. package/dist/src/plugins/js/utils/typescript.js +3 -2
  32. package/dist/src/project-graph/utils/retrieve-workspace-files.js +2 -2
  33. package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +34 -13
  34. package/dist/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +26 -5
  35. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +1 -1
  36. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +1 -1
  37. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +3 -3
  38. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +76 -39
  39. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +2 -2
  40. package/dist/src/tasks-runner/running-tasks/batch-process.js +1 -1
  41. package/dist/src/tasks-runner/task-orchestrator.d.ts +6 -3
  42. package/dist/src/tasks-runner/task-orchestrator.js +61 -29
  43. package/dist/src/utils/installation-directory.d.ts +8 -0
  44. package/dist/src/utils/installation-directory.js +13 -0
  45. package/dist/src/utils/package-manager.d.ts +2 -1
  46. package/dist/src/utils/package-manager.js +42 -12
  47. package/package.json +12 -12
@@ -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) {
@@ -85,7 +85,7 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
85
85
  }
86
86
  if (hasAgent('claude')) {
87
87
  const claudePath = (0, path_1.join)(options.directory, 'CLAUDE.md');
88
- writeAgentRules(tree, claudePath, options.writeNxCloudRules);
88
+ writeAgentRules(tree, importsAgentsMd(tree, claudePath) ? agentsMd : claudePath, options.writeNxCloudRules);
89
89
  // Configure Claude plugin via marketplace (plugin includes MCP server)
90
90
  const claudeSettingsPath = (0, path_1.join)(options.directory, '.claude', 'settings.json');
91
91
  if (!tree.exists(claudeSettingsPath)) {
@@ -348,6 +348,17 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
348
348
  function withEntries(existing, ...values) {
349
349
  return [...new Set([...(existing ?? []), ...values])];
350
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
+ }
351
362
  function writeAgentRules(tree, path, writeNxCloudRules) {
352
363
  if (!tree.exists(path)) {
353
364
  // File doesn't exist - create with h1 header (standalone content)
@@ -27,7 +27,7 @@ exports.safeReport = safeReport;
27
27
  const semver_1 = require("semver");
28
28
  const analytics_1 = require("../../analytics");
29
29
  const provenance_1 = require("../../utils/provenance");
30
- const workspace_root_1 = require("../../utils/workspace-root");
30
+ const workspace_installation_1 = require("./workspace-installation");
31
31
  // Identifier-shaped tokens only (Node codes like ENOENT, class names like
32
32
  // TypeError). Rejects anything with a slash, space, or punctuation so a
33
33
  // settable `.code`/`.name` can't smuggle a path or message into GA.
@@ -347,7 +347,7 @@ function reportMigrateSingleMigrationAbandoned(opts) {
347
347
  // workspace-local installation; same signal as the run-phase re-dispatch
348
348
  // check in migrate.ts.
349
349
  function cliSource() {
350
- return __dirname.startsWith(workspace_root_1.workspaceRoot) ? 'local' : 'temp-latest';
350
+ return (0, workspace_installation_1.isRunningWorkspaceNx)() ? 'local' : 'temp-latest';
351
351
  }
352
352
  // `coerce` tolerates ranges and partial versions from package.json entries
353
353
  // (e.g. `^21.0.0`); dist-tags that never resolved coerce to null.
@@ -67,6 +67,7 @@ export declare class Migrator {
67
67
  private readonly promptAnswers;
68
68
  private readonly pendingPackageJsonUpdates;
69
69
  private readonly appliedPackageJsonUpdates;
70
+ private readonly uninstalledDeclaredPackages;
70
71
  private readonly nxInstallation;
71
72
  private minVersionWithSkippedUpdates;
72
73
  constructor(opts: MigratorOptions);
@@ -86,8 +87,10 @@ export declare class Migrator {
86
87
  name: string;
87
88
  }[];
88
89
  promptContents?: Record<string, string>;
90
+ uninstalledDeclaredPackages?: string[];
89
91
  minVersionWithSkippedUpdates: string;
90
92
  }>;
93
+ private getDeclaredDependencies;
91
94
  private createMigrateJson;
92
95
  private buildPackageJsonUpdates;
93
96
  private applyPackageJsonUpdate;
@@ -54,6 +54,7 @@ const catalog_1 = require("../../utils/catalog");
54
54
  const migrate_analytics_1 = require("./migrate-analytics");
55
55
  const multi_major_1 = require("./multi-major");
56
56
  const prompt_files_1 = require("./prompt-files");
57
+ const workspace_installation_1 = require("./workspace-installation");
57
58
  const command_object_1 = require("./command-object");
58
59
  const migrate_config_1 = require("./migrate-config");
59
60
  const types_1 = require("./agentic/types");
@@ -125,6 +126,7 @@ class Migrator {
125
126
  this.promptAnswers = {};
126
127
  this.pendingPackageJsonUpdates = new Map();
127
128
  this.appliedPackageJsonUpdates = new Set();
129
+ this.uninstalledDeclaredPackages = new Set();
128
130
  if ((opts.include === 'required' || opts.include === 'optional') &&
129
131
  !opts.requiredPackages) {
130
132
  throw new Error(`Error: 'requiredPackages' is required when 'include' is '${opts.include}'.`);
@@ -159,9 +161,20 @@ class Migrator {
159
161
  packageUpdates: this.packageUpdates,
160
162
  migrations,
161
163
  ...(Object.keys(promptContents).length > 0 ? { promptContents } : {}),
164
+ ...(this.uninstalledDeclaredPackages.size > 0
165
+ ? { uninstalledDeclaredPackages: [...this.uninstalledDeclaredPackages] }
166
+ : {}),
162
167
  minVersionWithSkippedUpdates: this.minVersionWithSkippedUpdates,
163
168
  };
164
169
  }
170
+ getDeclaredDependencies() {
171
+ return {
172
+ ...this.packageJson?.dependencies,
173
+ ...this.packageJson?.devDependencies,
174
+ ...this.nxInstallation?.plugins,
175
+ ...(this.nxInstallation && { nx: this.nxInstallation.version }),
176
+ };
177
+ }
165
178
  async createMigrateJson(requiredPackageUpdates) {
166
179
  const promptContents = {};
167
180
  const collect = async (packageName, metadataVersion, fromVersion, toVersion) => {
@@ -288,6 +301,9 @@ class Migrator {
288
301
  targetVersion = this.to[targetPackage];
289
302
  }
290
303
  if (!this.getPkgVersion(targetPackage)) {
304
+ if (this.getDeclaredDependencies()[targetPackage]) {
305
+ this.uninstalledDeclaredPackages.add(targetPackage);
306
+ }
291
307
  this.addPackageUpdate(targetPackage, {
292
308
  version: target.version,
293
309
  addToPackageJson: target.addToPackageJson || false,
@@ -399,12 +415,7 @@ class Migrator {
399
415
  this.gt(packageJsonUpdate.version, targetVersion)) {
400
416
  continue;
401
417
  }
402
- const dependencies = {
403
- ...this.packageJson?.dependencies,
404
- ...this.packageJson?.devDependencies,
405
- ...this.nxInstallation?.plugins,
406
- ...(this.nxInstallation && { nx: this.nxInstallation.version }),
407
- };
418
+ const dependencies = this.getDeclaredDependencies();
408
419
  const filtered = {};
409
420
  for (const [packageName, packageUpdate] of Object.entries(packageJsonUpdate.packages)) {
410
421
  if (this.shouldExcludePackage(packageName)) {
@@ -1138,7 +1149,7 @@ function createInstalledPackageVersionsResolver(root) {
1138
1149
  for (const req of nxRequires) {
1139
1150
  try {
1140
1151
  const packageJsonPath = req.resolve('nx/package.json');
1141
- if (packageJsonPath.startsWith(workspace_root_1.workspaceRoot)) {
1152
+ if ((0, workspace_installation_1.isWorkspaceInstalledPackage)('nx', packageJsonPath, root)) {
1142
1153
  return (0, fileutils_1.readJsonFile)(packageJsonPath).version;
1143
1154
  }
1144
1155
  }
@@ -1156,8 +1167,8 @@ function createInstalledPackageVersionsResolver(root) {
1156
1167
  const { packageJson, path } = (0, package_json_1.readModulePackageJson)(packageName, (0, installation_directory_1.getNxRequirePaths)(root));
1157
1168
  // old workspaces would have the temp installation of nx in the cache,
1158
1169
  // so the resolved package is not the one we need
1159
- if (!path.startsWith(workspace_root_1.workspaceRoot)) {
1160
- throw new Error('Resolved a package outside the workspace root.');
1170
+ if (!(0, workspace_installation_1.isWorkspaceInstalledPackage)(packageName, path, root)) {
1171
+ throw new Error('Resolved a package the workspace does not install.');
1161
1172
  }
1162
1173
  cache[packageName] = packageJson.version;
1163
1174
  }
@@ -1616,7 +1627,16 @@ async function generateMigrationsJsonAndUpdatePackageJson(root, opts, fetch) {
1616
1627
  include,
1617
1628
  requiredPackages,
1618
1629
  });
1619
- const { migrations, packageUpdates, promptContents, minVersionWithSkippedUpdates, } = await migrator.migrate(walkedTargetPackage, opts.targetVersion);
1630
+ const { migrations, packageUpdates, promptContents, minVersionWithSkippedUpdates, uninstalledDeclaredPackages, } = await migrator.migrate(walkedTargetPackage, opts.targetVersion);
1631
+ if (uninstalledDeclaredPackages) {
1632
+ output_1.output.warn({
1633
+ title: `nx migrate could not find these declared packages installed: ${uninstalledDeclaredPackages.join(', ')}`,
1634
+ bodyLines: [
1635
+ `- Their package groups and migrations were skipped.`,
1636
+ `- Undo this run's changes, install the workspace's dependencies and run nx migrate again.`,
1637
+ ],
1638
+ });
1639
+ }
1620
1640
  // The cascade collects packageJsonUpdates entries against the cascade
1621
1641
  // root's installed version, but inner per-package pins are only gated
1622
1642
  // against the in-flight cascade tally — not against each inner package's
@@ -2188,7 +2208,7 @@ async function runMigrations(root, opts, args, isVerbose, shouldCreateCommits, c
2188
2208
  await (0, execute_migration_1.runInstall)();
2189
2209
  }
2190
2210
  }
2191
- if (!__dirname.startsWith(workspace_root_1.workspaceRoot)) {
2211
+ if (!(0, workspace_installation_1.isRunningWorkspaceNx)()) {
2192
2212
  // we are running from a temp installation with nx latest, switch to running
2193
2213
  // from local installation
2194
2214
  if (isContinue) {
@@ -2737,7 +2757,7 @@ function readNxVersionFromNodeModules(searchPaths) {
2737
2757
  // executes against the workspace-local nx that owns the run state, never the
2738
2758
  // temp installation. Reconciles only read state and commit, so no install.
2739
2759
  async function runOrchestratorReconcileFromCli(root, opts, args) {
2740
- if (!__dirname.startsWith(workspace_root_1.workspaceRoot)) {
2760
+ if (!(0, workspace_installation_1.isRunningWorkspaceNx)()) {
2741
2761
  // The workspace-local nx we are about to hand off to must be new enough to
2742
2762
  // understand the new flags we forward to it.
2743
2763
  (0, version_skew_guard_1.assertWorkspaceNxSupportsNewMigrateFlags)({
@@ -2770,7 +2790,7 @@ async function runSingleMigrationFromCli(root, opts, args, mergedArgs) {
2770
2790
  checkRunsForSingleMigration(root);
2771
2791
  await (0, execute_migration_1.runInstall)(undefined, 'pre-migration', (0, execute_migration_1.formatSingleMigrationRerunCommand)(opts.runMigration));
2772
2792
  }
2773
- if (!__dirname.startsWith(workspace_root_1.workspaceRoot)) {
2793
+ if (!(0, workspace_installation_1.isRunningWorkspaceNx)()) {
2774
2794
  // Must stay after the pre-install: it reads the version that install may
2775
2795
  // have just updated, so checking earlier would falsely refuse a workspace
2776
2796
  // whose package.json bump was not installed yet.
@@ -2820,8 +2840,7 @@ async function runMigration() {
2820
2840
  stdio: ['inherit', 'inherit', 'inherit'],
2821
2841
  }));
2822
2842
  if (!(0, version_skew_guard_1.targetsExistingRun)(process.argv.slice(3)) &&
2823
- process.env.NX_USE_LOCAL !== 'true' &&
2824
- process.env.NX_MIGRATE_USE_LOCAL === undefined) {
2843
+ !(0, workspace_installation_1.shouldSkipTempMigrateCli)()) {
2825
2844
  // The version spec mirrors nxCliPath's; keep the two in sync.
2826
2845
  const cliVersionSpec = process.env.NX_MIGRATE_CLI_VERSION || 'latest';
2827
2846
  const target = await (0, version_skew_guard_1.resolveNewMigrateFlagsRunTarget)({
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Whether `packageJsonPath`, resolved for `packageName` from
3
+ * `getNxRequirePaths(root)`, is the workspace's install rather than the temp nx
4
+ * installation on NODE_PATH. The install may sit in an ancestor's node_modules
5
+ * or link outside the root (pnpm's global virtual store).
6
+ */
7
+ export declare function isWorkspaceInstalledPackage(packageName: string, packageJsonPath: string, root: string): boolean;
8
+ export declare function shouldSkipTempMigrateCli(): boolean;
9
+ /**
10
+ * Whether the running nx is the workspace's installation rather than the temp
11
+ * one `nx migrate` runs first. Any nx on the lookup chain counts: the hand-off
12
+ * spawns the root's nearest `node_modules/nx` even when `.nx/installation`
13
+ * holds another copy.
14
+ */
15
+ export declare function isRunningWorkspaceNx(): boolean;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isWorkspaceInstalledPackage = isWorkspaceInstalledPackage;
4
+ exports.shouldSkipTempMigrateCli = shouldSkipTempMigrateCli;
5
+ exports.isRunningWorkspaceNx = isRunningWorkspaceNx;
6
+ const fs_1 = require("fs");
7
+ const path_1 = require("path");
8
+ const installation_directory_1 = require("../../utils/installation-directory");
9
+ const path_2 = require("../../utils/path");
10
+ const workspace_root_1 = require("../../utils/workspace-root");
11
+ /**
12
+ * Whether `packageJsonPath`, resolved for `packageName` from
13
+ * `getNxRequirePaths(root)`, is the workspace's install rather than the temp nx
14
+ * installation on NODE_PATH. The install may sit in an ancestor's node_modules
15
+ * or link outside the root (pnpm's global virtual store).
16
+ */
17
+ function isWorkspaceInstalledPackage(packageName, packageJsonPath, root) {
18
+ const resolved = realpathOrSelf(packageJsonPath);
19
+ return (isInside(resolved, realpathOrSelf(workspace_root_1.workspaceRoot)) ||
20
+ nodeModulesLookupEntries(packageName, root).some((entry) => realpathOrNull((0, path_1.join)(entry, 'package.json')) === resolved));
21
+ }
22
+ function shouldSkipTempMigrateCli() {
23
+ return (process.env.NX_USE_LOCAL === 'true' ||
24
+ process.env.NX_MIGRATE_USE_LOCAL !== undefined);
25
+ }
26
+ /**
27
+ * Whether the running nx is the workspace's installation rather than the temp
28
+ * one `nx migrate` runs first. Any nx on the lookup chain counts: the hand-off
29
+ * spawns the root's nearest `node_modules/nx` even when `.nx/installation`
30
+ * holds another copy.
31
+ */
32
+ function isRunningWorkspaceNx() {
33
+ // The wrapper never starts the temp nx under these variables, and the hand-off
34
+ // sets one for its child, so a misjudged location cannot respawn without end.
35
+ if (shouldSkipTempMigrateCli()) {
36
+ return true;
37
+ }
38
+ const running = realpathOrSelf(__dirname);
39
+ return (isInside(running, realpathOrSelf(workspace_root_1.workspaceRoot)) ||
40
+ nodeModulesLookupEntries('nx', workspace_root_1.workspaceRoot).some((entry) => {
41
+ const target = realpathOrNull(entry);
42
+ return target !== null && isInside(running, target);
43
+ }));
44
+ }
45
+ // The `<dir>/node_modules/<packageName>` paths Node's lookup from
46
+ // `getNxRequirePaths(root)` visits up to the filesystem root, wherever they
47
+ // link to.
48
+ function nodeModulesLookupEntries(packageName, root) {
49
+ const entries = new Set();
50
+ for (const start of (0, installation_directory_1.getNxRequirePaths)(root)) {
51
+ for (let dir = (0, path_1.resolve)(start);; dir = (0, path_1.dirname)(dir)) {
52
+ entries.add((0, path_1.join)(dir, 'node_modules', packageName));
53
+ if (dir === (0, path_1.dirname)(dir))
54
+ break;
55
+ }
56
+ }
57
+ return [...entries];
58
+ }
59
+ function isInside(path, dir) {
60
+ return (0, path_2.isContainedRelativePath)((0, path_1.relative)(dir, path));
61
+ }
62
+ // NX_WORKSPACE_ROOT_PATH is used verbatim, so the workspace root may not exist.
63
+ function realpathOrSelf(path) {
64
+ return realpathOrNull(path) ?? path;
65
+ }
66
+ function realpathOrNull(path) {
67
+ try {
68
+ return (0, fs_1.realpathSync)(path);
69
+ }
70
+ catch {
71
+ return null;
72
+ }
73
+ }
@@ -6,7 +6,7 @@ const shared_options_1 = require("../../yargs-utils/shared-options");
6
6
  exports.yargsStopAllAgentsCommand = {
7
7
  command: 'stop-all-agents [options]',
8
8
  aliases: ['complete-ci-run'],
9
- describe: 'Terminates all dedicated agents associated with this CI pipeline execution. This command is an alias for [`nx-cloud stop-all-agents`](/docs/reference/nx-cloud-cli#nx-cloud-stop-all-agents).',
9
+ describe: 'Terminates all dedicated agents associated with this CI pipeline execution. This command is an alias for [`nx-cloud stop-all-agents`](/docs/reference/nx-cloud-cli#nx-cloud-stop-all-workers).',
10
10
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
11
11
  .help(false)
12
12
  .showHelpOnFail(false)
@@ -5,7 +5,7 @@ const shared_options_1 = require("../../yargs-utils/shared-options");
5
5
  const handle_import_1 = require("../../../utils/handle-import");
6
6
  exports.yargsFixCiCommand = {
7
7
  command: 'fix-ci [options]',
8
- describe: 'Fixes CI failures. This command is an alias for [`nx-cloud fix-ci`](/ci/reference/nx-cloud-cli#npx-nxcloud-fix-ci).',
8
+ describe: 'Fixes CI failures. This command is an alias for [`nx-cloud fix-ci`](/docs/reference/nx-cloud-cli#nx-cloud-fix-ci).',
9
9
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
10
10
  .help(false)
11
11
  .showHelpOnFail(false)
@@ -4,9 +4,18 @@ exports.yargsLogoutCommand = void 0;
4
4
  const handle_import_1 = require("../../../utils/handle-import");
5
5
  const shared_options_1 = require("../../yargs-utils/shared-options");
6
6
  exports.yargsLogoutCommand = {
7
- command: 'logout',
7
+ command: 'logout [nxCloudUrl]',
8
8
  describe: 'Logout from Nx Cloud. This command is an alias for `nx-cloud logout`.',
9
- builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
9
+ builder: (yargs) => (0, shared_options_1.withVerbose)(yargs
10
+ .positional('nxCloudUrl', {
11
+ describe: 'The URL of the Nx Cloud instance to log out of. With several stored logins, pass one URL or --all.',
12
+ type: 'string',
13
+ required: false,
14
+ })
15
+ .option('all', {
16
+ describe: 'Log out of every Nx Cloud instance stored on this machine.',
17
+ type: 'boolean',
18
+ }))
10
19
  .help(false)
11
20
  .showHelpOnFail(false)
12
21
  .option('help', { describe: 'Show help.', type: 'boolean' }),
@@ -5,7 +5,7 @@ const handle_import_1 = require("../../../utils/handle-import");
5
5
  const shared_options_1 = require("../../yargs-utils/shared-options");
6
6
  exports.yargsRecordCommand = {
7
7
  command: 'record [options]',
8
- describe: 'Records a command execution for distributed task execution. This command is an alias for [`nx-cloud record`](/ci/reference/nx-cloud-cli#npx-nxcloud-record).',
8
+ describe: 'Records a command execution for distributed task execution. This command is an alias for [`nx-cloud record`](/docs/reference/nx-cloud-cli#nx-cloud-record).',
9
9
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
10
10
  .parserConfiguration({
11
11
  'populate--': true,
@@ -5,7 +5,7 @@ const handle_import_1 = require("../../../utils/handle-import");
5
5
  const shared_options_1 = require("../../yargs-utils/shared-options");
6
6
  exports.yargsStartCiRunCommand = {
7
7
  command: 'start-ci-run [options]',
8
- describe: 'Starts a new CI run for distributed task execution. This command is an alias for [`nx-cloud start-ci-run`](/docs/reference/nx-cloud-cli#npx-nxcloud-start-ci-run).',
8
+ describe: 'Starts a new CI run for distributed task execution. This command is an alias for [`nx-cloud start-ci-run`](/docs/reference/nx-cloud-cli#nx-cloud-start-ci-run).',
9
9
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
10
10
  .help(false)
11
11
  .showHelpOnFail(false)
@@ -5,7 +5,7 @@ const handle_import_1 = require("../../../utils/handle-import");
5
5
  const shared_options_1 = require("../../yargs-utils/shared-options");
6
6
  exports.yargsStartNxAgentsCommand = {
7
7
  command: 'start-nx-agents [options]',
8
- describe: 'Provisions Nx Agents for distributed task execution, reading configuration from `.nx/ci-config.yaml`. This command is an alias for [`nx-cloud start-nx-agents`](/docs/reference/nx-cloud-cli#nx-cloud-start-nx-agents).',
8
+ describe: 'Provisions Nx Agents for distributed task execution, reading configuration from `.nx/ci-config.yaml`. This command is an alias for [`nx-cloud start-nx-agents`](/docs/reference/nx-cloud-cli#nx-cloud-start-workers).',
9
9
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
10
10
  .help(false)
11
11
  .showHelpOnFail(false)
@@ -691,7 +691,9 @@ async function generateChangelogForWorkspace({ tree, args, nxReleaseConfig, work
691
691
  }
692
692
  else {
693
693
  // No existing version, simply prepend the new release to the top of the file
694
- rootChangelogContents = `${contents}\n\n${rootChangelogContents}`;
694
+ rootChangelogContents = contents
695
+ ? `${contents}\n\n${rootChangelogContents}`
696
+ : rootChangelogContents;
695
697
  }
696
698
  }
697
699
  else {
@@ -803,7 +805,9 @@ async function generateChangelogForProjects({ tree, args, changes, projectsVersi
803
805
  }
804
806
  else {
805
807
  // No existing version, simply prepend the new release to the top of the file
806
- changelogContents = `${contents}\n\n${changelogContents}`;
808
+ changelogContents = contents
809
+ ? `${contents}\n\n${changelogContents}`
810
+ : changelogContents;
807
811
  }
808
812
  }
809
813
  else {
@@ -6,13 +6,14 @@ const node_path_1 = require("node:path");
6
6
  const register_1 = require("../../../plugins/js/utils/register");
7
7
  const utils_1 = require("../../../tasks-runner/utils");
8
8
  const interpolate_release_config_1 = require("../utils/interpolate-release-config");
9
+ const installation_directory_1 = require("../../../utils/installation-directory");
9
10
  const workspace_root_1 = require("../../../utils/workspace-root");
10
11
  const config_1 = require("../config/config");
11
12
  const semver_1 = require("../utils/semver");
12
13
  const release_group_processor_1 = require("./release-group-processor");
13
14
  function resolveVersionActionsPath(path, projectGraphNode) {
14
15
  try {
15
- return require.resolve(path);
16
+ return (0, installation_directory_1.resolveFromWorkspace)(path);
16
17
  }
17
18
  catch {
18
19
  try {
@@ -14,7 +14,7 @@ declare function resolveTargetInfoData(t: ResolvedTarget): {
14
14
  customHasher?: boolean;
15
15
  dependsOn?: string[];
16
16
  _depSources?: number[];
17
- _continuousDeps?: Record<string, {
17
+ continuousDependencies?: Record<string, {
18
18
  inputsHashed: boolean;
19
19
  waitsForReady: boolean;
20
20
  }>;
@@ -69,7 +69,7 @@ function resolveTargetInfoData(t) {
69
69
  ? {
70
70
  dependsOn,
71
71
  _depSources: depSourceIndices,
72
- _continuousDeps: continuousDeps,
72
+ continuousDependencies: continuousDeps,
73
73
  }
74
74
  : {}),
75
75
  ...(transitiveTasks.length > 0 ? { transitiveTasks } : {}),
@@ -326,7 +326,7 @@ function describeReadyCheck(readyWhen) {
326
326
  function renderTargetInfo(data, args) {
327
327
  if (args.json) {
328
328
  // Strip internal renderer-only fields from JSON output
329
- const { _inputSources, _depSources, _commandSourceKey, _continuousDeps, ultracacheMode, ultracacheInCI, ...jsonData } = data;
329
+ const { _inputSources, _depSources, _commandSourceKey, ultracacheMode, ultracacheInCI, ...jsonData } = data;
330
330
  console.log(JSON.stringify(jsonData, null, 2));
331
331
  return;
332
332
  }
@@ -370,7 +370,7 @@ function renderTargetInfo(data, args) {
370
370
  const hint = srcIdx !== undefined && srcIdx >= 0
371
371
  ? sourceHint(`dependsOn.${srcIdx}`, 'dependsOn')
372
372
  : sourceHint('dependsOn');
373
- const continuousDep = data._continuousDeps?.[data.dependsOn[i]];
373
+ const continuousDep = data.continuousDependencies?.[data.dependsOn[i]];
374
374
  const note = continuousDep
375
375
  ? ` ${c.dim(continuousDep.waitsForReady
376
376
  ? '(continuous, waits for ready)'
@@ -392,7 +392,7 @@ function renderTargetInfo(data, args) {
392
392
  const notice = (0, ci_status_1.ultracacheInCINotice)(data.ultracacheInCI, (0, ci_status_1.hasAlwaysInput)(data.inputs));
393
393
  console.log(`${c.bold('Ultracache')}: ${notice} ${(0, ci_status_1.ultracacheDocsLink)()}`);
394
394
  }
395
- const hashedContinuousDeps = Object.entries(data._continuousDeps ?? {})
395
+ const hashedContinuousDeps = Object.entries(data.continuousDependencies ?? {})
396
396
  .filter(([, { inputsHashed }]) => inputsHashed)
397
397
  .map(([depId]) => depId);
398
398
  if (data.inputs?.length || hashedContinuousDeps.length) {
Binary file