diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 00aa2371..45185550 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,10 +6,11 @@ - [ ] Linked issue; for a new feature, the answers to the five questions - [ ] New or changed tests fail without this change; no test weakened -- [ ] Docs, upgrading notes and `CHANGELOG.md` describe the new state +- [ ] Docs and upgrading notes describe the new state; `CHANGELOG.md` entry (optional) - [ ] Reviewed before opening by someone who did not write it (strongly recommended, mandatory for the maintainer's own AI agents; for AI-written code a person or a separate AI session), and I read, ran and understand all of it ## Test plan - [ ] The checks of [Check your change](https://github.com/eizedev/pivotkit/blob/main/CONTRIBUTING.md#check-your-change): those for every change, and those for what this one changes +- [ ] `npm run growth` passes, or the known baseline entry it fails on is named in the Summary - [ ] What I ran, with numbers where a check gives some, such as benchmark timings: diff --git a/AGENTS.md b/AGENTS.md index c9f34c20..f333350f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -60,6 +60,7 @@ npm run pack:check # what npm pack would publish, checked npm run growth # functions, unused exports, duplication, docs pages may not grow ``` `npm run growth` compares with `scripts/growth-baseline.json`; when an offender shrinks, `node scripts/growth.js --update` lowers it. +When it fails on a known baseline entry, [CONTRIBUTING.md](CONTRIBUTING.md#check-your-change) says what to do. One package, the UI and the browser tests. A package's `AGENTS.md` lists its size and benchmark commands: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82fe5907..997cf7b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ npx playwright install # once, for the browser tests 2. Create a branch named after the change: `feat/...`, `fix/...` or `docs/...`. 3. Write the test first for a fix. Watch it fail, then fix the code. 4. Run the checks below. -5. Update the docs and the changelog. +5. Update the docs. A changelog entry is welcome (see below). 6. Open a pull request. ## Check your change @@ -43,6 +43,18 @@ npm test npm run growth ``` +`npm run growth` checks that functions, unused exports, duplicated code and docs pages do not grow; +the header of `scripts/growth.js` explains each check. If it fails: + +- on a function or docs page that is already in `scripts/growth-baseline.json` under the same file + and name, also when your change made it bigger, or on the total of all docs pages: name it in the + pull request's summary, for example "growth fails on the known entry `LevelMenu`". The red check + is expected, and the maintainer fixes it before the merge. CI skips the later steps of that job, + so run `npm test` and `npm run types` locally and say so. +- because an entry shrank: run `node scripts/growth.js --update` and commit the baseline. +- on anything else (a new entry, duplicated code, a renamed or moved function): that one is yours + to fix. + Then, depending on what you changed: | You changed | Also run | @@ -91,7 +103,9 @@ After `uvx zensical@ build --strict`, `node scripts/check-readme-links. ## Changelog and commits -- Add an entry under `[Unreleased]` in the `CHANGELOG.md` of each package you changed. +- Add an entry under `[Unreleased]` in the `CHANGELOG.md` of each package you changed. It is welcome, + not required: if it is missing, the maintainer adds it before the merge. This includes the entries + a deprecation or a break needs. - Use Conventional Commits with the package as scope: `feat(core): ...`, `fix(react): ...`. ## Pull request @@ -130,7 +144,8 @@ A pull request that deprecates something delivers: - for the services, a `check-config` line that names the id - where possible, the old form keeps working. pivotkit turns it into the new one - a test that uses the old form and checks the warning and the result -- the register entry, a changelog entry with the id, and a row on the upgrading page +- the register entry, a row on the upgrading page, and a changelog entry with the id (welcome, see + [Changelog and commits](#changelog-and-commits)) The removal waits for the next major release. diff --git a/PRODUCT.md b/PRODUCT.md index 781ac87d..b514ad5c 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -108,10 +108,12 @@ same for everyone. [CONTRIBUTING.md](CONTRIBUTING.md) has the commands. - A linked issue. For a new feature, also the answers to the five questions. - Tests that fail without the change and pass with it. No test weakened to pass. -- Docs, upgrading notes and changelogs that describe the new state. +- Docs and upgrading notes that describe the new state. A changelog entry is welcome; + [CONTRIBUTING.md](CONTRIBUTING.md#changelog-and-commits) says what happens without one. - Strongly recommended: an independent review before you open the pull request. Have code an AI assistant wrote reviewed by a reviewer that did not write it (a person or a separate AI session), and read, run and understand it yourself. The maintainer reviews every pull request neutrally anyway. What your own review would have found comes back as questions and change requests, and it delays the merge. -- Green CI on the commit that gets merged. +- Green CI on the commit that gets merged. A growth check that fails on a known entry is the + maintainer's to fix ([CONTRIBUTING.md](CONTRIBUTING.md#check-your-change)). diff --git a/docs/versioning.md b/docs/versioning.md index 204d12ea..4d54eeea 100644 --- a/docs/versioning.md +++ b/docs/versioning.md @@ -91,7 +91,8 @@ From 1.0.0, nothing public goes away without a deprecation first. 5. **A register entry.** The [register below](#register) lists the id, what is deprecated, the replacement, the release that deprecated it and the earliest release that removes it. 6. **A changelog entry and an upgrading row.** The changelog names the id. The upgrading page says - what to change while the deprecation's release is the newest. + what to change while the deprecation's release is the newest. When a contribution leaves the + changelog entry out, the maintainer adds it. Removal comes no earlier than the next major release. [CONTRIBUTING.md](https://github.com/eizedev/pivotkit/blob/main/CONTRIBUTING.md#deprecate-something)