-
Notifications
You must be signed in to change notification settings - Fork 44
/
plopfile.mjs
31 lines (29 loc) · 947 Bytes
/
plopfile.mjs
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
import { readFile } from 'fs/promises';
const packageJson = JSON.parse(
await readFile(
new URL('./package.json', import.meta.url)
)
);
export default function (plop) {
plop.setGenerator('wc', {
description: 'Create a new FDS web component',
prompts: [{
type: 'input',
name: 'name',
message: 'component name please'
}],
actions: [{
type: 'addMany',
destination: 'packages/fds-components-web/{{dashCase name}}',
templateFiles: 'tools/plop-templates/create-wc/**/*',
base: 'tools/plop-templates/create-wc/',
data: { 'version': packageJson.version},
globOptions: {dot: true}
}, {
type: 'append',
path: 'packages/fds-components-web/tsconfig.json',
pattern: '"references": [',
template: '{"path": "{{dashCase name}}"},',
}]
});
};