-
Notifications
You must be signed in to change notification settings - Fork 84
fix: generate correct changelogs when doing a PR #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tested locally and seems to work nicely.
$ pnpm --recursive --filter "@tutorialkit/*" exec pnpm version --no-git-tag-version --allow-same-version 0.0.1
v0.0.1
v0.0.1
v0.0.1
v0.0.1
v0.0.1
$ pnpm changelog
UPDATED packages/runtime/CHANGELOG.md 0.0.1
UPDATED packages/cli/CHANGELOG.md 0.0.1
UPDATED packages/astro/CHANGELOG.md 0.0.1
UPDATED packages/components/react/CHANGELOG.md 0.0.1
UPDATED packages/theme/CHANGELOG.md 0.0.1
UPDATED packages/types/CHANGELOG.md 0.0.1
UPDATED packages/create-tutorial/CHANGELOG.md 0.0.1-alpha.23
UPDATED CHANGELOG.md 0.0.1
$ git status
modified: CHANGELOG.md
modified: packages/astro/CHANGELOG.md
modified: packages/cli/CHANGELOG.md
modified: packages/components/react/CHANGELOG.md
modified: packages/runtime/CHANGELOG.md
modified: packages/theme/CHANGELOG.md
modified: packages/types/CHANGELOG.md
scripts/changelog/Package.mjs
Outdated
|
||
export class Package { | ||
/** | ||
* @param {PackageDefinition} pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be PackageConfiguration
?
* @param {PackageDefinition} pkg | |
* @param {PackageConfiguration} pkg |
To be able to reference that, let's move it into this file from changelog.mjs
instead:
/**
* @typedef {{
* path: string;
* excluded?: true;
* sameAs?: string;
* }} PackageConfiguration A package in the monorepo to generate changelog for.
*/
export class Package {
/**
* @param {PackageConfiguration} pkg
*/
Then use it in changelog.mjs
:
/**
* @type {import('./changelog/Package.mjs').PackageConfiguration[]}
*/
const PACKAGES = [
{ path: './packages/astro' },
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is nice! Thanks 😃
import fs from 'node:fs'; | ||
import addStream from 'add-stream'; | ||
import chalk from 'chalk'; | ||
import conventionalChangelog from 'conventional-changelog'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the package I mentioned earlier: https://github.com/antfu/changelogithub. It creates changelogs like https://github.com/unocss/unocss/releases/tag/v0.39.0.
This PR fix the changelog generation so that it when we do
pnpm changelog
it generate the changelog for every packages, in particular the CLI. The previous release PR didn't had the changelog for the CLI because we are bumping the CLI at a later point.