colonyNetwork
colonyNetwork copied to clipboard
Exploration of PNPM
For whatever reason ~~- possibly with the move to Node 20 -~~ we're having real issues with a single lockfile being installable on Linux and OSX. This comes down to fsevents
being only needed on OSX (and therefore optional elsewhere) and npm having an issue with that - see https://github.com/npm/cli/issues/4828 for the ongoing issue related to this.
I've explored what it would look like if we moved to pnpm. As well as the lockfile issue being resolved (I think), a couple of nice side benefits:
- Faster install times, which has been an issue with the CDapp dev environment
- A 'proper' way to patch
@nomiclabs/truffle-contract
rather than a postinstall call tosed
npm i -g pnpm@8
to install, and then just use pnpm
instead of npm
to call everything is all that should be necessary.
~NB based on top of maint/docker-file-builds
.~
As an addendum, after speaking to Chris, the resident Node guru:
- He uses pnpm for ColonyJS, and is thinking of moving the dapp to it, so supports this 'wholeheartedly'.
- He uses v8 there (as I do here), and will only look to move to v9 once it is more mature
I've been dealing with this issue for a while (~3 months) when we were on node@14. I went down a few rabbit holes, but the only fix which consistently worked in CI was manually editing package-lock.json
to add "linux"
to the os
field:
"os": [
"darwin",
"linux" // Manually add this
],
This behavior could conceivably be incorporated into a post-commit hook using sed
.
Don't want this merged yet (requires https://github.com/JoinColony/colonyCDapp/pull/2316), but interested in a review.
The versioning check script is broken, but not as a result of this PR so don't intend for it to hold it up.