@williamthorsen/release-kit 4.5.0 → 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.
- package/CHANGELOG.md +118 -95
- package/LICENSE +4 -4
- package/cliff.toml.template +66 -54
- package/dist/esm/.cache +1 -1
- package/dist/esm/assertCleanWorkingTree.d.ts +1 -0
- package/dist/esm/assertCleanWorkingTree.js +15 -0
- package/dist/esm/bin/release-kit.js +29 -6
- package/dist/esm/changelogJsonUtils.d.ts +4 -0
- package/dist/esm/changelogJsonUtils.js +29 -0
- package/dist/esm/createGithubRelease.d.ts +11 -0
- package/dist/esm/createGithubRelease.js +54 -0
- package/dist/esm/defaults.d.ts +3 -1
- package/dist/esm/defaults.js +14 -0
- package/dist/esm/generateChangelogJson.d.ts +7 -0
- package/dist/esm/generateChangelogJson.js +196 -0
- package/dist/esm/generateChangelogs.js +25 -9
- package/dist/esm/githubReleaseCommand.d.ts +1 -0
- package/dist/esm/githubReleaseCommand.js +35 -0
- package/dist/esm/index.d.ts +11 -3
- package/dist/esm/index.js +27 -3
- package/dist/esm/injectReleaseNotesIntoReadme.d.ts +2 -0
- package/dist/esm/injectReleaseNotesIntoReadme.js +42 -0
- package/dist/esm/injectSection.d.ts +1 -0
- package/dist/esm/injectSection.js +32 -0
- package/dist/esm/loadConfig.js +35 -3
- package/dist/esm/parseCommitMessage.js +1 -1
- package/dist/esm/prepareCommand.d.ts +1 -0
- package/dist/esm/prepareCommand.js +54 -20
- package/dist/esm/publish.d.ts +1 -1
- package/dist/esm/publish.js +7 -26
- package/dist/esm/publishCommand.js +49 -29
- package/dist/esm/releasePrepare.js +12 -1
- package/dist/esm/releasePrepareMono.js +23 -0
- package/dist/esm/renderReleaseNotes.d.ts +8 -0
- package/dist/esm/renderReleaseNotes.js +40 -0
- package/dist/esm/resolveCommandTags.d.ts +2 -0
- package/dist/esm/resolveCommandTags.js +36 -0
- package/dist/esm/resolveReleaseNotesConfig.d.ts +6 -0
- package/dist/esm/resolveReleaseNotesConfig.js +37 -0
- package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
- package/dist/esm/sync-labels/generateCommand.js +13 -7
- package/dist/esm/sync-labels/presets.d.ts +1 -0
- package/dist/esm/sync-labels/presets.js +10 -0
- package/dist/esm/sync-labels/templates.js +5 -1
- package/dist/esm/typeGuards.d.ts +1 -0
- package/dist/esm/typeGuards.js +5 -1
- package/dist/esm/types.d.ts +29 -0
- package/dist/esm/validateConfig.d.ts +1 -0
- package/dist/esm/validateConfig.js +89 -6
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +4 -3
- package/presets/labels/common.yaml +43 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,228 +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
|
+
## [release-kit-v4.6.0] - 2026-04-15
|
|
6
6
|
|
|
7
7
|
### Features
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- Guard `prepare` against dirty working tree (#188)
|
|
10
|
+
|
|
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
|
+
|
|
13
|
+
The check can be bypassed with `--no-git-checks` (`-n`) and is automatically skipped during `--dry-run`.
|
|
14
|
+
|
|
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
|
|
42
|
+
|
|
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.
|
|
10
46
|
|
|
11
47
|
## [release-kit-v4.4.0] - 2026-04-04
|
|
12
48
|
|
|
13
49
|
### Documentation
|
|
14
50
|
|
|
15
|
-
-
|
|
51
|
+
- Refine README to match preflight documentation standard (#138)
|
|
16
52
|
|
|
17
|
-
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.
|
|
18
54
|
|
|
19
55
|
### Features
|
|
20
56
|
|
|
21
|
-
-
|
|
57
|
+
- Add --version flag to nmr and release-kit (#143)
|
|
22
58
|
|
|
23
|
-
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`.
|
|
24
60
|
|
|
25
|
-
-
|
|
61
|
+
- Detect and report missing build output in bin wrappers (#152)
|
|
26
62
|
|
|
27
|
-
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.
|
|
28
64
|
|
|
29
65
|
### Refactoring
|
|
30
66
|
|
|
31
|
-
-
|
|
67
|
+
- Extract deleteFileIfExists helper (#136)
|
|
32
68
|
|
|
33
|
-
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.
|
|
34
70
|
|
|
35
|
-
-
|
|
71
|
+
- Extract shared CLI argument-parsing utility into core (#151)
|
|
36
72
|
|
|
37
|
-
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.
|
|
38
74
|
|
|
39
75
|
## [release-kit-v4.0.0] - 2026-04-02
|
|
40
76
|
|
|
41
77
|
### Features
|
|
42
78
|
|
|
43
|
-
-
|
|
79
|
+
- Rename reusable workflows to .reusable.yaml convention (#129)
|
|
44
80
|
|
|
45
|
-
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.
|
|
46
82
|
|
|
47
83
|
## [release-kit-v3.0.0] - 2026-03-29
|
|
48
84
|
|
|
49
85
|
### Bug fixes
|
|
50
86
|
|
|
51
|
-
-
|
|
87
|
+
- Pass tag pattern to git-cliff based on tagPrefix (#77)
|
|
52
88
|
|
|
53
|
-
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.
|
|
54
90
|
|
|
55
|
-
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.
|
|
56
92
|
|
|
57
|
-
-
|
|
93
|
+
- Propagate version bumps to workspace dependents (#80)
|
|
58
94
|
|
|
59
|
-
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.
|
|
60
96
|
|
|
61
97
|
### Features
|
|
62
98
|
|
|
63
|
-
-
|
|
99
|
+
- Support conventional-commit format in commit parsing (#85)
|
|
64
100
|
|
|
65
|
-
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.
|
|
66
102
|
|
|
67
|
-
-
|
|
103
|
+
- Add commit command for local release flow (#89)
|
|
68
104
|
|
|
69
|
-
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.
|
|
70
106
|
|
|
71
|
-
-
|
|
107
|
+
- Add CI publish workflow with OIDC trusted publishing (#90)
|
|
72
108
|
|
|
73
|
-
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.
|
|
74
110
|
|
|
75
|
-
-
|
|
111
|
+
- Make --provenance opt-in to support private repos (#94)
|
|
76
112
|
|
|
77
|
-
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`.
|
|
78
114
|
|
|
79
|
-
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.
|
|
80
116
|
|
|
81
117
|
## [release-kit-v2.3.2] - 2026-03-28
|
|
82
118
|
|
|
83
119
|
### Bug fixes
|
|
84
120
|
|
|
85
|
-
-
|
|
121
|
+
- Prevent unparseable commits from being silently dropped (#76)
|
|
86
122
|
|
|
87
|
-
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`.
|
|
88
124
|
|
|
89
125
|
## [release-kit-v2.3.0] - 2026-03-28
|
|
90
126
|
|
|
91
127
|
### Features
|
|
92
128
|
|
|
93
|
-
-
|
|
129
|
+
- Add shared writeFileWithCheck utility and overwrite reporting (#66)
|
|
94
130
|
|
|
95
|
-
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.
|
|
96
132
|
|
|
97
|
-
-
|
|
133
|
+
- Separate tag-write errors from release preparation errors (#67)
|
|
98
134
|
|
|
99
|
-
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.
|
|
100
136
|
|
|
101
|
-
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`.
|
|
102
138
|
|
|
103
139
|
### Tests
|
|
104
140
|
|
|
105
|
-
-
|
|
141
|
+
- Add eligibility check failure and short-circuit tests (#63)
|
|
106
142
|
|
|
107
|
-
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.
|
|
108
144
|
|
|
109
|
-
-
|
|
145
|
+
- Add cliff.toml.template alignment test (#64)
|
|
110
146
|
|
|
111
|
-
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.
|
|
112
148
|
|
|
113
|
-
-
|
|
149
|
+
- Add releasePrepare coverage for bumpOverride, tagPrefix, and dry-run tags (#65)
|
|
114
150
|
|
|
115
|
-
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.
|
|
116
152
|
|
|
117
153
|
## [release-kit-v2.2.0] - 2026-03-27
|
|
118
154
|
|
|
119
|
-
### Dependencies
|
|
120
|
-
|
|
121
|
-
- Root|deps: Add release-kit as root devDependency
|
|
122
|
-
|
|
123
|
-
Make `npx release-kit` and `pnpm exec release-kit` resolve within
|
|
124
|
-
this repo by adding a `workspace:*` dependency that symlinks the bin.
|
|
125
|
-
|
|
126
155
|
### Features
|
|
127
156
|
|
|
128
|
-
-
|
|
157
|
+
- Add sync-labels command (#33)
|
|
129
158
|
|
|
130
|
-
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.
|
|
131
160
|
|
|
132
|
-
-
|
|
161
|
+
- Report up-to-date status for unchanged init files (#35)
|
|
133
162
|
|
|
134
|
-
`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)`.
|
|
135
164
|
|
|
136
|
-
-
|
|
165
|
+
- Auto-detect Prettier for CHANGELOG formatting (#36)
|
|
137
166
|
|
|
138
|
-
|
|
139
|
-
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.
|
|
140
168
|
|
|
141
|
-
-
|
|
169
|
+
- Add tag-creation command (#40)
|
|
142
170
|
|
|
143
|
-
|
|
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.
|
|
144
172
|
|
|
145
|
-
-
|
|
173
|
+
- Add publish command (#42)
|
|
146
174
|
|
|
147
|
-
Adds a `release-kit
|
|
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.
|
|
148
176
|
|
|
149
|
-
-
|
|
177
|
+
- Remove tagPrefix customization from component config (#49)
|
|
150
178
|
|
|
151
|
-
|
|
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.
|
|
152
180
|
|
|
153
|
-
-
|
|
181
|
+
- Add styled terminal output to prepare command (#55)
|
|
154
182
|
|
|
155
|
-
|
|
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.
|
|
156
184
|
|
|
157
|
-
-
|
|
185
|
+
- Extract nmr CLI from core package (#61)
|
|
158
186
|
|
|
159
|
-
|
|
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.
|
|
160
188
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
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.
|
|
164
|
-
|
|
165
|
-
Scopes: core, nmr
|
|
189
|
+
Scopes: core, nmr
|
|
166
190
|
|
|
167
191
|
### Refactoring
|
|
168
192
|
|
|
169
|
-
-
|
|
193
|
+
- Replace dist bin targets with thin wrapper scripts (#48)
|
|
170
194
|
|
|
171
|
-
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.
|
|
172
196
|
|
|
173
|
-
-
|
|
197
|
+
- Separate presentation from logic in prepare workflow (#57)
|
|
174
198
|
|
|
175
|
-
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`.
|
|
176
200
|
|
|
177
201
|
### Tests
|
|
178
202
|
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
Add three tests for previously untested code paths:
|
|
203
|
+
- Cover multi-changelogPaths and error paths (#44)
|
|
182
204
|
|
|
183
|
-
|
|
184
|
-
- `
|
|
185
|
-
- `getCommitsSinceTarget`: `git
|
|
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.
|
|
186
209
|
|
|
187
|
-
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.
|
|
188
211
|
|
|
189
212
|
### Tooling
|
|
190
213
|
|
|
191
|
-
-
|
|
214
|
+
- Adopt nmr to run monorepo and workspace scripts (#38)
|
|
192
215
|
|
|
193
|
-
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.
|
|
194
217
|
|
|
195
218
|
## [release-kit-v2.1.0] - 2026-03-17
|
|
196
219
|
|
|
197
220
|
### Features
|
|
198
221
|
|
|
199
|
-
-
|
|
222
|
+
- Slim down release workflow by removing unnecessary pnpm install (#21)
|
|
200
223
|
|
|
201
|
-
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.
|
|
202
225
|
|
|
203
|
-
-
|
|
226
|
+
- Add --force flag to release-kit prepare (#25)
|
|
204
227
|
|
|
205
|
-
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.
|
|
206
229
|
|
|
207
|
-
-
|
|
230
|
+
- Move reusable release workflow into repo (#26)
|
|
208
231
|
|
|
209
|
-
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`.
|
|
210
233
|
|
|
211
|
-
-
|
|
234
|
+
- Allow git-cliff to be used without config (#31)
|
|
212
235
|
|
|
213
|
-
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.
|
|
214
237
|
|
|
215
238
|
### Refactoring
|
|
216
239
|
|
|
217
|
-
-
|
|
240
|
+
- Clean up release-kit post-migration issues (#19)
|
|
218
241
|
|
|
219
|
-
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.
|
|
220
243
|
|
|
221
244
|
## [release-kit-v1.0.1] - 2026-03-14
|
|
222
245
|
|
|
223
246
|
### Features
|
|
224
247
|
|
|
225
|
-
-
|
|
248
|
+
- Migrate release-kit from toolbelt (#18)
|
|
226
249
|
|
|
227
|
-
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.
|
|
228
251
|
|
|
229
252
|
<!-- generated by git-cliff -->
|
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
ISC License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 William Thorsen
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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.
|
package/cliff.toml.template
CHANGED
|
@@ -1,76 +1,88 @@
|
|
|
1
1
|
# git-cliff configuration
|
|
2
|
-
#
|
|
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
|
|
8
|
-
|
|
9
|
-
"""
|
|
10
|
-
#
|
|
11
|
-
body
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
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
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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 = "^
|
|
51
|
-
{ message = "^
|
|
52
|
-
{ message = "^(
|
|
53
|
-
{ message = "^(
|
|
54
|
-
{ message = "^(
|
|
55
|
-
{ message = "^(
|
|
56
|
-
{ message = "^(
|
|
57
|
-
{ message = "^(
|
|
58
|
-
{ message = "^(
|
|
59
|
-
{ message = "^(
|
|
60
|
-
{ message = "^(
|
|
61
|
-
{ message = "^(
|
|
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
|
-
|
|
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
|
+
};
|