-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
34 lines (34 loc) · 806 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
32
33
34
module.exports = function (plop) {
plop.setGenerator('component', {
description: 'React component using Typescript',
prompts: [
{
type: 'input',
name: 'dir',
message: 'Directory: ',
},
{
type: 'input',
name: 'name',
message: 'Name: ',
},
{
type: 'input',
name: 'tag',
message: 'Tag name: ',
},
],
actions: [
{
type: 'add',
path: 'src/components/{{dir}}/{{pascalCase name}}/index.tsx',
templateFile: 'templates/component/Component.tsx.hbs',
},
{
type: 'add',
path: 'src/components/{{dir}}/__tests__/{{pascalCase name}}.test.tsx',
templateFile: 'templates/component/Component.test.tsx.hbs',
},
],
});
};