nx 19.2.0-canary.20240601-6f22300 → 19.2.0-canary.20240605-5a06daa
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 +8 -8
- package/migrations.json +6 -0
- package/package.json +13 -12
- package/release/changelog-renderer/index.d.ts +6 -3
- package/release/changelog-renderer/index.js +53 -50
- package/schemas/nx-schema.json +8 -0
- package/src/command-line/add/add.d.ts +1 -1
- package/src/command-line/add/command-object.js +3 -1
- package/src/command-line/affected/command-object.js +10 -5
- package/src/command-line/deprecated/command-objects.js +12 -6
- package/src/command-line/examples.js +18 -0
- package/src/command-line/generate/generate.d.ts +1 -1
- package/src/command-line/migrate/migrate.d.ts +1 -1
- package/src/command-line/new/new.d.ts +1 -1
- package/src/command-line/release/changelog.d.ts +17 -1
- package/src/command-line/release/changelog.js +305 -76
- package/src/command-line/release/command-object.d.ts +14 -5
- package/src/command-line/release/command-object.js +52 -24
- package/src/command-line/release/config/config.js +38 -6
- package/src/command-line/release/config/filter-release-groups.d.ts +3 -1
- package/src/command-line/release/config/filter-release-groups.js +1 -0
- package/src/command-line/release/config/version-plans.d.ts +24 -0
- package/src/command-line/release/config/version-plans.js +184 -0
- package/src/command-line/release/plan.d.ts +3 -0
- package/src/command-line/release/plan.js +184 -0
- package/src/command-line/release/publish.d.ts +1 -1
- package/src/command-line/release/release.d.ts +1 -1
- package/src/command-line/release/release.js +40 -0
- package/src/command-line/release/utils/git.d.ts +10 -2
- package/src/command-line/release/utils/git.js +45 -10
- package/src/command-line/release/utils/shared.d.ts +12 -2
- package/src/command-line/release/utils/shared.js +3 -2
- package/src/command-line/release/version.d.ts +3 -2
- package/src/command-line/release/version.js +43 -5
- package/src/command-line/repair/repair.d.ts +1 -1
- package/src/command-line/reset/command-object.d.ts +6 -1
- package/src/command-line/reset/command-object.js +15 -2
- package/src/command-line/reset/reset.d.ts +2 -1
- package/src/command-line/reset/reset.js +98 -16
- package/src/command-line/run/command-object.js +6 -3
- package/src/command-line/run/run.d.ts +2 -2
- package/src/command-line/run-many/command-object.js +6 -3
- package/src/command-line/show/command-object.js +6 -6
- package/src/config/misc-interfaces.d.ts +15 -3
- package/src/config/nx-json.d.ts +11 -0
- package/src/core/graph/main.js +1 -1
- package/src/daemon/server/plugins.js +1 -0
- package/src/daemon/tmp-dir.js +1 -1
- package/src/devkit-exports.d.ts +1 -1
- package/src/migrations/update-19-2-0/move-workspace-data-directory.d.ts +4 -0
- package/src/migrations/update-19-2-0/move-workspace-data-directory.js +34 -0
- package/src/plugins/js/index.js +2 -2
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +11 -0
- package/src/plugins/js/project-graph/affected/npm-packages.js +12 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +3 -11
- package/src/plugins/js/utils/config.js +4 -0
- package/src/plugins/js/utils/register.d.ts +4 -3
- package/src/plugins/js/utils/register.js +47 -4
- package/src/project-graph/affected/affected-project-graph.js +6 -6
- package/src/project-graph/nx-deps-cache.js +6 -6
- package/src/project-graph/plugins/loader.js +1 -1
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
- package/src/tasks-runner/task-env.js +12 -0
- package/src/utils/cache-directory.d.ts +1 -1
- package/src/utils/cache-directory.js +13 -6
- package/src/utils/get-package-name-from-import-path.d.ts +1 -0
- package/src/utils/get-package-name-from-import-path.js +18 -0
- package/src/utils/package-json.d.ts +1 -0
- package/src/utils/package-manager.js +42 -9
- package/src/utils/params.d.ts +1 -1
- package/src/utils/params.js +5 -1
package/bin/post-install.js
CHANGED
@@ -11,8 +11,10 @@ const get_cloud_options_1 = require("../src/nx-cloud/utilities/get-cloud-options
|
|
11
11
|
const nx_cloud_utils_1 = require("../src/utils/nx-cloud-utils");
|
12
12
|
const nx_json_1 = require("../src/config/nx-json");
|
13
13
|
const workspace_context_1 = require("../src/utils/workspace-context");
|
14
|
+
const logger_1 = require("../src/utils/logger");
|
14
15
|
(async () => {
|
15
16
|
const start = new Date();
|
17
|
+
let errored = false;
|
16
18
|
try {
|
17
19
|
(0, workspace_context_1.setupWorkspaceContext)(workspace_root_1.workspaceRoot);
|
18
20
|
if (isMainNxPackage() && (0, fileutils_1.fileExists)((0, path_1.join)(workspace_root_1.workspaceRoot, 'nx.json'))) {
|
@@ -28,7 +30,7 @@ const workspace_context_1 = require("../src/utils/workspace-context");
|
|
28
30
|
tasks.push((0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)()));
|
29
31
|
}
|
30
32
|
await Promise.all(tasks.map((promise) => {
|
31
|
-
promise.catch((e) => {
|
33
|
+
return promise.catch((e) => {
|
32
34
|
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
33
35
|
console.warn(e);
|
34
36
|
}
|
@@ -37,15 +39,13 @@ const workspace_context_1 = require("../src/utils/workspace-context");
|
|
37
39
|
}
|
38
40
|
}
|
39
41
|
catch (e) {
|
40
|
-
|
41
|
-
|
42
|
-
}
|
42
|
+
errored = true;
|
43
|
+
logger_1.logger.verbose(e);
|
43
44
|
}
|
44
45
|
finally {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
46
|
+
const end = new Date();
|
47
|
+
logger_1.logger.verbose(`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`);
|
48
|
+
process.exit(errored ? 1 : 0);
|
49
49
|
}
|
50
50
|
})();
|
51
51
|
function isMainNxPackage() {
|
package/migrations.json
CHANGED
@@ -71,6 +71,12 @@
|
|
71
71
|
"version": "18.1.0-beta.3",
|
72
72
|
"description": "Moves affected.defaultBase to defaultBase in `nx.json`",
|
73
73
|
"implementation": "./src/migrations/update-17-2-0/move-default-base"
|
74
|
+
},
|
75
|
+
"19-2-0-move-graph-cache-directory": {
|
76
|
+
"cli": "nx",
|
77
|
+
"version": "19.2.0-beta.2",
|
78
|
+
"description": "Updates the default workspace data directory to .nx/workspace-data",
|
79
|
+
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory"
|
74
80
|
}
|
75
81
|
}
|
76
82
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.2.0-canary.
|
3
|
+
"version": "19.2.0-canary.20240605-5a06daa",
|
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": {
|
@@ -50,6 +50,7 @@
|
|
50
50
|
"enquirer": "~2.3.6",
|
51
51
|
"figures": "3.2.0",
|
52
52
|
"flat": "^5.0.2",
|
53
|
+
"front-matter": "^4.0.2",
|
53
54
|
"fs-extra": "^11.1.0",
|
54
55
|
"ignore": "^5.0.4",
|
55
56
|
"jest-diff": "^29.4.1",
|
@@ -69,7 +70,7 @@
|
|
69
70
|
"yargs-parser": "21.1.1",
|
70
71
|
"node-machine-id": "1.1.12",
|
71
72
|
"ora": "5.3.0",
|
72
|
-
"@nrwl/tao": "19.2.0-canary.
|
73
|
+
"@nrwl/tao": "19.2.0-canary.20240605-5a06daa"
|
73
74
|
},
|
74
75
|
"peerDependencies": {
|
75
76
|
"@swc-node/register": "^1.8.0",
|
@@ -84,16 +85,16 @@
|
|
84
85
|
}
|
85
86
|
},
|
86
87
|
"optionalDependencies": {
|
87
|
-
"@nx/nx-darwin-x64": "19.2.0-canary.
|
88
|
-
"@nx/nx-darwin-arm64": "19.2.0-canary.
|
89
|
-
"@nx/nx-linux-x64-gnu": "19.2.0-canary.
|
90
|
-
"@nx/nx-linux-x64-musl": "19.2.0-canary.
|
91
|
-
"@nx/nx-win32-x64-msvc": "19.2.0-canary.
|
92
|
-
"@nx/nx-linux-arm64-gnu": "19.2.0-canary.
|
93
|
-
"@nx/nx-linux-arm64-musl": "19.2.0-canary.
|
94
|
-
"@nx/nx-linux-arm-gnueabihf": "19.2.0-canary.
|
95
|
-
"@nx/nx-win32-arm64-msvc": "19.2.0-canary.
|
96
|
-
"@nx/nx-freebsd-x64": "19.2.0-canary.
|
88
|
+
"@nx/nx-darwin-x64": "19.2.0-canary.20240605-5a06daa",
|
89
|
+
"@nx/nx-darwin-arm64": "19.2.0-canary.20240605-5a06daa",
|
90
|
+
"@nx/nx-linux-x64-gnu": "19.2.0-canary.20240605-5a06daa",
|
91
|
+
"@nx/nx-linux-x64-musl": "19.2.0-canary.20240605-5a06daa",
|
92
|
+
"@nx/nx-win32-x64-msvc": "19.2.0-canary.20240605-5a06daa",
|
93
|
+
"@nx/nx-linux-arm64-gnu": "19.2.0-canary.20240605-5a06daa",
|
94
|
+
"@nx/nx-linux-arm64-musl": "19.2.0-canary.20240605-5a06daa",
|
95
|
+
"@nx/nx-linux-arm-gnueabihf": "19.2.0-canary.20240605-5a06daa",
|
96
|
+
"@nx/nx-win32-arm64-msvc": "19.2.0-canary.20240605-5a06daa",
|
97
|
+
"@nx/nx-freebsd-x64": "19.2.0-canary.20240605-5a06daa"
|
97
98
|
},
|
98
99
|
"nx-migrations": {
|
99
100
|
"migrations": "./migrations.json",
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { ChangelogChange } from '../../src/command-line/release/changelog';
|
1
2
|
import { NxReleaseConfig } from '../../src/command-line/release/config/config';
|
2
|
-
import
|
3
|
+
import { GitCommit } from '../../src/command-line/release/utils/git';
|
3
4
|
import { RepoSlug } from '../../src/command-line/release/utils/github';
|
4
5
|
import type { ProjectGraph } from '../../src/config/project-graph';
|
5
6
|
/**
|
@@ -22,7 +23,8 @@ export type DependencyBump = {
|
|
22
23
|
*
|
23
24
|
* @param {Object} config The configuration object for the ChangelogRenderer
|
24
25
|
* @param {ProjectGraph} config.projectGraph The project graph for the workspace
|
25
|
-
* @param {GitCommit[]} config.commits The collection of extracted commits to generate a changelog for
|
26
|
+
* @param {GitCommit[]} config.commits DEPRECATED [Use 'config.changes' instead] - The collection of extracted commits to generate a changelog for
|
27
|
+
* @param {ChangelogChange[]} config.changes The collection of changes to show in the changelog
|
26
28
|
* @param {string} config.releaseVersion The version that is being released
|
27
29
|
* @param {string | null} config.project The name of specific project to generate a changelog for, or `null` if the overall workspace changelog
|
28
30
|
* @param {string | false} config.entryWhenNoChanges The (already interpolated) string to use as the changelog entry when there are no changes, or `false` if no entry should be generated
|
@@ -31,7 +33,8 @@ export type DependencyBump = {
|
|
31
33
|
*/
|
32
34
|
export type ChangelogRenderer = (config: {
|
33
35
|
projectGraph: ProjectGraph;
|
34
|
-
commits
|
36
|
+
commits?: GitCommit[];
|
37
|
+
changes?: ChangelogChange[];
|
35
38
|
releaseVersion: string;
|
36
39
|
project: string | null;
|
37
40
|
entryWhenNoChanges: string | false;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const semver_1 = require("semver");
|
4
4
|
const github_1 = require("../../src/command-line/release/utils/github");
|
5
|
-
const shared_1 = require("../../src/command-line/release/utils/shared");
|
6
5
|
// axios types and values don't seem to match
|
7
6
|
const _axios = require("axios");
|
8
7
|
const axios = _axios;
|
@@ -10,18 +9,18 @@ const axios = _axios;
|
|
10
9
|
* The default ChangelogRenderer implementation that nx exports for the common case of generating markdown
|
11
10
|
* from the given commits and other metadata.
|
12
11
|
*/
|
13
|
-
const defaultChangelogRenderer = async ({ projectGraph,
|
14
|
-
const
|
12
|
+
const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion, project, entryWhenNoChanges, changelogRenderOptions, dependencyBumps, repoSlug, conventionalCommitsConfig, }) => {
|
13
|
+
const changeTypes = conventionalCommitsConfig.types;
|
15
14
|
const markdownLines = [];
|
16
15
|
const breakingChanges = [];
|
17
|
-
// If the current range of
|
18
|
-
for (const
|
19
|
-
if (
|
20
|
-
for (const revertedHash of
|
21
|
-
const revertedCommit =
|
16
|
+
// If the current range of changes contains both a commit and its revert, we strip them both from the final list. Changes from version plans are unaffected, as they have no hashes.
|
17
|
+
for (const change of changes) {
|
18
|
+
if (change.type === 'revert' && change.revertedHashes) {
|
19
|
+
for (const revertedHash of change.revertedHashes) {
|
20
|
+
const revertedCommit = changes.find((c) => c.shortHash && revertedHash.startsWith(c.shortHash));
|
22
21
|
if (revertedCommit) {
|
23
|
-
|
24
|
-
|
22
|
+
changes.splice(changes.indexOf(revertedCommit), 1);
|
23
|
+
changes.splice(changes.indexOf(change), 1);
|
25
24
|
}
|
26
25
|
}
|
27
26
|
}
|
@@ -29,7 +28,7 @@ const defaultChangelogRenderer = async ({ projectGraph, commits, releaseVersion,
|
|
29
28
|
// workspace root level changelog
|
30
29
|
if (project === null) {
|
31
30
|
// No changes for the workspace
|
32
|
-
if (
|
31
|
+
if (changes.length === 0) {
|
33
32
|
if (dependencyBumps?.length) {
|
34
33
|
applyAdditionalDependencyBumps({
|
35
34
|
markdownLines,
|
@@ -43,31 +42,31 @@ const defaultChangelogRenderer = async ({ projectGraph, commits, releaseVersion,
|
|
43
42
|
}
|
44
43
|
return markdownLines.join('\n').trim();
|
45
44
|
}
|
46
|
-
const typeGroups = groupBy(
|
45
|
+
const typeGroups = groupBy(changes, 'type');
|
47
46
|
markdownLines.push('', createVersionTitle(releaseVersion, changelogRenderOptions), '');
|
48
|
-
for (const type of Object.keys(
|
47
|
+
for (const type of Object.keys(changeTypes)) {
|
49
48
|
const group = typeGroups[type];
|
50
49
|
if (!group || group.length === 0) {
|
51
50
|
continue;
|
52
51
|
}
|
53
|
-
markdownLines.push('', '### ' +
|
52
|
+
markdownLines.push('', '### ' + changeTypes[type].changelog.title, '');
|
54
53
|
/**
|
55
|
-
* In order to make the final changelog most readable, we organize
|
56
|
-
* - By scope, where scopes are in alphabetical order (
|
57
|
-
* - Within a particular scope grouping, we list
|
54
|
+
* In order to make the final changelog most readable, we organize changes as follows:
|
55
|
+
* - By scope, where scopes are in alphabetical order (changes with no scope are listed first)
|
56
|
+
* - Within a particular scope grouping, we list changes in chronological order
|
58
57
|
*/
|
59
|
-
const
|
60
|
-
const
|
61
|
-
const scopesSortedAlphabetically = Object.keys(
|
58
|
+
const changesInChronologicalOrder = group.reverse();
|
59
|
+
const changesGroupedByScope = groupBy(changesInChronologicalOrder, 'scope');
|
60
|
+
const scopesSortedAlphabetically = Object.keys(changesGroupedByScope).sort();
|
62
61
|
for (const scope of scopesSortedAlphabetically) {
|
63
|
-
const
|
64
|
-
for (const
|
65
|
-
const line =
|
62
|
+
const changes = changesGroupedByScope[scope];
|
63
|
+
for (const change of changes) {
|
64
|
+
const line = formatChange(change, changelogRenderOptions, repoSlug);
|
66
65
|
markdownLines.push(line);
|
67
|
-
if (
|
68
|
-
const breakingChangeExplanation = extractBreakingChangeExplanation(
|
66
|
+
if (change.isBreaking) {
|
67
|
+
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
69
68
|
breakingChanges.push(breakingChangeExplanation
|
70
|
-
? `- ${
|
69
|
+
? `- ${change.scope ? `**${change.scope.trim()}:** ` : ''}${breakingChangeExplanation}`
|
71
70
|
: line);
|
72
71
|
}
|
73
72
|
}
|
@@ -76,9 +75,10 @@ const defaultChangelogRenderer = async ({ projectGraph, commits, releaseVersion,
|
|
76
75
|
}
|
77
76
|
else {
|
78
77
|
// project level changelog
|
79
|
-
const
|
78
|
+
const relevantChanges = changes.filter((c) => c.affectedProjects &&
|
79
|
+
(c.affectedProjects === '*' || c.affectedProjects.includes(project)));
|
80
80
|
// Generating for a named project, but that project has no relevant changes in the current set of commits, exit early
|
81
|
-
if (
|
81
|
+
if (relevantChanges.length === 0) {
|
82
82
|
if (dependencyBumps?.length) {
|
83
83
|
applyAdditionalDependencyBumps({
|
84
84
|
markdownLines,
|
@@ -94,22 +94,22 @@ const defaultChangelogRenderer = async ({ projectGraph, commits, releaseVersion,
|
|
94
94
|
}
|
95
95
|
markdownLines.push('', createVersionTitle(releaseVersion, changelogRenderOptions), '');
|
96
96
|
const typeGroups = groupBy(
|
97
|
-
// Sort the relevant
|
98
|
-
|
99
|
-
for (const type of Object.keys(
|
97
|
+
// Sort the relevant changes to have the unscoped changes first, before grouping by type
|
98
|
+
relevantChanges.sort((a, b) => (b.scope ? 1 : 0) - (a.scope ? 1 : 0)), 'type');
|
99
|
+
for (const type of Object.keys(changeTypes)) {
|
100
100
|
const group = typeGroups[type];
|
101
101
|
if (!group || group.length === 0) {
|
102
102
|
continue;
|
103
103
|
}
|
104
|
-
markdownLines.push('', `### ${
|
105
|
-
const
|
106
|
-
for (const
|
107
|
-
const line =
|
104
|
+
markdownLines.push('', `### ${changeTypes[type].changelog.title}`, '');
|
105
|
+
const changesInChronologicalOrder = group.reverse();
|
106
|
+
for (const change of changesInChronologicalOrder) {
|
107
|
+
const line = formatChange(change, changelogRenderOptions, repoSlug);
|
108
108
|
markdownLines.push(line + '\n');
|
109
|
-
if (
|
110
|
-
const breakingChangeExplanation = extractBreakingChangeExplanation(
|
109
|
+
if (change.isBreaking) {
|
110
|
+
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
111
111
|
breakingChanges.push(breakingChangeExplanation
|
112
|
-
? `- ${
|
112
|
+
? `- ${change.scope ? `**${change.scope.trim()}:** ` : ''}${breakingChangeExplanation}`
|
113
113
|
: line);
|
114
114
|
}
|
115
115
|
}
|
@@ -128,20 +128,20 @@ const defaultChangelogRenderer = async ({ projectGraph, commits, releaseVersion,
|
|
128
128
|
}
|
129
129
|
if (changelogRenderOptions.authors) {
|
130
130
|
const _authors = new Map();
|
131
|
-
for (const
|
132
|
-
if (!
|
131
|
+
for (const change of changes) {
|
132
|
+
if (!change.author) {
|
133
133
|
continue;
|
134
134
|
}
|
135
|
-
const name = formatName(
|
135
|
+
const name = formatName(change.author.name);
|
136
136
|
if (!name || name.includes('[bot]')) {
|
137
137
|
continue;
|
138
138
|
}
|
139
139
|
if (_authors.has(name)) {
|
140
140
|
const entry = _authors.get(name);
|
141
|
-
entry.email.add(
|
141
|
+
entry.email.add(change.author.email);
|
142
142
|
}
|
143
143
|
else {
|
144
|
-
_authors.set(name, { email: new Set([
|
144
|
+
_authors.set(name, { email: new Set([change.author.email]) });
|
145
145
|
}
|
146
146
|
}
|
147
147
|
// Try to map authors to github usernames
|
@@ -214,15 +214,15 @@ function groupBy(items, key) {
|
|
214
214
|
}
|
215
215
|
return groups;
|
216
216
|
}
|
217
|
-
function
|
218
|
-
let
|
219
|
-
(
|
220
|
-
(
|
221
|
-
|
217
|
+
function formatChange(change, changelogRenderOptions, repoSlug) {
|
218
|
+
let changeLine = '- ' +
|
219
|
+
(change.isBreaking ? '⚠️ ' : '') +
|
220
|
+
(change.scope ? `**${change.scope.trim()}:** ` : '') +
|
221
|
+
change.description;
|
222
222
|
if (repoSlug && changelogRenderOptions.commitReferences) {
|
223
|
-
|
223
|
+
changeLine += (0, github_1.formatReferences)(change.githubReferences, repoSlug);
|
224
224
|
}
|
225
|
-
return
|
225
|
+
return changeLine;
|
226
226
|
}
|
227
227
|
/**
|
228
228
|
* It is common to add further information about a breaking change in the commit body,
|
@@ -230,6 +230,9 @@ function formatCommit(commit, changelogRenderOptions, repoSlug) {
|
|
230
230
|
* section of changelog, rather than repeating the commit title/description.
|
231
231
|
*/
|
232
232
|
function extractBreakingChangeExplanation(message) {
|
233
|
+
if (!message) {
|
234
|
+
return null;
|
235
|
+
}
|
233
236
|
const breakingChangeIdentifier = 'BREAKING CHANGE:';
|
234
237
|
const startIndex = message.indexOf(breakingChangeIdentifier);
|
235
238
|
if (startIndex === -1) {
|
package/schemas/nx-schema.json
CHANGED
@@ -184,6 +184,10 @@
|
|
184
184
|
},
|
185
185
|
"releaseTagPattern": {
|
186
186
|
"type": "string"
|
187
|
+
},
|
188
|
+
"versionPlans": {
|
189
|
+
"type": "boolean",
|
190
|
+
"description": "Enables using version plans as a specifier source for versioning and to determine changes for changelog generation."
|
187
191
|
}
|
188
192
|
},
|
189
193
|
"required": ["projects"]
|
@@ -234,6 +238,10 @@
|
|
234
238
|
"version": {
|
235
239
|
"$ref": "#/definitions/NxReleaseVersionConfiguration"
|
236
240
|
},
|
241
|
+
"versionPlans": {
|
242
|
+
"type": "boolean",
|
243
|
+
"description": "Enables using version plans as a specifier source for versioning and to determine changes for changelog generation."
|
244
|
+
},
|
237
245
|
"releaseTagPattern": {
|
238
246
|
"type": "string"
|
239
247
|
}
|
@@ -25,5 +25,7 @@ exports.yargsAddCommand = {
|
|
25
25
|
.example('$0 add @nx/react', 'Install the latest version of the `@nx/react` package and run its `@nx/react:init` generator')
|
26
26
|
.example('$0 add non-core-nx-plugin', 'Install the latest version of the `non-core-nx-plugin` package and run its `non-core-nx-plugin:init` generator if available')
|
27
27
|
.example('$0 add @nx/react@17.0.0', 'Install version `17.0.0` of the `@nx/react` package and run its `@nx/react:init` generator'),
|
28
|
-
handler: (args) =>
|
28
|
+
handler: async (args) => {
|
29
|
+
process.exit(await Promise.resolve().then(() => require('./add')).then((m) => m.addHandler((0, shared_options_1.withOverrides)(args))));
|
30
|
+
},
|
29
31
|
};
|
@@ -18,9 +18,10 @@ exports.yargsAffectedCommand = {
|
|
18
18
|
}
|
19
19
|
}), 'affected'),
|
20
20
|
handler: async (args) => {
|
21
|
-
|
21
|
+
const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
22
22
|
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', (0, shared_options_1.withOverrides)(args));
|
23
23
|
});
|
24
|
+
process.exit(exitCode);
|
24
25
|
},
|
25
26
|
};
|
26
27
|
exports.yargsAffectedTestCommand = {
|
@@ -28,12 +29,13 @@ exports.yargsAffectedTestCommand = {
|
|
28
29
|
describe: false,
|
29
30
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
30
31
|
handler: async (args) => {
|
31
|
-
|
32
|
+
const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
32
33
|
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
33
34
|
...(0, shared_options_1.withOverrides)(args),
|
34
35
|
target: 'test',
|
35
36
|
});
|
36
37
|
});
|
38
|
+
process.exit(exitCode);
|
37
39
|
},
|
38
40
|
};
|
39
41
|
exports.yargsAffectedBuildCommand = {
|
@@ -41,12 +43,13 @@ exports.yargsAffectedBuildCommand = {
|
|
41
43
|
describe: false,
|
42
44
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
43
45
|
handler: async (args) => {
|
44
|
-
|
46
|
+
const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
45
47
|
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
46
48
|
...(0, shared_options_1.withOverrides)(args),
|
47
49
|
target: 'build',
|
48
50
|
});
|
49
51
|
});
|
52
|
+
process.exit(exitCode);
|
50
53
|
},
|
51
54
|
};
|
52
55
|
exports.yargsAffectedLintCommand = {
|
@@ -54,12 +57,13 @@ exports.yargsAffectedLintCommand = {
|
|
54
57
|
describe: false,
|
55
58
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
56
59
|
handler: async (args) => {
|
57
|
-
|
60
|
+
const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
58
61
|
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
59
62
|
...(0, shared_options_1.withOverrides)(args),
|
60
63
|
target: 'lint',
|
61
64
|
});
|
62
65
|
});
|
66
|
+
process.exit(exitCode);
|
63
67
|
},
|
64
68
|
};
|
65
69
|
exports.yargsAffectedE2ECommand = {
|
@@ -67,11 +71,12 @@ exports.yargsAffectedE2ECommand = {
|
|
67
71
|
describe: false,
|
68
72
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
69
73
|
handler: async (args) => {
|
70
|
-
|
74
|
+
const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
71
75
|
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
72
76
|
...(0, shared_options_1.withOverrides)(args),
|
73
77
|
target: 'e2e',
|
74
78
|
});
|
75
79
|
});
|
80
|
+
process.exit(exitCode);
|
76
81
|
},
|
77
82
|
};
|
@@ -14,9 +14,12 @@ exports.yargsAffectedGraphCommand = {
|
|
14
14
|
describe: false,
|
15
15
|
aliases: ['affected:dep-graph'],
|
16
16
|
builder: (yargs) => (0, shared_options_1.withAffectedOptions)((0, command_object_1.withGraphOptions)(yargs)),
|
17
|
-
handler: (args) =>
|
18
|
-
|
19
|
-
|
17
|
+
handler: async (args) => {
|
18
|
+
const exitCode = await (0, params_1.handleErrors)(false, () => {
|
19
|
+
throw new Error(affectedGraphDeprecationMessage);
|
20
|
+
});
|
21
|
+
process.exit(exitCode);
|
22
|
+
},
|
20
23
|
deprecated: affectedGraphDeprecationMessage,
|
21
24
|
};
|
22
25
|
/**
|
@@ -35,8 +38,11 @@ exports.yargsPrintAffectedCommand = {
|
|
35
38
|
choices: ['app', 'lib'],
|
36
39
|
describe: 'Select the type of projects to be returned (e.g., --type=app)',
|
37
40
|
}),
|
38
|
-
handler: (args) =>
|
39
|
-
|
40
|
-
|
41
|
+
handler: async (args) => {
|
42
|
+
const exitCode = await (0, params_1.handleErrors)(false, () => {
|
43
|
+
throw new Error(printAffectedDeprecationMessage);
|
44
|
+
});
|
45
|
+
process.exit(exitCode);
|
46
|
+
},
|
41
47
|
deprecated: printAffectedDeprecationMessage,
|
42
48
|
};
|
@@ -284,6 +284,24 @@ exports.examples = {
|
|
284
284
|
description: 'Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each commit by additionally setting --commit-prefix="PREFIX_HERE "',
|
285
285
|
},
|
286
286
|
],
|
287
|
+
reset: [
|
288
|
+
{
|
289
|
+
command: 'reset',
|
290
|
+
description: 'Clears the internal state of the daemon and metadata that Nx is tracking. Helpful if you are getting strange errors and want to start fresh',
|
291
|
+
},
|
292
|
+
{
|
293
|
+
command: 'reset --only-cache',
|
294
|
+
description: 'Clears the Nx Cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache',
|
295
|
+
},
|
296
|
+
{
|
297
|
+
command: 'reset --only-daemon',
|
298
|
+
description: 'Stops the Nx Daemon, it will be restarted fresh when the next Nx command is run.',
|
299
|
+
},
|
300
|
+
{
|
301
|
+
command: 'reset --only-workspace-data',
|
302
|
+
description: 'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc)',
|
303
|
+
},
|
304
|
+
],
|
287
305
|
show: [
|
288
306
|
{
|
289
307
|
command: 'show projects',
|
@@ -18,4 +18,4 @@ export declare function parseGeneratorString(value: string): {
|
|
18
18
|
export declare function printGenHelp(opts: GenerateOptions, schema: Schema, normalizedGeneratorName: string, aliases: string[]): void;
|
19
19
|
export declare function generate(cwd: string, args: {
|
20
20
|
[k: string]: any;
|
21
|
-
}): Promise<
|
21
|
+
}): Promise<number>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { NxReleaseChangelogConfiguration } from '../../config/nx-json';
|
2
2
|
import { ChangelogOptions } from './command-object';
|
3
|
+
import { Reference } from './utils/git';
|
3
4
|
import { ReleaseVersion } from './utils/shared';
|
4
5
|
export interface NxReleaseChangelogResult {
|
5
6
|
workspaceChangelog?: {
|
@@ -13,7 +14,22 @@ export interface NxReleaseChangelogResult {
|
|
13
14
|
};
|
14
15
|
};
|
15
16
|
}
|
16
|
-
export
|
17
|
+
export interface ChangelogChange {
|
18
|
+
type: string;
|
19
|
+
scope: string;
|
20
|
+
description: string;
|
21
|
+
affectedProjects: string[] | '*';
|
22
|
+
body?: string;
|
23
|
+
isBreaking?: boolean;
|
24
|
+
githubReferences?: Reference[];
|
25
|
+
author?: {
|
26
|
+
name: string;
|
27
|
+
email: string;
|
28
|
+
};
|
29
|
+
shortHash?: string;
|
30
|
+
revertedHashes?: string[];
|
31
|
+
}
|
32
|
+
export declare const releaseChangelogCLIHandler: (args: ChangelogOptions) => Promise<number>;
|
17
33
|
/**
|
18
34
|
* NOTE: This function is also exported for programmatic usage and forms part of the public API
|
19
35
|
* of Nx. We intentionally do not wrap the implementation with handleErrors because users need
|