chore: move changelog generation to after:bump hook#91
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the release workflow in package.json by replacing the before:npm:release hook with an after:bump hook for generating the changelog and documentation. A review comment identifies that the new git add command only stages CHANGELOG.md, which would omit the generated documentation files from the release commit, and suggests explicitly adding the docs directory to the staging command.
| "after:bump": [ | ||
| "npx auto-changelog -p", | ||
| "npm run docs", | ||
| "git add CHANGELOG.md" | ||
| ] |
There was a problem hiding this comment.
The after:bump hook includes npm run docs, which generates documentation in the ./docs/ directory (as specified in typedoc.json). By narrowing git add -A to git add CHANGELOG.md, the updated documentation files are no longer staged for the release commit.
If these docs are intended to be versioned in the repository (e.g., for GitHub Pages), they should be explicitly added. Otherwise, they will remain as unstaged changes and won't be included in the release tag or the release/${version} branch created in the after:release hook.
| "after:bump": [ | |
| "npx auto-changelog -p", | |
| "npm run docs", | |
| "git add CHANGELOG.md" | |
| ] | |
| "after:bump": [ | |
| "npx auto-changelog -p", | |
| "npm run docs", | |
| "git add CHANGELOG.md docs" | |
| ] |
Move auto-changelog generation from before:npm:release to after:bump so the updated CHANGELOG.md is included in the release commit and tag. Also narrows git add -A to git add CHANGELOG.md to avoid staging unrelated files.