JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q40639F

Package Exports

  • nx-codeowners-plugin
  • nx-codeowners-plugin/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nx-codeowners-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nx-codeowners-plugin

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 (github, gitlab, bitbucket), without requiring adding anything to your project.json files. Additionally, provides nice ownership statistics and CODEOWNERS validation

Install

nx add nx-codeowners-plugin

Generators

Sync Workspace CODEOWNERS

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

// ./nx.json
{
    ...,
    "sync": {
        "globalGenerators": ["nx-codeowners-plugin:sync-codeowners-file"]
    }
}
nx sync

NX < 19.8

nx generate nx-codeowners-plugin:sync-codeowners-file

Example

Before:

# ./CODEOWNERS
* @myorg/myteam
docs/* @myorg/docs-team
# ./apps/myapp/CODEOWNERS
* @myorg/app-team

After

# ./CODEOWNERS
* @myorg/myteam
docs/* @myorg/docs-team

# NX-CODEOWNERS-PLUGIN
# The content below was auto-generated with nx-codeowners-plugin
# do not edit it by hand

# app: myapp
./apps/myapp/* @myorg/app-team

Generate Project CODEOWNERS

Generate a native CODEOWNERS file for a target project:

nx generate nx-codeowners-plugin:codeowners --project=<PROJECT_NAME> --owners=<USERS_OR_GROUPS>

Example:

# ./<PROJECT_DIR>/CODEOWNERS

* <USERS_OR_GROUPS>