Skip to content

Commit dcf848e

Browse files
Sync cli docs (#1918)
sync cli docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent c515007 commit dcf848e

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

apps/svelte.dev/content/docs/cli/50-api/10-sv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default defineAddon({
4949
});
5050
```
5151

52-
The `sv` object in `run` provides `file`, `dependency`, `devDependency`, `execute`, and `pnpmBuildDependency`. For file transforms (AST-based editing of scripts, Svelte components, CSS, JSON, etc.), see [`@sveltejs/sv-utils`](sv-utils).
52+
The `sv` object in `run` provides `file`, `dependency`, `devDependency`, and `execute`. For file transforms (AST-based editing of scripts, Svelte components, CSS, JSON, etc.) and package manager helpers, see [`@sveltejs/sv-utils`](sv-utils).
5353

5454
## `defineAddonOptions`
5555

apps/svelte.dev/content/docs/cli/50-api/20-sv-utils.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Return `false` from any transform callback to abort - the original content is re
138138
import { transforms } from '@sveltejs/sv-utils';
139139

140140
sv.file(
141-
file.eslintConfig,
141+
'eslint.config.js',
142142
transforms.script(({ ast, js }) => {
143143
const { value: existing } = js.exports.createDefault(ast, { fallback: myConfig });
144144
if (existing !== myConfig) {
@@ -230,3 +230,18 @@ Namespaced helpers for AST manipulation:
230230
- **`json.*`** - arrayUpsert, packageScriptsUpsert
231231
- **`html.*`** - attribute manipulation
232232
- **`text.*`** - upsert lines in flat files (.env, .gitignore)
233+
234+
## Package manager helpers
235+
236+
### `pnpm.onlyBuiltDependencies`
237+
238+
Returns a transform for `pnpm-workspace.yaml` that adds packages to the `onlyBuiltDependencies` list. Use with `sv.file` when the project uses pnpm.
239+
240+
```js
241+
// @noErrors
242+
import { pnpm } from '@sveltejs/sv-utils';
243+
244+
if (packageManager === 'pnpm') {
245+
sv.file(file.findUp('pnpm-workspace.yaml'), pnpm.onlyBuiltDependencies('my-native-dep'));
246+
}
247+
```

apps/svelte.dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"prettier-plugin-svelte": "^3.5.0",
7575
"satori": "^0.19.2",
7676
"satori-html": "^0.3.2",
77-
"sv": "^0.14.0",
77+
"sv": "^0.14.1",
7878
"svelte": "^5.53.5",
7979
"svelte-check": "^4.4.3",
8080
"svelte-preprocess": "^6.0.3",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)