@williamthorsen/release-kit 4.5.1 → 4.6.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 (52) hide show
  1. package/CHANGELOG.md +115 -100
  2. package/LICENSE +4 -4
  3. package/cliff.toml.template +66 -54
  4. package/dist/esm/.cache +1 -1
  5. package/dist/esm/assertCleanWorkingTree.d.ts +1 -0
  6. package/dist/esm/assertCleanWorkingTree.js +15 -0
  7. package/dist/esm/bin/release-kit.js +29 -6
  8. package/dist/esm/changelogJsonUtils.d.ts +4 -0
  9. package/dist/esm/changelogJsonUtils.js +29 -0
  10. package/dist/esm/createGithubRelease.d.ts +11 -0
  11. package/dist/esm/createGithubRelease.js +54 -0
  12. package/dist/esm/defaults.d.ts +3 -1
  13. package/dist/esm/defaults.js +14 -0
  14. package/dist/esm/generateChangelogJson.d.ts +7 -0
  15. package/dist/esm/generateChangelogJson.js +196 -0
  16. package/dist/esm/generateChangelogs.js +25 -9
  17. package/dist/esm/githubReleaseCommand.d.ts +1 -0
  18. package/dist/esm/githubReleaseCommand.js +35 -0
  19. package/dist/esm/index.d.ts +11 -3
  20. package/dist/esm/index.js +27 -3
  21. package/dist/esm/injectReleaseNotesIntoReadme.d.ts +2 -0
  22. package/dist/esm/injectReleaseNotesIntoReadme.js +42 -0
  23. package/dist/esm/injectSection.d.ts +1 -0
  24. package/dist/esm/injectSection.js +32 -0
  25. package/dist/esm/loadConfig.js +35 -3
  26. package/dist/esm/parseCommitMessage.js +1 -1
  27. package/dist/esm/prepareCommand.d.ts +1 -0
  28. package/dist/esm/prepareCommand.js +54 -20
  29. package/dist/esm/publish.d.ts +1 -1
  30. package/dist/esm/publish.js +7 -26
  31. package/dist/esm/publishCommand.js +49 -29
  32. package/dist/esm/releasePrepare.js +12 -1
  33. package/dist/esm/releasePrepareMono.js +23 -0
  34. package/dist/esm/renderReleaseNotes.d.ts +8 -0
  35. package/dist/esm/renderReleaseNotes.js +40 -0
  36. package/dist/esm/resolveCommandTags.d.ts +2 -0
  37. package/dist/esm/resolveCommandTags.js +36 -0
  38. package/dist/esm/resolveReleaseNotesConfig.d.ts +6 -0
  39. package/dist/esm/resolveReleaseNotesConfig.js +37 -0
  40. package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
  41. package/dist/esm/sync-labels/generateCommand.js +12 -6
  42. package/dist/esm/sync-labels/presets.d.ts +1 -0
  43. package/dist/esm/sync-labels/presets.js +10 -0
  44. package/dist/esm/typeGuards.d.ts +1 -0
  45. package/dist/esm/typeGuards.js +5 -1
  46. package/dist/esm/types.d.ts +29 -0
  47. package/dist/esm/validateConfig.d.ts +1 -0
  48. package/dist/esm/validateConfig.js +89 -6
  49. package/dist/esm/version.d.ts +1 -1
  50. package/dist/esm/version.js +1 -1
  51. package/package.json +4 -3
  52. package/presets/labels/common.yaml +43 -0
package/CHANGELOG.md CHANGED
@@ -2,236 +2,251 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [release-kit-v4.5.1] - 2026-04-10
5
+ ## [release-kit-v4.6.0] - 2026-04-15
6
6
 
7
- ### Bug fixes
7
+ ### Features
8
8
 
9
- - #178 release-kit|fix: Fix sync-labels init scaffolding output (#179)
9
+ - Guard `prepare` against dirty working tree (#188)
10
10
 
11
- Fixes three issues in `release-kit sync-labels init` scaffolding output that cause immediate errors for consumers: adds missing workflow permissions, corrects config template indentation from 2 to 4 spaces, and switches YAML quoting from double to single quotes.
11
+ Add a clean-working-tree check at the start of `prepareCommand` that exits with an error when `git status --porcelain` reports uncommitted changes. This prevents the double-bump problem where running `prepare` multiple times bumps the version each time from the already-bumped `package.json`.
12
12
 
13
- ## [release-kit-v4.5.0] - 2026-04-06
13
+ The check can be bypassed with `--no-git-checks` (`-n`) and is automatically skipped during `--dry-run`.
14
14
 
15
- ### Features
15
+ - Add sync-labels drift detection to release-kit readyup kit (#190)
16
+
17
+ Adds readyup kit checks that detect when a consumer's sync-labels workflow or generated labels file has drifted from the current templates and presets. The `generate` command now embeds per-preset content hashes in the `labels.yaml` header, enabling hash-based staleness detection.
18
+
19
+ - Improve changelog formatting & add cliff config drift detection (#193)
20
+
21
+ Improves changelog generation: cleanly indented commit bodies, stripped type prefixes, and no unticketed noise. Adds hash-based drift detection so the rdy kit warns when a consumer's local cliff config falls behind the current template. Fixes a latent bug where git-cliff rejected the bundled `.template` file extension.
22
+
23
+ - Generate release notes distinct from changelogs (#199)
24
+
25
+ Adds structured changelog generation with audience tagging to the `release-kit` package, enabling GitHub Release creation and npm README injection with user-facing release notes filtered from developer-only sections. The existing CHANGELOG.md pipeline is unchanged; a new `.meta/changelog.json` artifact is generated in parallel during `release-kit prepare`, and consumed during `release-kit publish` to create GitHub Releases and inject release notes into the published package's README.
26
+
27
+ ### Refactoring
28
+
29
+ - Decouple GitHub Release creation and README injection from npm publish (#203)
30
+
31
+ Makes GitHub Release creation available as a standalone CLI command (`release-kit github-release`) and removes README injection logic from the publish function. Non-published projects (applications, websites, internal tools) can now create GitHub Releases independently after `release-kit prepare`, and the inject/restore lifecycle is managed by the command layer rather than buried inside business logic.
32
+
33
+ ### Tooling
34
+
35
+ - Enable automated publication to npm (#187)
36
+
37
+ Prepares the repository for reliable tag-triggered npm publishing by adding missing package metadata, standardizing licensing, and introducing a readyup kit that validates publish readiness across all packages.
38
+
39
+ ## [release-kit-v4.5.1] - 2026-04-10
40
+
41
+ ### Bug fixes
16
42
 
17
- - Release-kit|feat: Add spike to common repo labels
43
+ - Fix sync-labels init scaffolding output (#179)
44
+
45
+ Fixes three issues in `release-kit sync-labels init` scaffolding output that cause immediate errors for consumers: adds missing workflow permissions, corrects config template indentation from 2 to 4 spaces, and switches YAML quoting from double to single quotes.
18
46
 
19
47
  ## [release-kit-v4.4.0] - 2026-04-04
20
48
 
21
49
  ### Documentation
22
50
 
23
- - #135 release-kit|docs: Refine README to match preflight documentation standard (#138)
51
+ - Refine README to match preflight documentation standard (#138)
24
52
 
25
- Restructures the release-kit README to match the documentation standard established by the preflight README (#114). Reorders sections to follow the cross-package convention, converts CLI flag listings from code blocks to tables, adds representative `prepare --dry-run` output to the quick start, and condenses ~90 lines of inline workflow YAML into a summary with an inputs table and trigger examples. Fixes several accuracy gaps found by verifying documentation against source.
53
+ Restructures the release-kit README to match the documentation standard established by the preflight README (#114). Reorders sections to follow the cross-package convention, converts CLI flag listings from code blocks to tables, adds representative `prepare --dry-run` output to the quick start, and condenses ~90 lines of inline workflow YAML into a summary with an inputs table and trigger examples. Fixes several accuracy gaps found by verifying documentation against source.
26
54
 
27
55
  ### Features
28
56
 
29
- - #142 feat: Add --version flag to nmr and release-kit (#143)
57
+ - Add --version flag to nmr and release-kit (#143)
30
58
 
31
- Adds `--version` / `-V` support to the `nmr` and `release-kit` CLIs, matching the existing `preflight` behavior. Moves the build-time version generation script to the shared `config/` directory so all three packages use a single `generateVersion.ts`.
59
+ Adds `--version` / `-V` support to the `nmr` and `release-kit` CLIs, matching the existing `preflight` behavior. Moves the build-time version generation script to the shared `config/` directory so all three packages use a single `generateVersion.ts`.
32
60
 
33
- - #150 feat: Detect and report missing build output in bin wrappers (#152)
61
+ - Detect and report missing build output in bin wrappers (#152)
34
62
 
35
- Adds try/catch with `ERR_MODULE_NOT_FOUND` detection to all six bin wrappers across `nmr`, `preflight`, and `release-kit`. Previously, five of the six wrappers used bare `import()` calls that produced cryptic unhandled rejections when `dist/` was missing, and `preflight`'s existing try/catch gave no actionable guidance.
63
+ Adds try/catch with `ERR_MODULE_NOT_FOUND` detection to all six bin wrappers across `nmr`, `preflight`, and `release-kit`. Previously, five of the six wrappers used bare `import()` calls that produced cryptic unhandled rejections when `dist/` was missing, and `preflight`'s existing try/catch gave no actionable guidance.
36
64
 
37
65
  ### Refactoring
38
66
 
39
- - #88 release-kit|refactor: Extract deleteFileIfExists helper (#136)
67
+ - Extract deleteFileIfExists helper (#136)
40
68
 
41
- Replaces the duplicate `deleteTagsFile` and `deleteSummaryFile` functions in `createTags.ts` with a single parameterized `deleteFileIfExists(path)` utility. The new helper lives in its own module and is exported from the package barrel for reuse.
69
+ Replaces the duplicate `deleteTagsFile` and `deleteSummaryFile` functions in `createTags.ts` with a single parameterized `deleteFileIfExists(path)` utility. The new helper lives in its own module and is exported from the package barrel for reuse.
42
70
 
43
- - #145 refactor: Extract shared CLI argument-parsing utility into core (#151)
71
+ - Extract shared CLI argument-parsing utility into core (#151)
44
72
 
45
- Add a schema-driven `parseArgs` function to `@williamthorsen/node-monorepo-core` that handles boolean flags, string flags (both `--flag=value` and `--flag value`), short aliases, positional collection, the `--` delimiter, and unknown-flag errors. Migrate all CLI argument-parsing sites in preflight (3 sites) and release-kit (5 sites) to use it. A companion `translateParseError` helper normalizes internal error messages for consistent user-facing output.
73
+ Add a schema-driven `parseArgs` function to `@williamthorsen/node-monorepo-core` that handles boolean flags, string flags (both `--flag=value` and `--flag value`), short aliases, positional collection, the `--` delimiter, and unknown-flag errors. Migrate all CLI argument-parsing sites in preflight (3 sites) and release-kit (5 sites) to use it. A companion `translateParseError` helper normalizes internal error messages for consistent user-facing output.
46
74
 
47
75
  ## [release-kit-v4.0.0] - 2026-04-02
48
76
 
49
77
  ### Features
50
78
 
51
- - #125 feat: Rename reusable workflows to .reusable.yaml convention (#129)
79
+ - Rename reusable workflows to .reusable.yaml convention (#129)
52
80
 
53
- Renames all three reusable GitHub Actions workflow files from the inconsistent `-workflow.yaml`/bare `.yaml` convention to a uniform `.reusable.yaml` suffix. Updates all references across caller workflows, release-kit templates, tests, preflight collection, and documentation. Scaffolds the sync-labels caller workflow and labels file for this repo. Deletes superseded legacy files.
81
+ Renames all three reusable GitHub Actions workflow files from the inconsistent `-workflow.yaml`/bare `.yaml` convention to a uniform `.reusable.yaml` suffix. Updates all references across caller workflows, release-kit templates, tests, preflight collection, and documentation. Scaffolds the sync-labels caller workflow and labels file for this repo. Deletes superseded legacy files.
54
82
 
55
83
  ## [release-kit-v3.0.0] - 2026-03-29
56
84
 
57
85
  ### Bug fixes
58
86
 
59
- - #68 release-kit|fix: Pass tag pattern to git-cliff based on tagPrefix (#77)
87
+ - Pass tag pattern to git-cliff based on tagPrefix (#77)
60
88
 
61
- Fixes the issue that git-cliff was processing the entire commit history on every run instead of only commits since the last release.
89
+ Fixes the issue that git-cliff was processing the entire commit history on every run instead of only commits since the last release.
62
90
 
63
- Constructs the pattern from `tagPrefix` at invocation time (e.g., `release-kit-v` → `release-kit-v[0-9].*`) and pass it via `--tag-pattern`, which overrides the config file default.
91
+ Constructs the pattern from `tagPrefix` at invocation time (e.g., `release-kit-v` → `release-kit-v[0-9].*`) and pass it via `--tag-pattern`, which overrides the config file default.
64
92
 
65
- - #72 release-kit|fix: Propagate version bumps to workspace dependents (#80)
93
+ - Propagate version bumps to workspace dependents (#80)
66
94
 
67
- Restructures `releasePrepareMono` from a single-pass loop into a phased pipeline that automatically patch-bumps workspace dependents when a component is released. A reverse dependency graph is built from `workspace:` references in `dependencies` and `peerDependencies`, then BFS propagation walks upward from bumped components to their dependents. Propagated-only components receive synthetic changelog entries instead of git-cliff invocations.
95
+ Restructures `releasePrepareMono` from a single-pass loop into a phased pipeline that automatically patch-bumps workspace dependents when a component is released. A reverse dependency graph is built from `workspace:` references in `dependencies` and `peerDependencies`, then BFS propagation walks upward from bumped components to their dependents. Propagated-only components receive synthetic changelog entries instead of git-cliff invocations.
68
96
 
69
97
  ### Features
70
98
 
71
- - #73 release-kit|feat!: Support conventional-commit format in commit parsing (#85)
99
+ - Support conventional-commit format in commit parsing (#85)
72
100
 
73
- Adds support for the conventional commits format (`type(scope): description`) alongside the existing pipe-prefixed format (`scope|type: description`) in release-kit's commit parser. Renames `workspace` to `scope` throughout release-kit types, config, validation, and consumers.
101
+ Adds support for the conventional commits format (`type(scope): description`) alongside the existing pipe-prefixed format (`scope|type: description`) in release-kit's commit parser. Renames `workspace` to `scope` throughout release-kit types, config, validation, and consumers.
74
102
 
75
- - #70 release-kit|feat: Add commit command for local release flow (#89)
103
+ - Add commit command for local release flow (#89)
76
104
 
77
- Adds a `release-kit commit` command that centralizes the release commit step between `prepare` and `tag`. The command reads tag names and a per-component commit summary from temporary files written by `prepare`, stages all changes, and creates a formatted commit. Two new utilities — `stripScope` and `buildReleaseSummary` — support building the commit body by stripping redundant scope indicators and formatting commits under their component headings. The CI workflow is simplified to use `release-kit commit` and `release-kit tag` instead of inline shell logic.
105
+ Adds a `release-kit commit` command that centralizes the release commit step between `prepare` and `tag`. The command reads tag names and a per-component commit summary from temporary files written by `prepare`, stages all changes, and creates a formatted commit. Two new utilities — `stripScope` and `buildReleaseSummary` — support building the commit body by stripping redundant scope indicators and formatting commits under their component headings. The CI workflow is simplified to use `release-kit commit` and `release-kit tag` instead of inline shell logic.
78
106
 
79
- - #69 release-kit|feat: Add CI publish workflow with OIDC trusted publishing (#90)
107
+ - Add CI publish workflow with OIDC trusted publishing (#90)
80
108
 
81
- Adds automated npm publication via a tag-push-triggered GitHub Actions workflow using OIDC trusted publishing. Extends `release-kit publish` with a `--provenance` flag and `release-kit init` with publish workflow scaffolding.
109
+ Adds automated npm publication via a tag-push-triggered GitHub Actions workflow using OIDC trusted publishing. Extends `release-kit publish` with a `--provenance` flag and `release-kit init` with publish workflow scaffolding.
82
110
 
83
- - #91 release-kit|feat: Make --provenance opt-in to support private repos (#94)
111
+ - Make --provenance opt-in to support private repos (#94)
84
112
 
85
- Adds a `provenance` boolean input (default `false`) to the reusable `publish-workflow.yaml` so private repos using OIDC trusted publishing no longer fail at publish time. The `--provenance` flag is only passed to `release-kit publish` when the caller sets `provenance: true`.
113
+ Adds a `provenance` boolean input (default `false`) to the reusable `publish-workflow.yaml` so private repos using OIDC trusted publishing no longer fail at publish time. The `--provenance` flag is only passed to `release-kit publish` when the caller sets `provenance: true`.
86
114
 
87
- Updates the scaffolded `publish.yaml` template to include `provenance: false` with an inline comment guiding public repos to opt in. Expand the `release-kit init` next-steps output with hints about the provenance setting and trusted publisher registration. Set `provenance: true` in this repo's own `publish.yaml` since it is public.
115
+ Updates the scaffolded `publish.yaml` template to include `provenance: false` with an inline comment guiding public repos to opt in. Expand the `release-kit init` next-steps output with hints about the provenance setting and trusted publisher registration. Set `provenance: true` in this repo's own `publish.yaml` since it is public.
88
116
 
89
117
  ## [release-kit-v2.3.2] - 2026-03-28
90
118
 
91
119
  ### Bug fixes
92
120
 
93
- - #71 release-kit|fix: Prevent unparseable commits from being silently dropped (#76)
121
+ - Prevent unparseable commits from being silently dropped (#76)
94
122
 
95
- Prevents `releasePrepareMono` and `releasePrepare` from silently skipping components whose commits have unparseable messages. Adds ticket-prefix stripping to `parseCommitMessage` (mirroring cliff.toml's `commit_preprocessors`), a patch-floor safety net when commits exist but none parse, and unparseable-commit reporting in `reportPrepare`.
123
+ Prevents `releasePrepareMono` and `releasePrepare` from silently skipping components whose commits have unparseable messages. Adds ticket-prefix stripping to `parseCommitMessage` (mirroring cliff.toml's `commit_preprocessors`), a patch-floor safety net when commits exist but none parse, and unparseable-commit reporting in `reportPrepare`.
96
124
 
97
125
  ## [release-kit-v2.3.0] - 2026-03-28
98
126
 
99
127
  ### Features
100
128
 
101
- - #8 feat: Add shared writeFileWithCheck utility and overwrite reporting (#66)
129
+ - Add shared writeFileWithCheck utility and overwrite reporting (#66)
102
130
 
103
- Extracts three duplicated `writeIfAbsent` implementations and two duplicated terminal helper sets into shared utilities in `@williamthorsen/node-monorepo-core`, then migrates all consumers (`release-kit init`, `preflight init`, `sync-labels`) to use them. All init commands now report which files were created, overwritten, skipped, or failed — including when `--force` replaces existing files.
131
+ Extracts three duplicated `writeIfAbsent` implementations and two duplicated terminal helper sets into shared utilities in `@williamthorsen/node-monorepo-core`, then migrates all consumers (`release-kit init`, `preflight init`, `sync-labels`) to use them. All init commands now report which files were created, overwritten, skipped, or failed — including when `--force` replaces existing files.
104
132
 
105
- - #11 release-kit|feat: Separate tag-write errors from release preparation errors (#67)
133
+ - Separate tag-write errors from release preparation errors (#67)
106
134
 
107
- When tag-file writing fails, the error message now reads "Error writing release tags:" instead of the misleading "Error preparing release:", which only appeared because both operations shared a single try/catch.
135
+ When tag-file writing fails, the error message now reads "Error writing release tags:" instead of the misleading "Error preparing release:", which only appeared because both operations shared a single try/catch.
108
136
 
109
- Refactors `writeReleaseTags` to use the shared `writeFileWithCheck` utility from `@node-monorepo-tools/core` instead of raw `mkdirSync`/`writeFileSync`. The function now returns a structured `WriteResult` instead of throwing, and contains no `console` calls — all presentation moves to `runAndReport`.
137
+ Refactors `writeReleaseTags` to use the shared `writeFileWithCheck` utility from `@node-monorepo-tools/core` instead of raw `mkdirSync`/`writeFileSync`. The function now returns a structured `WriteResult` instead of throwing, and contains no `console` calls — all presentation moves to `runAndReport`.
110
138
 
111
139
  ### Tests
112
140
 
113
- - #14 release-kit|tests: Add eligibility check failure and short-circuit tests (#63)
141
+ - Add eligibility check failure and short-circuit tests (#63)
114
142
 
115
- Adds 4 unit tests to `initCommand.unit.test.ts` covering the remaining `checkEligibility` orchestration gaps: individual failure exit codes for `hasPackageJson` and `usesPnpm`, and short-circuit verification ensuring downstream checks are skipped when an earlier check fails.
143
+ Adds 4 unit tests to `initCommand.unit.test.ts` covering the remaining `checkEligibility` orchestration gaps: individual failure exit codes for `hasPackageJson` and `usesPnpm`, and short-circuit verification ensuring downstream checks are skipped when an earlier check fails.
116
144
 
117
- - #13 release-kit|tests: Add cliff.toml.template alignment test (#64)
145
+ - Add cliff.toml.template alignment test (#64)
118
146
 
119
- Adds a unit test that enforces bidirectional alignment between `DEFAULT_WORK_TYPES` and the bundled `cliff.toml.template` commit parsers. The test parses the TOML template using `smol-toml`, then verifies that every canonical type name and alias is matched by a parser with the correct group heading, and that every parser group maps to a known work type header.
147
+ Adds a unit test that enforces bidirectional alignment between `DEFAULT_WORK_TYPES` and the bundled `cliff.toml.template` commit parsers. The test parses the TOML template using `smol-toml`, then verifies that every canonical type name and alias is matched by a parser with the correct group heading, and that every parser group maps to a known work type header.
120
148
 
121
- - #12 release-kit|tests: Add releasePrepare coverage for bumpOverride, tagPrefix, and dry-run tags (#65)
149
+ - Add releasePrepare coverage for bumpOverride, tagPrefix, and dry-run tags (#65)
122
150
 
123
- Adds three unit tests to `releasePrepare.unit.test.ts` covering previously untested code paths: the `bumpOverride` bypass of commit-based bump detection, custom `tagPrefix` propagation into tags, and tag computation in dry-run mode.
151
+ Adds three unit tests to `releasePrepare.unit.test.ts` covering previously untested code paths: the `bumpOverride` bypass of commit-based bump detection, custom `tagPrefix` propagation into tags, and tag computation in dry-run mode.
124
152
 
125
153
  ## [release-kit-v2.2.0] - 2026-03-27
126
154
 
127
- ### Dependencies
128
-
129
- - Root|deps: Add release-kit as root devDependency
130
-
131
- Make `npx release-kit` and `pnpm exec release-kit` resolve within
132
- this repo by adding a `workspace:*` dependency that symlinks the bin.
133
-
134
155
  ### Features
135
156
 
136
- - #23 release-kit|feat: Add sync-labels command (#33)
157
+ - Add sync-labels command (#33)
137
158
 
138
- Add a `release-kit sync-labels` command group with three subcommands (`init`, `generate`, `sync`) for declarative GitHub label management in monorepos. Bundle a reusable GitHub Actions workflow and composable label presets with the release-kit package. Introduce a `findPackageRoot` utility to replace fragile hardcoded path resolutions across the codebase.
159
+ Add a `release-kit sync-labels` command group with three subcommands (`init`, `generate`, `sync`) for declarative GitHub label management in monorepos. Bundle a reusable GitHub Actions workflow and composable label presets with the release-kit package. Introduce a `findPackageRoot` utility to replace fragile hardcoded path resolutions across the codebase.
139
160
 
140
- - #34 release-kit|feat: Report up-to-date status for unchanged init files (#35)
161
+ - Report up-to-date status for unchanged init files (#35)
141
162
 
142
- `release-kit init` now compares existing file content against the default before reporting status. When an existing file is identical to the default (after normalizing trailing whitespace), it reports `✅ (up to date)` instead of the misleading `⚠️ (already exists)`.
163
+ `release-kit init` now compares existing file content against the default before reporting status. When an existing file is identical to the default (after normalizing trailing whitespace), it reports `✅ (up to date)` instead of the misleading `⚠️ (already exists)`.
143
164
 
144
- - Release-workflow|feat: Accept force input
165
+ - Auto-detect Prettier for CHANGELOG formatting (#36)
145
166
 
146
- Pass `--force` to the prepare command so callers can force a version
147
- bump even when there are no release-worthy changes.
167
+ When `formatCommand` is not configured, release-kit now auto-detects whether the repo uses Prettier by checking for config files (`.prettierrc*`, `prettier.config.*`) or a `"prettier"` key in root `package.json`. If found, it defaults to `npx prettier --write` on generated files. If not found, formatting is skipped.
148
168
 
149
- - #27 release-kit|feat: Auto-detect Prettier for CHANGELOG formatting (#36)
169
+ - Add tag-creation command (#40)
150
170
 
151
- When `formatCommand` is not configured, release-kit now auto-detects whether the repo uses Prettier by checking for config files (`.prettierrc*`, `prettier.config.*`) or a `"prettier"` key in root `package.json`. If found, it defaults to `npx prettier --write` on generated files. If not found, formatting is skipped.
171
+ Adds a `release-kit tag` CLI command that reads computed tag names from the `tmp/.release-tags` file produced by `prepare` and creates annotated git tags. The command supports `--dry-run` (preview without creating tags) and `--no-git-checks` (skip dirty working tree validation). The `createTags` function and its options type are exported for programmatic use.
152
172
 
153
- - #28 release-kit|feat: Add tag-creation command (#40)
173
+ - Add publish command (#42)
154
174
 
155
- Adds a `release-kit tag` CLI command that reads computed tag names from the `tmp/.release-tags` file produced by `prepare` and creates annotated git tags. The command supports `--dry-run` (preview without creating tags) and `--no-git-checks` (skip dirty working tree validation). The `createTags` function and its options type are exported for programmatic use.
175
+ Adds a `release-kit publish` subcommand that derives packages to publish from git tags on HEAD and delegates to the repo's detected package manager. Also cleans up the `.release-tags` file after tag creation.
156
176
 
157
- - #29 release-kit|feat: Add publish command (#42)
177
+ - Remove tagPrefix customization from component config (#49)
158
178
 
159
- Adds a `release-kit publish` subcommand that derives packages to publish from git tags on HEAD and delegates to the repo's detected package manager. Also cleans up the `.release-tags` file after tag creation.
179
+ Removes the ability to customize `tagPrefix` per component, enforcing the deterministic `{dir}-v` convention universally. The internal `tagPrefix` property on `ComponentConfig` and `ReleaseConfig` is preserved — only the override/customization entry points are removed. Existing configs that still include `tagPrefix` now receive a clear deprecation error.
160
180
 
161
- - #41 release-kit|feat: Remove tagPrefix customization from component config (#49)
181
+ - Add styled terminal output to prepare command (#55)
162
182
 
163
- Removes the ability to customize `tagPrefix` per component, enforcing the deterministic `{dir}-v` convention universally. The internal `tagPrefix` property on `ComponentConfig` and `ReleaseConfig` is preserved only the override/customization entry points are removed. Existing configs that still include `tagPrefix` now receive a clear deprecation error.
183
+ Adds ANSI formatting and emoji markers to the `release-kit prepare` command output. Progress chatter is dimmed, key results (version bumps, release tags, completion status) are highlighted with bold text and emoji, and monorepo components are separated by box-drawing section headers.
164
184
 
165
- - #54 release-kit|feat: Add styled terminal output to prepare command (#55)
185
+ - Extract nmr CLI from core package (#61)
166
186
 
167
- Adds ANSI formatting and emoji markers to the `release-kit prepare` command output. Progress chatter is dimmed, key results (version bumps, release tags, completion status) are highlighted with bold text and emoji, and monorepo components are separated by box-drawing section headers.
187
+ Extracts all nmr CLI code from `packages/core` into a new `packages/nmr` package (`@williamthorsen/nmr`). Core is reduced to an empty shared-library shell ready for cross-cutting utilities. All internal references are rewired and the full build/test pipeline passes.
168
188
 
169
- - #59 feat: Extract nmr CLI from core package (#61)
170
-
171
- Extracts all nmr CLI code from `packages/core` into a new `packages/nmr` package (`@williamthorsen/nmr`). Core is reduced to an empty shared-library shell ready for cross-cutting utilities. All internal references are rewired and the full build/test pipeline passes.
172
-
173
- Scopes: core, nmr
189
+ Scopes: core, nmr
174
190
 
175
191
  ### Refactoring
176
192
 
177
- - #43 refactor: Replace dist bin targets with thin wrapper scripts (#48)
193
+ - Replace dist bin targets with thin wrapper scripts (#48)
178
194
 
179
- The `bin` entries in `packages/core` and `packages/release-kit` pointed directly into `dist/esm/`, causing `pnpm install` to emit "Failed to create bin" warnings in fresh worktrees where `dist/` does not yet exist. Each bin entry now points to a committed wrapper script in `bin/` that dynamically imports the real entry point. The `files` field in both packages includes `bin` so the wrappers are published.
195
+ The `bin` entries in `packages/core` and `packages/release-kit` pointed directly into `dist/esm/`, causing `pnpm install` to emit "Failed to create bin" warnings in fresh worktrees where `dist/` does not yet exist. Each bin entry now points to a committed wrapper script in `bin/` that dynamically imports the real entry point. The `files` field in both packages includes `bin` so the wrappers are published.
180
196
 
181
- - #53 release-kit|refactor: Separate presentation from logic in prepare workflow (#57)
197
+ - Separate presentation from logic in prepare workflow (#57)
182
198
 
183
- Extracts all `console.info` calls from the prepare workflow's logic functions (`bumpAllVersions`, `generateChangelogs`, `releasePrepare`, `releasePrepareMono`) into a dedicated `reportPrepare` formatter. Logic functions now return structured result types (`BumpResult`, `ComponentPrepareResult`, `PrepareResult`). The legacy `runReleasePrepare` entry point is retired, with its utilities absorbed into `prepareCommand`.
199
+ Extracts all `console.info` calls from the prepare workflow's logic functions (`bumpAllVersions`, `generateChangelogs`, `releasePrepare`, `releasePrepareMono`) into a dedicated `reportPrepare` formatter. Logic functions now return structured result types (`BumpResult`, `ComponentPrepareResult`, `PrepareResult`). The legacy `runReleasePrepare` entry point is retired, with its utilities absorbed into `prepareCommand`.
184
200
 
185
201
  ### Tests
186
202
 
187
- - #17 release-kit|tests: Cover multi-changelogPaths and error paths (#44)
188
-
189
- Add three tests for previously untested code paths:
203
+ - Cover multi-changelogPaths and error paths (#44)
190
204
 
191
- - `releasePrepareMono`: component with two `changelogPaths` entries, asserting `git-cliff` is invoked once per path with the correct `--output` target.
192
- - `getCommitsSinceTarget`: `git describe` failure with a non-128 exit status propagates as a wrapped error instead of being swallowed.
193
- - `getCommitsSinceTarget`: `git log` failure is wrapped and re-thrown with the commit range in the message.
205
+ Add three tests for previously untested code paths:
206
+ - `releasePrepareMono`: component with two `changelogPaths` entries, asserting `git-cliff` is invoked once per path with the correct `--output` target.
207
+ - `getCommitsSinceTarget`: `git describe` failure with a non-128 exit status propagates as a wrapped error instead of being swallowed.
208
+ - `getCommitsSinceTarget`: `git log` failure is wrapped and re-thrown with the commit range in the message.
194
209
 
195
- Also adds a `findAllCliffOutputPaths()` test helper that collects the `--output` arg from every `git-cliff` mock call.
210
+ Also adds a `findAllCliffOutputPaths()` test helper that collects the `--output` arg from every `git-cliff` mock call.
196
211
 
197
212
  ### Tooling
198
213
 
199
- - #37 root|tooling: Adopt nmr to run monorepo and workspace scripts (#38)
214
+ - Adopt nmr to run monorepo and workspace scripts (#38)
200
215
 
201
- Replaces the legacy workspace script runner and ~25 root `package.json` scripts with `nmr`, the monorepo's own context-aware script runner. Root scripts are reduced to 4 (`prepare`, `postinstall`, `ci`, `bootstrap`), packages use direct build commands for bootstrap, and release-kit declares tier-3 test overrides for its integration test configs.
216
+ Replaces the legacy workspace script runner and ~25 root `package.json` scripts with `nmr`, the monorepo's own context-aware script runner. Root scripts are reduced to 4 (`prepare`, `postinstall`, `ci`, `bootstrap`), packages use direct build commands for bootstrap, and release-kit declares tier-3 test overrides for its integration test configs.
202
217
 
203
218
  ## [release-kit-v2.1.0] - 2026-03-17
204
219
 
205
220
  ### Features
206
221
 
207
- - #7 release-kit|feat!: Slim down release workflow by removing unnecessary pnpm install (#21)
222
+ - Slim down release workflow by removing unnecessary pnpm install (#21)
208
223
 
209
- Make release-kit self-contained by invoking git-cliff via `npx --yes` instead of requiring it on PATH, and by appending modified file paths to the format command so lightweight formatters like `npx prettier --write` work without a full `pnpm install`. Update init templates, README, and consuming repo config/workflow to reference workflow v3.
224
+ Make release-kit self-contained by invoking git-cliff via `npx --yes` instead of requiring it on PATH, and by appending modified file paths to the format command so lightweight formatters like `npx prettier --write` work without a full `pnpm install`. Update init templates, README, and consuming repo config/workflow to reference workflow v3.
210
225
 
211
- - #22 release-kit|feat: Add --force flag to release-kit prepare (#25)
226
+ - Add --force flag to release-kit prepare (#25)
212
227
 
213
- Add a `--force` flag to `release-kit prepare` that bypasses the "no commits since last tag" check in monorepo mode, allowing version bumping and changelog generation to proceed even when no new commits are found since the last release tag. The flag requires `--bump` since there are no commits to infer bump type from. The local release workflow gains a `force` boolean input for future use.
228
+ Add a `--force` flag to `release-kit prepare` that bypasses the "no commits since last tag" check in monorepo mode, allowing version bumping and changelog generation to proceed even when no new commits are found since the last release tag. The flag requires `--bump` since there are no commits to infer bump type from. The local release workflow gains a `force` boolean input for future use.
214
229
 
215
- - #20 release-kit|feat!: Move reusable release workflow into repo (#26)
230
+ - Move reusable release workflow into repo (#26)
216
231
 
217
- Moves the reusable release workflow from `williamthorsen/.github` into this repo as `release-workflow.yaml`, stripping all pnpm-related steps since release-kit now runs git-cliff and prettier via `npx` internally. Updates this repo's caller workflow to use a relative path and update init templates to reference the new location. Establishes a naming convention (`{name}-workflow.yaml` for reusable, `{name}.yaml` for callers) and independent versioning strategy (`{name}-workflow-v{major}` tags), documented in `.github/workflows/README.md`.
232
+ Moves the reusable release workflow from `williamthorsen/.github` into this repo as `release-workflow.yaml`, stripping all pnpm-related steps since release-kit now runs git-cliff and prettier via `npx` internally. Updates this repo's caller workflow to use a relative path and update init templates to reference the new location. Establishes a naming convention (`{name}-workflow.yaml` for reusable, `{name}.yaml` for callers) and independent versioning strategy (`{name}-workflow-v{major}` tags), documented in `.github/workflows/README.md`.
218
233
 
219
- - #30 release-kit|feat: Allow git-cliff to be used without config (#31)
234
+ - Allow git-cliff to be used without config (#31)
220
235
 
221
- Adds a `resolveCliffConfigPath()` function that searches for a git-cliff config in a 4-step cascade (explicit path → `.config/git-cliff.toml` → `cliff.toml` → bundled `cliff.toml.template`), eliminating the requirement for consuming repos to maintain a cliff config copy. Restructures the `init` command to scaffold only the workflow file by default, with new `--with-config` and `--force` flags. Moves `.release-tags` from `/tmp/release-kit/` to project-local `tmp/` for predictable behavior in local runs.
236
+ Adds a `resolveCliffConfigPath()` function that searches for a git-cliff config in a 4-step cascade (explicit path → `.config/git-cliff.toml` → `cliff.toml` → bundled `cliff.toml.template`), eliminating the requirement for consuming repos to maintain a cliff config copy. Restructures the `init` command to scaffold only the workflow file by default, with new `--with-config` and `--force` flags. Moves `.release-tags` from `/tmp/release-kit/` to project-local `tmp/` for predictable behavior in local runs.
222
237
 
223
238
  ### Refactoring
224
239
 
225
- - #6 release-kit|refactor: Clean up release-kit post-migration issues (#19)
240
+ - Clean up release-kit post-migration issues (#19)
226
241
 
227
- Addresses five code quality issues and a test coverage gap identified during the release-kit migration (#5). Extracts a duplicated `isRecord` type guard into a shared module, eliminates a double-read in `bumpAllVersions`, improves error handling in `usesPnpm` by replacing a silent catch with a structured error boundary, removes an unreachable `'feature'` pattern from version defaults, and adds an integration test for scaffold template path resolution.
242
+ Addresses five code quality issues and a test coverage gap identified during the release-kit migration (#5). Extracts a duplicated `isRecord` type guard into a shared module, eliminates a double-read in `bumpAllVersions`, improves error handling in `usesPnpm` by replacing a silent catch with a structured error boundary, removes an unreachable `'feature'` pattern from version defaults, and adds an integration test for scaffold template path resolution.
228
243
 
229
244
  ## [release-kit-v1.0.1] - 2026-03-14
230
245
 
231
246
  ### Features
232
247
 
233
- - #5 release-kit|feat: Migrate release-kit from toolbelt (#18)
248
+ - Migrate release-kit from toolbelt (#18)
234
249
 
235
- Migrates the complete `@williamthorsen/release-kit` package (v1.0.1) from `williamthorsen/toolbelt` into `packages/release-kit/`, adds shebang preservation to the shared esbuild plugin for CLI binaries, and sets up dogfooding infrastructure so this monorepo uses release-kit for its own releases.
250
+ Migrates the complete `@williamthorsen/release-kit` package (v1.0.1) from `williamthorsen/toolbelt` into `packages/release-kit/`, adds shebang preservation to the shared esbuild plugin for CLI binaries, and sets up dogfooding infrastructure so this monorepo uses release-kit for its own releases.
236
251
 
237
252
  <!-- generated by git-cliff -->
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- UNLICENSED SOFTWARE
1
+ ISC License
2
2
 
3
- Copyright (c) 2023-2025 William Thorsen
3
+ Copyright (c) 2026 William Thorsen
4
4
 
5
- All rights reserved.
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
6
 
7
- This software is provided 'as-is', without any express or implied warranty. No rights are granted to use, copy, modify, or distribute this software for any purpose. For full legal details, consult a legal expert. This notice may not be removed or altered from any distribution.
7
+ The software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.
@@ -1,76 +1,88 @@
1
1
  # git-cliff configuration
2
- # See https://git-cliff.org/docs/configuration
2
+ # Generates changelogs from conventional-ish commit messages.
3
+ #
4
+ # Commit format: [ticket-prefix ]scope|type[!]: description [#PR]
5
+ # Examples:
6
+ # #19 rdy|feat: Add utility functions for common check patterns (#26)
7
+ # AFG-42 panel|fix: Fix button layout (#73)
8
+ #
9
+ # Only ticketed commits (leading #NN or PROJ-NN) are included.
10
+ # Unticketed maintenance commits (deps upgrades, tooling tweaks) are skipped.
3
11
 
4
12
  [changelog]
5
- # changelog header
6
13
  header = """
7
- # Changelog\n
8
- All notable changes to this project will be documented in this file.\n
9
- """
10
- # template for the changelog body
11
- body = """
12
- {% if version %}\
13
- ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
14
- {% else %}\
15
- ## [unreleased]
16
- {% endif %}\
17
- {% for group, commits in commits | group_by(attribute="group") %}
18
- ### {{ group | striptags | trim | upper_first }}
19
- {% for commit in commits %}
20
- - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
21
- {% if commit.breaking %}[**breaking**] {% endif %}\
22
- {{ commit.message | upper_first }}\
23
- {% endfor %}
24
- {% endfor %}\n
14
+ # Changelog
15
+
16
+ All notable changes to this project will be documented in this file."""
17
+ # Render each commit as a bullet with the description (stripped of ticket ID
18
+ # and scope|type prefix). If the commit has a body, render it as indented
19
+ # continuation paragraphs under the bullet.
20
+ body = """{%- if version %}
21
+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
22
+ {%- else %}
23
+ ## [unreleased]
24
+ {%- endif -%}
25
+ {%- set non_merge = commits | filter(attribute="merge_commit", value=false) -%}
26
+ {%- for group, group_commits in non_merge | group_by(attribute="group") %}
27
+
28
+ ### {{ group | striptags | trim | upper_first }}
29
+
30
+ {% for commit in group_commits -%}
31
+ {%- set subject = commit.message | split(pat="\n") | first -%}
32
+ {%- set desc = subject | split(pat=": ") | slice(start=1) | join(sep=": ") -%}
33
+ {%- set body_lines = commit.message | split(pat="\n") | slice(start=2) -%}
34
+ {%- set body_text = body_lines | join(sep="\n") | trim -%}
35
+ {%- if not loop.first %}
36
+
37
+ {% endif -%}
38
+ - {{ desc | upper_first }}
39
+ {%- if body_text %}
40
+
41
+ {{ body_text | split(pat="\n") | join(sep="\n ") }}
42
+ {%- endif -%}
43
+ {%- endfor -%}
44
+ {%- endfor %}
25
45
  """
26
- # template for the changelog footer
27
46
  footer = """
47
+
28
48
  <!-- generated by git-cliff -->
29
49
  """
30
- # remove the leading and trailing whitespace from the templates
31
- trim = true
50
+ trim = false
32
51
 
33
52
  [git]
34
- # parse the commits based on https://www.conventionalcommits.org
35
53
  conventional_commits = false
36
- # filter out the commits that are not conventional
37
54
  filter_unconventional = false
38
- # process each line of a commit as an individual commit
39
55
  split_commits = false
40
- # regex for preprocessing the commit messages
41
- commit_preprocessors = [
42
- # Strip GitHub-style issue prefixes like "#8 " or "#123 "
43
- { pattern = '^#\d+\s+', replace = "" },
44
- # Strip Jira-style ticket prefixes like "TOOL-123 " or "AFG-456 "
45
- { pattern = '^[A-Z]+-\d+\s+', replace = "" },
46
- ]
47
- # regex for parsing and grouping commits
48
- # Supports "type: desc", "scope|type: desc", and "type(scope): desc" formats
56
+ commit_preprocessors = []
57
+ # Require a ticket-ID prefix for inclusion.
58
+ # Supported prefixes: "#123 ", "#123-1 ", "#123.1 ", "TOOL-123 "
49
59
  commit_parsers = [
50
- { message = "^(.*\\|)?fix(\\(.*\\))?(!)?:", group = "Bug fixes" },
51
- { message = "^(.*\\|)?bugfix(\\(.*\\))?(!)?:", group = "Bug fixes" },
52
- { message = "^(.*\\|)?feat(\\(.*\\))?(!)?:", group = "Features" },
53
- { message = "^(.*\\|)?feature(\\(.*\\))?(!)?:", group = "Features" },
54
- { message = "^(.*\\|)?internal(\\(.*\\))?(!)?:", group = "Internal" },
55
- { message = "^(.*\\|)?refactor(\\(.*\\))?(!)?:", group = "Refactoring" },
56
- { message = "^(.*\\|)?tests?(\\(.*\\))?(!)?:", group = "Tests" },
57
- { message = "^(.*\\|)?tooling(\\(.*\\))?(!)?:", group = "Tooling" },
58
- { message = "^(.*\\|)?ci(\\(.*\\))?(!)?:", group = "CI" },
59
- { message = "^(.*\\|)?deps?(\\(.*\\))?(!)?:", group = "Dependencies" },
60
- { message = "^(.*\\|)?docs?(\\(.*\\))?(!)?:", group = "Documentation" },
61
- { message = "^(.*\\|)?fmt(\\(.*\\))?(!)?:", group = "Formatting" },
60
+ { message = "^release:", skip = true },
61
+ { message = "^Merge", skip = true },
62
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?bugfix(!)?:", group = "Bug fixes" },
63
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?ci(!)?:", group = "CI" },
64
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?deprecate(!)?:", group = "Deprecated" },
65
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?deps?(!)?:", group = "Dependencies" },
66
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?docs?(!)?:", group = "Documentation" },
67
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?feat(!)?:", group = "Features" },
68
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?feature(!)?:", group = "Features" },
69
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?fix(!)?:", group = "Bug fixes" },
70
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?fmt(!)?:", group = "Formatting" },
71
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?internal(!)?:", group = "Internal" },
72
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?perf(!)?:", group = "Performance" },
73
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?performance(!)?:", group = "Performance" },
74
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?refactor(!)?:", group = "Refactoring" },
75
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?sec(!)?:", group = "Security" },
76
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?security(!)?:", group = "Security" },
77
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?tests?(!)?:", group = "Tests" },
78
+ { message = "^(\\#\\d+([.\\-]\\d+)?|[A-Z]+-\\d+)\\s+([\\w-]+\\|)?tooling(!)?:", group = "Tooling" },
79
+ # Skip unticketed commits (maintenance, deps, initial scaffolding, etc.)
80
+ { message = ".*", skip = true },
62
81
  ]
63
- # protect breaking changes from being skipped due to matching a skipping commit_parser
64
82
  protect_breaking_commits = false
65
- # filter out the commits that are not matched by commit parsers
66
83
  filter_commits = true
67
- # regex for matching git tags
68
84
  tag_pattern = "v[0-9].*"
69
- # regex for skipping tags
70
85
  skip_tags = ""
71
- # regex for ignoring tags
72
86
  ignore_tags = ""
73
- # sort the tags topologically
74
87
  topo_order = false
75
- # sort the commits inside sections by oldest/newest order
76
88
  sort_commits = "oldest"
package/dist/esm/.cache CHANGED
@@ -1 +1 @@
1
- 917d95efca91465ce82cd15afc45064b9a1f61976c9cd0c7e563a0d87e47bee5
1
+ 020cc360fffab3d5b52fc5e388bc432d37399fdfb25c30cff31a23d37f1c2c09
@@ -0,0 +1 @@
1
+ export declare function assertCleanWorkingTree(): void;
@@ -0,0 +1,15 @@
1
+ import { execFileSync } from "node:child_process";
2
+ function assertCleanWorkingTree() {
3
+ const status = execFileSync("git", ["status", "--porcelain"], {
4
+ encoding: "utf8",
5
+ stdio: ["pipe", "pipe", "pipe"]
6
+ }).trim();
7
+ if (status.length > 0) {
8
+ throw new Error(
9
+ "Working tree has uncommitted changes. Commit or stash them before running prepare, or use --no-git-checks to bypass this check."
10
+ );
11
+ }
12
+ }
13
+ export {
14
+ assertCleanWorkingTree
15
+ };