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

Yarn4 migration #212

Merged
merged 7 commits into from
Nov 19, 2024
Merged

Yarn4 migration #212

merged 7 commits into from
Nov 19, 2024

Conversation

marySalvi
Copy link
Collaborator

@marySalvi marySalvi commented Apr 10, 2024

This moves the project from yarn version 1 to yarn version 4.5.1. It uses the "plug 'n' play" installation workflow which eliminates the node_modules directory and uses a global cache for packages.

Setup

  • Must be using Node 18+
  • run corepack enable
  • run yarn set version berry -->This step shouldn't be necessary
  • run yarn

You may need to manually delete your node_modules directory.

@marySalvi marySalvi force-pushed the yarn4-migration branch 2 times, most recently from 9e66dda to 0b5833a Compare April 11, 2024 15:58
@marySalvi marySalvi force-pushed the yarn4-migration branch 2 times, most recently from 930dd22 to 27a86bb Compare October 28, 2024 17:19
@marySalvi marySalvi marked this pull request as ready for review October 28, 2024 17:50
Comment on lines +25 to +33

# Yarn directories
node_modules/*
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@manthey
Copy link
Contributor

manthey commented Oct 30, 2024

We should add the corepack enable line to docs/development.md file. Also, we probably should assert that we expect python 3.11, you need node >= 20, and yarn (do you need to specify yarn version berry to run tox -e binary or just tox?).

@marySalvi
Copy link
Collaborator Author

We should add the corepack enable line to docs/development.md file. Also, we probably should assert that we expect python 3.11, you need node >= 20

agreed

@@ -36,5 +36,11 @@
"vite": "^4.5.5",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^1.8.5"
},
"packageManager": "yarn@4.5.1+sha256.dc2e45a77f87a9c2a76708d098ab54ca0cfdd5ec2cf7d9e3c1f24bf786a2383c",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(do you need to specify yarn version berry to run tox -e binary or just tox?).

Locally I am able to run tox and tox -e binary in a terminal with yarn v1.22.0 and still have it build correctly so long as I am using node 20+ with corepack enabled. I believe this line is why.

Copy link
Collaborator Author

@marySalvi marySalvi Nov 11, 2024

Choose a reason for hiding this comment

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

After some investigation, yes this line combined with corepack is the magic. Once it is enabled corepack is able to detect the correct yarn version. I have updated the ci yaml to reflect this.

Corepack is also what allows us to switch to different projects using different versions without manually setting a new version each time. Huzzah!

https://nodejs.org/api/corepack.html#configuring-a-package

@marySalvi marySalvi merged commit 97a8aad into main Nov 19, 2024
4 checks passed
@marySalvi marySalvi deleted the yarn4-migration branch November 19, 2024 18:43
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.

3 participants