Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.15 KB

CONTRIBUTING.md

File metadata and controls

48 lines (30 loc) · 1.15 KB

Contributing Guide

Cheatsheet: All official add-ons source code


Some convenient scripts are provided to help develop the add-on.

## create a new minimal project in the `demo` directory
pnpm demo-create

## add your current add-on to the demo project
pnpm demo-add

## run the tests
pnpm test

Key things to note

Your add-on should:

  • export a function that returns a defineAddon object.
  • have a package.json with an exports field that points to the main entry point of the add-on.

Building

Your add-on is bundled with tsdown into a single file in dist/. This bundles everything except sv (which is a peer dependency provided at runtime).

pnpm build

Publishing

When you're ready to publish your add-on to npm:

pnpm login
pnpm publish

prepublishOnly will automatically run the build before publishing.

Things to be aware of

Community add-ons must have sv as a peerDependency and should not have any dependencies. Everything else (including @sveltejs/sv-utils) is bundled at build time by tsdown.