Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
36578be
feat: replace pnpmBuildDependency with sv.file + pnpm helper and file…
jycouet Apr 3, 2026
a311c0a
fmt²
jycouet Apr 3, 2026
d4ea793
rmv addPnpmBuildDependencies
jycouet Apr 4, 2026
32d11a1
don't export he internal of addPnpmOnlyBuiltDependencies
jycouet Apr 4, 2026
0ca761e
lint
jycouet Apr 4, 2026
8671cd2
chore: add api-surface generator and tsdown hooks
jycouet Apr 4, 2026
d058caa
chore: add generated public API surface snapshots
jycouet Apr 4, 2026
622fed9
chore: format api-surface snapshots via Prettier in generator
jycouet Apr 4, 2026
f05e03b
chore: satisfy lint (Prettier on api-surface, import process in gener…
jycouet Apr 4, 2026
db5a2df
chore: regenerate api-surface snapshots on PR #1037 base
jycouet Apr 4, 2026
bceae43
align
jycouet Apr 4, 2026
b5adf57
refactor: loadFile/saveFile/loadPackageJson; trim workspace addon paths
jycouet Apr 4, 2026
4e2bf1b
docs(sv-utils): clarify deprecation on readFile/writeFile/getPackageJ…
jycouet Apr 4, 2026
773f828
cleanup types
jycouet Apr 4, 2026
95ee322
chore: Prettier on sources (align with post-build output)
jycouet Apr 4, 2026
a294ebb
chore(sv-testing): remove deprecated exports from public API; docs us…
jycouet Apr 4, 2026
0bc3d68
fix(sv-utils): type onlyBuiltDependencies from YamlDocument.get
jycouet Apr 4, 2026
dc30d9d
chore: consolidate minor changeset for sv and @sveltejs/sv-utils
jycouet Apr 4, 2026
4c58d50
gen improvement
jycouet Apr 4, 2026
b02f0d7
move things
jycouet Apr 4, 2026
d6767dd
Merge branch 'main' of github.com:sveltejs/cli into chore/coupling-v2
jycouet Apr 4, 2026
86fcf24
cs
jycouet Apr 4, 2026
e42e507
add a deprecation mechanism
jycouet Apr 6, 2026
4b26be1
deprecated types
jycouet Apr 6, 2026
bc2a53b
Merge branch 'main' into chore/coupling-v2
jycouet Apr 6, 2026
135826a
trim deprecations: hard-remove internal-only stuff, fix file path mes…
jycouet Apr 6, 2026
c5e94b6
remove dead types: PackageDefinition, Scripts, TestDefinition
jycouet Apr 6, 2026
5a091ba
update changeset
jycouet Apr 6, 2026
ab880a8
dedent is back
jycouet Apr 6, 2026
5c4683e
JSDocs
jycouet Apr 6, 2026
5f84095
adjustments (#1051)
sacrosanctic Apr 6, 2026
1a59ab0
rmv some JSDoc
jycouet Apr 6, 2026
f712cde
small cleanup
jycouet Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changeset/coupling-sv-and-sv-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'sv': minor
'@sveltejs/sv-utils': minor
---

feat: decouple sv / sv-utils, explicit public API, deprecation pass

**`@sveltejs/sv-utils`**

- Rename file helpers: `readFile` -> `loadFile`, `writeFile` -> `saveFile`, `getPackageJson` -> `loadPackageJson`
- Add `pnpm.onlyBuiltDependencies()` transform for `pnpm-workspace.yaml`
- Export `YamlDocument` type from parsers
- Remove `commonFilePaths`, `installPackages` (moved internal to `sv`)

**`sv`**

- `create()` signature changed to `create({ cwd, ...options })`. The old `create(cwd, options)` is deprecated and will be removed in the next major release.
- `sv.pnpmBuildDependency()` is deprecated and will be removed in the next major release. Use `sv.file()` with `pnpm.onlyBuiltDependencies()` from `@sveltejs/sv-utils` instead.
- `workspace.file.prettierignore`, `.prettierrc`, `.eslintConfig`, `.vscodeSettings`, `.vscodeExtensions` are deprecated and will be removed in the next major release. Use the raw strings directly (e.g. `'.prettierignore'`).
- Add `workspace.file.findUp()` to locate files by walking up the directory tree.
- Add `api-surface.md` snapshots (auto-generated on build) to track the public API of `sv` and `@sveltejs/sv-utils`.
- Remove `setup`, `createProject`, `startPreview`, `addPnpmBuildDependencies` from `sv/testing` exports.
- Make type exports explicit (no more `export type *`). Removed types that were never part of the intended public API: `PackageDefinition`, `Scripts`, `TestDefinition`.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,30 @@ To run svelte-migrate locally:
node ./packages/migrate/bin.js
```

## Deprecation

Public APIs cannot be changed in a minor release since it is a breaking change. Instead, the old behaviour is marked as deprecated until the next major version, at which point they can be removed.

### How to deprecate

1. **Add `@deprecated` JSDoc** on the type/function - IDEs will show strikethrough:

```ts
/** @deprecated use `newThing()` instead. */
```

2. **Emit a runtime warning** (for functions/methods) using `svDeprecated()` from `core/deprecated.ts`. Warns once per message:

```ts
svDeprecated('use `newThing()` instead of `oldThing()`');
```

3. **Keep the old behavior working** - the deprecated API should still function correctly, just with a warning.

### Before a major release

Search for `svDeprecated` and `@deprecated` to find and remove all deprecated APIs.

## Generating changelogs

Here is the command to generate a change set:
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/50-api/20-sv-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Return `false` from any transform callback to abort - the original content is re
import { transforms } from '@sveltejs/sv-utils';

sv.file(
file.eslintConfig,
'eslint.config.js',
transforms.script(({ ast, js }) => {
const { value: existing } = js.exports.createDefault(ast, { fallback: myConfig });
if (existing !== myConfig) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "tsdown",
"postbuild": "node scripts/generate-api-surface.js",
"changeset:publish": "changeset publish",
"check": "pnpm --parallel check",
"dev": "tsdown -w & pnpm --parallel check -w & wait",
Expand Down
Loading
Loading