schema.json 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularEnum",
  4. "title": "Angular Enum Options Schema",
  5. "type": "object",
  6. "description": "Creates a new enum in your project. Enums (enumerations) are a way to define a set of named constants, making your code more readable and maintainable. This schematic generates a new enum with the specified name and type.",
  7. "additionalProperties": false,
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name for the new enum. This will be used to create the enum file (e.g., `my-enum.enum.ts`).",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the enum?"
  17. },
  18. "path": {
  19. "type": "string",
  20. "format": "path",
  21. "$default": {
  22. "$source": "workingDirectory"
  23. },
  24. "description": "The path where the enum file should be created, relative to the current workspace. If not specified, the enum 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 enum should be created. If not specified, the CLI will determine the project from the current directory.",
  30. "$default": {
  31. "$source": "projectName"
  32. }
  33. },
  34. "type": {
  35. "type": "string",
  36. "description": "Adds a custom type to the filename, allowing you to create more descriptive enum names. For example, if you set the type to `status`, the filename will be `my-enum.status.ts`."
  37. }
  38. },
  39. "required": ["name", "project"]
  40. }