snyk / nodejs-lockfile-parser

Generate a Snyk dependency tree from package-lock.json or yarn.lock file
Other
59 stars 28 forks source link

feat: support nohoist yarn workspaces #137

Closed jan-stehlik closed 2 years ago

jan-stehlik commented 2 years ago

Add support for nohoist key for yarn workspaces in package.json. Following this blog, yarn workspaces can follow these formats:

  1. workspaces are defined as an array of strings (legacy)

    "workspaces": [
    "packages/*"
    ]
  2. workspaces are defined in packages key

    "workspaces": {
    "packages": [
    "packages/*"
    ]
    }
  3. workspaces are defined in nohoist key

    "workspaces": {
    "nohoist": [
    "**/puppeteer",
    "**/puppeteer/**"
    ]
    }
  4. workspaces are defined as a combination of packages and nohoist

    "workspaces": {
    "packages": [
    "packages/*"
    ],
    "nohoist": [
    "**/puppeteer",
    "**/puppeteer/**"
    ]
    }
jan-stehlik commented 2 years ago

closing as there is additional work required to make nohoist work in SCM