Configure and optimize Nx monorepo workspaces with deterministic project-graph structure, boundary enforcement, cache-aware pipelines, and affected-command CI workflows; use when designing workspace architecture, tightening dependency rules, or reducing CI cost through Nx task orchestration.
76
95%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Navigation hub for Nx workspace architecture and operations.
apps/, libs/, tools/).nx lint --skip-nx-cache.targetDefaults for build/test/lint dependency flow.scope:*, type:*, platform:*) if consistent.| Missing Config | Fallback |
|---|---|
| no explicit tags | allow broad deps temporarily with warning and migration plan |
| no target defaults | tasks run independently with reduced optimization |
| no CI base/head | default to main branch and document tradeoff |
nx graphnx affected -t lint,test,build --base=origin/main --parallel=3nx show project my-app --webnx resetrg -n "@nx/enforce-module-boundaries|depConstraints" .{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"dependsOn": ["build"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
}
}
}{
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "scope:web",
"onlyDependOnLibsWithTags": ["scope:web", "scope:shared"]
},
{
"sourceTag": "type:feature",
"onlyDependOnLibsWithTags": ["type:feature", "type:ui", "type:data-access", "type:util"]
},
{
"sourceTag": "type:ui",
"onlyDependOnLibsWithTags": ["type:ui", "type:util"]
}
]
}
]
}
}
]
}libs/ui depends on libs/data while libs/data depends on libs/ui.run-many --all in CI as the default verification pathnx affected with explicit base/head.targetDefaultsdependsOn prevents optimal scheduling and can hide ordering bugs.dependsOn for build/test/lint behavior.| Topic | Reference |
|---|---|
| Project graph and nx.json patterns | references/project-graph-configuration.md |
| Caching and optimization | references/caching-strategies.md |
| Boundaries and tags | references/project-boundaries.md |
| Affected commands and CI | references/affected-commands.md |