nx 19.2.0-canary.20240604-0594deb → 19.2.0-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/migrations.json +6 -0
  2. package/package.json +13 -12
  3. package/release/changelog-renderer/index.d.ts +6 -3
  4. package/release/changelog-renderer/index.js +53 -50
  5. package/schemas/nx-schema.json +8 -0
  6. package/src/command-line/add/add.d.ts +1 -1
  7. package/src/command-line/add/command-object.js +3 -1
  8. package/src/command-line/affected/command-object.js +10 -5
  9. package/src/command-line/deprecated/command-objects.js +12 -6
  10. package/src/command-line/examples.js +18 -0
  11. package/src/command-line/generate/generate.d.ts +1 -1
  12. package/src/command-line/migrate/migrate.d.ts +1 -1
  13. package/src/command-line/new/new.d.ts +1 -1
  14. package/src/command-line/release/changelog.d.ts +17 -1
  15. package/src/command-line/release/changelog.js +305 -76
  16. package/src/command-line/release/command-object.d.ts +14 -5
  17. package/src/command-line/release/command-object.js +52 -24
  18. package/src/command-line/release/config/config.js +38 -6
  19. package/src/command-line/release/config/filter-release-groups.d.ts +3 -1
  20. package/src/command-line/release/config/filter-release-groups.js +1 -0
  21. package/src/command-line/release/config/version-plans.d.ts +24 -0
  22. package/src/command-line/release/config/version-plans.js +184 -0
  23. package/src/command-line/release/plan.d.ts +3 -0
  24. package/src/command-line/release/plan.js +184 -0
  25. package/src/command-line/release/publish.d.ts +1 -1
  26. package/src/command-line/release/release.d.ts +1 -1
  27. package/src/command-line/release/release.js +40 -0
  28. package/src/command-line/release/utils/git.d.ts +10 -2
  29. package/src/command-line/release/utils/git.js +45 -10
  30. package/src/command-line/release/utils/shared.d.ts +12 -2
  31. package/src/command-line/release/utils/shared.js +3 -2
  32. package/src/command-line/release/version.d.ts +3 -2
  33. package/src/command-line/release/version.js +43 -5
  34. package/src/command-line/repair/repair.d.ts +1 -1
  35. package/src/command-line/reset/command-object.d.ts +6 -1
  36. package/src/command-line/reset/command-object.js +15 -2
  37. package/src/command-line/reset/reset.d.ts +2 -1
  38. package/src/command-line/reset/reset.js +98 -16
  39. package/src/command-line/run/command-object.js +6 -3
  40. package/src/command-line/run/run.d.ts +2 -2
  41. package/src/command-line/run-many/command-object.js +6 -3
  42. package/src/command-line/show/command-object.js +6 -6
  43. package/src/config/misc-interfaces.d.ts +15 -3
  44. package/src/config/nx-json.d.ts +11 -0
  45. package/src/daemon/tmp-dir.js +1 -1
  46. package/src/devkit-exports.d.ts +1 -1
  47. package/src/migrations/update-19-2-0/move-workspace-data-directory.d.ts +4 -0
  48. package/src/migrations/update-19-2-0/move-workspace-data-directory.js +34 -0
  49. package/src/plugins/js/index.js +2 -2
  50. package/src/plugins/js/project-graph/affected/lock-file-changes.js +11 -0
  51. package/src/plugins/js/project-graph/affected/npm-packages.js +12 -0
  52. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +3 -11
  53. package/src/plugins/js/utils/config.js +4 -0
  54. package/src/plugins/js/utils/register.d.ts +4 -3
  55. package/src/plugins/js/utils/register.js +47 -4
  56. package/src/project-graph/affected/affected-project-graph.js +6 -6
  57. package/src/project-graph/nx-deps-cache.js +6 -6
  58. package/src/project-graph/plugins/loader.js +1 -1
  59. package/src/tasks-runner/task-env.js +12 -0
  60. package/src/utils/cache-directory.d.ts +1 -1
  61. package/src/utils/cache-directory.js +13 -6
  62. package/src/utils/get-package-name-from-import-path.d.ts +1 -0
  63. package/src/utils/get-package-name-from-import-path.js +18 -0
  64. package/src/utils/package-json.d.ts +1 -0
  65. package/src/utils/package-manager.js +42 -9
  66. package/src/utils/params.d.ts +1 -1
  67. package/src/utils/params.js +5 -1
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.20240604-0594deb",
3
+ "version": "19.2.0-rc.0",
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.20240604-0594deb"
73
+ "@nrwl/tao": "19.2.0-rc.0"
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.20240604-0594deb",
88
- "@nx/nx-darwin-arm64": "19.2.0-canary.20240604-0594deb",
89
- "@nx/nx-linux-x64-gnu": "19.2.0-canary.20240604-0594deb",
90
- "@nx/nx-linux-x64-musl": "19.2.0-canary.20240604-0594deb",
91
- "@nx/nx-win32-x64-msvc": "19.2.0-canary.20240604-0594deb",
92
- "@nx/nx-linux-arm64-gnu": "19.2.0-canary.20240604-0594deb",
93
- "@nx/nx-linux-arm64-musl": "19.2.0-canary.20240604-0594deb",
94
- "@nx/nx-linux-arm-gnueabihf": "19.2.0-canary.20240604-0594deb",
95
- "@nx/nx-win32-arm64-msvc": "19.2.0-canary.20240604-0594deb",
96
- "@nx/nx-freebsd-x64": "19.2.0-canary.20240604-0594deb"
88
+ "@nx/nx-darwin-x64": "19.2.0-rc.0",
89
+ "@nx/nx-darwin-arm64": "19.2.0-rc.0",
90
+ "@nx/nx-linux-x64-gnu": "19.2.0-rc.0",
91
+ "@nx/nx-linux-x64-musl": "19.2.0-rc.0",
92
+ "@nx/nx-win32-x64-msvc": "19.2.0-rc.0",
93
+ "@nx/nx-linux-arm64-gnu": "19.2.0-rc.0",
94
+ "@nx/nx-linux-arm64-musl": "19.2.0-rc.0",
95
+ "@nx/nx-linux-arm-gnueabihf": "19.2.0-rc.0",
96
+ "@nx/nx-win32-arm64-msvc": "19.2.0-rc.0",
97
+ "@nx/nx-freebsd-x64": "19.2.0-rc.0"
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 type { GitCommit } from '../../src/command-line/release/utils/git';
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: GitCommit[];
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, commits, releaseVersion, project, entryWhenNoChanges, changelogRenderOptions, dependencyBumps, repoSlug, conventionalCommitsConfig, }) => {
14
- const commitTypes = conventionalCommitsConfig.types;
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 commits contains both a commit and its revert, we strip them both from the final list
18
- for (const commit of commits) {
19
- if (commit.type === 'revert') {
20
- for (const revertedHash of commit.revertedHashes) {
21
- const revertedCommit = commits.find((c) => revertedHash.startsWith(c.shortHash));
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
- commits.splice(commits.indexOf(revertedCommit), 1);
24
- commits.splice(commits.indexOf(commit), 1);
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 (commits.length === 0) {
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(commits, 'type');
45
+ const typeGroups = groupBy(changes, 'type');
47
46
  markdownLines.push('', createVersionTitle(releaseVersion, changelogRenderOptions), '');
48
- for (const type of Object.keys(commitTypes)) {
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('', '### ' + commitTypes[type].changelog.title, '');
52
+ markdownLines.push('', '### ' + changeTypes[type].changelog.title, '');
54
53
  /**
55
- * In order to make the final changelog most readable, we organize commits as follows:
56
- * - By scope, where scopes are in alphabetical order (commits with no scope are listed first)
57
- * - Within a particular scope grouping, we list commits in chronological order
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 commitsInChronologicalOrder = group.reverse();
60
- const commitsGroupedByScope = groupBy(commitsInChronologicalOrder, 'scope');
61
- const scopesSortedAlphabetically = Object.keys(commitsGroupedByScope).sort();
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 commits = commitsGroupedByScope[scope];
64
- for (const commit of commits) {
65
- const line = formatCommit(commit, changelogRenderOptions, repoSlug);
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 (commit.isBreaking) {
68
- const breakingChangeExplanation = extractBreakingChangeExplanation(commit.body);
66
+ if (change.isBreaking) {
67
+ const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
69
68
  breakingChanges.push(breakingChangeExplanation
70
- ? `- ${commit.scope ? `**${commit.scope.trim()}:** ` : ''}${breakingChangeExplanation}`
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 relevantCommits = await (0, shared_1.getCommitsRelevantToProjects)(projectGraph, commits, [project]);
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 (relevantCommits.length === 0) {
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 commits to have the unscoped commits first, before grouping by type
98
- relevantCommits.sort((a, b) => (b.scope ? 1 : 0) - (a.scope ? 1 : 0)), 'type');
99
- for (const type of Object.keys(commitTypes)) {
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('', `### ${commitTypes[type].changelog.title}`, '');
105
- const commitsInChronologicalOrder = group.reverse();
106
- for (const commit of commitsInChronologicalOrder) {
107
- const line = formatCommit(commit, changelogRenderOptions, repoSlug);
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 (commit.isBreaking) {
110
- const breakingChangeExplanation = extractBreakingChangeExplanation(commit.body);
109
+ if (change.isBreaking) {
110
+ const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
111
111
  breakingChanges.push(breakingChangeExplanation
112
- ? `- ${commit.scope ? `**${commit.scope.trim()}:** ` : ''}${breakingChangeExplanation}`
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 commit of commits) {
132
- if (!commit.author) {
131
+ for (const change of changes) {
132
+ if (!change.author) {
133
133
  continue;
134
134
  }
135
- const name = formatName(commit.author.name);
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(commit.author.email);
141
+ entry.email.add(change.author.email);
142
142
  }
143
143
  else {
144
- _authors.set(name, { email: new Set([commit.author.email]) });
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 formatCommit(commit, changelogRenderOptions, repoSlug) {
218
- let commitLine = '- ' +
219
- (commit.isBreaking ? '⚠️ ' : '') +
220
- (commit.scope ? `**${commit.scope.trim()}:** ` : '') +
221
- commit.description;
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
- commitLine += (0, github_1.formatReferences)(commit.references, repoSlug);
223
+ changeLine += (0, github_1.formatReferences)(change.githubReferences, repoSlug);
224
224
  }
225
- return commitLine;
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) {
@@ -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
  }
@@ -1,3 +1,3 @@
1
1
  import type { AddOptions } from './command-object';
2
- export declare function addHandler(options: AddOptions): Promise<void>;
2
+ export declare function addHandler(options: AddOptions): Promise<number>;
3
3
  export declare const coreNxPluginVersions: Map<string, string>;
@@ -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) => Promise.resolve().then(() => require('./add')).then((m) => m.addHandler((0, shared_options_1.withOverrides)(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
- return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
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
- return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
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
- return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
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
- return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
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
- return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
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) => (0, params_1.handleErrors)(false, () => {
18
- throw new Error(affectedGraphDeprecationMessage);
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) => (0, params_1.handleErrors)(false, () => {
39
- throw new Error(printAffectedDeprecationMessage);
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<any>;
21
+ }): Promise<number>;
@@ -110,5 +110,5 @@ export declare function executeMigrations(root: string, migrations: {
110
110
  }[]>;
111
111
  export declare function migrate(root: string, args: {
112
112
  [k: string]: any;
113
- }, rawArgs: string[]): Promise<any>;
113
+ }, rawArgs: string[]): Promise<number>;
114
114
  export {};
@@ -1,3 +1,3 @@
1
1
  export declare function newWorkspace(cwd: string, args: {
2
2
  [k: string]: any;
3
- }): Promise<any>;
3
+ }): 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 declare const releaseChangelogCLIHandler: (args: ChangelogOptions) => Promise<any>;
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