0x80/isolate-package

Will fail if pnpm-workspace.yaml is empty

segevfiner opened this issue · 2 comments

pnpm defaults to auto-detection if pnpm-workspace.yaml is empty, isolate package will fail with:

Cannot destructure property 'packages' of 'readTypedYamlSync(...)' as it is null.

In that case as it tries to destructure packages from it at:

const { packages: globs } = readTypedYamlSync<{ packages: string[] }>(

0x80 commented

I didn't know there was an auto-detect feature in pnpm. Is there a clear advantage over defining your workspace package in the file? Is it essential for some use-cases?

I will fix the bug by detecting the empty file and throw an error. Maybe it will support auto-detect later, but until then defining the workspace would be a requirement.

It's basically like setting it to ** it just uses all folder that have a package.json, simpler to config unless you have any false positive, might be slightly slower.