forked from strapi/design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
47 lines (45 loc) · 1.23 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
const HandleBars = require("handlebars");
HandleBars.registerHelper("toLowerCase", function (str) {
return str.toLowerCase();
});
module.exports = function (plop) {
plop.setGenerator("component", {
description: "Component name",
prompts: [
{
type: "input",
name: "name",
message: "Component name please",
},
],
actions: [
{
type: "add",
path: "packages/strapi-design-system/src/{{name}}/index.js",
templateFile: "plop-templates/root.hbs",
},
{
type: "add",
path: "packages/strapi-design-system/src/{{name}}/{{name}}.js",
templateFile: "plop-templates/component.hbs",
},
{
type: "add",
path: "packages/strapi-design-system/src/{{name}}/{{name}}.stories.mdx",
templateFile: "plop-templates/stories.hbs",
},
{
type: "add",
path:
"packages/strapi-design-system/src/{{name}}/__tests__/{{name}}.spec.js",
templateFile: "plop-templates/unit-test.hbs",
},
{
type: "add",
path:
"packages/strapi-design-system/src/{{name}}/__tests__/{{name}}.e2e.js",
templateFile: "plop-templates/e2e-test.hbs",
},
],
});
};