react-lib-starter
Introduction
This is my personal React library template.
What's included
The template includes the following:
- rollup + swc with esm and cjs output
- panda-css integration as a postcss plugin
- Changesets setup for versioning and auto changelog generation.
- auto NPM package publishing workflow via changesets action
- zero dependency by default
-
vitest
for testing - minify all bundled files via @rollup/plugin-terser.
-
.d.ts
generation with alias support via tsc-alias - single tree-shaked .d.ts file via rollup-plugin-dts
- bundle analyze via rollup-plugin-visualizer
What's missing
- A quick playground for components
Usage
- Directly use this repo as a template in github
- use degit:
degit git@github.com:citrus327/react-lib-starter.git
Workflow
- Create new branch
- Do as many commits as you want
- After push all the commits, execute
pnpm run change
ornpx changeset
to create a changeset - Modify changeset markdown file in
.changeset
folder if needed - Push all the changes to current branch
- Make a pull request manually in your repo or just merge into the main branch
- Then changeset action will detect the changesets you've made and create new PR for it.
- After accepting the new PR, the changeset action will then go change the package version and publish to target registry