Skip to content

PNPM file reader incorrectly includes an underscore in some version numbers. #507

Description

@waynebeaton

We've run into a problem parsing a pnpm-lock.yaml file with version 5.4.

Keys of the form are being interpreted with a trailing underscore being part of the version:

 /@babel/helper-define-polyfill-provider/0.3.1_@babel+core@7.18.5:

That is, the current implementation sees the version as 0.3.1_ rather than 0.3.1.

I found a discussion regarding the format of package keys that provides some helpful background. The short version is that the underscore should be treated as a separator.

The fix is, AFAICT, relatively simple: add underscore as a separator in the regular expression that we use to parse this. I'm going to make that update.

FWIW, the format of pnpm-lock.yaml files is, AFAICT, poorly documented. IMHO, we should should get out of the business of trying to support various undocumented (oftentimes volatile) file formats and depend on the package managers themselves to provide us a list of dependencies. We have similar challenges with package-lock.json files, for example (see #415).

/cc @reissim

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions