nx icon indicating copy to clipboard operation
nx copied to clipboard

fix(core): ensure correct package name matching when parsing pnpm lock file

Open meeroslav opened this issue 2 years ago • 2 comments

Current Behavior

Package name matcher in the pnpm-parser will match key to alias name if found, and ignore the potential full name match.

  # ...
  /@isaacs/[email protected]:
    dependencies:
      string-width: 5.1.2
      string-width-cjs: /[email protected] # alias for string-width: 4.2.3  

  /[email protected]:
    dependencies:
      string-width: 4.2.3   
   # ...
 
  /[email protected]:
     # ...

  /[email protected]:
     # ...
 # ...

The above yaml would match 2 packages:

  • string-width @ 5.1.2
  • string-width-cjs @ 4.2.3 While skipping the:
  • string-width @ 4.2.3

Expected Behavior

If same package version is used in the original form and as an alias, both variants should be saved to graph, so that we can track them when finding dependency subgraph and pruning.

Related Issue(s)

Fixes #17492

meeroslav avatar Jun 15 '23 09:06 meeroslav

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2023 9:54am

vercel[bot] avatar Jun 15 '23 09:06 vercel[bot]

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

github-actions[bot] avatar Jun 27 '23 00:06 github-actions[bot]