You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like the idea of basically basing these on how Cargo works:
"Virtual Workspaces" can be created by having a blank toplevel project and a bunch of same-level packages.
"Hierarchical Workspace" can be created by having a "primary" package at the root, and a bunch of its "dependencies" in workspace directories.
important: I really really want to have workspace-level dependency versions, so you can specify a dependency version once, in your workspace definition, and just do something like "dependencies": { "my-dep": "workspace" }
I'm not sure I care enough about compatibility with NPM workspaces.
Annoyingly, there's a lot of inconsistencies as to what's called "workspaces", and what the host project is called:
Cargo refers to the host project as a workspace, and its children as members, but they're referred to on the CLI with the -p/--package flag.
PNPM has a pnpm-workspace.yaml file with a packages: field, and uses -r/--recursive to run certain commands across all workspace packages. It uses the -w/--workspace flag to refer to the host/root project.
NPM uses a "workspaces": {...} field and seems to refer to the host project as a "root project" or "project root". The -w/--workspace flag, as opposed to in NPM, refers to the individual packages, not the root project.
Yarn also uses a "workspaces": {...} field, which is probably the source of NPM's naming, but refers to the host project as a "worktree". It does not seem to have any configuration for either recursive execution (like PNPM) or package targeting (like Cargo or NPM).
So basically everyone is horrible and there's no right answer.
I personally like PNPM's approach the best because it's the clearest and most consistent.
The text was updated successfully, but these errors were encountered:
We should support some kind of workspaces.
I really like the idea of basically basing these on how Cargo works:
"dependencies": { "my-dep": "workspace" }
Some inspiration on design:
Annoyingly, there's a lot of inconsistencies as to what's called "workspaces", and what the host project is called:
-p
/--package
flag.pnpm-workspace.yaml
file with apackages:
field, and uses-r
/--recursive
to run certain commands across all workspace packages. It uses the-w
/--workspace
flag to refer to the host/root project."workspaces": {...}
field and seems to refer to the host project as a "root project" or "project root". The-w
/--workspace
flag, as opposed to in NPM, refers to the individual packages, not the root project."workspaces": {...}
field, which is probably the source of NPM's naming, but refers to the host project as a "worktree". It does not seem to have any configuration for either recursive execution (like PNPM) or package targeting (like Cargo or NPM).So basically everyone is horrible and there's no right answer.
I personally like PNPM's approach the best because it's the clearest and most consistent.
The text was updated successfully, but these errors were encountered: