Skip to content

feat: add yarn v2 (berry) support #820

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

Merged
merged 6 commits into from
Sep 22, 2021
Merged

feat: add yarn v2 (berry) support #820

merged 6 commits into from
Sep 22, 2021

Conversation

mathe42
Copy link
Contributor

@mathe42 mathe42 commented Mar 10, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR adds yarn v2 support. For this the json5 dependencie has to be added directly in package.json

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@mathe42 mathe42 changed the title WIP: add yarn v2 (berry) support feat add yarn v2 (berry) support Mar 10, 2021
@mathe42 mathe42 changed the title feat add yarn v2 (berry) support feat: add yarn v2 (berry) support Mar 10, 2021
@mathe42
Copy link
Contributor Author

mathe42 commented Mar 10, 2021

As json5 is required by some code with yarn v2 @nuxt/content has to declare it in the dependencies.

This is a single line change to the package.json

Just wondering why is yarn.lock not in git and not in .gitignore? One of this should be true!?

Copy link
Collaborator

@nozomuikuta nozomuikuta left a comment

Choose a reason for hiding this comment

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

@mathe42

Would you share some references so that we can know better why json5 package is needed?
Once it's verified, I think I can merge this PR.

By the way, yarn.lock was generated again after you had created this PR.
So it would be safer if you merge the main branch to your branch and update yarn.lock file as needed.

@mathe42
Copy link
Contributor Author

mathe42 commented Sep 22, 2021

JSON5 is imported here: https://github.com/nuxt/content/blob/main/packages/content/lib/database.js#L5 so for yarn v2 (berry) it would be optimal to add it to dependencies. (You can have multiple versions of a package with yarn v2 so yarn doesn't know wich to use. (There are workarounds but I think adding the dependencie would be a good idea).

Copy link
Collaborator

@nozomuikuta nozomuikuta left a comment

Choose a reason for hiding this comment

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

@mathe42

Thank you for quick response!

I see, and yeah, JSON5 package definitely should be added as a dependency if it's directly used by the package, regardless of Yarn's requirement. 🙌

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