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

Upgrade to yarn v4 with yarnPath #8

Merged
merged 3 commits into from
Nov 29, 2023

Conversation

shakuzen
Copy link
Member

Specifies the package manager (yarn) and version (4.0.2) in package.json. The package-lock.json file was removed. Yarn reported an error due to having both it and yarn.lock. There should only be one lock file. The yarn.lock file has been rewritten in the latest yarn lock format.

https://yarnpkg.com/migration/guide

@shakuzen
Copy link
Member Author

I'd like to get CI builds setup before merging this. Over the weekend, I noticed in a side project that the version of Yarn I expected to be used wasn't (JapanFinance/JapanFinance.github.io#47). We'll need to do something similar here I expect.

Specifies the package manager (yarn) and version (4.0.2) in package.json. The package-lock.json file was removed. Yarn reported an error due to having both it and yarn.lock. There should only be one lock file. The yarn.lock file has been rewritten in the latest yarn lock format.
@shakuzen
Copy link
Member Author

As suspected, this wasn't using yarn v4 but rather the globally installed yarn v1. From the build:

Run actions/setup-node@v4
Found in cache @ /opt/hostedtoolcache/node/20.9.0/x64
Environment details
/usr/local/bin/yarn --version
1.22.19

Copy link
Member Author

@shakuzen shakuzen Nov 20, 2023

Choose a reason for hiding this comment

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

Having both a package-lock.json and yarn.lock file results in a warning from yarn. This file won't be used so long as yarn is doing the building. But I notice that GitHub is opening pull requests to update dependencies that only update package-lock.json. That won't actually change anything for our build.

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

The original intent was to use yarn v4 via corepack as is encouraged, but the setup-node action does not have an option to enable corepack.
We can check in yarn to source control and use that copy until corepack is more easily usable with setup-node.
@shakuzen shakuzen changed the title Upgrade to yarn v4 with corepack Upgrade to yarn v4 with yarnPath Nov 20, 2023
@oodamien oodamien closed this Nov 21, 2023
@oodamien oodamien reopened this Nov 29, 2023
@oodamien oodamien merged commit 7d0aa62 into micrometer-metrics:main Nov 29, 2023
2 checks passed
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