An NX plugin alternative to `@nx/powerpack-owners`, aiming to provide a simpler API leveraging the basic `CODEOWNERS` syntax at the project level. By combining actual `CODEOWNERS` files at the project level, you can use your `git` implementation's syntax
npm install nx-codeowners-pluginAn NX plugin alternative to @nx/powerpack-owners, aiming to provide a simpler API leveraging the basic CODEOWNERS syntax at the project level. By combining actual CODEOWNERS files at the project level, you can use your git implementation's syntax (github, gitlab, bitbucket), without requiring adding anything to your project.json files. Additionally, provides nice ownership statistics and CODEOWNERS validation
``bash`
nx add nx-codeowners-plugin
Compile all the Project-level CODEOWNERS file to a single root CODEOWNERS file. The generator respects your existing base CODEOWNERS file, appending the project CODEOWNERS content to the end.
It is also recommended to setup as a Global Sync Generator and run nx sync as a git hook.
#### NX >= 19.8
`jsonc`
// ./nx.json
{
...,
"sync": {
"globalGenerators": ["nx-codeowners-plugin:sync-codeowners-file"]
}
}
`bash`
nx sync
#### NX < 19.8
`bash`
nx generate nx-codeowners-plugin:sync-codeowners-file
#### Before:
`CODEOWNERS`./CODEOWNERS
* @myorg/myteam
docs/* @myorg/docs-team
`CODEOWNERS`./apps/myapp/CODEOWNERS
* @myorg/app-team
#### After
`CODEOWNERS./CODEOWNERS
* @myorg/myteam
docs/* @myorg/docs-team
Generate Project CODEOWNERS
Generate a native CODEOWNERS file for a target project:
`bash
nx generate nx-codeowners-plugin:codeowners --project= --owners=
`$3
`CODEOWNERS
.//CODEOWNERS
*
``