Open-Source Wikis

/

Svelte

/

How to contribute

/

Development workflow

sveltejs/svelte

Development workflow

Active contributors: Rich Harris, Ben McCann, Simon H

Daily loop

  1. Branch from main. PRs target main only.
  2. Run the watcher. From packages/svelte/:
    pnpm dev
    This runs Rollup in watch mode and node scripts/process-messages -w, which regenerates src/compiler/errors.js and src/compiler/warnings.js whenever you change a file under packages/svelte/messages/.
  3. Write code or testspackages/svelte/src/... for code, packages/svelte/tests/... for tests.
  4. Run a focused test to iterate quickly:
    pnpm test runtime-runes -t "your test name"
    # or
    FILTER=your-test-name pnpm test runtime-runes
  5. Open a playground for ad-hoc verification: cd playgrounds/sandbox && pnpm dev (when present).
  6. Generate a changeset (only for user-visible changes):
    npx changeset

Test in another local project

Per CONTRIBUTING.md, you can install a PR's branch directly:

pnpm add -D "github:sveltejs/svelte#path:packages/svelte&branch-name"

Editing error/warning messages

Messages are authored in markdown under packages/svelte/messages/{client-errors,client-warnings,compile-errors,compile-warnings,server-errors,server-warnings,shared-errors,shared-warnings}/. The process-messages script (run by pnpm dev and pnpm generate) parses those files and emits:

  • packages/svelte/src/compiler/errors.js (~1.7k lines, fully generated)
  • packages/svelte/src/compiler/warnings.js
  • packages/svelte/src/internal/client/errors.js, warnings.js
  • packages/svelte/src/internal/server/errors.js, warnings.js
  • packages/svelte/src/internal/shared/errors.js, warnings.js

Do not hand-edit any of those .js files; the CI lint job will reject the PR.

Editing types

Types are auto-generated from JSDoc + .d.ts sources via dts-buddy and rolled up into packages/svelte/types/. To refresh:

cd packages/svelte
pnpm generate:types

The Lint CI job runs pnpm build and diffs the working tree — any uncommitted generated changes will fail the PR.

Commit conventions

There's no enforced commit-message template. Existing history uses Conventional-Commit-style prefixes (fix:, feat:, chore:, docs:) followed by a PR number — e.g. fix: ignore false-positive errors of $inspect dependencies (#18106).

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Development workflow – Svelte wiki | Factory