nx 17.2.0-beta.12 → 17.2.0-beta.14
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/bin/post-install.js +3 -1
- package/package.json +12 -12
- package/src/command-line/graph/graph.d.ts +1 -1
- package/src/command-line/graph/graph.js +58 -25
- package/src/command-line/release/changelog.js +19 -2
- package/src/command-line/release/config/config.d.ts +4 -4
- package/src/command-line/release/config/config.js +36 -15
- package/src/command-line/release/config/filter-release-groups.js +4 -3
- package/src/command-line/show/command-object.d.ts +1 -0
- package/src/command-line/show/command-object.js +11 -0
- package/src/command-line/show/show.js +9 -0
- package/src/config/nx-json.d.ts +6 -1
- package/src/core/graph/3rdpartylicenses.txt +76 -26
- package/src/core/graph/environment.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/polyfills.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +5 -1
- package/src/daemon/client/client.js +9 -4
- package/src/daemon/server/handle-request-project-graph.js +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +11 -15
- package/src/daemon/server/project-graph-incremental-recomputation.js +9 -6
- package/src/daemon/server/shutdown-utils.js +1 -1
- package/src/daemon/socket-utils.d.ts +1 -1
- package/src/daemon/socket-utils.js +2 -2
- package/src/project-graph/project-graph.d.ts +11 -1
- package/src/project-graph/project-graph.js +18 -12
- package/src/utils/source-maps.d.ts +0 -1
- package/src/utils/source-maps.js +0 -10
package/bin/post-install.js
CHANGED
|
@@ -21,7 +21,9 @@ const workspace_context_1 = require("../src/utils/workspace-context");
|
|
|
21
21
|
await client_1.daemonClient.stop();
|
|
22
22
|
}
|
|
23
23
|
catch (e) { }
|
|
24
|
-
const tasks = [
|
|
24
|
+
const tasks = [
|
|
25
|
+
(0, project_graph_1.buildProjectGraphAndSourceMapsWithoutDaemon)(),
|
|
26
|
+
];
|
|
25
27
|
if ((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())) {
|
|
26
28
|
tasks.push((0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)()));
|
|
27
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "17.2.0-beta.
|
|
3
|
+
"version": "17.2.0-beta.14",
|
|
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": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"yargs": "^17.6.2",
|
|
67
67
|
"yargs-parser": "21.1.1",
|
|
68
68
|
"node-machine-id": "1.1.12",
|
|
69
|
-
"@nrwl/tao": "17.2.0-beta.
|
|
69
|
+
"@nrwl/tao": "17.2.0-beta.14"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@swc-node/register": "^1.6.7",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"optionalDependencies": {
|
|
84
|
-
"@nx/nx-darwin-x64": "17.2.0-beta.
|
|
85
|
-
"@nx/nx-darwin-arm64": "17.2.0-beta.
|
|
86
|
-
"@nx/nx-linux-x64-gnu": "17.2.0-beta.
|
|
87
|
-
"@nx/nx-linux-x64-musl": "17.2.0-beta.
|
|
88
|
-
"@nx/nx-win32-x64-msvc": "17.2.0-beta.
|
|
89
|
-
"@nx/nx-linux-arm64-gnu": "17.2.0-beta.
|
|
90
|
-
"@nx/nx-linux-arm64-musl": "17.2.0-beta.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "17.2.0-beta.
|
|
92
|
-
"@nx/nx-win32-arm64-msvc": "17.2.0-beta.
|
|
93
|
-
"@nx/nx-freebsd-x64": "17.2.0-beta.
|
|
84
|
+
"@nx/nx-darwin-x64": "17.2.0-beta.14",
|
|
85
|
+
"@nx/nx-darwin-arm64": "17.2.0-beta.14",
|
|
86
|
+
"@nx/nx-linux-x64-gnu": "17.2.0-beta.14",
|
|
87
|
+
"@nx/nx-linux-x64-musl": "17.2.0-beta.14",
|
|
88
|
+
"@nx/nx-win32-x64-msvc": "17.2.0-beta.14",
|
|
89
|
+
"@nx/nx-linux-arm64-gnu": "17.2.0-beta.14",
|
|
90
|
+
"@nx/nx-linux-arm64-musl": "17.2.0-beta.14",
|
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "17.2.0-beta.14",
|
|
92
|
+
"@nx/nx-win32-arm64-msvc": "17.2.0-beta.14",
|
|
93
|
+
"@nx/nx-freebsd-x64": "17.2.0-beta.14"
|
|
94
94
|
},
|
|
95
95
|
"nx-migrations": {
|
|
96
96
|
"migrations": "./migrations.json",
|
|
@@ -43,7 +43,7 @@ const mimeType = {
|
|
|
43
43
|
'.eot': 'appliaction/vnd.ms-fontobject',
|
|
44
44
|
'.ttf': 'aplication/font-sfnt',
|
|
45
45
|
};
|
|
46
|
-
function buildEnvironmentJs(exclude, watchMode, localMode, depGraphClientResponse, taskGraphClientResponse, expandedTaskInputsReponse) {
|
|
46
|
+
function buildEnvironmentJs(exclude, watchMode, localMode, depGraphClientResponse, taskGraphClientResponse, expandedTaskInputsReponse, sourceMapsResponse) {
|
|
47
47
|
let environmentJs = `window.exclude = ${JSON.stringify(exclude)};
|
|
48
48
|
window.watch = ${!!watchMode};
|
|
49
49
|
window.environment = 'release';
|
|
@@ -59,6 +59,7 @@ function buildEnvironmentJs(exclude, watchMode, localMode, depGraphClientRespons
|
|
|
59
59
|
projectGraphUrl: 'project-graph.json',
|
|
60
60
|
taskGraphUrl: 'task-graph.json',
|
|
61
61
|
taskInputsUrl: 'task-inputs.json',
|
|
62
|
+
sourceMapsUrl: 'source-maps.json'
|
|
62
63
|
}
|
|
63
64
|
],
|
|
64
65
|
defaultWorkspaceId: 'local',
|
|
@@ -70,11 +71,13 @@ function buildEnvironmentJs(exclude, watchMode, localMode, depGraphClientRespons
|
|
|
70
71
|
environmentJs += `window.taskGraphResponse = ${JSON.stringify(taskGraphClientResponse)};
|
|
71
72
|
`;
|
|
72
73
|
environmentJs += `window.expandedTaskInputsResponse = ${JSON.stringify(expandedTaskInputsReponse)};`;
|
|
74
|
+
environmentJs += `window.sourceMapsResponse = ${JSON.stringify(sourceMapsResponse)};`;
|
|
73
75
|
}
|
|
74
76
|
else {
|
|
75
77
|
environmentJs += `window.projectGraphResponse = null;`;
|
|
76
78
|
environmentJs += `window.taskGraphResponse = null;`;
|
|
77
79
|
environmentJs += `window.expandedTaskInputsResponse = null;`;
|
|
80
|
+
environmentJs += `window.sourceMapsResponse = null;`;
|
|
78
81
|
}
|
|
79
82
|
return environmentJs;
|
|
80
83
|
}
|
|
@@ -133,11 +136,28 @@ async function generateGraph(args, affectedProjects) {
|
|
|
133
136
|
],
|
|
134
137
|
});
|
|
135
138
|
}
|
|
139
|
+
if (args.view === 'project-details' && !args.focus) {
|
|
140
|
+
output_1.output.error({
|
|
141
|
+
title: `The project details view requires the --focus option.`,
|
|
142
|
+
});
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
if (args.view === 'project-details' && (args.targets || args.affected)) {
|
|
146
|
+
output_1.output.error({
|
|
147
|
+
title: `The project details view can only be used with the --focus option.`,
|
|
148
|
+
bodyLines: [
|
|
149
|
+
`You passed ${args.targets ? '--targets ' : ''}${args.affected ? '--affected ' : ''}`,
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
136
154
|
// TODO: Graph Client should support multiple targets
|
|
137
155
|
const target = Array.isArray(args.targets && args.targets.length >= 1)
|
|
138
156
|
? args.targets[0]
|
|
139
157
|
: args.targets;
|
|
140
|
-
const rawGraph = await (0, project_graph_1.
|
|
158
|
+
const { projectGraph: rawGraph, sourceMaps } = await (0, project_graph_1.createProjectGraphAndSourceMapsAsync)({
|
|
159
|
+
exitOnError: true,
|
|
160
|
+
});
|
|
141
161
|
let prunedGraph = (0, operators_1.pruneExternalNodes)(rawGraph);
|
|
142
162
|
const projects = Object.values(prunedGraph.nodes);
|
|
143
163
|
projects.sort((a, b) => {
|
|
@@ -196,10 +216,10 @@ async function generateGraph(args, affectedProjects) {
|
|
|
196
216
|
return isntHtml;
|
|
197
217
|
},
|
|
198
218
|
});
|
|
199
|
-
const
|
|
219
|
+
const { projectGraphClientResponse } = await createProjectGraphAndSourceMapClientResponse(affectedProjects);
|
|
200
220
|
const taskGraphClientResponse = await createTaskGraphClientResponse();
|
|
201
|
-
const taskInputsReponse = await createExpandedTaskInputResponse(taskGraphClientResponse,
|
|
202
|
-
const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve',
|
|
221
|
+
const taskInputsReponse = await createExpandedTaskInputResponse(taskGraphClientResponse, projectGraphClientResponse);
|
|
222
|
+
const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
|
|
203
223
|
html = html.replace(/src="/g, 'src="static/');
|
|
204
224
|
html = html.replace(/href="styles/g, 'href="static/styles');
|
|
205
225
|
html = html.replace('<base href="/" />', '');
|
|
@@ -279,10 +299,11 @@ async function startServer(html, environmentJs, host, port = 4211, watchForchang
|
|
|
279
299
|
if (watchForchanges) {
|
|
280
300
|
unregisterFileWatcher = await createFileWatcher();
|
|
281
301
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
302
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected);
|
|
303
|
+
currentProjectGraphClientResponse = projectGraphClientResponse;
|
|
304
|
+
currentProjectGraphClientResponse.focus = focus;
|
|
305
|
+
currentProjectGraphClientResponse.groupByFolder = groupByFolder;
|
|
306
|
+
currentProjectGraphClientResponse.exclude = exclude;
|
|
286
307
|
const app = http.createServer(async (req, res) => {
|
|
287
308
|
// parse URL
|
|
288
309
|
const parsedUrl = new node_url_1.URL(req.url, `http://${host}:${port}`);
|
|
@@ -293,7 +314,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForchang
|
|
|
293
314
|
const sanitizePath = (0, path_1.basename)(parsedUrl.pathname);
|
|
294
315
|
if (sanitizePath === 'project-graph.json') {
|
|
295
316
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
296
|
-
res.end(JSON.stringify(
|
|
317
|
+
res.end(JSON.stringify(currentProjectGraphClientResponse));
|
|
297
318
|
return;
|
|
298
319
|
}
|
|
299
320
|
if (sanitizePath === 'task-graph.json') {
|
|
@@ -311,9 +332,14 @@ async function startServer(html, environmentJs, host, port = 4211, watchForchang
|
|
|
311
332
|
perf_hooks_1.performance.measure('task input generation', 'task input generation:start', 'task input generation:end');
|
|
312
333
|
return;
|
|
313
334
|
}
|
|
335
|
+
if (sanitizePath === 'source-maps.json') {
|
|
336
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
337
|
+
res.end(JSON.stringify(currentSourceMapsClientResponse));
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
314
340
|
if (sanitizePath === 'currentHash') {
|
|
315
341
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
316
|
-
res.end(JSON.stringify({ hash:
|
|
342
|
+
res.end(JSON.stringify({ hash: currentProjectGraphClientResponse.hash }));
|
|
317
343
|
return;
|
|
318
344
|
}
|
|
319
345
|
if (sanitizePath === 'environment.js') {
|
|
@@ -353,7 +379,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForchang
|
|
|
353
379
|
});
|
|
354
380
|
});
|
|
355
381
|
}
|
|
356
|
-
let
|
|
382
|
+
let currentProjectGraphClientResponse = {
|
|
357
383
|
hash: null,
|
|
358
384
|
projects: [],
|
|
359
385
|
dependencies: {},
|
|
@@ -367,6 +393,7 @@ let currentDepGraphClientResponse = {
|
|
|
367
393
|
groupByFolder: false,
|
|
368
394
|
exclude: [],
|
|
369
395
|
};
|
|
396
|
+
let currentSourceMapsClientResponse = {};
|
|
370
397
|
function debounce(fn, time) {
|
|
371
398
|
let timeout;
|
|
372
399
|
return (...args) => {
|
|
@@ -387,10 +414,12 @@ function createFileWatcher() {
|
|
|
387
414
|
}
|
|
388
415
|
else if (changes !== null && changes.changedFiles.length > 0) {
|
|
389
416
|
output_1.output.note({ title: 'Recalculating project graph...' });
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
417
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse();
|
|
418
|
+
if (projectGraphClientResponse.hash !==
|
|
419
|
+
currentProjectGraphClientResponse.hash) {
|
|
392
420
|
output_1.output.note({ title: 'Graph changes updated.' });
|
|
393
|
-
|
|
421
|
+
currentProjectGraphClientResponse = projectGraphClientResponse;
|
|
422
|
+
currentSourceMapsClientResponse = sourceMapResponse;
|
|
394
423
|
}
|
|
395
424
|
else {
|
|
396
425
|
output_1.output.note({ title: 'No graph changes found.' });
|
|
@@ -398,9 +427,10 @@ function createFileWatcher() {
|
|
|
398
427
|
}
|
|
399
428
|
}, 500));
|
|
400
429
|
}
|
|
401
|
-
async function
|
|
430
|
+
async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
402
431
|
perf_hooks_1.performance.mark('project graph watch calculation:start');
|
|
403
|
-
|
|
432
|
+
const { projectGraph, sourceMaps } = await (0, project_graph_1.createProjectGraphAndSourceMapsAsync)({ exitOnError: true });
|
|
433
|
+
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
|
404
434
|
let fileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
|
|
405
435
|
perf_hooks_1.performance.mark('project graph watch calculation:end');
|
|
406
436
|
perf_hooks_1.performance.mark('project graph response generation:start');
|
|
@@ -414,13 +444,16 @@ async function createDepGraphClientResponse(affected = []) {
|
|
|
414
444
|
perf_hooks_1.performance.measure('project graph watch calculation', 'project graph watch calculation:start', 'project graph watch calculation:end');
|
|
415
445
|
perf_hooks_1.performance.measure('project graph response generation', 'project graph response generation:start', 'project graph response generation:end');
|
|
416
446
|
return {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
447
|
+
projectGraphClientResponse: {
|
|
448
|
+
...currentProjectGraphClientResponse,
|
|
449
|
+
hash,
|
|
450
|
+
layout,
|
|
451
|
+
projects,
|
|
452
|
+
dependencies,
|
|
453
|
+
affected,
|
|
454
|
+
fileMap,
|
|
455
|
+
},
|
|
456
|
+
sourceMapResponse: sourceMaps,
|
|
424
457
|
};
|
|
425
458
|
}
|
|
426
459
|
async function createTaskGraphClientResponse(pruneExternal = false) {
|
|
@@ -523,7 +556,7 @@ async function getExpandedTaskInputs(taskId) {
|
|
|
523
556
|
const allWorkspaceFiles = await (0, all_file_data_1.allFileData)();
|
|
524
557
|
const inputs = taskGraphResponse.plans[taskId];
|
|
525
558
|
if (inputs) {
|
|
526
|
-
return expandInputs(inputs,
|
|
559
|
+
return expandInputs(inputs, currentProjectGraphClientResponse.projects.find((p) => p.name === project), allWorkspaceFiles, currentProjectGraphClientResponse);
|
|
527
560
|
}
|
|
528
561
|
return {};
|
|
529
562
|
}
|
|
@@ -163,8 +163,13 @@ function resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredPro
|
|
|
163
163
|
async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTasks, commitMessageValues, gitTagValues) {
|
|
164
164
|
let latestCommit = toSHA;
|
|
165
165
|
const changes = tree.listChanges();
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
/**
|
|
167
|
+
* In the case where we are expecting changelog file updates, but there is nothing
|
|
168
|
+
* to flush from the tree, we exit early. This could happen we using conventional
|
|
169
|
+
* commits, for example.
|
|
170
|
+
*/
|
|
171
|
+
const changelogFilesEnabled = checkChangelogFilesEnabled(nxReleaseConfig);
|
|
172
|
+
if (changelogFilesEnabled && !changes.length) {
|
|
168
173
|
output_1.output.warn({
|
|
169
174
|
title: `No changes detected for changelogs`,
|
|
170
175
|
bodyLines: [
|
|
@@ -573,3 +578,15 @@ async function generateChangelogForProjects(tree, args, projectGraph, commits, p
|
|
|
573
578
|
printSummary();
|
|
574
579
|
}
|
|
575
580
|
}
|
|
581
|
+
function checkChangelogFilesEnabled(nxReleaseConfig) {
|
|
582
|
+
if (nxReleaseConfig.changelog.workspaceChangelog &&
|
|
583
|
+
nxReleaseConfig.changelog.workspaceChangelog.file) {
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
for (const releaseGroup of Object.values(nxReleaseConfig.groups)) {
|
|
587
|
+
if (releaseGroup.changelog && releaseGroup.changelog.file) {
|
|
588
|
+
return true;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return false;
|
|
592
|
+
}
|
|
@@ -30,7 +30,7 @@ type RemoveTrueFromProperties<T, K extends keyof T> = {
|
|
|
30
30
|
type RemoveTrueFromPropertiesOnEach<T, K extends keyof T[keyof T]> = {
|
|
31
31
|
[U in keyof T]: RemoveTrueFromProperties<T[U], K>;
|
|
32
32
|
};
|
|
33
|
-
export declare const
|
|
33
|
+
export declare const IMPLICIT_DEFAULT_RELEASE_GROUP = "__default__";
|
|
34
34
|
/**
|
|
35
35
|
* Our source of truth is a deeply required variant of the user-facing config interface, so that command
|
|
36
36
|
* implementations can be sure that properties will exist and do not need to repeat the same checks over
|
|
@@ -40,12 +40,12 @@ export declare const CATCH_ALL_RELEASE_GROUP = "__default__";
|
|
|
40
40
|
* it easier to work with (the user could be specifying a single string, and they can also use any valid matcher
|
|
41
41
|
* pattern such as directories and globs).
|
|
42
42
|
*/
|
|
43
|
-
export type NxReleaseConfig = DeepRequired<NxJsonConfiguration['release'] & {
|
|
43
|
+
export type NxReleaseConfig = Omit<DeepRequired<NxJsonConfiguration['release'] & {
|
|
44
44
|
groups: DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<NxJsonConfiguration['release']['groups']>, 'changelog'>>;
|
|
45
45
|
changelog: RemoveTrueFromProperties<DeepRequired<NxJsonConfiguration['release']['changelog']>, 'workspaceChangelog' | 'projectChangelogs'>;
|
|
46
|
-
}>;
|
|
46
|
+
}>, 'projects'>;
|
|
47
47
|
export interface CreateNxReleaseConfigError {
|
|
48
|
-
code: 'RELEASE_GROUP_MATCHES_NO_PROJECTS' | 'RELEASE_GROUP_RELEASE_TAG_PATTERN_VERSION_PLACEHOLDER_MISSING_OR_EXCESSIVE' | 'PROJECT_MATCHES_MULTIPLE_GROUPS' | 'PROJECTS_MISSING_TARGET';
|
|
48
|
+
code: 'PROJECTS_AND_GROUPS_DEFINED' | 'RELEASE_GROUP_MATCHES_NO_PROJECTS' | 'RELEASE_GROUP_RELEASE_TAG_PATTERN_VERSION_PLACEHOLDER_MISSING_OR_EXCESSIVE' | 'PROJECT_MATCHES_MULTIPLE_GROUPS' | 'PROJECTS_MISSING_TARGET';
|
|
49
49
|
data: Record<string, string | string[]>;
|
|
50
50
|
}
|
|
51
51
|
export declare function createNxReleaseConfig(projectGraph: ProjectGraph, userConfig?: NxJsonConfiguration['release'], requiredTargetName?: 'nx-release-publish'): Promise<{
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleNxReleaseConfigError = exports.createNxReleaseConfig = exports.
|
|
3
|
+
exports.handleNxReleaseConfigError = exports.createNxReleaseConfig = exports.IMPLICIT_DEFAULT_RELEASE_GROUP = void 0;
|
|
4
4
|
const devkit_exports_1 = require("../../../devkit-exports");
|
|
5
5
|
const find_matching_projects_1 = require("../../../utils/find-matching-projects");
|
|
6
6
|
const project_graph_utils_1 = require("../../../utils/project-graph-utils");
|
|
7
7
|
const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
|
|
8
|
-
exports.
|
|
8
|
+
exports.IMPLICIT_DEFAULT_RELEASE_GROUP = '__default__';
|
|
9
9
|
// Apply default configuration to any optional user configuration and handle known errors
|
|
10
10
|
async function createNxReleaseConfig(projectGraph, userConfig = {},
|
|
11
11
|
// Optionally ensure that all configured projects have implemented a certain target
|
|
12
12
|
requiredTargetName) {
|
|
13
|
+
if (userConfig.projects && userConfig.groups) {
|
|
14
|
+
return {
|
|
15
|
+
error: {
|
|
16
|
+
code: 'PROJECTS_AND_GROUPS_DEFINED',
|
|
17
|
+
data: {},
|
|
18
|
+
},
|
|
19
|
+
nxReleaseConfig: null,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
13
22
|
const gitDefaults = {
|
|
14
23
|
commit: false,
|
|
15
24
|
commitMessage: '',
|
|
@@ -106,28 +115,27 @@ requiredTargetName) {
|
|
|
106
115
|
// git configuration is not supported at the group level, only the root/command level
|
|
107
116
|
const rootVersionWithoutGit = { ...rootVersionConfig };
|
|
108
117
|
delete rootVersionWithoutGit.git;
|
|
109
|
-
const allProjects = (0, find_matching_projects_1.findMatchingProjects)(['*'], projectGraph.nodes).filter(
|
|
110
|
-
// only include libs by default when the user has no groups config,
|
|
111
|
-
// because the default implementation assumes npm js packages
|
|
112
|
-
// and these will usually be libs
|
|
113
|
-
(project) => projectGraph.nodes[project].type === 'lib');
|
|
114
118
|
const groups = userConfig.groups && Object.keys(userConfig.groups).length
|
|
115
119
|
? ensureProjectsConfigIsArray(userConfig.groups)
|
|
116
120
|
: /**
|
|
117
|
-
* No user specified release groups, so we treat all projects
|
|
118
|
-
* together in which
|
|
121
|
+
* No user specified release groups, so we treat all projects (or any any user-defined subset via the top level "projects" property)
|
|
122
|
+
* as being in one release group together in which the projects are released in lock step.
|
|
119
123
|
*/
|
|
120
124
|
{
|
|
121
|
-
[exports.
|
|
125
|
+
[exports.IMPLICIT_DEFAULT_RELEASE_GROUP]: {
|
|
122
126
|
projectsRelationship: GROUP_DEFAULTS.projectsRelationship,
|
|
123
|
-
projects:
|
|
127
|
+
projects: userConfig.projects
|
|
128
|
+
? // user-defined top level "projects" config takes priority if set
|
|
129
|
+
(0, find_matching_projects_1.findMatchingProjects)(ensureArray(userConfig.projects), projectGraph.nodes)
|
|
130
|
+
: // default to all library projects in the workspace
|
|
131
|
+
(0, find_matching_projects_1.findMatchingProjects)(['*'], projectGraph.nodes).filter((project) => projectGraph.nodes[project].type === 'lib'),
|
|
124
132
|
/**
|
|
125
133
|
* For properties which are overriding config at the root, we use the root level config as the
|
|
126
134
|
* default values to merge with so that the group that matches a specific project will always
|
|
127
135
|
* be the valid source of truth for that type of config.
|
|
128
136
|
*/
|
|
129
137
|
version: deepMergeDefaults([GROUP_DEFAULTS.version], rootVersionWithoutGit),
|
|
130
|
-
// If the user has set something custom for releaseTagPattern at the top level, respect it for the
|
|
138
|
+
// If the user has set something custom for releaseTagPattern at the top level, respect it for the implicit default group
|
|
131
139
|
releaseTagPattern: userConfig.releaseTagPattern || GROUP_DEFAULTS.releaseTagPattern,
|
|
132
140
|
// Directly inherit the root level config for projectChangelogs, if set
|
|
133
141
|
changelog: rootChangelogConfig.projectChangelogs || false,
|
|
@@ -241,6 +249,18 @@ function normalizeTrueToEmptyObject(value) {
|
|
|
241
249
|
}
|
|
242
250
|
async function handleNxReleaseConfigError(error) {
|
|
243
251
|
switch (error.code) {
|
|
252
|
+
case 'PROJECTS_AND_GROUPS_DEFINED':
|
|
253
|
+
{
|
|
254
|
+
const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)([
|
|
255
|
+
'release',
|
|
256
|
+
'projects',
|
|
257
|
+
]);
|
|
258
|
+
devkit_exports_1.output.error({
|
|
259
|
+
title: `"projects" is not valid when explicitly defining release groups, and everything should be expressed within "groups" in that case. If you are using "groups" then you should remove the "projects" property`,
|
|
260
|
+
bodyLines: [nxJsonMessage],
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
244
264
|
case 'RELEASE_GROUP_MATCHES_NO_PROJECTS':
|
|
245
265
|
{
|
|
246
266
|
const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)([
|
|
@@ -309,13 +329,14 @@ function ensureProjectsConfigIsArray(groups) {
|
|
|
309
329
|
for (const [groupName, groupConfig] of Object.entries(groups)) {
|
|
310
330
|
result[groupName] = {
|
|
311
331
|
...groupConfig,
|
|
312
|
-
projects:
|
|
313
|
-
? groupConfig.projects
|
|
314
|
-
: [groupConfig.projects],
|
|
332
|
+
projects: ensureArray(groupConfig.projects),
|
|
315
333
|
};
|
|
316
334
|
}
|
|
317
335
|
return result;
|
|
318
336
|
}
|
|
337
|
+
function ensureArray(value) {
|
|
338
|
+
return Array.isArray(value) ? value : [value];
|
|
339
|
+
}
|
|
319
340
|
function ensureProjectsHaveTarget(projects, projectGraph, requiredTargetName) {
|
|
320
341
|
const missingTargetProjects = projects.filter((project) => !(0, project_graph_utils_1.projectHasTarget)(projectGraph.nodes[project], requiredTargetName));
|
|
321
342
|
if (missingTargetProjects.length) {
|
|
@@ -75,9 +75,10 @@ function filterReleaseGroups(projectGraph, nxReleaseConfig, projectsFilter, grou
|
|
|
75
75
|
const releaseGroupsForFilteredProjects = Array.from(new Set(Array.from(filteredProjectToReleaseGroup.values())));
|
|
76
76
|
const releaseGroupsThatAreNotIndependent = releaseGroupsForFilteredProjects.filter((rg) => rg.projectsRelationship !== 'independent');
|
|
77
77
|
if (releaseGroupsThatAreNotIndependent.length) {
|
|
78
|
-
// Special handling for
|
|
78
|
+
// Special handling for IMPLICIT_DEFAULT_RELEASE_GROUP
|
|
79
79
|
if (releaseGroupsThatAreNotIndependent.length === 1 &&
|
|
80
|
-
releaseGroupsThatAreNotIndependent[0].name ===
|
|
80
|
+
releaseGroupsThatAreNotIndependent[0].name ===
|
|
81
|
+
config_1.IMPLICIT_DEFAULT_RELEASE_GROUP) {
|
|
81
82
|
return {
|
|
82
83
|
error: {
|
|
83
84
|
title: `In order to release specific projects independently with --projects those projects must be configured appropriately. For example, by setting \`"projectsRelationship": "independent"\` in your nx.json config.`,
|
|
@@ -100,7 +101,7 @@ function filterReleaseGroups(projectGraph, nxReleaseConfig, projectsFilter, grou
|
|
|
100
101
|
title: `Your filter "${projectsFilter}" matched the following projects:`,
|
|
101
102
|
bodyLines: matchingProjectsForFilter.map((p) => {
|
|
102
103
|
const releaseGroupForProject = filteredProjectToReleaseGroup.get(p);
|
|
103
|
-
if (releaseGroupForProject.name === config_1.
|
|
104
|
+
if (releaseGroupForProject.name === config_1.IMPLICIT_DEFAULT_RELEASE_GROUP) {
|
|
104
105
|
return `- ${p}`;
|
|
105
106
|
}
|
|
106
107
|
return `- ${p} (release group "${releaseGroupForProject.name}")`;
|
|
@@ -69,6 +69,17 @@ const showProjectCommand = {
|
|
|
69
69
|
description: 'Which project should be viewed?',
|
|
70
70
|
})
|
|
71
71
|
.default('json', true)
|
|
72
|
+
.option('web', {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
description: 'Show project details in the browser',
|
|
75
|
+
hidden: true,
|
|
76
|
+
})
|
|
77
|
+
.check((argv) => {
|
|
78
|
+
if (argv.web) {
|
|
79
|
+
argv.json = false;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
})
|
|
72
83
|
.example('$0 show project my-app', 'View project information for my-app in JSON format'),
|
|
73
84
|
handler: (args) => Promise.resolve().then(() => require('./show')).then((m) => m.showProjectHandler(args)),
|
|
74
85
|
};
|
|
@@ -10,6 +10,7 @@ const project_graph_1 = require("../../project-graph/project-graph");
|
|
|
10
10
|
const all_file_data_1 = require("../../utils/all-file-data");
|
|
11
11
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
|
12
12
|
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
|
13
|
+
const graph_1 = require("../graph/graph");
|
|
13
14
|
async function showProjectsHandler(args) {
|
|
14
15
|
let graph = await (0, project_graph_1.createProjectGraphAsync)();
|
|
15
16
|
const nxJson = (0, nx_json_1.readNxJson)();
|
|
@@ -70,6 +71,14 @@ async function showProjectHandler(args) {
|
|
|
70
71
|
if (args.json) {
|
|
71
72
|
console.log(JSON.stringify(node.data));
|
|
72
73
|
}
|
|
74
|
+
else if (args.web) {
|
|
75
|
+
await (0, graph_1.generateGraph)({
|
|
76
|
+
view: 'project-details',
|
|
77
|
+
focus: node.name,
|
|
78
|
+
watch: false,
|
|
79
|
+
open: true,
|
|
80
|
+
}, []);
|
|
81
|
+
}
|
|
73
82
|
else {
|
|
74
83
|
const chalk = require('chalk');
|
|
75
84
|
const logIfExists = (label, key) => {
|
package/src/config/nx-json.d.ts
CHANGED
|
@@ -116,7 +116,12 @@ export interface NxReleaseGitConfiguration {
|
|
|
116
116
|
*/
|
|
117
117
|
interface NxReleaseConfiguration {
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Shorthand for amending the projects which will be included in the implicit default release group (all projects by default).
|
|
120
|
+
* @note Only one of `projects` or `groups` can be specified, the cannot be used together.
|
|
121
|
+
*/
|
|
122
|
+
projects?: string[] | string;
|
|
123
|
+
/**
|
|
124
|
+
* @note When no projects or groups are configured at all (the default), all projects in the workspace are treated as
|
|
120
125
|
* if they were in a release group together with a fixed relationship.
|
|
121
126
|
*/
|
|
122
127
|
groups?: Record<string, // group name
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
@babel/runtime
|
|
2
|
-
MIT
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
-
a copy of this software and associated documentation files (the
|
|
9
|
-
"Software"), to deal in the Software without restriction, including
|
|
10
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
-
the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be
|
|
16
|
-
included in all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
20
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
21
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
22
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
23
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
24
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
|
-
|
|
26
|
-
|
|
27
1
|
@floating-ui/react
|
|
28
2
|
MIT
|
|
29
3
|
MIT License
|
|
@@ -212,6 +186,31 @@ SOFTWARE.
|
|
|
212
186
|
|
|
213
187
|
|
|
214
188
|
|
|
189
|
+
aria-hidden
|
|
190
|
+
MIT
|
|
191
|
+
MIT License
|
|
192
|
+
|
|
193
|
+
Copyright (c) 2017 Anton Korzunov
|
|
194
|
+
|
|
195
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
196
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
197
|
+
in the Software without restriction, including without limitation the rights
|
|
198
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
199
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
200
|
+
furnished to do so, subject to the following conditions:
|
|
201
|
+
|
|
202
|
+
The above copyright notice and this permission notice shall be included in all
|
|
203
|
+
copies or substantial portions of the Software.
|
|
204
|
+
|
|
205
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
206
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
207
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
208
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
209
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
210
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
211
|
+
SOFTWARE.
|
|
212
|
+
|
|
213
|
+
|
|
215
214
|
classnames
|
|
216
215
|
MIT
|
|
217
216
|
The MIT License (MIT)
|
|
@@ -590,6 +589,57 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
590
589
|
SOFTWARE.
|
|
591
590
|
|
|
592
591
|
|
|
592
|
+
regenerator-runtime
|
|
593
|
+
MIT
|
|
594
|
+
MIT License
|
|
595
|
+
|
|
596
|
+
Copyright (c) 2014-present, Facebook, Inc.
|
|
597
|
+
|
|
598
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
599
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
600
|
+
in the Software without restriction, including without limitation the rights
|
|
601
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
602
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
603
|
+
furnished to do so, subject to the following conditions:
|
|
604
|
+
|
|
605
|
+
The above copyright notice and this permission notice shall be included in all
|
|
606
|
+
copies or substantial portions of the Software.
|
|
607
|
+
|
|
608
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
609
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
610
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
611
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
612
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
613
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
614
|
+
SOFTWARE.
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
tabbable
|
|
618
|
+
MIT
|
|
619
|
+
The MIT License (MIT)
|
|
620
|
+
|
|
621
|
+
Copyright (c) 2015 David Clark
|
|
622
|
+
|
|
623
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
624
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
625
|
+
in the Software without restriction, including without limitation the rights
|
|
626
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
627
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
628
|
+
furnished to do so, subject to the following conditions:
|
|
629
|
+
|
|
630
|
+
The above copyright notice and this permission notice shall be included in all
|
|
631
|
+
copies or substantial portions of the Software.
|
|
632
|
+
|
|
633
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
634
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
635
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
636
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
637
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
638
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
639
|
+
SOFTWARE.
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
593
643
|
use-isomorphic-layout-effect
|
|
594
644
|
MIT
|
|
595
645
|
MIT License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.exclude=[],window.watch=!1,window.environment="release",window.useXstateInspect=!1,window.appConfig={showDebugger:!1,showExperimentalFeatures:!1,workspaces:[{id:"local",label:"local",projectGraphUrl:"assets/project-graphs/e2e.json",taskGraphUrl:"assets/task-graphs/e2e.json",taskInputsUrl:"assets/task-inputs/e2e.json"}],defaultWorkspaceId:"local"};
|
|
1
|
+
window.exclude=[],window.watch=!1,window.environment="release",window.useXstateInspect=!1,window.appConfig={showDebugger:!1,showExperimentalFeatures:!1,workspaces:[{id:"local",label:"local",projectGraphUrl:"assets/project-graphs/e2e.json",taskGraphUrl:"assets/task-graphs/e2e.json",taskInputsUrl:"assets/task-inputs/e2e.json",sourceMapsUrl:"assets/source-maps/e2e.json"}],defaultWorkspaceId:"local"};
|