nx 22.0.0-beta.3 → 22.0.0-beta.4

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.
Files changed (50) hide show
  1. package/package.json +11 -11
  2. package/schemas/nx-schema.json +96 -83
  3. package/src/command-line/configure-ai-agents/command-object.d.ts +1 -1
  4. package/src/command-line/configure-ai-agents/command-object.d.ts.map +1 -1
  5. package/src/command-line/configure-ai-agents/command-object.js +18 -4
  6. package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
  7. package/src/command-line/configure-ai-agents/configure-ai-agents.js +58 -31
  8. package/src/command-line/nx-cloud/login/command-object.d.ts.map +1 -1
  9. package/src/command-line/nx-cloud/login/command-object.js +2 -2
  10. package/src/command-line/nx-cloud/logout/command-object.js +1 -1
  11. package/src/command-line/release/changelog.d.ts.map +1 -1
  12. package/src/command-line/release/changelog.js +40 -29
  13. package/src/command-line/release/command-object.d.ts +7 -3
  14. package/src/command-line/release/command-object.d.ts.map +1 -1
  15. package/src/command-line/release/config/config.d.ts.map +1 -1
  16. package/src/command-line/release/config/config.js +14 -0
  17. package/src/command-line/release/config/version-plans.d.ts.map +1 -1
  18. package/src/command-line/release/config/version-plans.js +4 -1
  19. package/src/command-line/release/publish.d.ts.map +1 -1
  20. package/src/command-line/release/publish.js +35 -11
  21. package/src/command-line/release/release.d.ts.map +1 -1
  22. package/src/command-line/release/release.js +31 -30
  23. package/src/command-line/release/utils/release-graph.d.ts +219 -0
  24. package/src/command-line/release/utils/release-graph.d.ts.map +1 -0
  25. package/src/command-line/release/utils/release-graph.js +658 -0
  26. package/src/command-line/release/utils/semver.d.ts +1 -2
  27. package/src/command-line/release/utils/semver.d.ts.map +1 -1
  28. package/src/command-line/release/utils/semver.js +3 -5
  29. package/src/command-line/release/utils/shared.d.ts +1 -1
  30. package/src/command-line/release/utils/shared.d.ts.map +1 -1
  31. package/src/command-line/release/utils/shared.js +49 -15
  32. package/src/command-line/release/version/release-group-processor.d.ts +3 -152
  33. package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
  34. package/src/command-line/release/version/release-group-processor.js +50 -569
  35. package/src/command-line/release/version/resolve-current-version.d.ts +1 -1
  36. package/src/command-line/release/version/resolve-current-version.d.ts.map +1 -1
  37. package/src/command-line/release/version/resolve-current-version.js +1 -1
  38. package/src/command-line/release/version/test-utils.d.ts +13 -4
  39. package/src/command-line/release/version/test-utils.d.ts.map +1 -1
  40. package/src/command-line/release/version/test-utils.js +26 -11
  41. package/src/command-line/release/version/version-actions.d.ts +12 -5
  42. package/src/command-line/release/version/version-actions.d.ts.map +1 -1
  43. package/src/command-line/release/version/version-actions.js +36 -19
  44. package/src/command-line/release/version.d.ts +6 -1
  45. package/src/command-line/release/version.d.ts.map +1 -1
  46. package/src/command-line/release/version.js +57 -28
  47. package/src/config/nx-json.d.ts +26 -4
  48. package/src/config/nx-json.d.ts.map +1 -1
  49. package/src/config/nx-json.js +8 -8
  50. package/src/tasks-runner/run-command.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "22.0.0-beta.3",
3
+ "version": "22.0.0-beta.4",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -83,16 +83,16 @@
83
83
  }
84
84
  },
85
85
  "optionalDependencies": {
86
- "@nx/nx-darwin-arm64": "22.0.0-beta.3",
87
- "@nx/nx-darwin-x64": "22.0.0-beta.3",
88
- "@nx/nx-freebsd-x64": "22.0.0-beta.3",
89
- "@nx/nx-linux-arm-gnueabihf": "22.0.0-beta.3",
90
- "@nx/nx-linux-arm64-gnu": "22.0.0-beta.3",
91
- "@nx/nx-linux-arm64-musl": "22.0.0-beta.3",
92
- "@nx/nx-linux-x64-gnu": "22.0.0-beta.3",
93
- "@nx/nx-linux-x64-musl": "22.0.0-beta.3",
94
- "@nx/nx-win32-arm64-msvc": "22.0.0-beta.3",
95
- "@nx/nx-win32-x64-msvc": "22.0.0-beta.3"
86
+ "@nx/nx-darwin-arm64": "22.0.0-beta.4",
87
+ "@nx/nx-darwin-x64": "22.0.0-beta.4",
88
+ "@nx/nx-freebsd-x64": "22.0.0-beta.4",
89
+ "@nx/nx-linux-arm-gnueabihf": "22.0.0-beta.4",
90
+ "@nx/nx-linux-arm64-gnu": "22.0.0-beta.4",
91
+ "@nx/nx-linux-arm64-musl": "22.0.0-beta.4",
92
+ "@nx/nx-linux-x64-gnu": "22.0.0-beta.4",
93
+ "@nx/nx-linux-x64-musl": "22.0.0-beta.4",
94
+ "@nx/nx-win32-arm64-msvc": "22.0.0-beta.4",
95
+ "@nx/nx-win32-x64-msvc": "22.0.0-beta.4"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -160,90 +160,98 @@
160
160
  },
161
161
  "groups": {
162
162
  "type": "object",
163
- "properties": {
164
- "projectsRelationship": {
165
- "type": "string",
166
- "enum": ["fixed", "independent"]
167
- },
168
- "projects": {
169
- "oneOf": [
170
- {
171
- "type": "string",
172
- "description": "A project name"
173
- },
174
- {
175
- "type": "array",
176
- "description": "An array of project names",
177
- "minItems": 1,
178
- "items": {
179
- "type": "string"
163
+ "additionalProperties": {
164
+ "type": "object",
165
+ "properties": {
166
+ "projectsRelationship": {
167
+ "type": "string",
168
+ "enum": ["fixed", "independent"]
169
+ },
170
+ "projects": {
171
+ "oneOf": [
172
+ {
173
+ "type": "string",
174
+ "description": "A project name"
175
+ },
176
+ {
177
+ "type": "array",
178
+ "description": "An array of project names",
179
+ "minItems": 1,
180
+ "items": {
181
+ "type": "string"
182
+ }
180
183
  }
181
- }
182
- ]
183
- },
184
- "version": {
185
- "$ref": "#/definitions/NxReleaseGroupVersionConfiguration"
186
- },
187
- "changelog": {
188
- "oneOf": [
189
- {
190
- "$ref": "#/definitions/NxReleaseChangelogConfiguration"
191
- },
192
- {
193
- "type": "boolean"
194
- }
195
- ]
196
- },
197
- "releaseTagPattern": {
198
- "type": "string",
199
- "description": "Optionally override the git/release tag pattern to use for this group."
200
- },
201
- "releaseTagPatternCheckAllBranchesWhen": {
202
- "oneOf": [
203
- {
204
- "type": "boolean"
205
- },
206
- {
207
- "type": "array",
208
- "items": {
209
- "type": "string"
184
+ ]
185
+ },
186
+ "version": {
187
+ "$ref": "#/definitions/NxReleaseGroupVersionConfiguration"
188
+ },
189
+ "changelog": {
190
+ "oneOf": [
191
+ {
192
+ "$ref": "#/definitions/NxReleaseChangelogConfiguration"
193
+ },
194
+ {
195
+ "type": "boolean"
210
196
  }
211
- }
212
- ],
213
- "description": "By default, we will try and resolve the latest match for the releaseTagPattern from the current branch, falling back to all branches if no match is found on the current branch. Setting this to true will cause us to ALWAYS check all branches for the latest match. Setting it to false will cause us to ONLY check the current branch for the latest match. Setting it to an array of strings will cause us to check all branches WHEN the current branch is one of the strings in the array. Glob patterns are supported."
214
- },
215
- "releaseTagPatternRequireSemver": {
216
- "type": "boolean",
217
- "description": "Whether to require semver to be used for the release tag pattern. If set to false, the release tag pattern will not be checked for semver compliance."
218
- },
219
- "releaseTagPatternStrictPreid": {
220
- "$ref": "#/definitions/NxReleaseReleaseTagPatternStrictPreidConfiguration"
221
- },
222
- "versionPlans": {
223
- "oneOf": [
224
- {
225
- "$ref": "#/definitions/NxReleaseVersionPlansConfiguration"
226
- },
227
- {
228
- "type": "boolean",
229
- "description": "Enables using version plans as a specifier source for versioning and to determine changes for changelog generation."
230
- }
231
- ]
197
+ ]
198
+ },
199
+ "releaseTagPattern": {
200
+ "type": "string",
201
+ "description": "Optionally override the git/release tag pattern to use for this group."
202
+ },
203
+ "releaseTagPatternCheckAllBranchesWhen": {
204
+ "oneOf": [
205
+ {
206
+ "type": "boolean"
207
+ },
208
+ {
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string"
212
+ }
213
+ }
214
+ ],
215
+ "description": "By default, we will try and resolve the latest match for the releaseTagPattern from the current branch, falling back to all branches if no match is found on the current branch. Setting this to true will cause us to ALWAYS check all branches for the latest match. Setting it to false will cause us to ONLY check the current branch for the latest match. Setting it to an array of strings will cause us to check all branches WHEN the current branch is one of the strings in the array. Glob patterns are supported."
216
+ },
217
+ "releaseTagPatternRequireSemver": {
218
+ "type": "boolean",
219
+ "description": "Whether to require semver to be used for the release tag pattern. If set to false, the release tag pattern will not be checked for semver compliance."
220
+ },
221
+ "releaseTagPatternPreferDockerVersion": {
222
+ "type": ["boolean", "string"],
223
+ "enum": [true, false, "both"],
224
+ "description": "Controls how docker versions are used relative to semver versions when creating git tags and changelog entries. Set to true to use only the docker version, false to use only the semver version, or 'both' to create tags and changelog entries for both docker and semver versions. By default, this is set to true when docker configuration is present, and false otherwise."
225
+ },
226
+ "releaseTagPatternStrictPreid": {
227
+ "$ref": "#/definitions/NxReleaseReleaseTagPatternStrictPreidConfiguration"
228
+ },
229
+ "versionPlans": {
230
+ "oneOf": [
231
+ {
232
+ "$ref": "#/definitions/NxReleaseVersionPlansConfiguration"
233
+ },
234
+ {
235
+ "type": "boolean",
236
+ "description": "Enables using version plans as a specifier source for versioning and to determine changes for changelog generation."
237
+ }
238
+ ]
239
+ },
240
+ "docker": {
241
+ "oneOf": [
242
+ {
243
+ "type": "boolean",
244
+ "enum": [true],
245
+ "description": "Enable docker configuration with default settings. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning. "
246
+ },
247
+ {
248
+ "$ref": "#/definitions/NxReleaseGroupDockerConfiguration"
249
+ }
250
+ ]
251
+ }
232
252
  },
233
- "docker": {
234
- "oneOf": [
235
- {
236
- "type": "boolean",
237
- "enum": [true],
238
- "description": "Enable docker configuration with default settings. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning. "
239
- },
240
- {
241
- "$ref": "#/definitions/NxReleaseGroupDockerConfiguration"
242
- }
243
- ]
244
- }
245
- },
246
- "required": ["projects"]
253
+ "required": ["projects"]
254
+ }
247
255
  },
248
256
  "changelog": {
249
257
  "type": "object",
@@ -323,6 +331,11 @@
323
331
  "type": "boolean",
324
332
  "description": "Whether to require semver to be used for the release tag pattern. If set to false, the release tag pattern will not be checked for semver compliance."
325
333
  },
334
+ "releaseTagPatternPreferDockerVersion": {
335
+ "type": ["boolean", "string"],
336
+ "enum": [true, false, "both"],
337
+ "description": "Controls how docker versions are used relative to semver versions when creating git tags and changelog entries. Set to true to use only the docker version, false to use only the semver version, or 'both' to create tags and changelog entries for both docker and semver versions. By default, this is set to true when docker configuration is present, and false otherwise."
338
+ },
326
339
  "releaseTagPatternStrictPreid": {
327
340
  "$ref": "#/definitions/NxReleaseReleaseTagPatternStrictPreidConfiguration"
328
341
  },
@@ -833,9 +846,9 @@
833
846
  },
834
847
  "updateDependents": {
835
848
  "type": "string",
836
- "enum": ["never", "auto"],
849
+ "enum": ["never", "auto", "always"],
837
850
  "default": "auto",
838
- "description": "When versioning independent projects, this controls whether to update their dependents (i.e. the things that depend on them). 'never' means no dependents will be updated (unless they happen to be versioned directly as well). 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned."
851
+ "description": "When versioning independent projects, this controls whether to update their dependents (i.e. the things that depend on them). 'never' means no dependents will be updated (unless they happen to be versioned directly as well). 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned, as long as a group or projects filter is not applied that does not include them. 'always' will cause dependents to be updated (a patch version bump) when a dependency is versioned, even if they are not included in the group or projects filter."
839
852
  },
840
853
  "logUnchangedProjects": {
841
854
  "type": "boolean",
@@ -3,7 +3,7 @@ export interface ConfigureAiAgentsOptions {
3
3
  agents?: string[];
4
4
  interactive?: boolean;
5
5
  verbose?: boolean;
6
- check?: boolean;
6
+ check?: boolean | 'outdated' | 'all';
7
7
  }
8
8
  export declare const yargsConfigureAiAgentsCommand: CommandModule<{}, ConfigureAiAgentsOptions>;
9
9
  //# sourceMappingURL=command-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,6BAA6B,EAAE,aAAa,CACvD,EAAE,EACF,wBAAwB,CA6CzB,CAAC"}
1
+ {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;CACtC;AAED,eAAO,MAAM,6BAA6B,EAAE,aAAa,CACvD,EAAE,EACF,wBAAwB,CA2DzB,CAAC"}
@@ -18,14 +18,28 @@ exports.yargsConfigureAiAgentsCommand = {
18
18
  default: true,
19
19
  })
20
20
  .option('check', {
21
- type: 'boolean',
22
- description: 'Check if any configured agents are out of date and need to be updated. Does not make any changes.',
23
- default: false,
21
+ type: 'string',
22
+ description: 'Check agent configurations. Use --check or --check=outdated to check only configured agents, or --check=all to include unconfigured/partial configurations. Does not make any changes.',
23
+ coerce: (value) => {
24
+ // --check (no value)
25
+ if (value === '')
26
+ return 'outdated';
27
+ // --check=true
28
+ if (value === 'true')
29
+ return 'outdated';
30
+ // --no-check or --check=false
31
+ if (value === 'false')
32
+ return false;
33
+ // --check=all or --check=outdated
34
+ return value;
35
+ },
36
+ choices: ['outdated', 'all'],
24
37
  })
25
38
  .example('$0 configure-ai-agents', 'Interactively select AI agents to update and configure')
26
39
  .example('$0 configure-ai-agents --agents claude gemini', 'Prompts for updates and and configuration of Claude and Gemini AI agents')
27
40
  .example('$0 configure-ai-agents --check', 'Checks if any configured agents are out of date and need to be updated')
28
- .example('$0 configure-ai-agents --agents claude gemini --no-interactive', 'Configures and updates Claude and Gemini AI agents without prompts'),
41
+ .example('$0 configure-ai-agents --check=all', 'Checks if any agents are not configured, out of date or partially configured')
42
+ .example('$0 configure-ai-agents --agents claude gemini --no-interactive', 'Configures and updates Claude and Gemini AI agents without prompts'), // because of the coerce function
29
43
  handler: async (args) => {
30
44
  await (await Promise.resolve().then(() => require('./configure-ai-agents'))).configureAiAgentsHandler(args);
31
45
  },
@@ -1 +1 @@
1
- {"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,wBAAwB,EAC9B,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CA2Mf"}
1
+ {"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,wBAAwB,EAC9B,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAyOf"}
@@ -64,38 +64,64 @@ async function configureAiAgentsHandlerImpl(options) {
64
64
  });
65
65
  process.exit(1);
66
66
  }
67
- if (options.check) {
68
- if (fullyConfiguredAgents.length === 0) {
69
- output_1.output.log({
70
- title: 'No AI agents are configured',
71
- bodyLines: [
72
- 'You can configure AI agents by running `nx configure-ai-agents`.',
73
- ],
74
- });
75
- process.exit(0);
76
- }
67
+ // important for wording
68
+ const usingAllAgents = normalizedOptions.agents.length === utils_1.supportedAgents.length;
69
+ if (normalizedOptions.check) {
77
70
  const outOfDateAgents = fullyConfiguredAgents.filter((a) => a?.outdated);
78
- if (outOfDateAgents.length === 0) {
79
- output_1.output.success({
80
- title: 'All configured AI agents are up to date',
81
- bodyLines: fullyConfiguredAgents.map((a) => `- ${a.displayName}`),
82
- });
83
- process.exit(0);
71
+ // only error if something is fully configured but outdated
72
+ if (normalizedOptions.check === 'outdated') {
73
+ if (fullyConfiguredAgents.length === 0) {
74
+ output_1.output.log({
75
+ title: 'No AI agents are configured',
76
+ bodyLines: [
77
+ 'You can configure AI agents by running `nx configure-ai-agents`.',
78
+ ],
79
+ });
80
+ process.exit(0);
81
+ }
82
+ if (outOfDateAgents.length === 0) {
83
+ output_1.output.success({
84
+ title: 'All configured AI agents are up to date',
85
+ bodyLines: fullyConfiguredAgents.map((a) => `- ${a.displayName}`),
86
+ });
87
+ process.exit(0);
88
+ }
89
+ else {
90
+ output_1.output.log({
91
+ title: 'The following AI agents are out of date:',
92
+ bodyLines: [
93
+ ...outOfDateAgents.map((a) => {
94
+ const rulesPath = a.rulesPath;
95
+ const displayPath = rulesPath.startsWith(workspace_root_1.workspaceRoot)
96
+ ? (0, path_1.relative)(workspace_root_1.workspaceRoot, rulesPath)
97
+ : rulesPath;
98
+ return `- ${a.displayName} (${displayPath})`;
99
+ }),
100
+ '',
101
+ 'You can update them by running `nx configure-ai-agents`.',
102
+ ],
103
+ });
104
+ process.exit(1);
105
+ }
106
+ // error on any partial, outdated or non-configured agent
84
107
  }
85
- else {
86
- output_1.output.log({
87
- title: 'The following AI agents are out of date:',
108
+ else if (normalizedOptions.check === 'all') {
109
+ if (partiallyConfiguredAgents.length === 0 &&
110
+ outOfDateAgents.length === 0 &&
111
+ nonConfiguredAgents.length === 0) {
112
+ output_1.output.success({
113
+ title: `All ${!usingAllAgents ? 'selected' : 'supported'} AI agents are fully configured and up to date`,
114
+ bodyLines: fullyConfiguredAgents.map((a) => `- ${a.displayName}`),
115
+ });
116
+ process.exit(0);
117
+ }
118
+ output_1.output.error({
119
+ title: 'The following agents are not fully configured or up to date:',
88
120
  bodyLines: [
89
- ...outOfDateAgents.map((a) => {
90
- const rulesPath = a.rulesPath;
91
- const displayPath = rulesPath.startsWith(workspace_root_1.workspaceRoot)
92
- ? (0, path_1.relative)(workspace_root_1.workspaceRoot, rulesPath)
93
- : rulesPath;
94
- return `- ${a.displayName} (${displayPath})`;
95
- }),
96
- '',
97
- 'You can update them by running `nx configure-ai-agents`.',
98
- ],
121
+ ...partiallyConfiguredAgents,
122
+ ...outOfDateAgents,
123
+ ...nonConfiguredAgents,
124
+ ].map((a) => getAgentChoiceForPrompt(a).message),
99
125
  });
100
126
  process.exit(1);
101
127
  }
@@ -123,7 +149,6 @@ async function configureAiAgentsHandlerImpl(options) {
123
149
  currentIndex++;
124
150
  });
125
151
  if (allAgentChoices.length === 0) {
126
- const usingAllAgents = normalizedOptions.agents.length === utils_1.supportedAgents.length;
127
152
  output_1.output.success({
128
153
  title: `No new agents to configure. All ${!usingAllAgents ? 'selected' : 'supported'} AI agents are already configured:`,
129
154
  bodyLines: fullyConfiguredAgents.map((agent) => `- ${agent.displayName}`),
@@ -228,9 +253,11 @@ function getAgentChoiceForPrompt(agent) {
228
253
  }
229
254
  function normalizeOptions(options) {
230
255
  const agents = (options.agents ?? utils_1.supportedAgents).filter((a) => utils_1.supportedAgents.includes(a));
256
+ // it used to be just --check which was implicitly 'outdated'
257
+ const check = (options.check === true ? 'outdated' : options.check) ?? false;
231
258
  return {
232
259
  ...options,
233
260
  agents,
234
- check: options.check ?? false,
261
+ check,
235
262
  };
236
263
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/login/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE,aAmB/B,CAAC"}
1
+ {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/login/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE,aAkB/B,CAAC"}
@@ -4,9 +4,9 @@ exports.yargsLoginCommand = void 0;
4
4
  const shared_options_1 = require("../../yargs-utils/shared-options");
5
5
  exports.yargsLoginCommand = {
6
6
  command: 'login [nxCloudUrl]',
7
- describe: 'Login to Nx Cloud. This command is an alias for [`nx-cloud login`](/ci/reference/nx-cloud-cli#npx-nxcloud-login).',
7
+ describe: 'Login to Nx Cloud. This command is an alias for `nx-cloud login`.',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs.positional('nxCloudUrl', {
9
- describe: 'The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to https://cloud.nx.app.',
9
+ describe: 'The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to your configured Nx Cloud instance by default.',
10
10
  type: 'string',
11
11
  required: false,
12
12
  }))
@@ -4,7 +4,7 @@ exports.yargsLogoutCommand = void 0;
4
4
  const shared_options_1 = require("../../yargs-utils/shared-options");
5
5
  exports.yargsLogoutCommand = {
6
6
  command: 'logout',
7
- describe: 'Logout from Nx Cloud. This command is an alias for [`nx-cloud logout`](/ci/reference/nx-cloud-cli#npx-nxcloud-logout).',
7
+ describe: 'Logout from Nx Cloud. This command is an alias for `nx-cloud logout`.',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
9
9
  .help(false)
10
10
  .showHelpOnFail(false)
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkBpD,OAAO,EAEL,SAAS,EAWV,MAAM,aAAa,CAAC;AAYrB,OAAO,EACL,cAAc,EASf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE;QACnB,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE;QAClB,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,cAAc,EAAE,cAAc,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,gBAAgB,KACrB,OAAO,CAAC,wBAAwB,CAAC,CAyqBrC"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAepD,OAAO,EAEL,SAAS,EAUV,MAAM,aAAa,CAAC;AASrB,OAAO,EACL,cAAc,EASf,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE;QACnB,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE;QAClB,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,cAAc,EAAE,cAAc,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,gBAAgB,KACrB,OAAO,CAAC,wBAAwB,CAAC,CAsqBrC"}
@@ -19,18 +19,18 @@ const path_1 = require("../../utils/path");
19
19
  const workspace_root_1 = require("../../utils/workspace-root");
20
20
  const config_1 = require("./config/config");
21
21
  const deep_merge_json_1 = require("./config/deep-merge-json");
22
- const filter_release_groups_1 = require("./config/filter-release-groups");
23
22
  const version_plans_1 = require("./config/version-plans");
24
23
  const git_1 = require("./utils/git");
25
24
  const launch_editor_1 = require("./utils/launch-editor");
26
25
  const markdown_1 = require("./utils/markdown");
27
26
  const print_changes_1 = require("./utils/print-changes");
28
27
  const print_config_1 = require("./utils/print-config");
28
+ const release_graph_1 = require("./utils/release-graph");
29
29
  const remote_release_client_1 = require("./utils/remote-release-clients/remote-release-client");
30
30
  const resolve_changelog_renderer_1 = require("./utils/resolve-changelog-renderer");
31
31
  const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
32
- const version_plan_utils_1 = require("./utils/version-plan-utils");
33
32
  const shared_1 = require("./utils/shared");
33
+ const version_plan_utils_1 = require("./utils/version-plan-utils");
34
34
  const releaseChangelogCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, () => createAPI({})(args));
35
35
  exports.releaseChangelogCLIHandler = releaseChangelogCLIHandler;
36
36
  function createAPI(overrideReleaseConfig) {
@@ -74,19 +74,30 @@ function createAPI(overrideReleaseConfig) {
74
74
  });
75
75
  process.exit(1);
76
76
  }
77
- const { error: filterError, filterLog, releaseGroups, releaseGroupToFilteredProjects, } = (0, filter_release_groups_1.filterReleaseGroups)(projectGraph, nxReleaseConfig, args.projects, args.groups);
78
- if (filterError) {
79
- output_1.output.error(filterError);
80
- process.exit(1);
81
- }
82
- if (filterLog &&
77
+ const tree = new tree_1.FsTree(workspace_root_1.workspaceRoot, args.verbose);
78
+ // Use pre-built release graph if provided, otherwise create a new one
79
+ const releaseGraph = args.releaseGraph ||
80
+ (await (0, release_graph_1.createReleaseGraph)({
81
+ tree,
82
+ projectGraph,
83
+ nxReleaseConfig,
84
+ filters: {
85
+ projects: args.projects,
86
+ groups: args.groups,
87
+ },
88
+ firstRelease: args.firstRelease,
89
+ verbose: args.verbose,
90
+ }));
91
+ // Display filter log if filters were applied (only when graph was created, not reused)
92
+ if (!args.releaseGraph &&
93
+ releaseGraph.filterLog &&
83
94
  process.env.NX_RELEASE_INTERNAL_SUPPRESS_FILTER_LOG !== 'true') {
84
- output_1.output.note(filterLog);
95
+ output_1.output.note(releaseGraph.filterLog);
85
96
  }
86
97
  const rawVersionPlans = await (0, version_plans_1.readRawVersionPlans)();
87
- await (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGroups, Object.keys(projectGraph.nodes), args.verbose);
98
+ await (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGraph.releaseGroups, Object.keys(projectGraph.nodes), args.verbose);
88
99
  // Validate version plans against the filter after resolution
89
- const versionPlanValidationError = (0, version_plan_utils_1.validateResolvedVersionPlansAgainstFilter)(releaseGroups, releaseGroupToFilteredProjects);
100
+ const versionPlanValidationError = (0, version_plan_utils_1.validateResolvedVersionPlansAgainstFilter)(releaseGraph.releaseGroups, releaseGraph.releaseGroupToFilteredProjects);
90
101
  if (versionPlanValidationError) {
91
102
  output_1.output.error(versionPlanValidationError);
92
103
  process.exit(1);
@@ -106,7 +117,6 @@ function createAPI(overrideReleaseConfig) {
106
117
  });
107
118
  return {};
108
119
  }
109
- const tree = new tree_1.FsTree(workspace_root_1.workspaceRoot, args.verbose);
110
120
  const useAutomaticFromRef = nxReleaseConfig.changelog?.automaticFromRef || args.firstRelease;
111
121
  /**
112
122
  * For determining the versions to use within changelog files, there are a few different possibilities:
@@ -122,7 +132,7 @@ function createAPI(overrideReleaseConfig) {
122
132
  * - in this case, the version property will be used as the reference for the workspace changelog, and the versionData object will be used
123
133
  * to generate project changelogs
124
134
  */
125
- const { workspaceChangelogVersion, projectsVersionData } = resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredProjects);
135
+ const { workspaceChangelogVersion, projectsVersionData } = resolveChangelogVersions(args, releaseGraph);
126
136
  const to = args.to || 'HEAD';
127
137
  const toSHA = await (0, git_1.getCommitHash)(to);
128
138
  const headSHA = to === 'HEAD' ? toSHA : await (0, git_1.getCommitHash)('HEAD');
@@ -145,19 +155,19 @@ function createAPI(overrideReleaseConfig) {
145
155
  throw new Error(`You are attempting to recreate the changelog for an old release, but you have enabled auto-commit mode. Please disable auto-commit mode by updating your nx.json, or passing --git-commit=false`);
146
156
  }
147
157
  const commitMessage = args.gitCommitMessage || nxReleaseConfig.changelog.git.commitMessage;
148
- const commitMessageValues = (0, shared_1.createCommitMessageValues)(releaseGroups, releaseGroupToFilteredProjects, projectsVersionData, commitMessage);
158
+ const commitMessageValues = (0, shared_1.createCommitMessageValues)(releaseGraph.releaseGroups, releaseGraph.releaseGroupToFilteredProjects, projectsVersionData, commitMessage);
149
159
  // Resolve any git tags as early as possible so that we can hard error in case of any duplicates before reaching the actual git command
150
160
  const gitTagValues = args.gitTag ?? nxReleaseConfig.changelog.git.tag
151
- ? (0, shared_1.createGitTagValues)(releaseGroups, releaseGroupToFilteredProjects, projectsVersionData)
161
+ ? (0, shared_1.createGitTagValues)(releaseGraph.releaseGroups, releaseGraph.releaseGroupToFilteredProjects, projectsVersionData)
152
162
  : [];
153
163
  (0, shared_1.handleDuplicateGitTags)(gitTagValues);
154
164
  const postGitTasks = [];
155
165
  let workspaceChangelogChanges = [];
156
166
  // If there are multiple release groups, we'll just skip the workspace changelog anyway.
157
- const versionPlansEnabledForWorkspaceChangelog = releaseGroups[0].resolvedVersionPlans;
167
+ const versionPlansEnabledForWorkspaceChangelog = releaseGraph.releaseGroups[0].resolvedVersionPlans;
158
168
  if (versionPlansEnabledForWorkspaceChangelog) {
159
- if (releaseGroups.length === 1) {
160
- const releaseGroup = releaseGroups[0];
169
+ if (releaseGraph.releaseGroups.length === 1) {
170
+ const releaseGroup = releaseGraph.releaseGroups[0];
161
171
  if (releaseGroup.projectsRelationship === 'fixed') {
162
172
  const versionPlans = releaseGroup.resolvedVersionPlans;
163
173
  workspaceChangelogChanges = versionPlans
@@ -254,7 +264,7 @@ function createAPI(overrideReleaseConfig) {
254
264
  * and figuring them out during the main iteration would be too late.
255
265
  */
256
266
  const projectToAdditionalDependencyBumps = new Map();
257
- for (const releaseGroup of releaseGroups) {
267
+ for (const releaseGroup of releaseGraph.releaseGroups) {
258
268
  if (releaseGroup.projectsRelationship !== 'independent') {
259
269
  continue;
260
270
  }
@@ -285,7 +295,7 @@ function createAPI(overrideReleaseConfig) {
285
295
  }
286
296
  }
287
297
  const allProjectChangelogs = {};
288
- for (const releaseGroup of releaseGroups) {
298
+ for (const releaseGroup of releaseGraph.releaseGroups) {
289
299
  const config = releaseGroup.changelog;
290
300
  // The entire feature is disabled at the release group level, exit early
291
301
  if (config === false) {
@@ -293,7 +303,7 @@ function createAPI(overrideReleaseConfig) {
293
303
  }
294
304
  const projects = args.projects?.length
295
305
  ? // If the user has passed a list of projects, we need to use the filtered list of projects within the release group, plus any dependents
296
- Array.from(releaseGroupToFilteredProjects.get(releaseGroup)).flatMap((project) => {
306
+ Array.from(releaseGraph.releaseGroupToFilteredProjects.get(releaseGroup)).flatMap((project) => {
297
307
  return [
298
308
  project,
299
309
  ...(projectsVersionData[project]?.dependentProjects.map((dep) => dep.source) || []),
@@ -509,19 +519,19 @@ function createAPI(overrideReleaseConfig) {
509
519
  }
510
520
  }
511
521
  }
512
- await applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTasks, commitMessageValues, gitTagValues, releaseGroups, releaseGroupToFilteredProjects);
522
+ await applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTasks, commitMessageValues, gitTagValues, releaseGraph);
513
523
  return {
514
524
  workspaceChangelog,
515
525
  projectChangelogs: allProjectChangelogs,
516
526
  };
517
527
  };
518
528
  }
519
- function resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredProjects) {
529
+ function resolveChangelogVersions(args, releaseGraph) {
520
530
  if (!args.version && !args.versionData) {
521
531
  throw new Error(`You must provide a version string and/or a versionData object.`);
522
532
  }
523
- const versionData = releaseGroups.reduce((versionData, releaseGroup) => {
524
- const releaseGroupProjectNames = Array.from(releaseGroupToFilteredProjects.get(releaseGroup));
533
+ const versionData = releaseGraph.releaseGroups.reduce((versionData, releaseGroup) => {
534
+ const releaseGroupProjectNames = Array.from(releaseGraph.releaseGroupToFilteredProjects.get(releaseGroup));
525
535
  for (const projectName of releaseGroupProjectNames) {
526
536
  if (!args.versionData) {
527
537
  versionData[projectName] = {
@@ -560,7 +570,7 @@ function applyRemoteReleaseProviderName(newRemoteReleaseProviderName) {
560
570
  remoteReleaseProviderName = newRemoteReleaseProviderName;
561
571
  }
562
572
  }
563
- async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTasks, commitMessageValues, gitTagValues, releaseGroups, releaseGroupToFilteredProjects) {
573
+ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTasks, commitMessageValues, gitTagValues, releaseGraph) {
564
574
  let latestCommit = toSHA;
565
575
  const changes = tree.listChanges();
566
576
  /**
@@ -603,8 +613,8 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
603
613
  let deletedFiles = [];
604
614
  if (args.deleteVersionPlans) {
605
615
  const planFiles = new Set();
606
- releaseGroups.forEach((group) => {
607
- const filteredProjects = releaseGroupToFilteredProjects.get(group);
616
+ releaseGraph.releaseGroups.forEach((group) => {
617
+ const filteredProjects = releaseGraph.releaseGroupToFilteredProjects.get(group);
608
618
  if (group.resolvedVersionPlans) {
609
619
  // Check each version plan individually to see if it should be deleted
610
620
  const plansToDelete = [];
@@ -835,7 +845,8 @@ async function generateChangelogForProjects({ tree, args, changes, projectsVersi
835
845
  }
836
846
  const preferDockerVersion = (0, shared_1.shouldPreferDockerVersionForReleaseGroup)(releaseGroup);
837
847
  const releaseVersion = new shared_1.ReleaseVersion({
838
- version: preferDockerVersion && projectsVersionData[project.name].dockerVersion
848
+ version: (preferDockerVersion === true || preferDockerVersion === 'both') &&
849
+ projectsVersionData[project.name].dockerVersion
839
850
  ? projectsVersionData[project.name].dockerVersion
840
851
  : projectsVersionData[project.name].newVersion,
841
852
  releaseTagPattern: releaseGroup.releaseTagPattern,