nx 23.2.0-rc.2 → 23.3.0-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.
Files changed (31) hide show
  1. package/dist/release/changelog-renderer/index.d.ts +4 -0
  2. package/dist/release/changelog-renderer/index.js +17 -1
  3. package/dist/src/command-line/migrate/prompt-files.js +2 -9
  4. package/dist/src/command-line/release/changelog.js +3 -1
  5. package/dist/src/command-line/reset/reset.js +1 -3
  6. package/dist/src/core/graph/main.js +1 -1
  7. package/dist/src/daemon/client/daemon-environment.d.ts +10 -0
  8. package/dist/src/daemon/client/daemon-environment.js +44 -0
  9. package/dist/src/daemon/server/handle-client-env.js +24 -3
  10. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  11. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  12. package/dist/src/nx-cloud/update-manager.js +4 -3
  13. package/dist/src/plugins/js/lock-file/pruned-output.d.ts +10 -9
  14. package/dist/src/plugins/js/lock-file/pruned-output.js +37 -13
  15. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +16 -0
  16. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +59 -22
  17. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +3 -0
  18. package/dist/src/tasks-runner/forked-process-task-runner.js +15 -6
  19. package/dist/src/tasks-runner/init-tasks-runner.js +32 -2
  20. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -11
  21. package/dist/src/tasks-runner/running-tasks/batch-process.js +3 -0
  22. package/dist/src/tasks-runner/running-tasks/shared-running-task.d.ts +1 -0
  23. package/dist/src/tasks-runner/running-tasks/shared-running-task.js +12 -1
  24. package/dist/src/tasks-runner/task-orchestrator.d.ts +3 -0
  25. package/dist/src/tasks-runner/task-orchestrator.js +31 -3
  26. package/dist/src/utils/min-release-age/behavior/pnpm.js +17 -9
  27. package/dist/src/utils/package-json.js +13 -2
  28. package/dist/src/utils/params.js +1 -1
  29. package/dist/src/utils/path.d.ts +6 -0
  30. package/dist/src/utils/path.js +15 -0
  31. package/package.json +11 -11
@@ -106,5 +106,9 @@ export default class DefaultChangelogRenderer {
106
106
  protected groupChangesByScope(changes: ChangelogChange[]): Record<string, ChangelogChange[]>;
107
107
  protected extractBreakingChangeExplanation(message: string): string | null;
108
108
  private isBreakingChangeBoundary;
109
+ protected isAiAgentAuthor(author: {
110
+ name: string;
111
+ email: string;
112
+ }): boolean;
109
113
  protected formatName(name?: string): string;
110
114
  }
@@ -3,6 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const semver_1 = require("semver");
4
4
  // Stripped from breaking change explanations (e.g. bot/session markers).
5
5
  const HtmlCommentRegex = /<!--[\s\S]*?-->/g;
6
+ // Keyed on email: agent display names track model versions (e.g. "Claude Opus
7
+ // 5 (1M context)"), and a human contributor can share a name with an agent.
8
+ const AiAgentAuthorEmails = new Set([
9
+ 'noreply@anthropic.com',
10
+ 'claude@anthropic.com',
11
+ 'amp@ampcode.com',
12
+ 'cursoragent@cursor.com',
13
+ 'openhands@all-hands.dev',
14
+ 'opendevin@all-hands.dev',
15
+ ]);
16
+ // The Copilot coding agent's trailer is not always [bot]-suffixed.
17
+ const CopilotAuthorEmailRegex = /^(?:\d+\+)?copilot@users\.noreply\.github\.com$/;
6
18
  class DefaultChangelogRenderer {
7
19
  /**
8
20
  * A ChangelogRenderer class takes in the determined changes and other relevant metadata
@@ -212,7 +224,7 @@ class DefaultChangelogRenderer {
212
224
  }
213
225
  for (const author of change.authors) {
214
226
  const name = this.formatName(author.name);
215
- if (!name || name.includes('[bot]')) {
227
+ if (!name || name.includes('[bot]') || this.isAiAgentAuthor(author)) {
216
228
  continue;
217
229
  }
218
230
  if (!_authors.has(name)) {
@@ -371,6 +383,10 @@ class DefaultChangelogRenderer {
371
383
  // Git metadata delimiter following the body
372
384
  trimmed === '"');
373
385
  }
386
+ isAiAgentAuthor(author) {
387
+ const email = (author.email || '').trim().toLowerCase();
388
+ return (AiAgentAuthorEmails.has(email) || CopilotAuthorEmailRegex.test(email));
389
+ }
374
390
  formatName(name = '') {
375
391
  return name
376
392
  .split(' ')
@@ -44,15 +44,8 @@ async function resolvePromptFiles(packageName, packageVersion, migrations, migra
44
44
  ? resolvedPromptFiles
45
45
  : undefined;
46
46
  }
47
- function isPromptPathWithinMigrationsDir(migrationsDir, promptRelPath) {
48
- const rel = (0, path_1.relative)(migrationsDir, (0, path_1.join)(migrationsDir, promptRelPath));
49
- return !((0, path_1.isAbsolute)(promptRelPath) ||
50
- rel === '..' ||
51
- rel.startsWith(`..${path_1.sep}`) ||
52
- rel.startsWith(`..${path_1.posix.sep}`));
53
- }
54
47
  function assertPromptPathWithinMigrationsDir(migrationsDir, promptRelPath, packageName, packageVersion) {
55
- if (!isPromptPathWithinMigrationsDir(migrationsDir, promptRelPath)) {
48
+ if (!(0, path_2.isContainedRelativePath)(promptRelPath)) {
56
49
  throw new Error(`Invalid prompt path "${promptRelPath}" in package "${packageName}@${packageVersion}": prompt paths must be relative and resolve within the package's migrations directory.`);
57
50
  }
58
51
  }
@@ -77,7 +70,7 @@ exports.PromptResolutionError = PromptResolutionError;
77
70
  * directory and point at an existing file.
78
71
  */
79
72
  function resolvePrompt(promptPath, migrationsDir) {
80
- if (!isPromptPathWithinMigrationsDir(migrationsDir, promptPath)) {
73
+ if (!(0, path_2.isContainedRelativePath)(promptPath)) {
81
74
  throw new PromptResolutionError(promptPath, migrationsDir);
82
75
  }
83
76
  const resolvedPath = (0, path_1.join)(migrationsDir, promptPath);
@@ -380,7 +380,9 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
380
380
  }
381
381
  else {
382
382
  const groupCacheKey = `${releaseGroup.name}:fixed`;
383
- const fromSHA = await getCachedFromSHA(groupCacheKey, releaseGroup.releaseTag.pattern, {}, workspacePreid ?? projectsPreid?.[Object.keys(projectsPreid)[0]], releaseGroup.releaseTag.checkAllBranchesWhen, releaseGroup.releaseTag.requireSemver, releaseGroup.releaseTag.strictPreid);
383
+ const fromSHA = await getCachedFromSHA(groupCacheKey, releaseGroup.releaseTag.pattern, {
384
+ releaseGroupName: releaseGroup.name,
385
+ }, workspacePreid ?? projectsPreid?.[Object.keys(projectsPreid)[0]], releaseGroup.releaseTag.checkAllBranchesWhen, releaseGroup.releaseTag.requireSemver, releaseGroup.releaseTag.strictPreid);
384
386
  if (!fromSHA) {
385
387
  throw new Error(`Unable to determine the previous git tag. If this is the first release of your release group, use the --first-release option or set the "release.changelog.automaticFromRef" config property in nx.json to generate a changelog from the first commit. Otherwise, be sure to configure the "release.releaseTag.pattern" property in nx.json to match the structure of your repository's git tags.`);
386
388
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resetHandler = resetHandler;
4
4
  const node_fs_1 = require("node:fs");
5
- const node_path_1 = require("node:path");
6
5
  const client_1 = require("../../daemon/client/client");
7
6
  const tmp_dir_1 = require("../../daemon/tmp-dir");
8
7
  const cache_directory_1 = require("../../utils/cache-directory");
@@ -125,8 +124,7 @@ async function resetCloudClient() {
125
124
  }
126
125
  function removeInstalledNxCloudClient() {
127
126
  return incrementalBackoff(INCREMENTAL_BACKOFF_FIRST_DELAY, INCREMENTAL_BACKOFF_MAX_DURATION, () => {
128
- const cloudClientDir = (0, update_manager_1.getBundleInstallDefaultLocation)();
129
- (0, node_fs_1.rmSync)((0, node_path_1.join)(cloudClientDir, 'cloud'), { recursive: true, force: true });
127
+ (0, node_fs_1.rmSync)((0, update_manager_1.getBundleInstallDefaultLocation)(), { recursive: true, force: true });
130
128
  });
131
129
  }
132
130
  function cleanupCacheEntries() {