schema.json 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularPipe",
  4. "title": "Angular Pipe Options Schema",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "description": "Creates a new pipe in your project. Pipes are used to transform data for display in templates. They take input values and apply a specific transformation, such as formatting dates, currency, or filtering arrays. This schematic generates the necessary files and boilerplate code for a new pipe.",
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name for the new pipe. This will be used to create the pipe's class and spec files (e.g., `my-pipe.pipe.ts` and `my-pipe.pipe.spec.ts`).",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the pipe?"
  17. },
  18. "path": {
  19. "type": "string",
  20. "format": "path",
  21. "$default": {
  22. "$source": "workingDirectory"
  23. },
  24. "description": "The path where the pipe files should be created, relative to the workspace root. If not provided, the pipe 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 pipe should be created. If not specified, the CLI will determine the project from the current directory.",
  30. "$default": {
  31. "$source": "projectName"
  32. }
  33. },
  34. "flat": {
  35. "type": "boolean",
  36. "default": true,
  37. "description": "Creates the new pipe files at the top level of the current project. If set to false, a new folder with the pipe's name will be created to contain the files."
  38. },
  39. "skipTests": {
  40. "type": "boolean",
  41. "description": "Prevent the generation of a unit test file `spec.ts` for the new pipe.",
  42. "default": false
  43. },
  44. "skipImport": {
  45. "type": "boolean",
  46. "default": false,
  47. "description": "Do not automatically import the new pipe into its closest NgModule."
  48. },
  49. "standalone": {
  50. "description": "Generate a standalone pipe. Standalone pipes 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, directives, or pipes.",
  51. "type": "boolean",
  52. "default": true,
  53. "x-user-analytics": "ep.ng_standalone"
  54. },
  55. "module": {
  56. "type": "string",
  57. "description": "Specify the NgModule where the pipe should be declared. If not provided, the CLI will attempt to find the closest NgModule in the pipe's path.",
  58. "alias": "m"
  59. },
  60. "export": {
  61. "type": "boolean",
  62. "default": false,
  63. "description": "Automatically export the pipe from the specified NgModule, making it accessible to other modules in the application."
  64. }
  65. },
  66. "required": ["name", "project"]
  67. }