The basics covered in this example are nested Worktrees and Workspaces where one of the nested Workspaces is dependent on a top level Workspace (a common library used amongst many Workspaces)
- Yarn v1 (globally installed)
- Check to make sure by entering
yarn -v
in a directory outside of this project in your command line - Inside this project the result of
yarn -v
should result in something like 2.0.0-rc.30
- Check to make sure by entering
-
You can test to make sure everything is working by running the following command from anywhere in the project directory:
yarn workspace @workspaces/dashboard-client start
โ ๏ธ If you try to run the commandnode dashboard/client/index.js
from the root directory it will say it was unable to find the @workspaces/common package because node by itself doesn't know how to resolve theworkspace:
protocol in the package.json. You must useyarn
to run your package
-
Yarn v2 is utilized via .yarnrc.yml file
-
The root package.json doesn't need to identify each nested Workspace. Instead you can list the Worktree that those nested Workspaces are contained in, and it will know about the nested Workspaces through the
"workspaces"
property in the Worktree package.json like dashboard/package.json