@turbo/gen

在你的 Turborepo 代码生成器中使用此包获取类型定义。

./turbo/generators/my-generator.ts
import type { PlopTypes } from "@turbo/gen"; 
 
export default function generator(plop: PlopTypes.NodePlopAPI): void {
  // 创建一个生成器
  plop.setGenerator("Generator name", {
    description: "Generator description",
    // 从用户那里收集信息
    prompts: [
      ...
    ],
    // 基于提示执行操作
    actions: [
      ...
    ],
  });
}

更多信息,访问生成代码指南