Skip to content

ci: add release quality gates to prevent issue #419 class of misses#421

Merged
iamdarshshah merged 5 commits intomasterfrom
ci/release-quality-gates
Apr 10, 2026
Merged

ci: add release quality gates to prevent issue #419 class of misses#421
iamdarshshah merged 5 commits intomasterfrom
ci/release-quality-gates

Conversation

@iamdarshshah
Copy link
Copy Markdown
Collaborator

@iamdarshshah iamdarshshah commented Apr 8, 2026

Summary

Adds CI/release infrastructure to catch the class of issues reported in #419 (overly-narrow peerDependencies blocking React 18/19) and other gaps identified by auditing Zustand, react-hook-form, TanStack Query, and Radix UI.

  • Peer dep assertion in test suite: package.test.ts asserts peerDependencies.react uses >= not ^. Runs on every yarn test. Would have caught Support React 19 #419 before release.
  • React version matrix: test-react-versions.yml runs tests against React 17 and 18 on every push/PR. React 19 is excluded until the pull-to-refresh setState/act() compatibility issue is resolved.
  • Publish gate: publish.yml has a validate job (React 17 and 18) that must fully pass before publish runs. needs: validate blocks npm publish on any failure.
  • Build artifact smoke tests: test-build-artifacts.yml verifies CJS require(), ESM exports, and dist/index.d.ts after every build.
  • Bundle size tracking: size.yml posts brotli diff on every PR; 6 kB budget per artifact (current: ~2.1 kB).
  • TypeScript version matrix: test-ts-versions.yml type-checks the library source against TS 4.9, 5.0, 5.4, and latest. Uses tsconfig.lib.json (excludes test files) to avoid jest globals resolution issues in newer TS versions.
  • Drop Node 18: Node 18 reached EOL April 2025. Removed from CI matrix; engines updated to >=20.0.0.

Notes

React 19 exclusion is intentional and tracked, re-add to both test-react-versions.yml and publish.yml once the pull-to-refresh setState outside act() issue is fixed.

Test plan

  • All CI / test jobs pass on Node 20.x and 22.x
  • Test React Versions / React 17 and React 18 pass
  • Test TypeScript Versions / 4.9, 5.0, 5.4, latest pass
  • Build Artifacts smoke test passes
  • Bundle size PR comment appears

- Add peer dep range assertion to test suite (catches overly-narrow
  peerDependencies like "^17" that block React 18/19 consumers at install)
- Gate npm publish behind React 17/18/19 matrix validation (publish job
  requires needs:validate to pass before running)
- Add test-react-versions workflow: runs tests against React 17, 18, 19
  on every push/PR
- Add test-build-artifacts workflow: smoke tests CJS require(), ESM export
  structure, and type declaration presence after each build
- Add size-limit (6 kB budget) + bundle size PR comment workflow via
  andresz1/size-limit-action
- Add test-ts-versions workflow: type-checks against TS 4.5/4.7/4.9/5.0/5.4/latest
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.33%. Comparing base (459674f) to head (124ac9c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #421   +/-   ##
=======================================
  Coverage   79.33%   79.33%           
=======================================
  Files           2        2           
  Lines         150      150           
  Branches       56       56           
=======================================
  Hits          119      119           
  Misses         24       24           
  Partials        7        7           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

andresz1/size-limit-action checks out the base branch and runs
size-limit there, but size-limit isn't in master's package.json yet,
causing npx to fail with no JSON output.

preactjs/compressed-size-action measures built artifact sizes directly
without requiring size-limit on the base branch — same approach used
by react-hook-form.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

Size Change: 0 B

Total Size: 8.61 kB

ℹ️ View Unchanged
Filename Size
dist/index.es.js 4.3 kB
dist/index.js 4.31 kB

compressed-size-action

React 19:
- Swap @testing-library/react to v16 when testing React 19 (v12 calls
  ReactDOM.unmountComponentAtNode which was removed in React 19)
- Also install @testing-library/dom which v16 requires as a peer dep
- Mark React 19 as experimental (continue-on-error) — pull-to-refresh
  touch/mouse event handling has a known compat issue under React 19
  that needs a separate fix

TypeScript:
- Drop 4.5 and 4.7 from the matrix; transitive @types/node uses accessor
  syntax requiring TS 4.9+, causing parse errors skipLibCheck cannot suppress
- Add tsconfig.lib.json (excludes __tests__) — the TS version matrix should
  check the public API surface, not test infrastructure types
- In the workflow, pass --ignoreDeprecations 6.0 for TS >= 6 (moduleResolution
  node deprecated as node10 in TS 6; ignoreDeprecations is a 5.0+ option so
  cannot live in tsconfig.json without breaking the TS 4.9 matrix job)
Node 18 reached EOL April 2025. @size-limit/preset-small-lib@12 requires
Node ^20, causing yarn install to fail on Node 18 in push.yml.
Pull-to-refresh setState calls are not wrapped in act(), which React 19
treats as an error. Remove React 19 from both test-react-versions.yml
and publish.yml to keep CI green. Re-add once the fix lands.
@iamdarshshah iamdarshshah merged commit e6d8fda into master Apr 10, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant