rescript-lang / rewatch

Rewatch is an alternative build system for the Rescript Compiler.
95 stars 12 forks source link

Rewatch with PNPM doesn't find local packages #134

Open hellos3b opened 2 days ago

hellos3b commented 2 days ago

PNPM monorepos use a pnpm-workspace.yaml file to define packages, which can include glob patterns. When running PNPM commands locally or using --filter @testrepo/dep01, everything works correctly from the root directory. However, when using Rewatch, these packages fail to resolve.

I've forked the testrepo repository and configured it with PNPM: https://github.com/hellos3b/rewatch-pnpm

From my investigation, Yarn hoists all packages to a root node_modules, whereas PNPM uses symlinks to cache dependencies as part of its core functionality. If Rewatch is relying on package resolution from node_modules, it may be missing the symlinked dependencies.

Since PNPM is included with Node through Corepack, it seems reasonable to add direct support for PNPM resolution.