-
Notifications
You must be signed in to change notification settings - Fork 27
/
plopfile.js
31 lines (31 loc) · 838 Bytes
/
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
module.exports = function (plop) {
plop.setGenerator('component', {
description: 'Generate a Fluid Component',
prompts: [{
type: 'input',
name: 'name',
message: 'What should it be called?',
validate: function (value) {
if ((/.+/).test(value)) { return true; }
return 'name is required';
}
}],
actions: [{
type: 'add',
path: 'src/{{properCase name}}/{{properCase name}}.js',
templateFile: 'templates/component/component.txt'
}, {
type: 'add',
path: 'src/{{properCase name}}/index.js',
templateFile: 'templates/component/index.txt'
}, {
type: 'add',
path: 'src/{{properCase name}}/styles.js',
templateFile: 'templates/component/styles.txt'
}, {
type: 'add',
path: 'docs/components/{{properCase name}}.md',
templateFile: 'templates/component/document.txt'
}]
});
}