Template for SolidJS library package. Bundling of the library is managed by tsup.
Other things configured include:
- Bun (for dependency management and running scripts)
- TypeScript
- ESLint / Prettier
- Solid Testing Library + Vitest (for testing)
- Playground app using library
- Simple Bun server scaffolding for playground app
- Support for publishing to NPM and JSR
- GitHub Actions (for all CI/CD)
Some pre-requisites before install dependencies:
- Install Node Version Manager (NVM)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- Install Bun
curl -fsSL https://bun.sh/install | bash
nvm use
bun install
bun start
bun start:server # entirely optional to use
bun run lint # checks source for lint violations
bun run format # checks source for format violations
bun run lint:fix # fixes lint violations
bun run format:fix # fixes format violations
This template uses tsup-preset-solid to build and bundle the library
bun run build
This template also comes with Changeset pre-configured and three utility scripts. You must have Changeset installed to leverage them.
bun pkg:changeset # run Changeset CLI
bun pkg:version # consume any changeset to produce package manifest updates
bun pkg:publish # git tag and publish the package to NPM via Changeset
Another thing to note is the template includes a jsr.json
config to support publishing to JSR alongside NPM if interested. To publish to JSR, you can run:
bunx jsr publish # publishes to JSR
bunx jsr publish --dry-run # checks if library is publishable
Note: For JSR publishing, Changeset does not update the jsr.json file after running
bun pkg:publish
so you have to manually update the version by hand after changeset has run.
The only requirements when contributing are:
- You keep a clean git history in your branch
- rebasing
main
instead of making merge commits.
- rebasing
- Using proper commit message formats that adhere to conventional commits
- Additionally, squashing (via rebase) commits that are not conventional commits
- CI checks pass before merging into
main