Is there an existing issue for this?
This issue exists in the latest npm version
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
Is there an existing issue for this?
This issue exists in the latest npm version
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-libraryis returned.Steps To Reproduce
Environment
; copy and paste output from `npm config ls` here