-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
83 lines (83 loc) · 2.38 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module.exports = function (plop) {
plop.setGenerator('game', {
description: 'A game added to the compendium and storybook',
prompts: [
{
type: 'input',
name: 'packageName',
message: 'Please enter the package name of your game. (lower-cased-kebab-sticked)'
},
{
type: 'input',
name: 'camelCasedName',
message: 'Please enter the component name of your game. (CamelCased)'
},
{
type: 'input',
name: 'verboseName',
message: 'Please enter the verbose name of your game. (Like a Title)'
}
],
actions: [
// Stories
{
type: 'add',
path: 'app/src/stories/games/{{ camelCasedName }}/Host.stories.js',
templateFile: 'templates/HostStory.js.hbs'
},
{
type: 'add',
path: 'app/src/stories/games/{{ camelCasedName }}/Guest.stories.js',
templateFile: 'templates/GuestStory.js.hbs'
},
// Root directory
{
type: 'add',
path: 'app/src/games/{{ packageName }}/README.md',
templateFile: 'templates/README.md.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/index.js',
templateFile: 'templates/index.js.hbs'
},
// Client
{
type: 'add',
path: 'app/src/games/{{ packageName }}/client/README.md',
templateFile: 'templates/client/README.md.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/client/index.js',
templateFile: 'templates/client/index.js.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/client/Host.js',
templateFile: 'templates/client/Host.js.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/client/Guest.js',
templateFile: 'templates/client/Guest.js.hbs'
},
// Game rules
{
type: 'add',
path: 'app/src/games/{{ packageName }}/game/README.md',
templateFile: 'templates/game/README.md.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/game/index.js',
templateFile: 'templates/game//index.js.hbs'
},
{
type: 'add',
path: 'app/src/games/{{ packageName }}/game/index.test.js',
templateFile: 'templates/game/index.test.js.hbs'
},
]
});
}