nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

mkYarnWorkspace fails with `nohoist` dependencies #140

Open glittershark opened 4 years ago

glittershark commented 4 years ago

My package.json looks something like this:

{
  "name": "repo",
  "version": "0.0.0",
  "private": true,
  "workspaces": {
    "packages": [
      "workspace-1",
      "workspace-2",
    ],
    "nohoist": [
      "**/babel-eslint",
      "**/babel-jest",
      "**/babel-loader",
      "**/eslint",
      "**/jest",
      "**/webpack-dev-server",
      "**/webpack-cli",
      "**/webpack"
    ]
  },
  "devDependencies": {
    "yarn": "^1.17.3"
  },
}

This breaks yarn2nix with the following error message, caused by it expecting workspaces to always be a list:

error: while evaluating 'mkYarnWorkspace' at /nix/store/w33plr3fnryxqlwwh59jvrq0f6ksp1in-source/default.nix:156:21, called from /home/grfn/code/project/default.nix:11:19:
value is a set while a list was expected, at /nix/store/w33plr3fnryxqlwwh59jvrq0f6ksp1in-source/default.nix:188:20