Add proper-changelog tool#1278
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.jsonto enable.ts-extension imports and extension rewriting. - Adjusts the release workflow behavior and updates
yarn.lockfor 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.
41885ad to
e5eab52
Compare
| ); | ||
| } | ||
|
|
||
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-changelogwhich 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):
From the readme:
Usage
Exactly one of
--repoor--packageis required.Releases are listed newest-first by published date. Draft releases are always excluded, and prereleases are excluded unless
--include-prereleasesis passed.By default this writes the changelog to
CHANGELOG-<package-or-repo>.mdin the current directory (using the package name when--packageis given, otherwise the repo name). Use--stdoutto print it instead, or--outto choose a different file name.Options
Either
--packageor--repois required, and they're mutually exclusive.--repo <owner/repo>--package <name>-o, --out <file>CHANGELOG-<package-or-repo>.md). Mutually exclusive with--stdout.--stdout--out.--token <token>--include-prereleases--from <tag>--to <tag>--limit <n>--filter <pattern><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>new Date(), such as2024-01-01.Authentication
The GitHub API is rate-limited for unauthenticated requests. To use a token, the tool checks the following in order:
--tokenoptionGITHUB_TOKENorGH_TOKENenvironment variablesgh auth token(if the GitHub CLI is installed and authenticated)If no token is found, the tool prints a warning and continues unauthenticated.