@ohos-ports/nx 23.2.0-beta.4 → 23.2.1-beta.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/bin/nx.js +7 -7
- package/dist/bin/post-install.js +2 -4
- package/dist/release/changelog-renderer/index.d.ts +4 -0
- package/dist/release/changelog-renderer/index.js +17 -1
- package/dist/src/command-line/add/add.js +1 -1
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +1 -1
- package/dist/src/command-line/init/init-v2.js +1 -1
- package/dist/src/command-line/migrate/migrate.js +9 -9
- package/dist/src/command-line/migrate/prompt-files.js +2 -9
- package/dist/src/command-line/migrate/run/worker.js +1 -1
- package/dist/src/command-line/release/changelog.js +3 -1
- package/dist/src/command-line/repair/repair.js +1 -1
- package/dist/src/command-line/report/report.d.ts +2 -0
- package/dist/src/command-line/report/report.js +29 -2
- package/dist/src/command-line/reset/reset.js +1 -3
- package/dist/src/command-line/run/run.js +1 -1
- package/dist/src/config/nx-json.d.ts +2 -2
- 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/daemon/server/handle-configure-ai-agents.js +2 -2
- package/dist/src/daemon/server/nx-console-operations.js +2 -2
- package/dist/src/daemon/server/shutdown-utils.js +1 -1
- package/dist/src/native/assert-supported-platform.js +1 -2
- package/dist/src/native/index.js +2 -6
- 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/in-process-loader.js +0 -9
- package/dist/src/project-graph/plugins/isolation/enabled.js +1 -8
- 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/installed-nx-version.js +1 -3
- package/dist/src/utils/min-release-age/behavior/pnpm.js +17 -9
- package/dist/src/utils/nx-package-group.js +1 -1
- package/dist/src/utils/owned-private-dir.js +4 -6
- package/dist/src/utils/package-json.js +13 -13
- 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/dist/src/utils/provenance.js +1 -1
- package/dist/src/utils/versions.js +1 -1
- package/dist/src/utils/workspace-root.js +1 -4
- package/package.json +20 -21
- package/dist/src/native/nx.openharmony-arm64.node +0 -0
package/dist/bin/nx.js
CHANGED
|
@@ -36,10 +36,10 @@ async function main() {
|
|
|
36
36
|
if (process.env.NX_COMPLETE) {
|
|
37
37
|
try {
|
|
38
38
|
perf_hooks_1.performance.mark('init-local');
|
|
39
|
-
const { tryValueCompletion } = await import('
|
|
39
|
+
const { tryValueCompletion } = await import('nx/src/command-line/completion/value-completions');
|
|
40
40
|
if (tryValueCompletion())
|
|
41
41
|
return;
|
|
42
|
-
const { tryCommandSurfaceCompletion } = await import('
|
|
42
|
+
const { tryCommandSurfaceCompletion } = await import('nx/src/command-line/completion/command-completions');
|
|
43
43
|
tryCommandSurfaceCompletion();
|
|
44
44
|
}
|
|
45
45
|
catch (e) {
|
|
@@ -91,7 +91,7 @@ async function main() {
|
|
|
91
91
|
// inherited via NX_ANALYTICS_SESSION_ID.
|
|
92
92
|
await initAnalytics();
|
|
93
93
|
}
|
|
94
|
-
(await import('
|
|
94
|
+
(await import('nx/src/command-line/nx-commands')).commandsObject.argv;
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
// polyfill rxjs observable to avoid issues with multiple version of Observable installed in node_modules
|
|
@@ -127,7 +127,7 @@ async function main() {
|
|
|
127
127
|
await initAnalytics();
|
|
128
128
|
// nx-cloud commands can run without local Nx installation
|
|
129
129
|
process.env.NX_DAEMON = 'false';
|
|
130
|
-
(await import('
|
|
130
|
+
(await import('nx/src/command-line/nx-commands')).commandsObject.argv;
|
|
131
131
|
}
|
|
132
132
|
else if (isLocalInstall) {
|
|
133
133
|
const { daemonClient } = await import('../src/daemon/client/client.js');
|
|
@@ -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 = [
|
|
@@ -295,7 +295,7 @@ function getLocalNxVersion(workspace) {
|
|
|
295
295
|
}
|
|
296
296
|
try {
|
|
297
297
|
const externalRequire = (0, module_1.createRequire)((0, path_1.join)(searchPath, 'package.json'));
|
|
298
|
-
const pkgJsonPath = externalRequire.resolve('
|
|
298
|
+
const pkgJsonPath = externalRequire.resolve('nx/package.json');
|
|
299
299
|
return require(pkgJsonPath).version;
|
|
300
300
|
}
|
|
301
301
|
catch { }
|
package/dist/bin/post-install.js
CHANGED
|
@@ -36,12 +36,10 @@ const postinstallTimeout = setTimeout(() => {
|
|
|
36
36
|
}
|
|
37
37
|
})();
|
|
38
38
|
function isMainNxPackage() {
|
|
39
|
-
|
|
40
|
-
// a bare `nx` specifier would fail when no `node_modules/nx` alias exists.
|
|
41
|
-
const mainNxPath = require.resolve('@ohos-ports/nx', {
|
|
39
|
+
const mainNxPath = require.resolve('nx', {
|
|
42
40
|
paths: [workspace_root_1.workspaceRoot],
|
|
43
41
|
});
|
|
44
|
-
const thisNxPath = require.resolve('
|
|
42
|
+
const thisNxPath = require.resolve('nx');
|
|
45
43
|
return mainNxPath === thisNxPath;
|
|
46
44
|
}
|
|
47
45
|
process.on('uncaughtException', (e) => {
|
|
@@ -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(' ')
|
|
@@ -129,7 +129,7 @@ function parsePackageSpecifier(packageSpecifier) {
|
|
|
129
129
|
const version = packageSpecifier.substring(i + 1);
|
|
130
130
|
return [pkgName, version];
|
|
131
131
|
}
|
|
132
|
-
exports.coreNxPluginVersions = require(require.resolve('
|
|
132
|
+
exports.coreNxPluginVersions = require(require.resolve('nx/package.json'))['nx-migrations'].packageGroup.reduce((map, entry) => {
|
|
133
133
|
const packageName = typeof entry === 'string' ? entry : entry.package;
|
|
134
134
|
const version = typeof entry === 'string' ? versions_1.nxVersion : entry.version;
|
|
135
135
|
return map.set(packageName, version);
|
|
@@ -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();
|
|
@@ -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);
|
|
@@ -1061,7 +1061,7 @@ function createInstalledPackageVersionsResolver(root) {
|
|
|
1061
1061
|
(() => {
|
|
1062
1062
|
for (const req of nxRequires) {
|
|
1063
1063
|
try {
|
|
1064
|
-
const packageJsonPath = req.resolve('
|
|
1064
|
+
const packageJsonPath = req.resolve('nx/package.json');
|
|
1065
1065
|
if (packageJsonPath.startsWith(workspace_root_1.workspaceRoot)) {
|
|
1066
1066
|
return (0, fileutils_1.readJsonFile)(packageJsonPath).version;
|
|
1067
1067
|
}
|
|
@@ -1244,7 +1244,7 @@ async function downloadPackageMigrationsFromRegistry(packageName, packageVersion
|
|
|
1244
1244
|
const { dir, cleanup } = (0, package_manager_1.createTempNpmDirectory)();
|
|
1245
1245
|
let result;
|
|
1246
1246
|
try {
|
|
1247
|
-
const { tarballPath } = await (0, package_manager_1.packageRegistryPack)(dir, packageName, packageVersion,
|
|
1247
|
+
const { tarballPath } = await (0, package_manager_1.packageRegistryPack)(dir, packageName, packageVersion,
|
|
1248
1248
|
// packageVersion is exact and already resolved through the workspace
|
|
1249
1249
|
// package manager's min-release-age policy by the fetcher. In an npm
|
|
1250
1250
|
// workspace the pack gate IS that policy, so leave it enforcing; for
|
|
@@ -1478,7 +1478,7 @@ async function isMigratingToNewMajor(from, to) {
|
|
|
1478
1478
|
return (0, semver_1.major)(from) < (0, semver_1.major)(to);
|
|
1479
1479
|
}
|
|
1480
1480
|
function readNxVersion(packageJson, root) {
|
|
1481
|
-
return ((0, package_json_1.getDependencyVersionFromPackageJson)('
|
|
1481
|
+
return ((0, package_json_1.getDependencyVersionFromPackageJson)('nx', root, packageJson) ??
|
|
1482
1482
|
(0, package_json_1.getDependencyVersionFromPackageJson)('@nx/workspace', root, packageJson) ??
|
|
1483
1483
|
(0, package_json_1.getDependencyVersionFromPackageJson)('@nrwl/workspace', root, packageJson));
|
|
1484
1484
|
}
|
|
@@ -1890,7 +1890,7 @@ async function executeMigrations(root, migrations, isVerbose, shouldCreateCommit
|
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
else if ((0, migration_shape_1.isHybridMigration)(m)) {
|
|
1893
|
-
const { changes, nextSteps, agentContext, skipAgentic, logs, madeChanges, } = await (0, execute_migration_1.runNxOrAngularMigration)(root, m, isVerbose,
|
|
1893
|
+
const { changes, nextSteps, agentContext, skipAgentic, logs, madeChanges, } = await (0, execute_migration_1.runNxOrAngularMigration)(root, m, isVerbose,
|
|
1894
1894
|
/* captureGeneratorOutput: */ !!agenticRun, resolvedCollection);
|
|
1895
1895
|
migrationEmittedNextSteps.push(...nextSteps);
|
|
1896
1896
|
if (skipAgentic) {
|
|
@@ -1949,7 +1949,7 @@ async function executeMigrations(root, migrations, isVerbose, shouldCreateCommit
|
|
|
1949
1949
|
// Defer commit until validation succeeds; failed validation leaves
|
|
1950
1950
|
// changes uncommitted in the working tree for the user to review.
|
|
1951
1951
|
const validationRun = agenticRun && shouldRunValidation ? agenticRun : undefined;
|
|
1952
|
-
const { changes, nextSteps, agentContext, skipAgentic, logs, madeChanges, } = await (0, execute_migration_1.runNxOrAngularMigration)(root, m, isVerbose,
|
|
1952
|
+
const { changes, nextSteps, agentContext, skipAgentic, logs, madeChanges, } = await (0, execute_migration_1.runNxOrAngularMigration)(root, m, isVerbose,
|
|
1953
1953
|
/* captureGeneratorOutput: */ !!validationRun, resolvedCollection);
|
|
1954
1954
|
migrationEmittedNextSteps.push(...nextSteps);
|
|
1955
1955
|
// Whether a validation step was on the table at all. `skipAgentic`
|
|
@@ -2152,7 +2152,7 @@ async function runMigrations(root, opts, args, isVerbose, shouldCreateCommits, c
|
|
|
2152
2152
|
!(await (0, migrate_commits_1.confirmMigrationCommitsOnDefaultBranch)(root, 'running migrations'))) {
|
|
2153
2153
|
return;
|
|
2154
2154
|
}
|
|
2155
|
-
const { packageJson: orchestratorNxPackageJson } = (0, package_json_1.readModulePackageJson)('
|
|
2155
|
+
const { packageJson: orchestratorNxPackageJson } = (0, package_json_1.readModulePackageJson)('nx', (0, installation_directory_1.getNxRequirePaths)(root));
|
|
2156
2156
|
const { runOrchestratorInit } = require('./run');
|
|
2157
2157
|
return await runOrchestratorInit({
|
|
2158
2158
|
root,
|
|
@@ -2215,7 +2215,7 @@ async function runMigrations(root, opts, args, isVerbose, shouldCreateCommits, c
|
|
|
2215
2215
|
}
|
|
2216
2216
|
if (agentic.kind === 'enabled') {
|
|
2217
2217
|
const { applyAgenticHandoffGitignoreFallback } = require('./agentic/handoff-gitignore');
|
|
2218
|
-
const { packageJson: nxPackageJson } = (0, package_json_1.readModulePackageJson)('
|
|
2218
|
+
const { packageJson: nxPackageJson } = (0, package_json_1.readModulePackageJson)('nx', (0, installation_directory_1.getNxRequirePaths)(root));
|
|
2219
2219
|
await applyAgenticHandoffGitignoreFallback({
|
|
2220
2220
|
migrations,
|
|
2221
2221
|
installedNxVersion: nxPackageJson.version,
|
|
@@ -2472,7 +2472,7 @@ function readLocalNxVersion(root) {
|
|
|
2472
2472
|
exports: {},
|
|
2473
2473
|
};
|
|
2474
2474
|
new Function('module', 'exports', 'require', '__dirname', '__filename', (0, fs_1.readFileSync)(pnpManifest, 'utf-8').replace(/^#!.*/, ''))(manifestModule, manifestModule.exports, require, root, pnpManifest);
|
|
2475
|
-
const packageJsonPath = manifestModule.exports.resolveRequest('
|
|
2475
|
+
const packageJsonPath = manifestModule.exports.resolveRequest('nx/package.json', (0, path_1.join)(root, 'package.json'));
|
|
2476
2476
|
if (packageJsonPath) {
|
|
2477
2477
|
// A resolving manifest names the install the yarn spawn runs, so
|
|
2478
2478
|
// every branch below returns rather than falling through to the
|
|
@@ -2651,7 +2651,7 @@ async function runMigration() {
|
|
|
2651
2651
|
cliVersionSpec,
|
|
2652
2652
|
fromEnvOverride: !!process.env.NX_MIGRATE_CLI_VERSION,
|
|
2653
2653
|
ownNxVersion: versions_1.nxVersion,
|
|
2654
|
-
resolveVersion: (spec) =>
|
|
2654
|
+
resolveVersion: (spec) =>
|
|
2655
2655
|
// A probe must not prompt, write pnpm excludes, or install; a
|
|
2656
2656
|
// minimum-release-age violation surfaces as a rejection and
|
|
2657
2657
|
// routes local.
|
|
@@ -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);
|
|
@@ -539,7 +539,7 @@ function buildOutcome(changes, nextSteps, description, root) {
|
|
|
539
539
|
// imports both statically.
|
|
540
540
|
async function prepareAgenticRun(root, migration, agentic, effectiveCreateCommits, commitPrefix) {
|
|
541
541
|
const { applyAgenticHandoffGitignoreFallback } = require('../agentic/handoff-gitignore');
|
|
542
|
-
const { packageJson: nxPackageJson } = (0, package_json_1.readModulePackageJson)('
|
|
542
|
+
const { packageJson: nxPackageJson } = (0, package_json_1.readModulePackageJson)('nx', (0, installation_directory_1.getNxRequirePaths)(root));
|
|
543
543
|
await applyAgenticHandoffGitignoreFallback({
|
|
544
544
|
migrations: [migration],
|
|
545
545
|
installedNxVersion: nxPackageJson.version,
|
|
@@ -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
|
}
|
|
@@ -6,7 +6,7 @@ const migrate_1 = require("../migrate/migrate");
|
|
|
6
6
|
const output_1 = require("../../utils/output");
|
|
7
7
|
async function repair(args, extraMigrations = []) {
|
|
8
8
|
return (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
|
9
|
-
const migrationsJson = require(require.resolve('
|
|
9
|
+
const migrationsJson = require(require.resolve('nx/migrations.json'));
|
|
10
10
|
const nxMigrations = Object.entries(migrationsJson.generators).reduce((agg, [name, migration]) => {
|
|
11
11
|
const skip = migration['x-repair-skip'];
|
|
12
12
|
if (!skip) {
|
|
@@ -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,9 +28,10 @@ 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
|
-
const nxPackageJson = (0, fileutils_1.readJsonFile)(require.resolve('
|
|
34
|
+
const nxPackageJson = (0, fileutils_1.readJsonFile)(require.resolve('nx/package.json'));
|
|
31
35
|
exports.packagesWeCareAbout = [
|
|
32
36
|
'lerna',
|
|
33
37
|
...(0, nx_package_group_1.readNxPackageGroup)(),
|
|
@@ -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() {
|
|
@@ -56,7 +56,7 @@ async function printTargetRunHelpInternal({ project, target }, root, projectsCon
|
|
|
56
56
|
plugin: nodeModule,
|
|
57
57
|
entity: executor,
|
|
58
58
|
});
|
|
59
|
-
if (
|
|
59
|
+
if (nodeModule === 'nx' &&
|
|
60
60
|
executor === 'run-commands' &&
|
|
61
61
|
targetConfig.options.command) {
|
|
62
62
|
const command = targetConfig.options.command.split(' ')[0];
|
|
@@ -357,7 +357,7 @@ export interface NxReleaseChangelogConfiguration {
|
|
|
357
357
|
* If configuring using a custom `ReleaseClient` via the programmatic API, you can either provide a path or directly
|
|
358
358
|
* provide the implementation class itself.
|
|
359
359
|
*
|
|
360
|
-
* By default, the renderer is set to the DefaultChangelogRenderer implementation from "
|
|
360
|
+
* By default, the renderer is set to the DefaultChangelogRenderer implementation from "nx/release/changelog-renderer",
|
|
361
361
|
* which nx provides out of the box.
|
|
362
362
|
*/
|
|
363
363
|
renderer?: string | typeof ChangelogRenderer;
|
|
@@ -409,7 +409,7 @@ export interface NxReleaseConventionalCommitsConfiguration {
|
|
|
409
409
|
* If not set, this will default to 'true'
|
|
410
410
|
*/
|
|
411
411
|
useCommitScope?: boolean;
|
|
412
|
-
types?: Record<string,
|
|
412
|
+
types?: Record<string,
|
|
413
413
|
/**
|
|
414
414
|
* A map of commit types to their configuration.
|
|
415
415
|
* If a type is set to 'true', then it will be enabled with the default 'semverBump' of 'patch' and will appear in the changelog.
|
|
@@ -62,3 +62,13 @@ export declare function getAppliedDaemonClientEnv(): {
|
|
|
62
62
|
* previous client is stale all the same.
|
|
63
63
|
*/
|
|
64
64
|
export declare function applyDaemonEnvFromClient(newEnv: NodeJS.ProcessEnv): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Yarn Berry creates a fresh BERRY_BIN_FOLDER for every invocation and puts it
|
|
67
|
+
* first on PATH. The wrappers inside are runtime state the daemon and workers
|
|
68
|
+
* must receive, but the folder's random name is not project-graph identity:
|
|
69
|
+
* two invocations whose environments differ only by it would compute the same
|
|
70
|
+
* graph. Strips the folder from PATH and pins the var to a sentinel so such
|
|
71
|
+
* environments compare equal. Returns a copy; never mutates runtime env.
|
|
72
|
+
*/
|
|
73
|
+
export declare function normalizeDaemonEnvironmentForGraph(env: NodeJS.ProcessEnv, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
|
|
74
|
+
export declare function getChangedEnvKeys(before: NodeJS.ProcessEnv, after: NodeJS.ProcessEnv): string[];
|
|
@@ -6,6 +6,8 @@ exports.getDaemonClientEnvGeneration = getDaemonClientEnvGeneration;
|
|
|
6
6
|
exports.getDaemonSpawnEnv = getDaemonSpawnEnv;
|
|
7
7
|
exports.getAppliedDaemonClientEnv = getAppliedDaemonClientEnv;
|
|
8
8
|
exports.applyDaemonEnvFromClient = applyDaemonEnvFromClient;
|
|
9
|
+
exports.normalizeDaemonEnvironmentForGraph = normalizeDaemonEnvironmentForGraph;
|
|
10
|
+
exports.getChangedEnvKeys = getChangedEnvKeys;
|
|
9
11
|
const file_hasher_1 = require("../../hasher/file-hasher");
|
|
10
12
|
const DAEMON_ENV_REQUIRED_SETTINGS = {
|
|
11
13
|
NX_PROJECT_GLOB_CACHE: 'false',
|
|
@@ -376,3 +378,45 @@ function applyDaemonEnvFromClient(newEnv) {
|
|
|
376
378
|
appliedClientEnv = { ...newEnv };
|
|
377
379
|
return [...changedKeys];
|
|
378
380
|
}
|
|
381
|
+
const BERRY_BIN_FOLDER_GRAPH_IDENTITY = '<YARN_BERRY_BIN_FOLDER>';
|
|
382
|
+
/**
|
|
383
|
+
* Yarn Berry creates a fresh BERRY_BIN_FOLDER for every invocation and puts it
|
|
384
|
+
* first on PATH. The wrappers inside are runtime state the daemon and workers
|
|
385
|
+
* must receive, but the folder's random name is not project-graph identity:
|
|
386
|
+
* two invocations whose environments differ only by it would compute the same
|
|
387
|
+
* graph. Strips the folder from PATH and pins the var to a sentinel so such
|
|
388
|
+
* environments compare equal. Returns a copy; never mutates runtime env.
|
|
389
|
+
*/
|
|
390
|
+
function normalizeDaemonEnvironmentForGraph(env, platform = process.platform) {
|
|
391
|
+
const normalized = { ...env };
|
|
392
|
+
const berryBinFolder = normalized.BERRY_BIN_FOLDER;
|
|
393
|
+
if (!berryBinFolder) {
|
|
394
|
+
return normalized;
|
|
395
|
+
}
|
|
396
|
+
const pathKey = Object.keys(normalized).find((key) => key.toUpperCase() === 'PATH');
|
|
397
|
+
if (pathKey && normalized[pathKey]) {
|
|
398
|
+
const pathDelimiter = platform === 'win32' ? ';' : ':';
|
|
399
|
+
const canonicalize = (value) => {
|
|
400
|
+
const withPlatformSeparators = platform === 'win32' ? value.replaceAll('/', '\\') : value;
|
|
401
|
+
return platform === 'win32'
|
|
402
|
+
? withPlatformSeparators.toLowerCase()
|
|
403
|
+
: withPlatformSeparators;
|
|
404
|
+
};
|
|
405
|
+
const canonicalBerryBinFolder = canonicalize(berryBinFolder);
|
|
406
|
+
normalized[pathKey] = normalized[pathKey]
|
|
407
|
+
.split(pathDelimiter)
|
|
408
|
+
.filter((entry) => canonicalize(entry) !== canonicalBerryBinFolder)
|
|
409
|
+
.join(pathDelimiter);
|
|
410
|
+
}
|
|
411
|
+
normalized.BERRY_BIN_FOLDER = BERRY_BIN_FOLDER_GRAPH_IDENTITY;
|
|
412
|
+
return normalized;
|
|
413
|
+
}
|
|
414
|
+
function getChangedEnvKeys(before, after) {
|
|
415
|
+
const changedKeys = [];
|
|
416
|
+
for (const key of new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
417
|
+
if (before[key] !== after[key]) {
|
|
418
|
+
changedKeys.push(key);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return changedKeys;
|
|
422
|
+
}
|
|
@@ -29,12 +29,30 @@ async function handleClientEnv(env) {
|
|
|
29
29
|
while (inFlightApply) {
|
|
30
30
|
await inFlightApply;
|
|
31
31
|
}
|
|
32
|
+
const graphEnvBefore = (0, daemon_environment_1.normalizeDaemonEnvironmentForGraph)(process.env);
|
|
33
|
+
const previousClientEnv = (0, daemon_environment_1.getAppliedDaemonClientEnv)()?.env;
|
|
32
34
|
const changedEnvKeys = (0, daemon_environment_1.applyDaemonEnvFromClient)(env);
|
|
33
35
|
if (changedEnvKeys.length === 0) {
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
// Runtime changes always reach the workers, but only changes that survive
|
|
39
|
+
// graph normalization (e.g. Yarn Berry's per-invocation BERRY_BIN_FOLDER
|
|
40
|
+
// does not) invalidate the computed graph.
|
|
41
|
+
const graphChangedKeys = new Set([
|
|
42
|
+
...(0, daemon_environment_1.getChangedEnvKeys)(graphEnvBefore, (0, daemon_environment_1.normalizeDaemonEnvironmentForGraph)(process.env)),
|
|
43
|
+
...(previousClientEnv
|
|
44
|
+
? (0, daemon_environment_1.getChangedEnvKeys)((0, daemon_environment_1.normalizeDaemonEnvironmentForGraph)(previousClientEnv), (0, daemon_environment_1.normalizeDaemonEnvironmentForGraph)(env))
|
|
45
|
+
: []),
|
|
46
|
+
]);
|
|
47
|
+
if (graphChangedKeys.size > 0) {
|
|
48
|
+
logger_1.serverLogger.log(`Graph recompute necessary due to env variable refresh. Changed keys: ${[
|
|
49
|
+
...graphChangedKeys,
|
|
50
|
+
].join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
logger_1.serverLogger.log(`Env variable refresh changed only runtime values (${changedEnvKeys.join(', ')}); graph identity is unchanged, keeping the cached graph.`);
|
|
54
|
+
}
|
|
55
|
+
const apply = applyEnvChange(env, graphChangedKeys.size > 0);
|
|
38
56
|
inFlightApply = apply;
|
|
39
57
|
try {
|
|
40
58
|
await apply;
|
|
@@ -45,8 +63,11 @@ async function handleClientEnv(env) {
|
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
65
|
}
|
|
48
|
-
async function applyEnvChange(env) {
|
|
66
|
+
async function applyEnvChange(env, invalidateGraph) {
|
|
49
67
|
await forwardEnvToPluginWorkers(env);
|
|
68
|
+
if (!invalidateGraph) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
50
71
|
// Discarding the cached graph makes the next request recompute under the
|
|
51
72
|
// new env, and chains any in-flight compute (started under the old env) to
|
|
52
73
|
// that successor.
|
|
@@ -71,11 +71,11 @@ async function computeAgentStatuses() {
|
|
|
71
71
|
let modulePath;
|
|
72
72
|
if (process.env.NX_USE_LOCAL === 'true') {
|
|
73
73
|
log('Using local implementation (NX_USE_LOCAL=true)');
|
|
74
|
-
modulePath = require.resolve('
|
|
74
|
+
modulePath = require.resolve('nx/src/ai/utils.js');
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
const tmpPath = await (0, latest_nx_1.getLatestNxTmpPath)();
|
|
78
|
-
modulePath = require.resolve('
|
|
78
|
+
modulePath = require.resolve('nx/src/ai/utils.js', {
|
|
79
79
|
paths: [tmpPath],
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -26,7 +26,7 @@ async function getNxConsoleStatus({ inner, } = {}) {
|
|
|
26
26
|
}
|
|
27
27
|
try {
|
|
28
28
|
const tmpPath = await (0, latest_nx_1.getLatestNxTmpPath)();
|
|
29
|
-
const modulePath = require.resolve('
|
|
29
|
+
const modulePath = require.resolve('nx/src/daemon/server/nx-console-operations.js', { paths: [tmpPath] });
|
|
30
30
|
const module = await (0, handle_import_1.handleImport)(modulePath);
|
|
31
31
|
const result = await module.getNxConsoleStatus({ inner: true });
|
|
32
32
|
log('Console status check completed, shouldPrompt:', result);
|
|
@@ -53,7 +53,7 @@ async function handleNxConsolePreferenceAndInstall({ preference, inner, }) {
|
|
|
53
53
|
}
|
|
54
54
|
try {
|
|
55
55
|
const tmpPath = await (0, latest_nx_1.getLatestNxTmpPath)();
|
|
56
|
-
const modulePath = require.resolve('
|
|
56
|
+
const modulePath = require.resolve('nx/src/daemon/server/nx-console-operations.js', { paths: [tmpPath] });
|
|
57
57
|
const module = await (0, handle_import_1.handleImport)(modulePath);
|
|
58
58
|
const result = await module.handleNxConsolePreferenceAndInstall({
|
|
59
59
|
preference,
|
|
@@ -38,7 +38,7 @@ async function startNewDaemonInBackground() {
|
|
|
38
38
|
// Resolve from workspace root to pick up the correct symlink target
|
|
39
39
|
let startScriptPath;
|
|
40
40
|
try {
|
|
41
|
-
startScriptPath = require.resolve('
|
|
41
|
+
startScriptPath = require.resolve('nx/src/daemon/server/start.js', {
|
|
42
42
|
paths: [workspace_root_1.workspaceRoot],
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -12,8 +12,7 @@ function assertSupportedPlatform() {
|
|
|
12
12
|
if (process.platform == 'win32' ||
|
|
13
13
|
process.platform == 'darwin' ||
|
|
14
14
|
process.platform == 'linux' ||
|
|
15
|
-
process.platform == 'freebsd'
|
|
16
|
-
process.platform == 'openharmony') {
|
|
15
|
+
process.platform == 'freebsd') {
|
|
17
16
|
title = 'Missing Platform Dependency';
|
|
18
17
|
bodyLines = [
|
|
19
18
|
`The Nx CLI could not find or load the native binary for your supported platform (${process.platform}-${process.arch}).`,
|
package/dist/src/native/index.js
CHANGED
|
@@ -35,14 +35,12 @@ const nxPackages = new Set([
|
|
|
35
35
|
'@nx/nx-darwin-x64',
|
|
36
36
|
'@nx/nx-darwin-arm64',
|
|
37
37
|
'@nx/nx-freebsd-x64',
|
|
38
|
-
'@nx/nx-openharmony-arm64',
|
|
39
|
-
'@nx/nx-openharmony-arm',
|
|
40
|
-
'@nx/nx-openharmony-x64',
|
|
41
38
|
'@nx/nx-linux-x64-musl',
|
|
42
39
|
'@nx/nx-linux-x64-gnu',
|
|
43
40
|
'@nx/nx-linux-arm64-musl',
|
|
44
41
|
'@nx/nx-linux-arm64-gnu',
|
|
45
42
|
'@nx/nx-linux-arm-gnueabihf',
|
|
43
|
+
'@nx/nx-openharmony-arm64',
|
|
46
44
|
]);
|
|
47
45
|
|
|
48
46
|
const localNodeFiles = [
|
|
@@ -55,14 +53,12 @@ const localNodeFiles = [
|
|
|
55
53
|
'nx.darwin-x64.node',
|
|
56
54
|
'nx.darwin-arm64.node',
|
|
57
55
|
'nx.freebsd-x64.node',
|
|
58
|
-
'nx.openharmony-arm64.node',
|
|
59
|
-
'nx.openharmony-arm.node',
|
|
60
|
-
'nx.openharmony-x64.node',
|
|
61
56
|
'nx.linux-x64-musl.node',
|
|
62
57
|
'nx.linux-x64-gnu.node',
|
|
63
58
|
'nx.linux-arm64-musl.node',
|
|
64
59
|
'nx.linux-arm64-gnu.node',
|
|
65
60
|
'nx.linux-arm-gnueabihf.node',
|
|
61
|
+
'nx.openharmony-arm64.node',
|
|
66
62
|
];
|
|
67
63
|
|
|
68
64
|
const originalLoad = Module._load;
|
|
Binary file
|