fix: Improve shrinkwrap generation handling
Enhances: https://github.com/UI5/cli/pull/1231
coverage: 94.69% (+0.1%) from 94.552% when pulling ce4820021dccf80d4c59751bbaf59ca87d35d35d on fix-shrinkwrap-generation into d0976b0910436ebe7e20579eb891396509376c6a on main.
To verify the shrinkwrap:
npm i
cd packages/cli
node ../../internal/shrinkwrap-extractor/cli.js ../../
rm -rf node_modules # Delete node_modules within CLI package
# <Manually remove devDependencies in package.json>
npm ci --workspaces false
Before Matthias' fix this yielded the following error:
npm error Missing: @npmcli/[email protected] from lock file
npm error Missing: @npmcli/[email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
Those dependencies where missing from the shrinkwrap, likely because multiple workspace packages dependent on different versions, overwriting each other.
I'm currently verifying the state after Matthias' fix. I suspect there might still be a problem with dependencies hoisted to the workspace root for packages other than the CLI, conflicting with dependencies of the CLI.
I suspect there might still be a problem with dependencies hoisted to the workspace root for packages other than the CLI, conflicting with dependencies of the CLI.
I added a failing test for this case. I'll work on a fix