Skip to content

feat: decouple pnpmBuildDependency from sv (2)#1037

Merged
jycouet merged 5 commits intomainfrom
onlyBuiltDependencies-v2
Apr 6, 2026
Merged

feat: decouple pnpmBuildDependency from sv (2)#1037
jycouet merged 5 commits intomainfrom
onlyBuiltDependencies-v2

Conversation

@jycouet
Copy link
Copy Markdown
Contributor

@jycouet jycouet commented Apr 4, 2026

Closes #1030

Description

replacing

run: ({ sv }) => {
  sv.pnpmBuildDependency('my-native-dep');
}

by

import { pnpm } from '@sveltejs/sv-utils';

run: ({ sv, packageManager }) => {
  if (packageManager === 'pnpm') {
    sv.file(file.findUp('pnpm-workspace.yaml'), pnpm.onlyBuiltDependencies('my-native-dep'));
  }
}

DX is not the best, but sv is less dependant of pnpm & changes.

Alternative:
rename: sv.pnpmBuildDependency('my-native-dep'); to sv.pnpmOnlyBuiltDependencies('my-native-dep'); to be explicit (but still coupled).

@benmccann WDYT?

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

🦋 Changeset detected

Latest commit: 0ca761e

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

This PR includes changesets to release 2 packages
Name Type
sv Minor
@sveltejs/sv-utils Minor

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-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 4, 2026

Open in StackBlitz

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

commit: 0ca761e

@svelte-docs-bot
Copy link
Copy Markdown

@benmccann
Copy link
Copy Markdown
Member

nice! I like it!

jycouet added a commit that referenced this pull request Apr 5, 2026
@jycouet jycouet merged commit aead922 into main Apr 6, 2026
8 checks passed
@jycouet jycouet deleted the onlyBuiltDependencies-v2 branch April 6, 2026 14:54
@github-actions github-actions bot mentioned this pull request Apr 6, 2026
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.

sv API & pnpmBuildDependency

2 participants