@storm-software/git-tools 2.130.40 → 2.131.7

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 (75) hide show
  1. package/README.md +1 -1
  2. package/bin/{chunk-3RY4CGUX.js → chunk-32WE3MHJ.js} +3 -3
  3. package/bin/{chunk-3RY4CGUX.js.map → chunk-32WE3MHJ.js.map} +1 -1
  4. package/bin/chunk-4EOHM2UV.cjs +16 -0
  5. package/bin/{chunk-ROM64JTJ.cjs.map → chunk-4EOHM2UV.cjs.map} +1 -1
  6. package/bin/{chunk-PTYTYIPG.cjs → chunk-4ILBJTRR.cjs} +9 -3
  7. package/bin/chunk-4ILBJTRR.cjs.map +1 -0
  8. package/bin/{chunk-BHWWH5OI.js → chunk-7ES3CGZQ.js} +9 -4
  9. package/bin/chunk-7ES3CGZQ.js.map +1 -0
  10. package/bin/{chunk-Y6YU46VF.js → chunk-ABI4JM6L.js} +3 -3
  11. package/bin/{chunk-Y6YU46VF.js.map → chunk-ABI4JM6L.js.map} +1 -1
  12. package/bin/{chunk-UIGOGTUM.cjs → chunk-AQ5YHZ3Z.cjs} +4 -4
  13. package/bin/{chunk-UIGOGTUM.cjs.map → chunk-AQ5YHZ3Z.cjs.map} +1 -1
  14. package/bin/{chunk-IEGXPTOH.js → chunk-AZGQVIYO.js} +4 -4
  15. package/bin/{chunk-IEGXPTOH.js.map → chunk-AZGQVIYO.js.map} +1 -1
  16. package/bin/{chunk-6V4HD3QJ.js → chunk-CDUCLZJV.js} +4 -4
  17. package/bin/{chunk-6V4HD3QJ.js.map → chunk-CDUCLZJV.js.map} +1 -1
  18. package/bin/{chunk-GU7L3IBA.js → chunk-CVTLZKKX.js} +4 -4
  19. package/bin/{chunk-GU7L3IBA.js.map → chunk-CVTLZKKX.js.map} +1 -1
  20. package/bin/{chunk-THX6DU6T.cjs → chunk-DPKFBB3S.cjs} +7 -7
  21. package/bin/{chunk-THX6DU6T.cjs.map → chunk-DPKFBB3S.cjs.map} +1 -1
  22. package/bin/{chunk-V6PBXXP5.js → chunk-IAZL2KCV.js} +4 -4
  23. package/bin/{chunk-V6PBXXP5.js.map → chunk-IAZL2KCV.js.map} +1 -1
  24. package/bin/{chunk-FH5OSXAJ.cjs → chunk-MTAYUS7E.cjs} +18 -2
  25. package/bin/chunk-MTAYUS7E.cjs.map +1 -0
  26. package/bin/{chunk-DNLVUV64.js → chunk-NOZEXVLA.js} +4 -4
  27. package/bin/{chunk-DNLVUV64.js.map → chunk-NOZEXVLA.js.map} +1 -1
  28. package/bin/{chunk-LR2WNL25.cjs → chunk-OGGY5I23.cjs} +7 -7
  29. package/bin/{chunk-LR2WNL25.cjs.map → chunk-OGGY5I23.cjs.map} +1 -1
  30. package/bin/chunk-POFLIQQB.cjs +18 -0
  31. package/bin/{chunk-USGU6ZVC.cjs.map → chunk-POFLIQQB.cjs.map} +1 -1
  32. package/bin/chunk-RPK5AKGK.js +39 -0
  33. package/bin/chunk-RPK5AKGK.js.map +1 -0
  34. package/bin/{chunk-27LFN4VQ.cjs → chunk-RZNFHUM6.cjs} +7 -7
  35. package/bin/{chunk-27LFN4VQ.cjs.map → chunk-RZNFHUM6.cjs.map} +1 -1
  36. package/bin/{chunk-MY767YV7.cjs → chunk-W5P2IM2W.cjs} +6 -6
  37. package/bin/{chunk-MY767YV7.cjs.map → chunk-W5P2IM2W.cjs.map} +1 -1
  38. package/bin/git.cjs +1439 -225
  39. package/bin/git.cjs.map +1 -1
  40. package/bin/git.js +1334 -123
  41. package/bin/git.js.map +1 -1
  42. package/bin/post-checkout.cjs +8 -8
  43. package/bin/post-checkout.js +3 -3
  44. package/bin/post-commit.cjs +8 -8
  45. package/bin/post-commit.js +3 -3
  46. package/bin/post-merge.cjs +8 -8
  47. package/bin/post-merge.js +3 -3
  48. package/bin/pre-commit.cjs +7 -7
  49. package/bin/pre-commit.js +2 -2
  50. package/bin/pre-install.cjs +8 -8
  51. package/bin/pre-install.js +3 -3
  52. package/bin/pre-push.cjs +7 -7
  53. package/bin/pre-push.js +2 -2
  54. package/bin/prepare.cjs +8 -8
  55. package/bin/prepare.js +3 -3
  56. package/bin/version-warning.cjs +5 -5
  57. package/bin/version-warning.js +1 -1
  58. package/dist/{chunk-GTHIKJY7.cjs → chunk-VOWQJXPC.cjs} +215 -50
  59. package/dist/{chunk-VBTXRYZY.js → chunk-ZDXX5TWI.js} +211 -53
  60. package/dist/index.cjs +41 -9
  61. package/dist/index.d.cts +2 -2
  62. package/dist/index.d.ts +2 -2
  63. package/dist/index.js +1 -1
  64. package/dist/release/config.cjs +41 -9
  65. package/dist/release/config.d.cts +100 -7
  66. package/dist/release/config.d.ts +100 -7
  67. package/dist/release/config.js +1 -1
  68. package/package.json +11 -8
  69. package/bin/chunk-BHWWH5OI.js.map +0 -1
  70. package/bin/chunk-FH5OSXAJ.cjs.map +0 -1
  71. package/bin/chunk-G3YPGVPS.js +0 -24
  72. package/bin/chunk-G3YPGVPS.js.map +0 -1
  73. package/bin/chunk-PTYTYIPG.cjs.map +0 -1
  74. package/bin/chunk-ROM64JTJ.cjs +0 -16
  75. package/bin/chunk-USGU6ZVC.cjs +0 -18
package/bin/git.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkTHX6DU6T_cjs = require('./chunk-THX6DU6T.cjs');
5
- var chunkLR2WNL25_cjs = require('./chunk-LR2WNL25.cjs');
6
- var chunk27LFN4VQ_cjs = require('./chunk-27LFN4VQ.cjs');
7
- var chunkUIGOGTUM_cjs = require('./chunk-UIGOGTUM.cjs');
8
- require('./chunk-USGU6ZVC.cjs');
9
- var chunkMY767YV7_cjs = require('./chunk-MY767YV7.cjs');
4
+ var chunkDPKFBB3S_cjs = require('./chunk-DPKFBB3S.cjs');
5
+ var chunkOGGY5I23_cjs = require('./chunk-OGGY5I23.cjs');
6
+ var chunkRZNFHUM6_cjs = require('./chunk-RZNFHUM6.cjs');
7
+ var chunkAQ5YHZ3Z_cjs = require('./chunk-AQ5YHZ3Z.cjs');
8
+ require('./chunk-POFLIQQB.cjs');
9
+ var chunkW5P2IM2W_cjs = require('./chunk-W5P2IM2W.cjs');
10
10
  require('./chunk-YHZNDNCW.cjs');
11
- var chunkROM64JTJ_cjs = require('./chunk-ROM64JTJ.cjs');
12
- var chunkFH5OSXAJ_cjs = require('./chunk-FH5OSXAJ.cjs');
13
- var chunkPTYTYIPG_cjs = require('./chunk-PTYTYIPG.cjs');
11
+ var chunk4EOHM2UV_cjs = require('./chunk-4EOHM2UV.cjs');
12
+ var chunkMTAYUS7E_cjs = require('./chunk-MTAYUS7E.cjs');
13
+ var chunk4ILBJTRR_cjs = require('./chunk-4ILBJTRR.cjs');
14
14
  var TOML = require('@ltd/j-toml');
15
15
  var commander = require('commander');
16
16
  require('@inquirer/checkbox');
@@ -54,12 +54,24 @@ var utils = require('nx/src/tasks-runner/utils');
54
54
  var execCommand_js = require('nx/src/command-line/release/utils/exec-command.js');
55
55
  var git = require('nx/src/command-line/release/utils/git');
56
56
  var semver = require('semver');
57
+ var clone = require('nanoclone');
57
58
  var release = require('nx/release');
59
+ var versionPlans = require('nx/src/command-line/release/config/version-plans');
60
+ var printChanges_js = require('nx/src/command-line/release/utils/print-changes.js');
61
+ var releaseGraph = require('nx/src/command-line/release/utils/release-graph');
62
+ var versionPlanUtils = require('nx/src/command-line/release/utils/version-plan-utils');
58
63
  var nxJson = require('nx/src/config/nx-json');
59
64
  var tree = require('nx/src/generators/tree');
60
65
  var fileMapUtils = require('nx/src/project-graph/file-map-utils');
66
+ var importsPlugin = require('prettier-plugin-organize-imports');
61
67
  var DefaultChangelogRenderer = require('nx/release/changelog-renderer');
62
68
  var conventionalCommits = require('nx/src/command-line/release/config/conventional-commits');
69
+ var findMatchingProjects = require('nx/src/utils/find-matching-projects');
70
+ var config_js = require('nx/src/command-line/release/config/config.js');
71
+ var deriveSpecifierFromConventionalCommits = require('nx/src/command-line/release/version/derive-specifier-from-conventional-commits');
72
+ var deriverSpecifierFromVersionPlans = require('nx/src/command-line/release/version/deriver-specifier-from-version-plans');
73
+ var releaseGroupProcessor = require('nx/src/command-line/release/version/release-group-processor');
74
+ var versionActions_js = require('nx/src/command-line/release/version/version-actions.js');
63
75
 
64
76
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
65
77
 
@@ -81,6 +93,9 @@ var ___default = /*#__PURE__*/_interopDefault(_);
81
93
  var updateSection__default = /*#__PURE__*/_interopDefault(updateSection);
82
94
  var axios__default = /*#__PURE__*/_interopDefault(axios);
83
95
  var chalk__default = /*#__PURE__*/_interopDefault(chalk);
96
+ var semver__default = /*#__PURE__*/_interopDefault(semver);
97
+ var clone__default = /*#__PURE__*/_interopDefault(clone);
98
+ var importsPlugin__default = /*#__PURE__*/_interopDefault(importsPlugin);
84
99
  var DefaultChangelogRenderer__default = /*#__PURE__*/_interopDefault(DefaultChangelogRenderer);
85
100
 
86
101
  function parseCargoToml(cargoString) {
@@ -409,9 +424,9 @@ function getRuleFromScopeEnum(scopeEnum) {
409
424
 
410
425
  // ../conventional-changelog/src/index.ts
411
426
  async function createPreset(variant = "monorepo") {
412
- const workspaceConfig = await chunkPTYTYIPG_cjs.getWorkspaceConfig();
427
+ const workspaceConfig = await chunk4ILBJTRR_cjs.getWorkspaceConfig();
413
428
  if (variant === "minimal") {
414
- return chunkPTYTYIPG_cjs.defu(
429
+ return chunk4ILBJTRR_cjs.defu(
415
430
  await createBasePreset__default.default({ ...COMMIT_CONFIGS.minimal.changelogs.props }),
416
431
  {
417
432
  ...COMMIT_CONFIGS.minimal,
@@ -425,7 +440,7 @@ async function createPreset(variant = "monorepo") {
425
440
  );
426
441
  }
427
442
  const nxScopes = await getNxScopes({ config: workspaceConfig });
428
- return chunkPTYTYIPG_cjs.defu(
443
+ return chunk4ILBJTRR_cjs.defu(
429
444
  await createBasePreset__default.default({
430
445
  ...COMMIT_CONFIGS.monorepo.changelogs.props,
431
446
  scope: nxScopes
@@ -989,7 +1004,7 @@ async function lint(message, config5) {
989
1004
  // src/commitlint/run.ts
990
1005
  var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
991
1006
  async function runCommitLint(workspaceConfig, options) {
992
- chunkPTYTYIPG_cjs.writeInfo(
1007
+ chunk4ILBJTRR_cjs.writeInfo(
993
1008
  "\u{1F4DD} Validating git commit message aligns with the Storm Software specification",
994
1009
  workspaceConfig
995
1010
  );
@@ -997,7 +1012,7 @@ async function runCommitLint(workspaceConfig, options) {
997
1012
  if (options.message && options.message !== COMMIT_EDITMSG_PATH) {
998
1013
  commitMessage = options.message;
999
1014
  } else {
1000
- const commitFile = chunkPTYTYIPG_cjs.joinPaths(
1015
+ const commitFile = chunk4ILBJTRR_cjs.joinPaths(
1001
1016
  workspaceConfig.workspaceRoot,
1002
1017
  options.file || options.message || COMMIT_EDITMSG_PATH
1003
1018
  );
@@ -1014,17 +1029,17 @@ async function runCommitLint(workspaceConfig, options) {
1014
1029
  if (upstreamRemote) {
1015
1030
  const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
1016
1031
  if (!upstreamRemoteIdentifier) {
1017
- chunkPTYTYIPG_cjs.writeWarning(
1032
+ chunk4ILBJTRR_cjs.writeWarning(
1018
1033
  `No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison.`,
1019
1034
  workspaceConfig
1020
1035
  );
1021
1036
  return;
1022
1037
  }
1023
- chunkPTYTYIPG_cjs.writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
1038
+ chunk4ILBJTRR_cjs.writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
1024
1039
  const currentBranch = childProcess__default.default.execSync("git branch --show-current").toString().trim();
1025
1040
  gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
1026
1041
  } else {
1027
- chunkPTYTYIPG_cjs.writeWarning(
1042
+ chunk4ILBJTRR_cjs.writeWarning(
1028
1043
  `No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison against upstream main.`,
1029
1044
  workspaceConfig
1030
1045
  );
@@ -1032,7 +1047,7 @@ async function runCommitLint(workspaceConfig, options) {
1032
1047
  }
1033
1048
  commitMessage = childProcess__default.default.execSync(gitLogCmd).toString().trim();
1034
1049
  if (!commitMessage) {
1035
- chunkPTYTYIPG_cjs.writeWarning(
1050
+ chunk4ILBJTRR_cjs.writeWarning(
1036
1051
  "No commits found. Skipping commit message validation.",
1037
1052
  workspaceConfig
1038
1053
  );
@@ -1042,7 +1057,7 @@ async function runCommitLint(workspaceConfig, options) {
1042
1057
  const preset = await createPreset(workspaceConfig.variant);
1043
1058
  const report = await lint(commitMessage, preset);
1044
1059
  if (!preset.commitlint.regex.test(commitMessage) || report.errors.length || report.warnings.length) {
1045
- chunkPTYTYIPG_cjs.writeSuccess(
1060
+ chunk4ILBJTRR_cjs.writeSuccess(
1046
1061
  `Commit was processing completed successfully!`,
1047
1062
  workspaceConfig
1048
1063
  );
@@ -1254,7 +1269,7 @@ async function createState(workspaceConfig, configPath) {
1254
1269
  const project = projectConfigurations.projects[scope];
1255
1270
  if (project) {
1256
1271
  let description = `${project.name} - ${project.root}`;
1257
- const packageJsonPath = chunkPTYTYIPG_cjs.joinPaths(project.root, "package.json");
1272
+ const packageJsonPath = chunk4ILBJTRR_cjs.joinPaths(project.root, "package.json");
1258
1273
  if (fs$1.existsSync(packageJsonPath)) {
1259
1274
  const packageJsonFile = await fs.readFile(packageJsonPath, "utf8");
1260
1275
  const packageJson = JSON.parse(packageJsonFile);
@@ -1300,11 +1315,11 @@ var formatCommitMessage = (state, workspaceConfig) => {
1300
1315
  const scope = workspaceConfig.variant !== "minimal" && typeof answers.scope === "string" && answers.scope ? answers.scope.trim() : "";
1301
1316
  const subject = answers.subject?.trim();
1302
1317
  const type = answers.type;
1303
- const format3 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
1318
+ const format4 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
1304
1319
  const body = answers.body && typeof answers.body === "string" ? wrap__default.default(answers.body || "", wrapOptions) : "";
1305
1320
  const breaking = answers.breakingBody && typeof answers.breakingBody === "string" ? wrap__default.default(answers.breakingBody || "", wrapOptions) : "";
1306
1321
  const issues = answers.issuesBody && typeof answers.issuesBody === "string" ? wrap__default.default(answers.issuesBody || "", wrapOptions) : "";
1307
- const head = format3.replace(/\{emoji\}/g, config5.settings.disableEmoji ? "" : `${emoji} `).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
1322
+ const head = format4.replace(/\{emoji\}/g, config5.settings.disableEmoji ? "" : `${emoji} `).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
1308
1323
  let msg = head;
1309
1324
  if (body) {
1310
1325
  msg += `
@@ -1328,20 +1343,20 @@ ${closedIssueEmoji}${config5.settings.closedIssueMessage}${issues}`;
1328
1343
 
1329
1344
  // src/commit/run.ts
1330
1345
  async function runCommit(commitizenFile, dryRun = false) {
1331
- const workspaceConfig = await chunkPTYTYIPG_cjs.getWorkspaceConfig();
1346
+ const workspaceConfig = await chunk4ILBJTRR_cjs.getWorkspaceConfig();
1332
1347
  const state = await createState(workspaceConfig);
1333
1348
  if (dryRun) {
1334
- chunkPTYTYIPG_cjs.writeInfo("Running in dry mode.", workspaceConfig);
1349
+ chunk4ILBJTRR_cjs.writeInfo("Running in dry mode.", workspaceConfig);
1335
1350
  }
1336
1351
  console.log(chalkTemplate__default.default`
1337
1352
  {bold.#999999 ----------------------------------------}
1338
1353
 
1339
- {bold.#FFFFFF ${chunkPTYTYIPG_cjs.brandIcon(workspaceConfig)} Storm Software Git-Tools - Commit}
1354
+ {bold.#FFFFFF ${chunk4ILBJTRR_cjs.brandIcon(workspaceConfig)} Storm Software Git-Tools - Commit}
1340
1355
  {#CCCCCC Please provide the requested details below...}
1341
1356
  `);
1342
1357
  state.answers = await askQuestions(state);
1343
1358
  const message = formatCommitMessage(state, workspaceConfig);
1344
- const commitMsgFile = chunkPTYTYIPG_cjs.joinPaths(getGitDir(), "COMMIT_EDITMSG");
1359
+ const commitMsgFile = chunk4ILBJTRR_cjs.joinPaths(getGitDir(), "COMMIT_EDITMSG");
1345
1360
  console.log(chalkTemplate__default.default`
1346
1361
  {bold.#999999 ----------------------------------------}
1347
1362
 
@@ -1354,14 +1369,14 @@ async function runCommit(commitizenFile, dryRun = false) {
1354
1369
  commandItems.push(...["--file", commitMsgFile]);
1355
1370
  const command = shellescape__default.default(commandItems);
1356
1371
  if (dryRun) {
1357
- chunkPTYTYIPG_cjs.writeDebug(
1372
+ chunk4ILBJTRR_cjs.writeDebug(
1358
1373
  `Skipping execution [dry-run]: ${command.replace(commitMsgFile, ".git/COMMIT_EDITMSG")}`,
1359
1374
  workspaceConfig
1360
1375
  );
1361
- chunkPTYTYIPG_cjs.writeDebug(`Message [dry-run]: ${message}`, workspaceConfig);
1376
+ chunk4ILBJTRR_cjs.writeDebug(`Message [dry-run]: ${message}`, workspaceConfig);
1362
1377
  } else {
1363
1378
  await fs__default.default.writeFile(commitMsgFile, message);
1364
- chunkFH5OSXAJ_cjs.run(workspaceConfig, command);
1379
+ chunkMTAYUS7E_cjs.run(workspaceConfig, command);
1365
1380
  }
1366
1381
  }
1367
1382
  async function askQuestions(state) {
@@ -2010,14 +2025,14 @@ var runReadme = async ({
2010
2025
  project,
2011
2026
  output: output3,
2012
2027
  clean = true,
2013
- prettier = true,
2028
+ prettier: prettier2 = true,
2014
2029
  workspace = false
2015
2030
  }) => {
2016
2031
  const projectGraph = await projectGraph_js.createProjectGraphAsync({
2017
2032
  exitOnError: true
2018
2033
  });
2019
2034
  const projectConfigs = projectGraph_js.readProjectsConfigurationFromProjectGraph(projectGraph);
2020
- const workspaceRoot = chunkPTYTYIPG_cjs.findWorkspaceRootSafe(process.cwd());
2035
+ const workspaceRoot = chunk4ILBJTRR_cjs.findWorkspaceRootSafe(process.cwd());
2021
2036
  if (!workspaceRoot) {
2022
2037
  throw new Error(
2023
2038
  "Unable to find the workspace root. Please ensure you are running this command from within a workspace."
@@ -2045,7 +2060,7 @@ var runReadme = async ({
2045
2060
  templates,
2046
2061
  output: output3,
2047
2062
  clean,
2048
- prettier
2063
+ prettier: prettier2
2049
2064
  });
2050
2065
  } else {
2051
2066
  for (const projectName of Object.keys(projectConfigs.projects)) {
@@ -2053,12 +2068,12 @@ var runReadme = async ({
2053
2068
  templates,
2054
2069
  output: output3,
2055
2070
  clean,
2056
- prettier
2071
+ prettier: prettier2
2057
2072
  });
2058
2073
  }
2059
2074
  }
2060
2075
  };
2061
- var runProjectReadme = async (projectName, { templates, output: output3, clean = true, prettier = true }) => {
2076
+ var runProjectReadme = async (projectName, { templates, output: output3, clean = true, prettier: prettier2 = true }) => {
2062
2077
  const projectGraph = await projectGraph_js.createProjectGraphAsync({
2063
2078
  exitOnError: true
2064
2079
  });
@@ -2146,10 +2161,10 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
2146
2161
  }
2147
2162
  }
2148
2163
  }
2149
- if (prettier) {
2150
- const prettier2 = await import('prettier');
2164
+ if (prettier2) {
2165
+ const prettier3 = await import('prettier');
2151
2166
  console.info("Formatting output with Prettier");
2152
- newContent = await prettier2.format(newContent, {
2167
+ newContent = await prettier3.format(newContent, {
2153
2168
  parser: "markdown",
2154
2169
  trailingComma: "none",
2155
2170
  tabWidth: 2,
@@ -2434,7 +2449,7 @@ async function generateChangelogContent(releaseVersion, filepath, newContent, cu
2434
2449
  const header = await prettier.format(
2435
2450
  `![${(typeof workspaceConfig?.release.banner === "string" ? workspaceConfig.organization ? titleCase(
2436
2451
  typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization.name
2437
- ) : void 0 : workspaceConfig?.release.banner.alt) || "Branded release banner image"}](${bannerUrl || chunkPTYTYIPG_cjs.STORM_DEFAULT_RELEASE_BANNER})
2452
+ ) : void 0 : workspaceConfig?.release.banner.alt) || "Branded release banner image"}](${bannerUrl || chunk4ILBJTRR_cjs.STORM_DEFAULT_RELEASE_BANNER})
2438
2453
 
2439
2454
  # Changelog ${project || workspaceConfig?.name ? "for" : ""}${workspaceConfig?.name ? ` ${titleCase(workspaceConfig.name)}` : ""}${project ? `${workspaceConfig?.name ? " -" : ""} ${titleCase(project)}` : ""}
2440
2455
 
@@ -2610,12 +2625,12 @@ async function generateChangelogForProjects({
2610
2625
  projectChangelogs
2611
2626
  )) {
2612
2627
  if (!projectGraph.nodes[projectName]?.data.root) {
2613
- chunkPTYTYIPG_cjs.writeWarning(
2628
+ chunk4ILBJTRR_cjs.writeWarning(
2614
2629
  `A changelog was generated for ${projectName}, but it could not be found in the project graph. Skipping writing changelog file.`,
2615
2630
  workspaceConfig
2616
2631
  );
2617
2632
  } else if (projectChangelog.contents) {
2618
- const filePath = chunkPTYTYIPG_cjs.joinPaths(
2633
+ const filePath = chunk4ILBJTRR_cjs.joinPaths(
2619
2634
  projectGraph.nodes[projectName].data.root,
2620
2635
  "CHANGELOG.md"
2621
2636
  );
@@ -2623,7 +2638,7 @@ async function generateChangelogForProjects({
2623
2638
  if (fs$1.existsSync(filePath)) {
2624
2639
  currentContent = await fs.readFile(filePath, "utf8");
2625
2640
  }
2626
- chunkPTYTYIPG_cjs.writeDebug(
2641
+ chunk4ILBJTRR_cjs.writeDebug(
2627
2642
  `\u270D\uFE0F Writing changelog for project ${projectName} to ${filePath}`,
2628
2643
  workspaceConfig
2629
2644
  );
@@ -2846,7 +2861,7 @@ var StormGithubRemoteReleaseClient = class extends github.GithubRemoteReleaseCli
2846
2861
  }
2847
2862
  async createOrUpdateRelease(releaseVersion, changelogContents, latestCommit, { dryRun }) {
2848
2863
  if (!this.workspaceConfig) {
2849
- this.workspaceConfig = await chunkPTYTYIPG_cjs.getWorkspaceConfig();
2864
+ this.workspaceConfig = await chunk4ILBJTRR_cjs.getWorkspaceConfig();
2850
2865
  }
2851
2866
  const name = releaseVersion.gitTag.includes("@") ? releaseVersion.gitTag.replace(new RegExp(`^@${this.workspaceConfig.name}/`), "").replace(/@.*$/, "") : releaseVersion.gitTag;
2852
2867
  return super.createOrUpdateRelease(
@@ -3025,6 +3040,54 @@ async function isUserAnOrganizationMember(userId, config5, remoteName = "origin"
3025
3040
  return false;
3026
3041
  }
3027
3042
  }
3043
+
3044
+ // src/utilities/logs.ts
3045
+ function formatNxLog(message) {
3046
+ const { title, bodyLines } = message;
3047
+ return `${title}${bodyLines && bodyLines.length > 0 ? `
3048
+ ${bodyLines.map((line) => ` ${line}`).join("\n")}` : ""}`;
3049
+ }
3050
+ async function format3(path, data) {
3051
+ let code = data;
3052
+ try {
3053
+ const resolvedConfig = await prettier.resolveConfig(path);
3054
+ if (resolvedConfig) {
3055
+ code = await prettier.format(
3056
+ data,
3057
+ chunk4ILBJTRR_cjs.defu(
3058
+ {
3059
+ absolutePath: path,
3060
+ ...resolvedConfig
3061
+ },
3062
+ path.endsWith(".ts") || path.endsWith(".tsx") ? { plugins: [importsPlugin__default.default] } : {}
3063
+ )
3064
+ );
3065
+ }
3066
+ } catch (error) {
3067
+ throw new Error(
3068
+ `Failed to format file at ${path} with Prettier: ${error.message}`,
3069
+ { cause: error }
3070
+ );
3071
+ }
3072
+ return code;
3073
+ }
3074
+ async function formatChangedFiles(tree) {
3075
+ if (process.env.NX_SKIP_FORMAT === "true") {
3076
+ return;
3077
+ }
3078
+ const files = new Set(
3079
+ tree.listChanges().filter((file) => file.type !== "DELETE")
3080
+ );
3081
+ const results = await Promise.all(
3082
+ Array.from(files).filter((file) => file.content && file.path).map(async (file) => [
3083
+ file.path,
3084
+ await format3(file.path, file.content?.toString("utf-8") ?? "")
3085
+ ])
3086
+ );
3087
+ for (const [path, content] of results) {
3088
+ tree.write(path, content);
3089
+ }
3090
+ }
3028
3091
  var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.default {
3029
3092
  /**
3030
3093
  * The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
@@ -3047,7 +3110,7 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.def
3047
3110
  }
3048
3111
  async render() {
3049
3112
  if (!this.workspaceConfig) {
3050
- this.workspaceConfig = await chunkPTYTYIPG_cjs.getWorkspaceConfig();
3113
+ this.workspaceConfig = await chunk4ILBJTRR_cjs.getWorkspaceConfig();
3051
3114
  }
3052
3115
  return super.render();
3053
3116
  }
@@ -3228,38 +3291,112 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.def
3228
3291
  }
3229
3292
  };
3230
3293
 
3231
- // src/release/config.ts
3294
+ // ../package-constants/src/tags.ts
3295
+ var ProjectTagConstants = {
3296
+ Language: {
3297
+ TAG_ID: "language",
3298
+ TYPESCRIPT: "typescript",
3299
+ RUST: "rust"
3300
+ }};
3301
+ var formatProjectTag = (variant, value) => {
3302
+ return `${variant}:${value}`;
3303
+ };
3304
+ var hasProjectTag = (project, variant) => {
3305
+ project.tags = project.tags ?? [];
3306
+ const prefix = formatProjectTag(variant, "");
3307
+ return project.tags.some(
3308
+ (tag) => tag.startsWith(prefix) && tag.length > prefix.length
3309
+ );
3310
+ };
3311
+ var getProjectTag = (project, variant) => {
3312
+ if (!hasProjectTag(project, variant)) {
3313
+ return void 0;
3314
+ }
3315
+ project.tags = project.tags ?? [];
3316
+ const prefix = formatProjectTag(variant, "");
3317
+ const tag = project.tags.find((tag2) => tag2.startsWith(prefix));
3318
+ return tag?.replace(prefix, "");
3319
+ };
3320
+ var isEqualProjectTag = (project, variant, value) => {
3321
+ const tag = getProjectTag(project, variant);
3322
+ return !!(tag && tag?.toUpperCase() === value.toUpperCase());
3323
+ };
3232
3324
  var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
3233
3325
  useCommitScope: true,
3234
3326
  questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
3235
3327
  types: DEFAULT_COMMIT_TYPES
3236
3328
  };
3237
- var DEFAULT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
3329
+ var DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
3330
+ var DEFAULT_FIXED_RELEASE_TAG_PATTERN = "{releaseGroupName}@{version}";
3331
+ var DEFAULT_COMMIT_MESSAGE = "release(monorepo): Publish v{version} release updates";
3332
+ var DEFAULT_RELEASE_GROUP_GIT_CONFIG = {
3333
+ commit: false,
3334
+ commitMessage: DEFAULT_COMMIT_MESSAGE,
3335
+ commitArgs: "",
3336
+ tag: false,
3337
+ tagMessage: "",
3338
+ tagArgs: "",
3339
+ stageChanges: false,
3340
+ pushArgs: ""
3341
+ };
3342
+ var DEFAULT_VERSION_RELEASE_CONFIG = {
3343
+ currentVersionResolver: "git-tag",
3344
+ fallbackCurrentVersionResolver: "disk",
3345
+ specifierSource: "conventional-commits",
3346
+ groupPreVersionCommand: "pnpm build",
3347
+ preserveLocalDependencyProtocols: true,
3348
+ preserveMatchingDependencyRanges: true,
3349
+ logUnchangedProjects: true,
3350
+ updateDependents: "always",
3351
+ git: {
3352
+ ...DEFAULT_RELEASE_GROUP_GIT_CONFIG,
3353
+ stageChanges: true
3354
+ }
3355
+ };
3356
+ var DEFAULT_CHANGELOG_RELEASE_CONFIG = {
3357
+ createRelease: "github",
3358
+ entryWhenNoChanges: "This was a version bump only for {projectName} to align it with other projects, there were no code changes.",
3359
+ file: false,
3360
+ renderOptions: {
3361
+ authors: false,
3362
+ commitReferences: true,
3363
+ versionTitleDate: true
3364
+ },
3365
+ git: {
3366
+ ...DEFAULT_RELEASE_GROUP_GIT_CONFIG,
3367
+ commit: true,
3368
+ tag: true,
3369
+ push: true
3370
+ }
3371
+ };
3238
3372
  var DEFAULT_RELEASE_GROUP_CONFIG = {
3239
3373
  projectsRelationship: "independent",
3240
3374
  changelog: {
3241
- createRelease: "github",
3242
- entryWhenNoChanges: false,
3243
- file: false,
3244
- renderOptions: {
3245
- authors: false,
3246
- commitReferences: true,
3247
- versionTitleDate: true
3248
- }
3375
+ ...DEFAULT_CHANGELOG_RELEASE_CONFIG
3249
3376
  },
3250
3377
  version: {
3251
- currentVersionResolver: "git-tag",
3252
- fallbackCurrentVersionResolver: "disk",
3253
- specifierSource: "conventional-commits",
3254
- groupPreVersionCommand: "pnpm build"
3378
+ ...DEFAULT_VERSION_RELEASE_CONFIG
3379
+ },
3380
+ releaseTag: {
3381
+ pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN,
3382
+ preferDockerVersion: false
3255
3383
  },
3256
- releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
3384
+ versionPlans: false
3385
+ };
3386
+ var DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG = {
3387
+ projectsRelationship: "independent",
3388
+ releaseTag: {
3389
+ pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN
3390
+ }
3391
+ };
3392
+ var DEFAULT_FIXED_RELEASE_GROUP_CONFIG = {
3393
+ projectsRelationship: "fixed",
3394
+ releaseTag: {
3395
+ pattern: DEFAULT_FIXED_RELEASE_TAG_PATTERN
3396
+ }
3257
3397
  };
3258
3398
  var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
3259
- ...DEFAULT_RELEASE_GROUP_CONFIG,
3260
- projects: ["packages/*"],
3261
3399
  version: {
3262
- ...DEFAULT_RELEASE_GROUP_CONFIG.version,
3263
3400
  versionActions: "@storm-software/workspace-tools/release/js-version-actions",
3264
3401
  versionActionsOptions: {
3265
3402
  currentVersionResolver: "git-tag",
@@ -3275,10 +3412,7 @@ var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
3275
3412
  }
3276
3413
  };
3277
3414
  var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
3278
- ...DEFAULT_RELEASE_GROUP_CONFIG,
3279
- projects: ["crates/*"],
3280
3415
  version: {
3281
- ...DEFAULT_RELEASE_GROUP_CONFIG.version,
3282
3416
  versionActions: "@storm-software/workspace-tools/release/rust-version-actions",
3283
3417
  versionActionsOptions: {
3284
3418
  currentVersionResolver: "git-tag",
@@ -3290,49 +3424,132 @@ var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
3290
3424
  var DEFAULT_RELEASE_CONFIG = {
3291
3425
  conventionalCommits: DEFAULT_CONVENTIONAL_COMMITS_CONFIG2,
3292
3426
  groups: {
3293
- packages: DEFAULT_JS_RELEASE_GROUP_CONFIG,
3294
- crates: DEFAULT_RUST_RELEASE_GROUP_CONFIG
3427
+ packages: chunk4ILBJTRR_cjs.defu(
3428
+ {
3429
+ projects: ["packages/*"]
3430
+ },
3431
+ DEFAULT_JS_RELEASE_GROUP_CONFIG,
3432
+ DEFAULT_RELEASE_GROUP_CONFIG
3433
+ ),
3434
+ crates: chunk4ILBJTRR_cjs.defu(
3435
+ {
3436
+ projects: ["crates/*"]
3437
+ },
3438
+ DEFAULT_RUST_RELEASE_GROUP_CONFIG,
3439
+ DEFAULT_RELEASE_GROUP_CONFIG
3440
+ )
3295
3441
  },
3296
3442
  changelog: {
3443
+ ...DEFAULT_CHANGELOG_RELEASE_CONFIG,
3297
3444
  automaticFromRef: true,
3298
3445
  workspaceChangelog: false,
3299
3446
  projectChangelogs: true
3300
3447
  },
3301
- releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
3448
+ releaseTag: {
3449
+ pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN,
3450
+ preferDockerVersion: false
3451
+ },
3452
+ version: {
3453
+ ...DEFAULT_VERSION_RELEASE_CONFIG
3454
+ }
3302
3455
  };
3303
- function getReleaseGroupConfig(releaseConfig, workspaceConfig) {
3456
+ function mergeReleaseGroupConfig(config5, defaultConfig, workspaceConfig) {
3457
+ return chunk4ILBJTRR_cjs.defu(
3458
+ {
3459
+ ...omit(defaultConfig, ["changelog", "version"]),
3460
+ ...config5
3461
+ },
3462
+ {
3463
+ version: {
3464
+ ...defaultConfig.version
3465
+ }
3466
+ },
3467
+ {
3468
+ changelog: {
3469
+ ...typeof defaultConfig.changelog === "object" ? defaultConfig.changelog : {},
3470
+ renderer: StormChangelogRenderer,
3471
+ renderOptions: {
3472
+ ...typeof defaultConfig.changelog === "object" && defaultConfig.changelog.renderOptions || {},
3473
+ workspaceConfig
3474
+ }
3475
+ }
3476
+ }
3477
+ );
3478
+ }
3479
+ function getReleaseGroupConfig(projectGraph, releaseConfig, workspaceConfig) {
3480
+ const alreadyMatchedProjects = /* @__PURE__ */ new Set();
3304
3481
  return !releaseConfig?.groups || Object.keys(releaseConfig.groups).length === 0 ? {} : Object.fromEntries(
3305
3482
  Object.entries(releaseConfig.groups).map(([name, group]) => {
3306
- const config5 = chunkPTYTYIPG_cjs.defu(
3307
- {
3308
- ...omit(DEFAULT_RELEASE_GROUP_CONFIG, ["changelog", "version"]),
3309
- ...group
3310
- },
3311
- {
3312
- version: {
3313
- ...DEFAULT_RELEASE_GROUP_CONFIG.version
3314
- }
3315
- },
3316
- {
3317
- changelog: {
3318
- ...DEFAULT_RELEASE_GROUP_CONFIG.changelog,
3319
- renderer: StormChangelogRenderer,
3320
- renderOptions: {
3321
- ...DEFAULT_RELEASE_GROUP_CONFIG.changelog.renderOptions,
3322
- workspaceConfig
3323
- }
3324
- }
3483
+ const matchingProjects = findMatchingProjects.findMatchingProjects(
3484
+ typeof group.projects === "string" ? [group.projects] : group.projects,
3485
+ projectGraph.nodes
3486
+ );
3487
+ if (!matchingProjects.length) {
3488
+ throw new Error(
3489
+ `Release group "${name}" does not have any matching projects.`
3490
+ );
3491
+ }
3492
+ for (const project of matchingProjects) {
3493
+ if (alreadyMatchedProjects.has(project)) {
3494
+ throw new Error(
3495
+ `Project "${project}" is included in more than one release group. Please ensure that each project is only included in one release group, or remove the "projects" property from the release group configuration to allow it to be included in the same release group as other projects with overlapping globs.`
3496
+ );
3325
3497
  }
3498
+ alreadyMatchedProjects.add(project);
3499
+ }
3500
+ let languageDefaultConfig = {};
3501
+ if (matchingProjects.every(
3502
+ (project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.js || isEqualProjectTag(
3503
+ projectGraph.nodes[project]?.data,
3504
+ ProjectTagConstants.Language.TAG_ID,
3505
+ ProjectTagConstants.Language.TYPESCRIPT
3506
+ ) || projectGraph.nodes[project]?.data.metadata?.root && fs$1.existsSync(
3507
+ chunk4ILBJTRR_cjs.joinPaths(
3508
+ projectGraph.nodes[project]?.data.metadata?.root,
3509
+ "package.json"
3510
+ )
3511
+ ))
3512
+ )) {
3513
+ languageDefaultConfig = chunk4ILBJTRR_cjs.defu(
3514
+ DEFAULT_JS_RELEASE_GROUP_CONFIG,
3515
+ DEFAULT_RELEASE_GROUP_CONFIG
3516
+ );
3517
+ } else if (matchingProjects.every(
3518
+ (project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.rust || projectGraph.nodes[project]?.data.metadata?.cargo || isEqualProjectTag(
3519
+ projectGraph.nodes[project]?.data,
3520
+ ProjectTagConstants.Language.TAG_ID,
3521
+ ProjectTagConstants.Language.RUST
3522
+ ) || projectGraph.nodes[project]?.data.metadata?.root && fs$1.existsSync(
3523
+ chunk4ILBJTRR_cjs.joinPaths(
3524
+ projectGraph.nodes[project]?.data.metadata?.root,
3525
+ "Cargo.toml"
3526
+ )
3527
+ ))
3528
+ )) {
3529
+ languageDefaultConfig = chunk4ILBJTRR_cjs.defu(
3530
+ DEFAULT_RUST_RELEASE_GROUP_CONFIG,
3531
+ DEFAULT_RELEASE_GROUP_CONFIG
3532
+ );
3533
+ }
3534
+ const config5 = mergeReleaseGroupConfig(
3535
+ group,
3536
+ chunk4ILBJTRR_cjs.defu(
3537
+ languageDefaultConfig,
3538
+ group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
3539
+ DEFAULT_RELEASE_GROUP_CONFIG
3540
+ ),
3541
+ workspaceConfig
3326
3542
  );
3543
+ config5.projects = matchingProjects;
3327
3544
  if (workspaceConfig?.workspaceRoot) {
3328
3545
  if (config5.changelog?.renderer && typeof config5.changelog?.renderer === "string" && config5.changelog?.renderer?.toString().startsWith("./")) {
3329
- config5.changelog.renderer = chunkPTYTYIPG_cjs.joinPaths(
3546
+ config5.changelog.renderer = chunk4ILBJTRR_cjs.joinPaths(
3330
3547
  workspaceConfig.workspaceRoot,
3331
3548
  config5.changelog.renderer
3332
3549
  );
3333
3550
  }
3334
3551
  if (config5.version?.versionActions && config5.version.versionActions.startsWith("./")) {
3335
- config5.version.versionActions = chunkPTYTYIPG_cjs.joinPaths(
3552
+ config5.version.versionActions = chunk4ILBJTRR_cjs.joinPaths(
3336
3553
  workspaceConfig.workspaceRoot,
3337
3554
  config5.version?.versionActions
3338
3555
  );
@@ -3342,31 +3559,725 @@ function getReleaseGroupConfig(releaseConfig, workspaceConfig) {
3342
3559
  })
3343
3560
  );
3344
3561
  }
3562
+ var StormReleaseGroupProcessor = class extends releaseGroupProcessor.ReleaseGroupProcessor {
3563
+ constructor(tree, workspaceConfig, projectGraph, nxReleaseConfig, releaseGraph, versionOptions) {
3564
+ super(tree, projectGraph, nxReleaseConfig, releaseGraph, {
3565
+ dryRun: !!versionOptions.dryRun,
3566
+ verbose: versionOptions.verbose || chunk4ILBJTRR_cjs.isVerbose(workspaceConfig.logLevel),
3567
+ firstRelease: !!versionOptions.firstRelease,
3568
+ preid: versionOptions.preid ?? workspaceConfig.preid ?? "",
3569
+ userGivenSpecifier: versionOptions.specifier,
3570
+ filters: {
3571
+ projects: versionOptions.projects,
3572
+ groups: versionOptions.groups
3573
+ },
3574
+ versionActionsOptionsOverrides: versionOptions.versionActionsOptionsOverrides
3575
+ });
3576
+ this.workspaceConfig = workspaceConfig;
3577
+ this.versionOptions = versionOptions;
3578
+ this.#tree = tree;
3579
+ this.#projectGraph = projectGraph;
3580
+ this.#nxReleaseConfig = nxReleaseConfig;
3581
+ this.#releaseGraph = releaseGraph;
3582
+ }
3583
+ #tree;
3584
+ #projectGraph;
3585
+ #nxReleaseConfig;
3586
+ #releaseGraph;
3587
+ /**
3588
+ * Track any version plan files that have been processed so that we can delete them after versioning is complete,
3589
+ * while leaving any unprocessed files in place.
3590
+ */
3591
+ #processedVersionPlanFiles = /* @__PURE__ */ new Set();
3592
+ /**
3593
+ * Tracks which release groups have already been processed to avoid
3594
+ * processing them multiple times. Used during the group traversal.
3595
+ */
3596
+ #processedGroups = /* @__PURE__ */ new Set();
3597
+ /**
3598
+ * Keeps track of which projects have already had their versions bumped.
3599
+ * This is used to avoid redundant version bumping and to determine which
3600
+ * projects need their dependencies updated.
3601
+ */
3602
+ #bumpedProjects = /* @__PURE__ */ new Set();
3603
+ /**
3604
+ * versionData that will ultimately be returned to the nx release version handler by getVersionData()
3605
+ */
3606
+ #versionData = /* @__PURE__ */ new Map();
3607
+ getReleaseGroupNameForProject(projectName) {
3608
+ const group = this.#releaseGraph.projectToReleaseGroup.get(projectName);
3609
+ return group ? group.name : null;
3610
+ }
3611
+ getNextGroup() {
3612
+ for (const [groupName, groupNode] of this.#releaseGraph.groupGraph) {
3613
+ if (!this.#processedGroups.has(groupName) && Array.from(groupNode.dependencies).every(
3614
+ (dep) => this.#processedGroups.has(dep)
3615
+ )) {
3616
+ return groupName;
3617
+ }
3618
+ }
3619
+ return null;
3620
+ }
3621
+ flushAllProjectLoggers() {
3622
+ for (const projectLogger of this.#releaseGraph.projectLoggers.values()) {
3623
+ projectLogger.flush();
3624
+ }
3625
+ }
3626
+ deleteProcessedVersionPlanFiles() {
3627
+ for (const versionPlanPath of this.#processedVersionPlanFiles) {
3628
+ this.#tree.delete(versionPlanPath);
3629
+ }
3630
+ }
3631
+ getVersionData() {
3632
+ return Object.fromEntries(this.#versionData);
3633
+ }
3634
+ /**
3635
+ * Invoke the afterAllProjectsVersioned functions for each unique versionActions type.
3636
+ * This can be useful for performing actions like updating a workspace level lock file.
3637
+ *
3638
+ * Because the tree has already been flushed to disk at this point, each afterAllProjectsVersioned
3639
+ * function is responsible for returning the list of changed and deleted files that it affected.
3640
+ *
3641
+ * The root level `release.version.versionActionsOptions` is what is passed in here because this
3642
+ * is a one time action for the whole workspace. Release group and project level overrides are
3643
+ * not applicable.
3644
+ */
3645
+ async afterAllProjectsVersioned(rootVersionActionsOptions) {
3646
+ const changedFiles = /* @__PURE__ */ new Set();
3647
+ const deletedFiles = /* @__PURE__ */ new Set();
3648
+ for (const [, afterAllProjectsVersioned] of this.#releaseGraph.uniqueAfterAllProjectsVersioned) {
3649
+ const {
3650
+ changedFiles: changedFilesForVersionActions,
3651
+ deletedFiles: deletedFilesForVersionActions
3652
+ } = await afterAllProjectsVersioned(this.#tree.root, {
3653
+ dryRun: this.versionOptions.dryRun,
3654
+ verbose: this.versionOptions.verbose || chunk4ILBJTRR_cjs.isVerbose(this.workspaceConfig.logLevel),
3655
+ rootVersionActionsOptions
3656
+ });
3657
+ for (const file of changedFilesForVersionActions) {
3658
+ changedFiles.add(file);
3659
+ }
3660
+ for (const file of deletedFilesForVersionActions) {
3661
+ deletedFiles.add(file);
3662
+ }
3663
+ }
3664
+ return {
3665
+ changedFiles: Array.from(changedFiles),
3666
+ deletedFiles: Array.from(deletedFiles)
3667
+ };
3668
+ }
3669
+ async processDockerProjects(dockerVersionScheme, dockerVersion) {
3670
+ const dockerProjects = /* @__PURE__ */ new Map();
3671
+ for (const project of this.#versionData.keys()) {
3672
+ const hasDockerTechnology = Object.values(
3673
+ this.#projectGraph.nodes[project]?.data?.targets ?? []
3674
+ ).some(({ metadata }) => metadata?.technologies?.includes("docker"));
3675
+ if (!hasDockerTechnology) {
3676
+ continue;
3677
+ }
3678
+ const finalConfigForProject = this.#releaseGraph.finalConfigsByProject.get(project);
3679
+ dockerProjects.set(project, finalConfigForProject);
3680
+ }
3681
+ if (dockerProjects.size === 0) {
3682
+ return;
3683
+ }
3684
+ let handleDockerVersion;
3685
+ try {
3686
+ const dockerVersionUtilsPath = "@nx/docker/release/version-utils";
3687
+ const { handleDockerVersion: _handleDockerVersion } = chunk4ILBJTRR_cjs.__require(dockerVersionUtilsPath);
3688
+ handleDockerVersion = _handleDockerVersion;
3689
+ } catch (e) {
3690
+ console.error(
3691
+ "Could not find `@nx/docker`. Please run `nx add @nx/docker` before attempting to release Docker images."
3692
+ );
3693
+ throw e;
3694
+ }
3695
+ for (const [project, finalConfigForProject] of dockerProjects.entries()) {
3696
+ const projectNode = this.#projectGraph.nodes[project];
3697
+ const projectVersionData = this.#versionData.get(project);
3698
+ const { newVersion, logs } = await handleDockerVersion(
3699
+ this.workspaceConfig.workspaceRoot,
3700
+ projectNode,
3701
+ finalConfigForProject,
3702
+ dockerVersionScheme,
3703
+ dockerVersion,
3704
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3705
+ projectVersionData?.newVersion
3706
+ );
3707
+ logs.forEach(
3708
+ (log) => this.#getProjectLoggerForProject(project).buffer(log)
3709
+ );
3710
+ const newVersionData = {
3711
+ ...projectVersionData,
3712
+ dockerVersion: newVersion
3713
+ };
3714
+ this.#versionData.set(project, newVersionData);
3715
+ }
3716
+ this.flushAllProjectLoggers();
3717
+ }
3718
+ async processGroups() {
3719
+ const processOrder = [];
3720
+ for (const nextGroup of this.#releaseGraph.sortedReleaseGroups) {
3721
+ if (this.#processedGroups.has(nextGroup)) {
3722
+ continue;
3723
+ }
3724
+ if (!this.#releaseGraph.groupGraph.has(nextGroup)) {
3725
+ continue;
3726
+ }
3727
+ const allDependenciesProcessed = Array.from(
3728
+ this.#releaseGraph.groupGraph.get(nextGroup).dependencies
3729
+ ).every((dep) => this.#processedGroups.has(dep));
3730
+ if (!allDependenciesProcessed) {
3731
+ for (const dep of this.#releaseGraph.groupGraph.get(nextGroup).dependencies) {
3732
+ if (!this.#processedGroups.has(dep)) {
3733
+ if (!this.#releaseGraph.groupGraph.has(dep)) {
3734
+ continue;
3735
+ }
3736
+ await this.#processGroup(dep);
3737
+ this.#processedGroups.add(dep);
3738
+ processOrder.push(dep);
3739
+ }
3740
+ }
3741
+ }
3742
+ await this.#processGroup(nextGroup);
3743
+ this.#processedGroups.add(nextGroup);
3744
+ processOrder.push(nextGroup);
3745
+ }
3746
+ return processOrder;
3747
+ }
3748
+ async #bumpVersions(releaseGroup) {
3749
+ if (releaseGroup.projectsRelationship === "fixed") {
3750
+ return this.#bumpFixedVersionGroup(releaseGroup);
3751
+ } else {
3752
+ return this.#bumpIndependentVersionGroup(releaseGroup);
3753
+ }
3754
+ }
3755
+ async #processGroup(releaseGroupName) {
3756
+ const groupNode = this.#releaseGraph.groupGraph.get(releaseGroupName);
3757
+ await this.#bumpVersions(groupNode.group);
3758
+ for (const project of groupNode.group.projects) {
3759
+ const projectLogger = this.#releaseGraph.projectLoggers.get(project);
3760
+ if (!projectLogger) {
3761
+ throw new Error(
3762
+ `No project logger found for project ${project} in release group ${releaseGroupName}. This should never happen.`
3763
+ );
3764
+ }
3765
+ projectLogger.flush();
3766
+ }
3767
+ }
3768
+ async #bumpFixedVersionGroup(releaseGroup) {
3769
+ if (releaseGroup.projects.length === 0) {
3770
+ return false;
3771
+ }
3772
+ let bumped = false;
3773
+ const firstProject = releaseGroup.projects.reduce((acc, project) => {
3774
+ const currentVersion = this.#getCurrentCachedVersionForProject(project);
3775
+ if (currentVersion && semver__default.default.gt(currentVersion, acc)) {
3776
+ return currentVersion;
3777
+ }
3778
+ return acc;
3779
+ }, "");
3780
+ const {
3781
+ newVersionInput,
3782
+ newVersionInputReason,
3783
+ newVersionInputReasonData
3784
+ } = await this.#determineVersionBumpForProject(releaseGroup, firstProject);
3785
+ if (newVersionInput === "none") {
3786
+ let bumpedByDependency = false;
3787
+ const sortedProjects2 = this.#releaseGraph.sortedProjects.get(releaseGroup.name) || [];
3788
+ for (const project of sortedProjects2) {
3789
+ const dependencies = this.#projectGraph.dependencies[project] || [];
3790
+ for (const dep of dependencies) {
3791
+ const depGroup = this.getReleaseGroupNameForProject(dep.target);
3792
+ if (depGroup && depGroup !== releaseGroup.name && this.#processedGroups.has(depGroup)) {
3793
+ const depGroupBumpType = await this.#getFixedReleaseGroupBumpType(depGroup);
3794
+ if (depGroupBumpType !== "none") {
3795
+ bumpedByDependency = true;
3796
+ const depBumpType = this.#determineSideEffectBump(
3797
+ releaseGroup,
3798
+ depGroupBumpType
3799
+ );
3800
+ await this.#bumpVersionForProject(
3801
+ project,
3802
+ depBumpType,
3803
+ "DEPENDENCY_ACROSS_GROUPS_WAS_BUMPED",
3804
+ {}
3805
+ );
3806
+ this.#bumpedProjects.add(project);
3807
+ await this.#updateDependenciesForProject(project);
3808
+ }
3809
+ }
3810
+ }
3811
+ }
3812
+ if (bumpedByDependency) {
3813
+ for (const project of sortedProjects2) {
3814
+ if (!this.#bumpedProjects.has(project)) {
3815
+ await this.#bumpVersionForProject(
3816
+ project,
3817
+ this.#applyPreidToBumpType("patch", project),
3818
+ "OTHER_PROJECT_IN_FIXED_GROUP_WAS_BUMPED_DUE_TO_DEPENDENCY",
3819
+ {}
3820
+ );
3821
+ this.#bumpedProjects.add(project);
3822
+ await this.#updateDependenciesForProject(project);
3823
+ }
3824
+ }
3825
+ } else {
3826
+ for (const project of releaseGroup.projects) {
3827
+ this.#versionData.set(project, {
3828
+ currentVersion: this.#getCurrentCachedVersionForProject(
3829
+ project
3830
+ ),
3831
+ newVersion: null,
3832
+ dockerVersion: null,
3833
+ dependentProjects: this.#getOriginalDependentProjects(project)
3834
+ });
3835
+ if (project === firstProject) {
3836
+ continue;
3837
+ }
3838
+ const projectLogger = this.#getProjectLoggerForProject(project);
3839
+ projectLogger.buffer(
3840
+ `\u{1F6AB} Skipping versioning for ${project} as it is a part of a fixed release group with ${firstProject} and no dependency bumps were detected`
3841
+ );
3842
+ }
3843
+ }
3844
+ return bumpedByDependency;
3845
+ }
3846
+ const { newVersion } = await this.#calculateNewVersion(
3847
+ firstProject,
3848
+ newVersionInput,
3849
+ newVersionInputReason,
3850
+ newVersionInputReasonData
3851
+ );
3852
+ const sortedProjects = this.#releaseGraph.sortedProjects.get(releaseGroup.name) || releaseGroup.projects;
3853
+ for (const project of sortedProjects) {
3854
+ const versionActions = this.#getVersionActionsForProject(project);
3855
+ const projectLogger = this.#getProjectLoggerForProject(project);
3856
+ const currentVersion = this.#getCurrentCachedVersionForProject(
3857
+ project
3858
+ );
3859
+ if (project !== firstProject) {
3860
+ projectLogger.buffer(
3861
+ `\u2753 Applied version ${newVersion} directly, because the project is a member of a fixed release group containing ${firstProject}`
3862
+ );
3863
+ }
3864
+ const logMessages = await versionActions.updateProjectVersion(
3865
+ this.#tree,
3866
+ newVersion
3867
+ );
3868
+ for (const logMessage of logMessages) {
3869
+ projectLogger.buffer(logMessage);
3870
+ }
3871
+ this.#bumpedProjects.add(project);
3872
+ bumped = true;
3873
+ this.#versionData.set(project, {
3874
+ currentVersion,
3875
+ newVersion,
3876
+ dependentProjects: this.#getOriginalDependentProjects(project)
3877
+ });
3878
+ }
3879
+ if (bumped) {
3880
+ for (const project of sortedProjects) {
3881
+ await this.#updateDependenciesForProject(project);
3882
+ }
3883
+ }
3884
+ return bumped;
3885
+ }
3886
+ #getOriginalDependentProjects(project) {
3887
+ return this.#releaseGraph.originalDependentProjectsPerProject.get(project) || [];
3888
+ }
3889
+ async #updateDependenciesForProject(projectName) {
3890
+ if (!this.#releaseGraph.allProjectsToProcess.has(projectName)) {
3891
+ throw new Error(
3892
+ `Unable to find ${projectName} in allProjectsToProcess, please report this as a bug on https://github.com/nrwl/nx/issues`
3893
+ );
3894
+ }
3895
+ const versionActions = this.#getVersionActionsForProject(projectName);
3896
+ const cachedFinalConfigForProject = this.#getCachedFinalConfigForProject(projectName);
3897
+ const dependenciesToUpdate = {};
3898
+ const dependencies = this.#projectGraph.dependencies[projectName] || [];
3899
+ for (const dep of dependencies) {
3900
+ if (this.#releaseGraph.allProjectsToProcess.has(dep.target)) {
3901
+ const targetVersionData = this.#versionData.get(dep.target);
3902
+ if (targetVersionData) {
3903
+ const { currentVersion: currentDependencyVersion } = await versionActions.readCurrentVersionOfDependency(
3904
+ this.#tree,
3905
+ this.#projectGraph,
3906
+ dep.target
3907
+ );
3908
+ if (!currentDependencyVersion) {
3909
+ continue;
3910
+ }
3911
+ let finalPrefix = "";
3912
+ if (cachedFinalConfigForProject.versionPrefix === "auto") {
3913
+ const prefixMatch = currentDependencyVersion?.match(/^([~^=])/);
3914
+ finalPrefix = prefixMatch ? prefixMatch[1] : "";
3915
+ } else if (cachedFinalConfigForProject.versionPrefix && ["~", "^", "="].includes(cachedFinalConfigForProject.versionPrefix)) {
3916
+ finalPrefix = cachedFinalConfigForProject.versionPrefix;
3917
+ }
3918
+ const newVersion = targetVersionData.newVersion ?? this.#releaseGraph.cachedCurrentVersions.get(dep.target) ?? currentDependencyVersion;
3919
+ const cleanNewVersion = newVersion.replace(/^[~^=]/, "");
3920
+ dependenciesToUpdate[dep.target] = `${finalPrefix}${cleanNewVersion}`;
3921
+ }
3922
+ }
3923
+ }
3924
+ const projectLogger = this.#getProjectLoggerForProject(projectName);
3925
+ const logMessages = await versionActions.updateProjectDependencies(
3926
+ this.#tree,
3927
+ this.#projectGraph,
3928
+ dependenciesToUpdate
3929
+ );
3930
+ for (const logMessage of logMessages) {
3931
+ projectLogger.buffer(logMessage);
3932
+ }
3933
+ }
3934
+ #getVersionActionsForProject(projectName) {
3935
+ const versionActions = this.#releaseGraph.projectsToVersionActions.get(projectName);
3936
+ if (!versionActions) {
3937
+ throw new Error(
3938
+ `No versionActions found for project ${projectName}, please report this as a bug on https://github.com/nrwl/nx/issues`
3939
+ );
3940
+ }
3941
+ return versionActions;
3942
+ }
3943
+ async #getFixedReleaseGroupBumpType(releaseGroupName) {
3944
+ const releaseGroup = this.#releaseGraph.groupGraph.get(releaseGroupName).group;
3945
+ const releaseGroupFilteredProjects = this.#releaseGraph.releaseGroupToFilteredProjects.get(releaseGroup);
3946
+ if (!releaseGroupFilteredProjects || releaseGroupFilteredProjects.size === 0) {
3947
+ return "none";
3948
+ }
3949
+ const anyProject = releaseGroupFilteredProjects.values().next().value;
3950
+ const { currentVersion, newVersion } = this.#versionData.get(anyProject);
3951
+ if (newVersion) {
3952
+ return semver__default.default.diff(currentVersion, newVersion);
3953
+ }
3954
+ return (await this.#determineVersionBumpForProject(releaseGroup, anyProject)).newVersionInput;
3955
+ }
3956
+ // TODO: Support influencing the side effect bump in a future version, always patch for now like in legacy versioning
3957
+ #determineSideEffectBump(releaseGroup, dependencyBumpType) {
3958
+ const anyProject = releaseGroup.projects[0];
3959
+ return this.#applyPreidToBumpType("patch", anyProject);
3960
+ }
3961
+ /**
3962
+ * When a preid is set (e.g. --preid rc) and the project has opted in via
3963
+ * `applyPreidToDependents`, convert a "patch" side-effect bump into a
3964
+ * "prepatch" so that semver.inc() actually applies the preid.
3965
+ * semver.inc('1.0.0', 'patch', 'rc') ignores preid and returns '1.0.1'.
3966
+ * semver.inc('1.0.0', 'prepatch', 'rc') returns '1.0.1-rc.0' as expected.
3967
+ */
3968
+ #applyPreidToBumpType(bumpType, projectName) {
3969
+ if (!(this.versionOptions.preid && this.workspaceConfig.preid) || bumpType === "none" || bumpType.startsWith("pre")) {
3970
+ return bumpType;
3971
+ }
3972
+ const finalConfig = this.#getCachedFinalConfigForProject(projectName);
3973
+ if (!finalConfig.applyPreidToDependents) {
3974
+ return bumpType;
3975
+ }
3976
+ switch (bumpType) {
3977
+ case "major":
3978
+ return "premajor";
3979
+ case "minor":
3980
+ return "preminor";
3981
+ case "patch":
3982
+ return "prepatch";
3983
+ default:
3984
+ return bumpType;
3985
+ }
3986
+ }
3987
+ #getCachedFinalConfigForProject(projectName) {
3988
+ const cachedFinalConfig = this.#releaseGraph.finalConfigsByProject.get(projectName);
3989
+ if (!cachedFinalConfig) {
3990
+ throw new Error(
3991
+ `Unexpected error: No cached config found for project ${projectName}, please report this as a bug on https://github.com/nrwl/nx/issues`
3992
+ );
3993
+ }
3994
+ return cachedFinalConfig;
3995
+ }
3996
+ async #bumpIndependentVersionGroup(releaseGroup) {
3997
+ const releaseGroupFilteredProjects = this.#releaseGraph.releaseGroupToFilteredProjects.get(releaseGroup);
3998
+ let bumped = false;
3999
+ const projectBumpTypes = /* @__PURE__ */ new Map();
4000
+ const projectsToUpdate = /* @__PURE__ */ new Set();
4001
+ if (releaseGroupFilteredProjects && releaseGroupFilteredProjects.size > 0) {
4002
+ for (const project of releaseGroupFilteredProjects) {
4003
+ const {
4004
+ newVersionInput: bumpType,
4005
+ newVersionInputReason: bumpTypeReason,
4006
+ newVersionInputReasonData: bumpTypeReasonData
4007
+ } = await this.#determineVersionBumpForProject(releaseGroup, project);
4008
+ projectBumpTypes.set(project, {
4009
+ bumpType,
4010
+ bumpTypeReason,
4011
+ bumpTypeReasonData
4012
+ });
4013
+ if (bumpType !== "none") {
4014
+ projectsToUpdate.add(project);
4015
+ }
4016
+ }
4017
+ const sortedProjects = this.#releaseGraph.sortedProjects.get(releaseGroup.name) || [];
4018
+ for (const project of sortedProjects) {
4019
+ if (projectsToUpdate.has(project) && releaseGroupFilteredProjects?.has(project)) {
4020
+ const {
4021
+ bumpType: finalBumpType,
4022
+ bumpTypeReason: finalBumpTypeReason,
4023
+ bumpTypeReasonData: finalBumpTypeReasonData
4024
+ } = projectBumpTypes.get(project);
4025
+ if (finalBumpType !== "none") {
4026
+ await this.#bumpVersionForProject(
4027
+ project,
4028
+ finalBumpType,
4029
+ finalBumpTypeReason,
4030
+ finalBumpTypeReasonData
4031
+ );
4032
+ this.#bumpedProjects.add(project);
4033
+ bumped = true;
4034
+ }
4035
+ }
4036
+ }
4037
+ for (const project of sortedProjects) {
4038
+ if (projectsToUpdate.has(project) && releaseGroupFilteredProjects?.has(project)) {
4039
+ await this.#updateDependenciesForProject(project);
4040
+ }
4041
+ }
4042
+ }
4043
+ return bumped;
4044
+ }
4045
+ #getCurrentCachedVersionForProject(projectName) {
4046
+ return this.#releaseGraph.cachedCurrentVersions.get(projectName) || null;
4047
+ }
4048
+ async #calculateNewVersion(project, newVersionInput, newVersionInputReason, newVersionInputReasonData) {
4049
+ const currentVersion = this.#getCurrentCachedVersionForProject(project);
4050
+ const versionActions = this.#getVersionActionsForProject(project);
4051
+ const { newVersion, logText } = await versionActions.calculateNewVersion(
4052
+ currentVersion,
4053
+ newVersionInput,
4054
+ newVersionInputReason,
4055
+ newVersionInputReasonData,
4056
+ this.versionOptions.preid || this.workspaceConfig.preid || ""
4057
+ );
4058
+ const projectLogger = this.#getProjectLoggerForProject(project);
4059
+ projectLogger.buffer(logText);
4060
+ return { currentVersion, newVersion };
4061
+ }
4062
+ async #bumpVersionForProject(projectName, bumpType, bumpTypeReason, bumpTypeReasonData) {
4063
+ const projectLogger = this.#getProjectLoggerForProject(projectName);
4064
+ if (bumpType === "none") {
4065
+ projectLogger.buffer(
4066
+ `\u23E9 Skipping bump for ${projectName} as bump type is "none"`
4067
+ );
4068
+ return;
4069
+ }
4070
+ const versionActions = this.#getVersionActionsForProject(projectName);
4071
+ const { currentVersion, newVersion } = await this.#calculateNewVersion(
4072
+ projectName,
4073
+ bumpType,
4074
+ bumpTypeReason,
4075
+ bumpTypeReasonData
4076
+ );
4077
+ const logMessages = await versionActions.updateProjectVersion(
4078
+ this.#tree,
4079
+ newVersion
4080
+ );
4081
+ for (const logMessage of logMessages) {
4082
+ projectLogger.buffer(logMessage);
4083
+ }
4084
+ this.#versionData.set(projectName, {
4085
+ currentVersion,
4086
+ newVersion,
4087
+ dependentProjects: this.#getOriginalDependentProjects(projectName)
4088
+ });
4089
+ this.#bumpedProjects.add(projectName);
4090
+ const releaseGroupName = this.getReleaseGroupNameForProject(projectName);
4091
+ if (!releaseGroupName) {
4092
+ projectLogger.buffer(
4093
+ `\u26A0\uFE0F Cannot find release group for ${projectName}, skipping dependent updates`
4094
+ );
4095
+ return;
4096
+ }
4097
+ const releaseGroup = this.#releaseGraph.groupGraph.get(releaseGroupName).group;
4098
+ const releaseGroupVersionConfig = releaseGroup.version;
4099
+ const updateDependents = releaseGroupVersionConfig?.updateDependents || "always";
4100
+ if (updateDependents === "auto" || updateDependents === "always") {
4101
+ const dependents = this.#getNonImplicitDependentsForProject(projectName);
4102
+ const dependentsToProcess = dependents.filter(
4103
+ (dep) => this.#releaseGraph.allProjectsToProcess.has(dep)
4104
+ );
4105
+ await this.#updateDependenciesForDependents(dependentsToProcess);
4106
+ for (const dependent of dependentsToProcess) {
4107
+ if (!this.#bumpedProjects.has(dependent)) {
4108
+ await this.#bumpVersionForProject(
4109
+ dependent,
4110
+ this.#applyPreidToBumpType("patch", dependent),
4111
+ "DEPENDENCY_WAS_BUMPED",
4112
+ {}
4113
+ );
4114
+ }
4115
+ }
4116
+ } else {
4117
+ const releaseGroupText = releaseGroupName !== config_js.IMPLICIT_DEFAULT_RELEASE_GROUP ? ` in release group "${releaseGroupName}" ` : " ";
4118
+ projectLogger.buffer(
4119
+ `\u23E9 Skipping dependent updates as "updateDependents"${releaseGroupText}is not "auto"`
4120
+ );
4121
+ }
4122
+ }
4123
+ #getProjectDependents(project) {
4124
+ return this.#releaseGraph.projectToDependents.get(project) || /* @__PURE__ */ new Set();
4125
+ }
4126
+ #getNonImplicitDependentsForProject(project) {
4127
+ return Array.from(this.#getProjectDependents(project));
4128
+ }
4129
+ async #updateDependenciesForDependents(dependents) {
4130
+ for (const dependent of dependents) {
4131
+ if (!this.#releaseGraph?.allProjectsToProcess.has(dependent)) {
4132
+ throw new Error(
4133
+ `Unable to find project "${dependent}" in allProjectsToProcess, please report this as a bug on https://github.com/nrwl/nx/issues`
4134
+ );
4135
+ }
4136
+ await this.#updateDependenciesForProject(dependent);
4137
+ }
4138
+ }
4139
+ async #determineVersionBumpForProject(releaseGroup, projectName) {
4140
+ if (this.versionOptions.specifier) {
4141
+ return {
4142
+ newVersionInput: this.versionOptions.specifier,
4143
+ newVersionInputReason: "USER_SPECIFIER",
4144
+ newVersionInputReasonData: {}
4145
+ };
4146
+ }
4147
+ const projectGraphNode = this.#projectGraph.nodes[projectName];
4148
+ const projectLogger = this.#getProjectLoggerForProject(projectName);
4149
+ const cachedFinalConfigForProject = this.#getCachedFinalConfigForProject(projectName);
4150
+ if (cachedFinalConfigForProject.specifierSource === "conventional-commits") {
4151
+ const currentVersion = this.#getCurrentCachedVersionForProject(projectName);
4152
+ const bumpType = await deriveSpecifierFromConventionalCommits.deriveSpecifierFromConventionalCommits(
4153
+ {
4154
+ ...this.#nxReleaseConfig,
4155
+ git: this.#nxReleaseConfig.git ?? {}
4156
+ },
4157
+ this.#projectGraph,
4158
+ projectLogger,
4159
+ releaseGroup,
4160
+ projectGraphNode,
4161
+ !!semver__default.default.prerelease(currentVersion ?? ""),
4162
+ this.#releaseGraph.cachedLatestMatchingGitTag.get(projectName),
4163
+ this.#releaseGraph,
4164
+ cachedFinalConfigForProject.fallbackCurrentVersionResolver,
4165
+ this.versionOptions.preid || this.workspaceConfig.preid || ""
4166
+ );
4167
+ return {
4168
+ newVersionInput: bumpType,
4169
+ newVersionInputReason: "CONVENTIONAL_COMMITS",
4170
+ newVersionInputReasonData: {}
4171
+ };
4172
+ }
4173
+ if (releaseGroup.versionPlans) {
4174
+ const currentVersion = this.#getCurrentCachedVersionForProject(projectName);
4175
+ const { bumpType, versionPlanPath } = await deriverSpecifierFromVersionPlans.deriveSpecifierFromVersionPlan(
4176
+ projectLogger,
4177
+ releaseGroup,
4178
+ projectGraphNode,
4179
+ currentVersion
4180
+ );
4181
+ if (bumpType !== "none") {
4182
+ this.#processedVersionPlanFiles.add(versionPlanPath);
4183
+ }
4184
+ return {
4185
+ newVersionInput: bumpType,
4186
+ newVersionInputReason: "VERSION_PLANS",
4187
+ newVersionInputReasonData: {
4188
+ versionPlanPath
4189
+ }
4190
+ };
4191
+ }
4192
+ const versionActions = this.#getVersionActionsForProject(projectName);
4193
+ if (versionActions instanceof versionActions_js.NOOP_VERSION_ACTIONS) {
4194
+ return {
4195
+ newVersionInput: "none",
4196
+ newVersionInputReason: "NOOP_VERSION_ACTIONS",
4197
+ newVersionInputReasonData: {}
4198
+ };
4199
+ }
4200
+ throw new Error(
4201
+ `Unhandled version bump config, please report this as a bug on https://github.com/nrwl/nx/issues`
4202
+ );
4203
+ }
4204
+ #getProjectLoggerForProject(projectName) {
4205
+ const projectLogger = this.#releaseGraph.projectLoggers.get(projectName);
4206
+ if (!projectLogger) {
4207
+ throw new Error(
4208
+ `No project logger found for project ${projectName}, please report this as a bug on https://github.com/nrwl/nx/issues`
4209
+ );
4210
+ }
4211
+ return projectLogger;
4212
+ }
4213
+ };
3345
4214
 
3346
4215
  // src/release/release-client.ts
3347
4216
  var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient {
3348
4217
  static async create(releaseConfig = {}, ignoreNxJsonConfig = false, workspaceConfig) {
3349
4218
  if (!workspaceConfig) {
3350
- workspaceConfig = await chunkPTYTYIPG_cjs.getWorkspaceConfig();
3351
- }
3352
- let projectGraph;
3353
- try {
3354
- projectGraph = devkit.readCachedProjectGraph();
3355
- } catch {
3356
- projectGraph = await devkit.createProjectGraphAsync({
3357
- exitOnError: true,
3358
- resetDaemonClient: true
3359
- });
4219
+ workspaceConfig = await chunk4ILBJTRR_cjs.getWorkspaceConfig();
3360
4220
  }
4221
+ const projectGraph = await devkit.createProjectGraphAsync({
4222
+ exitOnError: true,
4223
+ resetDaemonClient: true
4224
+ });
3361
4225
  if (!projectGraph) {
3362
4226
  throw new Error(
3363
4227
  "Failed to load the project graph. Please run `nx reset`, then run the `storm-git commit` command again."
3364
4228
  );
3365
4229
  }
4230
+ let nxJson$1;
4231
+ if (!ignoreNxJsonConfig && fs$1.existsSync(chunk4ILBJTRR_cjs.joinPaths(workspaceConfig.workspaceRoot, "nx.json"))) {
4232
+ nxJson$1 = nxJson.readNxJson();
4233
+ }
4234
+ const config5 = chunk4ILBJTRR_cjs.defu(
4235
+ {
4236
+ changelog: {
4237
+ renderOptions: {
4238
+ workspaceConfig
4239
+ }
4240
+ }
4241
+ },
4242
+ {
4243
+ groups: getReleaseGroupConfig(
4244
+ projectGraph,
4245
+ releaseConfig,
4246
+ workspaceConfig
4247
+ )
4248
+ },
4249
+ {
4250
+ groups: getReleaseGroupConfig(
4251
+ projectGraph,
4252
+ nxJson$1.release ?? {},
4253
+ workspaceConfig
4254
+ )
4255
+ },
4256
+ omit(releaseConfig, ["groups"]),
4257
+ nxJson$1.release ? omit(nxJson$1.release, ["groups"]) : {},
4258
+ omit(DEFAULT_RELEASE_CONFIG, ["groups"])
4259
+ );
4260
+ const normalizedConfig = clone__default.default(config5);
4261
+ if (workspaceConfig.preid) {
4262
+ normalizedConfig.groups = Object.fromEntries(
4263
+ Object.entries(normalizedConfig.groups ?? {}).map(([name, group]) => {
4264
+ return [
4265
+ name,
4266
+ {
4267
+ ...group,
4268
+ version: {
4269
+ ...group.version,
4270
+ preid: workspaceConfig.preid
4271
+ }
4272
+ }
4273
+ ];
4274
+ })
4275
+ );
4276
+ }
3366
4277
  return new _StormReleaseClient(
3367
4278
  projectGraph,
3368
- releaseConfig,
3369
- ignoreNxJsonConfig,
4279
+ config5,
4280
+ normalizedConfig,
3370
4281
  workspaceConfig
3371
4282
  );
3372
4283
  }
@@ -3374,6 +4285,10 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3374
4285
  * The release configuration used by this release client.
3375
4286
  */
3376
4287
  config;
4288
+ /**
4289
+ * The normalized release configuration used by this release client.
4290
+ */
4291
+ normalizedConfig;
3377
4292
  /**
3378
4293
  * The workspace configuration used by this release client.
3379
4294
  */
@@ -3398,40 +4313,16 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3398
4313
  * @param ignoreNxJsonConfig - Whether to ignore the nx.json configuration and use only the provided {@link releaseConfig}. Default is false.
3399
4314
  * @param workspaceConfig - Optional Storm workspace configuration object for logging purposes.
3400
4315
  */
3401
- constructor(projectGraph, releaseConfig, ignoreNxJsonConfig, workspaceConfig) {
3402
- let nxJson$1;
3403
- if (!ignoreNxJsonConfig && fs$1.existsSync(chunkPTYTYIPG_cjs.joinPaths(workspaceConfig.workspaceRoot, "nx.json"))) {
3404
- nxJson$1 = nxJson.readNxJson();
3405
- }
3406
- const config5 = chunkPTYTYIPG_cjs.defu(
3407
- {
3408
- changelog: {
3409
- renderOptions: {
3410
- workspaceConfig
3411
- }
3412
- }
3413
- },
3414
- {
3415
- groups: getReleaseGroupConfig(releaseConfig, workspaceConfig)
3416
- },
3417
- {
3418
- groups: getReleaseGroupConfig(
3419
- nxJson$1.release ?? {},
3420
- workspaceConfig
3421
- )
3422
- },
3423
- omit(releaseConfig, ["groups"]),
3424
- nxJson$1.release ? omit(nxJson$1.release, ["groups"]) : {},
3425
- omit(DEFAULT_RELEASE_CONFIG, ["groups"])
3426
- );
3427
- super(config5, true);
3428
- chunkPTYTYIPG_cjs.writeDebug(
4316
+ constructor(projectGraph, config5, normalizedConfig, workspaceConfig) {
4317
+ super(normalizedConfig, true);
4318
+ chunk4ILBJTRR_cjs.writeDebug(
3429
4319
  "Executing release with the following configuration",
3430
4320
  workspaceConfig
3431
4321
  );
3432
- chunkPTYTYIPG_cjs.writeDebug(config5, workspaceConfig);
4322
+ chunk4ILBJTRR_cjs.writeDebug(normalizedConfig, workspaceConfig);
3433
4323
  this.projectGraph = projectGraph;
3434
4324
  this.config = config5;
4325
+ this.normalizedConfig = normalizedConfig;
3435
4326
  this.workspaceConfig = workspaceConfig;
3436
4327
  this.tree = new tree.FsTree(workspaceConfig.workspaceRoot, false);
3437
4328
  this.projectConfigurations = devkit.readProjectsConfigurationFromProjectGraph(projectGraph);
@@ -3447,8 +4338,19 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3447
4338
  v.newVersion ? extractPreid(v.newVersion) : void 0
3448
4339
  ])
3449
4340
  );
4341
+ const releaseGraph$1 = options.releaseGraph ?? await releaseGraph.createReleaseGraph({
4342
+ tree: this.tree,
4343
+ projectGraph: this.projectGraph,
4344
+ nxReleaseConfig: this.normalizedConfig,
4345
+ filters: {
4346
+ projects: options.projects,
4347
+ groups: options.groups
4348
+ },
4349
+ firstRelease: !!options.firstRelease,
4350
+ verbose: chunk4ILBJTRR_cjs.isVerbose(this.workspaceConfig.logLevel)
4351
+ });
3450
4352
  const projectToAdditionalDependencyBumps = /* @__PURE__ */ new Map();
3451
- for (const releaseGroup of options.releaseGraph.releaseGroups) {
4353
+ for (const releaseGroup of releaseGraph$1.releaseGroups) {
3452
4354
  if (releaseGroup.projectsRelationship !== "independent") {
3453
4355
  continue;
3454
4356
  }
@@ -3476,12 +4378,12 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3476
4378
  }
3477
4379
  }
3478
4380
  const allProjectChangelogs = {};
3479
- for (const releaseGroup of options.releaseGraph.releaseGroups) {
4381
+ for (const releaseGroup of releaseGraph$1.releaseGroups) {
3480
4382
  const config5 = releaseGroup.changelog;
3481
4383
  if (config5 === false) {
3482
4384
  continue;
3483
4385
  }
3484
- if (!options.releaseGraph.releaseGroupToFilteredProjects.has(releaseGroup)) {
4386
+ if (!releaseGraph$1.releaseGroupToFilteredProjects.has(releaseGroup)) {
3485
4387
  throw new Error(
3486
4388
  `No filtered projects found for release group ${releaseGroup.name}`
3487
4389
  );
@@ -3490,9 +4392,7 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3490
4392
  // 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
3491
4393
  Array.from(
3492
4394
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3493
- options.releaseGraph.releaseGroupToFilteredProjects.get(
3494
- releaseGroup
3495
- )
4395
+ releaseGraph$1.releaseGroupToFilteredProjects.get(releaseGroup)
3496
4396
  ).flatMap((project) => {
3497
4397
  return [
3498
4398
  project,
@@ -3515,9 +4415,10 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3515
4415
  projectName: project.name,
3516
4416
  releaseGroupName: releaseGroup.name
3517
4417
  },
4418
+ releaseGraph$1.resolveRepositoryTags.bind(releaseGraph$1),
3518
4419
  {
3519
4420
  checkAllBranchesWhen: releaseGroup.releaseTag.checkAllBranchesWhen,
3520
- preid: projectsPreid[project.name],
4421
+ preid: projectsPreid[project.name] || this.workspaceConfig.preid,
3521
4422
  requireSemver: releaseGroup.releaseTag.requireSemver,
3522
4423
  strictPreid: releaseGroup.releaseTag.strictPreid
3523
4424
  }
@@ -3571,9 +4472,9 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3571
4472
  fileMap.nonProjectFiles
3572
4473
  ) ? "*" : getProjectsAffectedByCommit(c, fileToProjectMap)
3573
4474
  })),
3574
- this.config.conventionalCommits
4475
+ this.normalizedConfig.conventionalCommits
3575
4476
  );
3576
- chunkPTYTYIPG_cjs.writeDebug(
4477
+ chunk4ILBJTRR_cjs.writeDebug(
3577
4478
  `Running changelog generation for the ${releaseGroup.name} release group`,
3578
4479
  this.workspaceConfig
3579
4480
  );
@@ -3605,12 +4506,15 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3605
4506
  let changes = [];
3606
4507
  let fromRef = options.from || (await git.getLatestGitTagForPattern(
3607
4508
  releaseGroup.releaseTag.pattern,
3608
- {},
4509
+ {
4510
+ releaseGroupName: releaseGroup.name
4511
+ },
4512
+ releaseGraph$1.resolveRepositoryTags.bind(releaseGraph$1),
3609
4513
  {
3610
4514
  checkAllBranchesWhen: releaseGroup.releaseTag.checkAllBranchesWhen,
3611
- preid: Object.keys(projectsPreid)[0] ? projectsPreid?.[Object.keys(projectsPreid)[0]] : void 0,
4515
+ preid: Object.keys(projectsPreid)[0] && projectsPreid?.[Object.keys(projectsPreid)[0]] ? projectsPreid?.[Object.keys(projectsPreid)[0]] : this.workspaceConfig.preid,
3612
4516
  requireSemver: releaseGroup.releaseTag.requireSemver,
3613
- strictPreid: releaseGroup.releaseTag.strictPreid
4517
+ strictPreid: releaseGroup.releaseTag.strictPreid || this.workspaceConfig.preid !== void 0
3614
4518
  }
3615
4519
  ))?.tag;
3616
4520
  if (!fromRef) {
@@ -3642,9 +4546,9 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3642
4546
  fileMap.nonProjectFiles
3643
4547
  ) ? "*" : getProjectsAffectedByCommit(c, fileToProjectMap)
3644
4548
  })),
3645
- this.config.conventionalCommits
4549
+ this.normalizedConfig.conventionalCommits
3646
4550
  );
3647
- chunkPTYTYIPG_cjs.writeDebug(
4551
+ chunk4ILBJTRR_cjs.writeDebug(
3648
4552
  `Running changelog generation for the ${releaseGroup.name} release group`,
3649
4553
  this.workspaceConfig
3650
4554
  );
@@ -3673,7 +4577,7 @@ var StormReleaseClient = class _StormReleaseClient extends release.ReleaseClient
3673
4577
  }
3674
4578
  }
3675
4579
  }
3676
- chunkPTYTYIPG_cjs.writeDebug(
4580
+ chunk4ILBJTRR_cjs.writeDebug(
3677
4581
  `Generated changelogs for ${Object.keys(allProjectChangelogs).length} projects:
3678
4582
  ${Object.keys(allProjectChangelogs).map((p) => ` - ${p}`).join("\n")}
3679
4583
  `,
@@ -3698,11 +4602,11 @@ ${Object.keys(allProjectChangelogs).map((p) => ` - ${p}`).join("\n")}
3698
4602
  options.releaseGraph.releaseGroups,
3699
4603
  options.releaseGraph.releaseGroupToFilteredProjects,
3700
4604
  options.versionData,
3701
- options.gitCommitMessage || this.config.changelog?.git?.commitMessage || "release(monorepo): Publish workspace release updates"
4605
+ options.gitCommitMessage || this.normalizedConfig.changelog?.git?.commitMessage || DEFAULT_COMMIT_MESSAGE
3702
4606
  );
3703
4607
  const changes = this.tree.listChanges();
3704
4608
  if (!changes.length) {
3705
- chunkPTYTYIPG_cjs.writeWarning(
4609
+ chunk4ILBJTRR_cjs.writeWarning(
3706
4610
  "No changes were detected for any changelog files, so no changelog entries will be generated.",
3707
4611
  this.workspaceConfig
3708
4612
  );
@@ -3721,23 +4625,23 @@ ${Object.keys(allProjectChangelogs).map((p) => ` - ${p}`).join("\n")}
3721
4625
  isDryRun: !!options.dryRun,
3722
4626
  isVerbose: !!options.verbose,
3723
4627
  gitCommitMessages: commitMessageValues,
3724
- gitCommitArgs: options.gitCommitArgs || this.config.changelog?.git?.commitArgs
4628
+ gitCommitArgs: options.gitCommitArgs || this.normalizedConfig.changelog?.git?.commitArgs
3725
4629
  });
3726
4630
  latestCommit = await git.getCommitHash("HEAD");
3727
- chunkPTYTYIPG_cjs.writeDebug(
4631
+ chunk4ILBJTRR_cjs.writeDebug(
3728
4632
  `Creating git tags: ${gitTagValues.join(", ")}`,
3729
4633
  this.workspaceConfig
3730
4634
  );
3731
4635
  for (const tag of gitTagValues) {
3732
4636
  await gitTag({
3733
4637
  tag,
3734
- message: options.gitTagMessage || this.config.changelog?.git?.tagMessage,
3735
- additionalArgs: options.gitTagArgs || this.config.changelog?.git?.tagArgs,
4638
+ message: options.gitTagMessage || this.normalizedConfig.changelog?.git?.tagMessage,
4639
+ additionalArgs: options.gitTagArgs || this.normalizedConfig.changelog?.git?.tagArgs,
3736
4640
  dryRun: options.dryRun,
3737
4641
  verbose: options.verbose
3738
4642
  });
3739
4643
  }
3740
- chunkPTYTYIPG_cjs.writeDebug(
4644
+ chunk4ILBJTRR_cjs.writeDebug(
3741
4645
  `Pushing to git remote "${options.gitRemote ?? "origin"}"`,
3742
4646
  this.workspaceConfig
3743
4647
  );
@@ -3745,13 +4649,323 @@ ${Object.keys(allProjectChangelogs).map((p) => ` - ${p}`).join("\n")}
3745
4649
  gitRemote: options.gitRemote,
3746
4650
  dryRun: options.dryRun,
3747
4651
  verbose: options.verbose,
3748
- additionalArgs: options.gitPushArgs || this.config.changelog?.git?.pushArgs
4652
+ additionalArgs: options.gitPushArgs || this.normalizedConfig.changelog?.git?.pushArgs
3749
4653
  });
3750
4654
  for (const postGitTask of postGitTasks) {
3751
4655
  await postGitTask(latestCommit);
3752
4656
  }
3753
4657
  return;
3754
4658
  };
4659
+ releaseVersion = async (options) => {
4660
+ const verbose = options.verbose || chunk4ILBJTRR_cjs.isVerbose(this.workspaceConfig.logLevel);
4661
+ this.projectGraph = await devkit.createProjectGraphAsync({
4662
+ exitOnError: true,
4663
+ resetDaemonClient: true
4664
+ });
4665
+ if (!this.projectGraph) {
4666
+ throw new Error(
4667
+ "Failed to load the project graph. Please run `nx reset`, then run the `storm-git commit` command again."
4668
+ );
4669
+ }
4670
+ const releaseGraph$1 = options.releaseGraph ?? await releaseGraph.createReleaseGraph({
4671
+ tree: this.tree,
4672
+ projectGraph: this.projectGraph,
4673
+ nxReleaseConfig: this.normalizedConfig,
4674
+ filters: {
4675
+ projects: options.projects,
4676
+ groups: options.groups
4677
+ },
4678
+ firstRelease: !!options.firstRelease,
4679
+ verbose,
4680
+ preid: options.preid ?? this.workspaceConfig.preid,
4681
+ versionActionsOptionsOverrides: options.versionActionsOptionsOverrides
4682
+ });
4683
+ if (releaseGraph$1.filterLog && process.env.NX_RELEASE_INTERNAL_SUPPRESS_FILTER_LOG !== "true") {
4684
+ chunk4ILBJTRR_cjs.writeDebug(formatNxLog(releaseGraph$1.filterLog), this.workspaceConfig);
4685
+ }
4686
+ if (!options.specifier) {
4687
+ const rawVersionPlans = await versionPlans.readRawVersionPlans();
4688
+ await versionPlans.setResolvedVersionPlansOnGroups(
4689
+ rawVersionPlans,
4690
+ releaseGraph$1.releaseGroups,
4691
+ Object.keys(this.projectGraph.nodes),
4692
+ verbose
4693
+ );
4694
+ const versionPlanValidationError = versionPlanUtils.validateResolvedVersionPlansAgainstFilter(
4695
+ releaseGraph$1.releaseGroups,
4696
+ releaseGraph$1.releaseGroupToFilteredProjects
4697
+ );
4698
+ if (versionPlanValidationError) {
4699
+ throw new Error(formatNxLog(versionPlanValidationError));
4700
+ }
4701
+ } else {
4702
+ if (verbose && releaseGraph$1.releaseGroups.some((g) => !!g.versionPlans)) {
4703
+ chunk4ILBJTRR_cjs.writeDebug(
4704
+ `Skipping version plan discovery as a specifier was provided`,
4705
+ this.workspaceConfig
4706
+ );
4707
+ }
4708
+ }
4709
+ if (options.deleteVersionPlans === void 0) {
4710
+ options.deleteVersionPlans = false;
4711
+ }
4712
+ if (this.normalizedConfig.version?.preVersionCommand) {
4713
+ chunk4ILBJTRR_cjs.writeDebug(
4714
+ "Executing the following pre-version command: \n" + this.normalizedConfig.version.preVersionCommand,
4715
+ this.workspaceConfig
4716
+ );
4717
+ try {
4718
+ const childProcess2 = chunkMTAYUS7E_cjs.runAsync(
4719
+ this.workspaceConfig,
4720
+ this.normalizedConfig.version.preVersionCommand,
4721
+ this.workspaceConfig.workspaceRoot,
4722
+ {
4723
+ ...process.env,
4724
+ NX_DRY_RUN: options.dryRun ? "true" : "false"
4725
+ }
4726
+ );
4727
+ if (options.verbose) {
4728
+ childProcess2.stdout?.pipe(process.stdout);
4729
+ childProcess2.stderr?.pipe(process.stderr);
4730
+ }
4731
+ await childProcess2;
4732
+ } catch (e) {
4733
+ throw new Error(
4734
+ formatNxLog({
4735
+ title: `The pre-version command failed. See the full output above.`,
4736
+ bodyLines: [this.normalizedConfig.version.preVersionCommand, e]
4737
+ })
4738
+ );
4739
+ }
4740
+ }
4741
+ for (const groupName of releaseGraph$1.sortedReleaseGroups) {
4742
+ const releaseGroup = releaseGraph$1.releaseGroups.find(
4743
+ (g) => g.name === groupName
4744
+ );
4745
+ if (!releaseGroup) {
4746
+ continue;
4747
+ }
4748
+ if (releaseGroup.version?.groupPreVersionCommand) {
4749
+ chunk4ILBJTRR_cjs.writeDebug(
4750
+ `Executing the ${releaseGroup.name} release group's pre-version command:
4751
+ ` + releaseGroup.version?.groupPreVersionCommand,
4752
+ this.workspaceConfig
4753
+ );
4754
+ try {
4755
+ const childProcess2 = chunkMTAYUS7E_cjs.runAsync(
4756
+ this.workspaceConfig,
4757
+ releaseGroup.version?.groupPreVersionCommand,
4758
+ this.workspaceConfig.workspaceRoot,
4759
+ {
4760
+ ...process.env,
4761
+ NX_DRY_RUN: options.dryRun ? "true" : "false"
4762
+ }
4763
+ );
4764
+ if (options.verbose) {
4765
+ childProcess2.stdout?.pipe(process.stdout);
4766
+ childProcess2.stderr?.pipe(process.stderr);
4767
+ }
4768
+ await childProcess2;
4769
+ } catch (e) {
4770
+ throw new Error(
4771
+ formatNxLog({
4772
+ title: `The ${releaseGroup.name} release group's pre-version command failed. See the full output above.`,
4773
+ bodyLines: [releaseGroup.version?.groupPreVersionCommand, e]
4774
+ })
4775
+ );
4776
+ }
4777
+ }
4778
+ }
4779
+ await releaseGraph$1.validate(this.tree);
4780
+ const commitMessage = options.gitCommitMessage || this.normalizedConfig.version?.git?.commitMessage;
4781
+ const additionalChangedFiles = /* @__PURE__ */ new Set();
4782
+ const additionalDeletedFiles = /* @__PURE__ */ new Set();
4783
+ const processor = new StormReleaseGroupProcessor(
4784
+ this.tree,
4785
+ this.workspaceConfig,
4786
+ this.projectGraph,
4787
+ this.normalizedConfig,
4788
+ releaseGraph$1,
4789
+ options
4790
+ );
4791
+ try {
4792
+ await processor.processGroups();
4793
+ if (options.deleteVersionPlans) {
4794
+ processor.deleteProcessedVersionPlanFiles();
4795
+ }
4796
+ } catch (err) {
4797
+ processor.flushAllProjectLoggers();
4798
+ throw err;
4799
+ }
4800
+ await formatChangedFiles(this.tree);
4801
+ printChanges_js.printAndFlushChanges(this.tree, !!options.dryRun);
4802
+ const { changedFiles: changed, deletedFiles: deleted } = await processor.afterAllProjectsVersioned({
4803
+ ...this.normalizedConfig.version.versionActionsOptions,
4804
+ ...options.versionActionsOptionsOverrides ?? {}
4805
+ });
4806
+ changed.forEach((f) => additionalChangedFiles.add(f));
4807
+ deleted.forEach((f) => additionalDeletedFiles.add(f));
4808
+ if (this.normalizedConfig.docker && typeof this.normalizedConfig.docker === "object" && this.normalizedConfig.docker?.preVersionCommand) {
4809
+ chunk4ILBJTRR_cjs.writeDebug(
4810
+ `Executing the docker pre-version command:
4811
+ ` + this.normalizedConfig.docker.preVersionCommand,
4812
+ this.workspaceConfig
4813
+ );
4814
+ try {
4815
+ const childProcess2 = chunkMTAYUS7E_cjs.runAsync(
4816
+ this.workspaceConfig,
4817
+ this.normalizedConfig.docker.preVersionCommand,
4818
+ this.workspaceConfig.workspaceRoot,
4819
+ {
4820
+ ...process.env,
4821
+ NX_DRY_RUN: options.dryRun ? "true" : "false"
4822
+ }
4823
+ );
4824
+ if (options.verbose) {
4825
+ childProcess2.stdout?.pipe(process.stdout);
4826
+ childProcess2.stderr?.pipe(process.stderr);
4827
+ }
4828
+ await childProcess2;
4829
+ } catch (e) {
4830
+ throw new Error(
4831
+ formatNxLog({
4832
+ title: `The docker pre-version command failed. See the full output above.`,
4833
+ bodyLines: [this.normalizedConfig.docker.preVersionCommand, e]
4834
+ })
4835
+ );
4836
+ }
4837
+ }
4838
+ for (const groupName of releaseGraph$1.sortedReleaseGroups) {
4839
+ const releaseGroup = releaseGraph$1.releaseGroups.find(
4840
+ (g) => g.name === groupName
4841
+ );
4842
+ if (!releaseGroup) {
4843
+ continue;
4844
+ }
4845
+ if (releaseGroup.docker?.groupPreVersionCommand) {
4846
+ chunk4ILBJTRR_cjs.writeDebug(
4847
+ `Executing the ${releaseGroup.name} release group's docker pre-version command:
4848
+ ` + releaseGroup.docker?.groupPreVersionCommand,
4849
+ this.workspaceConfig
4850
+ );
4851
+ try {
4852
+ const childProcess2 = chunkMTAYUS7E_cjs.runAsync(
4853
+ this.workspaceConfig,
4854
+ releaseGroup.docker?.groupPreVersionCommand,
4855
+ this.workspaceConfig.workspaceRoot,
4856
+ {
4857
+ ...process.env,
4858
+ NX_DRY_RUN: options.dryRun ? "true" : "false"
4859
+ }
4860
+ );
4861
+ if (options.verbose) {
4862
+ childProcess2.stdout?.pipe(process.stdout);
4863
+ childProcess2.stderr?.pipe(process.stderr);
4864
+ }
4865
+ await childProcess2;
4866
+ } catch (e) {
4867
+ throw new Error(
4868
+ formatNxLog({
4869
+ title: `The ${releaseGroup.name} release group's docker pre-version command failed. See the full output above.`,
4870
+ bodyLines: [releaseGroup.docker?.groupPreVersionCommand, e]
4871
+ })
4872
+ );
4873
+ }
4874
+ }
4875
+ }
4876
+ if (this.normalizedConfig.docker || releaseGraph$1.releaseGroups.some((rg) => rg.docker)) {
4877
+ chunk4ILBJTRR_cjs.writeWarning(
4878
+ formatNxLog({
4879
+ title: "Warning",
4880
+ bodyLines: [
4881
+ `Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.`
4882
+ ]
4883
+ })
4884
+ );
4885
+ }
4886
+ await processor.processDockerProjects(
4887
+ options.dockerVersionScheme,
4888
+ options.dockerVersion
4889
+ );
4890
+ const versionData = processor.getVersionData();
4891
+ const gitTagValues = options.gitTag ?? this.normalizedConfig.version?.git?.tag ? shared.createGitTagValues(
4892
+ releaseGraph$1.releaseGroups,
4893
+ releaseGraph$1.releaseGroupToFilteredProjects,
4894
+ versionData
4895
+ ) : [];
4896
+ shared.handleDuplicateGitTags(gitTagValues);
4897
+ let workspaceVersion = void 0;
4898
+ if (releaseGraph$1.releaseGroups.length === 1) {
4899
+ const releaseGroup = releaseGraph$1.releaseGroups[0];
4900
+ if (releaseGroup?.projectsRelationship === "fixed") {
4901
+ const releaseGroupProjectNames = Array.from(
4902
+ releaseGraph$1.releaseGroupToFilteredProjects.get(releaseGroup)
4903
+ );
4904
+ workspaceVersion = versionData[releaseGroupProjectNames[0]].newVersion;
4905
+ }
4906
+ }
4907
+ const changedFiles = [
4908
+ ...this.tree.listChanges().map((f) => f.path),
4909
+ ...additionalChangedFiles
4910
+ ];
4911
+ const deletedFiles = Array.from(additionalDeletedFiles);
4912
+ if (!changedFiles.length && !deletedFiles.length) {
4913
+ return {
4914
+ workspaceVersion,
4915
+ projectsVersionData: versionData,
4916
+ releaseGraph: releaseGraph$1
4917
+ };
4918
+ }
4919
+ if (options.gitCommit ?? this.normalizedConfig.version?.git?.commit) {
4920
+ await commitChanges({
4921
+ changedFiles,
4922
+ deletedFiles,
4923
+ isDryRun: !!options.dryRun,
4924
+ isVerbose: !!options.verbose,
4925
+ gitCommitMessages: shared.createCommitMessageValues(
4926
+ releaseGraph$1.releaseGroups,
4927
+ releaseGraph$1.releaseGroupToFilteredProjects,
4928
+ versionData,
4929
+ commitMessage
4930
+ ),
4931
+ gitCommitArgs: options.gitCommitArgs || this.normalizedConfig.version?.git?.commitArgs
4932
+ });
4933
+ } else if (options.stageChanges ?? this.normalizedConfig.version?.git?.stageChanges) {
4934
+ chunk4ILBJTRR_cjs.writeDebug(`Staging changed files with git`);
4935
+ await git.gitAdd({
4936
+ changedFiles,
4937
+ deletedFiles,
4938
+ dryRun: options.dryRun,
4939
+ verbose
4940
+ });
4941
+ }
4942
+ if (options.gitTag ?? this.normalizedConfig.version?.git?.tag) {
4943
+ chunk4ILBJTRR_cjs.writeDebug(`Tagging commit with git`);
4944
+ for (const tag of gitTagValues) {
4945
+ await gitTag({
4946
+ tag,
4947
+ message: options.gitTagMessage || this.normalizedConfig.version?.git?.tagMessage,
4948
+ additionalArgs: options.gitTagArgs || this.normalizedConfig.version?.git?.tagArgs,
4949
+ dryRun: options.dryRun,
4950
+ verbose: options.verbose
4951
+ });
4952
+ }
4953
+ }
4954
+ if (options.gitPush ?? this.normalizedConfig.version?.git?.push) {
4955
+ chunk4ILBJTRR_cjs.writeDebug(`Pushing to git remote "${options.gitRemote ?? "origin"}"`);
4956
+ await git.gitPush({
4957
+ gitRemote: options.gitRemote,
4958
+ dryRun: options.dryRun,
4959
+ verbose: options.verbose,
4960
+ additionalArgs: options.gitPushArgs || this.normalizedConfig.version?.git?.pushArgs
4961
+ });
4962
+ }
4963
+ return {
4964
+ workspaceVersion,
4965
+ projectsVersionData: versionData,
4966
+ releaseGraph: releaseGraph$1
4967
+ };
4968
+ };
3755
4969
  };
3756
4970
 
3757
4971
  // src/release/run.ts
@@ -3769,7 +4983,7 @@ var runRelease = async (config5, {
3769
4983
  throw new Error("The `GITHUB_ACTOR` environment variable is not set.");
3770
4984
  }
3771
4985
  if (!await isUserAnOrganizationMember(process.env.GITHUB_ACTOR, config5)) {
3772
- chunkPTYTYIPG_cjs.writeFatal(
4986
+ chunk4ILBJTRR_cjs.writeFatal(
3773
4987
  "You must be a member of the Storm Software organization to run the release process.",
3774
4988
  config5
3775
4989
  );
@@ -3786,26 +5000,26 @@ var runRelease = async (config5, {
3786
5000
  process.env.NODE_AUTH_TOKEN = process.env.NPM_TOKEN;
3787
5001
  process.env.NPM_AUTH_TOKEN = process.env.NPM_TOKEN;
3788
5002
  process.env.NPM_CONFIG_PROVENANCE = "true";
3789
- chunkPTYTYIPG_cjs.writeDebug("Creating Storm release client...", config5);
5003
+ chunk4ILBJTRR_cjs.writeDebug("Creating Storm release client...", config5);
3790
5004
  const releaseClient = await StormReleaseClient.create(
3791
5005
  releaseConfig,
3792
5006
  ignoreNxJsonConfig,
3793
5007
  config5
3794
5008
  );
3795
- chunkPTYTYIPG_cjs.writeDebug("Reading in the workspaces release configuration", config5);
5009
+ chunk4ILBJTRR_cjs.writeDebug("Reading in the workspaces release configuration", config5);
3796
5010
  const to = head || process.env.NX_HEAD;
3797
5011
  const from = base || process.env.NX_BASE;
3798
- chunkPTYTYIPG_cjs.writeDebug(
5012
+ chunk4ILBJTRR_cjs.writeDebug(
3799
5013
  `Using the following Git SHAs to determine the release content:
3800
5014
  - From: ${from}
3801
5015
  - To: ${to}
3802
5016
  `,
3803
5017
  config5
3804
5018
  );
3805
- chunkPTYTYIPG_cjs.writeDebug("Determining the current release versions...", config5);
5019
+ chunk4ILBJTRR_cjs.writeDebug("Determining the current release versions...", config5);
3806
5020
  const { workspaceVersion, projectsVersionData, releaseGraph } = await releaseClient.releaseVersion({
3807
5021
  dryRun,
3808
- verbose: chunkPTYTYIPG_cjs.isVerbose(config5.logLevel),
5022
+ verbose: chunk4ILBJTRR_cjs.isVerbose(config5.logLevel),
3809
5023
  preid: config5.preid,
3810
5024
  stageChanges: true,
3811
5025
  gitCommit: false
@@ -3814,14 +5028,14 @@ var runRelease = async (config5, {
3814
5028
  version: releaseConfig?.projectsRelationship === "fixed" ? workspaceVersion : void 0,
3815
5029
  versionData: projectsVersionData,
3816
5030
  dryRun,
3817
- verbose: chunkPTYTYIPG_cjs.isVerbose(config5.logLevel),
5031
+ verbose: chunk4ILBJTRR_cjs.isVerbose(config5.logLevel),
3818
5032
  to,
3819
5033
  from,
3820
5034
  releaseGraph
3821
5035
  });
3822
- chunkPTYTYIPG_cjs.writeDebug("Tagging commit with git", config5);
5036
+ chunk4ILBJTRR_cjs.writeDebug("Tagging commit with git", config5);
3823
5037
  if (skipPublish) {
3824
- chunkPTYTYIPG_cjs.writeWarning(
5038
+ chunk4ILBJTRR_cjs.writeWarning(
3825
5039
  "Skipping publishing packages since `skipPublish` was provided as `true` in the release options.",
3826
5040
  config5
3827
5041
  );
@@ -3830,7 +5044,7 @@ var runRelease = async (config5, {
3830
5044
  (key) => projectsVersionData[key]?.newVersion
3831
5045
  );
3832
5046
  if (changedProjects.length > 0) {
3833
- chunkPTYTYIPG_cjs.writeInfo(
5047
+ chunk4ILBJTRR_cjs.writeInfo(
3834
5048
  `Publishing release for ${changedProjects.length} ${changedProjects.length === 1 ? "project" : "projects"}:
3835
5049
  ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
3836
5050
  `,
@@ -3839,7 +5053,7 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
3839
5053
  await updatePackageManifests(projectsVersionData, config5);
3840
5054
  const result = await releaseClient.releasePublish({
3841
5055
  dryRun,
3842
- verbose: chunkPTYTYIPG_cjs.isVerbose(config5.logLevel)
5056
+ verbose: chunk4ILBJTRR_cjs.isVerbose(config5.logLevel)
3843
5057
  });
3844
5058
  const failedProjects = Object.keys(result).filter(
3845
5059
  (key) => result[key]?.code && result[key]?.code > 0
@@ -3854,10 +5068,10 @@ ${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${res
3854
5068
  );
3855
5069
  }
3856
5070
  } else {
3857
- chunkPTYTYIPG_cjs.writeWarning("Skipped publishing packages.", config5);
5071
+ chunk4ILBJTRR_cjs.writeWarning("Skipped publishing packages.", config5);
3858
5072
  }
3859
5073
  }
3860
- chunkPTYTYIPG_cjs.writeSuccess("Completed the Storm workspace release process!", config5);
5074
+ chunk4ILBJTRR_cjs.writeSuccess("Completed the Storm workspace release process!", config5);
3861
5075
  };
3862
5076
  async function updatePackageManifests(projectsVersionData, config5) {
3863
5077
  let projectGraph;
@@ -3872,7 +5086,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
3872
5086
  Object.keys(projectsVersionData).map(async (node) => {
3873
5087
  const projectNode = projectGraph.nodes[node];
3874
5088
  if (!projectNode?.data.root) {
3875
- chunkPTYTYIPG_cjs.writeWarning(
5089
+ chunk4ILBJTRR_cjs.writeWarning(
3876
5090
  `Project node ${node} not found in the project graph. Skipping manifest update.`,
3877
5091
  config5
3878
5092
  );
@@ -3880,17 +5094,17 @@ async function updatePackageManifests(projectsVersionData, config5) {
3880
5094
  }
3881
5095
  const versionData = projectsVersionData[node];
3882
5096
  if (projectNode?.data.root && versionData && versionData.newVersion !== null) {
3883
- chunkPTYTYIPG_cjs.writeTrace(
5097
+ chunk4ILBJTRR_cjs.writeTrace(
3884
5098
  `Writing version ${versionData.newVersion} update to manifest file for ${node}
3885
5099
  `,
3886
5100
  config5
3887
5101
  );
3888
- const projectRoot = chunkPTYTYIPG_cjs.joinPaths(
5102
+ const projectRoot = chunk4ILBJTRR_cjs.joinPaths(
3889
5103
  config5.workspaceRoot,
3890
5104
  projectNode.data.root
3891
5105
  );
3892
- const packageJsonPath = chunkPTYTYIPG_cjs.joinPaths(projectRoot, "package.json");
3893
- const cargoTomlPath = chunkPTYTYIPG_cjs.joinPaths(projectRoot, "Cargo.toml");
5106
+ const packageJsonPath = chunk4ILBJTRR_cjs.joinPaths(projectRoot, "package.json");
5107
+ const cargoTomlPath = chunk4ILBJTRR_cjs.joinPaths(projectRoot, "Cargo.toml");
3894
5108
  if (fs$1.existsSync(packageJsonPath)) {
3895
5109
  const packageJsonContent = await fs.readFile(packageJsonPath, "utf8");
3896
5110
  const packageJson = JSON.parse(packageJsonContent);
@@ -3908,7 +5122,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
3908
5122
  })
3909
5123
  );
3910
5124
  } else {
3911
- chunkPTYTYIPG_cjs.writeWarning("No project nodes found. Skipping manifest updates.", config5);
5125
+ chunk4ILBJTRR_cjs.writeWarning("No project nodes found. Skipping manifest updates.", config5);
3912
5126
  }
3913
5127
  }
3914
5128
 
@@ -3916,8 +5130,8 @@ async function updatePackageManifests(projectsVersionData, config5) {
3916
5130
  var _config = {};
3917
5131
  function createProgram(config5) {
3918
5132
  _config = config5;
3919
- chunkPTYTYIPG_cjs.writeInfo(`${chunkPTYTYIPG_cjs.brandIcon(_config)} Running Storm Git Tools`, config5);
3920
- const root = chunkPTYTYIPG_cjs.findWorkspaceRootSafe(process.cwd());
5133
+ chunk4ILBJTRR_cjs.writeInfo(`${chunk4ILBJTRR_cjs.brandIcon(_config)} Running Storm Git Tools`, config5);
5134
+ const root = chunk4ILBJTRR_cjs.findWorkspaceRootSafe(process.cwd());
3921
5135
  process.env.STORM_WORKSPACE_ROOT ??= root;
3922
5136
  process.env.NX_WORKSPACE_ROOT_PATH ??= root;
3923
5137
  if (root) {
@@ -3964,12 +5178,12 @@ async function commitAction({
3964
5178
  dryRun = false
3965
5179
  }) {
3966
5180
  try {
3967
- chunkPTYTYIPG_cjs.writeInfo(
3968
- `${chunkPTYTYIPG_cjs.brandIcon(typeof config5 === "string" ? {} : config5)} Preparing to commit your changes. Please provide the requested details below...`,
5181
+ chunk4ILBJTRR_cjs.writeInfo(
5182
+ `${chunk4ILBJTRR_cjs.brandIcon(typeof config5 === "string" ? {} : config5)} Preparing to commit your changes. Please provide the requested details below...`,
3969
5183
  _config
3970
5184
  );
3971
5185
  await runCommit(config5, dryRun);
3972
- chunkPTYTYIPG_cjs.writeSuccess(
5186
+ chunk4ILBJTRR_cjs.writeSuccess(
3973
5187
  `\u2714 Storm Commit processing completed successfully!
3974
5188
 
3975
5189
  Note: Please run "pnpm push" to upload these changes to the remote ${_config.name ? _config.name : _config.namespace ? _config.namespace : _config.organization ? _config.organization : "Storm-Software"} Git repository at ${_config.repository}
@@ -3977,7 +5191,7 @@ Note: Please run "pnpm push" to upload these changes to the remote ${_config.nam
3977
5191
  _config
3978
5192
  );
3979
5193
  } catch (error) {
3980
- chunkPTYTYIPG_cjs.writeFatal(
5194
+ chunk4ILBJTRR_cjs.writeFatal(
3981
5195
  `A fatal error occurred while running commit action:
3982
5196
 
3983
5197
  ${error.message}${error.stack ? `
@@ -3992,17 +5206,17 @@ Please fix any errors and try committing again.`,
3992
5206
  }
3993
5207
  async function readmeAction(options) {
3994
5208
  try {
3995
- chunkPTYTYIPG_cjs.writeInfo(
3996
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Formatting the workspace's README.md files`,
5209
+ chunk4ILBJTRR_cjs.writeInfo(
5210
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Formatting the workspace's README.md files`,
3997
5211
  _config
3998
5212
  );
3999
5213
  await runReadme(options);
4000
- chunkPTYTYIPG_cjs.writeSuccess(
5214
+ chunk4ILBJTRR_cjs.writeSuccess(
4001
5215
  "\u2714 Formatting of the workspace's README.md files is complete\n",
4002
5216
  _config
4003
5217
  );
4004
5218
  } catch (error) {
4005
- chunkPTYTYIPG_cjs.writeFatal(
5219
+ chunk4ILBJTRR_cjs.writeFatal(
4006
5220
  `A fatal error occurred while running README format action:
4007
5221
 
4008
5222
  ${error.message}`
@@ -4017,8 +5231,8 @@ async function releaseAction({
4017
5231
  dryRun
4018
5232
  }) {
4019
5233
  try {
4020
- chunkPTYTYIPG_cjs.writeInfo(
4021
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm Release and Publish process on the workspace`,
5234
+ chunk4ILBJTRR_cjs.writeInfo(
5235
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm Release and Publish process on the workspace`,
4022
5236
  _config
4023
5237
  );
4024
5238
  await runRelease(_config, {
@@ -4027,9 +5241,9 @@ async function releaseAction({
4027
5241
  base,
4028
5242
  head
4029
5243
  });
4030
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Release completed successfully!\n", _config);
5244
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Release completed successfully!\n", _config);
4031
5245
  } catch (error) {
4032
- chunkPTYTYIPG_cjs.writeFatal(
5246
+ chunk4ILBJTRR_cjs.writeFatal(
4033
5247
  `A fatal error occurred while running release action:
4034
5248
 
4035
5249
  ${error.message} ${error.stack ? `
@@ -4043,17 +5257,17 @@ Stacktrace: ${error.stack}` : ""}`,
4043
5257
  }
4044
5258
  async function commitLintAction(options) {
4045
5259
  try {
4046
- chunkPTYTYIPG_cjs.writeInfo(
4047
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Linting the ${_config.repository ? _config.repository : _config.namespace ? _config.namespace : _config.name ? _config.name : typeof _config.organization === "string" ? _config.organization : _config.organization?.name ? _config.organization?.name : "Storm-Software"} repository's commit messages.`,
5260
+ chunk4ILBJTRR_cjs.writeInfo(
5261
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Linting the ${_config.repository ? _config.repository : _config.namespace ? _config.namespace : _config.name ? _config.name : typeof _config.organization === "string" ? _config.organization : _config.organization?.name ? _config.organization?.name : "Storm-Software"} repository's commit messages.`,
4048
5262
  _config
4049
5263
  );
4050
5264
  await runCommitLint(_config, options);
4051
- chunkPTYTYIPG_cjs.writeSuccess(
5265
+ chunk4ILBJTRR_cjs.writeSuccess(
4052
5266
  "\u2714 Linting the commit messages completed successfully!\n",
4053
5267
  _config
4054
5268
  );
4055
5269
  } catch (error) {
4056
- chunkPTYTYIPG_cjs.writeFatal(
5270
+ chunk4ILBJTRR_cjs.writeFatal(
4057
5271
  `A fatal error occurred while linting the commit messages:
4058
5272
 
4059
5273
  ${error.message}`,
@@ -4064,14 +5278,14 @@ ${error.message}`,
4064
5278
  }
4065
5279
  async function postCheckoutAction({ files }) {
4066
5280
  try {
4067
- chunkPTYTYIPG_cjs.writeInfo(
4068
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm post-checkout git hook for ${files.length} files in the workspace...`,
5281
+ chunk4ILBJTRR_cjs.writeInfo(
5282
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm post-checkout git hook for ${files.length} files in the workspace...`,
4069
5283
  _config
4070
5284
  );
4071
- await chunkTHX6DU6T_cjs.postCheckoutHook(_config, files);
4072
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Post-checkout hook completed successfully!\n", _config);
5285
+ await chunkDPKFBB3S_cjs.postCheckoutHook(_config, files);
5286
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Post-checkout hook completed successfully!\n", _config);
4073
5287
  } catch (error) {
4074
- chunkPTYTYIPG_cjs.writeFatal(
5288
+ chunk4ILBJTRR_cjs.writeFatal(
4075
5289
  `A fatal error occurred while running the post-checkout hook:
4076
5290
 
4077
5291
  ${error.message}`,
@@ -4082,14 +5296,14 @@ ${error.message}`,
4082
5296
  }
4083
5297
  async function postCommitAction({ files }) {
4084
5298
  try {
4085
- chunkPTYTYIPG_cjs.writeInfo(
4086
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm post-commit git hook for ${files.length} files in the workspace...`,
5299
+ chunk4ILBJTRR_cjs.writeInfo(
5300
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm post-commit git hook for ${files.length} files in the workspace...`,
4087
5301
  _config
4088
5302
  );
4089
- await chunkLR2WNL25_cjs.postCommitHook(_config, files);
4090
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Post-commit hook completed successfully!\n", _config);
5303
+ await chunkOGGY5I23_cjs.postCommitHook(_config, files);
5304
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Post-commit hook completed successfully!\n", _config);
4091
5305
  } catch (error) {
4092
- chunkPTYTYIPG_cjs.writeFatal(
5306
+ chunk4ILBJTRR_cjs.writeFatal(
4093
5307
  `A fatal error occurred while running the post-commit hook:
4094
5308
 
4095
5309
  ${error.message}`,
@@ -4100,14 +5314,14 @@ ${error.message}`,
4100
5314
  }
4101
5315
  async function postMergeAction({ files }) {
4102
5316
  try {
4103
- chunkPTYTYIPG_cjs.writeInfo(
4104
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm post-merge git hook for ${files.length} files in the workspace...`,
5317
+ chunk4ILBJTRR_cjs.writeInfo(
5318
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm post-merge git hook for ${files.length} files in the workspace...`,
4105
5319
  _config
4106
5320
  );
4107
- await chunk27LFN4VQ_cjs.postMergeHook(_config, files);
4108
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Post-merge hook completed successfully!\n", _config);
5321
+ await chunkRZNFHUM6_cjs.postMergeHook(_config, files);
5322
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Post-merge hook completed successfully!\n", _config);
4109
5323
  } catch (error) {
4110
- chunkPTYTYIPG_cjs.writeFatal(
5324
+ chunk4ILBJTRR_cjs.writeFatal(
4111
5325
  `A fatal error occurred while running the post-merge hook:
4112
5326
 
4113
5327
  ${error.message}`,
@@ -4118,14 +5332,14 @@ ${error.message}`,
4118
5332
  }
4119
5333
  async function preCommitAction({ files }) {
4120
5334
  try {
4121
- chunkPTYTYIPG_cjs.writeInfo(
4122
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm pre-commit git hook for ${files.length} files in the workspace...`,
5335
+ chunk4ILBJTRR_cjs.writeInfo(
5336
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm pre-commit git hook for ${files.length} files in the workspace...`,
4123
5337
  _config
4124
5338
  );
4125
- await chunkUIGOGTUM_cjs.preCommitHook(_config, files);
4126
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Pre-commit hook completed successfully!\n", _config);
5339
+ await chunkAQ5YHZ3Z_cjs.preCommitHook(_config, files);
5340
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Pre-commit hook completed successfully!\n", _config);
4127
5341
  } catch (error) {
4128
- chunkPTYTYIPG_cjs.writeFatal(
5342
+ chunk4ILBJTRR_cjs.writeFatal(
4129
5343
  `A fatal error occurred while running the pre-commit hook:
4130
5344
 
4131
5345
  ${error.message}`,
@@ -4136,14 +5350,14 @@ ${error.message}`,
4136
5350
  }
4137
5351
  async function prePushAction({ files }) {
4138
5352
  try {
4139
- chunkPTYTYIPG_cjs.writeInfo(
4140
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm pre-push git hook for ${files.length} files in the workspace...`,
5353
+ chunk4ILBJTRR_cjs.writeInfo(
5354
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm pre-push git hook for ${files.length} files in the workspace...`,
4141
5355
  _config
4142
5356
  );
4143
- await chunkMY767YV7_cjs.prePushHook(_config, files);
4144
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Pre-push hook completed successfully!\n", _config);
5357
+ await chunkW5P2IM2W_cjs.prePushHook(_config, files);
5358
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Pre-push hook completed successfully!\n", _config);
4145
5359
  } catch (error) {
4146
- chunkPTYTYIPG_cjs.writeFatal(
5360
+ chunk4ILBJTRR_cjs.writeFatal(
4147
5361
  `A fatal error occurred while running the pre-push hook:
4148
5362
 
4149
5363
  ${error.message}`,
@@ -4154,14 +5368,14 @@ ${error.message}`,
4154
5368
  }
4155
5369
  async function prepareAction() {
4156
5370
  try {
4157
- chunkPTYTYIPG_cjs.writeInfo(
4158
- `${chunkPTYTYIPG_cjs.brandIcon(_config)} Running the Storm prepare git hook for the workspace...`,
5371
+ chunk4ILBJTRR_cjs.writeInfo(
5372
+ `${chunk4ILBJTRR_cjs.brandIcon(_config)} Running the Storm prepare git hook for the workspace...`,
4159
5373
  _config
4160
5374
  );
4161
- await chunkROM64JTJ_cjs.prepareHook(_config);
4162
- chunkPTYTYIPG_cjs.writeSuccess("\u2714 Prepare hook completed successfully!\n", _config);
5375
+ await chunk4EOHM2UV_cjs.prepareHook(_config);
5376
+ chunk4ILBJTRR_cjs.writeSuccess("\u2714 Prepare hook completed successfully!\n", _config);
4163
5377
  } catch (error) {
4164
- chunkPTYTYIPG_cjs.writeFatal(
5378
+ chunk4ILBJTRR_cjs.writeFatal(
4165
5379
  `A fatal error occurred while running the prepare hook:
4166
5380
 
4167
5381
  ${error.message}`,
@@ -4173,18 +5387,18 @@ ${error.message}`,
4173
5387
 
4174
5388
  // bin/git.ts
4175
5389
  void (async () => {
4176
- const config5 = await chunkPTYTYIPG_cjs.getConfig();
5390
+ const config5 = await chunk4ILBJTRR_cjs.getConfig();
4177
5391
  try {
4178
- chunkPTYTYIPG_cjs.handleProcess(config5);
5392
+ chunk4ILBJTRR_cjs.handleProcess(config5);
4179
5393
  const program = createProgram(config5);
4180
5394
  await program.parseAsync(process.argv);
4181
- chunkPTYTYIPG_cjs.writeSuccess(
5395
+ chunk4ILBJTRR_cjs.writeSuccess(
4182
5396
  `\u2714 Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
4183
5397
  config5
4184
5398
  );
4185
- chunkPTYTYIPG_cjs.exitWithSuccess(config5);
5399
+ chunk4ILBJTRR_cjs.exitWithSuccess(config5);
4186
5400
  } catch (error) {
4187
- chunkPTYTYIPG_cjs.exitWithError(config5);
5401
+ chunk4ILBJTRR_cjs.exitWithError(config5);
4188
5402
  process.exit(1);
4189
5403
  }
4190
5404
  })();