Skip to content

feat(sv): type the options of official add-ons (alternative infer) - #1334

Draft
jycouet wants to merge 2 commits into
version-1from
feat-dts-generator-tsgo
Draft

jycouet wants to merge 2 commits into
version-1from
feat-dts-generator-tsgo

Conversation

@jycouet

@jycouet jycouet commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Alternative to #1333: fully inferred instead of hand-written.

Drops the Addon<any> table and switches the sv DTS builds to the tsgo generator (oxc can't infer under isolatedDeclarations). No types to maintain, but api-surface.md grows 335 → 1561 lines of question literals and the published engine.d.mts 15 kB → 42 kB.

First commit is independent: api-surface snapshots now dedupe declarations shared with another package's surface (api-surface-testing.md 260 → 81 lines).

`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`.
Drops the `Addon<any>` annotation on `officialAddons` so every add-on keeps its real option types. `oxc` cannot emit declarations for inferred objects (isolatedDeclarations), so the `sv` DTS builds switch to the `tsgo` generator, which infers them - at the cost of ~1200 extra lines of option literals in the public `.d.ts`.
@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0fcf5b5

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

@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of sv from 0fcf5b5:

pnx https://pkg.svelte.dev/sv/c/0fcf5b55f63d28f80c815d0f3c9e6c559d2ce796 create

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

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