@storm-software/git-tools 2.131.23 → 2.131.24

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 (79) hide show
  1. package/bin/{chunk-77NN2DPB.cjs → chunk-3LVCR6LS.cjs} +4 -4
  2. package/bin/{chunk-77NN2DPB.cjs.map → chunk-3LVCR6LS.cjs.map} +1 -1
  3. package/bin/{chunk-S2N3WA4O.js → chunk-3PI2VV32.js} +3 -3
  4. package/bin/{chunk-S2N3WA4O.js.map → chunk-3PI2VV32.js.map} +1 -1
  5. package/bin/{chunk-KDRZY2YU.js → chunk-3XAQUPZK.js} +10 -8
  6. package/bin/chunk-3XAQUPZK.js.map +1 -0
  7. package/bin/{chunk-ZRZDX2ZA.cjs → chunk-4CS5RPMP.cjs} +5 -5
  8. package/bin/{chunk-ZRZDX2ZA.cjs.map → chunk-4CS5RPMP.cjs.map} +1 -1
  9. package/bin/{chunk-2JR3HPAL.js → chunk-4GZZR7XL.js} +3 -3
  10. package/bin/{chunk-2JR3HPAL.js.map → chunk-4GZZR7XL.js.map} +1 -1
  11. package/bin/{chunk-KBH5ZZ4V.js → chunk-AX3PXQKJ.js} +3 -3
  12. package/bin/{chunk-KBH5ZZ4V.js.map → chunk-AX3PXQKJ.js.map} +1 -1
  13. package/bin/{chunk-5OEE2E65.js → chunk-C6K3ZRT6.js} +3 -3
  14. package/bin/{chunk-5OEE2E65.js.map → chunk-C6K3ZRT6.js.map} +1 -1
  15. package/bin/{chunk-YDVAE433.js → chunk-DOELUOOS.js} +3 -3
  16. package/bin/{chunk-YDVAE433.js.map → chunk-DOELUOOS.js.map} +1 -1
  17. package/bin/{chunk-J76RVP3G.js → chunk-GPHBDU6A.js} +3 -3
  18. package/bin/{chunk-J76RVP3G.js.map → chunk-GPHBDU6A.js.map} +1 -1
  19. package/bin/{chunk-FNM5AXPR.cjs → chunk-M4UDDFX2.cjs} +4 -4
  20. package/bin/{chunk-FNM5AXPR.cjs.map → chunk-M4UDDFX2.cjs.map} +1 -1
  21. package/bin/{chunk-Z5SKX5XN.cjs → chunk-MQOEMLKV.cjs} +4 -4
  22. package/bin/{chunk-Z5SKX5XN.cjs.map → chunk-MQOEMLKV.cjs.map} +1 -1
  23. package/bin/{chunk-KHPLFH3X.cjs → chunk-NSP7UDOF.cjs} +4 -4
  24. package/bin/{chunk-KHPLFH3X.cjs.map → chunk-NSP7UDOF.cjs.map} +1 -1
  25. package/bin/{chunk-7I4XZL7P.cjs → chunk-QITSXT5W.cjs} +6 -6
  26. package/bin/{chunk-7I4XZL7P.cjs.map → chunk-QITSXT5W.cjs.map} +1 -1
  27. package/bin/{chunk-AU2HBQCB.cjs → chunk-QOOEK76B.cjs} +10 -8
  28. package/bin/chunk-QOOEK76B.cjs.map +1 -0
  29. package/bin/{chunk-NKCKZ3E3.cjs → chunk-WZZIVUHI.cjs} +4 -4
  30. package/bin/{chunk-NKCKZ3E3.cjs.map → chunk-WZZIVUHI.cjs.map} +1 -1
  31. package/bin/{chunk-CBJFXXVE.js → chunk-Y7OK7243.js} +3 -3
  32. package/bin/{chunk-CBJFXXVE.js.map → chunk-Y7OK7243.js.map} +1 -1
  33. package/bin/git.cjs +266 -155
  34. package/bin/git.cjs.map +1 -1
  35. package/bin/git.js +127 -16
  36. package/bin/git.js.map +1 -1
  37. package/bin/post-checkout.cjs +7 -7
  38. package/bin/post-checkout.js +2 -2
  39. package/bin/post-commit.cjs +7 -7
  40. package/bin/post-commit.js +2 -2
  41. package/bin/post-merge.cjs +7 -7
  42. package/bin/post-merge.js +2 -2
  43. package/bin/pre-commit.cjs +7 -7
  44. package/bin/pre-commit.js +2 -2
  45. package/bin/pre-install.cjs +7 -7
  46. package/bin/pre-install.js +2 -2
  47. package/bin/pre-push.cjs +7 -7
  48. package/bin/pre-push.js +2 -2
  49. package/bin/prepare.cjs +7 -7
  50. package/bin/prepare.js +2 -2
  51. package/bin/version-warning.cjs +5 -5
  52. package/bin/version-warning.js +1 -1
  53. package/dist/{chunk-YOBEA3QU.cjs → chunk-3YY3EGSK.cjs} +2 -2
  54. package/dist/{chunk-CUC73XZD.cjs → chunk-4J6EYVX4.cjs} +16 -13
  55. package/dist/{chunk-BNXSIXM2.js → chunk-5AVCKBNV.js} +5 -2
  56. package/dist/{chunk-C53K5W6J.js → chunk-A3IJ22YJ.js} +1 -1
  57. package/dist/{chunk-D2TE2WQZ.cjs → chunk-AOPYQZJZ.cjs} +2 -2
  58. package/dist/{chunk-6HBRIYPP.cjs → chunk-C4226MIL.cjs} +3 -3
  59. package/dist/{chunk-46DT23BR.cjs → chunk-F67AF77W.cjs} +8 -6
  60. package/dist/{chunk-HRYBIFJL.js → chunk-GN5PPUYJ.js} +1 -1
  61. package/dist/{chunk-BPDSCBOI.js → chunk-ISJNCGTW.js} +8 -6
  62. package/dist/{chunk-UVEWNW75.js → chunk-JTMGWUUD.js} +1 -1
  63. package/dist/{chunk-WVCBWTDU.js → chunk-MTEWMWXP.js} +1 -1
  64. package/dist/{chunk-2KO5IEIY.cjs → chunk-MWFYZ6C5.cjs} +2 -2
  65. package/dist/{chunk-IDG5O4UL.cjs → chunk-QHOVDHJS.cjs} +2 -2
  66. package/dist/{chunk-NABJ2MII.js → chunk-RA7GZDUN.js} +1 -1
  67. package/dist/{chunk-KVTWY6IN.cjs → chunk-S57KI3QJ.cjs} +2 -2
  68. package/dist/{chunk-FBGULNA7.js → chunk-VXHEKX5N.js} +1 -1
  69. package/dist/{chunk-GNPQRGZ2.cjs → chunk-XMOG277R.cjs} +4 -4
  70. package/dist/{chunk-4KMJAFZI.js → chunk-YEPJCR66.js} +1 -1
  71. package/dist/index.cjs +33 -33
  72. package/dist/index.js +9 -9
  73. package/dist/release/config.cjs +19 -19
  74. package/dist/release/config.d.cts +2 -0
  75. package/dist/release/config.d.ts +2 -0
  76. package/dist/release/config.js +2 -2
  77. package/package.json +7 -7
  78. package/bin/chunk-AU2HBQCB.cjs.map +0 -1
  79. package/bin/chunk-KDRZY2YU.js.map +0 -1
package/bin/git.js CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { postCheckoutHook } from './chunk-YDVAE433.js';
3
- import { postCommitHook } from './chunk-S2N3WA4O.js';
4
- import { postMergeHook } from './chunk-KBH5ZZ4V.js';
5
- import { preCommitHook } from './chunk-2JR3HPAL.js';
6
- import './chunk-5OEE2E65.js';
7
- import { prePushHook } from './chunk-J76RVP3G.js';
2
+ import { postCheckoutHook } from './chunk-DOELUOOS.js';
3
+ import { postCommitHook } from './chunk-3PI2VV32.js';
4
+ import { postMergeHook } from './chunk-AX3PXQKJ.js';
5
+ import { preCommitHook } from './chunk-4GZZR7XL.js';
6
+ import './chunk-C6K3ZRT6.js';
7
+ import { prePushHook } from './chunk-GPHBDU6A.js';
8
8
  import './chunk-HBLWPOJV.js';
9
- import { prepareHook } from './chunk-CBJFXXVE.js';
9
+ import { prepareHook } from './chunk-Y7OK7243.js';
10
10
  import { run, runAsync } from './chunk-RPK5AKGK.js';
11
- import { defu, getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, brandIcon, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, writeWarning, writeTrace, isVerbose, formatLogMessage, __require, STORM_DEFAULT_RELEASE_BANNER } from './chunk-KDRZY2YU.js';
11
+ import { defu, getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, brandIcon, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, writeWarning, writeTrace, isVerbose, formatLogMessage, __require, STORM_DEFAULT_RELEASE_BANNER } from './chunk-3XAQUPZK.js';
12
12
  import TOML from '@ltd/j-toml';
13
13
  import { Command } from 'commander';
14
14
  import '@inquirer/checkbox';
@@ -50,10 +50,11 @@ import { parse } from 'yaml';
50
50
  import chalk from 'chalk';
51
51
  import { printAndFlushChanges as printAndFlushChanges$1 } from 'nx/src/command-line/release/utils/print-changes';
52
52
  import { createGitTagValues, handleDuplicateGitTags, createCommitMessageValues, isPrerelease, shouldPreferDockerVersionForReleaseGroup, ReleaseVersion, noDiffInChangelogMessage, shouldSkipVersionActions } from 'nx/src/command-line/release/utils/shared';
53
- import { interpolate } from 'nx/src/tasks-runner/utils';
53
+ import { interpolate as interpolate$1 } from 'nx/src/tasks-runner/utils';
54
54
  import { execCommand } from 'nx/src/command-line/release/utils/exec-command.js';
55
- import { getCommitHash, getLatestGitTagForPattern, getFirstGitCommit, gitPush, gitAdd, getGitDiff, parseCommits, sanitizeProjectNameForGitTag } from 'nx/src/command-line/release/utils/git';
56
- import semver, { prerelease, major } from 'semver';
55
+ import { getCommitHash, getFirstGitCommit, gitPush, gitAdd, extractTagAndVersion, getGitDiff, parseCommits, sanitizeProjectNameForGitTag } from 'nx/src/command-line/release/utils/git';
56
+ import { interpolate } from 'nx/src/tasks-runner/utils.js';
57
+ import semver, { prerelease, coerce, gte, major } from 'semver';
57
58
  import { ReleaseClient } from 'nx/release';
58
59
  import { readRawVersionPlans, setResolvedVersionPlansOnGroups } from 'nx/src/command-line/release/config/version-plans';
59
60
  import { printAndFlushChanges } from 'nx/src/command-line/release/utils/print-changes.js';
@@ -73,7 +74,7 @@ import { topologicalSort } from 'nx/src/command-line/release/version/topological
73
74
  import { resolveVersionActionsForProject, NOOP_VERSION_ACTIONS as NOOP_VERSION_ACTIONS$1 } from 'nx/src/command-line/release/version/version-actions';
74
75
  import { filterAffected } from 'nx/src/project-graph/affected/affected-project-graph';
75
76
  import { calculateFileChanges } from 'nx/src/project-graph/file-utils';
76
- import gte from 'semver/functions/gte';
77
+ import gte2 from 'semver/functions/gte';
77
78
  import { IMPLICIT_DEFAULT_RELEASE_GROUP as IMPLICIT_DEFAULT_RELEASE_GROUP$1 } from 'nx/src/command-line/release/config/config.js';
78
79
  import { deriveSpecifierFromConventionalCommits } from 'nx/src/command-line/release/version/derive-specifier-from-conventional-commits';
79
80
  import { deriveSpecifierFromVersionPlan } from 'nx/src/command-line/release/version/deriver-specifier-from-version-plans';
@@ -2550,7 +2551,7 @@ async function generateChangelogForProjects({
2550
2551
  for (const project of projects) {
2551
2552
  let interpolatedTreePath = config5.file || "";
2552
2553
  if (interpolatedTreePath) {
2553
- interpolatedTreePath = interpolate(interpolatedTreePath, {
2554
+ interpolatedTreePath = interpolate$1(interpolatedTreePath, {
2554
2555
  projectName: project.name,
2555
2556
  projectRoot: project.data.root,
2556
2557
  workspaceRoot: ""
@@ -2578,7 +2579,7 @@ async function generateChangelogForProjects({
2578
2579
  changes,
2579
2580
  changelogEntryVersion: releaseVersion.rawVersion,
2580
2581
  project: project.name,
2581
- entryWhenNoChanges: typeof config5.entryWhenNoChanges === "string" ? interpolate(config5.entryWhenNoChanges, {
2582
+ entryWhenNoChanges: typeof config5.entryWhenNoChanges === "string" ? interpolate$1(config5.entryWhenNoChanges, {
2582
2583
  projectName: project.name,
2583
2584
  projectRoot: project.data.root,
2584
2585
  workspaceRoot: ""
@@ -2800,6 +2801,109 @@ async function commitChanges({
2800
2801
  verbose: isVerbose2
2801
2802
  });
2802
2803
  }
2804
+ var SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/g;
2805
+ async function getLatestGitTagForPattern(workspaceConfig, releaseTagPattern, additionalInterpolationData = {}, resolveTags, options) {
2806
+ const { requireSemver, strictPreid, preid, checkAllBranchesWhen } = options;
2807
+ try {
2808
+ const tags = await resolveTags(checkAllBranchesWhen);
2809
+ if (!tags.length) {
2810
+ return null;
2811
+ }
2812
+ const interpolatedTagPattern = interpolate(releaseTagPattern, {
2813
+ version: "%v%",
2814
+ projectName: "%p%",
2815
+ releaseGroupName: "%rg%",
2816
+ ...additionalInterpolationData
2817
+ });
2818
+ const tagRegexp = `^${interpolatedTagPattern.replace(/[/\-\\^$*+?.()|[\]{}]/g, "\\$&").replace("%v%", "(.+)").replace("%p%", "(.+)").replace("%rg%", "(.+)")}`;
2819
+ const matchingTags = tags.filter((tag) => {
2820
+ if (requireSemver) {
2821
+ return !!tag.match(tagRegexp) && tag.match(tagRegexp).some((r) => r.match(SEMVER_REGEX));
2822
+ } else {
2823
+ return !!tag.match(tagRegexp);
2824
+ }
2825
+ });
2826
+ if (!matchingTags.length) {
2827
+ return null;
2828
+ }
2829
+ writeDebug(
2830
+ `Found ${matchingTags.length} matching tags out of ${tags.length} total tags for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2831
+ workspaceConfig
2832
+ );
2833
+ if (!strictPreid) {
2834
+ writeDebug(
2835
+ `Not using strict preid, will use the first matching tag ${matchingTags[0]} for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2836
+ workspaceConfig
2837
+ );
2838
+ return extractTagAndVersion(matchingTags[0], tagRegexp, options);
2839
+ }
2840
+ const stableReleaseTags = matchingTags.filter((tag) => {
2841
+ const matches = tag.match(tagRegexp);
2842
+ if (!matches) return false;
2843
+ const [, version] = matches;
2844
+ return version && !isPrerelease(version);
2845
+ });
2846
+ writeDebug(
2847
+ `Found ${stableReleaseTags.length} stable tags for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2848
+ workspaceConfig
2849
+ );
2850
+ if (preid && preid.length > 0) {
2851
+ const preidReleaseTags = matchingTags.filter((tag) => {
2852
+ const match = tag.match(tagRegexp);
2853
+ if (!match) return false;
2854
+ const version = match.find((part) => part.match(SEMVER_REGEX));
2855
+ return version && version.includes(`-${preid}.`);
2856
+ });
2857
+ writeDebug(
2858
+ `Found ${preidReleaseTags.length} preid tags for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2859
+ workspaceConfig
2860
+ );
2861
+ if (preidReleaseTags.length > 0 && stableReleaseTags.length > 0) {
2862
+ const preidResult = extractTagAndVersion(
2863
+ preidReleaseTags[0],
2864
+ tagRegexp,
2865
+ options
2866
+ );
2867
+ const stableResult = extractTagAndVersion(
2868
+ stableReleaseTags[0],
2869
+ tagRegexp,
2870
+ options
2871
+ );
2872
+ writeDebug(
2873
+ `Extracted preid version: ${preidResult.extractedVersion} and stable version: ${stableResult.extractedVersion} for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2874
+ workspaceConfig
2875
+ );
2876
+ const preidBaseVersion = coerce(preidResult.extractedVersion)?.version;
2877
+ const stableVersion = stableResult.extractedVersion;
2878
+ if (preidBaseVersion && stableVersion && gte(stableVersion, preidBaseVersion)) {
2879
+ writeDebug(
2880
+ `Using latest stable tag for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern}) because its version (${stableVersion}) is greater than or equal to the base version of the latest preid tag (${preidBaseVersion})`,
2881
+ workspaceConfig
2882
+ );
2883
+ return stableResult;
2884
+ }
2885
+ return preidResult;
2886
+ }
2887
+ if (preidReleaseTags.length > 0) {
2888
+ writeDebug(
2889
+ `Using latest preid tag for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2890
+ workspaceConfig
2891
+ );
2892
+ return extractTagAndVersion(preidReleaseTags[0], tagRegexp, options);
2893
+ }
2894
+ }
2895
+ if (stableReleaseTags.length > 0) {
2896
+ writeDebug(
2897
+ `Using latest stable tag for release tag pattern "${releaseTagPattern}" (Interpolated tag pattern: ${interpolatedTagPattern})`,
2898
+ workspaceConfig
2899
+ );
2900
+ return extractTagAndVersion(stableReleaseTags[0], tagRegexp, options);
2901
+ }
2902
+ return null;
2903
+ } catch {
2904
+ return null;
2905
+ }
2906
+ }
2803
2907
 
2804
2908
  // src/utilities/omit.ts
2805
2909
  function omit(obj, keys) {
@@ -3357,7 +3461,9 @@ var DEFAULT_RELEASE_GROUP_CONFIG = {
3357
3461
  ...DEFAULT_VERSION_RELEASE_CONFIG
3358
3462
  },
3359
3463
  releaseTag: {
3360
- preferDockerVersion: false
3464
+ checkAllBranchesWhen: true,
3465
+ preferDockerVersion: false,
3466
+ strictPreid: true
3361
3467
  },
3362
3468
  versionPlans: false
3363
3469
  };
@@ -3977,6 +4083,7 @@ var ReleaseGraph = class _ReleaseGraph {
3977
4083
  };
3978
4084
  if (releaseGroupNode.group.projectsRelationship === "fixed" && !releaseTagPattern.includes("{projectName}")) {
3979
4085
  const groupReleaseTag = await getLatestGitTagForPattern(
4086
+ this.workspaceConfig,
3980
4087
  releaseTagPattern,
3981
4088
  additionalInterpolationData,
3982
4089
  this.resolveRepositoryTags.bind(this),
@@ -3986,6 +4093,7 @@ var ReleaseGraph = class _ReleaseGraph {
3986
4093
  "{releaseGroupName}"
3987
4094
  ) ? releaseTagPattern.replace("{releaseGroupName}", "{projectName}") : `{projectName}@${releaseTagPattern}`;
3988
4095
  const projectReleaseTag = await getLatestGitTagForPattern(
4096
+ this.workspaceConfig,
3989
4097
  projectReleaseTagPattern,
3990
4098
  additionalInterpolationData,
3991
4099
  this.resolveRepositoryTags.bind(this),
@@ -3998,7 +4106,7 @@ Group release tag: ${groupReleaseTag?.tag}
3998
4106
  Project release tag: ${projectReleaseTag?.tag}`,
3999
4107
  this.workspaceConfig
4000
4108
  );
4001
- if (projectReleaseTag?.extractedVersion && groupReleaseTag?.extractedVersion && gte(
4109
+ if (projectReleaseTag?.extractedVersion && groupReleaseTag?.extractedVersion && gte2(
4002
4110
  projectReleaseTag.extractedVersion,
4003
4111
  groupReleaseTag.extractedVersion
4004
4112
  )) {
@@ -4008,6 +4116,7 @@ Project release tag: ${projectReleaseTag?.tag}`,
4008
4116
  }
4009
4117
  } else {
4010
4118
  latestMatchingGitTag = await getLatestGitTagForPattern(
4119
+ this.workspaceConfig,
4011
4120
  releaseTagPattern,
4012
4121
  additionalInterpolationData,
4013
4122
  this.resolveRepositoryTags.bind(this),
@@ -5139,6 +5248,7 @@ ${formatConfigLog(config5)}`,
5139
5248
  for (const project of projectNodes) {
5140
5249
  let changes = null;
5141
5250
  let fromRef = options.from || (await getLatestGitTagForPattern(
5251
+ this.workspaceConfig,
5142
5252
  releaseGroup.releaseTag.pattern,
5143
5253
  {
5144
5254
  projectName: project.name,
@@ -5234,6 +5344,7 @@ ${formatConfigLog(config5)}`,
5234
5344
  } else {
5235
5345
  let changes = [];
5236
5346
  let fromRef = options.from || (await getLatestGitTagForPattern(
5347
+ this.workspaceConfig,
5237
5348
  releaseGroup.releaseTag.pattern,
5238
5349
  {
5239
5350
  releaseGroupName: releaseGroup.name