Skip to content

refactor: move file helpers to sv-utils#1002

Open
jycouet wants to merge 4 commits intomainfrom
refactor/move-file-helpers-to-sv-utils
Open

refactor: move file helpers to sv-utils#1002
jycouet wants to merge 4 commits intomainfrom
refactor/move-file-helpers-to-sv-utils

Conversation

@jycouet
Copy link
Contributor

@jycouet jycouet commented Mar 21, 2026

Summary

  • Moves commonFilePaths, getPackageJson, readFile, fileExists and the Package type from sv/core/files to @sveltejs/sv-utils
  • These are pure helpers (no CLI/orchestration deps) that community add-on authors can benefit from
  • Re-exports from sv/core/files.ts for backwards compatibility — no breaking changes in sv

Test plan

  • pnpm build passes
  • pnpm check passes for both sv and sv-utils
  • Existing tests still pass

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.
@changeset-bot
Copy link

changeset-bot bot commented Mar 21, 2026

🦋 Changeset detected

Latest commit: 3dd34a6

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

This PR includes changesets to release 2 packages
Name Type
@sveltejs/sv-utils Patch
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

jycouet added 3 commits March 21, 2026 21:24
…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.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 21, 2026

Open in StackBlitz

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

commit: 3dd34a6

@jycouet jycouet mentioned this pull request Mar 21, 2026
12 tasks
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