/
plopfile.mjs
35 lines (35 loc) · 933 Bytes
/
plopfile.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export default function (plop) {
plop.setGenerator('component', {
description: 'create a new component',
prompts: [
{
type: 'input',
name: 'path',
message: 'Where is the path to create components? (e.g. components)',
},
{
type: 'input',
name: 'name',
message: 'What is the component name? (e.g. button)',
},
],
actions: [
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/index.tsx',
templateFile: '.plop/index.tsx.hbs',
skipIfExists: true,
},
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/{{pascalCase name}}.test.tsx',
templateFile: '.plop/component.test.tsx.hbs',
},
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/{{pascalCase name}}.stories.tsx',
templateFile: '.plop/component.stories.tsx.hbs',
},
],
})
}