nx 22.0.0-beta.3 → 22.0.0-beta.5

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 (85) hide show
  1. package/migrations.json +5 -0
  2. package/package.json +11 -11
  3. package/release/changelog-renderer/index.d.ts +1 -0
  4. package/release/changelog-renderer/index.d.ts.map +1 -1
  5. package/release/changelog-renderer/index.js +46 -15
  6. package/schemas/nx-schema.json +254 -86
  7. package/src/command-line/configure-ai-agents/command-object.d.ts +1 -1
  8. package/src/command-line/configure-ai-agents/command-object.d.ts.map +1 -1
  9. package/src/command-line/configure-ai-agents/command-object.js +18 -4
  10. package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
  11. package/src/command-line/configure-ai-agents/configure-ai-agents.js +58 -31
  12. package/src/command-line/migrate/migrate.d.ts.map +1 -1
  13. package/src/command-line/migrate/migrate.js +0 -4
  14. package/src/command-line/nx-cloud/login/command-object.d.ts.map +1 -1
  15. package/src/command-line/nx-cloud/login/command-object.js +2 -2
  16. package/src/command-line/nx-cloud/logout/command-object.js +1 -1
  17. package/src/command-line/nx-commands.js +1 -1
  18. package/src/command-line/release/changelog.d.ts.map +1 -1
  19. package/src/command-line/release/changelog.js +58 -47
  20. package/src/command-line/release/command-object.d.ts +7 -3
  21. package/src/command-line/release/command-object.d.ts.map +1 -1
  22. package/src/command-line/release/config/config.d.ts +6 -2
  23. package/src/command-line/release/config/config.d.ts.map +1 -1
  24. package/src/command-line/release/config/config.js +124 -61
  25. package/src/command-line/release/config/version-plans.d.ts.map +1 -1
  26. package/src/command-line/release/config/version-plans.js +4 -1
  27. package/src/command-line/release/publish.d.ts.map +1 -1
  28. package/src/command-line/release/publish.js +35 -11
  29. package/src/command-line/release/release.d.ts.map +1 -1
  30. package/src/command-line/release/release.js +31 -30
  31. package/src/command-line/release/utils/git.d.ts +2 -2
  32. package/src/command-line/release/utils/git.d.ts.map +1 -1
  33. package/src/command-line/release/utils/git.js +5 -5
  34. package/src/command-line/release/utils/release-graph.d.ts +219 -0
  35. package/src/command-line/release/utils/release-graph.d.ts.map +1 -0
  36. package/src/command-line/release/utils/release-graph.js +658 -0
  37. package/src/command-line/release/utils/semver.d.ts +1 -2
  38. package/src/command-line/release/utils/semver.d.ts.map +1 -1
  39. package/src/command-line/release/utils/semver.js +3 -5
  40. package/src/command-line/release/utils/shared.d.ts +1 -1
  41. package/src/command-line/release/utils/shared.d.ts.map +1 -1
  42. package/src/command-line/release/utils/shared.js +53 -19
  43. package/src/command-line/release/version/release-group-processor.d.ts +3 -152
  44. package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
  45. package/src/command-line/release/version/release-group-processor.js +58 -569
  46. package/src/command-line/release/version/resolve-current-version.d.ts +1 -1
  47. package/src/command-line/release/version/resolve-current-version.d.ts.map +1 -1
  48. package/src/command-line/release/version/resolve-current-version.js +1 -1
  49. package/src/command-line/release/version/test-utils.d.ts +13 -4
  50. package/src/command-line/release/version/test-utils.d.ts.map +1 -1
  51. package/src/command-line/release/version/test-utils.js +26 -11
  52. package/src/command-line/release/version/version-actions.d.ts +12 -5
  53. package/src/command-line/release/version/version-actions.d.ts.map +1 -1
  54. package/src/command-line/release/version/version-actions.js +36 -19
  55. package/src/command-line/release/version.d.ts +6 -1
  56. package/src/command-line/release/version.d.ts.map +1 -1
  57. package/src/command-line/release/version.js +57 -28
  58. package/src/config/nx-json.d.ts +139 -58
  59. package/src/config/nx-json.d.ts.map +1 -1
  60. package/src/config/nx-json.js +8 -8
  61. package/src/core/graph/main.js +1 -1
  62. package/src/daemon/client/client.d.ts +4 -0
  63. package/src/daemon/client/client.d.ts.map +1 -1
  64. package/src/daemon/client/client.js +23 -0
  65. package/src/daemon/message-types/register-project-graph-listener.d.ts +6 -0
  66. package/src/daemon/message-types/register-project-graph-listener.d.ts.map +1 -0
  67. package/src/daemon/message-types/register-project-graph-listener.js +11 -0
  68. package/src/daemon/server/project-graph-incremental-recomputation.d.ts +3 -1
  69. package/src/daemon/server/project-graph-incremental-recomputation.d.ts.map +1 -1
  70. package/src/daemon/server/project-graph-incremental-recomputation.js +13 -5
  71. package/src/daemon/server/project-graph-listener-sockets.d.ts +8 -0
  72. package/src/daemon/server/project-graph-listener-sockets.d.ts.map +1 -0
  73. package/src/daemon/server/project-graph-listener-sockets.js +24 -0
  74. package/src/daemon/server/server.d.ts.map +1 -1
  75. package/src/daemon/server/server.js +9 -2
  76. package/src/migrations/update-22-0-0/consolidate-release-tag-config.d.ts +3 -0
  77. package/src/migrations/update-22-0-0/consolidate-release-tag-config.d.ts.map +1 -0
  78. package/src/migrations/update-22-0-0/consolidate-release-tag-config.js +100 -0
  79. package/src/native/nx.wasm32-wasi.wasm +0 -0
  80. package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
  81. package/src/tasks-runner/is-tui-enabled.js +0 -1
  82. package/src/tasks-runner/run-command.d.ts.map +1 -1
  83. package/src/tasks-runner/run-command.js +5 -2
  84. package/src/utils/package-manager.d.ts.map +1 -1
  85. package/src/utils/package-manager.js +1 -3
@@ -21,16 +21,14 @@ function isRelativeVersionKeyword(val) {
21
21
  function isValidSemverSpecifier(specifier) {
22
22
  return (specifier && !!((0, semver_1.valid)(specifier) || isRelativeVersionKeyword(specifier)));
23
23
  }
24
- // https://github.com/unjs/changelogen/blob/main/src/semver.ts
25
- function determineSemverChange(relevantCommits, // <projectName, commits>
26
- config) {
24
+ function determineSemverChange(relevantCommits, config) {
27
25
  const semverChangePerProject = new Map();
28
26
  for (const [projectName, relevantCommit] of relevantCommits) {
29
27
  let highestChange = null;
30
28
  for (const { commit, isProjectScopedCommit } of relevantCommit) {
31
29
  if (!isProjectScopedCommit) {
32
- // commit is relevant to the project, but not directly, report minor change
33
- highestChange = Math.max(2 /* SemverSpecifier.MINOR */, highestChange ?? 0);
30
+ // commit is relevant to the project, but not directly, report patch change to match side-effectful bump behavior in update dependents in release-group-processor
31
+ highestChange = Math.max(1 /* SemverSpecifier.PATCH */, highestChange ?? 0);
34
32
  continue;
35
33
  }
36
34
  const semverType = config.types[commit.type]?.semverBump;
@@ -48,7 +48,7 @@ export declare function commitChanges({ changedFiles, deletedFiles, isDryRun, is
48
48
  gitCommitArgs?: string | string[];
49
49
  }): Promise<void>;
50
50
  export declare function createCommitMessageValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData, commitMessage: string): string[];
51
- export declare function shouldPreferDockerVersionForReleaseGroup(releaseGroup: ReleaseGroupWithName): boolean;
51
+ export declare function shouldPreferDockerVersionForReleaseGroup(releaseGroup: ReleaseGroupWithName): boolean | 'both';
52
52
  export declare function shouldSkipVersionActions(dockerOptions: {
53
53
  skipVersionActions?: string[] | boolean;
54
54
  }, projectName: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iBAAiB,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;KACxB,EAAE,C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C,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,CAiDV;AAeD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAcnE;AAED,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,EAAE,GAEpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAAC,CAwC5E"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iBAAiB,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,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G,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,CA6FV;AAeD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAcnE;AAED,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,EAAE,GAEpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAAC,CAwC5E"}
@@ -76,7 +76,7 @@ function createCommitMessageValues(releaseGroups, releaseGroupToFilteredProjects
76
76
  const projectVersionData = versionData[releaseGroupProjectNames[0]]; // all at the same version, so we can just pick the first one
77
77
  const releaseVersion = new ReleaseVersion({
78
78
  version: projectVersionData.newVersion,
79
- releaseTagPattern: releaseGroup.releaseTagPattern,
79
+ releaseTagPattern: releaseGroup.releaseTag.pattern,
80
80
  });
81
81
  commitMessageValues[0] = (0, utils_1.interpolate)(commitMessageValues[0], {
82
82
  version: releaseVersion.rawVersion,
@@ -97,7 +97,7 @@ function createCommitMessageValues(releaseGroups, releaseGroupToFilteredProjects
97
97
  const projectVersionData = versionData[releaseGroupProjectNames[0]];
98
98
  const releaseVersion = new ReleaseVersion({
99
99
  version: projectVersionData.newVersion,
100
- releaseTagPattern: releaseGroup.releaseTagPattern,
100
+ releaseTagPattern: releaseGroup.releaseTag.pattern,
101
101
  projectName: releaseGroupProjectNames[0],
102
102
  });
103
103
  commitMessageValues[0] = (0, utils_1.interpolate)(commitMessageValues[0], {
@@ -128,7 +128,7 @@ function createCommitMessageValues(releaseGroups, releaseGroupToFilteredProjects
128
128
  if (projectVersionData.newVersion !== null) {
129
129
  const releaseVersion = new ReleaseVersion({
130
130
  version: projectVersionData.newVersion,
131
- releaseTagPattern: releaseGroup.releaseTagPattern,
131
+ releaseTagPattern: releaseGroup.releaseTag.pattern,
132
132
  projectName: project,
133
133
  });
134
134
  commitMessageValues.push(`- project: ${project} ${releaseVersion.rawVersion}`);
@@ -141,7 +141,7 @@ function createCommitMessageValues(releaseGroups, releaseGroupToFilteredProjects
141
141
  if (projectVersionData.newVersion !== null) {
142
142
  const releaseVersion = new ReleaseVersion({
143
143
  version: projectVersionData.newVersion,
144
- releaseTagPattern: releaseGroup.releaseTagPattern,
144
+ releaseTagPattern: releaseGroup.releaseTag.pattern,
145
145
  });
146
146
  commitMessageValues.push(`- release-group: ${releaseGroup.name} ${releaseVersion.rawVersion}`);
147
147
  }
@@ -160,9 +160,7 @@ function stripPlaceholders(str, placeholders) {
160
160
  return str;
161
161
  }
162
162
  function shouldPreferDockerVersionForReleaseGroup(releaseGroup) {
163
- // The inference was already done in the config phase, so if docker projects exist,
164
- // releaseTagPatternRequireSemver would be false
165
- return !releaseGroup.releaseTagPatternRequireSemver;
163
+ return releaseGroup.releaseTag.preferDockerVersion;
166
164
  }
167
165
  function shouldSkipVersionActions(dockerOptions, projectName) {
168
166
  return (dockerOptions.skipVersionActions === true ||
@@ -181,12 +179,30 @@ function createGitTagValues(releaseGroups, releaseGroupToFilteredProjects, versi
181
179
  if (projectVersionData.newVersion !== null ||
182
180
  projectVersionData.dockerVersion !== null) {
183
181
  const preferDockerVersion = shouldPreferDockerVersionForReleaseGroup(releaseGroup);
184
- tags.push((0, utils_1.interpolate)(releaseGroup.releaseTagPattern, {
185
- version: preferDockerVersion
186
- ? projectVersionData.dockerVersion
187
- : projectVersionData.newVersion,
188
- projectName: project,
189
- }));
182
+ if (preferDockerVersion === 'both') {
183
+ // Create tags for both docker and semver versions
184
+ if (projectVersionData.dockerVersion) {
185
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
186
+ version: projectVersionData.dockerVersion,
187
+ projectName: project,
188
+ }));
189
+ }
190
+ if (projectVersionData.newVersion) {
191
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
192
+ version: projectVersionData.newVersion,
193
+ projectName: project,
194
+ }));
195
+ }
196
+ }
197
+ else {
198
+ // Use either docker version or semver version based on preference
199
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
200
+ version: preferDockerVersion
201
+ ? projectVersionData.dockerVersion
202
+ : projectVersionData.newVersion,
203
+ projectName: project,
204
+ }));
205
+ }
190
206
  }
191
207
  }
192
208
  continue;
@@ -196,12 +212,30 @@ function createGitTagValues(releaseGroups, releaseGroupToFilteredProjects, versi
196
212
  if (projectVersionData.newVersion !== null ||
197
213
  projectVersionData.dockerVersion !== null) {
198
214
  const preferDockerVersion = shouldPreferDockerVersionForReleaseGroup(releaseGroup);
199
- tags.push((0, utils_1.interpolate)(releaseGroup.releaseTagPattern, {
200
- version: preferDockerVersion
201
- ? projectVersionData.dockerVersion
202
- : projectVersionData.newVersion,
203
- releaseGroupName: releaseGroup.name,
204
- }));
215
+ if (preferDockerVersion === 'both') {
216
+ // Create tags for both docker and semver versions
217
+ if (projectVersionData.dockerVersion) {
218
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
219
+ version: projectVersionData.dockerVersion,
220
+ releaseGroupName: releaseGroup.name,
221
+ }));
222
+ }
223
+ if (projectVersionData.newVersion) {
224
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
225
+ version: projectVersionData.newVersion,
226
+ releaseGroupName: releaseGroup.name,
227
+ }));
228
+ }
229
+ }
230
+ else {
231
+ // Use either docker version or semver version based on preference
232
+ tags.push((0, utils_1.interpolate)(releaseGroup.releaseTag.pattern, {
233
+ version: preferDockerVersion
234
+ ? projectVersionData.dockerVersion
235
+ : projectVersionData.newVersion,
236
+ releaseGroupName: releaseGroup.name,
237
+ }));
238
+ }
205
239
  }
206
240
  }
207
241
  return tags;
@@ -1,28 +1,8 @@
1
- import { ManifestRootToUpdate, NxReleaseDockerConfiguration, NxReleaseVersionConfiguration } from '../../../config/nx-json';
2
1
  import { ProjectGraph } from '../../../config/project-graph';
3
2
  import { Tree } from '../../../generators/tree';
4
3
  import { type NxReleaseConfig } from '../config/config';
5
- import type { ReleaseGroupWithName } from '../config/filter-release-groups';
4
+ import { ReleaseGraph } from '../utils/release-graph';
6
5
  import type { VersionData } from '../utils/shared';
7
- /**
8
- * The final configuration for a project after applying release group and project level overrides,
9
- * as well as default values. This will be passed to the relevant version actions implementation,
10
- * and referenced throughout the versioning process.
11
- */
12
- export interface FinalConfigForProject {
13
- specifierSource: NxReleaseVersionConfiguration['specifierSource'];
14
- currentVersionResolver: NxReleaseVersionConfiguration['currentVersionResolver'];
15
- currentVersionResolverMetadata: NxReleaseVersionConfiguration['currentVersionResolverMetadata'];
16
- fallbackCurrentVersionResolver: NxReleaseVersionConfiguration['fallbackCurrentVersionResolver'];
17
- versionPrefix: NxReleaseVersionConfiguration['versionPrefix'];
18
- preserveLocalDependencyProtocols: NxReleaseVersionConfiguration['preserveLocalDependencyProtocols'];
19
- preserveMatchingDependencyRanges: NxReleaseVersionConfiguration['preserveMatchingDependencyRanges'];
20
- versionActionsOptions: NxReleaseVersionConfiguration['versionActionsOptions'];
21
- manifestRootsToUpdate: Array<Exclude<ManifestRootToUpdate, string>>;
22
- dockerOptions: NxReleaseDockerConfiguration & {
23
- groupPreVersionCommand?: string;
24
- };
25
- }
26
6
  export declare const BUMP_TYPE_REASON_TEXT: {
27
7
  readonly DEPENDENCY_WAS_BUMPED: ", because a dependency was bumped, ";
28
8
  readonly USER_SPECIFIER: ", from the given specifier, ";
@@ -55,15 +35,8 @@ export declare class ReleaseGroupProcessor {
55
35
  private tree;
56
36
  private projectGraph;
57
37
  private nxReleaseConfig;
58
- private releaseGroups;
59
- private releaseGroupToFilteredProjects;
38
+ private releaseGraph;
60
39
  private options;
61
- /**
62
- * Stores the relationships between release groups, including their dependencies
63
- * and dependents. This is used for determining processing order and propagating
64
- * version changes between related groups.
65
- */
66
- private groupGraph;
67
40
  /**
68
41
  * Tracks which release groups have already been processed to avoid
69
42
  * processing them multiple times. Used during the group traversal.
@@ -75,128 +48,21 @@ export declare class ReleaseGroupProcessor {
75
48
  * projects need their dependencies updated.
76
49
  */
77
50
  private bumpedProjects;
78
- /**
79
- * Cache of release groups sorted in topological order to ensure dependencies
80
- * are processed before dependents. Computed once and reused throughout processing.
81
- */
82
- private sortedReleaseGroups;
83
- /**
84
- * Maps each release group to its projects sorted in topological order.
85
- * Ensures projects are processed after their dependencies within each group.
86
- */
87
- private sortedProjects;
88
- /**
89
- * Track the unique afterAllProjectsVersioned functions involved in the current versioning process,
90
- * so that we can ensure they are only invoked once per versioning execution.
91
- */
92
- private uniqueAfterAllProjectsVersioned;
93
- /**
94
- * Track the versionActions for each project so that we can invoke certain instance methods.
95
- */
96
- private projectsToVersionActions;
97
51
  /**
98
52
  * versionData that will ultimately be returned to the nx release version handler by getVersionData()
99
53
  */
100
54
  private versionData;
101
- /**
102
- * Set of all projects that are configured in the nx release config.
103
- * Used to validate dependencies and identify projects that should be updated.
104
- */
105
- private allProjectsConfiguredForNxRelease;
106
- /**
107
- * Set of projects that will be processed in the current run.
108
- * This is potentially a subset of allProjectsConfiguredForNxRelease based on filters
109
- * and dependency relationships.
110
- */
111
- private allProjectsToProcess;
112
55
  /**
113
56
  * If the user provided a specifier at the time of versioning we store it here so that it can take priority
114
57
  * over any configuration.
115
58
  */
116
59
  private userGivenSpecifier;
117
- /**
118
- * Caches the current version of each project to avoid repeated disk/registry/git tag lookups.
119
- * Often used during new version calculation. Will be null if the current version resolver is set to 'none'.
120
- */
121
- private cachedCurrentVersions;
122
- /**
123
- * Caches git tag information for projects that resolve their version from git tags.
124
- * This avoids performing expensive git operations multiple times for the same project.
125
- */
126
- private cachedLatestMatchingGitTag;
127
- /**
128
- * Temporary storage for dependent project names while building the dependency graph.
129
- * This is used as an intermediate step before creating the full dependent projects data.
130
- */
131
- private tmpCachedDependentProjects;
132
- /**
133
- * Resolve the data regarding dependent projects for each project upfront so that it remains accurate
134
- * even after updates are applied to manifests.
135
- */
136
- private originalDependentProjectsPerProject;
137
- /**
138
- * In the case of fixed release groups that are configured to resolve the current version from a registry
139
- * or a git tag, it would be a waste of time and resources to resolve the current version for each individual
140
- * project, therefore we maintain a cache of the current version for each applicable fixed release group here.
141
- */
142
- private currentVersionsPerFixedReleaseGroup;
143
- /**
144
- * Cache of project loggers for each project.
145
- */
146
- private projectLoggers;
147
60
  /**
148
61
  * Track any version plan files that have been processed so that we can delete them after versioning is complete,
149
62
  * while leaving any unprocessed files in place.
150
63
  */
151
64
  private processedVersionPlanFiles;
152
- /**
153
- * Certain configuration options can be overridden at the project level, and otherwise fall back to the release group level.
154
- * Many also have a specific default value if nothing is set at either level. To avoid applying this hierarchy for each project
155
- * every time such a configuration option is needed, we cache the result per project here.
156
- */
157
- private finalConfigsByProject;
158
- /**
159
- * Maps each project to its release group for quick O(1) lookups.
160
- * This avoids having to scan through all release groups to find a project.
161
- */
162
- private projectToReleaseGroup;
163
- /**
164
- * Maps each project to its dependents (projects that depend on it).
165
- * This is the inverse of the projectToDependencies map and enables
166
- * efficient lookup of dependent projects for propagating version changes.
167
- */
168
- private projectToDependents;
169
- /**
170
- * Maps each project to its dependencies (projects it depends on).
171
- * Used for building dependency graphs and determining processing order.
172
- */
173
- private projectToDependencies;
174
- /**
175
- * Caches the updateDependents setting for each project to avoid repeated
176
- * lookups and calculations. This determines if dependent projects should
177
- * be automatically updated when a dependency changes.
178
- */
179
- private projectToUpdateDependentsSetting;
180
- constructor(tree: Tree, projectGraph: ProjectGraph, nxReleaseConfig: NxReleaseConfig, releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, options: ReleaseGroupProcessorOptions);
181
- /**
182
- * Initialize the processor by building the group graph and preparing for processing.
183
- * This method must be called before processGroups().
184
- */
185
- init(): Promise<void>;
186
- /**
187
- * Setup mapping from project to release group and cache updateDependents settings
188
- */
189
- private setupProjectReleaseGroupMapping;
190
- /**
191
- * Determine which projects should be processed and resolve their version actions
192
- */
193
- private setupProjectsToProcess;
194
- /**
195
- * Find all dependents that should be processed due to dependency updates
196
- */
197
- private findDependentsToProcess;
198
- private buildGroupDependencyGraph;
199
- private populateDependentProjectsData;
65
+ constructor(tree: Tree, projectGraph: ProjectGraph, nxReleaseConfig: NxReleaseConfig, releaseGraph: ReleaseGraph, options: ReleaseGroupProcessorOptions);
200
66
  getReleaseGroupNameForProject(projectName: string): string | null;
201
67
  getNextGroup(): string | null;
202
68
  processGroups(): Promise<string[]>;
@@ -225,15 +91,9 @@ export declare class ReleaseGroupProcessor {
225
91
  private bumpIndependentVersionGroup;
226
92
  private determineVersionBumpForProject;
227
93
  private getVersionActionsForProject;
228
- private getFinalConfigForProject;
229
94
  private getProjectLoggerForProject;
230
95
  private getCurrentCachedVersionForProject;
231
96
  private getCachedFinalConfigForProject;
232
- /**
233
- * Apply project and release group precedence and default values, as well as validate the final configuration,
234
- * ready to be cached.
235
- */
236
- private resolveFinalConfigForProject;
237
97
  private calculateNewVersion;
238
98
  private updateDependenciesForProject;
239
99
  private bumpVersionForProject;
@@ -242,16 +102,7 @@ export declare class ReleaseGroupProcessor {
242
102
  private getFixedReleaseGroupBumpType;
243
103
  private determineSideEffectBump;
244
104
  private getProjectDependents;
245
- private getAllNonImplicitDependents;
246
105
  private getNonImplicitDependentsForProject;
247
- private hasAutoUpdateDependents;
248
- private topologicallySortReleaseGroups;
249
- private topologicallySortProjects;
250
- /**
251
- * Precompute project -> dependents/dependencies relationships for O(1) lookups
252
- */
253
- private precomputeDependencyRelationships;
254
- private getProjectDependencies;
255
106
  }
256
107
  export {};
257
108
  //# sourceMappingURL=release-group-processor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-group-processor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/release-group-processor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AACjC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CAAC,wBAAwB;IAUhC,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,iCAAiC;IAMzC,OAAO,CAAC,8BAA8B;IAYtC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;YAuJtB,mBAAmB;YAoBnB,4BAA4B;YA+D5B,qBAAqB;YA2FrB,+BAA+B;IAa7C,OAAO,CAAC,4BAA4B;YAMtB,4BAA4B;IAuB1C,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,kCAAkC;IAK1C,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,yBAAyB;IAyBjC;;OAEG;YACW,iCAAiC;IAgC/C,OAAO,CAAC,sBAAsB;CAG/B"}
1
+ {"version":3,"file":"release-group-processor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/release-group-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAyB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,iBAAiB,CAAC;AAarE,eAAO,MAAM,qBAAqB;;;;;;;;;CAYxB,CAAC;AAEX,UAAU,4BAA4B;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IAEd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;;OAIG;IACH,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAA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