@williamthorsen/release-kit 6.0.0 → 7.0.0

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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -3
  3. package/dist/esm/.cache +1 -1
  4. package/dist/esm/assertCleanWorkingTree.js +9 -14
  5. package/dist/esm/bin/release-kit.js +200 -199
  6. package/dist/esm/buildChangelogEntries.d.ts +2 -2
  7. package/dist/esm/buildChangelogEntries.js +142 -149
  8. package/dist/esm/buildDependencyGraph.d.ts +1 -1
  9. package/dist/esm/buildDependencyGraph.js +60 -59
  10. package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -1
  11. package/dist/esm/buildEmptyReleaseEntry.js +12 -15
  12. package/dist/esm/buildReleaseSummary.d.ts +1 -1
  13. package/dist/esm/buildReleaseSummary.js +23 -26
  14. package/dist/esm/buildSyntheticChangelogEntry.d.ts +1 -1
  15. package/dist/esm/buildSyntheticChangelogEntry.js +9 -12
  16. package/dist/esm/bumpAllVersions.d.ts +1 -1
  17. package/dist/esm/bumpAllVersions.js +51 -52
  18. package/dist/esm/bumpVersion.d.ts +1 -1
  19. package/dist/esm/bumpVersion.js +25 -28
  20. package/dist/esm/changelogJsonFile.d.ts +1 -1
  21. package/dist/esm/changelogJsonFile.js +59 -62
  22. package/dist/esm/changelogJsonUtils.d.ts +1 -1
  23. package/dist/esm/changelogJsonUtils.js +35 -32
  24. package/dist/esm/changelogOverrides.d.ts +1 -1
  25. package/dist/esm/changelogOverrides.js +374 -377
  26. package/dist/esm/checkWorkTypesDrift.js +104 -102
  27. package/dist/esm/collectPolicyViolations.d.ts +2 -2
  28. package/dist/esm/collectPolicyViolations.js +11 -14
  29. package/dist/esm/commitCommand.js +48 -46
  30. package/dist/esm/compareVersions.js +20 -23
  31. package/dist/esm/createGithubRelease.js +56 -59
  32. package/dist/esm/createGithubReleaseCommand.js +21 -23
  33. package/dist/esm/createTags.js +57 -56
  34. package/dist/esm/decideRelease.d.ts +2 -2
  35. package/dist/esm/decideRelease.js +27 -41
  36. package/dist/esm/defaults.d.ts +3 -3
  37. package/dist/esm/defaults.js +36 -48
  38. package/dist/esm/deleteFileIfExists.js +10 -12
  39. package/dist/esm/deriveWorkspaceConfig.d.ts +1 -1
  40. package/dist/esm/deriveWorkspaceConfig.js +34 -36
  41. package/dist/esm/detectPackageManager.js +35 -37
  42. package/dist/esm/detectUndeclaredTagPrefixes.js +41 -40
  43. package/dist/esm/determineBumpFromCommits.d.ts +2 -2
  44. package/dist/esm/determineBumpFromCommits.js +25 -29
  45. package/dist/esm/determineBumpType.d.ts +1 -1
  46. package/dist/esm/determineBumpType.js +31 -32
  47. package/dist/esm/discoverWorkspaces.js +38 -40
  48. package/dist/esm/format.js +6 -11
  49. package/dist/esm/generateChangelogs.d.ts +1 -1
  50. package/dist/esm/generateChangelogs.js +13 -17
  51. package/dist/esm/getCommitsSinceTarget.d.ts +1 -1
  52. package/dist/esm/getCommitsSinceTarget.js +54 -55
  53. package/dist/esm/hasPrettierConfig.js +33 -35
  54. package/dist/esm/help/prepareHelp.js +4 -8
  55. package/dist/esm/index.d.ts +4 -4
  56. package/dist/esm/index.js +2 -8
  57. package/dist/esm/init/checks.js +28 -32
  58. package/dist/esm/init/detectRepoType.js +12 -15
  59. package/dist/esm/init/initCommand.js +60 -54
  60. package/dist/esm/init/parseJsonRecord.js +9 -11
  61. package/dist/esm/init/scaffold.d.ts +1 -1
  62. package/dist/esm/init/scaffold.js +32 -38
  63. package/dist/esm/init/templates.d.ts +1 -1
  64. package/dist/esm/init/templates.js +16 -22
  65. package/dist/esm/injectReleaseNotesIntoReadme.js +42 -49
  66. package/dist/esm/injectSection.js +17 -27
  67. package/dist/esm/loadConfig.d.ts +1 -1
  68. package/dist/esm/loadConfig.js +206 -225
  69. package/dist/esm/parseCommitMessage.d.ts +1 -1
  70. package/dist/esm/parseCommitMessage.js +72 -76
  71. package/dist/esm/parseRequestedTags.js +6 -9
  72. package/dist/esm/prepareCommand.d.ts +1 -1
  73. package/dist/esm/prepareCommand.js +225 -235
  74. package/dist/esm/previewTagPrefixes.d.ts +1 -1
  75. package/dist/esm/previewTagPrefixes.js +101 -96
  76. package/dist/esm/propagateBumps.d.ts +2 -2
  77. package/dist/esm/propagateBumps.js +48 -50
  78. package/dist/esm/publish.d.ts +2 -2
  79. package/dist/esm/publish.js +22 -28
  80. package/dist/esm/publishCommand.js +75 -80
  81. package/dist/esm/pushCommand.js +33 -34
  82. package/dist/esm/pushRelease.d.ts +1 -1
  83. package/dist/esm/pushRelease.js +21 -24
  84. package/dist/esm/readCurrentVersion.js +13 -17
  85. package/dist/esm/releasePrepare.d.ts +1 -1
  86. package/dist/esm/releasePrepare.js +213 -231
  87. package/dist/esm/releasePrepareMono.d.ts +2 -2
  88. package/dist/esm/releasePrepareMono.js +434 -494
  89. package/dist/esm/releasePrepareProject.d.ts +2 -2
  90. package/dist/esm/releasePrepareProject.js +143 -153
  91. package/dist/esm/renderChangelogMarkdown.d.ts +1 -1
  92. package/dist/esm/renderChangelogMarkdown.js +20 -24
  93. package/dist/esm/renderReleaseNotes.d.ts +1 -1
  94. package/dist/esm/renderReleaseNotes.js +50 -55
  95. package/dist/esm/reportPrepare.d.ts +1 -1
  96. package/dist/esm/reportPrepare.js +230 -231
  97. package/dist/esm/resolveCliffConfigPath.js +18 -23
  98. package/dist/esm/resolveCommandTags.d.ts +1 -1
  99. package/dist/esm/resolveCommandTags.js +47 -45
  100. package/dist/esm/resolveReleaseNotesConfig.d.ts +1 -1
  101. package/dist/esm/resolveReleaseNotesConfig.js +39 -43
  102. package/dist/esm/resolveReleaseTags.d.ts +1 -1
  103. package/dist/esm/resolveReleaseTags.js +39 -40
  104. package/dist/esm/runGitCliff.js +27 -30
  105. package/dist/esm/showTagPrefixesCommand.js +48 -70
  106. package/dist/esm/stripEmojiPrefix.js +2 -5
  107. package/dist/esm/stripScope.js +18 -21
  108. package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
  109. package/dist/esm/sync-labels/generateCommand.js +51 -53
  110. package/dist/esm/sync-labels/initCommand.js +46 -48
  111. package/dist/esm/sync-labels/loadSyncLabelsConfig.d.ts +1 -1
  112. package/dist/esm/sync-labels/loadSyncLabelsConfig.js +46 -52
  113. package/dist/esm/sync-labels/presets.d.ts +1 -1
  114. package/dist/esm/sync-labels/presets.js +40 -43
  115. package/dist/esm/sync-labels/resolveLabels.d.ts +1 -1
  116. package/dist/esm/sync-labels/resolveLabels.js +28 -35
  117. package/dist/esm/sync-labels/syncCommand.js +30 -31
  118. package/dist/esm/sync-labels/templates.d.ts +1 -1
  119. package/dist/esm/sync-labels/templates.js +23 -26
  120. package/dist/esm/sync-labels/types.js +1 -0
  121. package/dist/esm/syncWorkTypes.js +83 -84
  122. package/dist/esm/tagCommand.js +12 -14
  123. package/dist/esm/typeGuards.js +4 -8
  124. package/dist/esm/types.js +66 -60
  125. package/dist/esm/validateConfig.d.ts +1 -1
  126. package/dist/esm/validateConfig.js +109 -115
  127. package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +2 -2
  128. package/dist/esm/validateOnlyExcludesStrandedDependents.js +97 -91
  129. package/dist/esm/validateOverridesCommand.d.ts +2 -2
  130. package/dist/esm/validateOverridesCommand.js +110 -111
  131. package/dist/esm/workTypesData.js +57 -60
  132. package/dist/esm/workTypesUtils.js +16 -21
  133. package/dist/esm/writeReleaseNotesPreviews.js +55 -57
  134. package/package.json +2 -2
@@ -1,254 +1,253 @@
1
1
  import { bold, dim, sectionHeader } from "./format.js";
2
- function reportPrepare(result) {
3
- const isMultiWorkspace = result.workspaces.some((w) => w.name !== void 0) || result.project !== void 0;
4
- if (isMultiWorkspace) {
5
- return formatMultiWorkspace(result);
6
- }
7
- return formatSingleWorkspace(result);
2
+ export function reportPrepare(result) {
3
+ const isMultiWorkspace = result.workspaces.some((w) => w.name !== undefined) || result.project !== undefined;
4
+ if (isMultiWorkspace) {
5
+ return formatMultiWorkspace(result);
6
+ }
7
+ return formatSingleWorkspace(result);
8
8
  }
9
9
  function formatSingleWorkspace(result) {
10
- const lines = [];
11
- const workspace = result.workspaces[0];
12
- if (workspace === void 0) {
13
- return "";
14
- }
15
- const since = workspace.previousTag === void 0 ? "the beginning" : workspace.previousTag;
16
- lines.push(dim(`Found ${workspace.commitCount} commits since ${since}`));
17
- if (workspace.parsedCommitCount !== void 0) {
18
- lines.push(dim(` Parsed ${workspace.parsedCommitCount} typed commits`));
19
- }
20
- formatUnparseableWarning(lines, workspace);
21
- formatPolicyViolations(lines, workspace.policyViolations);
22
- if (workspace.status === "skipped") {
23
- lines.push(`\u23ED\uFE0F ${workspace.skipReason}`);
24
- return lines.join("\n");
25
- }
26
- if (workspace.setVersion !== void 0) {
27
- lines.push(` Using version override: ${workspace.setVersion}`);
28
- } else if (workspace.bumpOverride !== void 0) {
29
- lines.push(` Using bump override: ${workspace.bumpOverride}`);
30
- }
31
- if (workspace.releaseType !== void 0) {
32
- lines.push(dim(`Bumping versions (${workspace.releaseType})...`));
33
- } else if (workspace.setVersion !== void 0) {
34
- lines.push(dim(`Bumping versions (version override)...`));
35
- }
36
- if (workspace.setVersion !== void 0) {
37
- lines.push(`\u{1F4E6} ${workspace.currentVersion} \u2192 ${bold(workspace.newVersion)} (version override)`);
38
- } else if (workspace.releaseType !== void 0) {
39
- lines.push(`\u{1F4E6} ${workspace.currentVersion} \u2192 ${bold(workspace.newVersion)} (${workspace.releaseType})`);
40
- }
41
- formatBumpFiles(lines, workspace, result.dryRun);
42
- lines.push(dim("Generating changelogs..."));
43
- formatChangelogFiles(lines, workspace, result.dryRun);
44
- formatFormatCommand(lines, result);
45
- lines.push(`\u2705 Release preparation complete.`, ` \u{1F3F7}\uFE0F ${bold(workspace.tag)}`);
46
- return lines.join("\n");
10
+ const lines = [];
11
+ const workspace = result.workspaces[0];
12
+ if (workspace === undefined) {
13
+ return '';
14
+ }
15
+ const since = workspace.previousTag === undefined ? 'the beginning' : workspace.previousTag;
16
+ lines.push(dim(`Found ${workspace.commitCount} commits since ${since}`));
17
+ if (workspace.parsedCommitCount !== undefined) {
18
+ lines.push(dim(` Parsed ${workspace.parsedCommitCount} typed commits`));
19
+ }
20
+ formatUnparseableWarning(lines, workspace);
21
+ formatPolicyViolations(lines, workspace.policyViolations);
22
+ if (workspace.status === 'skipped') {
23
+ lines.push(`⏭️ ${workspace.skipReason}`);
24
+ return lines.join('\n');
25
+ }
26
+ if (workspace.setVersion !== undefined) {
27
+ lines.push(` Using version override: ${workspace.setVersion}`);
28
+ }
29
+ else if (workspace.bumpOverride !== undefined) {
30
+ lines.push(` Using bump override: ${workspace.bumpOverride}`);
31
+ }
32
+ if (workspace.releaseType !== undefined) {
33
+ lines.push(dim(`Bumping versions (${workspace.releaseType})...`));
34
+ }
35
+ else if (workspace.setVersion !== undefined) {
36
+ lines.push(dim(`Bumping versions (version override)...`));
37
+ }
38
+ if (workspace.setVersion !== undefined) {
39
+ lines.push(`📦 ${workspace.currentVersion} → ${bold(workspace.newVersion)} (version override)`);
40
+ }
41
+ else if (workspace.releaseType !== undefined) {
42
+ lines.push(`📦 ${workspace.currentVersion} → ${bold(workspace.newVersion)} (${workspace.releaseType})`);
43
+ }
44
+ formatBumpFiles(lines, workspace, result.dryRun);
45
+ lines.push(dim('Generating changelogs...'));
46
+ formatChangelogFiles(lines, workspace, result.dryRun);
47
+ formatFormatCommand(lines, result);
48
+ lines.push(`✅ Release preparation complete.`, ` 🏷️ ${bold(workspace.tag)}`);
49
+ return lines.join('\n');
47
50
  }
48
51
  function formatMultiWorkspace(result) {
49
- const lines = [];
50
- for (const workspace of result.workspaces) {
51
- formatWorkspaceSection(lines, workspace, result.dryRun);
52
- }
53
- if (result.project !== void 0) {
54
- formatProjectSection(lines, result.project, result.dryRun);
55
- }
56
- formatFormatCommand(lines, result);
57
- formatWarnings(lines, result);
58
- if (result.tags.length > 0) {
59
- lines.push(`
60
- \u2705 Release preparation complete.`);
61
- for (const tag of result.tags) {
62
- lines.push(` \u{1F3F7}\uFE0F ${bold(tag)}`);
63
- }
64
- } else {
65
- lines.push(`
66
- \u23ED\uFE0F No workspaces had release-worthy changes.`);
67
- }
68
- return lines.join("\n");
52
+ const lines = [];
53
+ for (const workspace of result.workspaces) {
54
+ formatWorkspaceSection(lines, workspace, result.dryRun);
55
+ }
56
+ if (result.project !== undefined) {
57
+ formatProjectSection(lines, result.project, result.dryRun);
58
+ }
59
+ formatFormatCommand(lines, result);
60
+ formatWarnings(lines, result);
61
+ if (result.tags.length > 0) {
62
+ lines.push(`\n✅ Release preparation complete.`);
63
+ for (const tag of result.tags) {
64
+ lines.push(` 🏷️ ${bold(tag)}`);
65
+ }
66
+ }
67
+ else {
68
+ lines.push(`\n⏭️ No workspaces had release-worthy changes.`);
69
+ }
70
+ return lines.join('\n');
69
71
  }
70
72
  function formatProjectSection(lines, project, dryRun) {
71
- lines.push(`
72
- ${sectionHeader("project")}`);
73
- const since = project.previousTag === void 0 ? "(no previous release found)" : `since ${project.previousTag}`;
74
- lines.push(dim(` Found ${project.commitCount} commits ${since}`));
75
- formatPolicyViolations(lines, project.policyViolations, " ");
76
- if (project.status === "skipped") {
77
- lines.push(` \u23ED\uFE0F ${project.skipReason}`);
78
- return;
79
- }
80
- const { releaseType, currentVersion, newVersion, tag } = project;
81
- if (project.parsedCommitCount > 0) {
82
- lines.push(dim(` Parsed ${project.parsedCommitCount} typed commits`));
83
- }
84
- if (project.bumpOverride !== void 0) {
85
- lines.push(` Using bump override: ${project.bumpOverride}`);
86
- }
87
- formatProjectUnparseable(lines, project);
88
- lines.push(
89
- dim(` Bumping versions (${releaseType})...`),
90
- ` \u{1F4E6} ${currentVersion} \u2192 ${bold(newVersion)} (${releaseType})`
91
- );
92
- for (const file of project.bumpedFiles) {
93
- if (dryRun) {
94
- lines.push(dim(` [dry-run] Would bump ${file}`));
95
- } else {
96
- lines.push(dim(` Bumped ${file}`));
97
- }
98
- }
99
- lines.push(dim(" Generating changelogs..."));
100
- for (const file of project.changelogFiles) {
101
- if (dryRun) {
102
- lines.push(dim(` [dry-run] Would run: npx --yes git-cliff ... --output ${file}`));
103
- } else {
104
- lines.push(dim(` Generating changelog: ${file}`));
105
- }
106
- }
107
- lines.push(` \u{1F3F7}\uFE0F ${bold(tag)}`);
73
+ lines.push(`\n${sectionHeader('project')}`);
74
+ const since = project.previousTag === undefined ? '(no previous release found)' : `since ${project.previousTag}`;
75
+ lines.push(dim(` Found ${project.commitCount} commits ${since}`));
76
+ formatPolicyViolations(lines, project.policyViolations, ' ');
77
+ if (project.status === 'skipped') {
78
+ lines.push(` ⏭️ ${project.skipReason}`);
79
+ return;
80
+ }
81
+ const { releaseType, currentVersion, newVersion, tag } = project;
82
+ if (project.parsedCommitCount > 0) {
83
+ lines.push(dim(` Parsed ${project.parsedCommitCount} typed commits`));
84
+ }
85
+ if (project.bumpOverride !== undefined) {
86
+ lines.push(` Using bump override: ${project.bumpOverride}`);
87
+ }
88
+ formatProjectUnparseable(lines, project);
89
+ lines.push(dim(` Bumping versions (${releaseType})...`), ` 📦 ${currentVersion} → ${bold(newVersion)} (${releaseType})`);
90
+ for (const file of project.bumpedFiles) {
91
+ if (dryRun) {
92
+ lines.push(dim(` [dry-run] Would bump ${file}`));
93
+ }
94
+ else {
95
+ lines.push(dim(` Bumped ${file}`));
96
+ }
97
+ }
98
+ lines.push(dim(' Generating changelogs...'));
99
+ for (const file of project.changelogFiles) {
100
+ if (dryRun) {
101
+ lines.push(dim(` [dry-run] Would run: npx --yes git-cliff ... --output ${file}`));
102
+ }
103
+ else {
104
+ lines.push(dim(` Generating changelog: ${file}`));
105
+ }
106
+ }
107
+ lines.push(` 🏷️ ${bold(tag)}`);
108
108
  }
109
109
  function formatProjectUnparseable(lines, project) {
110
- const unparseable = project.unparseableCommits;
111
- if (unparseable === void 0 || unparseable.length === 0) {
112
- return;
113
- }
114
- const count = unparseable.length;
115
- const isPatchFloor = project.parsedCommitCount === 0;
116
- const suffix = isPatchFloor ? " (defaulting to patch bump)" : "";
117
- lines.push(` \u26A0\uFE0F ${count} commit${count === 1 ? "" : "s"} could not be parsed${suffix}`);
118
- for (const commit of unparseable) {
119
- const shortHash = commit.hash.slice(0, 7);
120
- const truncatedMessage = commit.message.length > 72 ? `${commit.message.slice(0, 69)}...` : commit.message;
121
- lines.push(` \xB7 ${shortHash} ${truncatedMessage}`);
122
- }
110
+ const unparseable = project.unparseableCommits;
111
+ if (unparseable === undefined || unparseable.length === 0) {
112
+ return;
113
+ }
114
+ const count = unparseable.length;
115
+ const isPatchFloor = project.parsedCommitCount === 0;
116
+ const suffix = isPatchFloor ? ' (defaulting to patch bump)' : '';
117
+ lines.push(` ⚠️ ${count} commit${count === 1 ? '' : 's'} could not be parsed${suffix}`);
118
+ for (const commit of unparseable) {
119
+ const shortHash = commit.hash.slice(0, 7);
120
+ const truncatedMessage = commit.message.length > 72 ? `${commit.message.slice(0, 69)}...` : commit.message;
121
+ lines.push(` · ${shortHash} ${truncatedMessage}`);
122
+ }
123
123
  }
124
124
  function formatWorkspaceSection(lines, workspace, dryRun) {
125
- if (workspace.name !== void 0) {
126
- lines.push(`
127
- ${sectionHeader(workspace.name)}`);
128
- }
129
- const since = workspace.previousTag === void 0 ? "(no previous release found)" : `since ${workspace.previousTag}`;
130
- lines.push(dim(` Found ${workspace.commitCount} commits ${since}`));
131
- if (workspace.status === "skipped") {
132
- lines.push(` \u23ED\uFE0F ${workspace.skipReason}`);
133
- return;
134
- }
135
- const { propagatedFrom } = workspace;
136
- const isPropagatedOnly = propagatedFrom !== void 0 && workspace.commitCount === 0;
137
- formatCommitSummary(lines, workspace, propagatedFrom, isPropagatedOnly);
138
- formatUnparseableWarning(lines, workspace, " ");
139
- formatPolicyViolations(lines, workspace.policyViolations, " ");
140
- formatBumpLabels(lines, workspace, isPropagatedOnly);
141
- formatVersionLine(lines, workspace, propagatedFrom, isPropagatedOnly);
142
- formatBumpFiles(lines, workspace, dryRun, " ");
143
- lines.push(dim(" Generating changelogs..."));
144
- formatChangelogFiles(lines, workspace, dryRun, " ");
145
- lines.push(` \u{1F3F7}\uFE0F ${bold(workspace.tag)}`);
125
+ if (workspace.name !== undefined) {
126
+ lines.push(`\n${sectionHeader(workspace.name)}`);
127
+ }
128
+ const since = workspace.previousTag === undefined ? '(no previous release found)' : `since ${workspace.previousTag}`;
129
+ lines.push(dim(` Found ${workspace.commitCount} commits ${since}`));
130
+ if (workspace.status === 'skipped') {
131
+ lines.push(` ⏭️ ${workspace.skipReason}`);
132
+ return;
133
+ }
134
+ const { propagatedFrom } = workspace;
135
+ const isPropagatedOnly = propagatedFrom !== undefined && workspace.commitCount === 0;
136
+ formatCommitSummary(lines, workspace, propagatedFrom, isPropagatedOnly);
137
+ formatUnparseableWarning(lines, workspace, ' ');
138
+ formatPolicyViolations(lines, workspace.policyViolations, ' ');
139
+ formatBumpLabels(lines, workspace, isPropagatedOnly);
140
+ formatVersionLine(lines, workspace, propagatedFrom, isPropagatedOnly);
141
+ formatBumpFiles(lines, workspace, dryRun, ' ');
142
+ lines.push(dim(' Generating changelogs...'));
143
+ formatChangelogFiles(lines, workspace, dryRun, ' ');
144
+ lines.push(` 🏷️ ${bold(workspace.tag)}`);
146
145
  }
147
146
  function formatCommitSummary(lines, workspace, propagatedFrom, isPropagatedOnly) {
148
- if (isPropagatedOnly && propagatedFrom !== void 0) {
149
- const depNames = propagatedFrom.map((p) => p.packageName).join(", ");
150
- lines.push(dim(` 0 commits (bumped via dependency: ${depNames})`));
151
- } else if (workspace.parsedCommitCount !== void 0 && workspace.parsedCommitCount > 0) {
152
- lines.push(dim(` Parsed ${workspace.parsedCommitCount} typed commits`));
153
- }
147
+ if (isPropagatedOnly && propagatedFrom !== undefined) {
148
+ const depNames = propagatedFrom.map((p) => p.packageName).join(', ');
149
+ lines.push(dim(` 0 commits (bumped via dependency: ${depNames})`));
150
+ }
151
+ else if (workspace.parsedCommitCount !== undefined && workspace.parsedCommitCount > 0) {
152
+ lines.push(dim(` Parsed ${workspace.parsedCommitCount} typed commits`));
153
+ }
154
154
  }
155
155
  function formatBumpLabels(lines, workspace, isPropagatedOnly) {
156
- if (workspace.setVersion !== void 0) {
157
- lines.push(` Using version override: ${workspace.setVersion}`);
158
- } else if (workspace.bumpOverride !== void 0 && !isPropagatedOnly) {
159
- lines.push(` Using bump override: ${workspace.bumpOverride}`);
160
- }
161
- if (workspace.releaseType !== void 0) {
162
- lines.push(dim(` Bumping versions (${workspace.releaseType})...`));
163
- } else if (workspace.setVersion !== void 0) {
164
- lines.push(dim(` Bumping versions (version override)...`));
165
- }
156
+ if (workspace.setVersion !== undefined) {
157
+ lines.push(` Using version override: ${workspace.setVersion}`);
158
+ }
159
+ else if (workspace.bumpOverride !== undefined && !isPropagatedOnly) {
160
+ lines.push(` Using bump override: ${workspace.bumpOverride}`);
161
+ }
162
+ if (workspace.releaseType !== undefined) {
163
+ lines.push(dim(` Bumping versions (${workspace.releaseType})...`));
164
+ }
165
+ else if (workspace.setVersion !== undefined) {
166
+ lines.push(dim(` Bumping versions (version override)...`));
167
+ }
166
168
  }
167
169
  function formatVersionLine(lines, workspace, propagatedFrom, isPropagatedOnly) {
168
- if (workspace.setVersion !== void 0) {
169
- lines.push(` \u{1F4E6} ${workspace.currentVersion} \u2192 ${bold(workspace.newVersion)} (version override)`);
170
- } else if (workspace.releaseType !== void 0) {
171
- const suffix = isPropagatedOnly ? formatPropagationSuffix(propagatedFrom) : "";
172
- lines.push(` \u{1F4E6} ${workspace.currentVersion} \u2192 ${bold(workspace.newVersion)} (${workspace.releaseType}${suffix})`);
173
- }
174
- }
175
- function formatBumpFiles(lines, workspace, dryRun, indent = "") {
176
- for (const file of workspace.bumpedFiles) {
177
- if (dryRun) {
178
- lines.push(dim(`${indent} [dry-run] Would bump ${file}`));
179
- } else {
180
- lines.push(dim(`${indent} Bumped ${file}`));
181
- }
182
- }
183
- }
184
- function formatChangelogFiles(lines, workspace, dryRun, indent = "") {
185
- for (const file of workspace.changelogFiles) {
186
- if (dryRun) {
187
- lines.push(dim(`${indent} [dry-run] Would run: npx --yes git-cliff ... --output ${file}`));
188
- } else {
189
- lines.push(dim(`${indent} Generating changelog: ${file}`));
190
- }
191
- }
192
- }
193
- function formatUnparseableWarning(lines, workspace, indent = "") {
194
- const unparseable = workspace.unparseableCommits;
195
- if (unparseable === void 0 || unparseable.length === 0) {
196
- return;
197
- }
198
- const count = unparseable.length;
199
- const isPatchFloor = workspace.parsedCommitCount === 0;
200
- const suffix = isPatchFloor ? " (defaulting to patch bump)" : "";
201
- lines.push(`${indent} \u26A0\uFE0F ${count} commit${count === 1 ? "" : "s"} could not be parsed${suffix}`);
202
- for (const commit of unparseable) {
203
- const shortHash = commit.hash.slice(0, 7);
204
- const truncatedMessage = commit.message.length > 72 ? `${commit.message.slice(0, 69)}...` : commit.message;
205
- lines.push(`${indent} \xB7 ${shortHash} ${truncatedMessage}`);
206
- }
207
- }
208
- function formatPolicyViolations(lines, violations, indent = "") {
209
- if (violations === void 0 || violations.length === 0) {
210
- return;
211
- }
212
- const count = violations.length;
213
- lines.push(`${indent} \u26A0\uFE0F ${count} policy violation${count === 1 ? "" : "s"}:`);
214
- for (const violation of violations) {
215
- const shortHash = violation.commitHash.slice(0, 7);
216
- const subject = violation.commitSubject;
217
- const truncatedSubject = subject.length > 72 ? `${subject.slice(0, 69)}...` : subject;
218
- lines.push(
219
- `${indent} \xB7 ${shortHash} '${truncatedSubject}' \u2014 type '${violation.type}' at ${violation.surface} surface`
220
- );
221
- }
170
+ if (workspace.setVersion !== undefined) {
171
+ lines.push(` 📦 ${workspace.currentVersion} → ${bold(workspace.newVersion)} (version override)`);
172
+ }
173
+ else if (workspace.releaseType !== undefined) {
174
+ const suffix = isPropagatedOnly ? formatPropagationSuffix(propagatedFrom) : '';
175
+ lines.push(` 📦 ${workspace.currentVersion} → ${bold(workspace.newVersion)} (${workspace.releaseType}${suffix})`);
176
+ }
177
+ }
178
+ function formatBumpFiles(lines, workspace, dryRun, indent = '') {
179
+ for (const file of workspace.bumpedFiles) {
180
+ if (dryRun) {
181
+ lines.push(dim(`${indent} [dry-run] Would bump ${file}`));
182
+ }
183
+ else {
184
+ lines.push(dim(`${indent} Bumped ${file}`));
185
+ }
186
+ }
187
+ }
188
+ function formatChangelogFiles(lines, workspace, dryRun, indent = '') {
189
+ for (const file of workspace.changelogFiles) {
190
+ if (dryRun) {
191
+ lines.push(dim(`${indent} [dry-run] Would run: npx --yes git-cliff ... --output ${file}`));
192
+ }
193
+ else {
194
+ lines.push(dim(`${indent} Generating changelog: ${file}`));
195
+ }
196
+ }
197
+ }
198
+ function formatUnparseableWarning(lines, workspace, indent = '') {
199
+ const unparseable = workspace.unparseableCommits;
200
+ if (unparseable === undefined || unparseable.length === 0) {
201
+ return;
202
+ }
203
+ const count = unparseable.length;
204
+ const isPatchFloor = workspace.parsedCommitCount === 0;
205
+ const suffix = isPatchFloor ? ' (defaulting to patch bump)' : '';
206
+ lines.push(`${indent} ⚠️ ${count} commit${count === 1 ? '' : 's'} could not be parsed${suffix}`);
207
+ for (const commit of unparseable) {
208
+ const shortHash = commit.hash.slice(0, 7);
209
+ const truncatedMessage = commit.message.length > 72 ? `${commit.message.slice(0, 69)}...` : commit.message;
210
+ lines.push(`${indent} · ${shortHash} ${truncatedMessage}`);
211
+ }
212
+ }
213
+ function formatPolicyViolations(lines, violations, indent = '') {
214
+ if (violations === undefined || violations.length === 0) {
215
+ return;
216
+ }
217
+ const count = violations.length;
218
+ lines.push(`${indent} ⚠️ ${count} policy violation${count === 1 ? '' : 's'}:`);
219
+ for (const violation of violations) {
220
+ const shortHash = violation.commitHash.slice(0, 7);
221
+ const subject = violation.commitSubject;
222
+ const truncatedSubject = subject.length > 72 ? `${subject.slice(0, 69)}...` : subject;
223
+ lines.push(`${indent} · ${shortHash} '${truncatedSubject}' — type '${violation.type}' at ${violation.surface} surface`);
224
+ }
222
225
  }
223
226
  function formatPropagationSuffix(propagatedFrom) {
224
- if (propagatedFrom === void 0 || propagatedFrom.length === 0) {
225
- return "";
226
- }
227
- const names = propagatedFrom.map((p) => p.packageName).join(", ");
228
- return `, dependency: ${names}`;
227
+ if (propagatedFrom === undefined || propagatedFrom.length === 0) {
228
+ return '';
229
+ }
230
+ const names = propagatedFrom.map((p) => p.packageName).join(', ');
231
+ return `, dependency: ${names}`;
229
232
  }
230
233
  function formatWarnings(lines, result) {
231
- const { warnings } = result;
232
- if (warnings === void 0 || warnings.length === 0) {
233
- return;
234
- }
235
- lines.push("");
236
- for (const warning of warnings) {
237
- lines.push(`\u26A0\uFE0F ${warning}`);
238
- }
234
+ const { warnings } = result;
235
+ if (warnings === undefined || warnings.length === 0) {
236
+ return;
237
+ }
238
+ lines.push('');
239
+ for (const warning of warnings) {
240
+ lines.push(`⚠️ ${warning}`);
241
+ }
239
242
  }
240
243
  function formatFormatCommand(lines, result) {
241
- if (result.formatCommand === void 0) {
242
- return;
243
- }
244
- if (result.formatCommand.executed) {
245
- lines.push(dim(`
246
- Running format command: ${result.formatCommand.command}`));
247
- } else {
248
- lines.push(dim(`
249
- [dry-run] Would run format command: ${result.formatCommand.command}`));
250
- }
251
- }
252
- export {
253
- reportPrepare
254
- };
244
+ if (result.formatCommand === undefined) {
245
+ return;
246
+ }
247
+ if (result.formatCommand.executed) {
248
+ lines.push(dim(`\n Running format command: ${result.formatCommand.command}`));
249
+ }
250
+ else {
251
+ lines.push(dim(`\n [dry-run] Would run format command: ${result.formatCommand.command}`));
252
+ }
253
+ }
@@ -1,25 +1,20 @@
1
- import { existsSync } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { findPackageRoot } from "@williamthorsen/nmr-core";
4
- function resolveCliffConfigPath(cliffConfigPath, metaUrl) {
5
- if (cliffConfigPath !== void 0) {
6
- return cliffConfigPath;
7
- }
8
- const candidates = [".config/git-cliff.toml", "cliff.toml"];
9
- for (const candidate of candidates) {
10
- if (existsSync(candidate)) {
11
- return candidate;
1
+ import { existsSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { findPackageRoot } from '@williamthorsen/nmr-core';
4
+ export function resolveCliffConfigPath(cliffConfigPath, metaUrl) {
5
+ if (cliffConfigPath !== undefined) {
6
+ return cliffConfigPath;
12
7
  }
13
- }
14
- const root = findPackageRoot(metaUrl);
15
- const bundledPath = resolve(root, "cliff.toml.template");
16
- if (existsSync(bundledPath)) {
17
- return bundledPath;
18
- }
19
- throw new Error(
20
- `Could not resolve a git-cliff config file. Searched: ${candidates.join(", ")}, and bundled template at ${bundledPath}`
21
- );
8
+ const candidates = ['.config/git-cliff.toml', 'cliff.toml'];
9
+ for (const candidate of candidates) {
10
+ if (existsSync(candidate)) {
11
+ return candidate;
12
+ }
13
+ }
14
+ const root = findPackageRoot(metaUrl);
15
+ const bundledPath = resolve(root, 'cliff.toml.template');
16
+ if (existsSync(bundledPath)) {
17
+ return bundledPath;
18
+ }
19
+ throw new Error(`Could not resolve a git-cliff config file. Searched: ${candidates.join(', ')}, and bundled template at ${bundledPath}`);
22
20
  }
23
- export {
24
- resolveCliffConfigPath
25
- };
@@ -1,2 +1,2 @@
1
- import type { ResolvedTag } from './resolveReleaseTags.ts';
1
+ import type { ResolvedTag } from './resolveReleaseTags.js';
2
2
  export declare function resolveCommandTags(tags: string[] | undefined): Promise<ResolvedTag[]>;