Skip to content

feat(sv): type the options of official add-ons (alternative export) - #1335

Draft
jycouet wants to merge 2 commits into
version-1from
feat-export-addon-option-types
Draft

jycouet wants to merge 2 commits into
version-1from
feat-export-addon-option-types

Conversation

@jycouet

@jycouet jycouet commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Alternative to #1333: each add-on declares and exports the values its options produce.

const options: AddonOptions<VitestOptions> = defineAddonOptions()... - the compiler checks questions against the declared values, and officialAddons just wires each exported type to an id, so nothing can drift. Consumers get OfficialAddonOptions, add-on authors get the same pattern (docs added). api-surface.md 335 → 391 lines, oxc stays.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Sep 20, 2026

Copy link
Copy Markdown

Install the latest version of sv from da264b6:

pnx https://pkg.svelte.dev/sv/c/da264b677df545fd86185d85fe32ffd0d40e891b create

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1335

@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: da264b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

@jycouet
jycouet marked this pull request as draft September 20, 2026 12:51
Each add-on declares the values its options produce (`AddonOptions<Values>`) and exports that type; `officialAddons` wires them to ids, so the compiler - not a snapshot test - keeps types and questions in sync. Consumers get `OfficialAddonOptions`, add-on authors get the same pattern for their own add-ons.
@jycouet
jycouet force-pushed the feat-export-addon-option-types branch from b2b5477 to c7739fc Compare September 20, 2026 12:52
`testing.ts` re-exports most of the root entry, so its snapshot repeated those declarations verbatim. They are now replaced by a single pointer comment to `api-surface.md`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant