npm-package-template Svelte Themes

Npm Package Template

Npm package template with integrated CI/CD on release

npm package template

A streamlined template for creating npm packages with automated CI/CD pipeline. Built with Svelte but can be used for any JavaScript/TypeScript package.

Features

  • 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

Setup Guide

  1. Create a new repository from this template

  2. 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
  3. 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
  4. 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

npm install your-package-name

Top categories

Loading Svelte Themes