feat(deps): refactor node-workspace plugin to drop lerna-lite/core#2117
feat(deps): refactor node-workspace plugin to drop lerna-lite/core#2117
Conversation
test: fix test
Use the internal workspace-plugin graph/dependency logic and built-in package.json updaters to update the content.
15cbb65 to
35c6fd3
Compare
| ], | ||
| }), | ||
| buildMockCandidatePullRequest('node1', 'node', '2.2.2', { | ||
| buildMockCandidatePullRequest('node1', 'node', '3.3.3', { |
There was a problem hiding this comment.
Why do the mock values need to change? It would be good to see the same tests running with the same assertions against the refactored code.
There was a problem hiding this comment.
The node1 package (@here/pkgA) fixture is already at 3.3.3. The lerna updater only updated the dependency versions, so the output still had 3.3.3 as the @here/pkgA version. But switching to the PackageJson updater, it actually did change the value from 3.3.3 to 2.2.2 (which was invalid). To keep the test output the same before and after the refactor, I switched this value to be 3.3.3.
| assertHasUpdate(updates, 'node1/package.json'); | ||
| assertHasUpdate(updates, 'node4/package.json'); | ||
| snapshot(dateSafe(nodeCandidate!.pullRequest.body.toString())); | ||
| snapshotUpdate(updates, 'package.json'); |
There was a problem hiding this comment.
The snapshot name is based on an incrementing count. To make the snapshots only additive (and easier to review), I put these ones after the existing snapshot.
| ], | ||
| "author": "Ben Coe <ben@npmjs.com>", | ||
| "license": "ISC", | ||
| "devDependencies": { |
There was a problem hiding this comment.
I like that you tested very type of dependency here (dev, optional, peer).
bcoe
left a comment
There was a problem hiding this comment.
Glad to eliminate a dependency, good work.
Refactors the node-workspace plugin to use the internal workspace-plugin graph/dependency logic and built-in
package.json updaters to update the content. We do not need to rely on lerna internals.
Fixes #2116
feat: PackageJson updater can update dependencies