MCPcopy Create free account
hub / github.com/code100x/chess / generator

Function generator

packages/ui/turbo/generators/config.ts:5–30  ·  view source on GitHub ↗
(plop: PlopTypes.NodePlopAPI)

Source from the content-addressed store, hash-verified

3// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
4
5export default function generator(plop: PlopTypes.NodePlopAPI): void {
6 // A simple generator to add a new React component to the internal UI library
7 plop.setGenerator('react-component', {
8 description: 'Adds a new react component',
9 prompts: [
10 {
11 type: 'input',
12 name: 'name',
13 message: 'What is the name of the component?',
14 },
15 ],
16 actions: [
17 {
18 type: 'add',
19 path: 'src/{{kebabCase name}}.tsx',
20 templateFile: 'templates/component.hbs',
21 },
22 {
23 type: 'append',
24 path: 'package.json',
25 pattern: /"exports": {(?<insertion>)/g,
26 template: '"./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
27 },
28 ],
29 });
30}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected