-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Switch from yarn to pnpm #27299
Switch from yarn to pnpm #27299
Conversation
dffc1f6
to
c022d77
Compare
Probably a good choice, but you'll have to look at the Dockerfile stuff, since the official images only ship with NPM and Yarn1. I know there are a few Docker related PRs active right now, that might move off the official NodeJS image |
I switched the docker images to using |
I've been working on one of them, and have it setup to test this and worked with Renchap to get a successful build on it today. |
This pull request has merge conflicts that must be resolved before it can be merged. |
Switching from our current I ran into multiple issues setting up corepack on my setups, but to be fair, I had other issues with yarn 1.
Also, should we change something to the Renovate config?~~ |
What node version manager are you using? This is very weird, I am not sure what is happening here 🤔 |
v18.18.0 |
Nothing specific, we use The currently open PRs will probably need to be rebased, but Renovate should do it.
I did it for documentation in this repo, but as the main documentation is not versioned, I will probably need to add specific instructions for Mastodon >= 4.3 everywhere Do you want me to open the PR for this now, or should we do it closer to the 4.3 release? |
Yarn v1 is no longer maintained and is causing multiple issues. pnpm is a more modern package manager, which should be much faster and generate a more correct `node_modules/` I monkey-patched the parts of Webpacker that called `yarn` directly to replace it with `pnpm`.
Those are unused as the definitions are included in the base packages
Rebased with latest |
This pull request has resolved merge conflicts and is ready for review. |
Compiled and running it in prod, no errors. |
This pull request has merge conflicts that must be resolved before it can be merged. |
Closing as #27073 has been merged. |
This is al alternative to #27073
Yarn 1 is no longer maintained and suffers from many bugs (including eslint/eslint#17215 (reply in thread) which prevents multiple package upgrades)
pnpm is a more modern package manager, which should be much faster and generate a more correct
node_modules/
The two main changes are:
pnpm
maintains a global package repository on your machine. Then it links those packages intonode_modules/
, which makes installation much more efficient and reduces the disk usage if you have many JS projects on your computernode_modules/
. For example,tesseract.js-core
was not defined as a dependency but was imported from a JS file, causing an error, so I added it as an explicit dependency.As Webpacker relies on
yarn
, I monkey-patched the parts that calledyarn
directly to replace it withpnpm
.Our setup should now properly support corepack, so installing the package manager is as simple as
corepack prepare --activate
(and maybecorepack enable
before, if it has never been ran on this machine and is not down when installing node). It will automatically install the correct pnpm version.This PR is based on #27295 as we can no longer use
capitrano-yarn
, and Capistrano is not tested so I removed it.