This is a template for creating React libraries, based on Rslib.
It includes a basic setup with TypeScript, ESLint, Prettier, and Vitest for testing.
It also uses semantic-release for automated versioning and publishing.
- GitHub Personal Access Token
- Click
Generate new token
- Generate a new token with the following permissions:
- Actions - read and write
- Commit statuses - read and write
- Contents - read and write
- Deployments - read and write
- Issues - read and write
- Copy the token and add it to your repository's secrets:
- Go to your repository settings
- Navigate to Secrets and variables > Actions
- Create a new secret named `GH_TOKEN
- Go to npmjs.com
- Navigate to your profile settings
- Select "Access Tokens"
- Create a new access token (Publish)
- Copy the token and add it to your repository's secrets:
- Go to your repository settings
- Navigate to Secrets and variables > Actions
- Create a new secret named
NPM_TOKEN
-
setup
- install dependencies and required node- and pnpm-version -
dev
- start development server for the example app and watch for changes on the library and example app -
lint
- run ESLint on the library -
test
- run tests using Vitest
This template uses semantic-release for automated versioning and publishing.
The release process is triggered automatically when changes are pushed to the main branch.
Commit messages should follow the Conventional Commits specification:
-
fix: ...
- patch release -
feat: ...
- minor release -
BREAKING CHANGE: ...
at the footer - major release