/ packages / generator / src / generator.ts
generator.ts
 1  import type { Plugin } from "rolldown";
 2  export type { Plugin };
 3  
 4  /**
 5   * This is where it all begins.
 6   *
 7   * @example
 8   * import { type Generator } from "@genoly/generator";
 9   *
10   * export class GeneratorVue implements Generator {
11   *   public get outDir() {
12   *     return "vue";
13   *   }
14   * }
15   */
16  export interface Generator {
17    /**
18     * Appended to the user's configured output directory,
19     * which is set to `dist` by default.
20     *
21     * @example "vue"// -> writes to "<PROJECT>/<OUTDIR>/vue"
22     */
23    get outDir(): string;
24  
25    /**
26     * Where all the magic happens!
27     */
28    plugin(): Plugin | Array<Plugin>;
29  }