A streamlined template for creating npm packages with automated CI/CD pipeline. Built with Svelte but can be used for any JavaScript/TypeScript package.
- Automated publishing to npm on GitHub releases
- TypeScript support out of the box
- Svelte integration (optional for your package consumers)
- Pre-configured testing with Vitest
- TailwindCSS for styling development environment
-
Create a new repository from this template
-
Configure your package
- Update
package.json
with your package name - Version is automatically set from GitHub release tags
- Modify dependencies as needed for your project
- Update
-
Set up CI/CD
- Generate an npm token: Get npm token
- Add token as
NPM_TOKEN
in GitHub secrets: Create GitHub secret - Replace
<YOUR_NPM_USERNAME>
,<YOUR_GITHUB_USERNAME>
, and<YOUR_GITHUB_REPOSITORY>
with your actual values
-
Release your package
- Create a GitHub release with a semantic version tag (e.g.,
v1.0.0
) - The workflow automatically builds and publishes your package to npm
- Create a GitHub release with a semantic version tag (e.g.,
npm install your-package-name