UNPKG

@nx/angular

Version:

The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypre

199 lines (198 loc) • 7.72 kB
{ "$schema": "https://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.", "x-priority": "important" }, "directory": { "type": "string", "description": "A directory where the library is placed.", "$default": { "$source": "argv", "index": 0 }, "x-prompt": "Which directory do you want to create the library in?" }, "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" }, "simpleName": { "description": "Don't include the directory in the name of the module or standalone component entry of the library.", "type": "boolean", "default": false, "x-deprecated": "Use the --name option to provide the exact name instead. This option will be removed in Nx 22." }, "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": ["jest", "vitest", "none"], "description": "Test runner to use for unit tests.", "x-prompt": "Which unit test runner would you like to use?", "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" }, "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": true }, "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": ["directory"], "examplesFile": "../../../docs/library-examples.md" }