forked from MikeCheek/naturalmente-tecnologici
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
41 lines (39 loc) · 1.06 KB
/
plopfile.js
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
// This is for generating component structure from a boilerplate
// To create a new component run:
// npm run generate component
// and fill in the name and type
const pathComponent = 'src/components/{{lowerCase type}}s/{{pascalCase name}}/';
module.exports = (plop) => {
plop.setGenerator('component', {
description: 'Create a component',
prompts: [
{
type: 'input',
name: 'name',
message: 'Component name: ',
},
{
type: 'input',
name: 'type',
message: 'Component type (atom, molecule, organism): ',
},
],
actions: [
{
type: 'add',
path: pathComponent + 'index.tsx',
templateFile: 'plopTemplates/Component/index.tsx.hbs',
},
{
type: 'add',
path: pathComponent + 'index.types.ts',
templateFile: 'plopTemplates/Component/index.types.ts.hbs',
},
{
type: 'add',
path: pathComponent + 'index.module.scss',
templateFile: 'plopTemplates/Component/index.module.scss.hbs',
},
],
});
};