@williamthorsen/release-kit 16.1.1 → 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 (116) hide show
  1. package/.meta/changelog.json +79 -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 +28 -0
  6. package/README.md +7 -2
  7. package/bin/release-kit.js +1 -1
  8. package/dist/esm/assertCleanWorkingTree.js +14 -7
  9. package/dist/esm/assertReleasesOnNpm.js +11 -3
  10. package/dist/esm/assertTaggedBaseline.js +2 -1
  11. package/dist/esm/assertTarballsComplete.js +16 -5
  12. package/dist/esm/bin.d.ts +2 -0
  13. package/dist/esm/bin.js +1 -0
  14. package/dist/esm/buildChangelogEntries.js +2 -2
  15. package/dist/esm/buildDependencyGraph.js +5 -4
  16. package/dist/esm/bumpVersion.js +3 -2
  17. package/dist/esm/changelogJsonUtils.js +2 -1
  18. package/dist/esm/changelogOverrides.js +3 -2
  19. package/dist/esm/cli/commandKit.d.ts +18 -0
  20. package/dist/esm/cli/commandKit.js +27 -0
  21. package/dist/esm/cli/maintenanceCommands.d.ts +6 -0
  22. package/dist/esm/cli/maintenanceCommands.js +129 -0
  23. package/dist/esm/cli/releaseCommands.d.ts +7 -0
  24. package/dist/esm/cli/releaseCommands.js +156 -0
  25. package/dist/esm/cli.js +9 -237
  26. package/dist/esm/commitCommand.d.ts +4 -1
  27. package/dist/esm/commitCommand.js +12 -10
  28. package/dist/esm/compareVersions.js +2 -1
  29. package/dist/esm/createGithubRelease.js +7 -1
  30. package/dist/esm/createGithubReleaseCommand.d.ts +10 -4
  31. package/dist/esm/createGithubReleaseCommand.js +4 -18
  32. package/dist/esm/createTags.js +6 -4
  33. package/dist/esm/deleteFileIfExists.js +2 -1
  34. package/dist/esm/deriveDirectoryConfig.js +7 -7
  35. package/dist/esm/deriveWorkspaceConfig.js +4 -4
  36. package/dist/esm/detectPackageManager.js +1 -1
  37. package/dist/esm/enterRepoRoot.js +2 -1
  38. package/dist/esm/enumerateReleaseWindows.js +2 -2
  39. package/dist/esm/findMissingManifestPaths.js +1 -1
  40. package/dist/esm/hasPrettierConfig.js +1 -1
  41. package/dist/esm/init/initCommand.js +10 -1
  42. package/dist/esm/init/parseJsonRecord.js +1 -1
  43. package/dist/esm/init/updateTemplatesCommand.js +10 -1
  44. package/dist/esm/isPublishableManifest.js +1 -1
  45. package/dist/esm/loadChangelogOverrides.js +1 -1
  46. package/dist/esm/loadConfig.js +6 -6
  47. package/dist/esm/loadValidatedConfig.d.ts +6 -1
  48. package/dist/esm/loadValidatedConfig.js +11 -3
  49. package/dist/esm/mergeConfig.js +5 -4
  50. package/dist/esm/monorepoConfigAssertions.js +6 -5
  51. package/dist/esm/npmRegistry.js +1 -1
  52. package/dist/esm/packFromCleanCheckout.js +12 -4
  53. package/dist/esm/parseChangeRecordBlock.js +1 -1
  54. package/dist/esm/planVersionBump.js +6 -5
  55. package/dist/esm/prepareArgs.d.ts +1 -49
  56. package/dist/esm/prepareArgs.js +4 -51
  57. package/dist/esm/prepareCommand.d.ts +15 -3
  58. package/dist/esm/prepareCommand.js +26 -44
  59. package/dist/esm/prepareComposite.js +2 -1
  60. package/dist/esm/prepareRunContext.js +2 -2
  61. package/dist/esm/previewTagPrefixes.js +2 -2
  62. package/dist/esm/publish.js +7 -1
  63. package/dist/esm/publishCommand.d.ts +12 -3
  64. package/dist/esm/publishCommand.js +4 -33
  65. package/dist/esm/pushCommand.d.ts +12 -4
  66. package/dist/esm/pushCommand.js +6 -27
  67. package/dist/esm/pushRelease.js +18 -6
  68. package/dist/esm/releaseFiles.js +2 -2
  69. package/dist/esm/releasePlan.js +2 -2
  70. package/dist/esm/resolveCommandTags.d.ts +4 -4
  71. package/dist/esm/resolveCommandTags.js +8 -12
  72. package/dist/esm/resolveReleaseDeclaration.js +9 -8
  73. package/dist/esm/resolveReleaseTags.js +11 -4
  74. package/dist/esm/resolveReleaseTargets.js +2 -1
  75. package/dist/esm/{resolveStylesOrExit.d.ts → resolveStyles.d.ts} +2 -2
  76. package/dist/esm/resolveStyles.js +10 -0
  77. package/dist/esm/route.d.ts +2 -0
  78. package/dist/esm/route.js +39 -0
  79. package/dist/esm/showTagPrefixesCommand.js +6 -3
  80. package/dist/esm/sync-labels/generateCommand.js +11 -7
  81. package/dist/esm/sync-labels/initCommand.js +7 -1
  82. package/dist/esm/sync-labels/presets.js +7 -8
  83. package/dist/esm/sync-labels/resolveLabels.js +4 -3
  84. package/dist/esm/sync-labels/retiredConfig.js +2 -1
  85. package/dist/esm/sync-labels/syncCommand.js +4 -3
  86. package/dist/esm/sync-labels/templates.js +2 -2
  87. package/dist/esm/tagCommand.d.ts +8 -3
  88. package/dist/esm/tagCommand.js +2 -15
  89. package/dist/esm/typeGuards.d.ts +0 -2
  90. package/dist/esm/typeGuards.js +0 -3
  91. package/dist/esm/user-error-chaining.d.ts +13 -0
  92. package/dist/esm/user-error-chaining.js +11 -0
  93. package/dist/esm/validateConfig.js +1 -1
  94. package/dist/esm/validateOverridesCommand.js +12 -5
  95. package/docs/configuration.md +1 -1
  96. package/docs/editorial-overrides.md +2 -0
  97. package/docs/labels.md +2 -0
  98. package/docs/releasing.md +1 -1
  99. package/package.json +3 -3
  100. package/dist/esm/configFlagSchema.d.ts +0 -12
  101. package/dist/esm/configFlagSchema.js +0 -3
  102. package/dist/esm/help/initHelp.d.ts +0 -4
  103. package/dist/esm/help/initHelp.js +0 -31
  104. package/dist/esm/help/overridesHelp.d.ts +0 -4
  105. package/dist/esm/help/overridesHelp.js +0 -32
  106. package/dist/esm/help/prepareHelp.d.ts +0 -7
  107. package/dist/esm/help/prepareHelp.js +0 -30
  108. package/dist/esm/help/releaseStepsHelp.d.ts +0 -12
  109. package/dist/esm/help/releaseStepsHelp.js +0 -91
  110. package/dist/esm/help/syncLabelsHelp.d.ts +0 -8
  111. package/dist/esm/help/syncLabelsHelp.js +0 -55
  112. package/dist/esm/help/usage.d.ts +0 -2
  113. package/dist/esm/help/usage.js +0 -29
  114. package/dist/esm/resolveConfigFlag.d.ts +0 -7
  115. package/dist/esm/resolveConfigFlag.js +0 -4
  116. package/dist/esm/resolveStylesOrExit.js +0 -10
@@ -0,0 +1,13 @@
1
+ import { UserError } from '@williamthorsen/nmr-core';
2
+ /**
3
+ * Returns `error` as a `UserError` with the same message, for a failure that the tool anticipates, such as a failed
4
+ * external command.
5
+ */
6
+ export declare function asUserError(error: unknown): UserError;
7
+ /** Wraps an anticipated failure as a `UserError` that reads `<message>: <cause's message>`. */
8
+ export declare function chainUserError(message: string, cause: unknown): UserError;
9
+ /**
10
+ * Prefixes an anticipated failure (see `isAnticipatedFailure`) with `<message>: ` as a `UserError`, and returns any
11
+ * other value unchanged, so that a crash keeps its own stack when rethrown.
12
+ */
13
+ export declare function prefixUserError(message: string, error: unknown): unknown;
@@ -0,0 +1,11 @@
1
+ import { isAnticipatedFailure, UserError } from '@williamthorsen/nmr-core';
2
+ import { describeError } from '@williamthorsen/toolbelt.errors';
3
+ export function asUserError(error) {
4
+ return error instanceof UserError ? error : new UserError(describeError(error), { cause: error });
5
+ }
6
+ export function chainUserError(message, cause) {
7
+ return new UserError(`${message}: ${describeError(cause)}`, { cause });
8
+ }
9
+ export function prefixUserError(message, error) {
10
+ return isAnticipatedFailure(error) ? chainUserError(message, error) : error;
11
+ }
@@ -1,5 +1,5 @@
1
+ import { isRecord } from '@williamthorsen/nmr-core';
1
2
  import { releaseKitConfigSchema } from "./configSchema.js";
2
- import { isRecord } from "./typeGuards.js";
3
3
  export function validateConfig(rawConfig) {
4
4
  if (!isRecord(rawConfig)) {
5
5
  return { config: {}, errors: ['Config must be an object'], warnings: [] };
@@ -1,5 +1,6 @@
1
- import { formatErrorLine, formatStatusLine } from '@williamthorsen/nmr-core';
1
+ import { formatErrorLine, formatStatusLine, isAnticipatedFailure, } from '@williamthorsen/nmr-core';
2
2
  import { describeError } from '@williamthorsen/toolbelt.errors';
3
+ import { BIN } from "./bin.js";
3
4
  import { buildChangelogEntries } from "./buildChangelogEntries.js";
4
5
  import { resolveOverridePath } from "./changelogOverrides.js";
5
6
  import { describeEmptyWorkspace, discoverWorkspaces } from "./discoverWorkspaces.js";
@@ -23,12 +24,15 @@ export async function validateOverridesCommand(styles, configPath, dependencies
23
24
  workspace = discover();
24
25
  }
25
26
  catch (error) {
26
- return { exitCode: 2, message: formatErrorLine(`Failed to discover workspaces: ${describeError(error)}`) };
27
+ if (!isAnticipatedFailure(error)) {
28
+ throw error;
29
+ }
30
+ return { exitCode: 2, message: formatErrorLine(BIN, `Failed to discover workspaces: ${describeError(error)}`) };
27
31
  }
28
32
  if (workspace.kind === 'empty') {
29
33
  return {
30
34
  exitCode: 2,
31
- message: formatErrorLine(`No workspace package to validate. ${describeEmptyWorkspace(workspace)}`),
35
+ message: formatErrorLine(BIN, `No workspace package to validate. ${describeEmptyWorkspace(workspace)}`),
32
36
  };
33
37
  }
34
38
  let inputs;
@@ -36,7 +40,10 @@ export async function validateOverridesCommand(styles, configPath, dependencies
36
40
  inputs = buildValidationInputs(resolveReleaseTargets(userConfig, workspace), buildEntries);
37
41
  }
38
42
  catch (error) {
39
- return { exitCode: 2, message: formatErrorLine(`Failed to resolve overrides scope: ${describeError(error)}`) };
43
+ if (!isAnticipatedFailure(error)) {
44
+ throw error;
45
+ }
46
+ return { exitCode: 2, message: formatErrorLine(BIN, `Failed to resolve overrides scope: ${describeError(error)}`) };
40
47
  }
41
48
  const result = validate(inputs);
42
49
  return formatValidateOverridesResult(result, styles.stderr);
@@ -84,7 +91,7 @@ function flattenEntriesToItems(entries) {
84
91
  }
85
92
  function formatConfigProblem(problem) {
86
93
  return problem.kind === 'load'
87
- ? formatErrorLine(`Failed to load config: ${problem.message}`)
94
+ ? formatErrorLine(BIN, `Failed to load config: ${problem.message}`)
88
95
  : `Invalid config:\n - ${problem.errors.join('\n - ')}`;
89
96
  }
90
97
  function buildValidationInputs({ targets, settings }, buildEntries) {
@@ -193,7 +193,7 @@ The `RELEASE_KIT_OUTPUT_STYLE` environment variable sets the style for every com
193
193
  | `plain` | Print plain on both streams. |
194
194
  | `rich` | Print rich on both streams, even in a pipe or under CI. |
195
195
 
196
- Any other value is a usage error: release-kit reports it and exits with code 1.
196
+ Any other value is a usage error: release-kit reports it and exits with code 2.
197
197
 
198
198
  The variable outranks detection. Under `auto`, release-kit defers to detection, which reads `CI`, then the stream, then `TERM`. A stream is plain when any of these holds, and rich otherwise:
199
199
 
@@ -162,6 +162,8 @@ An override file references it from its top-level `$schema` key:
162
162
  }
163
163
  ```
164
164
 
165
+ release-kit also ships the schema in its package. A project that lists `@williamthorsen/release-kit` as a direct dependency can reference the installed version by a path relative to the override file: `../node_modules/@williamthorsen/release-kit/schemas/changelog-overrides.json` from `.meta/changelog-overrides.json`, and `../../../node_modules/@williamthorsen/release-kit/schemas/changelog-overrides.json` from a workspace's `packages/<ws>/.meta/changelog-overrides.json`. pnpm links only direct dependencies into a project's `node_modules`, so the path does not resolve when release-kit runs through `pnpm dlx` or `npx`.
166
+
165
167
  The schema states the key form and the entry fields. It accepts `audience` values `'all'` and `'dev'`, which the file format declares; the loader still rejects them (see below).
166
168
 
167
169
  ## Audience semantics: v1 supports `'skip'` only
package/docs/labels.md CHANGED
@@ -125,4 +125,6 @@ Consumers reference it from the top of their `.meta/label-map.json`:
125
125
  }
126
126
  ```
127
127
 
128
+ change-grammar also ships the schema in its package. A project that lists `@williamthorsen/change-grammar` as a direct devDependency can reference the installed version as `../node_modules/@williamthorsen/change-grammar/schemas/label-map.json`, relative to `.meta/label-map.json`. release-kit depends on change-grammar, but pnpm links only direct dependencies into a project's `node_modules`, so the path does not resolve through release-kit alone; the URL works either way.
129
+
128
130
  Earlier releases published the same schema from release-kit, and URLs under existing `release-kit-v*` tags keep resolving. release-kit does not generate `.meta/label-map.json`; change-grammar's `deriveLabelMap` derives one from the taxonomy, the workspace scopes, and the caller's statement of whether the repo is a monorepo, which decides the `root` scope.
package/docs/releasing.md CHANGED
@@ -65,7 +65,7 @@ Before it writes any file, and in a dry run as well, `prepare` asks npm about ea
65
65
 
66
66
  ### Packages whose tarball would lack a manifest file
67
67
 
68
- Before it writes any file, and in a dry run as well, `prepare` packs each publishable package that the release includes as the publish workflow would: It clones HEAD into a temporary directory, runs the package manager's frozen install there, runs the package's `prepublishOnly` script when it declares one, and packs the package. Build output in the working tree therefore does not count, and the check adds the time of one install and one build to every release. `prepare` refuses the release when a tarball lacks a file named by the package's `main`, `types`, `bin`, or `exports`, and names each package with each missing path and the manifest field that names it. The usual fix is to build the files in the package's publish lifecycle, such as in a `prepack` script. A failed install or build in the clean checkout also refuses the release, with the failing step's output.
68
+ Before it writes any file, and in a dry run as well, `prepare` packs each publishable package that the release includes as the publish workflow would: It clones HEAD into a temporary directory, runs the package manager's frozen install there, runs the package's `prepublishOnly` script when it declares one, and packs the package. Build output in the working tree therefore does not count, and the check adds the time of one install and one build to every release. `prepare` refuses the release when a tarball lacks a file named by the package's `main`, `types`, `bin`, or `exports`, and names each package with each missing path and the manifest field that names it. The usual fix is to build the files in the package's `prepublishOnly` script, as `"prepublishOnly": "nmr build"` does. A failed install or build in the clean checkout also refuses the release, with the failing step's output.
69
69
 
70
70
  A target under the `source` export condition is exempt, and so is a target under a condition listed in [`devExportConditions`](configuration.md#releasekitconfig-reference), which declares the conditions that resolve only inside the repo. [`publish`](publishing.md#tarball-check) runs the same check before it publishes any package.
71
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/release-kit",
3
- "version": "16.1.1",
3
+ "version": "17.0.0",
4
4
  "description": "Version-bumping and changelog-generation toolkit for release workflows",
5
5
  "keywords": [
6
6
  "changelog",
@@ -51,8 +51,8 @@
51
51
  "templates"
52
52
  ],
53
53
  "dependencies": {
54
- "@williamthorsen/change-grammar": "0.3.0",
55
- "@williamthorsen/nmr-core": "0.15.0",
54
+ "@williamthorsen/change-grammar": "0.3.1",
55
+ "@williamthorsen/nmr-core": "0.16.0",
56
56
  "@williamthorsen/toolbelt.errors": "0.9.0",
57
57
  "json-stringify-pretty-compact": "4.0.0",
58
58
  "semver": "7.8.6",
@@ -1,12 +0,0 @@
1
- /**
2
- * The `--config` flag, shared by every subcommand that reads the config file.
3
- *
4
- * Spread into a subcommand's own schema rather than repeated, so that the subcommands cannot drift to different
5
- * spellings of one flag.
6
- */
7
- export declare const configFlagSchema: {
8
- config: {
9
- long: string;
10
- type: "string";
11
- };
12
- };
@@ -1,3 +0,0 @@
1
- export const configFlagSchema = {
2
- config: { long: '--config', type: 'string' },
3
- };
@@ -1,4 +0,0 @@
1
- /** Prints the `init` command's help text. */
2
- export declare function showInitHelp(): void;
3
- /** Prints the `update-templates` command's help text. */
4
- export declare function showUpdateTemplatesHelp(): void;
@@ -1,31 +0,0 @@
1
- export function showInitHelp() {
2
- console.info(`
3
- Usage: release-kit init [options]
4
-
5
- Initialize release-kit in the current repository.
6
- By default, scaffolds only the GitHub Actions workflow files. When every
7
- package is private, skips publish.yaml and create-github-release.yaml.
8
-
9
- Options:
10
- --with-config Also scaffold .config/release-kit.config.ts
11
- --force Overwrite existing files instead of skipping them
12
- --dry-run Preview changes without writing files
13
- --help, -h Show this help message
14
- `);
15
- }
16
- export function showUpdateTemplatesHelp() {
17
- console.info(`
18
- Usage: release-kit update-templates [options]
19
-
20
- Update the GitHub Actions workflows that release-kit scaffolds to the templates
21
- of the installed version, showing what changed in each file. Creates a missing
22
- workflow that \`init\` would create, and refreshes sync-labels.yaml only when it
23
- exists. When every package is private, refreshes publish.yaml and
24
- create-github-release.yaml only when they exist. Keeps publish.yaml's provenance
25
- setting. Never touches config files.
26
-
27
- Options:
28
- --dry-run Preview changes without writing files
29
- --help, -h Show this help message
30
- `);
31
- }
@@ -1,4 +0,0 @@
1
- /** Prints the `overrides` command's help text. */
2
- export declare function showOverridesHelp(): void;
3
- /** Prints the `overrides validate` subcommand's help text. */
4
- export declare function showOverridesValidateHelp(): void;
@@ -1,32 +0,0 @@
1
- export function showOverridesHelp() {
2
- console.info(`
3
- Usage: release-kit overrides <subcommand> [options]
4
-
5
- Manage editorial changelog overrides.
6
-
7
- Subcommands:
8
- validate Validate every \`.meta/changelog-overrides.json\` file across all scopes
9
-
10
- Options:
11
- --help, -h Show this help message
12
- `);
13
- }
14
- export function showOverridesValidateHelp() {
15
- console.info(`
16
- Usage: release-kit overrides validate
17
-
18
- Validate every \`.meta/changelog-overrides.json\` file across the project and per-workspace
19
- scopes. Reports schema/parse errors, ambiguous-prefix errors, conflicting-key errors, and
20
- stale-key warnings.
21
-
22
- Exit codes:
23
- 0 Clean: no errors, no stale keys
24
- 1 Stale-key warnings only (no errors)
25
- 2 Schema/parse, ambiguous-prefix, or conflicting-key errors (errors take precedence)
26
-
27
- Options:
28
- --config <path> Config file, relative to the current directory
29
- (default: .config/release-kit.config.ts at the repo root)
30
- --help, -h Show this help message
31
- `);
32
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Help text for `release-kit prepare`. The module does not have any import-time side effects, so that a test can
3
- * import it without running the CLI.
4
- */
5
- export declare const prepareHelpText = "\nUsage: release-kit prepare [options]\n\nRun release preparation with automatic workspace discovery.\n\nOptions:\n --config <path> Config file, relative to the current directory\n (default: .config/release-kit.config.ts at the repo root)\n --dry-run Run without modifying any files\n --bump=major|minor|patch Set the level of every release that happens; does not trigger one\n --set-version=X.Y.Z Set an explicit version; bypasses the changelog-derived bump. In monorepo\n mode, name each workspace or directory target:\n --set-version=arrays@1.0.0[,strings@2.0.0].\n Rejected when a composite (a 'project' block or a releases composite)\n is configured.\n --force Release even when the last tag is not followed by any commits,\n or by any bump-worthy ones. Defaults to patch when --bump is not given;\n use --bump=X for a different level.\n --no-git-checks, -n Skip the clean-working-tree check\n --only=name1,name2 Release only the named release targets and their dependents\n (comma-separated, monorepo only). A composite declared under 'releases'\n releases only when named; a 'project' block's release is skipped.\n --with-release-notes Also write per-workspace release-notes previews under <workspacePath>/docs/\n (docs/README.v<version>.md and docs/RELEASE_NOTES.v<version>.md).\n Recommended .gitignore entry: packages/*/docs/*.v*.md (or docs/*.v*.md).\n --help, -h Show this help message\n";
6
- /** Prints the prepare command's help text. */
7
- export declare function showPrepareHelp(): void;
@@ -1,30 +0,0 @@
1
- export const prepareHelpText = `
2
- Usage: release-kit prepare [options]
3
-
4
- Run release preparation with automatic workspace discovery.
5
-
6
- Options:
7
- --config <path> Config file, relative to the current directory
8
- (default: .config/release-kit.config.ts at the repo root)
9
- --dry-run Run without modifying any files
10
- --bump=major|minor|patch Set the level of every release that happens; does not trigger one
11
- --set-version=X.Y.Z Set an explicit version; bypasses the changelog-derived bump. In monorepo
12
- mode, name each workspace or directory target:
13
- --set-version=arrays@1.0.0[,strings@2.0.0].
14
- Rejected when a composite (a 'project' block or a releases composite)
15
- is configured.
16
- --force Release even when the last tag is not followed by any commits,
17
- or by any bump-worthy ones. Defaults to patch when --bump is not given;
18
- use --bump=X for a different level.
19
- --no-git-checks, -n Skip the clean-working-tree check
20
- --only=name1,name2 Release only the named release targets and their dependents
21
- (comma-separated, monorepo only). A composite declared under 'releases'
22
- releases only when named; a 'project' block's release is skipped.
23
- --with-release-notes Also write per-workspace release-notes previews under <workspacePath>/docs/
24
- (docs/README.v<version>.md and docs/RELEASE_NOTES.v<version>.md).
25
- Recommended .gitignore entry: packages/*/docs/*.v*.md (or docs/*.v*.md).
26
- --help, -h Show this help message
27
- `;
28
- export function showPrepareHelp() {
29
- console.info(prepareHelpText);
30
- }
@@ -1,12 +0,0 @@
1
- /** Prints the `commit` command's help text. */
2
- export declare function showCommitHelp(): void;
3
- /** Prints the `create-github-release` command's help text. */
4
- export declare function showCreateGithubReleaseHelp(): void;
5
- /** Prints the `publish` command's help text. */
6
- export declare function showPublishHelp(): void;
7
- /** Prints the `push` command's help text. */
8
- export declare function showPushHelp(): void;
9
- /** Prints the `show-tag-prefixes` command's help text. */
10
- export declare function showShowTagPrefixesHelp(): void;
11
- /** Prints the `tag` command's help text. */
12
- export declare function showTagHelp(): void;
@@ -1,91 +0,0 @@
1
- export function showCommitHelp() {
2
- console.info(`
3
- Usage: release-kit commit [options]
4
-
5
- Stage all changes and create the release commit using tags and summary
6
- produced by \`prepare\`.
7
-
8
- Options:
9
- --dry-run Preview the commit message without creating it
10
- --help, -h Show this help message
11
- `);
12
- }
13
- export function showCreateGithubReleaseHelp() {
14
- console.info(`
15
- Usage: release-kit create-github-release [options]
16
-
17
- Create GitHub Releases from changelog.json for tags on HEAD. Private
18
- (package.json#private) workspaces are skipped with a warning, and the command
19
- doesn't create a Release for them. A project tag gets a Release even when the
20
- root package is private.
21
-
22
- Options:
23
- --config <path> Config file, relative to the current directory
24
- (default: .config/release-kit.config.ts at the repo root)
25
- --dry-run Preview without creating releases
26
- --tags=tag1,tag2 Only create releases for the named tags (comma-separated, full tag names)
27
- --help, -h Show this help message
28
- `);
29
- }
30
- export function showPublishHelp() {
31
- console.info(`
32
- Usage: release-kit publish [options]
33
-
34
- Publish packages that have release tags on HEAD. Operates only on workspaces whose
35
- package.json#private is absent or false. Without --tags, unpublishable workspaces are
36
- silently filtered out. With --tags, an unpublishable tag is skipped with a warning while
37
- any publishable tags are still published. A project tag is never published.
38
-
39
- Options:
40
- --config <path> Config file, relative to the current directory
41
- (default: .config/release-kit.config.ts at the repo root)
42
- --dry-run Preview without publishing
43
- --no-git-checks Skip the clean-working-tree check
44
- --tags=tag1,tag2 Only publish the named tags (comma-separated, full tag names)
45
- --provenance Generate provenance statement (requires OIDC, not supported by classic yarn)
46
- --help, -h Show this help message
47
- `);
48
- }
49
- export function showPushHelp() {
50
- console.info(`
51
- Usage: release-kit push [options]
52
-
53
- Push the release commit and each tag individually, so that GitHub Actions
54
- starts a separate workflow run for each tag.
55
-
56
- Options:
57
- --config <path> Config file, relative to the current directory
58
- (default: .config/release-kit.config.ts at the repo root)
59
- --dry-run Preview without pushing
60
- --tags=tag1,tag2 Only push the named tags (comma-separated, full tag names)
61
- --tags-only Skip the branch push (push tags only)
62
- --help, -h Show this help message
63
- `);
64
- }
65
- export function showShowTagPrefixesHelp() {
66
- console.info(`
67
- Usage: release-kit show-tag-prefixes [options]
68
-
69
- Print a per-workspace table of derived tag prefixes, tag counts, and declared
70
- legacy tag prefixes. Reports any release-shaped tags whose prefix is neither a
71
- derived prefix nor declared in \`legacyIdentities\`, with a copy-pasteable
72
- config snippet.
73
-
74
- Options:
75
- --config <path> Config file, relative to the current directory
76
- (default: .config/release-kit.config.ts at the repo root)
77
- --help, -h Show this help message
78
- `);
79
- }
80
- export function showTagHelp() {
81
- console.info(`
82
- Usage: release-kit tag [options]
83
-
84
- Create annotated git tags from the tags file produced by \`prepare\`.
85
-
86
- Options:
87
- --dry-run Preview without creating tags
88
- --no-git-checks Skip dirty working tree check
89
- --help, -h Show this help message
90
- `);
91
- }
@@ -1,8 +0,0 @@
1
- /** Prints the `sync-labels generate` subcommand's help text. */
2
- export declare function showSyncLabelsGenerateHelp(): void;
3
- /** Prints the `sync-labels` command's help text. */
4
- export declare function showSyncLabelsHelp(): void;
5
- /** Prints the `sync-labels init` subcommand's help text. */
6
- export declare function showSyncLabelsInitHelp(): void;
7
- /** Prints the `sync-labels sync` subcommand's help text. */
8
- export declare function showSyncLabelsSyncHelp(): void;
@@ -1,55 +0,0 @@
1
- export function showSyncLabelsGenerateHelp() {
2
- console.info(`
3
- Usage: release-kit sync-labels generate [options]
4
-
5
- Regenerate .github/labels.yaml from the repoLabels block of .config/release-kit.config.ts.
6
-
7
- Options:
8
- --check Report whether .github/labels.yaml is stale instead of writing it
9
- --config <path> Config file, relative to the current directory
10
- (default: .config/release-kit.config.ts at the repo root)
11
- --help, -h Show this help message
12
- `);
13
- }
14
- export function showSyncLabelsHelp() {
15
- console.info(`
16
- Usage: release-kit sync-labels <subcommand> [options]
17
-
18
- Manage GitHub label synchronization via preset and custom label definitions.
19
-
20
- Subcommands:
21
- init Scaffold caller workflow and config, then generate labels
22
- generate Regenerate .github/labels.yaml from config
23
- sync Trigger the sync-labels workflow via gh CLI
24
-
25
- Options:
26
- --help, -h Show this help message
27
- `);
28
- }
29
- export function showSyncLabelsInitHelp() {
30
- console.info(`
31
- Usage: release-kit sync-labels init [options]
32
-
33
- Scaffold the sync-labels caller workflow and seed the repoLabels block of
34
- .config/release-kit.config.ts with scope labels discovered from workspaces and
35
- retired packages, then generate .github/labels.yaml. When the config file already
36
- exists, print the block for manual paste instead of rewriting the file.
37
-
38
- Options:
39
- --config <path> Config file, relative to the current directory
40
- (default: .config/release-kit.config.ts at the repo root)
41
- --dry-run Preview changes without writing files
42
- --force Overwrite existing files instead of skipping them
43
- --help, -h Show this help message
44
- `);
45
- }
46
- export function showSyncLabelsSyncHelp() {
47
- console.info(`
48
- Usage: release-kit sync-labels sync
49
-
50
- Trigger the sync-labels GitHub Actions workflow via the gh CLI.
51
-
52
- Options:
53
- --help, -h Show this help message
54
- `);
55
- }
@@ -1,2 +0,0 @@
1
- /** Prints the top-level usage text. */
2
- export declare function showUsage(): void;
@@ -1,29 +0,0 @@
1
- import { OUTPUT_STYLE_ENV_VAR } from "../resolveStylesOrExit.js";
2
- export function showUsage() {
3
- console.info(`
4
- Usage: release-kit <command> [options]
5
-
6
- Commands:
7
- prepare Run release preparation (auto-discovers workspaces)
8
- commit Stage changes and create the release commit
9
- tag Create annotated git tags from the tags file
10
- push Push release commit and tags (one push per tag)
11
- publish Publish packages with release tags on HEAD
12
- create-github-release Create GitHub Releases from changelog.json for tags on HEAD
13
- show-tag-prefixes Show derived and declared legacy tag prefixes per workspace
14
- init Initialize release-kit in the current repository
15
- update-templates Update the scaffolded workflows to the current templates
16
- overrides Manage editorial changelog overrides
17
- sync-labels Manage GitHub label synchronization
18
-
19
- Options:
20
- --dry-run Preview changes without writing files
21
- --help, -h Show this help message
22
- --version, -V Show the version number
23
-
24
- Environment:
25
- ${OUTPUT_STYLE_ENV_VAR}
26
- Output style: auto (default), plain, or rich. auto prints plain,
27
- without emoji, when CI is set or the stream is not a terminal.
28
- `);
29
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Resolves a `--config` value against the directory from which `release-kit` was invoked, which differs from the
3
- * working directory once the process has moved to the repo root.
4
- *
5
- * Returns `undefined` when the flag is absent, so that `loadConfig` falls back to the default path under the root.
6
- */
7
- export declare function resolveConfigFlag(config: string | undefined, invocationDir: string): string | undefined;
@@ -1,4 +0,0 @@
1
- import path from 'node:path';
2
- export function resolveConfigFlag(config, invocationDir) {
3
- return config === undefined ? undefined : path.resolve(invocationDir, config);
4
- }
@@ -1,10 +0,0 @@
1
- import { describeInvalidOutputStyle, reportError, resolveStreamStyles, } from '@williamthorsen/nmr-core';
2
- export const OUTPUT_STYLE_ENV_VAR = 'RELEASE_KIT_OUTPUT_STYLE';
3
- export function resolveStylesOrExit(options) {
4
- const { invalid, styles } = resolveStreamStyles({ ...options, envVar: OUTPUT_STYLE_ENV_VAR });
5
- if (invalid !== undefined) {
6
- reportError(describeInvalidOutputStyle(invalid));
7
- process.exit(1);
8
- }
9
- return styles;
10
- }