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

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

Closed
wants to merge 1 commit into from

Conversation

mckramer
Copy link
Contributor

@mckramer mckramer commented Jun 6, 2022

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

@nx-cloud
Copy link

nx-cloud bot commented Jun 6, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 392e191. 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.

@vercel
Copy link

vercel bot commented Jun 6, 2022

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)

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
Copy link
Contributor Author

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

@nartc
Copy link
Contributor

nartc commented Sep 23, 2022

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

@AgentEnder
Copy link
Member

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 AgentEnder closed this Mar 16, 2023
@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fine-grained dependency type support for publishable libraries
3 participants