Skip to content

aklinker1/zero-changelog

Repository files navigation

@aklinker1/zero-changelog

JSR NPM Version Docs Install Size

Zero-dependency, conventional commit release and changelog generator with monorepo support

bun add @aklinker1/zero-changelog

Features

  • 📦 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/release@v1.0.0
  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 --help

Semver

@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
  • 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
  • Stable: [1-9][0-9]*.[0-9]+.[0-9]+

    • Examples: 1.1.0, 2.0.1, 3.0.0

It does NOT support:

  • Truncated versions with one or two digits:
    • Examples: 1.0, 2
  • Unstable prereleases:
    • Examples: 0.2.0-alpha.1
  • Non X.0.0 prereleases:
    • Examples: 1.1.0-rc.1, 1.0.5-alpha.1
  • Other prerelease formats:
    • Examples: 0.2.0-0.3.2, 0.2.0-1

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:

  1. Unstable: The type of semver change will be lowered by 1, so majorminor, minorpatch, patchpatch.

    • Examples:
      • 0.1.0major0.2.0
      • 0.1.0minor0.1.1
      • 0.1.0patch0.1.1
  2. Prereleases: The final integer will always be updated.

    • Examples:
      • 1.0.0-alpha.1major1.0.0-alpha.2
      • 1.0.0-alpha.1minor1.0.0-alpha.2
      • 1.0.0-alpha.1patch1.0.0-alpha.2

So if you want to switch between versions types (stable ↔ unstable ↔ pre-release), like 0.7.51.0.0 or 2.0.0-rc.42.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.

TODO

  • Structure for package + action
  • Implement tests
  • Implement git logic
  • Implement sync releases
  • Implement unreleased commit summary
  • Glob patterns for github action
  • CLI?
  • Implement alpha/beta version bumping

About

Zero-dependency conventional commit release and changelog generator

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors