fracpack

Easy npm packages with svelte-package and changesets.

see fracpack-auth for private packages and a password-protected demo/docs site.


Running locally

npx degit fractalhq/fracpack my-package

cd my-package

pnpm install

pnpm run dev

navigate to http://localhost:3333


Setup

  • Add your npm token to your Github environment variables.
  • Update the repo field in .changeset/config.json
  • Update the github.repository field in .github/workflows/release.yml

Usage

pnpm build - Build the demo/docs site.

pnpm package - Build the package into dist.

pnpm package-watch - Watch for changes in the package, and rebuild it automatically.

npx changset - Publish the build.

Anything exported from src/package/index.ts will be included in the npm package (with type declaration files automatically generated). Markdown can be used anywhere (see src/routes/docs/+page.md). I like to use the home page (src/routes/+page.svelte) for demos. See svelte.config.js and vite.config.js for further configuration.


Publishing

  • To publish a package update, run npx changeset and follow the instructions.
  • Commit the generated changelog, and merge the changeset bot's PR.
  • Profit.