-
Notifications
You must be signed in to change notification settings - Fork 392
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
chore: migrate from yarn to pnpm #4897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good so far. I'm surprised so many changed are needed for pnpm, but I do like the workspace:*
thing.
One thing missing: this code to build the benchmarks will need to run yarn or pnpm:
lwc/packages/@lwc/perf-benchmarks/scripts/build.js
Lines 117 to 120 in 4df361b
'yarn --immutable', | |
// bust the Tachometer cache in case these files change locally | |
`echo '${directoryHash}'`, | |
'yarn build:performance:components', |
The reason is that it is going to compare the current master
against an arbitrary commit from the past. Since that arbitrary commit might be using yarn, I'd suggest checking if [ -f yarn.lock ]
inline.
@nolanlawson thank you for looking into this! I'll see what I can do about the benchmark scripts. I left them for last since it takes a while to fully run. The changes in src are mostly due to the non-flat structure of node_modules, which actually helps figure out some "phantom" and cyclic dependencies since they break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. It'll take some muscle memory for me to remember to type pnpm
instead of yarn
(also a bit more awkward to type 😆) but overall this is a great change. We were sticking with yarn v1 for way too long.
Also: the Tachometer tests work now! I guess we will just "shamefully hoist" 🤷
Thanks a lot!! ❤️
/nucleus test |
Co-authored-by: Nolan Lawson <[email protected]>
/nucleus test |
I can repro the above SauceLabs issue:
I'll dig into it since you need SauceLabs credentials in order to repro. Not sure why the pnpm change exposed this. |
After some fruitless debugging, I am quite lost. I cannot even figure out how to run the Maybe we can switch to |
@nolanlawson that's weird... I can't repro here. |
@nolanlawson actually, the pinned got version wasn't compatible with sauce. I unpinned it and that issue should be fixed. This wasn't pinned originally, so I don't think it should block this PR.
Ref: GHSA-pfrx-2q88-qq97 |
This reverts commit 36bc724.
Ahhh, that makes sense! I didn't consider that it was the BTW I opened #4946 to fix the subdir issue. No need to do it here. I'm going to do some research into how to do |
/nucleus test |
@nolanlawson maybe you need to do |
Figured out the trick. To run the karma tests in the
This is fine – it's just "one of those things you need to know" for pnpm I guess. The |
/nucleus test |
/nucleus test |
Ugggghh... I just remembered something. Our internal tool for testing downstream repos, Nucleus, does not support pnpm. It only supports npm and yarn. 😞 I think we will either need to switch to npm or latest yarn. Sorry for the runaround @cardoso – I totally forgot until just now. My personal preference is for latest npm. Don't feel obligated – I can do the conversion. |
@nolanlawson ouch! That was close 😅. Yeah, since I don't have access to nucleus, I'll leave it to you. Not sure if anything here can be reused, so feel free to close this PR. |
Closing for now, would be happy to revisit later! |
Details
I'm still going through all scripts and haven't touched CI yet, but this is mostly working.
I don't know what external workflows might depend on things like the versions being spelled out in
package.json
and could break by using workspace:* and others. I initially made it work without that feature, so I can revert back to spelled out versions if needed.Since pnpm doesn’t hoist dependencies to the root by default, it uncovers several issues similar to
@lwc/shared
dep #4415I’m submitting fixes for those separately to make sure they are correct.
I recommend cloning in a separate folder or running
git clean -dfX
before trying this out.pnpm version used:
9.14.2
.Closes #4426
Top-level package.json scripts I tested so far:
Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item