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

update to yarn 3.6.3 #98

Merged
merged 3 commits into from May 6, 2024
Merged

update to yarn 3.6.3 #98

merged 3 commits into from May 6, 2024

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Oct 24, 2022

closes #102

update to Yarn 3.6.3 now that Dependabot supports Yarn v2/v3: dependabot/dependabot-core#1297 (comment)

For migration steps see https://yarnpkg.com/getting-started/migration

Also use corepack similar to docker/actions-toolkit#323 to download yarn on-fly.

$ corepack enable
# https://yarnpkg.com/getting-started/install#updating-to-the-latest-versions
$ yarn set version stable
$ yarn --version
3.6.3

Also install plugin-interactive-tools yarn pkg: https://yarnpkg.com/api/modules/plugin_interactive_tools.html

$ yarn plugin import interactive-tools

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Why is yarn itself committed to the repository? We don't even store the modules we use in the repo.

@crazy-max
Copy link
Member Author

Why is yarn itself committed to the repository? We don't even store the modules we use in the repo.

Yarn Modern (v2/v3) has some breaking changes with old v1 and therefore requires Yarn releases to be kept versioned: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored. This prevents potential issues if, say, two engineers use different Yarn versions with different features.

@crazy-max crazy-max marked this pull request as draft October 25, 2022 18:50
@crazy-max crazy-max force-pushed the yarn-update branch 2 times, most recently from 9f553cb to 3130840 Compare November 27, 2022 14:51
@crazy-max
Copy link
Member Author

@tonistiigi Setting yarn version in the Dockerfile works: master...crazy-max:docker-bake-action:yarn-update-2#diff-3ed65642ec1610de6b0f162c77dc8499662ebeb7057d3f6c89108952d1cb33deR10-R14 but Dependabot will still use Yarn v1 and corrupt the lock file 😞.

Unfortunately we can't define yarn version in the yarnrc config, just the yarnPath: https://yarnpkg.com/configuration/yarnrc#yarnPath

The yarnPath setting is currently the preferred way to install Yarn within a project, as it ensures that your whole team will use the exact same Yarn version, without having to individually keep it up-to-date.

@crazy-max
Copy link
Member Author

crazy-max commented Nov 27, 2022

@tonistiigi Switching back to npm looks to be the only alternative we have if you still don't want yarn installed within the repo:

@crazy-max crazy-max changed the title Update to Yarn 3.2.4 Update to Yarn 3.3.0 Nov 27, 2022
@crazy-max crazy-max changed the title Update to Yarn 3.3.0 update to yarn 3.6.3 Apr 27, 2024
@crazy-max crazy-max removed the request for review from jedevc April 27, 2024 08:15
@crazy-max
Copy link
Member Author

@tonistiigi Now using corepack to avoid having yarn in the repo.

@crazy-max crazy-max marked this pull request as ready for review April 27, 2024 08:16
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
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.

None yet

2 participants