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

[wip] Support yarn "resolutions" #34

Closed
wants to merge 2 commits into from
Closed

Conversation

geropl
Copy link
Member

@geropl geropl commented Sep 2, 2020

Fixes #12 .

This is a first draft to solve the issues mentioned in #12 (comment).

Open questions:

packageJSON["files"] = packageJSONFiles
packageJSON["files"] = packageJSONFiles

_, err = mergeYarnWorkspaceResolutions(p.C.W.Origin, packageJSON)
Copy link
Collaborator

Choose a reason for hiding this comment

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

not keen on the assumption that the package.json is in the workspace root.
I'd rather see this as a config field resolutionsFrom or something. That file would then become AdditionalSource of the yarn package.

Copy link
Member Author

Choose a reason for hiding this comment

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

@csweichel I wondered whether there already is an (implicit) relation between leeway and yarn; especially with regards to nested workspaces? Or do we "just" call yarn and are 100% yarn-workspace-agnostic? If there already were such an (implicit) relation it might be nice to make that explicit and derive the package.json for this use case from that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Leeway is built on the assumption that all packages of a workspace, including yarn packages, can stand on their own. In that sense, it even assumes that yarn workspaces don't exist.

The only concession we're making to Yarn here is a yarn.lock that resides outside of the package. It's still explicitly listed in the package definition, becomes part of a package's source list and does not imply anything else about the package's structure - just that the yarn lock is outside the package directory. Really, this is something I'd love to get rid of today rather than tomorrow.

@csweichel
Copy link
Collaborator

Open questions:

Leeway knows nothing about yarn workspaces, as such any assumption of this kind doesn't sit right.
The source of resolutions should be explicitly listed in a package that requires them.

  • How to include the workspace root's resolutions into the caching hash?

By listing the "resolutions package.json" explicitly, it can become part of the package's source manifest, hence its version.

@csweichel
Copy link
Collaborator

closing for now. Please re-open if it's still relevant in the future.

@csweichel csweichel closed this Dec 1, 2020
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.

Support "resolutions" in typescript libraries
2 participants