-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.mjs
45 lines (44 loc) · 1.2 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
const setPlopGenerator = (
/** @type {import('plop').NodePlopAPI} */
plop
) => {
plop.setGenerator('component', {
description: 'Create a component',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is your component name?',
},
{
type: 'input',
name: 'path',
message: 'What is your component path?',
default: 'src/shared/components',
},
],
actions: [
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/index.ts',
templateFile: 'plop-templates/Component/index.ts.hbs',
},
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/{{pascalCase name}}.tsx',
templateFile: 'plop-templates/Component/Component.tsx.hbs',
},
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/{{pascalCase name}}.module.scss',
templateFile: 'plop-templates/Component/Component.module.scss.hbs',
},
{
type: 'add',
path: '{{path}}/{{pascalCase name}}/{{pascalCase name}}.stories.tsx',
templateFile: 'plop-templates/Component/Component.stories.tsx.hbs',
},
],
});
};
export default setPlopGenerator;