schema.json 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularClass",
  4. "title": "Angular Class Options Schema",
  5. "type": "object",
  6. "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.",
  7. "additionalProperties": false,
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "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`.",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the class?"
  17. },
  18. "path": {
  19. "type": "string",
  20. "format": "path",
  21. "$default": {
  22. "$source": "workingDirectory"
  23. },
  24. "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.",
  25. "visible": false
  26. },
  27. "project": {
  28. "type": "string",
  29. "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.",
  30. "$default": {
  31. "$source": "projectName"
  32. }
  33. },
  34. "skipTests": {
  35. "type": "boolean",
  36. "description": "Skip the generation of a unit test file `spec.ts` for the new class.",
  37. "default": false
  38. },
  39. "type": {
  40. "type": "string",
  41. "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`."
  42. }
  43. },
  44. "required": ["name", "project"]
  45. }