Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

yarn workspaces

Show information about your workspaces.

What is a workspace?

To learn more about workspaces, check these links:

Commands

yarn workspaces info [--json]

This command will display the workspace dependency tree of your current project.

yarn workspaces info
yarn workspaces vx.x.x
{ "create-subscription": {
    "location": "packages/create-subscription",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  },
  ...
  "react-noop-renderer": {
    "location": "packages/react-noop-renderer",
    "workspaceDependencies": [
      "react-reconciler"
    ],
    "mismatchedWorkspaceDependencies": []
  },
  "react-reconciler": {
    "location": "packages/react-reconciler",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  }, ... }
yarn workspaces run <command>

This will run the chosen Yarn command in each workspace.

yarn workspaces run test

This will invoke the test script for each workspace.

This will also pass forward flags and can be useful for CI processes.

yarn workspaces run test --ci