-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.mjs
48 lines (48 loc) · 1.3 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
export default function (
/** @type {import('plop').NodePlopAPI} */
plop,
) {
plop.setGenerator('component', {
description: 'Create a new component',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is your component name?',
},
],
actions: [
{
type: 'add',
path: 'src/components/{{pascalCase name}}/index.ts',
templateFile: '.templates/index.hbs',
},
{
type: 'add',
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.tsx',
templateFile: '.templates/component.hbs',
},
{
type: 'add',
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.test.tsx',
templateFile: '.templates/componentTest.hbs',
},
{
type: 'add',
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.stories.ts',
templateFile: '.templates/story.hbs',
},
{
type: 'add',
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.framer.tsx',
templateFile: '.templates/framer.hbs',
},
{
type: 'modify',
path: 'src/components/index.ts',
pattern: /$/,
template: "export { {{pascalCase name}} } from './{{pascalCase name}}';\n",
},
],
});
}