nx 22.1.0 → 22.2.0-canary.20251120-aa38b25
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0-canary.20251120-aa38b25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
6
6
|
"repository": {
|
|
@@ -83,16 +83,16 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"optionalDependencies": {
|
|
86
|
-
"@nx/nx-darwin-arm64": "22.
|
|
87
|
-
"@nx/nx-darwin-x64": "22.
|
|
88
|
-
"@nx/nx-freebsd-x64": "22.
|
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "22.
|
|
90
|
-
"@nx/nx-linux-arm64-gnu": "22.
|
|
91
|
-
"@nx/nx-linux-arm64-musl": "22.
|
|
92
|
-
"@nx/nx-linux-x64-gnu": "22.
|
|
93
|
-
"@nx/nx-linux-x64-musl": "22.
|
|
94
|
-
"@nx/nx-win32-arm64-msvc": "22.
|
|
95
|
-
"@nx/nx-win32-x64-msvc": "22.
|
|
86
|
+
"@nx/nx-darwin-arm64": "22.2.0-canary.20251120-aa38b25",
|
|
87
|
+
"@nx/nx-darwin-x64": "22.2.0-canary.20251120-aa38b25",
|
|
88
|
+
"@nx/nx-freebsd-x64": "22.2.0-canary.20251120-aa38b25",
|
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "22.2.0-canary.20251120-aa38b25",
|
|
90
|
+
"@nx/nx-linux-arm64-gnu": "22.2.0-canary.20251120-aa38b25",
|
|
91
|
+
"@nx/nx-linux-arm64-musl": "22.2.0-canary.20251120-aa38b25",
|
|
92
|
+
"@nx/nx-linux-x64-gnu": "22.2.0-canary.20251120-aa38b25",
|
|
93
|
+
"@nx/nx-linux-x64-musl": "22.2.0-canary.20251120-aa38b25",
|
|
94
|
+
"@nx/nx-win32-arm64-msvc": "22.2.0-canary.20251120-aa38b25",
|
|
95
|
+
"@nx/nx-win32-x64-msvc": "22.2.0-canary.20251120-aa38b25"
|
|
96
96
|
},
|
|
97
97
|
"nx-migrations": {
|
|
98
98
|
"migrations": "./migrations.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAA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OAAO,CAAC,IAAI,CAAC,CA4Tf;AAuvBD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
|
|
@@ -27,6 +27,7 @@ const transform_objects_1 = require("../../native/transform-objects");
|
|
|
27
27
|
const affected_1 = require("../affected/affected");
|
|
28
28
|
const nx_deps_cache_1 = require("../../project-graph/nx-deps-cache");
|
|
29
29
|
const task_hasher_1 = require("../../hasher/task-hasher");
|
|
30
|
+
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
|
30
31
|
const create_task_hasher_1 = require("../../hasher/create-task-hasher");
|
|
31
32
|
const error_types_1 = require("../../project-graph/error-types");
|
|
32
33
|
const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
|
|
@@ -203,23 +204,29 @@ async function generateGraph(args, affectedProjects) {
|
|
|
203
204
|
// and the operation might fail (i.e: in e2e tests), we fallback to empty array
|
|
204
205
|
affectedProjects = [];
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
let excludePatterns = [];
|
|
208
|
+
if (args.exclude && args.exclude.length > 0) {
|
|
209
|
+
try {
|
|
210
|
+
// Use findMatchingProjects to expand patterns (supports globs, tags, directories, etc.)
|
|
211
|
+
excludePatterns = (0, find_matching_projects_1.findMatchingProjects)(args.exclude, prunedGraph.nodes);
|
|
212
|
+
// If no projects matched any of the exclude patterns, show a warning
|
|
213
|
+
if (excludePatterns.length === 0) {
|
|
214
|
+
output_1.output.warn({
|
|
215
|
+
title: `No projects matched the following exclude patterns:`,
|
|
216
|
+
bodyLines: args.exclude,
|
|
217
|
+
});
|
|
211
218
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
214
221
|
output_1.output.error({
|
|
215
|
-
title: `
|
|
216
|
-
bodyLines:
|
|
222
|
+
title: `Invalid exclude pattern:`,
|
|
223
|
+
bodyLines: [e.message],
|
|
217
224
|
});
|
|
218
225
|
process.exit(1);
|
|
219
226
|
}
|
|
220
227
|
}
|
|
221
228
|
let html = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
|
|
222
|
-
prunedGraph = filterGraph(prunedGraph, args.focus || null,
|
|
229
|
+
prunedGraph = filterGraph(prunedGraph, args.focus || null, excludePatterns);
|
|
223
230
|
if (args.print || args.file === 'stdout') {
|
|
224
231
|
console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
|
|
225
232
|
await output_1.output.drain();
|
|
@@ -250,7 +257,7 @@ async function generateGraph(args, affectedProjects) {
|
|
|
250
257
|
? await createTaskGraphForTargetsAndProjects(args.targets, args.projects)
|
|
251
258
|
: await createTaskGraphClientResponse();
|
|
252
259
|
const taskInputsReponse = await createExpandedTaskInputResponse(taskGraphClientResponse, projectGraphClientResponse);
|
|
253
|
-
const environmentJs = buildEnvironmentJs(
|
|
260
|
+
const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
|
|
254
261
|
html = html.replace(/src="/g, 'src="static/');
|
|
255
262
|
html = html.replace(/href="styles/g, 'href="static/styles');
|
|
256
263
|
html = html.replace(/<base href="\/".*>/g, '');
|
|
@@ -281,11 +288,11 @@ async function generateGraph(args, affectedProjects) {
|
|
|
281
288
|
process.exit(0);
|
|
282
289
|
}
|
|
283
290
|
else {
|
|
284
|
-
const environmentJs = buildEnvironmentJs(
|
|
291
|
+
const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve');
|
|
285
292
|
let app;
|
|
286
293
|
let url;
|
|
287
294
|
try {
|
|
288
|
-
const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder,
|
|
295
|
+
const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, excludePatterns);
|
|
289
296
|
app = result.app;
|
|
290
297
|
url = result.url;
|
|
291
298
|
}
|
|
@@ -377,7 +384,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
|
377
384
|
if (watchForChanges && client_1.daemonClient.enabled()) {
|
|
378
385
|
unregisterFileWatcher = await createFileWatcher();
|
|
379
386
|
}
|
|
380
|
-
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected);
|
|
387
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected, focus, exclude);
|
|
381
388
|
currentProjectGraphClientResponse = projectGraphClientResponse;
|
|
382
389
|
currentProjectGraphClientResponse.focus = focus;
|
|
383
390
|
currentProjectGraphClientResponse.groupByFolder = groupByFolder;
|
|
@@ -534,7 +541,7 @@ function createFileWatcher() {
|
|
|
534
541
|
}
|
|
535
542
|
else if (changes !== null && changes.changedFiles.length > 0) {
|
|
536
543
|
output_1.output.note({ title: 'Recalculating project graph...' });
|
|
537
|
-
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse();
|
|
544
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse([], currentProjectGraphClientResponse.focus, currentProjectGraphClientResponse.exclude);
|
|
538
545
|
if (projectGraphClientResponse.hash !==
|
|
539
546
|
currentProjectGraphClientResponse.hash &&
|
|
540
547
|
sourceMapResponse) {
|
|
@@ -563,7 +570,7 @@ function createFileWatcher() {
|
|
|
563
570
|
}
|
|
564
571
|
}, 500));
|
|
565
572
|
}
|
|
566
|
-
async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
573
|
+
async function createProjectGraphAndSourceMapClientResponse(affected = [], focus = null, exclude = []) {
|
|
567
574
|
node_perf_hooks_1.performance.mark('project graph watch calculation:start');
|
|
568
575
|
let projectGraph;
|
|
569
576
|
let sourceMaps;
|
|
@@ -598,6 +605,8 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
|
598
605
|
}
|
|
599
606
|
}
|
|
600
607
|
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
|
608
|
+
// Apply focus and exclude filters
|
|
609
|
+
graph = filterGraph(graph, focus, exclude);
|
|
601
610
|
const fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap || {};
|
|
602
611
|
node_perf_hooks_1.performance.mark('project graph watch calculation:end');
|
|
603
612
|
node_perf_hooks_1.performance.mark('project graph response generation:start');
|