Closed nezouse closed 1 year ago
What's the procedure to update this? Say I update pnpm and do make install
(pnpm install -r
), will that automatically update both the lockfile and the version in package.json
?
Lockfile will be updated automatically when you install new deps, but version in package.json has to be managed manually
Is there a way to modify make install
such that in addition to updating the lockfile, it also updates the packageManager
property?
If that's too hard, we could add corepack enable
to make setup
then change all pnpm
commands in the makefile to use corepack pnpm
instead?
Not sure why would you want to update the packageManager
field. It's sets which version of pnpm you want to use and i don't think it's something that should be updated by accident.
Tbh i added it more as an escape hatch if pnpm is not working if someone has a wrong version installed. Also it's hard to say about corepack enable
as right now this command throws for me, so not sure if you can run it multiple times.
The scenario I'm thinking of is that right now if I (1) update pnpm, (2) run make install
then push, then the version is not correct anymore (mismatch between pnpm-lock.json
and packageManager
& even someone using corepack will get an error.
Unless pnpm itself checks packageManager
& prevents this from happening?
Ok, so I think this is good enough for now. Thinking of it, there is no trivial solution anyway, since the lock file version doesn't update with every version of pnpm. We'll just have to be vigilant to upgrade the statement in the package file every time the lock-file version changes.
I've added warnings to the Makefile and that'll have to do!
Many thanks for the PR!
I completely missed that this also was setting up Vite. This was not fully integrated in the build flow & needs further review, so I've reverted on master.
However, feel free to open a new PR for setting up Vite!
Should be easier to make sure you use correct version of pnpm now.