UNPKG

@angular/cli

Version:
1,303 lines (1,302 loc) • 216 kB
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "ng-cli://config/schema.json", "title": "Angular CLI Workspace Configuration", "type": "object", "properties": { "$schema": { "type": "string" }, "version": { "$ref": "#/definitions/fileVersion" }, "cli": { "$ref": "#/definitions/cliOptions" }, "schematics": { "$ref": "#/definitions/schematicOptions" }, "newProjectRoot": { "type": "string", "description": "Path where new projects will be created." }, "projects": { "type": "object", "patternProperties": { "^(?:@[a-zA-Z0-9._-]+/)?[a-zA-Z0-9._-]+$": { "$ref": "#/definitions/project" } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "version" ], "definitions": { "cliOptions": { "type": "object", "properties": { "schematicCollections": { "type": "array", "description": "The list of schematic collections to use.", "items": { "type": "string", "uniqueItems": true } }, "packageManager": { "description": "Specify which package manager tool to use.", "type": "string", "enum": [ "npm", "cnpm", "yarn", "pnpm", "bun" ] }, "warnings": { "description": "Control CLI specific console warnings", "type": "object", "properties": { "versionMismatch": { "description": "Show a warning when the global version is newer than the local one.", "type": "boolean" } }, "additionalProperties": false }, "analytics": { "type": [ "boolean", "string" ], "description": "Share pseudonymous usage data with the Angular Team at Google." }, "cache": { "description": "Control disk cache.", "type": "object", "properties": { "environment": { "description": "Configure in which environment disk cache is enabled.", "type": "string", "enum": [ "local", "ci", "all" ] }, "enabled": { "description": "Configure whether disk caching is enabled.", "type": "boolean" }, "path": { "description": "Cache base path.", "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "cliGlobalOptions": { "type": "object", "properties": { "schematicCollections": { "type": "array", "description": "The list of schematic collections to use.", "items": { "type": "string", "uniqueItems": true } }, "packageManager": { "description": "Specify which package manager tool to use.", "type": "string", "enum": [ "npm", "cnpm", "yarn", "pnpm", "bun" ] }, "warnings": { "description": "Control CLI specific console warnings", "type": "object", "properties": { "versionMismatch": { "description": "Show a warning when the global version is newer than the local one.", "type": "boolean" } }, "additionalProperties": false }, "analytics": { "type": [ "boolean", "string" ], "description": "Share pseudonymous usage data with the Angular Team at Google." }, "completion": { "type": "object", "description": "Angular CLI completion settings.", "properties": { "prompted": { "type": "boolean", "description": "Whether the user has been prompted to add completion command prompt." } }, "additionalProperties": false } }, "additionalProperties": false }, "schematicOptions": { "type": "object", "properties": { "@schematics/angular:application": { "$ref": "#/definitions/SchematicsAngularApplicationSchema" }, "@schematics/angular:class": { "$ref": "#/definitions/SchematicsAngularClassSchema" }, "@schematics/angular:component": { "$ref": "#/definitions/SchematicsAngularComponentSchema" }, "@schematics/angular:directive": { "$ref": "#/definitions/SchematicsAngularDirectiveSchema" }, "@schematics/angular:enum": { "$ref": "#/definitions/SchematicsAngularEnumSchema" }, "@schematics/angular:guard": { "$ref": "#/definitions/SchematicsAngularGuardSchema" }, "@schematics/angular:interceptor": { "$ref": "#/definitions/SchematicsAngularInterceptorSchema" }, "@schematics/angular:interface": { "$ref": "#/definitions/SchematicsAngularInterfaceSchema" }, "@schematics/angular:library": { "$ref": "#/definitions/SchematicsAngularLibrarySchema" }, "@schematics/angular:pipe": { "$ref": "#/definitions/SchematicsAngularPipeSchema" }, "@schematics/angular:ng-new": { "$ref": "#/definitions/SchematicsAngularNgNewSchema" }, "@schematics/angular:resolver": { "$ref": "#/definitions/SchematicsAngularResolverSchema" }, "@schematics/angular:service": { "$ref": "#/definitions/SchematicsAngularServiceSchema" }, "@schematics/angular:web-worker": { "$ref": "#/definitions/SchematicsAngularWebWorkerSchema" } }, "additionalProperties": true }, "fileVersion": { "type": "integer", "description": "File format version", "minimum": 1 }, "project": { "type": "object", "properties": { "cli": { "schematicCollections": { "type": "array", "description": "The list of schematic collections to use.", "items": { "type": "string", "uniqueItems": true } } }, "schematics": { "$ref": "#/definitions/schematicOptions" }, "prefix": { "type": "string", "format": "html-selector", "description": "The prefix to apply to generated selectors." }, "root": { "type": "string", "description": "Root of the project files." }, "i18n": { "$ref": "#/definitions/project/definitions/i18n" }, "sourceRoot": { "type": "string", "description": "The root of the source files, assets and index.html file structure." }, "projectType": { "type": "string", "description": "Project type.", "enum": [ "application", "library" ] }, "architect": { "type": "object", "additionalProperties": { "$ref": "#/definitions/project/definitions/target" } }, "targets": { "type": "object", "additionalProperties": { "$ref": "#/definitions/project/definitions/target" } } }, "required": [ "root", "projectType" ], "anyOf": [ { "required": [ "architect" ], "not": { "required": [ "targets" ] } }, { "required": [ "targets" ], "not": { "required": [ "architect" ] } }, { "not": { "required": [ "targets", "architect" ] } } ], "additionalProperties": false, "patternProperties": { "^[a-z]{1,3}-.*": {} }, "definitions": { "i18n": { "description": "Project i18n options", "type": "object", "properties": { "sourceLocale": { "oneOf": [ { "type": "string", "description": "Specifies the source locale of the application.", "default": "en-US", "$comment": "IETF BCP 47 language tag (simplified)", "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$" }, { "type": "object", "description": "Localization options to use for the source locale.", "properties": { "code": { "type": "string", "description": "Specifies the locale code of the source locale.", "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$" }, "baseHref": { "type": "string", "description": "Specifies the HTML base HREF for the locale. Defaults to the locale code if not provided." }, "subPath": { "type": "string", "description": "Defines the subpath for accessing this locale. It serves as the HTML base HREF and the directory name for the output. Defaults to the locale code if not specified.", "pattern": "^[\\w-]*$" } }, "anyOf": [ { "required": [ "subPath" ], "not": { "required": [ "baseHref" ] } }, { "required": [ "baseHref" ], "not": { "required": [ "subPath" ] } }, { "not": { "required": [ "baseHref", "subPath" ] } } ], "additionalProperties": false } ] }, "locales": { "type": "object", "additionalProperties": false, "patternProperties": { "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$": { "oneOf": [ { "type": "string", "description": "Localization file to use for i18n." }, { "type": "array", "description": "Localization files to use for i18n.", "items": { "type": "string", "uniqueItems": true } }, { "type": "object", "description": "Localization options to use for the locale.", "properties": { "translation": { "oneOf": [ { "type": "string", "description": "Localization file to use for i18n." }, { "type": "array", "description": "Localization files to use for i18n.", "items": { "type": "string", "uniqueItems": true } } ] }, "baseHref": { "type": "string", "description": "Specifies the HTML base HREF for the locale. Defaults to the locale code if not provided." }, "subPath": { "type": "string", "description": "Defines the URL segment for accessing this locale. It serves as the HTML base HREF and the directory name for the output. Defaults to the locale code if not specified.", "pattern": "^[\\w-]*$" } }, "anyOf": [ { "required": [ "subPath" ], "not": { "required": [ "baseHref" ] } }, { "required": [ "baseHref" ], "not": { "required": [ "subPath" ] } }, { "not": { "required": [ "baseHref", "subPath" ] } } ], "additionalProperties": false } ] } } } }, "additionalProperties": false }, "target": { "oneOf": [ { "$comment": "Extendable target with custom builder", "type": "object", "properties": { "builder": { "type": "string", "description": "The builder used for this package.", "not": { "enum": [ "@angular/build:application", "@angular/build:dev-server", "@angular/build:extract-i18n", "@angular/build:karma", "@angular/build:ng-packagr", "@angular-devkit/build-angular:application", "@angular-devkit/build-angular:app-shell", "@angular-devkit/build-angular:browser", "@angular-devkit/build-angular:browser-esbuild", "@angular-devkit/build-angular:dev-server", "@angular-devkit/build-angular:extract-i18n", "@angular-devkit/build-angular:karma", "@angular-devkit/build-angular:ng-packagr", "@angular-devkit/build-angular:prerender", "@angular-devkit/build-angular:jest", "@angular-devkit/build-angular:web-test-runner", "@angular-devkit/build-angular:server", "@angular-devkit/build-angular:ssr-dev-server" ] } }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "type": "object" }, "configurations": { "type": "object", "description": "A map of alternative target options.", "additionalProperties": { "type": "object" } } }, "additionalProperties": false, "required": [ "builder" ] }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular/build:application" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersApplicationSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersApplicationSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:application" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersApplicationSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersApplicationSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:app-shell" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersAppShellSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersAppShellSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:browser" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:browser-esbuild" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular/build:dev-server" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersDevServerSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersDevServerSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:dev-server" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersDevServerSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersDevServerSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular/build:extract-i18n" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersExtractI18nSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersExtractI18nSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:extract-i18n" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersExtractI18nSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersExtractI18nSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular/build:karma" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersKarmaSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersKarmaSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:karma" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersKarmaSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersKarmaSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:jest" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersJestSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersJestSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:web-test-runner" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersWebTestRunnerSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersWebTestRunnerSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:prerender" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersPrerenderSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersPrerenderSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:ssr-dev-server" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersSsrDevServerSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersSsrDevServerSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:server" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersServerSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersServerSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular-devkit/build-angular:ng-packagr" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersNgPackagrSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularDevkitBuildAngularBuildersNgPackagrSchema" } } } }, { "type": "object", "additionalProperties": false, "properties": { "builder": { "const": "@angular/build:ng-packagr" }, "defaultConfiguration": { "type": "string", "description": "A default named configuration to use when a target configuration is not provided." }, "options": { "$ref": "#/definitions/AngularBuildBuildersNgPackagrSchema" }, "configurations": { "type": "object", "additionalProperties": { "$ref": "#/definitions/AngularBuildBuildersNgPackagrSchema" } } } } ] } } }, "global": { "type": "object", "properties": { "$schema": { "type": "string" }, "version": { "$ref": "#/definitions/fileVersion" }, "cli": { "$ref": "#/definitions/cliGlobalOptions" }, "schematics": { "$ref": "#/definitions/schematicOptions" } }, "required": [ "version" ] }, "SchematicsAngularApplicationSchema": { "title": "Angular Application Options Schema", "type": "object", "description": "Generates a new Angular application within your workspace. This schematic sets up the foundational structure of your project, including the root component, module, and configuration files. You can customize various aspects of the application, such as routing, styling, and testing.", "additionalProperties": false, "properties": { "projectRoot": { "description": "The directory where the new application's files will be created, relative to the workspace root. If not specified, the application will be created in a subfolder within the `projects` directory, using the application's name.", "type": "string" }, "name": { "description": "The name for the new application. This name will be used for the project directory and various identifiers throughout the application's code.", "type": "string", "pattern": "^(?:@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*/)?[a-zA-Z0-9-~][a-zA-Z0-9-._~]*$", "$default": { "$source": "argv", "index": 0 } }, "inlineStyle": { "description": "Include the styles for the root component directly within the `app.component.ts` file. Only CSS styles can be included inline. By default, a separate stylesheet file (e.g., `app.component.css`) is created.", "type": "boolean", "alias": "s" }, "inlineTemplate": { "description": "Include the HTML template for the root component directly within the `app.component.ts` file. By default, a separate template file (e.g., `app.component.html`) is created.", "type": "boolean", "alias": "t" }, "viewEncapsulation": { "description": "Sets the view encapsulation mode for the application's components. This determines how component styles are scoped and applied.", "enum": [ "Emulated", "None", "ShadowDom" ], "type": "string" }, "routing": { "type": "boolean", "description": "Generate an application with routing already configured. This sets up the necessary files and modules for managing navigation between different views in your application.", "default": true }, "prefix": { "type": "string", "format": "html-selector", "description": "A prefix to be added to the selectors of components generated within this application. For example, if the prefix is `my-app` and you generate a component named `my-component`, the selector will be `my-app-my-component`.", "default": "app", "alias": "p" }, "style": { "description": "The type of stylesheet files to be created for components in the application.", "type": "string", "default": "css", "enum": [ "css", "scss", "sass", "less" ] }, "skipTests": { "description": "Skip the generation of a unit test files `spec.ts`.", "type": "boolean", "default": false, "alias": "S" }, "skipPackageJson": { "type": "boolean", "default": false, "description": "Do not add dependencies to the `package.json` file." }, "minimal": { "description": "Generate a minimal project without any testing frameworks. This is intended for learning purposes and simple experimentation, not for production applications.", "type": "boolean", "default": false }, "skipInstall": { "description": "Skip the automatic installation of packages. You will need to manually install the dependencies later.", "type": "boolean", "default": false }, "strict": { "description": "Enable stricter bundle budget settings for the application. This helps to keep your application's bundle size small and improve performance. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode", "type": "boolean", "default": true }, "standalone": { "description": "Create an application that utilizes the standalone API, eliminating the need for NgModules. This can simplify the structure of your application.", "type": "boolean", "default": true }, "ssr": { "description": "Configure the application for Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering).", "type": "boolean", "default": false }, "serverRouting": { "description": "Set up a server application using the Server Routing and App Engine APIs (Developer Preview).", "type": "boolean" }, "experimentalZoneless": { "description": "Generate an application that does not use `zone.js`.", "type": "boolean", "default": false } } }, "SchematicsAngularClassSchema": { "title": "Angular Class Options Schema", "type": "object", "description": "Creates a new class in your project. Classes are the fundamental building blocks for object-oriented programming in TypeScript. They provide a blueprint for creating objects with properties and methods. This schematic helps you generate a new class with the basic structure and optional test files.", "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The name for the new class. This will be used to create the class file (e.g., `my-class.ts`) and, if enabled, the corresponding test file `my-class.spec.ts`.", "$default": { "$source": "argv", "index": 0 } }, "path": { "type": "string", "format": "path", "$default": { "$source": "workingDirectory" }, "description": "The path where the class file should be created, relative to the workspace root. If not specified, the class will be created in the current directory.", "visible": false }, "project": { "type": "string", "description": "The name of the project where the class should be added. If not specified, the CLI will determine the project from the current directory.", "$default": { "$source": "projectName" } }, "skipTests": { "type": "boolean", "description": "Skip the generation of a unit test file `spec.ts` for the new class.", "default": false }, "type": { "type": "string", "description": "Adds a custom type to the filename, allowing you to create more descriptive class names. For example, if you set the type to `helper`, the filename will be `my-class.helper.ts`." } } }, "SchematicsAngularComponentSchema": { "title": "Angular Component Options Schema", "type": "object", "description": "Creates a new Angular component. Components are the basic building blocks of Angular applications. Each component consists of a TypeScript class, an HTML template, and an optional CSS stylesheet. Use this schematic to generate a new component in your project.", "additionalProperties": false, "properties": { "path": { "type": "string", "format": "path", "$default": { "$source": "workingDirectory" }, "description": "The path where the component files should be created, relative to the current workspace. If not provided, a folder with the same name as the component will be created in the project's `src/app` directory.", "visible": false }, "project": { "type": "string", "description": "The name of the project where the component should be added. If not specified, the CLI will determine the project from the current directory.", "$default": { "$source": "projectName" } }, "name": { "type": "string", "description": "The name for the new component. This will be used to create the component's class, template, and stylesheet files. For example, if you provide `my-component`, the files will be named `my-component.component.ts`, `my-component.component.html`, and `my-component.component.css`.", "$default": { "$source": "argv", "index": 0 } }, "displayBlock": { "description": "Adds `:host { display: block; }` to the component's stylesheet, ensuring the component renders as a block-level element. This is useful for layout purposes.", "type": "boolean", "default": false, "alias": "b" }, "inlineStyle": { "description": "Include the component's styles directly in the `component.ts` file. By default, a separate stylesheet file (e.g., `my-component.component.css`) is created.", "type": "boolean", "default": false, "alias": "s" }, "inlineTemplate": { "description": "Include the component's HTML template directly in the `component.ts` file. By default, a separate template file (e.g., `my-component.component.html`) is created.", "type": "boolean", "default": false, "alias": "t" }, "standalone": { "description": "Generate a standalone component. Standalone components are self-contained and don't need to be declared in an NgModule. They can be used independently or imported directly into other standalone components.", "type": "boolean", "default": true }, "viewEncapsulation": { "description": "Sets the view encapsulation mode for the component. This determines how the component's styles are scoped and applied.", "enum": [ "Emulated", "None", "ShadowDom" ], "type": "string", "alias": "v" }, "changeDetection": { "description": "Configures the change detection strategy for the component.", "enum": [ "Default", "OnPush" ], "type": "string", "default": "Default", "alias": "c" }, "prefix": { "type": "string", "description": "A prefix to be added to the component's selector. For example, if the prefix is `app` and the component name is `my-component`, the selector will be `app-my-component`.", "alias": "p", "oneOf": [ { "maxLength": 0 }, { "minLength": 1, "format": "html-selector" } ] }, "style": { "description": "Specify the type of stylesheet to be created for the component, or `none` to skip creating a stylesheet.", "type": "string", "default": "css", "enum": [ "css", "scss", "sass", "less", "none" ] }, "type": { "type": "string", "description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`.", "default": "Component" }, "skipTests": { "type": "boolean", "description": "Skip the generation of unit test files `spec.ts`.", "default": false }, "flat": { "type": "boolean", "description": "Create the component files directly in the project's `src/app` directory instead of creating a new folder for them.", "default": false }, "skipImport": { "type": "boolean", "description": "Do not automatically import the new component into its closest NgModule.", "default": false }, "selector": { "type": "string", "format": "html-selector", "description": "The HTML selector to use for this component. If not provided, a selector will be generated based on the component name (e.g., `app-my-component`)." }, "skipSelector": { "type": "boolean", "default": false, "description": "Skip the generation of an HTML selector for the component." }, "module": { "type": "string", "description": "Specify the NgModule where the component should be declared. If not provided, the CLI will attempt to find the closest NgModule in the component's path.", "alias": "m" }, "export": { "type": "boolean", "default": false, "description": "Automatically export the component from the specified NgModule, making it accessible to other modules in the application." }, "exportDefault": { "type": "boolean", "default": false, "description": "Use a default export for the component in its TypeScript file instead of a named export." } } }, "SchematicsAngularDirectiveSchema": { "title": "Angular Directive Options Schema", "type": "object", "description": "Creates a new directive in your project. Directives are used to extend the behavior or appearance of HTML elements and components. They allow you to manipulate the DOM, add custom attributes, and respond to events. This schematic generates the necessary files and boilerplate code for a new directive.", "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The name for the new directive. This will be used to create the directive's class and spec files (e.g., `my-directive.directive.ts` and `my-directive.directive.spec.ts`).", "$default": { "$source": "argv", "index": 0 } }, "path": { "type": "string", "format": "path", "$default": { "$source": "workingDirectory" }, "description": "The path where the directive files should be created, relative to the workspace root. If not provided, the directive will be created in the current directory.", "visible": false }, "project": { "type": "string", "description": "The name of the project where the directive should be added. If not specified, the CLI will determine the project from the current directory.", "$default": { "$source": "projectName" } }, "prefix": { "type": "string", "description": "A prefix to be added to the directive's selector. For example, if the prefix is `app` and the directive name is `highlight`, the selector will be `appHighlight`.", "alias": "p", "oneOf": [ { "maxLength": 0 }, { "minLength": 1, "format": "html-selector" } ] }, "skipTests": { "type": "boolean", "description": "Skip the generation of a unit test file `spec.ts` for the new directive.", "default": false }, "skipImport": { "type": "boolean", "description": "Do not automatically import the new directive into its closest NgModule.", "default": false }, "selector": { "type": "string", "format": "html-selector", "description": "The HTML selector to use for this directive. If not provided, a selector will be generated based on the directive's name (e.g., `appHighlight`)." }, "standalone": { "description": "Generate a standalone directive. Standalone directives are self-contained and don't need to be declared in an NgModule. They can be used independently or imported directly into other standalone components or directives.", "type": "boolean", "default": true }, "flat": { "type": "boolean", "description": "Creates the new directive files at the top level of the current project. If set to false, a new folder with the directive's name will be created to contain the files.", "default": true }, "module": { "type": "string", "description": "Specify the NgModule where the directive should be declared. If not provided, the CLI will attempt to find the closest NgModule in the directive's path.", "alias": "m" }, "export": { "type": "boolean", "default": false, "description": "Automatically export the directive from the specified NgModule, making it accessible to other modules in the application." }