Skip to content

Add proper-changelog tool#1278

Merged
ecraig12345 merged 12 commits into
mainfrom
proper-changelog
Jun 13, 2026
Merged

Add proper-changelog tool#1278
ecraig12345 merged 12 commits into
mainfrom
proper-changelog

Conversation

@ecraig12345

@ecraig12345 ecraig12345 commented Jun 12, 2026

Copy link
Copy Markdown
Member

GitHub releases are useful in some ways, but they're horrible as changelogs if you need to look at changes across multiple versions or figure out when a specific change was introduced. This tool reads GitHub releases and generates a single markdown changelog.

This PR adds a tool proper-changelog which fetches a repo's releases and formats them as a markdown changes, with various customization options.

Try it out (some of the special header formatting logic was based on these packages):

yarn proper-changelog --package tsx --limit 10
yarn proper-changelog --repo TypeStrong/ts-node

From the readme:

Usage

# By GitHub repository
npx proper-changelog --repo <owner>/<repo>

# By npm package name (the GitHub repository is read from the latest published version)
npx proper-changelog --package <package-name>

Exactly one of --repo or --package is required.

Releases are listed newest-first by published date. Draft releases are always excluded, and prereleases are excluded unless --include-prereleases is passed.

By default this writes the changelog to CHANGELOG-<package-or-repo>.md in the current directory (using the package name when --package is given, otherwise the repo name). Use --stdout to print it instead, or --out to choose a different file name.

# Write to a custom file
npx proper-changelog --repo microsoft/beachball --out CHANGELOG.md

# Print to stdout
npx proper-changelog --repo microsoft/beachball --stdout

# Resolve the repository from an npm package
npx proper-changelog --package @fluentui/react --stdout

Options

Either --package or --repo is required, and they're mutually exclusive.

Option Description
--repo <owner/repo> GitHub repository to read releases from.
--package <name> npm package whose GitHub repository should be used (read from the latest published version on npmjs.com; only supports github.com repos). Note that for a monorepo, this does not do any filtering of releases by package.
-o, --out <file> Output file name (default: CHANGELOG-<package-or-repo>.md). Mutually exclusive with --stdout.
--stdout Write the changelog to stdout instead of a file. Mutually exclusive with --out.
--token <token> GitHub token (see Authentication).
--include-prereleases Include prerelease releases. Draft releases are always excluded.
--from <tag> Include releases up to and including this tag (based on date, not semver).
--to <tag> Include releases down to and including this tag (based on date, not semver).
--limit <n> Maximum number of releases to include.
--filter <pattern> Only include releases whose tag matches <pattern>. A plain string matches tags containing it (case-insensitive); wrap the value in slashes (e.g. /^v1\./i) to match with a regular expression. Useful for monorepos that tag releases per package. (Warning: this is not sanitized, so ReDOS yourself at will.)
--since <date> Only include releases published after this date. Accepts any value parseable by new Date(), such as 2024-01-01.

Authentication

The GitHub API is rate-limited for unauthenticated requests. To use a token, the tool checks the following in order:

  1. The --token option
  2. The GITHUB_TOKEN or GH_TOKEN environment variables
  3. The output of gh auth token (if the GitHub CLI is installed and authenticated)

If no token is found, the tool prints a warning and continues unauthenticated.

Comment thread packages/proper-changelog/src/selectReleases.ts Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new workspace package/tool, proper-changelog, which fetches a repository’s GitHub Releases and renders them into a single consolidated Markdown changelog (with filtering/ranging options and a CLI). This fits the monorepo as an additional published utility package alongside existing release/versioning tooling.

Changes:

  • Adds packages/proper-changelog (CLI, release fetching, selection/rendering logic, tests, and README).
  • Updates the shared scripts/config/tsconfig.base.json to enable .ts-extension imports and extension rewriting.
  • Adjusts the release workflow behavior and updates yarn.lock for new dependencies.

Reviewed changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Adds lockfile entries for proper-changelog and its dependencies (commander, nano-spawn).
scripts/config/tsconfig.base.json Enables rewriteRelativeImportExtensions + allowImportingTsExtensions in the shared TS base config.
packages/proper-changelog/tsconfig.json Sets up TS compilation for the new tool package (NodeNext module/resolution).
packages/proper-changelog/src/types.ts Defines core types (GitHub release type + options).
packages/proper-changelog/src/selectReleases.ts Implements release filtering/sorting/ranging/limiting logic.
packages/proper-changelog/src/resolveToken.ts Resolves GitHub token from CLI/env/gh auth token.
packages/proper-changelog/src/resolveRepoFromPackage.ts Resolves owner/repo from npm package metadata and fetches registry manifest.
packages/proper-changelog/src/renderChangelog.ts Renders releases into a single Markdown changelog with heading normalization.
packages/proper-changelog/src/fetchReleases.ts Fetches releases from GitHub REST API with pagination and error reporting.
packages/proper-changelog/src/cli.ts Provides CLI option parsing and orchestration (fetch → render → output).
packages/proper-changelog/src/**/tests/* Adds Jest coverage for core behaviors (selection, rendering, fetch, token/repo resolution, CLI parsing).
packages/proper-changelog/src/fixtures/makeRelease.ts Test fixture helper for GitHub release objects.
packages/proper-changelog/README.md Documents usage/options/auth for the new CLI tool.
packages/proper-changelog/package.json Defines the new published CLI package metadata/scripts/deps.
packages/proper-changelog/jest.config.js Jest ESM config for the new package.
packages/proper-changelog/eslint.config.js ESLint config wiring for the new package.
packages/proper-changelog/bin/proper-changelog.js Node shebang entrypoint calling the CLI.
packages/proper-changelog/.depcheckrc.yml Depcheck configuration for the new package.
change/proper-changelog-09b60638-6897-444b-8606-da737bda3a24.json Beachball change file for initial release.
.github/workflows/release.yml Removes the prior branch gate and stops invoking the canary release command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/proper-changelog/package.json Outdated
Comment thread packages/proper-changelog/src/cli.ts Outdated
Comment thread .github/workflows/release.yml
@ecraig12345 ecraig12345 requested a review from Copilot June 13, 2026 09:28
@ecraig12345 ecraig12345 merged commit 415d6a7 into main Jun 13, 2026
12 checks passed
@ecraig12345 ecraig12345 deleted the proper-changelog branch June 13, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.

);
}

return { ...rawOptions, repo, token };
Comment on lines 48 to 52
# TODO (release): switch back to regular release
- name: Publish packages
# (temporarily add yarn release:canary when ready)
- name: Publish packages (non-prerelease)
run: |
git config user.email "kchau@microsoft.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants