Template repository for building reusable React TypeScript npm libraries (components + hooks + utilities).
- ESM + CJS + Types build (tsup)
- Vitest testing
- ESLint + Prettier (flat config)
- Changesets (manual release flow, no automation PR)
- Husky (pre-commit + pre-push)
- Enforced public API via
src/index.ts - Dependency-free styling (Tailwind-compatible by convention only)
reactandreact-domas peerDependencies
src/components– reusable UI componentssrc/hooks– reusable React hookssrc/utils– framework-agnostic utilitiessrc/index.ts– only public API (no deep imports allowed)
Anything not exported from src/index.ts is considered private.
npm run build– build todist/(tsup)npm test– run tests (vitest)npm run typecheck– TypeScript typechecknpm run lint– ESLintnpm run format/npm run format:write– Prettiernpx changeset– create a changeset
- Work on a
featurebranch fromdevelop - Merge to
develop - Add a changeset for user-facing changes:
npx changeset - Promote
develop→master - Tag
vX.Y.Zto publish (npm OIDC)
This repository is a template. Teams should clone it and focus only on library logic, not tooling or release mechanics.