-
Notifications
You must be signed in to change notification settings - Fork 13
/
plopfile.js
38 lines (38 loc) · 958 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) {
plop.setGenerator("controller", {
description: "new component controller logic",
prompts: [
{
type: "input",
name: "name",
message: "Enter a PascalCase name for your component:",
},
],
actions: [
{
type: "add",
path: "./src/{{name}}/{{name}}.tsx",
templateFile: "./src/template/component.hbs",
},
{
type: "add",
path: "./src/{{name}}/index.ts",
templateFile: "./src/template/index.hbs",
},
{
type: "add",
path: "./src/{{name}}/{{name}}.story.tsx",
templateFile: "./src/template/component.story.hbs",
},
{
type: "modify",
path: "./src/index.ts",
pattern: /$/,
templateFile: "./src/template/index-js-injection.txt",
},
function (data) {
return "Your component was created! 😊";
},
],
});
};