@@ -7,7 +7,7 @@ changes agent behaviour and cannot be inferred from the codebase or tooling.
77
88TypeScript React library providing a slim progress bar primitive via three
99patterns: ` useNProgress ` hook, ` NProgress ` render-props component, and
10- ` withNProgress ` HOC. Exports logic only — no rendering. All exports go through
10+ ` withNProgress ` HOC. Exports logic only, not rendering. All exports go through
1111` src/index.tsx ` . Types live in ` src/types.ts ` .
1212
1313## Key Commands
@@ -22,14 +22,15 @@ npm run format # fix lint and formatting
2222
2323### Comments
2424
25- - Use ` // ` line comments only — never ` /* */ ` or ` /** */ `
25+ - Use ` // ` line comments only, never ` /* */ ` or ` /** */ `
2626- Explain _ why_ , not _ what_ ; wrap at 80 characters
27+ - End every comment with a full stop, even single-line comments
2728
2829### Language
2930
3031Use ** New Zealand English** in all user-facing text, variable names, and
3132comments (e.g. "colour", "behaviour", "organisation"). Standardised API names
32- (` color ` , ` textAlign ` ) are fixed — leave them unchanged.
33+ (` color ` , ` textAlign ` ) are fixed: leave them unchanged.
3334
3435``` javascript
3536const progressColour = ' #0066cc'
@@ -49,16 +50,42 @@ subject, no trailing period, blank line between subject and body.
4950
5051Managed by Renovate (` config:js-lib ` preset):
5152
52- - ` devDependencies ` — pinned exact versions (no ` ^ ` or ` ~ ` )
53- - ` dependencies ` — caret ranges (` ^ ` )
54- - ` peerDependencies ` — explicit OR ranges (e.g. ` ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 ` )
53+ - ` devDependencies ` : pinned exact versions (no ` ^ ` or ` ~ ` )
54+ - ` dependencies ` : caret ranges (` ^ ` )
55+ - ` peerDependencies ` : explicit OR ranges (e.g. ` ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 ` )
5556- Do ** not** add ` allowedVersions ` to ` renovate.json ` without a documented reason
5657
5758## Testing
5859
5960- ** 100% code coverage** required across all build formats
6061- Always run ` npm test ` after changes; use ` npm run test:src ` for quick
6162 source-only feedback during development
63+ - Use ` npm run test:react ` for the full React version matrix independently.
64+ It also runs as part of ` npm test ` (via the ` test:* ` glob).
65+
66+ ### React version matrix
67+
68+ We test boundary versions only: first and last minor of each supported
69+ major. See ` test/react/ ` for current versions.
70+
71+ Current boundaries: 16.14, 17.0, 18.0, 18.3, 19.0.
72+
73+ React 16.14 is the practical lower bound. Hooks require 16.8 and
74+ ` @testing-library/react-hooks ` requires 16.9.
75+
76+ When adding a new boundary:
77+
78+ 1 . Add ` test/react/<version>/package.json ` with correct ` react ` ,
79+ ` react-dom ` , and ` @testing-library/react ` (12.x for React 16–17,
80+ 16.x for React 18+). React 16–17 also need
81+ ` @testing-library/react-hooks ` (8.x) and ` react-test-renderer ` .
82+ 2 . Replace the previous "latest minor" for that major.
83+ 3 . Verify with a single-version run before the full matrix:
84+ ``` bash
85+ cd test/react/< version> && npm i --no-package-lock --quiet --no-progress
86+ REACT_VERSION=< version> npx jest --config ./scripts/jest/config.src.js --coverage false
87+ ```
88+ 4 . Update the boundary list above.
6289
6390## Examples
6491
@@ -85,7 +112,23 @@ needed but test on CodeSandbox before merging.
85112Do not bump vite, @vitejs/plugin-react , next, or typescript in examples
86113beyond the versions in the reference templates.
87114
115+ ## Writing Style
116+
117+ - Avoid marketing or promotional language. State facts plainly.
118+ - Follow best practices for technical writing: be clear, direct, and
119+ concise.
120+ - Avoid em dashes. Use colons, commas, or separate sentences instead.
121+ - Use present tense and active voice where practical.
122+ - Keep sentences short. One idea per sentence.
123+
88124## Versioning
89125
90- Strict semver — no breaking changes without a major version bump, including
126+ Strict semver: no breaking changes without a major version bump, including
91127technical refactors.
128+
129+ ## Documentation
130+
131+ - After each code change, update all related docs and markdown files
132+ (README.md, MIGRATION.md, example READMEs, etc.) in the same pass.
133+ - Do not manually modify CHANGELOG.md. It is auto-generated during
134+ release.
0 commit comments