-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
74 lines (74 loc) · 2.34 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = plop => {
plop.setGenerator('component', {
description: 'Criando componente 🧙',
// User input prompts provided as arguments to the template
prompts: [
{
// Raw text input
type: 'input',
// Variable name for this input
name: 'name',
// Prompt to display on command line
message: 'Nome:'
},
],
actions: [
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{pascalCase name}}/index.tsx',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ComponentIndex.tsx.hbs',
},
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{pascalCase name}}/styles.ts',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ComponentStyles.ts.hbs',
},
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{pascalCase name}}/test.tsx',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ComponentTests.tsx.hbs',
},
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{pascalCase name}}/stories.tsx',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ComponentStories.tsx.hbs',
},
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/types/{{pascalCase name}}.types.ts',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ComponentTypes.ts.hbs',
},
{
// Add a new file
type: 'append',
// Path for the new file
path: 'src/types/index.ts',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ExportType.txt.hbs',
},
{
// Add a new file
type: 'append',
// Path for the new file
path: 'src/components/index.ts',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/ExportFile.txt.hbs',
},
],
});
};