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

Use Volta to manage Node and Yarn version #933

Merged
merged 6 commits into from
Feb 13, 2023
Merged

Use Volta to manage Node and Yarn version #933

merged 6 commits into from
Feb 13, 2023

Conversation

felipecrs
Copy link
Contributor

So, I noticed that you upgraded Yarn to v3. So, I tried to upgrade it here in my environment as well and I noticed two problems:

  • It was generating some files that were not git ignored
  • It was causing yarn build to fail

Then I noticed as well that the GitHub workflows were still using Yarn v1, and thus were re-generating the yarn.lock during build (which should not happen).

This refactors the logic to use Volta. I use Volta to manage the Node and NPM/Yarn versions of my projects since Volta 1.0 was released, and I never looked behind. It's blazing fast, you don't even notice how fast it downloads either node or yarn when you enter in a project that uses it.

So, this ensures all environments are using the same version of Node and Yarn. When you want to upgrade to some newer version of both, you can run:

volta pin node@18 yarn@3

That will update package.json with the up-to-date version of both.

@felipecrs felipecrs marked this pull request as draft February 11, 2023 15:28
@felipecrs felipecrs marked this pull request as ready for review February 11, 2023 15:31
@felipecrs
Copy link
Contributor Author

felipecrs commented Feb 11, 2023

I mean, I'd totally respect if you prefer not using Volta. I'd just recommend you give it a try. :)

@felipecrs
Copy link
Contributor Author

You can see that GitHub Actions is currently using Yarn v1 here: https://github.com/dermotduffy/frigate-hass-card/actions/runs/4159320574/jobs/7195271272#step:3:6

@dermotduffy dermotduffy merged commit 5910c09 into dermotduffy:release-4.1.0 Feb 13, 2023
@dermotduffy
Copy link
Owner

Thanks @felipecrs! I noticed github wasn't yet using yarn3, but hadn't gotten around to fixing it. I wasn't aware of volta, this seems like a great fix. Thank you again!

@felipecrs felipecrs deleted the volta branch February 13, 2023 03:43
@dermotduffy dermotduffy added the build Build System and Dependencies label Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build System and Dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants