@aklinker1/zero-changelog
v0.1.5
Published
Zero-dependency, conventional commit release and changelog generator with monorepo support
Maintainers
Readme
@aklinker1/zero-changelog
Zero-dependency, conventional commit release and changelog generator with monorepo support
bun add @aklinker1/zero-changelogFeatures
- 📦 Zero dependencies, e18e first
- 🏗️ Monorepo & sub-directory support
- 🛠️ Github Action, JS API, CLI
- 🚀 Runs custom publish scripts
- 📊 Summarize unreleased changes
Options
Refer to the API reference:
Usage
GitHub Action
- uses: aklinker1/zero-changelog/actions/[email protected]
with:
# options...JS API
import { release } from "@aklinker1/zero-changelog/release";
await release({
// options...
});CLI
TODO: CLI not implemented yet.
Run any command with --help to see available options.
bun zero-changelog --help
bun zero-changelog release --help
bun zero-changelog sync-releases --help
bun zero-changelog summarize-unreleased-changes --helpSemver
@aklinker1/zero-changelog does not implement the entire Semver spec. It only supports the
following types of versions:
✅ Unstable:
0.[0-9]+.[0-9]+- Examples:
0.0.0,0.12.1,0.1.9,0.20.17
- Examples:
✅ Prerelease:
[1-9][0-9]*.0.0-\w+.[0-9]+- Examples:
1.0.0-alpha.1,2.0.0-beta.3,3.0.0-rc.10
- Examples:
✅ Stable:
[1-9][0-9]*.[0-9]+.[0-9]+- Examples:
1.1.0,2.0.1,3.0.0
- Examples:
It does NOT support:
- ❌ Truncated versions with one or two digits:
- Examples:
1.0,2
- Examples:
- ❌ Unstable prereleases:
- Examples:
0.2.0-alpha.1
- Examples:
- ❌ Non X.0.0 prereleases:
- Examples:
1.1.0-rc.1,1.0.5-alpha.1
- Examples:
- ❌ Other prerelease formats:
- Examples:
0.2.0-0.3.2,0.2.0-1
- Examples:
This allows the package to have 0 dependencies.
Relative Version Bumping
When bumping the version by major, minor, or patch, either by setting the bump option or
auto-detecting the type based on commits, there are some special cases where the version may not be
bumped as expected:
Unstable: The type of semver change will be lowered by 1, so
major→minor,minor→patch,patch→patch.- Examples:
0.1.0→major→0.2.00.1.0→minor→0.1.10.1.0→patch→0.1.1
- Examples:
Prereleases: The final integer will always be updated.
- Examples:
1.0.0-alpha.1→major→1.0.0-alpha.21.0.0-alpha.1→minor→1.0.0-alpha.21.0.0-alpha.1→patch→1.0.0-alpha.2
- Examples:
So if you want to switch between versions types (stable ↔ unstable ↔ pre-release), like 0.7.5
→ 1.0.0 or 2.0.0-rc.4 → 2.0.0, you need to provide the next version number for the
bump option instead of using major/minor/patch:
await release({
bump: "2.0.0",
});Otherwise stable versions will remain stable, unstable will remain unstable, and prereleases will remain prereleases.
Plan
Release:
- List git commits
- Detect type of version bump
- Generate changelog
- Bump version in version files
- Update changelog
- Git commit & tag
- Git push
- Create release
Sync Releases:
- Parse changelog
- Update each release to match changelog
Summarize Unreleased Changes:
- List commits in each directory since the last commit
- Print and return the summary
TODO
- [x] Structure for package + action
- [x] Implement tests
- [x] Implement git logic
- [ ] Implement sync releases
- [x] Glob patterns for github action
- [x] Implement unreleased commit summary
- [ ] CLI?
- [x] Implement alpha/beta version bumping
