Skip to content
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]: Upgrade to yarn 4 #2610

Merged
merged 28 commits into from
Aug 23, 2024
Merged

[chore]: Upgrade to yarn 4 #2610

merged 28 commits into from
Aug 23, 2024

Conversation

heshan0131
Copy link
Contributor

@heshan0131 heshan0131 commented Aug 20, 2024

  • Upgrade default yarn version to Yarn 4.4.0 https://yarnpkg.com/blog/release/4.0
  • Add .yarnrc.yml
  • Added volta
  • Add packageManager to package.json
  • Fix github workflows
  • Fix netlify build and deploy
  • run yarn cache clean and yarn install and yarn bootstrap for a fresh install
  • Future work might needed to fix npm publish workflow

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for keplergl2 ready!

Name Link
🔨 Latest commit dd59d25
🔍 Latest deploy log https://app.netlify.com/sites/keplergl2/deploys/66c825ac2f3ec50008a21d4d
😎 Deploy Preview https://deploy-preview-2610--keplergl2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -10,7 +10,9 @@ umd/

typedoc/

*/**/yarn.lock
examples/**/yarn.lock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the yarn4 gitignore recommendations that I have been following in the vis.gl repos https://github.com/visgl/luma.gl/blob/master/.gitignore#L33

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying different things to get netlify deployment works on this PR. So far I noticed if I don't have yarn.lock in the website and examples/demo-app folder, running yarn install in these two folders to build the website will fail with a 'issing yarn.lock' message

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you should check in the yarn.lock file

@@ -70,5 +74,6 @@
"peerDependencies": {
"react": "18.x",
"react-dom": "18.x"
}
},
"packageManager": "[email protected]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had issues mixing volta and packageManager. I personally prefer volta as it makes it way easier to move between repos and directories.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to add a volta section that extends the base package.json, but I got some trouble when adding website to workspaces, so keep a separate volta section in website. Just my experience...


- name: Use Node.js 12.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are using volta locally, don't we want volta to be used in CI too?

https://github.com/visgl/luma.gl/blob/master/.github/workflows/test.yml#L19

.yarnrc.yml Outdated
# https://yarnpkg.com/configuration/yarnrc
nodeLinker: node-modules
# Define the registry to use when fetching packages.
npmRegistryServer: "https://registry.yarnpkg.com"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised that registry entry is needed.

"node": ">=10.0.0"
"node": ">=18"
},
"volta": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep engines and volta at the bottom of package.json? Just used to having them there. Or at least together with the packageManager field, I missed these in my first read through.

@@ -10,7 +10,9 @@ umd/

typedoc/

*/**/yarn.lock
examples/**/yarn.lock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you should check in the yarn.lock file

@heshan0131 heshan0131 merged commit 7b512cf into master Aug 23, 2024
12 checks passed
@heshan0131 heshan0131 deleted the 0820-upgrade-yarn branch August 23, 2024 07:44
@ibgreen
Copy link
Collaborator

ibgreen commented Aug 23, 2024

heshan0131 merged commit 7b512cf into master

Congrats, that was quite an epic PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants