219 lines
9.4 KiB
JSON
219 lines
9.4 KiB
JSON
{
|
|
"name": "library",
|
|
"factory": "./src/generators/library/library",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"$id": "GeneratorAngularLibrary",
|
|
"title": "Create a library",
|
|
"description": "Creates an Angular library.",
|
|
"type": "object",
|
|
"cli": "nx",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "The name of the library.",
|
|
"$default": { "$source": "argv", "index": 0 },
|
|
"x-prompt": "What name would you like to use for the library?",
|
|
"pattern": "^[a-zA-Z].*$"
|
|
},
|
|
"directory": {
|
|
"type": "string",
|
|
"description": "A directory where the library is placed.",
|
|
"x-priority": "important"
|
|
},
|
|
"publishable": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Generate a publishable library.",
|
|
"x-priority": "important"
|
|
},
|
|
"buildable": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Generate a buildable library.",
|
|
"x-priority": "important"
|
|
},
|
|
"prefix": {
|
|
"type": "string",
|
|
"format": "html-selector",
|
|
"description": "The prefix to apply to generated selectors.",
|
|
"alias": "p"
|
|
},
|
|
"skipFormat": {
|
|
"description": "Skip formatting files.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"x-priority": "internal"
|
|
},
|
|
"simpleModuleName": {
|
|
"description": "Keep the module name simple (when using `--directory`).",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"x-deprecated": "Use `simpleName` instead. It will be removed in v16."
|
|
},
|
|
"simpleName": {
|
|
"description": "Don't include the directory in the name of the module or standalone component entry of the library.",
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"addModuleSpec": {
|
|
"description": "Add a module spec file.",
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"skipPackageJson": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Do not add dependencies to `package.json`.",
|
|
"x-priority": "internal"
|
|
},
|
|
"skipTsConfig": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Do not update `tsconfig.json` for development experience."
|
|
},
|
|
"routing": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Add router configuration. See `lazy` for more information.",
|
|
"x-priority": "important"
|
|
},
|
|
"lazy": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Add `RouterModule.forChild` when set to true, and a simple array of routes when set to false.",
|
|
"x-priority": "important"
|
|
},
|
|
"parent": {
|
|
"type": "string",
|
|
"description": "Path to the parent route configuration using `loadChildren` or `children`, depending on what `lazy` is set to.",
|
|
"x-priority": "important"
|
|
},
|
|
"tags": {
|
|
"type": "string",
|
|
"description": "Add tags to the library (used for linting)."
|
|
},
|
|
"unitTestRunner": {
|
|
"type": "string",
|
|
"enum": ["karma", "jest", "none"],
|
|
"description": "Test runner to use for unit tests.",
|
|
"default": "jest"
|
|
},
|
|
"importPath": {
|
|
"type": "string",
|
|
"description": "The library name used to import it, like `@myorg/my-awesome-lib`. Must be a valid npm name."
|
|
},
|
|
"strict": {
|
|
"type": "boolean",
|
|
"description": "Create a library with stricter type checking and build optimization options.",
|
|
"default": true
|
|
},
|
|
"linter": {
|
|
"description": "The tool to use for running lint checks.",
|
|
"type": "string",
|
|
"enum": ["eslint", "none"],
|
|
"default": "eslint"
|
|
},
|
|
"standaloneConfig": {
|
|
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"x-deprecated": "Nx only supports standaloneConfig"
|
|
},
|
|
"compilationMode": {
|
|
"description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
|
|
"type": "string",
|
|
"enum": ["full", "partial"]
|
|
},
|
|
"setParserOptionsProject": {
|
|
"type": "boolean",
|
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
"default": false
|
|
},
|
|
"addTailwind": {
|
|
"type": "boolean",
|
|
"description": "Whether to configure Tailwind CSS for the application. It can only be used with buildable and publishable libraries. Non-buildable libraries will use the application's Tailwind configuration.",
|
|
"default": false
|
|
},
|
|
"skipModule": {
|
|
"type": "boolean",
|
|
"description": "Whether to skip the creation of a default module when generating the library.",
|
|
"default": false
|
|
},
|
|
"standalone": {
|
|
"type": "boolean",
|
|
"description": "Generate a library that uses a standalone component instead of a module as the entry point.",
|
|
"default": false
|
|
},
|
|
"displayBlock": {
|
|
"description": "Specifies if the component generated style will contain `:host { display: block; }`. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"alias": "b"
|
|
},
|
|
"inlineStyle": {
|
|
"description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"alias": "s"
|
|
},
|
|
"inlineTemplate": {
|
|
"description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"alias": "t"
|
|
},
|
|
"viewEncapsulation": {
|
|
"description": "The view encapsulation strategy to use in the new component. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"enum": ["Emulated", "None", "ShadowDom"],
|
|
"type": "string",
|
|
"alias": "v"
|
|
},
|
|
"changeDetection": {
|
|
"description": "The change detection strategy to use in the new component. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"enum": ["Default", "OnPush"],
|
|
"type": "string",
|
|
"default": "Default",
|
|
"alias": "c"
|
|
},
|
|
"style": {
|
|
"description": "The file extension or preprocessor to use for style files, or `none` to skip generating the style file. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"type": "string",
|
|
"default": "css",
|
|
"enum": ["css", "scss", "sass", "less", "none"]
|
|
},
|
|
"skipTests": {
|
|
"type": "boolean",
|
|
"description": "Do not create `spec.ts` test files for the new component. Disclaimer: This option is only valid when `--standalone` is set to `true`.",
|
|
"default": false
|
|
},
|
|
"selector": {
|
|
"type": "string",
|
|
"format": "html-selector",
|
|
"description": "The HTML selector to use for this component. Disclaimer: This option is only valid when `--standalone` is set to `true`."
|
|
},
|
|
"skipSelector": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Specifies if the component should have a selector or not. Disclaimer: This option is only valid when `--standalone` is set to `true`."
|
|
},
|
|
"flat": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Ensure the generated standalone component is not placed in a subdirectory. Disclaimer: This option is only valid when `--standalone` is set to `true`."
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["name"],
|
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nrwl/angular:library my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n```bash\nnx g @nrwl/angular:library --directory=nested --importPath=@myorg/nested/my-lib my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone component\"%}\nCreates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector.\n\n```bash\nnx g @nrwl/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib\n```\n\n{% /tab %}\n",
|
|
"presets": []
|
|
},
|
|
"aliases": ["lib"],
|
|
"x-type": "library",
|
|
"description": "Creates an Angular library.",
|
|
"implementation": "/packages/angular/src/generators/library/library.ts",
|
|
"hidden": false,
|
|
"path": "/packages/angular/src/generators/library/schema.json",
|
|
"type": "generator"
|
|
}
|