@nx/plugin:generator

Create a Generator for an Nx Plugin.

Usage

1nx generate generator ... 2

By default, Nx will search for generator in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

1nx g @nx/plugin:generator ... 2

Show what will be generated without writing to disk:

1nx g generator ... --dry-run 2

Examples

Generate libs/my-plugin/src/generators/my-generator:

1nx g generator libs/my-plugin/src/generators/my-generator 2

Options

path

Required
string

The file path to the generator without the file extension (e.g. my-plugin/src/generators/my-generator generates the file my-plugin/src/generators/my-generator.ts). Relative to the current working directory.

description

string

Generator description.

name

string

The generator name to export in the plugin generators collection.

skipLintChecks

boolean
Default: false

Do not add an eslint configuration for plugin json files.

unitTestRunner

string
Default: jest
Accepted values: jest, none

Test runner to use for unit tests.

skipFormat

Internal
boolean
Default: false

Do not format files with prettier.