UNPKG

524 BPlain TextView Raw
1import { resolve as resolvePath } from 'path';
2import createFile from 'vamtiger-create-file';
3import webcomponentSnippet from './snippet/webcomponent';
4
5const { cwd } = process;
6const folder = resolvePath(
7 cwd(),
8 'source'
9);
10
11export default async function({ packagePath }: IParams) {
12 const { name } = require(packagePath);
13 const filePath = resolvePath(
14 folder,
15 `${name}.ts`
16 );
17
18 await createFile(filePath, webcomponentSnippet);
19}
20
21export interface IParams {
22 packagePath: string;
23}