nx 23.2.0-beta.4 → 23.2.0-beta.5
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 +1 -0
- package/dist/src/command-line/affected/affected.js +1 -0
- package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +2 -2
- package/dist/src/command-line/init/init-v2.js +2 -2
- package/dist/src/command-line/migrate/agentic/definitions.js +2 -2
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +15 -19
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +19 -31
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +4 -6
- package/dist/src/command-line/migrate/agentic/handoff.js +9 -8
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +7 -12
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +7 -0
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +10 -0
- package/dist/src/command-line/migrate/agentic/select.d.ts +10 -2
- package/dist/src/command-line/migrate/agentic/select.js +10 -2
- package/dist/src/command-line/migrate/agentic/types.d.ts +17 -3
- package/dist/src/command-line/migrate/agentic/types.js +26 -0
- package/dist/src/command-line/migrate/command-object.d.ts +3 -0
- package/dist/src/command-line/migrate/command-object.js +6 -1
- package/dist/src/command-line/migrate/execute-migration.d.ts +14 -9
- package/dist/src/command-line/migrate/execute-migration.js +82 -18
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +7 -0
- package/dist/src/command-line/migrate/migrate-analytics.js +14 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +32 -8
- package/dist/src/command-line/migrate/migrate-commits.js +77 -9
- package/dist/src/command-line/migrate/migrate-config.d.ts +11 -12
- package/dist/src/command-line/migrate/migrate-config.js +14 -14
- package/dist/src/command-line/migrate/migrate-output.d.ts +45 -7
- package/dist/src/command-line/migrate/migrate-output.js +52 -8
- package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
- package/dist/src/command-line/migrate/migrate-ui-api.js +16 -7
- package/dist/src/command-line/migrate/migrate.d.ts +17 -68
- package/dist/src/command-line/migrate/migrate.js +385 -220
- package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
- package/dist/src/command-line/migrate/run/index.d.ts +2 -0
- package/dist/src/command-line/migrate/run/index.js +5 -0
- package/dist/src/command-line/migrate/run/util.d.ts +1 -0
- package/dist/src/command-line/migrate/run/util.js +16 -0
- package/dist/src/command-line/migrate/run/worker.d.ts +15 -0
- package/dist/src/command-line/migrate/run/worker.js +419 -0
- package/dist/src/command-line/migrate/run-migration-process.js +6 -5
- package/dist/src/command-line/migrate/sort-migrations.d.ts +16 -0
- package/dist/src/command-line/migrate/sort-migrations.js +32 -0
- package/dist/src/command-line/migrate/version-skew-guard.d.ts +59 -0
- package/dist/src/command-line/migrate/version-skew-guard.js +156 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.d.ts +2 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +16 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.d.ts +4 -0
- package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.js +13 -0
- package/dist/src/command-line/nx-commands.js +26 -24
- package/dist/src/command-line/release/changelog.js +5 -0
- package/dist/src/command-line/release/utils/git.js +1 -1
- package/dist/src/command-line/release/utils/release-graph.d.ts +1 -0
- package/dist/src/command-line/release/utils/release-graph.js +15 -3
- package/dist/src/command-line/release/version/version-actions.d.ts +8 -0
- package/dist/src/command-line/release/version/version-actions.js +8 -0
- package/dist/src/command-line/release/version.js +9 -5
- package/dist/src/config/misc-interfaces.d.ts +19 -7
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/daemon/server/latest-nx.js +5 -2
- package/dist/src/devkit-internals.d.ts +91 -2
- package/dist/src/devkit-internals.js +181 -3
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +5 -0
- package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +9 -2
- 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/utilities/get-cloud-options.js +5 -2
- package/dist/src/nx-cloud/utilities/onboarding.js +5 -2
- package/dist/src/nx-cloud/utilities/url-shorten.d.ts +1 -4
- package/dist/src/nx-cloud/utilities/url-shorten.js +9 -8
- package/dist/src/plugins/js/lock-file/project-graph-pruning.js +14 -8
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -0
- package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
- package/dist/src/project-graph/affected/affected-project-graph.js +2 -2
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +5 -2
- package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +12 -0
- package/dist/src/tasks-runner/life-cycles/performance-report.js +62 -3
- package/dist/src/tasks-runner/run-command.js +4 -0
- package/dist/src/utils/assert-workspace-validity.js +7 -2
- package/dist/src/utils/child-process.js +2 -0
- package/package.json +12 -12
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MEANINGFUL_OVERHEAD = exports.MIN_RECOMMENDATION_RUN_DURATION = void 0;
|
|
4
|
+
exports.prefetchRemoteCacheOnboardingUrl = prefetchRemoteCacheOnboardingUrl;
|
|
4
5
|
exports.recommendationToPayloadString = recommendationToPayloadString;
|
|
5
6
|
exports.buildRecommendations = buildRecommendations;
|
|
6
7
|
exports.formatReport = formatReport;
|
|
@@ -8,14 +9,72 @@ exports.formatReportMarkdown = formatReportMarkdown;
|
|
|
8
9
|
exports.buildExitSummaryPayload = buildExitSummaryPayload;
|
|
9
10
|
const native_1 = require("../../native");
|
|
10
11
|
const terminal_link_1 = require("../../utils/terminal-link");
|
|
12
|
+
const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
|
|
13
|
+
const url_shorten_1 = require("../../nx-cloud/utilities/url-shorten");
|
|
14
|
+
const get_cloud_options_1 = require("../../nx-cloud/utilities/get-cloud-options");
|
|
15
|
+
const git_utils_1 = require("../../utils/git-utils");
|
|
16
|
+
const logger_1 = require("../../utils/logger");
|
|
11
17
|
const NX_AGENTS_URL = 'https://nx.dev/ci/features/distribute-task-execution';
|
|
12
|
-
|
|
18
|
+
// Fallback for the remote-cache CTA when the short onboarding URL can't be
|
|
19
|
+
// fetched: the generic Cloud get-started page (still drives to onboarding).
|
|
20
|
+
const NX_CLOUD_GET_STARTED_URL = 'https://cloud.nx.app/get-started';
|
|
13
21
|
const NX_PERFORMANCE_URL = 'https://nx.dev/docs/concepts/ci-concepts/parallelization-distribution';
|
|
14
22
|
/** utm tag attributing report clicks back to it; the content names the CTA clicked. */
|
|
15
23
|
const utm = (content) => `?utm_source=nx-cli&utm_medium=cli&utm_campaign=performance-report&utm_content=${content}`;
|
|
16
24
|
const NX_PERFORMANCE_LINK = `${NX_PERFORMANCE_URL}${utm('parallelization')}`;
|
|
17
25
|
const NX_AGENTS_LINK = `${NX_AGENTS_URL}${utm('nx-agents')}`;
|
|
18
|
-
const NX_REMOTE_CACHE_LINK = `${
|
|
26
|
+
const NX_REMOTE_CACHE_LINK = `${NX_CLOUD_GET_STARTED_URL}${utm('remote-cache')}`;
|
|
27
|
+
// Defaults to the get-started link; a disconnected workspace gets a short Nx
|
|
28
|
+
// Cloud onboarding URL instead (see prefetchRemoteCacheOnboardingUrl).
|
|
29
|
+
let remoteCacheLink = NX_REMOTE_CACHE_LINK;
|
|
30
|
+
// Give up on the short URL after this long so a slow/hung Cloud API never
|
|
31
|
+
// lingers past the exit report. Covers two sequential round trips (features
|
|
32
|
+
// GET, onboarding POST); the 30s CTA floor leaves room. Timing out also aborts
|
|
33
|
+
// the request - Promise.race alone would leave the socket holding the event
|
|
34
|
+
// loop open, which strands programmatic callers that never process.exit.
|
|
35
|
+
const ONBOARDING_URL_TIMEOUT = 5000;
|
|
36
|
+
/**
|
|
37
|
+
* Point the remote-cache CTA at a short Nx Cloud onboarding URL for a
|
|
38
|
+
* disconnected GitHub workspace - the VCS flow where Cloud opens the nx.json PR.
|
|
39
|
+
* Non-GitHub remotes keep the get-started link (handles every provider) and skip
|
|
40
|
+
* the network entirely. Runs in CI too - terminal + job summary.
|
|
41
|
+
*
|
|
42
|
+
* Best-effort: the get-started link stays on failure/timeout. Fired at run start;
|
|
43
|
+
* the CTA needs a >30s run (MIN_RECOMMENDATION_RUN_DURATION), so the fetch
|
|
44
|
+
* always resolves first.
|
|
45
|
+
*/
|
|
46
|
+
async function prefetchRemoteCacheOnboardingUrl(nxJson) {
|
|
47
|
+
if ((0, nx_cloud_utils_1.isNxCloudDisabled)(nxJson) || (0, nx_cloud_utils_1.isNxCloudUsed)(nxJson)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if ((0, git_utils_1.getVcsRemoteInfo)()?.domain !== 'github.com') {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const abortController = new AbortController();
|
|
54
|
+
try {
|
|
55
|
+
const url = await Promise.race([
|
|
56
|
+
(0, url_shorten_1.createNxCloudOnboardingURL)('nx-cli-perf-report', undefined, undefined, false, false, undefined, abortController.signal),
|
|
57
|
+
new Promise((resolve) => {
|
|
58
|
+
// unref so the pending timer never keeps the CLI alive on its own.
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
abortController.abort();
|
|
61
|
+
resolve(null);
|
|
62
|
+
}, ONBOARDING_URL_TIMEOUT).unref();
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
// createNxCloudOnboardingURL never throws - on an unreachable API it returns a
|
|
66
|
+
// paste-a-token URL (accessToken=undefined). Only accept a real short link.
|
|
67
|
+
if (url?.startsWith(`${(0, get_cloud_options_1.getCloudUrl)()}/connect/`)) {
|
|
68
|
+
remoteCacheLink = url;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
logger_1.logger.verbose(`Keeping the get-started remote-cache link (${url === null ? 'onboarding URL timed out' : `got: ${url}`})`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
logger_1.logger.verbose(`Keeping the get-started remote-cache link: ${e}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
19
78
|
/**
|
|
20
79
|
* Whole-phrase CTA: the whole sentence is the link. The Rust TUI popup keeps no
|
|
21
80
|
* copy of this string; it gets the phrase + href from the exit payload's `links`.
|
|
@@ -176,7 +235,7 @@ const RECOMMENDATIONS = [
|
|
|
176
235
|
c.cacheableCount > 0 &&
|
|
177
236
|
!c.remoteCacheEnabled &&
|
|
178
237
|
c.cacheHits / c.cacheableCount <= LOW_CACHE_HIT_RATE,
|
|
179
|
-
build: () => [phraseLink(NX_REMOTE_CACHE_CTA,
|
|
238
|
+
build: () => [phraseLink(NX_REMOTE_CACHE_CTA, remoteCacheLink), `.`],
|
|
180
239
|
},
|
|
181
240
|
{
|
|
182
241
|
// Cache skipped: drop the flag to restore unchanged tasks instantly.
|
|
@@ -39,6 +39,7 @@ const store_run_information_life_cycle_1 = require("./life-cycles/store-run-info
|
|
|
39
39
|
const task_history_life_cycle_1 = require("./life-cycles/task-history-life-cycle");
|
|
40
40
|
const task_profiling_life_cycle_1 = require("./life-cycles/task-profiling-life-cycle");
|
|
41
41
|
const performance_life_cycle_1 = require("./life-cycles/performance-life-cycle");
|
|
42
|
+
const performance_report_1 = require("./life-cycles/performance-report");
|
|
42
43
|
const task_results_life_cycle_1 = require("./life-cycles/task-results-life-cycle");
|
|
43
44
|
const task_telemetry_life_cycle_1 = require("./life-cycles/task-telemetry-life-cycle");
|
|
44
45
|
const task_timings_life_cycle_1 = require("./life-cycles/task-timings-life-cycle");
|
|
@@ -80,6 +81,9 @@ async function getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, pr
|
|
|
80
81
|
if (tasks.length === 1 && !is_tui_enabled_1.ORIGINAL_TUI_ENV_VALUE) {
|
|
81
82
|
process.env.NX_TUI = 'false';
|
|
82
83
|
}
|
|
84
|
+
// Kick off in the background so the URL is ready by the exit report. A brief
|
|
85
|
+
// sync preamble (git remote + axios load) runs here; the network call does not.
|
|
86
|
+
(0, performance_report_1.prefetchRemoteCacheOnboardingUrl)(nxJson);
|
|
83
87
|
if ((0, is_tui_enabled_1.isTuiEnabled)()) {
|
|
84
88
|
const interceptedNxCloudLogs = [];
|
|
85
89
|
// Resolve where the Nx Cloud client bundle actually loads from so the
|
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.assertWorkspaceValidity = assertWorkspaceValidity;
|
|
4
4
|
const find_matching_projects_1 = require("./find-matching-projects");
|
|
5
5
|
const output_1 = require("./output");
|
|
6
|
-
|
|
6
|
+
// Import from the defining module, not the devkit-internals barrel: this file
|
|
7
|
+
// is on the project-graph construction path, and the barrel now eagerly
|
|
8
|
+
// re-exports the project-graph modules, which would create a require cycle back
|
|
9
|
+
// through build-project-graph. (Release modules cross the barrel as erased
|
|
10
|
+
// types only — see the note in packages/devkit/internal.ts.)
|
|
11
|
+
const error_types_1 = require("../project-graph/error-types");
|
|
7
12
|
function assertWorkspaceValidity(projects, nxJson) {
|
|
8
13
|
const projectNames = Object.keys(projects);
|
|
9
14
|
const projectGraphNodes = projectNames.reduce((graph, project) => {
|
|
@@ -65,7 +70,7 @@ function assertWorkspaceValidity(projects, nxJson) {
|
|
|
65
70
|
})
|
|
66
71
|
.join('\n\n');
|
|
67
72
|
}
|
|
68
|
-
throw new
|
|
73
|
+
throw new error_types_1.WorkspaceValidityError(message);
|
|
69
74
|
}
|
|
70
75
|
function detectAndSetInvalidProjectGlobValues(map, sourceName, desiredImplicitDeps, projectConfigurations, projects) {
|
|
71
76
|
const invalidProjectsOrGlobs = desiredImplicitDeps.filter((implicit) => {
|
|
@@ -13,6 +13,8 @@ const exit_codes_1 = require("./exit-codes");
|
|
|
13
13
|
function getRunNxBaseCommand(packageManagerCommand, cwd = process.cwd()) {
|
|
14
14
|
if ((0, fs_1.existsSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'))) {
|
|
15
15
|
if (!packageManagerCommand) {
|
|
16
|
+
// `readLocalNxVersion` (command-line/migrate/migrate.ts) mirrors this
|
|
17
|
+
// selector to predict which nx the spawn will run; keep the two in sync.
|
|
16
18
|
const pm = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot);
|
|
17
19
|
packageManagerCommand = (0, package_manager_1.getPackageManagerCommand)(pm, workspace_root_1.workspaceRoot);
|
|
18
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"balanced-match": "4.0.3",
|
|
66
66
|
"base64-js": "1.5.1",
|
|
67
67
|
"bl": "4.1.0",
|
|
68
|
-
"brace-expansion": "5.0.
|
|
68
|
+
"brace-expansion": "5.0.9",
|
|
69
69
|
"buffer": "5.7.1",
|
|
70
70
|
"bundle-name": "4.1.0",
|
|
71
71
|
"call-bind-apply-helpers": "1.0.2",
|
|
@@ -181,16 +181,16 @@
|
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
"optionalDependencies": {
|
|
184
|
-
"@nx/nx-darwin-arm64": "23.2.0-beta.
|
|
185
|
-
"@nx/nx-darwin-x64": "23.2.0-beta.
|
|
186
|
-
"@nx/nx-freebsd-x64": "23.2.0-beta.
|
|
187
|
-
"@nx/nx-linux-arm-gnueabihf": "23.2.0-beta.
|
|
188
|
-
"@nx/nx-linux-arm64-gnu": "23.2.0-beta.
|
|
189
|
-
"@nx/nx-linux-arm64-musl": "23.2.0-beta.
|
|
190
|
-
"@nx/nx-linux-x64-gnu": "23.2.0-beta.
|
|
191
|
-
"@nx/nx-linux-x64-musl": "23.2.0-beta.
|
|
192
|
-
"@nx/nx-win32-arm64-msvc": "23.2.0-beta.
|
|
193
|
-
"@nx/nx-win32-x64-msvc": "23.2.0-beta.
|
|
184
|
+
"@nx/nx-darwin-arm64": "23.2.0-beta.5",
|
|
185
|
+
"@nx/nx-darwin-x64": "23.2.0-beta.5",
|
|
186
|
+
"@nx/nx-freebsd-x64": "23.2.0-beta.5",
|
|
187
|
+
"@nx/nx-linux-arm-gnueabihf": "23.2.0-beta.5",
|
|
188
|
+
"@nx/nx-linux-arm64-gnu": "23.2.0-beta.5",
|
|
189
|
+
"@nx/nx-linux-arm64-musl": "23.2.0-beta.5",
|
|
190
|
+
"@nx/nx-linux-x64-gnu": "23.2.0-beta.5",
|
|
191
|
+
"@nx/nx-linux-x64-musl": "23.2.0-beta.5",
|
|
192
|
+
"@nx/nx-win32-arm64-msvc": "23.2.0-beta.5",
|
|
193
|
+
"@nx/nx-win32-x64-msvc": "23.2.0-beta.5"
|
|
194
194
|
},
|
|
195
195
|
"nx-migrations": {
|
|
196
196
|
"migrations": "./migrations.json",
|