-
Notifications
You must be signed in to change notification settings - Fork 1
/
plopfile.mjs
48 lines (48 loc) · 1.5 KB
/
plopfile.mjs
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
export default function (plop) {
plop.setGenerator("component", {
prompts: [
{
type: "input",
name: "name",
message: "What do you want to name this component?",
},
{
type: "input",
name: "description",
message: "What is the description for this component?",
},
{
type: "list",
name: "category",
message: "Component category:",
choices: ["components", "layout", "primitives"],
},
],
actions: [
{
type: "add",
data: { rootPath: { rootPath: process.cwd() } },
path: "./packages/components/src/{{category}}/{{pascalCase name}}/index.ts",
templateFile: "./template/index.ts.hbs",
},
{
type: "add",
data: { rootPath: { rootPath: process.cwd() } },
path: "./packages/components/src/{{category}}/{{pascalCase name}}/{{pascalCase name}}.tsx",
templateFile: "./template/Component.tsx.hbs",
},
{
type: "add",
data: { rootPath: { rootPath: process.cwd() } },
path: "./packages/components/src/{{category}}/{{pascalCase name}}/{{pascalCase name}}.test.tsx",
templateFile: "./template/Component.test.tsx.hbs",
},
{
type: "add",
data: { rootPath: { rootPath: process.cwd() } },
path: "./packages/components/src/{{category}}/{{pascalCase name}}/{{pascalCase name}}.stories.tsx",
templateFile: "./template/Component.stories.tsx.hbs",
},
],
});
}