-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathplopfile.ts
36 lines (35 loc) · 926 Bytes
/
plopfile.ts
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
import type { NodePlopAPI } from 'plop';
export default function (plop: NodePlopAPI) {
plop.setGenerator('lib', {
description: 'Generate a new package',
prompts: [
{
type: 'list',
name: 'template',
message: 'Choose a template:',
choices: [
{ name: 'Library', value: { name: 'lib', dest: 'packages' } },
{ name: 'React Example', value: { name: 'example-react', dest: 'examples' } },
],
},
{
type: 'input',
name: 'name',
message: 'Package name (without scope):',
},
{
type: 'input',
name: 'description',
message: 'Package description:',
},
],
actions: [
{
type: 'addMany',
destination: '{{template.dest}}/{{name}}',
base: 'templates/{{template.name}}/',
templateFiles: 'templates/{{template.name}}/**',
},
],
});
}