Loading...
Loading...
Best practices for Nx monorepo development, project configuration, and code generation
npx skill4agent add mindrally/skills nxapps/libs/scope-type-nameshared-ui-buttonnx.json{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"cache": true
},
"test": {
"cache": true
}
},
"defaultBase": "main"
}project.jsontagsproject.json{
"name": "my-app",
"sourceRoot": "apps/my-app/src",
"projectType": "application",
"tags": ["scope:web", "type:app"],
"targets": {
"build": { },
"serve": { },
"test": { }
}
}applicationlibrarynx g @nx/react:app my-appnx g @nx/react:lib my-libnx g @nx/react:component my-component --project=my-lib--dry-run{
"@nx/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{ "sourceTag": "type:app", "onlyDependOnLibsWithTags": ["type:lib", "type:util"] },
{ "sourceTag": "type:lib", "onlyDependOnLibsWithTags": ["type:lib", "type:util"] },
{ "sourceTag": "scope:web", "onlyDependOnLibsWithTags": ["scope:web", "scope:shared"] }
]
}
]
}nx affected:buildnx affected:testnx affected:lintinputsoutputsnx build my-appnx run-many -t buildnx affected -t testnx affected:test- uses: nrwl/nx-set-shas@v4
- run: nx affected -t lint test buildnx-cloud recordindex.tsnx graph