nx icon indicating copy to clipboard operation
nx copied to clipboard

Yarn resolutions are not being picked up by generatePackageJson flag

Open mmckirilpep opened this issue 3 years ago • 5 comments

Current Behavior

If there are packages listed in the resolutions field and the project would implicitly use those dependencies, the generated package.json should include the resolution.

Ex: myPackage is a devDepencdency and it has yourPackage v1.0.0 as a dependency. You list in the package.json resolution to use "yourPackage: 1.0.1". This resolution never makes it to the generated package.json

Expected Behavior

The resolution should be included in the package.json

Steps to Reproduce

Add to resolutions in package.json a higher version of an implicit dependency. Run the project build for one that has the generatepackagejson flag as true

Failure Logs

Environment

All

mmckirilpep avatar Dec 13 '21 22:12 mmckirilpep

We are facing the same issue. The only ugly workaround so far is to write a script that adds resolutions to final package.json after generation

npwork avatar Jun 14 '22 08:06 npwork

Btw, this issue is not related to react so you can remove scope:react

npwork avatar Jun 14 '22 08:06 npwork

Yeah , I am facing this issue also . I agreed, the only solution right now is to add resolutions to final package.json. which is fine but the issue is we have to copy the unnecessary dependencies due to this. resolutions field in root folder contains all resolutions for different applications. What if I want to include resolutions which are specific to application.

vasuarya avatar Jul 28 '22 15:07 vasuarya

Ideally we need a script which will strip down the yarn.lock from root folder and copy it to dist/apps/appfolder and update generated package.json with application specific resolutions.

vasuarya avatar Jul 28 '22 21:07 vasuarya

👍 for this, would be helpful for me as well

driley-abbvie avatar Sep 19 '22 16:09 driley-abbvie

any workarounds?

cris-santos avatar Sep 29 '22 15:09 cris-santos

Yeah same, any workarounds?

quicksilverr avatar Dec 23 '22 11:12 quicksilverr

Please check with the latest version, as this should be fixed by parsing the source lock file.

meeroslav avatar Mar 06 '23 11:03 meeroslav

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[bot] avatar Apr 21 '23 00:04 github-actions[bot]