nx 23.2.0-rc.2 → 23.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/release/changelog-renderer/index.d.ts +4 -0
- package/dist/release/changelog-renderer/index.js +17 -1
- package/dist/src/command-line/migrate/prompt-files.js +2 -9
- package/dist/src/command-line/release/changelog.js +3 -1
- package/dist/src/command-line/report/report.d.ts +2 -0
- package/dist/src/command-line/report/report.js +28 -1
- package/dist/src/command-line/reset/reset.js +1 -3
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/daemon/client/daemon-environment.d.ts +10 -0
- package/dist/src/daemon/client/daemon-environment.js +44 -0
- package/dist/src/daemon/server/handle-client-env.js +24 -3
- 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.js +4 -3
- package/dist/src/plugins/js/lock-file/pruned-output.d.ts +10 -9
- package/dist/src/plugins/js/lock-file/pruned-output.js +37 -13
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +16 -0
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +59 -22
- package/dist/src/tasks-runner/forked-process-task-runner.d.ts +3 -0
- package/dist/src/tasks-runner/forked-process-task-runner.js +15 -6
- package/dist/src/tasks-runner/init-tasks-runner.js +32 -2
- package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -11
- package/dist/src/tasks-runner/running-tasks/batch-process.js +3 -0
- package/dist/src/tasks-runner/running-tasks/shared-running-task.d.ts +1 -0
- package/dist/src/tasks-runner/running-tasks/shared-running-task.js +12 -1
- package/dist/src/tasks-runner/task-orchestrator.d.ts +3 -0
- package/dist/src/tasks-runner/task-orchestrator.js +31 -3
- package/dist/src/utils/min-release-age/behavior/pnpm.js +17 -9
- package/dist/src/utils/package-json.js +13 -2
- package/dist/src/utils/params.js +1 -1
- package/dist/src/utils/path.d.ts +6 -0
- package/dist/src/utils/path.js +15 -0
- 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 (!
|
|
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 (!
|
|
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, {
|
|
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
|
}
|
|
@@ -13,6 +13,7 @@ export declare const patternsWeIgnoreInCommunityReport: Array<string | RegExp>;
|
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
15
|
export declare function reportHandler(): Promise<void>;
|
|
16
|
+
export declare function cacheSectionLines(cache: NonNullable<ReportData['cache']>): string[];
|
|
16
17
|
export interface ReportData {
|
|
17
18
|
pm: PackageManager;
|
|
18
19
|
pmVersion: string;
|
|
@@ -49,6 +50,7 @@ export interface ReportData {
|
|
|
49
50
|
cache: {
|
|
50
51
|
max: number;
|
|
51
52
|
used: number;
|
|
53
|
+
location: string;
|
|
52
54
|
} | null;
|
|
53
55
|
}
|
|
54
56
|
export declare function getReportData(): Promise<ReportData>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patternsWeIgnoreInCommunityReport = exports.packagesWeCareAbout = void 0;
|
|
4
4
|
exports.reportHandler = reportHandler;
|
|
5
|
+
exports.cacheSectionLines = cacheSectionLines;
|
|
5
6
|
exports.getReportData = getReportData;
|
|
6
7
|
exports.findMisalignedPackagesForPackage = findMisalignedPackagesForPackage;
|
|
7
8
|
exports.findInstalledPowerpackPlugins = findInstalledPowerpackPlugins;
|
|
@@ -11,6 +12,8 @@ exports.findInstalledPackagesWeCareAbout = findInstalledPackagesWeCareAbout;
|
|
|
11
12
|
const tslib_1 = require("tslib");
|
|
12
13
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
13
14
|
const output_1 = require("../../utils/output");
|
|
15
|
+
const path_1 = require("path");
|
|
16
|
+
const os_1 = require("os");
|
|
14
17
|
const package_manager_1 = require("../../utils/package-manager");
|
|
15
18
|
const fileutils_1 = require("../../utils/fileutils");
|
|
16
19
|
const package_json_1 = require("../../utils/package-json");
|
|
@@ -25,6 +28,7 @@ const operators_1 = require("../../project-graph/operators");
|
|
|
25
28
|
const versions_1 = require("../../utils/versions");
|
|
26
29
|
const nx_key_1 = require("../../utils/nx-key");
|
|
27
30
|
const cache_1 = require("../../tasks-runner/cache");
|
|
31
|
+
const cache_directory_1 = require("../../utils/cache-directory");
|
|
28
32
|
const client_1 = require("../../daemon/client/client");
|
|
29
33
|
const nx_package_group_1 = require("../../utils/nx-package-group");
|
|
30
34
|
const nxPackageJson = (0, fileutils_1.readJsonFile)(require.resolve('nx/package.json'));
|
|
@@ -140,7 +144,7 @@ async function reportHandler() {
|
|
|
140
144
|
}
|
|
141
145
|
if (cache) {
|
|
142
146
|
bodyLines.push(LINE_SEPARATOR);
|
|
143
|
-
bodyLines.push(
|
|
147
|
+
bodyLines.push(...cacheSectionLines(cache));
|
|
144
148
|
}
|
|
145
149
|
if (outOfSyncPackageGroup) {
|
|
146
150
|
bodyLines.push(LINE_SEPARATOR);
|
|
@@ -182,6 +186,28 @@ async function reportHandler() {
|
|
|
182
186
|
bodyLines,
|
|
183
187
|
});
|
|
184
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* The report is meant to be pasted into public issues, so the home directory
|
|
191
|
+
* is elided rather than printing the user's account name.
|
|
192
|
+
*/
|
|
193
|
+
function collapseHome(path) {
|
|
194
|
+
const home = (0, os_1.homedir)();
|
|
195
|
+
return path === home || path.startsWith(home + path_1.sep)
|
|
196
|
+
? `~${path.slice(home.length)}`
|
|
197
|
+
: path;
|
|
198
|
+
}
|
|
199
|
+
function cacheSectionLines(cache) {
|
|
200
|
+
const unlimited = cache.max === 0;
|
|
201
|
+
const max = unlimited ? '∞' : (0, cache_1.formatCacheSize)(cache.max);
|
|
202
|
+
const share = unlimited
|
|
203
|
+
? ''
|
|
204
|
+
: ` (${((cache.used / cache.max) * 100).toFixed(1)}%)`;
|
|
205
|
+
return [
|
|
206
|
+
'Cache',
|
|
207
|
+
`- Usage: ${(0, cache_1.formatCacheSize)(cache.used)} / ${max}${share}`,
|
|
208
|
+
`- Location: ${collapseHome(cache.location)}`,
|
|
209
|
+
];
|
|
210
|
+
}
|
|
185
211
|
function findDependencyChain(graph, targetNode) {
|
|
186
212
|
const reversedGraph = (0, operators_1.reverse)(graph);
|
|
187
213
|
// BFS to find shortest path to root dependency
|
|
@@ -266,6 +292,7 @@ async function getReportData() {
|
|
|
266
292
|
? {
|
|
267
293
|
max: (0, cache_1.resolveMaxCacheSize)(nxJson),
|
|
268
294
|
used: new cache_1.DbCache({ nxCloudRemoteCache: null }).getUsedCacheSpace(),
|
|
295
|
+
location: cache_directory_1.cacheDir,
|
|
269
296
|
}
|
|
270
297
|
: null;
|
|
271
298
|
return {
|
|
@@ -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
|
-
|
|
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() {
|