@williamthorsen/release-kit 16.1.2 → 17.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 (86) hide show
  1. package/.meta/changelog.json +62 -0
  2. package/.readyup/kits/default.js +2 -2
  3. package/.readyup/kits/npm-auto-publish.js +1 -1
  4. package/.readyup/manifest.json +204 -16
  5. package/CHANGELOG.md +22 -0
  6. package/README.md +7 -2
  7. package/bin/release-kit.js +1 -1
  8. package/dist/esm/assertReleasesOnNpm.js +1 -2
  9. package/dist/esm/assertTarballsComplete.js +2 -3
  10. package/dist/esm/bin.d.ts +2 -0
  11. package/dist/esm/bin.js +1 -0
  12. package/dist/esm/changelogJsonUtils.js +2 -1
  13. package/dist/esm/cli/commandKit.d.ts +18 -0
  14. package/dist/esm/cli/commandKit.js +27 -0
  15. package/dist/esm/cli/maintenanceCommands.d.ts +6 -0
  16. package/dist/esm/cli/maintenanceCommands.js +129 -0
  17. package/dist/esm/cli/releaseCommands.d.ts +7 -0
  18. package/dist/esm/cli/releaseCommands.js +156 -0
  19. package/dist/esm/cli.js +4 -3
  20. package/dist/esm/commitCommand.d.ts +4 -1
  21. package/dist/esm/commitCommand.js +2 -6
  22. package/dist/esm/createGithubReleaseCommand.d.ts +10 -4
  23. package/dist/esm/createGithubReleaseCommand.js +2 -15
  24. package/dist/esm/deriveDirectoryConfig.js +1 -2
  25. package/dist/esm/deriveWorkspaceConfig.js +1 -2
  26. package/dist/esm/detectPackageManager.js +1 -1
  27. package/dist/esm/findMissingManifestPaths.js +1 -1
  28. package/dist/esm/hasPrettierConfig.js +1 -1
  29. package/dist/esm/init/parseJsonRecord.js +1 -1
  30. package/dist/esm/isPublishableManifest.js +1 -1
  31. package/dist/esm/loadChangelogOverrides.js +1 -1
  32. package/dist/esm/loadConfig.js +1 -2
  33. package/dist/esm/loadValidatedConfig.d.ts +6 -1
  34. package/dist/esm/loadValidatedConfig.js +11 -3
  35. package/dist/esm/npmRegistry.js +1 -1
  36. package/dist/esm/packFromCleanCheckout.js +1 -2
  37. package/dist/esm/parseChangeRecordBlock.js +1 -1
  38. package/dist/esm/prepareArgs.d.ts +1 -49
  39. package/dist/esm/prepareArgs.js +4 -51
  40. package/dist/esm/prepareCommand.d.ts +15 -3
  41. package/dist/esm/prepareCommand.js +15 -23
  42. package/dist/esm/publishCommand.d.ts +12 -3
  43. package/dist/esm/publishCommand.js +1 -16
  44. package/dist/esm/pushCommand.d.ts +12 -4
  45. package/dist/esm/pushCommand.js +2 -16
  46. package/dist/esm/resolveCommandTags.d.ts +3 -3
  47. package/dist/esm/resolveCommandTags.js +5 -7
  48. package/dist/esm/{resolveStylesOrExit.d.ts → resolveStyles.d.ts} +2 -2
  49. package/dist/esm/resolveStyles.js +10 -0
  50. package/dist/esm/route.d.ts +2 -0
  51. package/dist/esm/route.js +39 -0
  52. package/dist/esm/showTagPrefixesCommand.js +2 -1
  53. package/dist/esm/sync-labels/generateCommand.js +7 -6
  54. package/dist/esm/sync-labels/presets.js +1 -2
  55. package/dist/esm/sync-labels/retiredConfig.js +2 -1
  56. package/dist/esm/sync-labels/syncCommand.js +4 -3
  57. package/dist/esm/tagCommand.d.ts +8 -3
  58. package/dist/esm/tagCommand.js +1 -7
  59. package/dist/esm/typeGuards.d.ts +0 -2
  60. package/dist/esm/typeGuards.js +0 -3
  61. package/dist/esm/validateConfig.js +1 -1
  62. package/dist/esm/validateOverridesCommand.js +5 -4
  63. package/docs/configuration.md +1 -1
  64. package/docs/editorial-overrides.md +2 -0
  65. package/docs/labels.md +2 -0
  66. package/docs/releasing.md +1 -1
  67. package/package.json +3 -3
  68. package/dist/esm/configFlagSchema.d.ts +0 -12
  69. package/dist/esm/configFlagSchema.js +0 -3
  70. package/dist/esm/help/initHelp.d.ts +0 -4
  71. package/dist/esm/help/initHelp.js +0 -31
  72. package/dist/esm/help/overridesHelp.d.ts +0 -4
  73. package/dist/esm/help/overridesHelp.js +0 -32
  74. package/dist/esm/help/prepareHelp.d.ts +0 -7
  75. package/dist/esm/help/prepareHelp.js +0 -30
  76. package/dist/esm/help/releaseStepsHelp.d.ts +0 -12
  77. package/dist/esm/help/releaseStepsHelp.js +0 -91
  78. package/dist/esm/help/syncLabelsHelp.d.ts +0 -8
  79. package/dist/esm/help/syncLabelsHelp.js +0 -55
  80. package/dist/esm/help/usage.d.ts +0 -2
  81. package/dist/esm/help/usage.js +0 -29
  82. package/dist/esm/resolveConfigFlag.d.ts +0 -7
  83. package/dist/esm/resolveConfigFlag.js +0 -4
  84. package/dist/esm/resolveStylesOrExit.js +0 -10
  85. package/dist/esm/runCli.d.ts +0 -5
  86. package/dist/esm/runCli.js +0 -224
@@ -1,224 +0,0 @@
1
- import { parseArgsOrExit, reportError, resolveSelfVersion } from '@williamthorsen/nmr-core';
2
- import { commitCommand } from "./commitCommand.js";
3
- import { configFlagSchema } from "./configFlagSchema.js";
4
- import { createGithubReleaseCommand } from "./createGithubReleaseCommand.js";
5
- import { enterRepoRoot } from "./enterRepoRoot.js";
6
- import { showInitHelp, showUpdateTemplatesHelp } from "./help/initHelp.js";
7
- import { showOverridesHelp, showOverridesValidateHelp } from "./help/overridesHelp.js";
8
- import { showPrepareHelp } from "./help/prepareHelp.js";
9
- import { showCommitHelp, showCreateGithubReleaseHelp, showPublishHelp, showPushHelp, showShowTagPrefixesHelp, showTagHelp, } from "./help/releaseStepsHelp.js";
10
- import { showSyncLabelsGenerateHelp, showSyncLabelsHelp, showSyncLabelsInitHelp, showSyncLabelsSyncHelp, } from "./help/syncLabelsHelp.js";
11
- import { showUsage } from "./help/usage.js";
12
- import { initCommand } from "./init/initCommand.js";
13
- import { updateTemplatesCommand } from "./init/updateTemplatesCommand.js";
14
- import { prepareCommand } from "./prepareCommand.js";
15
- import { publishCommand } from "./publishCommand.js";
16
- import { pushCommand } from "./pushCommand.js";
17
- import { resolveConfigFlag } from "./resolveConfigFlag.js";
18
- import { resolveStylesOrExit } from "./resolveStylesOrExit.js";
19
- import { showTagPrefixesCommand } from "./showTagPrefixesCommand.js";
20
- import { generateCommand } from "./sync-labels/generateCommand.js";
21
- import { syncLabelsInitCommand } from "./sync-labels/initCommand.js";
22
- import { syncLabelsCommand } from "./sync-labels/syncCommand.js";
23
- import { tagCommand } from "./tagCommand.js";
24
- import { validateOverridesCommand } from "./validateOverridesCommand.js";
25
- const VERSION = resolveSelfVersion(import.meta.url);
26
- export async function runCli(args) {
27
- const command = args[0];
28
- if (command === '--version' || command === '-V') {
29
- console.info(VERSION);
30
- process.exit(0);
31
- }
32
- if (command === undefined || ['--help', '-h'].includes(command)) {
33
- showUsage();
34
- process.exit(0);
35
- }
36
- const flags = args.slice(1);
37
- const styles = resolveStylesOrExit({
38
- env: process.env,
39
- stderrIsTty: process.stderr.isTTY,
40
- stdoutIsTty: process.stdout.isTTY,
41
- });
42
- if (command === 'prepare') {
43
- if (flags.some((f) => f === '--help' || f === '-h')) {
44
- showPrepareHelp();
45
- process.exit(0);
46
- }
47
- const { invocationDir } = enterRepoRoot();
48
- await prepareCommand(flags, styles, invocationDir);
49
- process.exit(0);
50
- }
51
- if (command === 'commit') {
52
- if (flags.some((f) => f === '--help' || f === '-h')) {
53
- showCommitHelp();
54
- process.exit(0);
55
- }
56
- enterRepoRoot();
57
- commitCommand(flags);
58
- process.exit(0);
59
- }
60
- if (command === 'tag') {
61
- if (flags.some((f) => f === '--help' || f === '-h')) {
62
- showTagHelp();
63
- process.exit(0);
64
- }
65
- enterRepoRoot();
66
- tagCommand(flags, styles);
67
- process.exit(0);
68
- }
69
- if (command === 'push') {
70
- if (flags.some((f) => f === '--help' || f === '-h')) {
71
- showPushHelp();
72
- process.exit(0);
73
- }
74
- const { invocationDir } = enterRepoRoot();
75
- await pushCommand(flags, styles, invocationDir);
76
- process.exit(0);
77
- }
78
- if (command === 'create-github-release') {
79
- if (flags.some((f) => f === '--help' || f === '-h')) {
80
- showCreateGithubReleaseHelp();
81
- process.exit(0);
82
- }
83
- const { invocationDir } = enterRepoRoot();
84
- await createGithubReleaseCommand(flags, styles, invocationDir);
85
- process.exit(0);
86
- }
87
- if (command === 'publish') {
88
- if (flags.some((f) => f === '--help' || f === '-h')) {
89
- showPublishHelp();
90
- process.exit(0);
91
- }
92
- const { invocationDir } = enterRepoRoot();
93
- await publishCommand(flags, styles, invocationDir);
94
- process.exit(0);
95
- }
96
- if (command === 'show-tag-prefixes') {
97
- if (flags.some((f) => f === '--help' || f === '-h')) {
98
- showShowTagPrefixesHelp();
99
- process.exit(0);
100
- }
101
- const { invocationDir } = enterRepoRoot();
102
- const { config } = parseArgsOrExit(flags, configFlagSchema).flags;
103
- const exitCode = await showTagPrefixesCommand(styles, resolveConfigFlag(config, invocationDir));
104
- process.exit(exitCode);
105
- }
106
- if (command === 'init') {
107
- if (flags.some((f) => f === '--help' || f === '-h')) {
108
- showInitHelp();
109
- process.exit(0);
110
- }
111
- enterRepoRoot();
112
- const initFlagSchema = {
113
- isDryRun: { long: '--dry-run', type: 'boolean' },
114
- shouldForce: { long: '--force', type: 'boolean' },
115
- shouldScaffoldConfig: { long: '--with-config', type: 'boolean' },
116
- };
117
- const { isDryRun, shouldForce, shouldScaffoldConfig } = parseArgsOrExit(flags, initFlagSchema).flags;
118
- const exitCode = initCommand({ isDryRun, shouldForce, styles, shouldScaffoldConfig });
119
- process.exit(exitCode);
120
- }
121
- if (command === 'update-templates') {
122
- if (flags.some((f) => f === '--help' || f === '-h')) {
123
- showUpdateTemplatesHelp();
124
- process.exit(0);
125
- }
126
- enterRepoRoot();
127
- const updateTemplatesFlagSchema = {
128
- isDryRun: { long: '--dry-run', type: 'boolean' },
129
- };
130
- const { isDryRun } = parseArgsOrExit(flags, updateTemplatesFlagSchema).flags;
131
- const exitCode = updateTemplatesCommand({ isDryRun, styles });
132
- process.exit(exitCode);
133
- }
134
- if (command === 'sync-labels') {
135
- const subcommand = flags[0];
136
- if (subcommand === undefined || ['--help', '-h'].includes(subcommand)) {
137
- showSyncLabelsHelp();
138
- process.exit(0);
139
- }
140
- const subflags = flags.slice(1);
141
- if (subcommand === 'init') {
142
- if (subflags.some((f) => f === '--help' || f === '-h')) {
143
- showSyncLabelsInitHelp();
144
- process.exit(0);
145
- }
146
- const { invocationDir } = enterRepoRoot();
147
- const syncLabelsInitFlagSchema = {
148
- ...configFlagSchema,
149
- isDryRun: { long: '--dry-run', type: 'boolean' },
150
- shouldForce: { long: '--force', type: 'boolean' },
151
- };
152
- const { config, isDryRun, shouldForce } = parseArgsOrExit(subflags, syncLabelsInitFlagSchema).flags;
153
- const configPath = resolveConfigFlag(config, invocationDir);
154
- const exitCode = await syncLabelsInitCommand({
155
- ...(configPath !== undefined && { configPath }),
156
- isDryRun,
157
- shouldForce,
158
- styles,
159
- });
160
- process.exit(exitCode);
161
- }
162
- if (subcommand === 'generate') {
163
- if (subflags.some((f) => f === '--help' || f === '-h')) {
164
- showSyncLabelsGenerateHelp();
165
- process.exit(0);
166
- }
167
- const { invocationDir } = enterRepoRoot();
168
- const generateFlagSchema = {
169
- ...configFlagSchema,
170
- shouldCheck: { long: '--check', type: 'boolean' },
171
- };
172
- const { shouldCheck, config } = parseArgsOrExit(subflags, generateFlagSchema).flags;
173
- const configPath = resolveConfigFlag(config, invocationDir);
174
- const exitCode = await generateCommand({ shouldCheck, ...(configPath !== undefined && { configPath }), styles });
175
- process.exit(exitCode);
176
- }
177
- if (subcommand === 'sync') {
178
- if (subflags.some((f) => f === '--help' || f === '-h')) {
179
- showSyncLabelsSyncHelp();
180
- process.exit(0);
181
- }
182
- if (subflags.length > 0) {
183
- reportError(`Unknown option: ${subflags[0]}`);
184
- process.exit(1);
185
- }
186
- enterRepoRoot();
187
- const exitCode = syncLabelsCommand();
188
- process.exit(exitCode);
189
- }
190
- reportError(`Unknown subcommand: ${subcommand}`);
191
- showSyncLabelsHelp();
192
- process.exit(1);
193
- }
194
- if (command === 'overrides') {
195
- const subcommand = flags[0];
196
- if (subcommand === undefined || ['--help', '-h'].includes(subcommand)) {
197
- showOverridesHelp();
198
- process.exit(0);
199
- }
200
- const subflags = flags.slice(1);
201
- if (subcommand === 'validate') {
202
- if (subflags.some((f) => f === '--help' || f === '-h')) {
203
- showOverridesValidateHelp();
204
- process.exit(0);
205
- }
206
- const { invocationDir } = enterRepoRoot();
207
- const { config } = parseArgsOrExit(subflags, configFlagSchema).flags;
208
- const result = await validateOverridesCommand(styles, resolveConfigFlag(config, invocationDir));
209
- if (result.exitCode === 0) {
210
- console.info(result.message);
211
- }
212
- else {
213
- process.stderr.write(`${result.message}\n`);
214
- }
215
- process.exit(result.exitCode);
216
- }
217
- reportError(`Unknown subcommand: ${subcommand}`);
218
- showOverridesHelp();
219
- process.exit(1);
220
- }
221
- reportError(`Unknown command: ${command}`);
222
- showUsage();
223
- process.exit(1);
224
- }