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

Adding Yarn v1.x workspaces metadata extractor #666

Merged

Conversation

a-ovchinnikov
Copy link
Collaborator

@a-ovchinnikov a-ovchinnikov commented Sep 26, 2024

In Yarn v1.x workspaces metadata is stored outside of yarn.lock in package.json. This commit inroduces functions for workspaces metadata extraction and a dataclass to represent workspaces.

This addresses #630

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@a-ovchinnikov a-ovchinnikov marked this pull request as ready for review October 9, 2024 20:00
A model to handle yarn workspaces is added.
Workspaces allow user to install dependencies from
multiple package.json files within one root package.
Official workspaces definition:
  https://classic.yarnpkg.com/lang/en/docs/workspaces/

Signed-off-by: Alexey Ovchinnikov <[email protected]>
In Yarn v1.x workspaces metadata is stored outside of yarn.lock in
package.json. This commit inroduces functions for workspaces metadata
extraction and a dataclass to represent workspaces.

Signed-off-by: Alexey Ovchinnikov <[email protected]>
It turns out that workspaces could be either Array or
a nested Array in an Object thus we must handle both cases.
Official docs mentioning the former:
  https://classic.yarnpkg.com/lang/en/docs/workspaces/
Official blog containing a hint about the latter:
  https://classic.yarnpkg.com/lang/en/docs/workspaces/

Signed-off-by: Alexey Ovchinnikov <[email protected]>
@a-ovchinnikov a-ovchinnikov added this pull request to the merge queue Oct 21, 2024
Merged via the queue into containerbuildsystem:main with commit 746bdfe Oct 21, 2024
16 checks passed
@a-ovchinnikov a-ovchinnikov deleted the yarn_workspace_metadata branch October 21, 2024 19:07
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