-
Notifications
You must be signed in to change notification settings - Fork 615
Description
After resisting switching away from regular NPM for many years, I recently decided to switch to PNPM. It’s pretty awesome!
Learning the differences are easy for the basic commands. (npm install becomes pnpm add, pnpm install; use pnpm exec <CLI-tool> instead of npx <CLI-tool>, etc.)
But workspaces are different. The NPM docs on Workspaces make it trivial to find the information I need. Here is what the Table of Contents (TOC) looks like for that page:
Description
Defining workspaces
Getting started with workspaces
Adding dependencies to a workspace
Using workspaces
Running commands in the context of workspaces
Ignoring missing scripts
See also
If I run into a problem while I’m learning to use workspaces with NPM, it’s easy to look at the TOC and see where to go to find what I need.
But when I look for PNPM’s docs for workspaces in the same way…:
Workspace protocol (workspace:)
Referencing workspace packages through aliases
Referencing workspace packages through their relative path
Publishing workspace packages
Release workflow
Troubleshooting
Usage examples
Configuration
linkWorkspacePackages
injectWorkspacePackages
dedupeInjectedDeps
syncInjectedDepsAfterScripts
preferWorkspacePackages
sharedWorkspaceLockfile
saveWorkspaceProtocol
includeWorkspaceRoot
ignoreWorkspaceCycles
disallowWorkspaceCycles
failIfNoMatch
…It’s clear that there is a lot of detailed info on the page—but it doesn’t help me learn. There’s no obvious place to start. And I have no idea if, or how, this functions differently from NPM workspaces.
When I first looked at the TOC, I can see that there’s a protocol, plenty of configuration options, but no real examples to demonstrate how to use the workspace feature in PNPM.
I clicked on “Usage examples”, hoping to see just that. But instead, I was presented with is a list of links to real-world projects using this feature. (I felt that was misleading, so I opened PR #755.)
Making learning PNPM workspaces even more difficult is the additional feature of catalogues. Now, after reading the docs on catalogues, they look pretty awesome! And I think I understand them. But since catalogues are related to workspaces, and I don’t really know how to use workspaces (in PNPM), it’s just another obstacle to learning the feature.