Skip to content

Commit 63b1dcf

Browse files
tanemclaude
andcommitted
Correct and extend AGENTS.md
The React boundary verification snippet chained `cd test/react/<version>` into the jest run, so jest resolved `--config ./scripts/jest/config.src.js` against the version directory, which holds only `package.json` and `node_modules`. It failed with "Can't find a root directory while resolving a config file path". `scripts/test-react.js` scopes only the install to that directory and runs jest from the repo root, which is what `config.src.js` needs: it sets `rootDir` to the current working directory and `roots` to `<rootDir>/test`. The install now runs in a subshell so the jest line keeps the repo root. Checked against 16.14 and 17.0, 26 tests passing on each. Three gaps alongside it. Nothing recorded how a release triggers. `release.yml` runs on a Monday cron against master with no content gate, and `tanem-scripts release` throws on unlabelled and multi-labelled PRs while deriving the bump from the labels it finds. An agent opening an unlabelled PR breaks the next release with no local signal that it did. MIGRATION.md appeared only in a list of docs to keep current, so the rule that a breaking change earns an entry was left to inference. It now sits under Versioning, next to the semver rule it follows from. The coverage requirement read as machine-enforced. `config.src.js` sets no `coverageThreshold` and `codecov.yml` turns patch status off, so a drop below 100% fails nothing and has to be read off the report. `roadmap/` stays undocumented here: it is excluded via `.git/info/exclude` and is not present in a fresh clone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b5855a7 commit 63b1dcf

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,15 @@ Managed by Renovate (`config:js-lib` preset):
6262
## Testing
6363

6464
- **100% code coverage** of `src` is required. Coverage is collected by
65-
`npm run test:src` only.
65+
`npm run test:src` only. No `coverageThreshold` is configured, so a drop
66+
will not fail the run: read the report.
6667
- `npm run test:cjs` and `npm run test:es` re-run the hook and component
6768
specs against `dist/react-nprogress.cjs` and `dist/react-nprogress.mjs`,
68-
so they need a build first. `npm test` builds before running them.
69+
and `npm run test:bundles` asserts what the build emits, so all three need
70+
a build first. `npm test` builds before running them.
71+
- `test/bundles.spec.ts` is excluded from `config.src.js` so that `test:src`
72+
and the React matrix stay runnable without a build. A new spec that reads
73+
`dist` belongs in `config.bundles.js`, not alongside the source specs.
6974
- Always run `npm test` after changes; use `npm run test:src` for quick
7075
source-only feedback during development.
7176
- Use `npm run test:react` for the full React version matrix independently.
@@ -88,9 +93,11 @@ When adding a new boundary:
8893
16.x for React 18+). React 16–17 also need
8994
`@testing-library/react-hooks` (8.x) and `react-test-renderer`.
9095
2. Replace the previous "latest minor" for that major.
91-
3. Verify with a single-version run before the full matrix:
96+
3. Verify with a single-version run before the full matrix. Install inside
97+
the version directory, but run jest from the repo root: the config sets
98+
`rootDir` to the current working directory.
9299
```bash
93-
cd test/react/<version> && npm i --no-package-lock --quiet --no-progress
100+
(cd test/react/<version> && npm i --no-package-lock --quiet --no-progress)
94101
REACT_VERSION=<version> npx jest --config ./scripts/jest/config.src.js --coverage false
95102
```
96103
4. Update the boundary list above.
@@ -152,6 +159,20 @@ in `.prettierignore` rather than tracked.
152159
Strict semver: no breaking changes without a major version bump, including
153160
technical refactors.
154161

162+
Every breaking change needs a MIGRATION.md entry under the target major's
163+
heading, describing the change and the action required.
164+
165+
## Releases
166+
167+
`.github/workflows/release.yml` runs on a Monday cron against master with no
168+
content gate: whatever is on master ships in the next release.
169+
170+
`tanem-scripts release` derives the bump from PR labels. Every PR merged
171+
since the last tag must carry exactly one label, ignoring `safe to test`. It
172+
throws on unlabelled and on multi-labelled PRs. `breaking` selects a major,
173+
`enhancement` a minor, anything else a patch. Renovate labels its own PRs
174+
`internal`.
175+
155176
## Documentation
156177

157178
- After each code change, update all related docs and markdown files

0 commit comments

Comments
 (0)