@schematics/angular
Version:
Schematics specific to Angular
46 lines (45 loc) • 1.95 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "SchematicsAngularClass",
"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
},
"x-prompt": "What name would you like to use for the class?"
},
"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`."
}
},
"required": ["name", "project"]
}