-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.cjs
43 lines (43 loc) · 1.13 KB
/
plopfile.cjs
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
/**
* @param {import('plop').NodePlopAPI} plop
*/
module.exports = (plop) => {
plop.setGenerator('package', {
description: 'Generate package',
prompts: [
{
type: 'input',
name: 'name',
message: 'Name of new package',
},
{
type: 'list',
name: 'type',
message: 'Type of new package',
choices: ['config', 'plugin'],
},
],
actions: [
{
type: 'add',
path: 'packages/eslint-{{ kebabCase type }}-{{ kebabCase name }}/src/index.ts',
templateFile: 'plop-templates/index.ts.hbs',
},
{
type: 'add',
path: 'packages/eslint-{{ kebabCase type }}-{{ kebabCase name }}/package.json',
templateFile: 'plop-templates/package.json.hbs',
},
{
type: 'add',
path: 'packages/eslint-{{ kebabCase type }}-{{ kebabCase name }}/index.js',
templateFile: 'plop-templates/index.js.hbs',
},
{
type: 'add',
path: 'packages/eslint-{{ kebabCase type }}-{{ kebabCase name }}/README.md',
templateFile: 'plop-templates/readme.md.hbs',
},
],
});
};