Class YarnBerryLockAdapter

java.lang.Object
org.openrewrite.javascript.internal.YarnBerryLockAdapter

public final class YarnBerryLockAdapter extends Object
Converts a yarn 2+ (Berry) yarn.lock (YAML) into the npm v3 shape consumed by LockFileParser.

Berry entries look like:

   "lodash@npm:^4.17.21":
     version: 4.17.21
     resolution: "lodash@npm:4.17.21"
     dependencies:
       foo: "npm:^2.0.0"
     languageName: node
     linkType: hard
 
The package name is taken from the resolution field (or key) by stripping the @<protocol>: suffix. Transitive dep values like "npm:^2.0.0" are stripped of their protocol prefix to ^2.0.0.
  • Method Details

    • toNpmV3

      public static String toNpmV3(String yarnLockContent)