Fallow detects and analyzes monorepo workspaces automatically. It understands npm, yarn, and pnpm workspace protocols, resolves cross-package imports throughDocumentation Index
Fetch the complete documentation index at: https://docs.fallow.tools/llms.txt
Use this file to discover all available pages before exploring further.
node_modules symlinks, and supports scoping output to a single package.
Workspace detection is automatic. If your repo has a
workspaces field in package.json or a pnpm-workspace.yaml file, fallow will find and analyze all packages.Workspace auto-detection
Fallow detects workspaces from these sources:| Source | Example |
|---|---|
package.json workspaces field | "workspaces": ["packages/*"] |
pnpm-workspace.yaml | packages: ["packages/*", "apps/*"] |
Cross-workspace imports
Whenapps/web imports from @myorg/ui, fallow resolves the import through the node_modules symlink back to the workspace source files. Symlinked paths are canonicalized, so usage is tracked against the real source location, not the node_modules copy.
apps/web/src/App.tsx
Pnpm content-addressable store
Pnpm uses a content-addressable store with a.pnpm virtual store inside node_modules. Fallow detects these paths and maps them back to the original workspace source files. Cross-package usage is tracked correctly even with pnpm’s strict isolation mode.
Package exports resolution
Fallow resolves theexports field in each package’s package.json, including subpath patterns:
packages/ui/package.json
@myorg/ui/icons resolves to packages/ui/src/icons/index.ts.
Output directory mapping
When a package’sexports or main points to a build output directory (dist, build, out, esm, cjs), fallow maps it back to the corresponding source file. It tries the same relative path under src/ with source extensions (.ts, .tsx, .js, .jsx).
packages/utils/package.json
dist/index.js back to src/index.ts (or .js, .tsx, etc.) if the source file exists.
Per-package tsconfig.json
Fallow discoverstsconfig.json files in each workspace package automatically. Path aliases from each package’s tsconfig.json are used when resolving imports within that package.
packages/ui/tsconfig.json
Scoping output to workspaces
Use-w / --workspace to focus on one or more workspaces. Fallow still analyzes the full monorepo graph; only the reported issues are scoped.
Patterns support three forms:
- Exact package name or workspace path:
web,@myorg/ui,apps/web - Glob matched against BOTH the package name AND the workspace path relative to the repo root:
apps/*,@scope/* - Negation with a
!prefix:!apps/legacy
! or glob characters so your shell doesn’t expand them.
$ fallow dead-code -w 'apps/*,!apps/legacy'
Additional workspace patterns
If fallow doesn’t detect all your workspace packages automatically, add extra patterns in your config:package.json or pnpm-workspace.yaml.
See also
Configuration
Full config file reference including all available fields.
fallow dead-code
CLI reference for running analysis across workspaces.