-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(js): fine-grained dep type support for publishable libs #10595
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Allows lib package.json to define its dependencies appropriately between dependencies and peerDependencies, while providing a way to continue to inherit the workspace's pkg version e.g. "foo": "[inherit]" ISSUES CLOSED: 10550
packageJson[typeOfDependency][packageName] = depVersion; | ||
} else if (isNpmProject(entry.node)) { | ||
// If an npm dep is part of the workspace devDependencies, do not include it the library | ||
if ( | ||
!!workspacePackageJson.devDependencies?.[ | ||
entry.node.data.packageName |
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.
The packageName is already normalized on L322
Hi @mckramer thank you for the PR, can you rebase the PR and fix the conflict? |
Hey @mckramer! This PR has been sitting around for a bit. I have some concerns with using '[inherit]' as a version token inside the project's package.json, as if a workspace is also using package manager's workspace functionality (e.g. yarn workspaces), it would cause errors on installation. As such, I'm going to go ahead and close this PR. Lets talk over potential solutions in an issue, and then after we agree with how to move forward a community member or team member can open a new PR. |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Allows lib package.json to define its dependencies appropriately between dependencies and peerDependencies, while providing a way to continue to inherit the workspace's pkg version
e.g. "foo": "[inherit]"
Current Behavior
If the options to update the package is true and a dependency is declared in the libraries package.json, it would not be updated.
Expected Behavior
If dependency is declared with "magic" string ===
[inherit]
. The version will be updated from workspace package.json for that dependency.This allows a library to maintain finer control over whether to use dependencies or peerDependencies for a given package, without giving up the ability to inherit the workspace's package.json version.
Related Issue(s)
Fixes #10550