schema.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Creates a new service in your project. Services are used to encapsulate reusable logic,
  3. * such as data access, API calls, or utility functions. This schematic simplifies the
  4. * process of generating a new service with the necessary files and boilerplate code.
  5. */
  6. export type Schema = {
  7. /**
  8. * Creates files at the top level of the project or the given path. If set to false, a new
  9. * folder with the service's name will be created to contain the files.
  10. */
  11. flat?: boolean;
  12. /**
  13. * The name for the new service. This will be used to create the service's class and spec
  14. * files (e.g., `my-service.service.ts` and `my-service.service.spec.ts`).
  15. */
  16. name: string;
  17. /**
  18. * The path where the service files should be created, relative to the workspace root. If
  19. * not provided, the service will be created in the project's `src/app` directory.
  20. */
  21. path?: string;
  22. /**
  23. * The name of the project where the service should be added. If not specified, the CLI will
  24. * determine the project from the current directory.
  25. */
  26. project: string;
  27. /**
  28. * Skip the generation of a unit test file `spec.ts` for the service.
  29. */
  30. skipTests?: boolean;
  31. };