fix: Improve shrinkwrap generation handling#1228
Conversation
internal/shrinkwrap-extractor/lib/convertPackageLockToShrinkwrap.js
Outdated
Show resolved
Hide resolved
|
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 falseBefore Matthias' fix this yielded the following error: 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 added a failing test for this case. I'll work on a fix |
56e1877 to
47fde0f
Compare
| "resolved": "https://registry.npmjs.org/package/version.tgz", | ||
| "integrity": "sha512-mock-integrity-hash" | ||
| }, | ||
| "node_modules/@ui5/target/node_modules/@sapui5/some-thirdparty": { |
There was a problem hiding this comment.
I don't think this will work. If @ui5/target is the root package, it will never search the path node_modules/@ui5/target/node_modules/ for its dependencies.
For module @sapui5/some-thirdparty, the target package would resolve it to node_modules/@sapui5/some-thirdparty, which contains the wrong version now...
47fde0f to
795c6f6
Compare
445b150 to
40d48f6
Compare
…kages other than the target
This reverts commit 2f3840a.
Get the virtual tree in a flat format Sort it, so that it the loop runs top to bottom Start rewriting modules to the target root
50393a9 to
ce48200
Compare
Enhances: #1231