-
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
Generated package.json for publishable libs includes wrong peerDependencies #8096
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. |
I think this is still an issue that needs further investigation |
We are encountering a similar issue with wrong Our publishable UI library has a couple of "main" peerDependencies, like
But, when building the lib with NX this results in a main package.json with:
|
Hi, I have a similar problems on my nxrocks project project, event after having upgraded to Nx In my case, I have a publishable library named Here is an excerpt of the root tsconfig file: tsconfig.base.json
When packaging ( A workaround, is to declare them explicitly as **devDependencies" in the package.json of the publishable library @nxrocks/common's package.json
Is that the appropriate thing to do? |
nx-verison: 14.7.5 We're encountering the same issue. The generated I think the spec-files should be ignored by nx's dependency discovery mechanism. There should be no need to include dev dependency information in a publishable artifact. Adding an option to exclude libs from being included in the generated artifact would be another solution although this manual configuration should not be necessary IMHO. Relates to/Is duplicated by #4547 |
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. |
Replying to keep this topic active. |
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. |
Replying to keep this topic active. |
We have resolved this by changing the way to keep dependencies in sync via an EsLint rule which should allow for you to have dependencies in either |
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. |
Current Behavior
When generating the
package.json
for a publishable lib it sometimes includes dependencies as peerDependency, which shouldn't.Expected Behavior
Only include the dependencies in the generated
package.json
, that are actually needed/used in production.Steps to Reproduce
For example, in the
angular-testing-library
, we encountered the problem that@angular/forms
and@testing-library/user-event
were somehow included in the generatedpackage.json
@angular/forms
and@testing-library/user-event
are NOT used in the library files, but ARE used in in the tests/spec files.(moving those 2 dependencies to our
devDependencies
solves the problem. But is that the correct solution?)See: testing-library/angular-testing-library#272 (comment) for more information
N.B.
The strange thing is that the problem did not occur while using
angular.json
, but does occur withworkspace.json
Possible Solutions
nx
section to the library package.json with an exlcude?Environment
Related
Might be related to:
The text was updated successfully, but these errors were encountered: