fallow workspaces
fallow workspaces shows the workspace packages that fallow finds in a monorepo, and the problems of the setup.
Show the workspaces that fallow finds in a monorepo, and the problems of the workspace setup. The command gives the same result as fallow list --workspaces.
For the setup of a monorepo, read Monorepos.
Synopsis
fallow workspaces [OPTIONS]
Options
fallow workspaces has no options of its own. It accepts the global options, for example --format and --root.
Output
fallow workspaces
Discovered 2 workspaces
@acme/api -> packages/api (internal dep)
@acme/web -> packages/web
1 discovery diagnostic:
- Dropped workspace 'packages/broken': package.json is not valid JSON (Failed to parse packages/broken/package.json: EOF while parsing a value at line 2 column 0). Fix the JSON syntax or remove 'packages/broken' from the workspaces pattern.
Read and parse failures of source files are not in this list. `fallow dead-code` reports them.
Each line gives the package name and its directory. internal dep marks a package that another workspace lists as a dependency. Each diagnostic gives a problem and its fix. The list has the diagnostics of workspace discovery and of the source file walk, for example skipped-source-dotdir for a hidden folder with sources. A file that fallow cannot read or parse shows only in an analysis, for example fallow dead-code.
With --format json, the output has these top-level fields:
| Field | Content |
|---|---|
kind | "list-workspaces" |
workspace_count | The number of workspaces. |
workspaces | One object for each workspace: name, path, is_internal_dependency. |
workspace_diagnostics | One object for each problem: kind, path, message, degrades_analysis, and fields of the kind. Workspace diagnostics lists each kind. |
Exit codes
| Code | Meaning |
|---|---|
0 | The list completed, also with diagnostics. |
2 | The root package.json does not parse, or other invalid input. |
See Exit codes.
Examples
# Show the workspaces and the problems of the setup
fallow workspaces
# Get the workspaces as JSON
fallow workspaces --format json --quiet
# Analyze only one workspace
fallow dead-code --workspace @acme/api
Related
fallow list: the files, entry points and plugins next to the workspaces.- Workspaces config: set the workspace patterns.
- Monorepos: analyze a monorepo.