2024-01-30 16:29:05 -05:00

77 lines
2.9 KiB
JSON

{
"name": "generator",
"factory": "./src/generators/generator/generator#generatorGeneratorInternal",
"schema": {
"$schema": "https://json-schema.org/schema",
"cli": "nx",
"$id": "NxPluginGenerator",
"title": "Create a Generator for an Nx Plugin",
"description": "Create a Generator for an Nx Plugin.",
"type": "object",
"examples": [
{
"command": "nx g generator my-generator --project=my-plugin",
"description": "Generate `libs/my-plugin/src/generators/my-generator`"
}
],
"properties": {
"name": {
"type": "string",
"description": "Generator name.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the generator?",
"x-priority": "important"
},
"directory": {
"type": "string",
"description": "The directory at which to create the generator file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
"aliases": ["dir"],
"x-priority": "important"
},
"description": {
"type": "string",
"description": "Generator description.",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest"
},
"skipLintChecks": {
"type": "boolean",
"default": false,
"description": "Do not add an eslint configuration for plugin json files."
},
"project": {
"type": "string",
"description": "The name of the project.",
"alias": "p",
"$default": { "$source": "projectName" },
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
},
"skipFormat": {
"type": "boolean",
"default": false,
"description": "Do not format files with prettier.",
"x-priority": "internal"
},
"nameAndDirectoryFormat": {
"description": "Whether to generate the generator in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
}
},
"required": ["name"],
"additionalProperties": false,
"presets": []
},
"description": "Create a generator for an Nx Plugin.",
"implementation": "/packages/plugin/src/generators/generator/generator#generatorGeneratorInternal.ts",
"aliases": [],
"hidden": false,
"path": "/packages/plugin/src/generators/generator/schema.json",
"type": "generator"
}