-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Wrong dependencies calculation during builds #10227
Comments
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. |
not stale |
I experience the same problem, and I'm on the search for a solution since hours. So, I have: {
"dependencies": {
"@some/lib2": "version"
}
} @some/lib2: {
"dependencies": {
"@some/lib3": "version",
"random-package1": "version",
"random-package2": "version",
"random-package3": "version"
}
} @some/lib3: {
"dependencies": {
"random-sub-package1": "version",
"random-sub-package2": "version",
"random-sub-package3": "version"
}
} When I now run {
"peerDependencies": {
"@some/lib2": "version",
"@some/lib3": "version",
"random-package1": "version",
"random-package2": "version",
"random-package3": "version",
"random-sub-package1": "version",
"random-sub-package2": "version",
"random-sub-package3": "version"
}
} In my point of view, it should be sufficient to include I found a PR which seems to go in that direction if I do interpret the logic wrong: #10595 |
I looked a bit more into #10595 the code is not used in the package @nrwl/js. |
A solution was implemented in #10600, but rolled back and tried in a second attempt in #12857. The issue is also mentioned in older issues like #8096 #8640 #8641 #9371 where similar stuff is mentioned. |
@JosefBredereck that's a really helpful list, there also appears to be a new issue with this system which I've reported here |
We've deprecated and removed The new recommended approach is to manage the dependencies with the help of a lint rule called: |
@FrozenPandaz is it documented anywhere that this is the case, aside from the lint plugin docs? The main docs site doesn't seem to mention it, and still references the previous approach on the page about dependency management |
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. |
I have a project with many lib packages, I'm using the
updateBuildableProjectDepsInPackageJson
(which is enabled by default) to generate the package json of my libs but I notice some weird behaviorCurrent Behavior
Lib
core
imports some package, let's say@actions/exec
, I build this library and the package.json inside dist/core directory is something like this:which is fine...
Also, I have a second libe, let's say
lib1
which depends on core and do something... I build this library and the package.json inside dist/core directory is something like this:but
@actions/exec
is not imported in lib1 and is a dependency of coreIf I have a third lib which import core and lib1, this lib will have all deps from core and lib1 in their package.json after I build it
Expected Behavior
Only
@sample/core
must be present in the package.json oflib1
Steps to Reproduce
Use this repo https://github.com/gperdomor/nx-sample-buildable-bug
Failure Logs
N/A
Environment
NX Report complete - copy this into the issue template
Node : 16.15.0
OS : darwin x64
npm : 8.9.0
nx : 14.1.4
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.4
@nrwl/eslint-plugin-nx : 14.1.4
@nrwl/express : Not Found
@nrwl/jest : 14.1.4
@nrwl/js : 14.1.4
@nrwl/linter : 14.1.4
@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 : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 14.1.4
typescript : 4.6.4
rxjs : 6.6.7
Community plugins:
The text was updated successfully, but these errors were encountered: