Skip to content

Conversation

@laurathackray21
Copy link
Collaborator

When analysing duplicate dependencies, the cli will now look at the lock file rather than at the file system.

I've created a new plugin to do this and left the old code as it was so that whoever reviews this can do a side by side comparison. I'll clean up the old code once we're happy with the changes.

The part of the old dependency plugin that generates the statistics (install size, dependency count etc) should remain a separate plugin as this isn't dealing with duplicate dependencies. Also, I think that code is going to have to use the file system to deduce how many esm/cjs modules there are (I don't think it's possible to find this info out from the lock file)

Example screenshot of output before the changes
image

Example screenshot of output after the changes
image

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/e18e/cli/@e18e/cli@146

commit: 5d9f666

Copy link
Contributor

@43081j 43081j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me 👍

eventually i think we'd extract some of the resolveDuplicateDependencies/computeParents stuff in a "core" file the action can use too.

future ideas though :D

Copy link
Contributor

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, but i'm here wondering if we're gonna add testing after we finish the whole refactor?

@laurathackray21
Copy link
Collaborator Author

Thanks both :) Yeah, we need to make sure this stuff is all covered by tests - I'm gonna do a follow up PR to remove the old duplicate dependency code - I'll have a look at the tests when I do that

@laurathackray21 laurathackray21 merged commit 88b6afb into main Jan 15, 2026
5 checks passed
@laurathackray21 laurathackray21 deleted the task/dupe-dependency-use-lock-file branch January 15, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants