Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@diginikkari
Copy link
Contributor

Current Behavior

When a workspace library has a name field set in its nx configuration (e.g., "nx": { "name": "buildable" }), the @nx/js:prune-lockfile executor fails to include transitive dependencies from that library in the pruned lockfile.

The issue occurs because addNodesAndDependencies attempts to retrieve workspace nodes using graph.nodes[name] where name is the package name from package.json, but graph.nodes is keyed by the project name (from nx.name). When these differ, the lookup fails and transitive dependencies are not traversed.

Expected Behavior

The @nx/js:prune-lockfile executor should include all transitive dependencies from workspace libraries regardless of whether the library has a name field set in its nx configuration.

The fix uses the workspace node from the workspacePackages map (which is keyed by package name) instead of attempting to look it up in graph.nodes (which is keyed by project name).

Related Issue(s)

Fixes #33582

@diginikkari diginikkari requested review from a team and meeroslav as code owners November 23, 2025 15:47
@diginikkari diginikkari requested a review from MaxKless November 23, 2025 15:47
@netlify
Copy link

netlify bot commented Nov 23, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 65ae1e2

@vercel
Copy link

vercel bot commented Nov 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 12, 2025 3:31pm

@diginikkari diginikkari changed the title fix(nx): handle workspace packages when nx.name differs from package.json.name fix(js): handle workspace packages when nx.name differs from package.json.name Nov 23, 2025
@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 12, 2025

View your CI Pipeline Execution ↗ for commit 65ae1e2

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 33m 57s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 1m 32s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-12 16:43:55 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Important

A new CI pipeline execution was requested that may update the conclusion below...

Nx Cloud has identified a possible root cause for your failed CI:

Our PR changes fix workspace package handling in the prune-lockfile executor, which has no code path connection to the Storybook serve operation. The e2e test failure is due to a test infrastructure issue where the expected regex pattern /Storybook.*started/gi doesn't match the actual Storybook v10.1.7 output "Storybook ready!", causing a timeout despite Storybook successfully starting.

No code changes were suggested for this issue.

If the issue was transient, you can trigger a rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

…json.name

Fix addNodesAndDependencies to correctly retrieve workspace nodes from workspacePackages map instead of graph.nodes when handling workspace dependencies. This ensures transitive dependencies are included even when the project's nx.name differs from its package.json.name.

Fixes nrwl#33582
@jaysoo jaysoo merged commit 30e6f85 into nrwl:master Dec 12, 2025
15 of 16 checks passed
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
…json.name (#33583)

## Current Behavior
<!-- This is the behavior we have today -->

When a workspace library has a `name` field set in its `nx`
configuration (e.g., `"nx": { "name": "buildable" }`), the
`@nx/js:prune-lockfile` executor fails to include transitive
dependencies from that library in the pruned lockfile.

The issue occurs because `addNodesAndDependencies` attempts to retrieve
workspace nodes using `graph.nodes[name]` where `name` is the package
name from `package.json`, but `graph.nodes` is keyed by the project name
(from `nx.name`). When these differ, the lookup fails and transitive
dependencies are not traversed.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/js:prune-lockfile` executor should include all transitive
dependencies from workspace libraries regardless of whether the library
has a `name` field set in its `nx` configuration.

The fix uses the workspace node from the `workspacePackages` map (which
is keyed by package name) instead of attempting to look it up in
`graph.nodes` (which is keyed by project name).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #33582

(cherry picked from commit 30e6f85)
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
…json.name (#33583)

## Current Behavior
<!-- This is the behavior we have today -->

When a workspace library has a `name` field set in its `nx`
configuration (e.g., `"nx": { "name": "buildable" }`), the
`@nx/js:prune-lockfile` executor fails to include transitive
dependencies from that library in the pruned lockfile.

The issue occurs because `addNodesAndDependencies` attempts to retrieve
workspace nodes using `graph.nodes[name]` where `name` is the package
name from `package.json`, but `graph.nodes` is keyed by the project name
(from `nx.name`). When these differ, the lookup fails and transitive
dependencies are not traversed.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/js:prune-lockfile` executor should include all transitive
dependencies from workspace libraries regardless of whether the library
has a `name` field set in its `nx` configuration.

The fix uses the workspace node from the `workspacePackages` map (which
is keyed by package name) instead of attempting to look it up in
`graph.nodes` (which is keyed by project name).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #33582
@github-actions
Copy link
Contributor

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 Dec 18, 2025
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.

Bug: @nx/js:prune-lockfile excludes transitive dependencies from workspace libraries when nx.name is set

3 participants