Turborepo logo

@turbo/gen

在您的 Turborepo 程式碼產生器中使用此套件進行類型定義。

./turbo/generators/my-generator.ts
import type { PlopTypes } from "@turbo/gen"; 
 
export default function generator(plop: PlopTypes.NodePlopAPI): void {
  // Create a generator
  plop.setGenerator("Generator name", {
    description: "Generator description",
    // Gather information from the user
    prompts: [
      ...
    ],
    // Perform actions based on the prompts
    actions: [
      ...
    ],
  });
}

如需更多資訊,請造訪程式碼產生指南