Détail du package

changelogen

unjs187.1kMIT0.6.2

Generate Beautiful Changelogs using Conventional Commits

readme

changelogen

npm version npm downloads Codecov License

Generate Beautiful Changelogs using Conventional Commits

Quick Start

Generate a changelog in Markdown format and display in the console:

npx changelogen@latest

Generate a changelog, bump the version in package.json and update CHANGELOG.md (without commit):

npx changelogen@latest --bump

Bump the version, update CHANGELOG.md and make a git commit and tag:

npx changelogen@latest --release

CLI Usage

npx changelogen@latest [...args] [--dir <dir>]

Arguments:

  • --from: Start commit reference. When not provided, latest git tag will be used as default.
  • --to: End commit reference. When not provided, latest commit in HEAD will be used as default.
  • --dir: Path to git repository. When not provided, current working directory will be used as as default.
  • --clean: Determine if the working directory is clean and if it is not clean, exit.
  • --output: Changelog file name to create or update. Defaults to CHANGELOG.md and resolved relative to dir. Use --no-output to write to console only.
  • --noAuthors: Skip contributors section in changelog.
  • --bump: Determine semver change and update version in package.json.
  • --release. Bumps version in package.json and creates commit and git tags using local git. You can disable commit using --no-commit and tag using --no-tag. You can enable the automatic push of the new tag and release commit to your git repository by adding --push.
  • --publish. Publishes package as a new version on npm. You will need to set authorisation tokens separately via .npmrc or environment variables.
  • --publishTag Use custom npm tag for publishing (Default is latest)
  • --nameSuffix: Adds suffix to package name (Example: --nameSuffix canary renames foo to foo-canary)
  • --versionSuffix: Adds suffix to package version. When set without value or to true, uses date + commit hash as commit
  • --canary. Shortcut to --bump --versionSuffix (--nameSuffix will be also added if arg has a string value).
  • -r: Release as specific version.
  • --major: Bump as a semver-major version
  • --minor: Bump as a semver-minor version
  • --patch: Bump as a semver-patch version
  • --premajor: Bump as a semver-premajor version, can set id with string.
  • --preminor: Bump as a semver-preminor version, can set id with string.
  • --prepatch: Bump as a semver-prepatch version, can set id with string.
  • --prerelease: Bump as a semver-prerelease version, can set id with string.
  • --hideAuthorEmail: Do not include author email in changelog if github username cannot be found.

[!NOTE] Version numbers starting with 0. or 0.0. follow different rules.

In these cases, the second or third digit is treated as the major version. They use the formats 0.major.minor and 0.0.major instead of the standard major.minor.patch.

To ensure consistent semantic versioning, start version numbering at 1.0.0.

changelogen gh release

Changelogen has built-in functionality to sync with Github releases.

In order to manually sync a release, you can use changelogen gh release. It will parse current CHANGELOG.md from current repository (local, then remote) and create or update releases.

Usage:

npx changelogen@latest gh release [all|versions...] [--dir] [--token]

To enable this integration, make sure there is a valid repository field in package.json or repo is set in .changelogenrc.

By default in unauthenticated mode, changelogen will open a browser link to make manual release. By providing github token, it can be automated.

  • Using environment variables or .env, use CHANGELOGEN_TOKENS_GITHUB or GITHUB_TOKEN or GH_TOKEN
  • Using CLI args, use --token <token>
  • Using global configuration, put tokens.github=<token> inside ~/.changlogenrc
  • Using GitHub CLI token when authenticated with gh auth login

Configuration

Configuration is loaded by unjs/c12 from cwd. You can use either changelog.config.json, changelog.config.{ts,js,mjs,cjs}, .changelogrc or use the changelog field in package.json.

See ./src/config.ts for available options and defaults.

💻 Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

v0.6.2

compare changes

🩹 Fixes

  • cli: Accept hideAuthorEmail arg (#275)

📖 Documentation

  • Add note about version number interpretation (#272)

🌊 Types

  • config.types accept boolean value (#278)

🏡 Chore

❤️ Contributors

v0.6.1

compare changes

🩹 Fixes

  • Pass cwd in more places before running commands (#266)

🏡 Chore

✅ Tests

❤️ Contributors

v0.6.0

compare changes

🚀 Enhancements

  • Update jiti to v2 (6e85d32)
  • Add check for breaking changes in commit body (#228)
  • Hide author email address via flag (#247)
  • Add noAuthors option (#183)

🩹 Fixes

  • Use https proto for author's github link (#225)
  • Use https proto for author's github link in tests (#226)
  • Release version regex supporting pre versions (#259)
  • Use correct compare changes URL for Bitbucket (#257)
  • Use tag template for version title and compare change link (#255)
  • Render usernames in github changelog (#265)

💅 Refactors

  • Use consola for colors (49e0401)
  • Use confbox for yaml parsing (19e940c)

📦 Build

🏡 Chore

✅ Tests

  • Add tests for parsing co-authors from commit body (#229)

⚠️ Breaking Changes

❤️ Contributors

v0.5.7

compare changes

🩹 Fixes

  • bump: Avoid using + for canary suffix (#224)

❤️ Contributors

  • Pooya Parsa (@pi0)

v0.5.6

compare changes

🚀 Enhancements

  • Add option to sign git tags (#117)
  • git: Support parse git messages that have prefix emoji (#146)

🩹 Fixes

  • github: Use bearer token (#180)
  • Handle repo name with multiple segments (#219)
  • Lowercase scope when filtering (#199)

💅 Refactors

  • Replace execa with execSync (#222)
  • Use human readable date for canary versions (#223)
  • Update execCommand (68127be)

🏡 Chore

❤️ Contributors

v0.5.5

compare changes

🚀 Enhancements

  • repo option as string (#128)
  • Add param to require clean working dir (#92, #93)
  • Add excludeAuthors option (#95)

🩹 Fixes

  • Extra spaces in contributors and breaking changes (#134)
  • Repo name with - or . (#127)

🏡 Chore

❤️ Contributors

v0.5.4

compare changes

🚀 Enhancements

  • Support --publish and --canary (#123)

🩹 Fixes

  • markdown: Remove unnecessary spaces (#106)
  • Add missing type export to package.json (#113)

📖 Documentation

  • Add documentation about --push flag (#114)

❤️ Contributors

v0.5.3

compare changes

v0.5.2

compare changes

🚀 Enhancements

  • Resolve repository config from git remote (8401f91)
  • Load config from changelog field in package.json (#88)
  • Bump pre version (#70)
  • Support templates for commit and tag messages (#68)

🩹 Fixes

  • Handle unset value for config.repo (#72)
  • getLastGitTag: Handle when there are no git tags (#77)

💅 Refactors

🏡 Chore

  • Update badges and small improvements (146d1d4)
  • Update dev dependencies (0f44ee9)

❤️ Contributors

v0.5.1

compare changes

🩹 Fixes

  • Allow providing no versions (ac84c39)
  • Use parsed release body (aec2341)
  • Strip title line from release (319f7ce)

🏡 Chore

  • Simplify release command (225fa64)

❤️ Contributors

  • Pooya Parsa (@pi0)

v0.5.0

compare changes

🚀 Enhancements

  • Update execa to v7 (e61e2f6)
  • ⚠️ Support different repository providers (#55)
  • Github release integration (#67)
  • Support explicit bumping as major, minor, or patch via cli (c8afa86)
  • Automatically resolve github token from gh cli (231a3ec)
  • Default gh release to latest version (44788f5)

🩹 Fixes

  • Stage CHANGELOG.md and package.json when releasing (69d375c)
  • Add correct output file to git (#64)
  • Update ungh link (a5ab510)
  • Only access latest tag accessible from current branch (#69)
  • cli: Don't eat up first -* arg (77b483b)

🏡 Chore

  • Fix lint issue and update snapshots (e162ab8)
  • Mention gh cli login (7f4a05f)

⚠️ Breaking Changes

  • ⚠️ Support different repository providers (#55)

❤️ Contributors

v0.4.1

compare changes

🩹 Fixes

  • Bump by patch by default (7e38438)

🏡 Chore

❤️ Contributors

v0.4.0

compare changes

🚀 Enhancements

  • ⚠️ Resolve github usernames using ungh/ungh (#46)

🩹 Fixes

  • markdown: Avoid rendering noreply.github.com emails (4871721)
  • Avoid rendering authors with [bot] in their name (4f3f644)
  • Format name to avoid duplicates (f74a988)

⚠️ Breaking Changes

  • ⚠️ Resolve github usernames using ungh/ungh (#46)

❤️ Contributors

  • Pooya Parsa (@pi0)

v0.3.5

compare changes

🩹 Fixes

  • Only skip non breaking chre(deps) (20e622e)

❤️ Contributors

  • Pooya Parsa

v0.3.4

compare changes

🚀 Enhancements

  • Infer github config from package.json (#37)

❤️ Contributors

  • Pooya Parsa

v0.3.3

compare changes

🚀 Enhancements

  • Expose determineSemverChange and bumpVersion (5451f18)

🩹 Fixes

  • Let --output work without value (#43)
  • Consider docs and refactor as semver patch for bump (648ccf1)

🏡 Chore

❤️ Contributors

  • Lvjiaxuan
  • Pooya Parsa

v0.3.2

compare changes

🩹 Fixes

  • Use release version in changelog title (04671a6)

❤️ Contributors

  • Pooya Parsa

0.3.1

🚀 Enhancements

  • Handle new version before generating changelog (fd56f6b)

🩹 Fixes

  • Use creatordate to find last tag (#39)

❤️ Contributors

  • Ahad Birang
  • Pooya Parsa

0.3.0

🚀 Enhancements

  • cli: ⚠️ Show changelog in CLI unless bumping or releasing (d348943)

⚠️ Breaking Changes

  • cli: ⚠️ Show changelog in CLI unless bumping or releasing (d348943)

❤️ Contributors

  • Pooya Parsa

0.2.3

🩹 Fixes

  • Import semver as default import (3bd0b61)

❤️ Contributors

  • Pooya Parsa

0.2.2

🚀 Enhancements

  • Generate markdown links when github is provided (ffe1d08)

✅ Tests

❤️ Contributors

  • Pooya Parsa

0.2.1

🩹 Fixes

  • Use last commit for changelog diff (6ac4b4b)
  • Use h2 for title (fc0967c)

✅ Tests

  • Update snapshot (102aa98)

❤️ Contributors

  • Pooya Parsa

0.2.0

🚀 Enhancements

  • GetGitDiff ignores from (#17)
  • Add gitmoji support (#22)
  • Auto-update changelog files (#24)
  • Support --bump to update version while generating changelog (9bf9aff)
  • Basic --release support (934c487)

🩹 Fixes

  • Expose ./config (#10)
  • Use getCurrentGitRef (#15)
  • parse: ⚠️ references with type (#27)
  • Convertminor to patch for 0.x versions (011b6a1)
  • Run release step last (b052f55)
  • Handle breaking change commits for bumping (f7ffaa4)
  • Show original semver type without 0.x changes in log (ddd818a)
  • Use v prefix for git tag and annotate (bf6b5da)
  • Add missing annotate message (157b0c5)

💅 Refactors

  • Use lines array for constructing markdown (#16)

🏡 Chore

  • Update lockfile and vitest config (48f609b)
  • Use changelogen release flow (2a8bb4f)

⚠️ Breaking Changes

  • parse: ⚠️ references with type (#27)

❤️ Contributors

  • Anthony Fu
  • Conner
  • Pooya Parsa
  • 三咲智子

0.1.1

Bug Fixes

  • remove general in entries without scope (31a0861)

0.1.0

⚠ BREAKING CHANGES

  • use flat scopes

  • use flat scopes (8e33e93)

0.0.6

0.0.5

Features

  • add missing commitlint types (#6) (0a6deef)

0.0.4

Bug Fixes

  • cli: use /usr/bin/env (resolves #5) (e4218cc)

0.0.3

Features

  • generate breaking changes section (cc0b427)

Bug Fixes

  • avoid .exec for multi matches (7c612fc)
  • format names for case matching (ece2d90)

0.0.2 (2022-05-02)