Skip to content

feat: community add-ons#997

Draft
jycouet wants to merge 21 commits intomainfrom
feat_com-add
Draft

feat: community add-ons#997
jycouet wants to merge 21 commits intomainfrom
feat_com-add

Conversation

@jycouet
Copy link
Contributor

@jycouet jycouet commented Mar 20, 2026

I created multiple PRs to ease the diff. once merged, I'll rebase this one.

Main topic

Detail

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

⚠️ No Changeset found

Latest commit: 4723975

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 21, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@997
npx https://pkg.pr.new/sv@997
npx https://pkg.pr.new/@sveltejs/sv-utils@997

commit: 4723975

@svelte-docs-bot
Copy link

jycouet added 14 commits March 21, 2026 18:10
Singular form is more consistent — `file.viteConfig` reads better
than `files.viteConfig` since each property refers to a single file.

Prep for community add-on improvements.
Moves the setupTest boilerplate into `sv/testing` as a reusable
`createSetupTest(vitest)` factory. Internal tests now consume it
the same way community add-ons will.

Prep for community add-on improvements.
Typed, parser-aware `string -> string` functions that wrap
parse -> callback(ast/data) -> generateCode(). Includes transforms
for script, svelte, css, json, yaml, toml, html, and text.

The engine detects transforms via `isTransform()` and injects
workspace context (language) automatically.
Mechanical migration: every `sv.file()` callback that followed the
parse -> mutate -> generateCode pattern now uses the typed transform.

`parse` is retained only where transforms don't fit:
- prettier.ts: try/catch around JSON parsing
- sveltekit-adapter.ts: conditional parser (json vs toml) and
  standalone parse outside sv.file
Move `commonFilePaths`, `getPackageJson`, `readFile`, `fileExists` and
`Package` type from `sv/core/files` to `@sveltejs/sv-utils` so they are
available to community add-on authors.

The symbols are re-exported from `sv/core/files` for backwards compat.
…pace

Move `writeFile`, `installPackages` alongside the previously moved helpers.
Refactor signatures to take `cwd: string` instead of `Workspace` since
only `workspace.cwd` was ever used.

`formatFiles` stays in `sv` as it depends on `@clack/prompts`.
…ectly

Remove re-exports — all callers now import file helpers from
`@sveltejs/sv-utils` directly. Rename the remaining file to match
its only export.
# Conflicts:
#	packages/sv/src/addons/better-auth.ts
#	packages/sv/src/addons/devtools-json.ts
#	packages/sv/src/addons/drizzle.ts
#	packages/sv/src/addons/eslint.ts
#	packages/sv/src/addons/mdsvex.ts
#	packages/sv/src/addons/paraglide.ts
#	packages/sv/src/addons/playwright.ts
#	packages/sv/src/addons/prettier.ts
#	packages/sv/src/addons/sveltekit-adapter.ts
#	packages/sv/src/addons/tailwindcss.ts
#	packages/sv/src/addons/vitest-addon.ts
…dd-rebuild

# Conflicts:
#	packages/sv/src/addons/drizzle.ts
#	packages/sv/src/addons/sveltekit-adapter.ts
#	packages/sv/src/core/engine.ts
docs, templates, dependency setup, scoped package validation,
bundling, and test updates
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.

Allow community addons to have dependencies

1 participant