-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: main
Are you sure you want to change the base?
Adding Yarn v1.x workspaces metadata extractor #666
Conversation
) -> list[Workspace]: | ||
"""Extract workspace metadata from a package. | ||
|
||
Currently does not deal with nested workspaces, however the way the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember reading that nested workspaces are not supported: https://classic.yarnpkg.com/lang/en/docs/workspaces/#toc-limitations-caveats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think it is worth mentioning this here anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? Yarn v1 is maintenance only so nested workspaces aren't happening and so we'd better not confuse the reader with the unlikely possibility of an unplanned feature in the ecosystem.
) | ||
|
||
|
||
def get_workspace_paths( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably ensure that a package.json exists for each workspace we report
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added a check.
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]>
4539e89
to
5c27f9e
Compare
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
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:
/ok-to-test
(as is the standard for Pipelines as Code)