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

@nrwl/js:tsc includes non-toplevel dependencies when building the package.json #15070

Closed
jessecollier opened this issue Feb 16, 2023 · 5 comments

Comments

@jessecollier
Copy link

Current Behavior

Given three buildable and publishable packages depending on each other:

A -> B -> C

Building package A generates a package.json with a dependency on B and C.

Expected Behavior

Package A should only have dependency on B.

This issue here is that ALL dependencies in the graph are used:
https://github.com/nrwl/nx/blob/master/packages/js/src/executors/tsc/tsc.impl.ts#L168

Compared to @nrwl/angular:package which uses only topLevel dependencies:

GitHub Repo

No response

Steps to Reproduce

  1. Create 3 typescript packages using tsc compiler (packageA, packageB, packageC)
  2. Import packageB in package A
  3. Import packageC in packageB
  4. Build.

Nx Report

npx nx report

 >  NX   Report complete - copy this into the issue template

   Node : 18.12.1
   OS   : darwin arm64
   npm  : 9.2.0

   nx : 15.3.3
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.3.3
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.3.3
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.3.3
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.3.3
   @nrwl/js : 15.3.3
   @nrwl/linter : 15.3.3
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.3.3
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.3.3
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.3.3
   @nrwl/web : 15.3.3
   @nrwl/webpack : 15.3.3
   @nrwl/workspace : 15.3.3
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:


### Failure Logs

_No response_

### Additional Information

_No response_
@AgentEnder
Copy link
Member

Can you try to repro this in latest? A lot has changed in this area recently.

@AgentEnder AgentEnder added blocked: retry with latest Retry with latest release or head. scope: js labels Feb 17, 2023
@JosefBredereck
Copy link
Contributor

See my comment in another issue where I listet everything #10227 (comment)

There are two similar issues open right now and in one its stated that there are no recent updates.

IMHO other executors could have the same issue because they also don't use the shallow option of calculateProjectDependencies. Only rollup has this working right now.

@jessecollier
Copy link
Author

Can you try to repro this in latest? A lot has changed in this area recently.

I'll give it a shot, but I linked to master branch code that has the issue

@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions
Copy link

github-actions bot commented May 6, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants