-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplopfile.mjs
68 lines (67 loc) · 1.66 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { updateBitsPackage } from "./scripts/updateBitsPackage.mjs";
import { execSync } from "child_process";
export default function (plop) {
plop.setGenerator("bit", {
description: "Creates a new Bit package.",
prompts: [
{
type: "list",
name: "type",
choices: ["end", "start", "task", "title", "input"],
},
{
type: "input",
name: "name",
message: "name please",
},
],
actions: [
{
type: "addMany",
templateFiles: "plop-templates/bits/{{ type }}/**/*",
destination: "packages/{{ type }}-{{ dashCase name }}/",
base: "plop-templates/bits/{{ type }}",
},
() => {
updateBitsPackage(plop)();
execSync("pnpm i");
},
],
});
plop.setGenerator("component package", {
description: "Creates a component TypeScript package.",
prompts: [
{
type: "input",
name: "name",
message: "component name please",
},
],
actions: [
{
type: "addMany",
templateFiles: "plop-templates/component/**/*",
destination: "packages/{{ dashCase name }}/",
base: "plop-templates/component/",
},
],
});
plop.setGenerator("plain package", {
description: "Creates a plain TypeScript package.",
prompts: [
{
type: "input",
name: "packageName",
message: "package name please",
},
],
actions: [
{
type: "addMany",
templateFiles: "plop-templates/package/**/*",
destination: "packages/{{ dashCase packageName }}/",
base: "plop-templates/package/",
},
],
});
}