-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configurational dependencies #8
base: main
Are you sure you want to change the base?
Conversation
## Prior Art | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this similar to build-dependencies
in Rust?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is different than build-dependencies
in the Rust ecosystem.
This RFC is similar what templates was trying to do with reusable configuration, but only for pnpm specific settings. Similar to templates, configuration is stored in the package manifest since that's available at earlier stages of the installation process. However, I think it's a lot simpler than templates and likely to be less controversial since it's only for pnpm related settings and not existing package.json
fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up! I think this will be useful to a lot of users.
## Prior Art | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is different than build-dependencies
in the Rust ecosystem.
This RFC is similar what templates was trying to do with reusable configuration, but only for pnpm specific settings. Similar to templates, configuration is stored in the package manifest since that's available at earlier stages of the installation process. However, I think it's a lot simpler than templates and likely to be less controversial since it's only for pnpm related settings and not existing package.json
fields.
* They will not have lifecycle scripts. | ||
* They will only be installable via exact versions. | ||
|
||
These dependencies will be installed into a new directory (name to be decided), not into `node_modules`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, using node_modules could have advantages but would also require additional changes in the existing installation code. Unless, we use a dot directory inside node_modules, like node_modules/.pnpm-config
. Or node_modules/.pnpm/config
. This way users wouldn't have to add new entries to .gitignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the idea of node_modules/.pnpm-config
as an analogue to the existing node_modules/.pnpm
dir. I feel like that makes it clearer that these are NPM packages, but live under a namespace isolated from the existing packages in node_modules/.pnpm
.
Co-authored-by: Brandon Cheng <[email protected]>
@@ -49,6 +49,8 @@ These dependencies will be installed as early as possible in order to be able to | |||
|
|||
## Prior Art | |||
|
|||
There was a big RFC by Brandon Cheng about a much more powerful system using [templates](https://github.com/pnpm/rfcs/pull/3), which was rejected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new system here targeting just pnpm specific settings is a lot easier to understand. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I don't remember why exactly it was rejected.
I will work on an implementation. |
Related PR: pnpm/pnpm#8915 I think with configurational dependencies we can achieve some of what we wanted to achieve with templates. We could have some config dependency that changes the |
Implementation: pnpm/pnpm#8915