node-installed-check icon indicating copy to clipboard operation
node-installed-check copied to clipboard

Support a `--workspaces` and maybe `--workspace` flag to run in a npm workspace monorepo

Open voxpelli opened this issue 4 years ago • 1 comments

voxpelli avatar Sep 04 '21 15:09 voxpelli

Inspiration:

  • https://www.npmjs.com/package/@npmcli/map-workspaces
  • https://www.npmjs.com/package/yarn-changed-workspaces

voxpelli avatar Sep 08 '21 13:09 voxpelli

I tried to support this usecase manually by re-running installed-check in our multiple workspace subdirectories, but because all of the deps are installed in node_modules in the root, installed-check will fail with "Non-existing path" looking for a node_modules next to the package.json, whereas node and bundlers will traverse your file tree up and up looking for more node_modules directories. Do you have any suggestions on how to do this in a manual way? Or just be able to say "look at that nested package.json(s), but look in this node_modules"

vitaminj avatar Sep 29 '23 12:09 vitaminj

I've done a naïve hack that works for our usecases - perhaps this can serve as either useful for anyone else, or a starting point for a more legitimate implementation? https://github.com/youviewtv/node-installed-check-core/compare/main...workspaces

vitaminj avatar Sep 29 '23 20:09 vitaminj