-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Contribution
- I'd be willing to implement this feature (contributing guide)
Describe the user story
It's easy to begin development with the wrong dependencies installed. Here's some examples:
- Switch branches, where the new branch has different dependencies
- Pull the repo for the first time
Describe the solution you'd like
Normally you'd have to remember to run pnpm i
in these scenarios. I'd like pnpm to "remember" for me.
Before I run a script in the "scripts"
field of the package.json
(or pnpm test
, etc.), I'd like pnpm to check that the correct dependencies are installed then either:
- Error out, notifying me that I should run
pnpm i
- Automatically install the dependencies for me (i.e., run
pnpm i
in the background).
Describe the drawbacks of your solution
- This will increase the latency of every command. It may be possible to utilize caching to speed this up for subsequent pnpm invocations.
- Automatically running
pnpm i
can pose security risks (becausepostinstall
scripts can run arbitrary code), so doing this should be opt-in on the developer-level in my opinion.
Describe alternatives you've considered
Keep the status quo.
amrsalama