-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
58 lines (58 loc) · 1.44 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
export default function (plop) {
plop.setGenerator("component", {
description: "Create a new React Component in the selected path",
prompts: [
{
type: "input",
name: "name",
message: "What is this component's name?",
},
{
type: "input",
name: "path",
message: "What is this component's path?",
default: "src/components",
},
],
actions: [
{
type: "add",
path: "{{path}}/{{pascalCase name}}/{{pascalCase name}}.tsx",
templateFile: "plop-templates/Component.tsx.hbs",
},
{
type: "add",
path: "{{path}}/{{pascalCase name}}/{{camelCase name}}.css",
templateFile: "plop-templates/style.css.hbs",
},
{
type: "add",
path: "{{path}}/{{pascalCase name}}/index.ts",
templateFile: "plop-templates/index.ts.hbs",
},
],
});
plop.setGenerator("context", {
description: "Create a new Context in the selected path",
prompts: [
{
type: "input",
name: "name",
message: "What is this context's name?",
},
{
type: "input",
name: "path",
message: "What is this context's path?",
default: "src/context",
},
],
actions: [
{
type: "add",
path: "{{path}}/{{pascalCase name}}Context.tsx",
templateFile: "plop-templates/context.tsx.hbs",
},
],
});
}