feat: enforce conventional commits and generate the changelog from them - #1530
Merged
Conversation
A commit-msg hook and a Commitlint workflow on every pull request enforce the 11 conventional types; scopes are derived from the workspace names and only warn for now (DouglasNeuroInformatics#1529). scripts/changelog.ts recommends the bump, writes the release section into CHANGELOG.md and docs/en/6-changelog, and the release job uses that section as the GitHub release body, failing when it is missing. CHANGELOG.md starts with the former v2.0.0 upgrade guide. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARgbo2xng7MUSDVn27d8gp
Rename tsconfig.base.json to tsconfig.json so the root becomes a project that eslint's typed rules and tsc can find, and add a lint:root task that pnpm lint runs alongside the package tasks. The root files leave the eslint ignore list; the findings that surfaced are fixed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARgbo2xng7MUSDVn27d8gp
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.
Summary
commitlint.config.tsextends@commitlint/config-conventionaland derives the permitted scopes from the 27@opendatacapture/*workspace names inpnpm-workspace.yaml(vendor/**excluded on purpose). An unknown type is an error; an unknown scope is a warning for now (Raise the commit scope check from a warning to an error #1529). A huskycommit-msghook checks locally, and a newCommitlintworkflow checks the commits a pull request adds, on PRs to any branch, so forks are covered.scripts/changelog.tsreads the commits since the lastv*tag withconventional-commits-parser.recommendprints the strict-SemVer bump,write <version>inserts a section (Breaking Changes, Features, Bug Fixes, Performance) intoCHANGELOG.mdand regenerates the docs-site copy, andsection <version>prints one section.scripts/increment-version.shnow shows the recommendation before its menu and runs the generator after the bump. Non-conforming commits are skipped with a warning (Raise the commit scope check from a warning to an error #1529 tracks making that an error); a revert cancels its target when both are in the range.releasejob extracts the new section and passes it as the GitHub release body, and fails when the section is missing rather than publishing an empty body.CHANGELOG.mdstarts with the former v2.0.0 upgrade guide, verbatim. The docs site gets a singleChangelogsidebar link to a generated page; theUpdatingsection is removed.tsconfig.base.jsonis renamed totsconfig.jsonso eslint's typed rules andtsccan see the root-level scripts and configs, and alint:rootturbo task runs them as part ofpnpm lint. The root files leave the eslint ignore list; the findings that surfaced are fixed.CONTRIBUTING.md, the rootAGENTS.md,docs/AGENTS.md,apps/outreach/AGENTS.md, the cut-a-release playbook, the release skill, the workspace map and the testing strategy are updated. No tests forscripts/, by decision, recorded in the rootAGENTS.md.New root devDependencies, via the catalog:
@commitlint/cli,@commitlint/config-conventional,conventional-commits-parser.Test plan
pnpm lint(34 tasks, including//#lint:root)pnpm test(1153 passed)pnpm test:e2e(172 passed)pnpm --filter @opendatacapture/outreach buildrenders/en/docs/changelog/with the sidebar linkfeature: xrejected,fix(api): xaccepted,fix(deps): xwarnsincrement-version.shdry run to 2.3.0 produced the expected section, then revertedCHANGELOG.mdsectiontsconfig.json; nothing local builds the images, so the releasebuildjob is the check🤖 Generated with Claude Code