map-workspaces
map-workspaces copied to clipboard
fix: workspaces run at root
I was looking into https://github.com/npm/cli/issues/7563 where npm run -w packages/workspace doesn't work when the cwd is root / (docker issue).
Turns out it's because this returns false here https://github.com/npm/map-workspaces/blob/main/lib/index.js#L128
minimatch('/packages/workspace','packages/workspace', { partial: true, windowsPathsNoEscape: true })
I wish we could catch these. It is not possible to test this kind of code that uses cwd /.
I wish we could catch these. It is not possible to test this kind of code that uses cwd /.
We don't "support" running out of root, and there are other issues where we've said that the kinds of bugs folks have from doing so won't be fixed. Running from / is a best-effort deal in npm, and it's possible we need better docs explaining this.
We don't "support" running out of root, and there are other issues where we've said that the kinds of bugs folks have from doing so won't be fixed. Running from
/is a best-effort deal in npm, and it's possible we need better docs explaining this.
Is this nonsupport documented anywhere? It'd be helpful to reference in an internal ticket to refactor some docker images we have.