nx 22.0.0-canary.20251001-e28a97a → 22.0.0-canary.20251006-0149fac

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 (67) hide show
  1. package/migrations.json +5 -0
  2. package/package.json +12 -12
  3. package/project.json +2 -1
  4. package/schemas/nx-schema.json +339 -246
  5. package/schemas/project-schema.json +72 -12
  6. package/src/ai/utils.d.ts +6 -5
  7. package/src/ai/utils.d.ts.map +1 -1
  8. package/src/ai/utils.js +14 -13
  9. package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
  10. package/src/command-line/configure-ai-agents/configure-ai-agents.js +79 -74
  11. package/src/command-line/release/changelog.d.ts.map +1 -1
  12. package/src/command-line/release/changelog.js +1 -3
  13. package/src/command-line/release/command-object.d.ts +0 -6
  14. package/src/command-line/release/command-object.d.ts.map +1 -1
  15. package/src/command-line/release/config/config.d.ts +1 -1
  16. package/src/command-line/release/config/config.d.ts.map +1 -1
  17. package/src/command-line/release/config/config.js +33 -126
  18. package/src/command-line/release/plan-check.d.ts.map +1 -1
  19. package/src/command-line/release/plan-check.js +1 -3
  20. package/src/command-line/release/plan.d.ts.map +1 -1
  21. package/src/command-line/release/plan.js +1 -3
  22. package/src/command-line/release/publish.d.ts.map +1 -1
  23. package/src/command-line/release/publish.js +1 -3
  24. package/src/command-line/release/release.d.ts.map +1 -1
  25. package/src/command-line/release/release.js +1 -3
  26. package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
  27. package/src/command-line/release/utils/resolve-semver-specifier.d.ts.map +1 -1
  28. package/src/command-line/release/utils/semver.d.ts +15 -9
  29. package/src/command-line/release/utils/semver.d.ts.map +1 -1
  30. package/src/command-line/release/utils/semver.js +30 -24
  31. package/src/command-line/release/utils/shared.d.ts +4 -1
  32. package/src/command-line/release/utils/shared.d.ts.map +1 -1
  33. package/src/command-line/release/utils/shared.js +33 -11
  34. package/src/command-line/release/utils/test/test-utils.d.ts +20 -0
  35. package/src/command-line/release/utils/test/test-utils.d.ts.map +1 -0
  36. package/src/command-line/release/utils/test/test-utils.js +24 -0
  37. package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts.map +1 -1
  38. package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +10 -1
  39. package/src/command-line/release/version/test-utils.d.ts.map +1 -1
  40. package/src/command-line/release/version/test-utils.js +0 -4
  41. package/src/command-line/release/version.d.ts.map +1 -1
  42. package/src/command-line/release/version.js +1 -8
  43. package/src/config/nx-json.d.ts +2 -31
  44. package/src/config/nx-json.d.ts.map +1 -1
  45. package/src/config/workspace-json-project-json.d.ts +2 -2
  46. package/src/config/workspace-json-project-json.d.ts.map +1 -1
  47. package/src/core/graph/main.js +1 -1
  48. package/src/core/graph/styles.js +1 -1
  49. package/src/migrations/update-21-0-0/release-changelog-config-changes.d.ts.map +1 -1
  50. package/src/migrations/update-21-0-0/release-version-config-changes.d.ts.map +1 -1
  51. package/src/migrations/update-21-0-0/release-version-config-changes.js +5 -15
  52. package/src/migrations/update-22-0-0/release-version-config-changes.d.ts +3 -0
  53. package/src/migrations/update-22-0-0/release-version-config-changes.d.ts.map +1 -0
  54. package/src/migrations/update-22-0-0/release-version-config-changes.js +101 -0
  55. package/src/native/index.d.ts +2 -2
  56. package/src/native/nx.wasm32-wasi.wasm +0 -0
  57. package/src/utils/nx-console-prompt.d.ts.map +1 -1
  58. package/src/utils/nx-console-prompt.js +4 -1
  59. package/src/command-line/release/config/use-legacy-versioning.d.ts +0 -3
  60. package/src/command-line/release/config/use-legacy-versioning.d.ts.map +0 -1
  61. package/src/command-line/release/config/use-legacy-versioning.js +0 -9
  62. package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts +0 -8
  63. package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts.map +0 -1
  64. package/src/command-line/release/utils/batch-projects-by-generator-config.js +0 -39
  65. package/src/command-line/release/version-legacy.d.ts +0 -47
  66. package/src/command-line/release/version-legacy.d.ts.map +0 -1
  67. package/src/command-line/release/version-legacy.js +0 -453
@@ -28,7 +28,6 @@ const gitlab_1 = require("../utils/remote-release-clients/gitlab");
28
28
  const resolve_changelog_renderer_1 = require("../utils/resolve-changelog-renderer");
29
29
  const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
30
30
  const conventional_commits_1 = require("./conventional-commits");
31
- const use_legacy_versioning_1 = require("./use-legacy-versioning");
32
31
  exports.IMPLICIT_DEFAULT_RELEASE_GROUP = '__default__';
33
32
  exports.DEFAULT_VERSION_ACTIONS_PATH = '@nx/js/src/release/version-actions';
34
33
  // Apply default configuration to any optional user configuration and handle known errors
@@ -60,7 +59,6 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
60
59
  nxReleaseConfig: null,
61
60
  };
62
61
  }
63
- const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userConfig);
64
62
  const gitDefaults = {
65
63
  commit: false,
66
64
  commitMessage: 'chore(release): publish {version}',
@@ -191,30 +189,18 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
191
189
  : undefined,
192
190
  git: gitDefaults,
193
191
  version: {
194
- useLegacyVersioning: USE_LEGACY_VERSIONING,
195
192
  git: versionGitDefaults,
196
193
  conventionalCommits: userConfig.version?.conventionalCommits || false,
197
194
  preVersionCommand: userConfig.version?.preVersionCommand || '',
198
- ...(USE_LEGACY_VERSIONING
199
- ? {
200
- generator: '@nx/js:release-version',
201
- generatorOptions: defaultGeneratorOptions,
202
- }
203
- : {
204
- versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
205
- versionActionsOptions: {},
206
- currentVersionResolver: defaultGeneratorOptions.currentVersionResolver,
207
- specifierSource: defaultGeneratorOptions.specifierSource,
208
- preserveLocalDependencyProtocols: userConfig.version
209
- ?.preserveLocalDependencyProtocols ?? true,
210
- // TODO(v22): flip default to true
211
- preserveMatchingDependencyRanges: userConfig.version
212
- ?.preserveMatchingDependencyRanges ?? false,
213
- logUnchangedProjects: userConfig.version
214
- ?.logUnchangedProjects ?? true,
215
- updateDependents: userConfig.version
216
- ?.updateDependents ?? 'auto',
217
- }),
195
+ versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
196
+ versionActionsOptions: {},
197
+ currentVersionResolver: defaultGeneratorOptions.currentVersionResolver,
198
+ specifierSource: defaultGeneratorOptions.specifierSource,
199
+ preserveLocalDependencyProtocols: userConfig.version?.preserveLocalDependencyProtocols ?? true,
200
+ // TODO(v22): flip default to true
201
+ preserveMatchingDependencyRanges: userConfig.version?.preserveMatchingDependencyRanges ?? false,
202
+ logUnchangedProjects: userConfig.version?.logUnchangedProjects ?? true,
203
+ updateDependents: userConfig.version?.updateDependents ?? 'auto',
218
204
  },
219
205
  changelog: {
220
206
  git: changelogGitDefaults,
@@ -278,19 +264,12 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
278
264
  groupPreVersionCommand: '',
279
265
  }
280
266
  : undefined,
281
- version: USE_LEGACY_VERSIONING
282
- ? {
283
- conventionalCommits: false,
284
- generator: '@nx/js:release-version',
285
- generatorOptions: {},
286
- groupPreVersionCommand: '',
287
- }
288
- : {
289
- conventionalCommits: false,
290
- versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
291
- versionActionsOptions: {},
292
- groupPreVersionCommand: '',
293
- },
267
+ version: {
268
+ conventionalCommits: false,
269
+ versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
270
+ versionActionsOptions: {},
271
+ groupPreVersionCommand: '',
272
+ },
294
273
  changelog: {
295
274
  createRelease: false,
296
275
  entryWhenNoChanges: 'This was a version bump only for {projectName} to align it with other projects, there were no code changes.',
@@ -361,43 +340,19 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
361
340
  delete rootVersionWithoutGlobalOptions.preVersionCommand;
362
341
  // Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
363
342
  if (userConfig.version?.conventionalCommits === true) {
364
- if (USE_LEGACY_VERSIONING) {
365
- rootVersionWithoutGlobalOptions.generatorOptions = {
366
- ...rootVersionWithoutGlobalOptions.generatorOptions,
367
- currentVersionResolver: 'git-tag',
368
- specifierSource: 'conventional-commits',
369
- };
370
- }
371
- else {
372
- rootVersionWithoutGlobalOptions.currentVersionResolver = 'git-tag';
373
- rootVersionWithoutGlobalOptions.specifierSource = 'conventional-commits';
374
- }
343
+ rootVersionWithoutGlobalOptions.currentVersionResolver = 'git-tag';
344
+ rootVersionWithoutGlobalOptions.specifierSource = 'conventional-commits';
375
345
  }
376
346
  if (userConfig.version?.conventionalCommits === false) {
377
- delete rootVersionWithoutGlobalOptions.generatorOptions
378
- ?.currentVersionResolver;
379
- delete rootVersionWithoutGlobalOptions.generatorOptions?.specifierSource;
380
- delete rootVersionWithoutGlobalOptions
381
- .currentVersionResolver;
382
- delete rootVersionWithoutGlobalOptions
383
- .specifierSource;
347
+ delete rootVersionWithoutGlobalOptions.currentVersionResolver;
348
+ delete rootVersionWithoutGlobalOptions.specifierSource;
384
349
  }
385
350
  // Apply versionPlans shorthand to the final group defaults if explicitly configured in the original user config
386
351
  if (userConfig.versionPlans) {
387
- if (USE_LEGACY_VERSIONING) {
388
- rootVersionWithoutGlobalOptions.generatorOptions = {
389
- ...rootVersionWithoutGlobalOptions.generatorOptions,
390
- specifierSource: 'version-plans',
391
- };
392
- }
393
- else {
394
- rootVersionWithoutGlobalOptions.specifierSource = 'version-plans';
395
- }
352
+ rootVersionWithoutGlobalOptions.specifierSource = 'version-plans';
396
353
  }
397
354
  if (userConfig.versionPlans === false) {
398
- delete rootVersionWithoutGlobalOptions.generatorOptions.specifierSource;
399
- delete rootVersionWithoutGlobalOptions
400
- .specifierSource;
355
+ delete rootVersionWithoutGlobalOptions.specifierSource;
401
356
  }
402
357
  const rootDockerWithoutGlobalOptions = { ...rootDockerConfig };
403
358
  delete rootDockerWithoutGlobalOptions.preVersionCommand;
@@ -545,52 +500,21 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
545
500
  }
546
501
  // Apply conventionalCommits shorthand to the final group if explicitly configured in the original group
547
502
  if (releaseGroup.version?.conventionalCommits === true) {
548
- if (USE_LEGACY_VERSIONING) {
549
- finalReleaseGroup.version.generatorOptions = {
550
- ...finalReleaseGroup.version.generatorOptions,
551
- currentVersionResolver: 'git-tag',
552
- specifierSource: 'conventional-commits',
553
- };
554
- }
555
- else {
556
- finalReleaseGroup.version.currentVersionResolver = 'git-tag';
557
- finalReleaseGroup.version.specifierSource = 'conventional-commits';
558
- }
503
+ finalReleaseGroup.version.currentVersionResolver = 'git-tag';
504
+ finalReleaseGroup.version.specifierSource = 'conventional-commits';
559
505
  }
560
506
  if (releaseGroup.version?.conventionalCommits === false &&
561
507
  releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
562
- if (USE_LEGACY_VERSIONING) {
563
- delete finalReleaseGroup.version.generatorOptions
564
- ?.currentVersionResolver;
565
- delete finalReleaseGroup.version.generatorOptions?.specifierSource;
566
- }
567
- delete finalReleaseGroup.version
568
- .currentVersionResolver;
569
- delete finalReleaseGroup.version
570
- .specifierSource;
508
+ delete finalReleaseGroup.version.currentVersionResolver;
509
+ delete finalReleaseGroup.version.specifierSource;
571
510
  }
572
511
  // Apply versionPlans shorthand to the final group if explicitly configured in the original group
573
512
  if (releaseGroup.versionPlans) {
574
- if (USE_LEGACY_VERSIONING) {
575
- finalReleaseGroup.version = {
576
- ...finalReleaseGroup.version,
577
- generatorOptions: {
578
- ...finalReleaseGroup.version?.generatorOptions,
579
- specifierSource: 'version-plans',
580
- },
581
- };
582
- }
583
- else {
584
- finalReleaseGroup.version.specifierSource = 'version-plans';
585
- }
513
+ finalReleaseGroup.version.specifierSource = 'version-plans';
586
514
  }
587
515
  if (releaseGroup.versionPlans === false &&
588
516
  releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
589
- if (USE_LEGACY_VERSIONING) {
590
- delete finalReleaseGroup.version.generatorOptions?.specifierSource;
591
- }
592
- delete finalReleaseGroup.version
593
- .specifierSource;
517
+ delete finalReleaseGroup.version.specifierSource;
594
518
  }
595
519
  releaseGroups[releaseGroupName] = finalReleaseGroup;
596
520
  }
@@ -728,7 +652,7 @@ function fillUnspecifiedConventionalCommitsProperties(config) {
728
652
  types,
729
653
  };
730
654
  }
731
- async function handleNxReleaseConfigError(error, useLegacyVersioning) {
655
+ async function handleNxReleaseConfigError(error) {
732
656
  const linkMessage = `\nRead more about Nx Release at https://nx.dev/features/manage-releases.`;
733
657
  switch (error.code) {
734
658
  case 'PROJECTS_AND_GROUPS_DEFINED':
@@ -786,11 +710,8 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
786
710
  const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)([
787
711
  'release',
788
712
  ]);
789
- const text = useLegacyVersioning
790
- ? '"version.generatorOptions"'
791
- : 'configuration options';
792
713
  output_1.output.error({
793
- title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related ${text} that it sets for you. Please use one or the other:`,
714
+ title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related configuration options that it sets for you. Please use one or the other:`,
794
715
  bodyLines: [nxJsonMessage, linkMessage],
795
716
  });
796
717
  }
@@ -943,30 +864,16 @@ function deepMergeDefaults(defaultConfigs, userConfig) {
943
864
  function hasInvalidConventionalCommitsConfig(userConfig) {
944
865
  // at the root
945
866
  if (userConfig.version?.conventionalCommits === true &&
946
- // v2 config - directly on version config
947
- (userConfig.version
948
- ?.currentVersionResolver ||
949
- userConfig.version?.specifierSource ||
950
- // Legacy config - on generatorOptions
951
- userConfig.version
952
- ?.generatorOptions?.currentVersionResolver ||
953
- userConfig.version
954
- ?.generatorOptions?.specifierSource)) {
867
+ (userConfig.version?.currentVersionResolver ||
868
+ userConfig.version?.specifierSource)) {
955
869
  return true;
956
870
  }
957
871
  // within any groups
958
872
  if (userConfig.groups) {
959
873
  for (const group of Object.values(userConfig.groups)) {
960
874
  if (group.version?.conventionalCommits === true &&
961
- // v2 config - directly on version config
962
- (group.version
963
- ?.currentVersionResolver ||
964
- group.version?.specifierSource ||
965
- // Legacy config - on generatorOptions
966
- group.version
967
- ?.generatorOptions?.currentVersionResolver ||
968
- group.version
969
- ?.generatorOptions?.specifierSource)) {
875
+ (group.version?.currentVersionResolver ||
876
+ group.version?.specifierSource)) {
970
877
  return true;
971
878
  }
972
879
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plan-check.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/plan-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAU1E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgBjE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAC9B,MAAM,WAAW,KAAG,OAAO,CAAC,MAAM,CAAC,CA+N3E"}
1
+ {"version":3,"file":"plan-check.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/plan-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAU1E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAejE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAC9B,MAAM,WAAW,KAAG,OAAO,CAAC,MAAM,CAAC,CAyN3E"}
@@ -12,7 +12,6 @@ const output_1 = require("../../utils/output");
12
12
  const config_1 = require("./config/config");
13
13
  const deep_merge_json_1 = require("./config/deep-merge-json");
14
14
  const filter_release_groups_1 = require("./config/filter-release-groups");
15
- const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
16
15
  const version_plans_1 = require("./config/version-plans");
17
16
  const get_touched_projects_for_group_1 = require("./utils/get-touched-projects-for-group");
18
17
  const print_config_1 = require("./utils/print-config");
@@ -26,8 +25,7 @@ function createAPI(overrideReleaseConfig) {
26
25
  // Apply default configuration to any optional user configuration
27
26
  const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
28
27
  if (configError) {
29
- const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
30
- return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
28
+ return await (0, config_1.handleNxReleaseConfigError)(configError);
31
29
  }
32
30
  // --print-config exits directly as it is not designed to be combined with any other programmatic operations
33
31
  if (args.printConfig) {
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/plan.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAU1E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgB/C,eAAO,MAAM,qBAAqB,GAAI,MAAM,WAAW,oBACA,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAEnE,MAAM,WAAW,KAChB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAqO5B"}
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/plan.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAU1E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAe/C,eAAO,MAAM,qBAAqB,GAAI,MAAM,WAAW,oBACA,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAEnE,MAAM,WAAW,KAChB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CA+N5B"}
@@ -18,7 +18,6 @@ const output_1 = require("../../utils/output");
18
18
  const config_1 = require("./config/config");
19
19
  const deep_merge_json_1 = require("./config/deep-merge-json");
20
20
  const filter_release_groups_1 = require("./config/filter-release-groups");
21
- const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
22
21
  const version_plans_1 = require("./config/version-plans");
23
22
  const generate_version_plan_content_1 = require("./utils/generate-version-plan-content");
24
23
  const get_touched_projects_for_group_1 = require("./utils/get-touched-projects-for-group");
@@ -35,8 +34,7 @@ function createAPI(overrideReleaseConfig) {
35
34
  // Apply default configuration to any optional user configuration
36
35
  const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
37
36
  if (configError) {
38
- const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
39
- return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
37
+ return await (0, config_1.handleNxReleaseConfigError)(configError);
40
38
  }
41
39
  // --print-config exits directly as it is not designed to be combined with any other programmatic operations
42
40
  if (args.printConfig) {
@@ -1 +1 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAEvB,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG;QACrB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB,GAAI,MAAM,cAAc,oBAWzD,CAAC;AAEL,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,cAAc,KACnB,OAAO,CAAC,qBAAqB,CAAC,CAwHlC"}
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAEvB,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASlD,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG;QACrB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB,GAAI,MAAM,cAAc,oBAWzD,CAAC;AAEL,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,cAAc,KACnB,OAAO,CAAC,qBAAqB,CAAC,CAkHlC"}
@@ -17,7 +17,6 @@ const graph_1 = require("../graph/graph");
17
17
  const config_1 = require("./config/config");
18
18
  const deep_merge_json_1 = require("./config/deep-merge-json");
19
19
  const filter_release_groups_1 = require("./config/filter-release-groups");
20
- const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
21
20
  const print_config_1 = require("./utils/print-config");
22
21
  const releasePublishCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, async () => {
23
22
  const publishProjectsResult = await createAPI({})(args);
@@ -48,8 +47,7 @@ function createAPI(overrideReleaseConfig) {
48
47
  // Apply default configuration to any optional user configuration
49
48
  const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
50
49
  if (configError) {
51
- const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
52
- return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
50
+ return await (0, config_1.handleNxReleaseConfigError)(configError);
53
51
  }
54
52
  // --print-config exits directly as it is not designed to be combined with any other programmatic operations
55
53
  if (args.printConfig) {
@@ -1 +1 @@
1
- {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA6BlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAkX5C"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA4BlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,CA4W5C"}
@@ -13,7 +13,6 @@ const changelog_1 = require("./changelog");
13
13
  const config_1 = require("./config/config");
14
14
  const deep_merge_json_1 = require("./config/deep-merge-json");
15
15
  const filter_release_groups_1 = require("./config/filter-release-groups");
16
- const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
17
16
  const version_plans_1 = require("./config/version-plans");
18
17
  const publish_1 = require("./publish");
19
18
  const git_1 = require("./utils/git");
@@ -49,8 +48,7 @@ function createAPI(overrideReleaseConfig) {
49
48
  // Apply default configuration to any optional user configuration
50
49
  const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
51
50
  if (configError) {
52
- const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
53
- return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
51
+ return await (0, config_1.handleNxReleaseConfigError)(configError);
54
52
  }
55
53
  // --print-config exits directly as it is not designed to be combined with any other programmatic operations
56
54
  if (args.printConfig) {
@@ -1,6 +1,7 @@
1
1
  import { ProjectGraph } from '../../../config/project-graph';
2
2
  import { NxReleaseConfig } from '../config/config';
3
3
  import { SemverBumpType } from '../version/version-actions';
4
- export declare function resolveSemverSpecifierFromConventionalCommits(from: string, projectGraph: ProjectGraph, projectNames: string[], conventionalCommitsConfig: NxReleaseConfig['conventionalCommits']): Promise<string | null>;
4
+ import { SemverSpecifier } from './semver';
5
+ export declare function resolveSemverSpecifierFromConventionalCommits(from: string, projectGraph: ProjectGraph, projectNames: string[], conventionalCommitsConfig: NxReleaseConfig['conventionalCommits']): Promise<Map<string, SemverSpecifier | null>>;
5
6
  export declare function resolveSemverSpecifierFromPrompt(selectionMessage: string, customVersionMessage: string): Promise<SemverBumpType | string>;
6
7
  //# sourceMappingURL=resolve-semver-specifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-semver-specifier.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/resolve-semver-specifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAK5D,wBAAsB,6CAA6C,CACjE,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,MAAM,EAAE,EACtB,yBAAyB,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAChE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASxB;AAED,wBAAsB,gCAAgC,CACpD,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,cAAc,GAAG,MAAM,CAAC,CAwClC"}
1
+ {"version":3,"file":"resolve-semver-specifier.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/resolve-semver-specifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAyB,eAAe,EAAE,MAAM,UAAU,CAAC;AAGlE,wBAAsB,6CAA6C,CACjE,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,MAAM,EAAE,EACtB,yBAAyB,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAEnE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC,CAAC,CAS3C;AAED,wBAAsB,gCAAgC,CACpD,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,cAAc,GAAG,MAAM,CAAC,CAwClC"}
@@ -5,16 +5,22 @@
5
5
  import { ReleaseType } from 'semver';
6
6
  import { NxReleaseConfig } from '../config/config';
7
7
  import { GitCommit } from './git';
8
+ export declare const enum SemverSpecifier {
9
+ MAJOR = 3,
10
+ MINOR = 2,
11
+ PATCH = 1
12
+ }
13
+ export declare const SemverSpecifierType: {
14
+ 3: string;
15
+ 2: string;
16
+ 1: string;
17
+ };
8
18
  export declare function isRelativeVersionKeyword(val: string): val is ReleaseType;
9
19
  export declare function isValidSemverSpecifier(specifier: string): boolean;
10
- /**
11
- * TODO: We would be able to make the logging for the conventional commits use-case
12
- * for fixed release groups more clear/precise if we passed through which project
13
- * the conventional commits were detected for.
14
- *
15
- * It would then flow up through deriveSpecifierFromConventionalCommits back to
16
- * ReleaseGroupProcessor.
17
- */
18
- export declare function determineSemverChange(commits: GitCommit[], config: NxReleaseConfig['conventionalCommits']): 'patch' | 'minor' | 'major' | null;
20
+ export declare function determineSemverChange(relevantCommits: Map<string, {
21
+ commit: GitCommit;
22
+ isProjectScopedCommit: boolean;
23
+ }[]>, // <projectName, commits>
24
+ config: NxReleaseConfig['conventionalCommits']): Map<string, SemverSpecifier | null>;
19
25
  export declare function deriveNewSemverVersion(currentSemverVersion: string, semverSpecifier: string, preid?: string): string;
20
26
  //# sourceMappingURL=semver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/semver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAiB,WAAW,EAAc,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,WAAW,CAExE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED;;;;;;;GAOG;AAEH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,EAAE,EACpB,MAAM,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAC7C,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAgBpC;AAED,wBAAgB,sBAAsB,CACpC,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,MAAM,EACvB,KAAK,CAAC,EAAE,MAAM,UA2Bf"}
1
+ {"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/semver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAiB,WAAW,EAAc,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0BAAkB,eAAe;IAC/B,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;CACV;AAED,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,WAAW,CAExE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIjE;AAGD,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,GAAG,CAClB,MAAM,EACN;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,EAAE,CACxD,EAAE,yBAAyB;AAC5B,MAAM,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAC7C,GAAG,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC,CA0BrC;AAED,wBAAgB,sBAAsB,CACpC,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,MAAM,EACvB,KAAK,CAAC,EAAE,MAAM,UA2Bf"}
@@ -4,44 +4,50 @@
4
4
  * https://github.com/unjs/changelogen
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.SemverSpecifierType = void 0;
7
8
  exports.isRelativeVersionKeyword = isRelativeVersionKeyword;
8
9
  exports.isValidSemverSpecifier = isValidSemverSpecifier;
9
10
  exports.determineSemverChange = determineSemverChange;
10
11
  exports.deriveNewSemverVersion = deriveNewSemverVersion;
11
12
  const semver_1 = require("semver");
13
+ exports.SemverSpecifierType = {
14
+ 3: 'major',
15
+ 2: 'minor',
16
+ 1: 'patch',
17
+ };
12
18
  function isRelativeVersionKeyword(val) {
13
19
  return semver_1.RELEASE_TYPES.includes(val);
14
20
  }
15
21
  function isValidSemverSpecifier(specifier) {
16
22
  return (specifier && !!((0, semver_1.valid)(specifier) || isRelativeVersionKeyword(specifier)));
17
23
  }
18
- /**
19
- * TODO: We would be able to make the logging for the conventional commits use-case
20
- * for fixed release groups more clear/precise if we passed through which project
21
- * the conventional commits were detected for.
22
- *
23
- * It would then flow up through deriveSpecifierFromConventionalCommits back to
24
- * ReleaseGroupProcessor.
25
- */
26
24
  // https://github.com/unjs/changelogen/blob/main/src/semver.ts
27
- function determineSemverChange(commits, config) {
28
- let [hasMajor, hasMinor, hasPatch] = [false, false, false];
29
- for (const commit of commits) {
30
- const semverType = config.types[commit.type]?.semverBump;
31
- if (semverType === 'major' || commit.isBreaking) {
32
- hasMajor = true;
33
- }
34
- else if (semverType === 'minor') {
35
- hasMinor = true;
36
- }
37
- else if (semverType === 'patch') {
38
- hasPatch = true;
39
- }
40
- else if (semverType === 'none' || !semverType) {
41
- // do not report a change
25
+ function determineSemverChange(relevantCommits, // <projectName, commits>
26
+ config) {
27
+ const semverChangePerProject = new Map();
28
+ for (const [projectName, relevantCommit] of relevantCommits) {
29
+ let highestChange = null;
30
+ for (const { commit, isProjectScopedCommit } of relevantCommit) {
31
+ if (!isProjectScopedCommit) {
32
+ // commit is relevant to the project, but not directly, report minor change
33
+ highestChange = Math.max(2 /* SemverSpecifier.MINOR */, highestChange ?? 0);
34
+ continue;
35
+ }
36
+ const semverType = config.types[commit.type]?.semverBump;
37
+ if (semverType === 'major' || commit.isBreaking) {
38
+ highestChange = Math.max(3 /* SemverSpecifier.MAJOR */, highestChange ?? 0);
39
+ break; // Major is highest priority, no need to check more commits
40
+ }
41
+ else if (semverType === 'minor') {
42
+ highestChange = Math.max(2 /* SemverSpecifier.MINOR */, highestChange ?? 0);
43
+ }
44
+ else if (semverType === 'patch') {
45
+ highestChange = Math.max(1 /* SemverSpecifier.PATCH */, highestChange ?? 0);
46
+ }
42
47
  }
48
+ semverChangePerProject.set(projectName, highestChange);
43
49
  }
44
- return hasMajor ? 'major' : hasMinor ? 'minor' : hasPatch ? 'patch' : null;
50
+ return semverChangePerProject;
45
51
  }
46
52
  function deriveNewSemverVersion(currentSemverVersion, semverSpecifier, preid) {
47
53
  if (!(0, semver_1.valid)(currentSemverVersion)) {
@@ -54,5 +54,8 @@ export declare function shouldSkipVersionActions(dockerOptions: {
54
54
  }, projectName: string): boolean;
55
55
  export declare function createGitTagValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData): string[];
56
56
  export declare function handleDuplicateGitTags(gitTagValues: string[]): void;
57
- export declare function getCommitsRelevantToProjects(projectGraph: ProjectGraph, commits: GitCommit[], projects: string[]): Promise<GitCommit[]>;
57
+ export declare function getCommitsRelevantToProjects(projectGraph: ProjectGraph, commits: GitCommit[], projects: string[]): Promise<Map<string, {
58
+ commit: GitCommit;
59
+ isProjectScopedCommit: boolean;
60
+ }[]>>;
58
61
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI7D,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,OAAO,CAQrD;AAED,qBAAa,cAAc;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;gBAEV,EACV,OAAO,EAAE,qEAAqE;IAC9E,iBAAiB,EAAE,8EAA8E;IACjG,WAAW,GACZ,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CAQF;AAED,wBAAsB,aAAa,CAAC,EAClC,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,aAAa,GACd,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC,iBAsBA;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CA0GV;AAcD,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAIT;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,EAC1D,WAAW,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,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,GACjB,OAAO,CAAC,SAAS,EAAE,CAAC,CAwBtB"}
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,OAAO,CAQrD;AAED,qBAAa,cAAc;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;gBAEV,EACV,OAAO,EAAE,qEAAqE;IAC9E,iBAAiB,EAAE,8EAA8E;IACjG,WAAW,GACZ,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CAQF;AAED,wBAAsB,aAAa,CAAC,EAClC,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,aAAa,GACd,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC,iBAsBA;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CA0GV;AAcD,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAIT;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,EAC1D,WAAW,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,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"}
@@ -11,9 +11,10 @@ exports.handleDuplicateGitTags = handleDuplicateGitTags;
11
11
  exports.getCommitsRelevantToProjects = getCommitsRelevantToProjects;
12
12
  const chalk = require("chalk");
13
13
  const semver_1 = require("semver");
14
- const file_map_utils_1 = require("../../../project-graph/file-map-utils");
15
14
  const utils_1 = require("../../../tasks-runner/utils");
16
15
  const output_1 = require("../../../utils/output");
16
+ const affected_project_graph_1 = require("../../../project-graph/affected/affected-project-graph");
17
+ const file_utils_1 = require("../../../project-graph/file-utils");
17
18
  const git_1 = require("./git");
18
19
  exports.noDiffInChangelogMessage = chalk.yellow(`NOTE: There was no diff detected for the changelog entry. Maybe you intended to pass alternative git references via --from and --to?`);
19
20
  function isPrerelease(version) {
@@ -234,14 +235,35 @@ function handleDuplicateGitTags(gitTagValues) {
234
235
  }
235
236
  }
236
237
  async function getCommitsRelevantToProjects(projectGraph, commits, projects) {
237
- const { fileMap } = await (0, file_map_utils_1.createFileMapUsingProjectGraph)(projectGraph);
238
- const filesInReleaseGroup = new Set(projects.reduce((files, p) => [...files, ...fileMap.projectFileMap[p].map((f) => f.file)], []));
239
- /**
240
- * The relevant commits are those that either:
241
- * - touch project files which are contained within the list of projects directly
242
- * - touch non-project files and the commit is not scoped
243
- */
244
- return commits.filter((c) => c.affectedFiles.some((f) => filesInReleaseGroup.has(f) ||
245
- (!c.scope &&
246
- fileMap.nonProjectFiles.some((nonProjectFile) => nonProjectFile.file === f))));
238
+ const projectSet = new Set(projects);
239
+ const relevantCommits = new Map();
240
+ for (const commit of commits) {
241
+ // Convert affectedFiles to FileChange[] format
242
+ const touchedFiles = commit.affectedFiles.map((f) => ({
243
+ file: f,
244
+ getChanges: () => [new file_utils_1.WholeFileChange()],
245
+ }));
246
+ // Use the same affected detection logic as `nx affected`
247
+ const affectedGraph = await (0, affected_project_graph_1.filterAffected)(projectGraph, touchedFiles);
248
+ for (const projectName of Object.keys(affectedGraph.nodes)) {
249
+ if (projectSet.has(projectName)) {
250
+ if (!relevantCommits.has(projectName)) {
251
+ relevantCommits.set(projectName, []);
252
+ }
253
+ if (commit.scope === projectName ||
254
+ commit.scope.split(',').includes(projectName) ||
255
+ !commit.scope) {
256
+ relevantCommits
257
+ .get(projectName)
258
+ ?.push({ commit, isProjectScopedCommit: true });
259
+ }
260
+ else {
261
+ relevantCommits
262
+ .get(projectName)
263
+ ?.push({ commit, isProjectScopedCommit: false });
264
+ }
265
+ }
266
+ }
267
+ }
268
+ return relevantCommits;
247
269
  }
@@ -0,0 +1,20 @@
1
+ export declare function createVersionConfig(): {
2
+ conventionalCommits: boolean;
3
+ groupPreVersionCommand: string;
4
+ preVersionCommand: string;
5
+ deleteVersionPlans: any;
6
+ manifestRootsToUpdate: any;
7
+ specifierSource: any;
8
+ currentVersionResolver: any;
9
+ currentVersionResolverMetadata: any;
10
+ preserveMatchingDependencyRanges: any;
11
+ preserveLocalDependencyProtocols: any;
12
+ fallbackCurrentVersionResolver: any;
13
+ firstRelease: any;
14
+ versionPrefix: any;
15
+ updateDependents: any;
16
+ logUnchangedProjects: any;
17
+ versionActions: any;
18
+ versionActionsOptions: any;
19
+ };
20
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/command-line/release/utils/test/test-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;EAoBlC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createVersionConfig = createVersionConfig;
4
+ function createVersionConfig() {
5
+ return {
6
+ conventionalCommits: false,
7
+ groupPreVersionCommand: '',
8
+ preVersionCommand: '',
9
+ deleteVersionPlans: undefined,
10
+ manifestRootsToUpdate: undefined,
11
+ specifierSource: undefined,
12
+ currentVersionResolver: undefined,
13
+ currentVersionResolverMetadata: undefined,
14
+ preserveMatchingDependencyRanges: undefined,
15
+ preserveLocalDependencyProtocols: undefined,
16
+ fallbackCurrentVersionResolver: undefined,
17
+ firstRelease: undefined,
18
+ versionPrefix: undefined,
19
+ updateDependents: undefined,
20
+ logUnchangedProjects: undefined,
21
+ versionActions: undefined,
22
+ versionActionsOptions: undefined,
23
+ };
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"derive-specifier-from-conventional-commits.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/derive-specifier-from-conventional-commits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAqB,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,wBAAsB,sCAAsC,CAC1D,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,oBAAoB,EAClC,gBAAgB,EAAE,uBAAuB,EAMzC,YAAY,EAAE,OAAO,EACrB,oBAAoB,EAChB,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,GACrD,SAAS,EACb,8BAA8B,CAAC,EAAE,MAAM,EACvC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,CAAC,CAwDzB"}
1
+ {"version":3,"file":"derive-specifier-from-conventional-commits.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/derive-specifier-from-conventional-commits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAqB,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,wBAAsB,sCAAsC,CAC1D,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,oBAAoB,EAClC,gBAAgB,EAAE,uBAAuB,EAMzC,YAAY,EAAE,OAAO,EACrB,oBAAoB,EAChB,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,GACrD,SAAS,EACb,8BAA8B,CAAC,EAAE,MAAM,EACvC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,CAAC,CAwEzB"}