-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
36 lines (36 loc) · 1.16 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
// Docs: https://plopjs.com/documentation
module.exports = function (plop) {
/**
* React dumb component generator.
*/
plop.setGenerator('dumb component', {
description: 'A Dumb Component',
prompts: [
{
type: 'input',
name: 'name',
message: 'component name please',
},
],
actions: [
// Create component file.
{
type: 'add',
templateFile: 'templates/DumbComponent.txt',
path: './src/components/unsorted/{{pascalCase name}}/{{pascalCase name}}.tsx',
},
// Create storybook file.
{
type: 'add',
templateFile: 'templates/DumbComponent.stories.txt',
path: './src/components/unsorted/{{pascalCase name}}/{{pascalCase name}}.stories.tsx',
},
// Create index file.
{
type: 'add',
templateFile: 'templates/DumbComponent.index.txt',
path: './src/components/unsorted/{{pascalCase name}}/index.ts',
},
],
});
};