Class YarnClassicLockAdapter

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

public final class YarnClassicLockAdapter extends Object
Converts a yarn 1.x yarn.lock (custom non-YAML format) into the npm package-lock.json v3 shape consumed by LockFileParser.

yarn classic blocks look like:

   "lodash@^4.17.21", "lodash@^4.17.0":
     version "4.17.21"
     resolved "..."
     dependencies:
       foo "^2.0.0"
 
Each block is parsed into one entry. The first occurrence of a given name is emitted as a top-level npm v3 path (node_modules/<name>); later occurrences (multi-version cases) get a synthetic nested path so they're preserved in all but excluded from topLevel.
  • Method Details

    • toNpmV3

      public static String toNpmV3(String yarnLockContent)