schema.json 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularResolver",
  4. "title": "Angular Resolver Options Schema",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "description": "Creates a new resolver in your project. Resolvers are used to pre-fetch data before a route is activated, ensuring that the necessary data is available before the component is displayed. This can improve the user experience by preventing delays and loading states. This schematic generates a new resolver with the specified name and options.",
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name for the new resolver. This will be used to create the resolver's class and spec files (e.g., `my-resolver.resolver.ts` and `my-resolver.resolver.spec.ts`).",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the resolver?"
  17. },
  18. "skipTests": {
  19. "type": "boolean",
  20. "description": "Skip the generation of a unit test file `spec.ts` for the new resolver.",
  21. "default": false
  22. },
  23. "flat": {
  24. "type": "boolean",
  25. "description": "Creates the new resolver files at the top level of the current project. If set to false, a new folder with the resolver's name will be created to contain the files.",
  26. "default": true
  27. },
  28. "functional": {
  29. "type": "boolean",
  30. "description": "Creates the resolver as a function `ResolveFn` instead of a class. Functional resolvers can be simpler for basic scenarios.",
  31. "default": true
  32. },
  33. "path": {
  34. "type": "string",
  35. "format": "path",
  36. "$default": {
  37. "$source": "workingDirectory"
  38. },
  39. "description": "The path where the resolver files should be created, relative to the current workspace. If not provided, the resolver will be created in the current directory.",
  40. "visible": false
  41. },
  42. "project": {
  43. "type": "string",
  44. "description": "The name of the project where the resolver should be created. If not specified, the CLI will determine the project from the current directory.",
  45. "$default": {
  46. "$source": "projectName"
  47. }
  48. }
  49. },
  50. "required": ["name", "project"]
  51. }