You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When automatically addiing peerDependencies to the built package.json files for publishable libs, some top-level dependencies can be missing if they are also dependencies of other dependencies
Expected Behavior
All top-level dependencies are included in the peerDependencies section of the built package.json, even if they are also dependencies of other dependencies.
Steps to Reproduce
With publishable libs where:
lib-a imports from lib-b and also from npm package @external/package
lib-b imports from npm package @external/package
After running nx run lib-a:build, the dist package.json file for the lib does not contain @external/package in the peerDependencies, even though lib-a imports from it.
Nx Report
Node : 16.16.0
OS : darwin x64
npm : 8.11.0
nx : 14.1.10
@nrwl/angular : 14.1.10
@nrwl/cypress : 14.1.10
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.10
@nrwl/eslint-plugin-nx : 14.1.10
@nrwl/express : Not Found
@nrwl/jest : 14.1.10
@nrwl/js : Not Found
@nrwl/linter : 14.1.10
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.1.10
@nrwl/web : Not Found
@nrwl/workspace : 14.1.10
typescript : 4.6.4
---------------------------------------
Community plugins:
@ng-bootstrap/ng-bootstrap: 11.0.1
@ngrx/component-store: 13.2.0
@ngrx/effects: 13.2.0
@ngrx/store: 13.2.0
@compodoc/compodoc: 1.1.19
@ngrx/eslint-plugin: 14.3.2
@ngrx/store-devtools: 13.2.0
@storybook/angular: 6.5.13
Additional Information
After debugging, it seems the issue is affected by the order of processing deps in the recursive collectDependenciesfunction.
If this function processes the dependency on lib-b before it processes the dependency on the npm package, then the npm package is added as a non-top-level dependency to the accumulator, then skipped when it is processed as a top-level dependency because it already exists in the accumulator.
The text was updated successfully, but these errors were encountered:
Current Behavior
When automatically addiing peerDependencies to the built package.json files for publishable libs, some top-level dependencies can be missing if they are also dependencies of other dependencies
Expected Behavior
All top-level dependencies are included in the peerDependencies section of the built package.json, even if they are also dependencies of other dependencies.
Steps to Reproduce
With publishable libs where:
lib-a
imports fromlib-b
and also from npm package@external/package
lib-b
imports from npm package@external/package
After running
nx run lib-a:build
, the dist package.json file for the lib does not contain@external/package
in the peerDependencies, even though lib-a imports from it.Nx Report
Additional Information
After debugging, it seems the issue is affected by the order of processing deps in the recursive
collectDependencies
function.If this function processes the dependency on
lib-b
before it processes the dependency on the npm package, then the npm package is added as a non-top-level dependency to the accumulator, then skipped when it is processed as a top-level dependency because it already exists in the accumulator.The text was updated successfully, but these errors were encountered: