Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pnpm onlyBuiltDependencies config #521

Open
hyunbinseo opened this issue Apr 2, 2025 · 2 comments
Open

Update pnpm onlyBuiltDependencies config #521

hyunbinseo opened this issue Apr 2, 2025 · 2 comments
Labels
enhancement New feature or request pkg:add sv add pkg:create

Comments

@hyunbinseo
Copy link
Contributor

hyunbinseo commented Apr 2, 2025

onlyBuiltDependencies in pnpm-workspace.yaml is supported from [email protected]:

The pnpm.* settings from package.json can now be specified in the pnpm-workspace.yaml file instead.

onlyBuiltDependencies:
- esbuild
- fuse-native

pnpm approve-builds adds onlyBuiltDependencies to pnpm-workspace.yaml as of 10.7.1.

Current implementation is fixed to the pnpm.onlyBuiltDependencies field in the pacakge.json:

Backwards compatibility is supported and is probably fixed (?) in 10.6.1

When executing the approve-builds command, if package.json contains onlyBuiltDependencies or ignoredBuiltDependencies, the selected dependency package will continue to be written into package.json.

@manuel3108 manuel3108 added enhancement New feature or request pkg:add sv add pkg:create labels Apr 3, 2025
@manuel3108
Copy link
Member

I wonder what should happen if there is no pnpm-workspace.yaml because you are creating a new project. Should it just be created to only add those three lines?

Basically I think this is a good idea, because it puts pnpm related stuff in an pnpm file

@hyunbinseo
Copy link
Contributor Author

The pnpm-workspace.yaml seems to be created.

corepack use pnpm@latest
# Installing [email protected] in the project...

pnpm i @sveltejs/kit -D
# Ignored build scripts: esbuild.
# Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.

pnpm approve-builds
# √ The next packages will now be built: esbuild.
# Do you approve? (y/N) · true -- workspace file is generated at this point.
# pnpm-workspace.yaml
onlyBuiltDependencies:
  - esbuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:add sv add pkg:create
Projects
None yet
Development

No branches or pull requests

2 participants