Update to pnpm 11 and enable dedupePeers - #9766
Conversation
|
I think we should also migrate to https://github.com/pnpm/setup |
|
Also no idea if there are still holes in pnpm 11 support, see dependabot/dependabot-core#14794 (comment) |
Feels like a point of concern to me if it just removes all the security alerts :/ |
|
dependabot defaults to pnpm 11 at the moment so it is already using pnpm 11, we would need to force it to use pnpm 10 by setting the package manager in the package.json file if we want it to use pnpm 10. They definitely don't support using pnpm 12 like that yet based on the comments in the dependabot threat that pika linked (something about the new pnpm 12 installer not respecting dependabot's proxy settings). |
|
Also our project is not affected by that because our pnpm lockfile is a single yaml document, pnpm 11 only switches to a multi document one if you have special settings (e.g. requiring a specific version of pnpm in the package.json), pnpm 12 supposedly always uses that multi document format but i'm using pnpm 12 locally and it hasn't switched the format yet. |
|
Okay, convinced :)
Should this be done here or separate PR? |
|
The GitHub Actions macOS runners have been using ARM64 CPUs for a while now, so that shouldn't affect use in GitHub Actions, not sure if that is something that would affect local development of FreeTube though. |
Local dev with intel macOS can still install pnpm 11 I guess... or wdym |
|
Okay then it doesn't seem like a concern for us. |
|
I can make a separate PR for the migration if you prefer |
Which migration? What is not done yet in this PR that you want to do in a separate PR? |
|
As there will almost certainly be conflicts with all the dependabot PRs, I'll rebase this PR/redo the lockfile changes afterwards and do that pnpm setup migration then (looks like we'll want to turn off a bunch of the enabled by default config options in that action, so I'll need to experiment in my fork first). |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
There was allot of activity in the recent hours on v12 support. 1 PR needs to be merged and seems close to me |
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
Switched to pnpm/setup but only using it to setup pnpm and I also switched from |
|
pnpm/setup has |
|
As we restore the cache after installing pnpm we cannot use that option. We manage the cache ourselves to have full control over when we ignore it, only read it or read and write to it. |
|
When pika originally suggested that we switch to |
|
Pnpm 12 support just has been added do we want to make the jump or stick with 11? |
|
Stick with 11 for now, the last dependabot-core release was before the last pnpm 12 relevant PR was merged in the dependabot-core repo, so we should definitely wait until they have rolled out pnpm 12 support in dependabot before bumping. So I would say get this merged first and then bump to pnpm 12 later once dependabot supports it, rather than leaving this PR open until then and having to deal with the conflicts every week with the dependabot PRs. |
CI-and-lockfile-only sync; no app code changed apart from one German string. - Update to pnpm 11 and enable dedupePeers (FreeTubeApp#9766): the workflows move to pnpm 11, the `ci` script is deleted from package.json in favour of calling `pnpm install --frozen-lockfile` directly, pnpm-workspace.yaml uncomments `dedupePeers: true`, and the lockfile is rewritten to the deduped peer-key form (no package version changes at all). - Translated using Weblate (German): one string, de-DE back to 100 %. package.json was the only conflict: upstream deleted the `ci` script, whose line sits directly under our pack:android* block, so its context lines did not match. Resolved by keeping our block and dropping `ci`. pnpm-lock.yaml auto-merged and `pnpm install` confirms it is already consistent ("Lockfile is up to date"); only node_modules restructured (+53 -39) under dedupePeers. Both bundles compile: `pnpm run pack` and `pnpm run pack:android`.


Pull Request Type
Description
We originally pinned the workflows to pnpm 10 as for a long time dependabot didn't support pnpm 11, however they have supported and been running with pnpm 11 for a few weeks now without any noticable issues, so I think it is time that we pin it to 11 instead. This also enables the
dedupePeerssetting that is new in pnpm 11 which cuts down on some of the information stored in the lock file for peer dependencies which should hopefully reduce conflicts. I chose 11 instead of 12 as dependabot runs 11 but if we think that it should be fine I am also happy to pin to 12 instead.I also removed the
ciscript in the package.json file, aspnpm run {x}runspnpm installinternally, so we were runningpnpm install+pnpm install --frozen-lockfileand replaced it with a direct call topnpm install --frozen-lockfilein the workflow files.Testing
Successful build workflow:https://github.com/absidue/FreeTube/actions/runs/34990910624
The lint workflow on this pull request
Desktop