ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

fix: Improve shrinkwrap generation handling

Open d3xter666 opened this issue 2 months ago • 3 comments

Enhances: https://github.com/UI5/cli/pull/1231

d3xter666 avatar Dec 04 '25 11:12 d3xter666

Coverage Status

coverage: 94.69% (+0.1%) from 94.552% when pulling ce4820021dccf80d4c59751bbaf59ca87d35d35d on fix-shrinkwrap-generation into d0976b0910436ebe7e20579eb891396509376c6a on main.

coveralls avatar Dec 04 '25 11:12 coveralls

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.

RandomByte avatar Dec 04 '25 13:12 RandomByte

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

RandomByte avatar Dec 04 '25 13:12 RandomByte