nx icon indicating copy to clipboard operation
nx copied to clipboard

feat(js): fine-grained dep type support for publishable libs

Open mckramer opened this issue 3 years ago • 2 comments

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

mckramer avatar Jun 06 '22 14:06 mckramer

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 392e191d84eaf0267b4639b98dd56b2f27e28225. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Jun 06 '22 14:06 nx-cloud[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jun 6, 2022 at 2:32PM (UTC)

vercel[bot] avatar Jun 06 '22 14:06 vercel[bot]

Hi @mckramer thank you for the PR, can you rebase the PR and fix the conflict?

nartc avatar Sep 23 '22 09:09 nartc

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.

AgentEnder avatar Mar 16 '23 19:03 AgentEnder

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.

github-actions[bot] avatar Mar 21 '23 20:03 github-actions[bot]