Switch to pnpm#10576
Conversation
7c3d87e to
b327dd9
Compare
e618efc to
ea5bc05
Compare
f616a48 to
cdc99f0
Compare
LeeLenaleee
left a comment
There was a problem hiding this comment.
Looks fine only I think it would be best to put a mention in the migration guide for this too.
Guess best place is like in the V3 migration guide in the Developer migration section, small bit of text that we switched from npm to pnpm so that needs to be installed before you can work with hte project again
|
Developer migration in v3 was for developers of plugins, etc. However, there won't be any migration required for either end users or developers of plugins. Only people working on this repository itself. That will start immediately with this being merged and will not coincide with the release of v4. So I think putting it in the contributor's guide is probably best. |
|
Aah yeah makes sense, my bad |
kurkle
left a comment
There was a problem hiding this comment.
Faster speed is a good enough reason to switch already. I have some questions though.
872fb63 to
43739aa
Compare
|
I can replicate the CI failure locally |
|
No new should be without putting it in a variable if I'm not mistaken so const c = new Chart() should work although it's an unused car so we might need an update statement or ignore it |
|
Oops. Should be fixed now. I think it was working originally, but I lost some of the fixes while merging in the latest changes from |
kurkle
left a comment
There was a problem hiding this comment.
looks good expect for @LeeLenaleee comments (integration tests for helpers)
930ac69 to
f917e10
Compare
|
Some actions seem to fail still |
|
@kurkle looks like you caught it right before I pushed a fix 😄 I had a bad merge when rebasing against |
The main benefit is that it allows you to have a monorepo with sub-projects. E.g. right now the main
package.jsonhas all the dependencies in it, but in this PR I was able to move the documentation dependencies to thedocssub-project, which is cleaner and helps make it clearer what is used where. Also, this completely removes the need fortest/integration/integration-test.cjsand creating a temporary directory for integration testing as we can use workspace dependencies.As a final benefit, pnpm is much faster than npm especially for subsequent installs of the Chart.js project. The lockfile is also easier to read - you can see the deletion of 28,000 lines. I've been seeing it adopted quite a lot in large projects like Next.js, Vue, Vite, and SvelteKit.
This requires that you install pnpm to build the project. Just run
npm install -g pnpmThe compressed size action is failing because it's checking out the previous version from github where pnpm fails because this project is not currently specifying the required peer dependencies. I fixed that in this PR, so all subsequent PRs after this one should pass that check if this is merged.