nx 19.1.0-canary.20240508-fd78152 → 19.1.0-canary.20240509-8f705e3
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 +12 -12
- package/schemas/nx-schema.json +1 -1
- package/src/command-line/affected/affected.js +0 -16
- package/src/command-line/affected/command-object.d.ts +0 -10
- package/src/command-line/affected/command-object.js +1 -44
- package/src/command-line/graph/graph.js +0 -11
- package/src/command-line/migrate/command-object.js +2 -2
- package/src/command-line/nx-commands.js +0 -2
- package/src/command-line/release/changelog.js +3 -26
- package/src/command-line/release/config/config.js +45 -4
- package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -0
- package/src/command-line/release/utils/resolve-changelog-renderer.js +31 -0
- package/src/command-line/show/command-object.d.ts +2 -1
- package/src/command-line/show/command-object.js +10 -5
- package/src/command-line/show/project.js +1 -1
- package/src/config/project-graph.d.ts +2 -2
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +1 -1
- package/src/project-graph/project-graph-builder.d.ts +1 -1
- package/src/project-graph/project-graph-builder.js +1 -1
- package/src/tasks-runner/init-tasks-runner.js +1 -1
- package/src/tasks-runner/utils.d.ts +1 -1
- package/src/utils/async-iterator.d.ts +1 -1
- package/src/utils/async-iterator.js +3 -1
- package/src/utils/nx-plugin.deprecated.d.ts +5 -5
- package/src/command-line/affected/print-affected.d.ts +0 -11
- package/src/command-line/affected/print-affected.js +0 -108
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.1.0-canary.
|
3
|
+
"version": "19.1.0-canary.20240509-8f705e3",
|
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-parser": "21.1.1",
|
67
67
|
"node-machine-id": "1.1.12",
|
68
68
|
"ora": "5.3.0",
|
69
|
-
"@nrwl/tao": "19.1.0-canary.
|
69
|
+
"@nrwl/tao": "19.1.0-canary.20240509-8f705e3"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
72
|
"@swc-node/register": "^1.8.0",
|
@@ -81,16 +81,16 @@
|
|
81
81
|
}
|
82
82
|
},
|
83
83
|
"optionalDependencies": {
|
84
|
-
"@nx/nx-darwin-x64": "19.1.0-canary.
|
85
|
-
"@nx/nx-darwin-arm64": "19.1.0-canary.
|
86
|
-
"@nx/nx-linux-x64-gnu": "19.1.0-canary.
|
87
|
-
"@nx/nx-linux-x64-musl": "19.1.0-canary.
|
88
|
-
"@nx/nx-win32-x64-msvc": "19.1.0-canary.
|
89
|
-
"@nx/nx-linux-arm64-gnu": "19.1.0-canary.
|
90
|
-
"@nx/nx-linux-arm64-musl": "19.1.0-canary.
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.
|
92
|
-
"@nx/nx-win32-arm64-msvc": "19.1.0-canary.
|
93
|
-
"@nx/nx-freebsd-x64": "19.1.0-canary.
|
84
|
+
"@nx/nx-darwin-x64": "19.1.0-canary.20240509-8f705e3",
|
85
|
+
"@nx/nx-darwin-arm64": "19.1.0-canary.20240509-8f705e3",
|
86
|
+
"@nx/nx-linux-x64-gnu": "19.1.0-canary.20240509-8f705e3",
|
87
|
+
"@nx/nx-linux-x64-musl": "19.1.0-canary.20240509-8f705e3",
|
88
|
+
"@nx/nx-win32-x64-msvc": "19.1.0-canary.20240509-8f705e3",
|
89
|
+
"@nx/nx-linux-arm64-gnu": "19.1.0-canary.20240509-8f705e3",
|
90
|
+
"@nx/nx-linux-arm64-musl": "19.1.0-canary.20240509-8f705e3",
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.20240509-8f705e3",
|
92
|
+
"@nx/nx-win32-arm64-msvc": "19.1.0-canary.20240509-8f705e3",
|
93
|
+
"@nx/nx-freebsd-x64": "19.1.0-canary.20240509-8f705e3"
|
94
94
|
},
|
95
95
|
"nx-migrations": {
|
96
96
|
"migrations": "./migrations.json",
|
package/schemas/nx-schema.json
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
}
|
20
20
|
},
|
21
21
|
"additionalProperties": false,
|
22
|
-
"deprecated": "Use `defaultBase` instead. Support for setting `defaultBase` in `affected` will be removed in Nx
|
22
|
+
"deprecated": "Use `defaultBase` instead. Support for setting `defaultBase` in `affected` will be removed in Nx 20."
|
23
23
|
},
|
24
24
|
"defaultBase": {
|
25
25
|
"type": "string",
|
@@ -4,7 +4,6 @@ exports.getAffectedGraphNodes = exports.affected = void 0;
|
|
4
4
|
const file_utils_1 = require("../../project-graph/file-utils");
|
5
5
|
const run_command_1 = require("../../tasks-runner/run-command");
|
6
6
|
const output_1 = require("../../utils/output");
|
7
|
-
const print_affected_1 = require("./print-affected");
|
8
7
|
const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
|
9
8
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
10
9
|
const perf_hooks_1 = require("perf_hooks");
|
@@ -16,8 +15,6 @@ const workspace_configuration_check_1 = require("../../utils/workspace-configura
|
|
16
15
|
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
17
16
|
const graph_1 = require("../graph/graph");
|
18
17
|
const all_file_data_1 = require("../../utils/all-file-data");
|
19
|
-
const logger_1 = require("../../utils/logger");
|
20
|
-
const command_object_1 = require("./command-object");
|
21
18
|
async function affected(command, args, extraTargetDependencies = {}) {
|
22
19
|
perf_hooks_1.performance.mark('code-loading:end');
|
23
20
|
perf_hooks_1.performance.measure('code-loading', 'init-local', 'code-loading:end');
|
@@ -34,19 +31,6 @@ async function affected(command, args, extraTargetDependencies = {}) {
|
|
34
31
|
const projects = await getAffectedGraphNodes(nxArgs, projectGraph);
|
35
32
|
try {
|
36
33
|
switch (command) {
|
37
|
-
case 'graph':
|
38
|
-
logger_1.logger.warn([logger_1.NX_PREFIX, command_object_1.affectedGraphDeprecationMessage].join(' '));
|
39
|
-
const projectNames = projects.map((p) => p.name);
|
40
|
-
await (0, graph_1.generateGraph)(args, projectNames);
|
41
|
-
break;
|
42
|
-
case 'print-affected':
|
43
|
-
if (nxArgs.targets && nxArgs.targets.length > 0) {
|
44
|
-
await (0, print_affected_1.printAffected)(allProjectsWithTarget(projects, nxArgs), projectGraph, { nxJson }, nxArgs, overrides);
|
45
|
-
}
|
46
|
-
else {
|
47
|
-
await (0, print_affected_1.printAffected)(projects, projectGraph, { nxJson }, nxArgs, overrides);
|
48
|
-
}
|
49
|
-
break;
|
50
34
|
case 'affected': {
|
51
35
|
const projectsWithTarget = allProjectsWithTarget(projects, nxArgs);
|
52
36
|
if (nxArgs.graph) {
|
@@ -4,13 +4,3 @@ export declare const yargsAffectedTestCommand: CommandModule;
|
|
4
4
|
export declare const yargsAffectedBuildCommand: CommandModule;
|
5
5
|
export declare const yargsAffectedLintCommand: CommandModule;
|
6
6
|
export declare const yargsAffectedE2ECommand: CommandModule;
|
7
|
-
export declare const affectedGraphDeprecationMessage = "Use `nx graph --affected`, or `nx affected --graph` instead depending on which best suits your use case. The `affected:graph` command will be removed in Nx 19.";
|
8
|
-
/**
|
9
|
-
* @deprecated 'Use `nx graph --affected`, or` nx affected --graph` instead depending on which best suits your use case. The `affected:graph` command will be removed in Nx 19.'
|
10
|
-
*/
|
11
|
-
export declare const yargsAffectedGraphCommand: CommandModule;
|
12
|
-
export declare const printAffectedDeprecationMessage = "Use `nx show projects --affected`, `nx affected --graph -t build` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.";
|
13
|
-
/**
|
14
|
-
* @deprecated 'Use `nx show --affected`, `nx affected --graph` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.'
|
15
|
-
*/
|
16
|
-
export declare const yargsPrintAffectedCommand: CommandModule;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.yargsAffectedE2ECommand = exports.yargsAffectedLintCommand = exports.yargsAffectedBuildCommand = exports.yargsAffectedTestCommand = exports.yargsAffectedCommand = void 0;
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
5
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
6
|
const params_1 = require("../../utils/params");
|
@@ -75,46 +75,3 @@ exports.yargsAffectedE2ECommand = {
|
|
75
75
|
});
|
76
76
|
},
|
77
77
|
};
|
78
|
-
exports.affectedGraphDeprecationMessage = 'Use `nx graph --affected`, or `nx affected --graph` instead depending on which best suits your use case. The `affected:graph` command will be removed in Nx 19.';
|
79
|
-
/**
|
80
|
-
* @deprecated 'Use `nx graph --affected`, or` nx affected --graph` instead depending on which best suits your use case. The `affected:graph` command will be removed in Nx 19.'
|
81
|
-
*/
|
82
|
-
exports.yargsAffectedGraphCommand = {
|
83
|
-
command: 'affected:graph',
|
84
|
-
describe: 'Graph dependencies affected by changes',
|
85
|
-
aliases: ['affected:dep-graph'],
|
86
|
-
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withDepGraphOptions)(yargs)), 'affected:graph'),
|
87
|
-
handler: async (args) => {
|
88
|
-
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
89
|
-
return await (await Promise.resolve().then(() => require('./affected'))).affected('graph', {
|
90
|
-
...args,
|
91
|
-
});
|
92
|
-
});
|
93
|
-
},
|
94
|
-
deprecated: exports.affectedGraphDeprecationMessage,
|
95
|
-
};
|
96
|
-
exports.printAffectedDeprecationMessage = 'Use `nx show projects --affected`, `nx affected --graph -t build` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.';
|
97
|
-
/**
|
98
|
-
* @deprecated 'Use `nx show --affected`, `nx affected --graph` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.'
|
99
|
-
*/
|
100
|
-
exports.yargsPrintAffectedCommand = {
|
101
|
-
command: 'print-affected',
|
102
|
-
describe: 'Prints information about the projects and targets affected by changes',
|
103
|
-
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTargetAndConfigurationOption)(yargs, false)), 'print-affected')
|
104
|
-
.option('select', {
|
105
|
-
type: 'string',
|
106
|
-
describe: 'Select the subset of the returned json document (e.g., --select=projects)',
|
107
|
-
})
|
108
|
-
.option('type', {
|
109
|
-
type: 'string',
|
110
|
-
choices: ['app', 'lib'],
|
111
|
-
describe: 'Select the type of projects to be returned (e.g., --type=app)',
|
112
|
-
}),
|
113
|
-
handler: async (args) => {
|
114
|
-
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
115
|
-
await (await Promise.resolve().then(() => require('./affected'))).affected('print-affected', (0, shared_options_1.withOverrides)(args));
|
116
|
-
process.exit(0);
|
117
|
-
});
|
118
|
-
},
|
119
|
-
deprecated: exports.printAffectedDeprecationMessage,
|
120
|
-
};
|
@@ -267,18 +267,7 @@ async function generateGraph(args, affectedProjects) {
|
|
267
267
|
else if (ext === '.json') {
|
268
268
|
(0, fs_extra_1.ensureDirSync)((0, path_1.dirname)(fullFilePath));
|
269
269
|
const json = await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets);
|
270
|
-
json.affectedProjects = affectedProjects;
|
271
|
-
json.criticalPath = affectedProjects;
|
272
270
|
(0, fileutils_1.writeJsonFile)(fullFilePath, json);
|
273
|
-
output_1.output.warn({
|
274
|
-
title: 'JSON output contains deprecated fields:',
|
275
|
-
bodyLines: [
|
276
|
-
'- affectedProjects',
|
277
|
-
'- criticalPath',
|
278
|
-
'',
|
279
|
-
'These fields will be removed in Nx 19. If you need to see which projects were affected, use `nx show projects --affected`.',
|
280
|
-
],
|
281
|
-
});
|
282
271
|
output_1.output.success({
|
283
272
|
title: `JSON output created in ${fileFolderPath}`,
|
284
273
|
bodyLines: [fullFilePath],
|
@@ -128,8 +128,8 @@ function nxCliPath() {
|
|
128
128
|
});
|
129
129
|
// if it's berry ensure we set the node_linker to node-modules
|
130
130
|
if (packageManager === 'yarn' && pmc.ciInstall.includes('immutable')) {
|
131
|
-
(0, child_process_2.execSync)(
|
132
|
-
cwd:
|
131
|
+
(0, child_process_2.execSync)('yarn config set nodeLinker node-modules', {
|
132
|
+
cwd: tmpDir,
|
133
133
|
stdio: ['ignore', 'ignore', 'ignore'],
|
134
134
|
});
|
135
135
|
}
|
@@ -43,7 +43,6 @@ exports.commandsObject = yargs
|
|
43
43
|
.command(command_object_1.yargsAffectedBuildCommand)
|
44
44
|
.command(command_object_1.yargsAffectedCommand)
|
45
45
|
.command(command_object_1.yargsAffectedE2ECommand)
|
46
|
-
.command(command_object_1.yargsAffectedGraphCommand)
|
47
46
|
.command(command_object_1.yargsAffectedLintCommand)
|
48
47
|
.command(command_object_1.yargsAffectedTestCommand)
|
49
48
|
.command(command_object_2.yargsConnectCommand)
|
@@ -58,7 +57,6 @@ exports.commandsObject = yargs
|
|
58
57
|
.command(command_object_9.yargsListCommand)
|
59
58
|
.command(command_object_10.yargsMigrateCommand)
|
60
59
|
.command(command_object_11.yargsNewCommand)
|
61
|
-
.command(command_object_1.yargsPrintAffectedCommand)
|
62
60
|
.command(command_object_19.yargsReleaseCommand)
|
63
61
|
.command(command_object_12.yargsRepairCommand)
|
64
62
|
.command(command_object_13.yargsReportCommand)
|
@@ -8,7 +8,6 @@ const semver_1 = require("semver");
|
|
8
8
|
const tmp_1 = require("tmp");
|
9
9
|
const nx_json_1 = require("../../config/nx-json");
|
10
10
|
const tree_1 = require("../../generators/tree");
|
11
|
-
const register_1 = require("../../plugins/js/utils/register");
|
12
11
|
const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
13
12
|
const project_graph_1 = require("../../project-graph/project-graph");
|
14
13
|
const utils_1 = require("../../tasks-runner/utils");
|
@@ -24,9 +23,9 @@ const github_1 = require("./utils/github");
|
|
24
23
|
const launch_editor_1 = require("./utils/launch-editor");
|
25
24
|
const markdown_1 = require("./utils/markdown");
|
26
25
|
const print_changes_1 = require("./utils/print-changes");
|
26
|
+
const resolve_changelog_renderer_1 = require("./utils/resolve-changelog-renderer");
|
27
27
|
const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
|
28
28
|
const shared_1 = require("./utils/shared");
|
29
|
-
const typescript_1 = require("../../plugins/js/utils/typescript");
|
30
29
|
const releaseChangelogCLIHandler = (args) => (0, params_1.handleErrors)(args.verbose, () => releaseChangelog(args));
|
31
30
|
exports.releaseChangelogCLIHandler = releaseChangelogCLIHandler;
|
32
31
|
/**
|
@@ -360,28 +359,6 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
360
359
|
}
|
361
360
|
return;
|
362
361
|
}
|
363
|
-
function resolveChangelogRenderer(changelogRendererPath) {
|
364
|
-
const interpolatedChangelogRendererPath = (0, utils_1.interpolate)(changelogRendererPath, {
|
365
|
-
workspaceRoot: workspace_root_1.workspaceRoot,
|
366
|
-
});
|
367
|
-
// Try and load the provided (or default) changelog renderer
|
368
|
-
let changelogRenderer;
|
369
|
-
let cleanupTranspiler = () => { };
|
370
|
-
try {
|
371
|
-
const rootTsconfigPath = (0, typescript_1.getRootTsConfigPath)();
|
372
|
-
if (rootTsconfigPath) {
|
373
|
-
cleanupTranspiler = (0, register_1.registerTsProject)(rootTsconfigPath);
|
374
|
-
}
|
375
|
-
const r = require(interpolatedChangelogRendererPath);
|
376
|
-
changelogRenderer = r.default || r;
|
377
|
-
}
|
378
|
-
catch {
|
379
|
-
}
|
380
|
-
finally {
|
381
|
-
cleanupTranspiler();
|
382
|
-
}
|
383
|
-
return changelogRenderer;
|
384
|
-
}
|
385
362
|
async function generateChangelogForWorkspace(tree, args, projectGraph, nxReleaseConfig, workspaceChangelogVersion, commits) {
|
386
363
|
const config = nxReleaseConfig.changelog.workspaceChangelog;
|
387
364
|
// The entire feature is disabled at the workspace level, exit early
|
@@ -421,7 +398,7 @@ async function generateChangelogForWorkspace(tree, args, projectGraph, nxRelease
|
|
421
398
|
const interactive = args.interactive === 'all' || args.interactive === 'workspace';
|
422
399
|
const dryRun = !!args.dryRun;
|
423
400
|
const gitRemote = args.gitRemote;
|
424
|
-
const changelogRenderer = resolveChangelogRenderer(config.renderer);
|
401
|
+
const changelogRenderer = (0, resolve_changelog_renderer_1.resolveChangelogRenderer)(config.renderer);
|
425
402
|
let interpolatedTreePath = config.file || '';
|
426
403
|
if (interpolatedTreePath) {
|
427
404
|
interpolatedTreePath = (0, utils_1.interpolate)(interpolatedTreePath, {
|
@@ -502,7 +479,7 @@ async function generateChangelogForProjects(tree, args, projectGraph, commits, p
|
|
502
479
|
const interactive = args.interactive === 'all' || args.interactive === 'projects';
|
503
480
|
const dryRun = !!args.dryRun;
|
504
481
|
const gitRemote = args.gitRemote;
|
505
|
-
const changelogRenderer = resolveChangelogRenderer(config.renderer);
|
482
|
+
const changelogRenderer = (0, resolve_changelog_renderer_1.resolveChangelogRenderer)(config.renderer);
|
506
483
|
const projectChangelogs = {};
|
507
484
|
for (const project of projects) {
|
508
485
|
let interpolatedTreePath = config.file || '';
|
@@ -14,11 +14,12 @@ exports.handleNxReleaseConfigError = exports.createNxReleaseConfig = exports.IMP
|
|
14
14
|
* defaults and user overrides, as well as handling common errors, up front to produce a single, consistent,
|
15
15
|
* and easy to consume config object for all the `nx release` command implementations.
|
16
16
|
*/
|
17
|
-
const
|
17
|
+
const node_path_1 = require("node:path");
|
18
18
|
const fileutils_1 = require("../../../utils/fileutils");
|
19
19
|
const find_matching_projects_1 = require("../../../utils/find-matching-projects");
|
20
20
|
const output_1 = require("../../../utils/output");
|
21
21
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
22
|
+
const resolve_changelog_renderer_1 = require("../utils/resolve-changelog-renderer");
|
22
23
|
const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
|
23
24
|
const conventional_commits_1 = require("./conventional-commits");
|
24
25
|
exports.IMPLICIT_DEFAULT_RELEASE_GROUP = '__default__';
|
@@ -84,7 +85,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
84
85
|
userGroups[0].projectsRelationship === 'independent') ||
|
85
86
|
(userConfig.projectsRelationship === 'independent' &&
|
86
87
|
!userGroups.some((g) => g.projectsRelationship === 'fixed'));
|
87
|
-
const defaultRendererPath = (0,
|
88
|
+
const defaultRendererPath = (0, node_path_1.join)(__dirname, '../../../../release/changelog-renderer');
|
88
89
|
const WORKSPACE_DEFAULTS = {
|
89
90
|
// By default all projects in all groups are released together
|
90
91
|
projectsRelationship: workspaceProjectsRelationship,
|
@@ -318,6 +319,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
318
319
|
}
|
319
320
|
releaseGroups[releaseGroupName] = finalReleaseGroup;
|
320
321
|
}
|
322
|
+
ensureChangelogRenderersAreResolvable(releaseGroups, rootChangelogConfig);
|
321
323
|
return {
|
322
324
|
error: null,
|
323
325
|
nxReleaseConfig: {
|
@@ -613,12 +615,12 @@ async function getDefaultProjects(projectGraph, projectFileMap) {
|
|
613
615
|
}
|
614
616
|
function isProjectPublic(project, projectGraph, projectFileMap) {
|
615
617
|
const projectNode = projectGraph.nodes[project];
|
616
|
-
const packageJsonPath = (0,
|
618
|
+
const packageJsonPath = (0, node_path_1.join)(projectNode.data.root, 'package.json');
|
617
619
|
if (!projectFileMap[project]?.find((f) => f.file === packageJsonPath)) {
|
618
620
|
return false;
|
619
621
|
}
|
620
622
|
try {
|
621
|
-
const fullPackageJsonPath = (0,
|
623
|
+
const fullPackageJsonPath = (0, node_path_1.join)(workspace_root_1.workspaceRoot, packageJsonPath);
|
622
624
|
const packageJson = (0, fileutils_1.readJsonFile)(fullPackageJsonPath);
|
623
625
|
return !(packageJson.private === true);
|
624
626
|
}
|
@@ -628,3 +630,42 @@ function isProjectPublic(project, projectGraph, projectFileMap) {
|
|
628
630
|
return false;
|
629
631
|
}
|
630
632
|
}
|
633
|
+
function ensureChangelogRenderersAreResolvable(releaseGroups, rootChangelogConfig) {
|
634
|
+
/**
|
635
|
+
* If any form of changelog config is enabled, ensure that any provided changelog renderers are resolvable
|
636
|
+
* up front so that we do not end up erroring only after the versioning step has been completed.
|
637
|
+
*/
|
638
|
+
const uniqueRendererPaths = new Set();
|
639
|
+
if (rootChangelogConfig.workspaceChangelog &&
|
640
|
+
typeof rootChangelogConfig.workspaceChangelog !== 'boolean' &&
|
641
|
+
rootChangelogConfig.workspaceChangelog.renderer?.length) {
|
642
|
+
uniqueRendererPaths.add(rootChangelogConfig.workspaceChangelog.renderer);
|
643
|
+
}
|
644
|
+
if (rootChangelogConfig.projectChangelogs &&
|
645
|
+
typeof rootChangelogConfig.projectChangelogs !== 'boolean' &&
|
646
|
+
rootChangelogConfig.projectChangelogs.renderer?.length) {
|
647
|
+
uniqueRendererPaths.add(rootChangelogConfig.projectChangelogs.renderer);
|
648
|
+
}
|
649
|
+
for (const group of Object.values(releaseGroups)) {
|
650
|
+
if (group.changelog &&
|
651
|
+
typeof group.changelog !== 'boolean' &&
|
652
|
+
group.changelog.renderer?.length) {
|
653
|
+
uniqueRendererPaths.add(group.changelog.renderer);
|
654
|
+
}
|
655
|
+
}
|
656
|
+
if (!uniqueRendererPaths.size) {
|
657
|
+
return;
|
658
|
+
}
|
659
|
+
for (const rendererPath of uniqueRendererPaths) {
|
660
|
+
try {
|
661
|
+
(0, resolve_changelog_renderer_1.resolveChangelogRenderer)(rendererPath);
|
662
|
+
}
|
663
|
+
catch (e) {
|
664
|
+
const workspaceRelativePath = (0, node_path_1.relative)(workspace_root_1.workspaceRoot, rendererPath);
|
665
|
+
output_1.output.error({
|
666
|
+
title: `There was an error when resolving the configured changelog renderer at path: ${workspaceRelativePath}`,
|
667
|
+
});
|
668
|
+
throw e;
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.resolveChangelogRenderer = void 0;
|
4
|
+
const register_1 = require("../../../plugins/js/utils/register");
|
5
|
+
const typescript_1 = require("../../../plugins/js/utils/typescript");
|
6
|
+
const utils_1 = require("../../../tasks-runner/utils");
|
7
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
8
|
+
function resolveChangelogRenderer(changelogRendererPath) {
|
9
|
+
const interpolatedChangelogRendererPath = (0, utils_1.interpolate)(changelogRendererPath, {
|
10
|
+
workspaceRoot: workspace_root_1.workspaceRoot,
|
11
|
+
});
|
12
|
+
// Try and load the provided (or default) changelog renderer
|
13
|
+
let changelogRenderer;
|
14
|
+
let cleanupTranspiler = () => { };
|
15
|
+
try {
|
16
|
+
const rootTsconfigPath = (0, typescript_1.getRootTsConfigPath)();
|
17
|
+
if (rootTsconfigPath) {
|
18
|
+
cleanupTranspiler = (0, register_1.registerTsProject)(rootTsconfigPath);
|
19
|
+
}
|
20
|
+
const r = require(interpolatedChangelogRendererPath);
|
21
|
+
changelogRenderer = r.default || r;
|
22
|
+
}
|
23
|
+
catch (err) {
|
24
|
+
throw err;
|
25
|
+
}
|
26
|
+
finally {
|
27
|
+
cleanupTranspiler();
|
28
|
+
}
|
29
|
+
return changelogRenderer;
|
30
|
+
}
|
31
|
+
exports.resolveChangelogRenderer = resolveChangelogRenderer;
|
@@ -20,6 +20,7 @@ export type ShowProjectsOptions = NxShowArgs & {
|
|
20
20
|
export type ShowProjectOptions = NxShowArgs & {
|
21
21
|
projectName: string;
|
22
22
|
web?: boolean;
|
23
|
-
|
23
|
+
open?: boolean;
|
24
|
+
verbose?: boolean;
|
24
25
|
};
|
25
26
|
export declare const yargsShowCommand: CommandModule<Record<string, unknown>, NxShowArgs>;
|
@@ -75,7 +75,7 @@ const showProjectsCommand = {
|
|
75
75
|
const showProjectCommand = {
|
76
76
|
command: 'project <projectName>',
|
77
77
|
describe: 'Shows resolved project configuration for a given project.',
|
78
|
-
builder: (yargs) => yargs
|
78
|
+
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
|
79
79
|
.positional('projectName', {
|
80
80
|
type: 'string',
|
81
81
|
alias: 'p',
|
@@ -86,12 +86,17 @@ const showProjectCommand = {
|
|
86
86
|
type: 'boolean',
|
87
87
|
description: 'Show project details in the browser',
|
88
88
|
})
|
89
|
-
.option('
|
89
|
+
.option('open', {
|
90
90
|
type: 'boolean',
|
91
|
-
description: '
|
91
|
+
description: 'Set to false to prevent the browser from opening when using --web',
|
92
|
+
implies: 'web',
|
93
|
+
})
|
94
|
+
.check((argv) => {
|
95
|
+
if (argv.web) {
|
96
|
+
argv.json = false;
|
97
|
+
}
|
98
|
+
return true;
|
92
99
|
})
|
93
|
-
.conflicts('json', 'web')
|
94
|
-
.conflicts('web', 'json')
|
95
100
|
.example('$0 show project my-app', 'View project information for my-app in JSON format')
|
96
101
|
.example('$0 show project my-app --web', 'View project information for my-app in the browser'),
|
97
102
|
handler: (args) => {
|
@@ -111,7 +111,7 @@ export interface ProjectGraphDependency {
|
|
111
111
|
}
|
112
112
|
/**
|
113
113
|
* Additional information to be used to process a project graph
|
114
|
-
* @deprecated The {@link ProjectGraphProcessor} is deprecated. This will be removed in Nx
|
114
|
+
* @deprecated The {@link ProjectGraphProcessor} is deprecated. This will be removed in Nx 20.
|
115
115
|
*/
|
116
116
|
export interface ProjectGraphProcessorContext {
|
117
117
|
/**
|
@@ -132,6 +132,6 @@ export interface ProjectGraphProcessorContext {
|
|
132
132
|
}
|
133
133
|
/**
|
134
134
|
* A function that produces an updated ProjectGraph
|
135
|
-
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx
|
135
|
+
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx 20.
|
136
136
|
*/
|
137
137
|
export type ProjectGraphProcessor = (currentGraph: ProjectGraph, context: ProjectGraphProcessorContext) => ProjectGraph | Promise<ProjectGraph>;
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stripSourceCode = void 0;
|
4
4
|
let SyntaxKind;
|
5
5
|
/**
|
6
|
-
* @deprecated This is deprecated and will be removed in Nx
|
6
|
+
* @deprecated This is deprecated and will be removed in Nx 20.
|
7
7
|
* This was not intended to be exposed.
|
8
8
|
* Please talk to us if you need this.
|
9
9
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DependencyType } from '../../../../config/project-graph';
|
2
2
|
/**
|
3
|
-
* @deprecated This is deprecated and will be removed in Nx
|
3
|
+
* @deprecated This is deprecated and will be removed in Nx 20.
|
4
4
|
* This was not intended to be exposed.
|
5
5
|
* Please talk to us if you need this.
|
6
6
|
*/
|
@@ -7,7 +7,7 @@ const file_utils_1 = require("../../../../project-graph/file-utils");
|
|
7
7
|
const strip_source_code_1 = require("./strip-source-code");
|
8
8
|
let tsModule;
|
9
9
|
/**
|
10
|
-
* @deprecated This is deprecated and will be removed in Nx
|
10
|
+
* @deprecated This is deprecated and will be removed in Nx 20.
|
11
11
|
* This was not intended to be exposed.
|
12
12
|
* Please talk to us if you need this.
|
13
13
|
*/
|
@@ -5,7 +5,7 @@ import { DependencyType, FileMap, ProjectFileMap, ProjectGraph, ProjectGraphExte
|
|
5
5
|
import { CreateDependenciesContext } from './plugins';
|
6
6
|
/**
|
7
7
|
* A class which builds up a project graph
|
8
|
-
* @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx
|
8
|
+
* @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx 20.
|
9
9
|
*/
|
10
10
|
export declare class ProjectGraphBuilder {
|
11
11
|
readonly graph: ProjectGraph;
|
@@ -8,7 +8,7 @@ const project_graph_1 = require("../config/project-graph");
|
|
8
8
|
const build_project_graph_1 = require("./build-project-graph");
|
9
9
|
/**
|
10
10
|
* A class which builds up a project graph
|
11
|
-
* @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx
|
11
|
+
* @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx 20.
|
12
12
|
*/
|
13
13
|
class ProjectGraphBuilder {
|
14
14
|
constructor(graph, projectFileMap, nonProjectFiles) {
|
@@ -21,7 +21,7 @@ async function initTasksRunner(nxArgs) {
|
|
21
21
|
return {
|
22
22
|
invoke: async (opts) => {
|
23
23
|
perf_hooks_1.performance.mark('code-loading:end');
|
24
|
-
// TODO: This polyfills the outputs if someone doesn't pass a task with outputs. Remove this in Nx
|
24
|
+
// TODO: This polyfills the outputs if someone doesn't pass a task with outputs. Remove this in Nx 20
|
25
25
|
opts.tasks.forEach((t) => {
|
26
26
|
if (!t.outputs) {
|
27
27
|
t.outputs = (0, utils_1.getOutputs)(projectGraph.nodes, t.target, t.overrides);
|
@@ -18,7 +18,7 @@ declare class InvalidOutputsError extends Error {
|
|
18
18
|
export declare function validateOutputs(outputs: string[]): void;
|
19
19
|
export declare function transformLegacyOutputs(projectRoot: string, error: InvalidOutputsError): string[];
|
20
20
|
/**
|
21
|
-
* @deprecated Pass the target and overrides instead. This will be removed in
|
21
|
+
* @deprecated Pass the target and overrides instead. This will be removed in v20.
|
22
22
|
*/
|
23
23
|
export declare function getOutputsForTargetAndConfiguration(task: Task, node: ProjectGraphProjectNode): string[];
|
24
24
|
export declare function getOutputsForTargetAndConfiguration(target: Task['target'] | Task, overrides: Task['overrides'] | ProjectGraphProjectNode, node: ProjectGraphProjectNode): string[];
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export declare function isAsyncIterator<T>(v: any): v is AsyncIterableIterator<T>;
|
2
|
-
export declare function getLastValueFromAsyncIterableIterator<T>(i: AsyncIterableIterator<T>): Promise<T>;
|
2
|
+
export declare function getLastValueFromAsyncIterableIterator<T>(i: AsyncIterable<T> | AsyncIterableIterator<T>): Promise<T>;
|
@@ -8,9 +8,11 @@ exports.isAsyncIterator = isAsyncIterator;
|
|
8
8
|
async function getLastValueFromAsyncIterableIterator(i) {
|
9
9
|
let prev;
|
10
10
|
let current;
|
11
|
+
const generator = i[Symbol.asyncIterator] || i[Symbol.iterator];
|
12
|
+
const iterator = generator.call(i);
|
11
13
|
do {
|
12
14
|
prev = current;
|
13
|
-
current = await
|
15
|
+
current = await iterator.next();
|
14
16
|
} while (!current.done);
|
15
17
|
return current.value !== undefined || !prev ? current.value : prev.value;
|
16
18
|
}
|
@@ -2,26 +2,26 @@ import { ProjectGraphProcessor } from '../config/project-graph';
|
|
2
2
|
import { TargetConfiguration } from '../config/workspace-json-project-json';
|
3
3
|
import { NxPluginV2 } from '../project-graph/plugins';
|
4
4
|
/**
|
5
|
-
* @deprecated Add targets to the projects in a {@link CreateNodes} function instead. This will be removed in Nx
|
5
|
+
* @deprecated Add targets to the projects in a {@link CreateNodes} function instead. This will be removed in Nx 20
|
6
6
|
*/
|
7
7
|
export type ProjectTargetConfigurator = (file: string) => Record<string, TargetConfiguration>;
|
8
8
|
/**
|
9
|
-
* @deprecated Use {@link NxPluginV2} instead. This will be removed in Nx
|
9
|
+
* @deprecated Use {@link NxPluginV2} instead. This will be removed in Nx 20
|
10
10
|
*/
|
11
11
|
export type NxPluginV1 = {
|
12
12
|
name: string;
|
13
13
|
/**
|
14
|
-
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx
|
14
|
+
* @deprecated Use {@link CreateNodes} and {@link CreateDependencies} instead. This will be removed in Nx 20
|
15
15
|
*/
|
16
16
|
processProjectGraph?: ProjectGraphProcessor;
|
17
17
|
/**
|
18
|
-
* @deprecated Add targets to the projects inside of {@link CreateNodes} instead. This will be removed in Nx
|
18
|
+
* @deprecated Add targets to the projects inside of {@link CreateNodes} instead. This will be removed in Nx 20
|
19
19
|
*/
|
20
20
|
registerProjectTargets?: ProjectTargetConfigurator;
|
21
21
|
/**
|
22
22
|
* A glob pattern to search for non-standard project files.
|
23
23
|
* @example: ["*.csproj", "pom.xml"]
|
24
|
-
* @deprecated Use {@link CreateNodes} instead. This will be removed in Nx
|
24
|
+
* @deprecated Use {@link CreateNodes} instead. This will be removed in Nx 20
|
25
25
|
*/
|
26
26
|
projectFilePatterns?: string[];
|
27
27
|
};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import * as yargs from 'yargs';
|
2
|
-
import type { NxArgs } from '../../utils/command-line-utils';
|
3
|
-
import { ProjectGraph, ProjectGraphProjectNode } from '../../config/project-graph';
|
4
|
-
import { NxJsonConfiguration } from '../../config/nx-json';
|
5
|
-
/**
|
6
|
-
* @deprecated Use showProjectsHandler, generateGraph, or affected (without the print-affected mode) instead.
|
7
|
-
*/
|
8
|
-
export declare function printAffected(affectedProjects: ProjectGraphProjectNode[], projectGraph: ProjectGraph, { nxJson }: {
|
9
|
-
nxJson: NxJsonConfiguration;
|
10
|
-
}, nxArgs: NxArgs, overrides: yargs.Arguments): Promise<void>;
|
11
|
-
export declare function selectPrintAffected(wholeJson: any, wholeSelect: string): any;
|
@@ -1,108 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.selectPrintAffected = exports.printAffected = void 0;
|
4
|
-
const utils_1 = require("../../tasks-runner/utils");
|
5
|
-
const create_task_graph_1 = require("../../tasks-runner/create-task-graph");
|
6
|
-
const task_hasher_1 = require("../../hasher/task-hasher");
|
7
|
-
const hash_task_1 = require("../../hasher/hash-task");
|
8
|
-
const package_manager_1 = require("../../utils/package-manager");
|
9
|
-
const command_object_1 = require("./command-object");
|
10
|
-
const logger_1 = require("../../utils/logger");
|
11
|
-
const task_env_1 = require("../../tasks-runner/task-env");
|
12
|
-
const build_project_graph_1 = require("../../project-graph/build-project-graph");
|
13
|
-
const client_1 = require("../../daemon/client/client");
|
14
|
-
/**
|
15
|
-
* @deprecated Use showProjectsHandler, generateGraph, or affected (without the print-affected mode) instead.
|
16
|
-
*/
|
17
|
-
async function printAffected(affectedProjects, projectGraph, { nxJson }, nxArgs, overrides) {
|
18
|
-
logger_1.logger.warn([logger_1.NX_PREFIX, command_object_1.printAffectedDeprecationMessage].join(' '));
|
19
|
-
const projectsForType = affectedProjects.filter((p) => nxArgs.type ? p.type === nxArgs.type : true);
|
20
|
-
const projectNames = projectsForType.map((p) => p.name);
|
21
|
-
const tasksJson = nxArgs.targets && nxArgs.targets.length > 0
|
22
|
-
? await createTasks(projectsForType, projectGraph, nxArgs, nxJson, overrides)
|
23
|
-
: [];
|
24
|
-
const result = {
|
25
|
-
tasks: tasksJson,
|
26
|
-
projects: projectNames,
|
27
|
-
projectGraph: serializeProjectGraph(projectGraph),
|
28
|
-
};
|
29
|
-
if (nxArgs.select) {
|
30
|
-
console.log(selectPrintAffected(result, nxArgs.select));
|
31
|
-
}
|
32
|
-
else {
|
33
|
-
console.log(JSON.stringify(selectPrintAffected(result, null), null, 2));
|
34
|
-
}
|
35
|
-
}
|
36
|
-
exports.printAffected = printAffected;
|
37
|
-
async function createTasks(affectedProjectsWithTargetAndConfig, projectGraph, nxArgs, nxJson, overrides) {
|
38
|
-
const defaultDependencyConfigs = (0, create_task_graph_1.mapTargetDefaultsToDependencies)(nxJson.targetDefaults);
|
39
|
-
const taskGraph = (0, create_task_graph_1.createTaskGraph)(projectGraph, defaultDependencyConfigs, affectedProjectsWithTargetAndConfig.map((p) => p.name), nxArgs.targets, nxArgs.configuration, overrides);
|
40
|
-
let hasher;
|
41
|
-
if (client_1.daemonClient.enabled()) {
|
42
|
-
hasher = new task_hasher_1.DaemonBasedTaskHasher(client_1.daemonClient, {});
|
43
|
-
}
|
44
|
-
else {
|
45
|
-
const { fileMap, allWorkspaceFiles, rustReferences } = (0, build_project_graph_1.getFileMap)();
|
46
|
-
hasher = new task_hasher_1.InProcessTaskHasher(fileMap?.projectFileMap, allWorkspaceFiles, projectGraph, nxJson, rustReferences, {});
|
47
|
-
}
|
48
|
-
const execCommand = (0, package_manager_1.getPackageManagerCommand)().exec;
|
49
|
-
const tasks = Object.values(taskGraph.tasks);
|
50
|
-
await Promise.all(tasks.map((t) => (0, hash_task_1.hashTask)(hasher, projectGraph, taskGraph, t,
|
51
|
-
// This loads dotenv files for the task
|
52
|
-
(0, task_env_1.getTaskSpecificEnv)(t))));
|
53
|
-
return tasks.map((task) => ({
|
54
|
-
id: task.id,
|
55
|
-
overrides,
|
56
|
-
target: task.target,
|
57
|
-
hash: task.hash,
|
58
|
-
command: (0, utils_1.getCommandAsString)(execCommand, task),
|
59
|
-
outputs: task.outputs,
|
60
|
-
}));
|
61
|
-
}
|
62
|
-
function serializeProjectGraph(projectGraph) {
|
63
|
-
const nodes = Object.values(projectGraph.nodes).map((n) => n.name);
|
64
|
-
const dependencies = {};
|
65
|
-
// we don't need external dependencies' dependencies for print-affected
|
66
|
-
// having them included makes the output unreadable
|
67
|
-
Object.keys(projectGraph.dependencies).forEach((key) => {
|
68
|
-
if (!key.startsWith('npm:')) {
|
69
|
-
dependencies[key] = projectGraph.dependencies[key];
|
70
|
-
}
|
71
|
-
});
|
72
|
-
return { nodes, dependencies };
|
73
|
-
}
|
74
|
-
function selectPrintAffected(wholeJson, wholeSelect) {
|
75
|
-
if (!wholeSelect)
|
76
|
-
return wholeJson;
|
77
|
-
return _select(wholeJson, wholeSelect);
|
78
|
-
function _select(json, select) {
|
79
|
-
if (select.indexOf('.') > -1) {
|
80
|
-
const [firstKey, ...restKeys] = select.split('.');
|
81
|
-
const first = json[firstKey];
|
82
|
-
throwIfEmpty(wholeSelect, first);
|
83
|
-
const rest = restKeys.join('.');
|
84
|
-
if (Array.isArray(first)) {
|
85
|
-
return first.map((q) => _select(q, rest)).join(', ');
|
86
|
-
}
|
87
|
-
else {
|
88
|
-
return _select(first, rest);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
else {
|
92
|
-
const res = json[select];
|
93
|
-
throwIfEmpty(wholeSelect, res);
|
94
|
-
if (Array.isArray(res)) {
|
95
|
-
return res.join(', ');
|
96
|
-
}
|
97
|
-
else {
|
98
|
-
return res;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
}
|
102
|
-
}
|
103
|
-
exports.selectPrintAffected = selectPrintAffected;
|
104
|
-
function throwIfEmpty(select, value) {
|
105
|
-
if (value === undefined) {
|
106
|
-
throw new Error(`Cannot select '${select}' in the results of print-affected.`);
|
107
|
-
}
|
108
|
-
}
|