-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Dependencies of a child workspace are not returned during npm query
.
Given a dependency chain applications/my-app -> packages/top-level-library -> packages/lower-level-library
,
When I query with selector .workspace > .workspace > *
Then no dependencies are returned.
Expected Behavior
Dependencies of child workspaces should be returned with npm query
.
Given a dependency chain applications/my-app -> packages/top-level-library -> packages/lower-level-library
,
When I query with selector .workspace > .workspace > *
Then lower-level-library
is returned.
Steps To Reproduce
- Setup:
$ mkdir test-workspaces && cd test-workspaces
$ npm init -y
$ npm init -y -w applications/my-app
$ npm init -y -w packages/top-level-library
$ npm init -y -w packages/lower-level-library
$ npm install -w packages/top-level-library ./packages/lower-level-library
$ npm install -w applications/my-app ./packages/top-level-library
- Query:
$ npm query ".workspace" | jq 'map(.name)|join(",")'
my-app,top-level-library,lower-level-library
$ npm query ".workspace > .workspace" | jq 'map(.name)|join(",")'
top-level-library,lower-level-library
$ npm query ".workspace > .workspace > .workspace" | jq 'map(.name)|join(",")'
Environment
- npm: 9.8.1, 10.1.0
- Node.js: 18.18.0
- OS Name: MacOS
- System Model Name: Macbook Pro
- npm config:
; copy and paste output from `npm config ls` here
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release