types.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. export type Logger = {
  2. info: (message: string) => void;
  3. warn: (message: string) => void;
  4. debug: (message: string) => void;
  5. error: (message: string) => void;
  6. };
  7. export type PluginInfo = {
  8. name: string;
  9. pluginPath: string;
  10. dashboardEntryPath: string | undefined;
  11. /** The original source path of the plugin, only set for local plugins that are compiled */
  12. sourcePluginPath?: string;
  13. };
  14. export type GetCompiledConfigPathFn = (params: {
  15. inputRootDir: string;
  16. outputPath: string;
  17. configFileName: string;
  18. }) => string;
  19. export type TransformTsConfigPathMappingsFn = (params: {
  20. phase: 'compiling' | 'loading';
  21. alias: string;
  22. patterns: string[];
  23. }) => string[];
  24. /**
  25. * @description
  26. * The PathAdapter interface allows customization of how paths are handled
  27. * when compiling the Vendure config and its imports.
  28. */
  29. export interface PathAdapter {
  30. /**
  31. * @description
  32. * A function to determine the path to the compiled Vendure config file.
  33. */
  34. getCompiledConfigPath?: GetCompiledConfigPathFn;
  35. /**
  36. * If your project makes use of the TypeScript `paths` configuration, the compiler will
  37. * attempt to use these paths when compiling the Vendure config and its imports.
  38. */
  39. transformTsConfigPathMappings?: TransformTsConfigPathMappingsFn;
  40. }