-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
plopfile.js
38 lines (38 loc) · 918 Bytes
/
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
module.exports = function(plop) {
// controller generator
plop.addHelper("lowerCase", function(p) {
return p.toLowerCase().trim();
});
plop.setGenerator("component", {
description: "create component",
prompts: [
{
type: "input",
name: "name",
message: "component name please"
}
],
actions: [
{
type: "add",
path: "src/components/{{name}}/{{lowerCase name}}.tsx",
templateFile: "plop-template/component.hbs"
},
{
type: "add",
path: "src/components/{{name}}/index.tsx",
templateFile: "plop-template/componentIndex.hbs"
},
{
type: "add",
path: "src/components/{{name}}/_style.scss",
templateFile: "plop-template/componentStyle.hbs"
},
{
type: "add",
path: "src/components/{{name}}/{{lowerCase name}}.stories.mdx",
templateFile: "plop-template/componentStories.hbs"
}
]
});
};