Move template into packages/scripts
This commit is contained in:
parent
103f6d1e7a
commit
1eafdf7fd8
@ -13,5 +13,6 @@
|
||||
"dependencies": {},
|
||||
"types": "lib/index.d.ts",
|
||||
"devDependencies": {},
|
||||
"module": "lib/index.js"
|
||||
}
|
||||
"module": "lib/index.js",
|
||||
"main": "lib/index.js"
|
||||
}
|
||||
|
||||
@ -8,6 +8,11 @@ export async function add(...argv: string[]) {
|
||||
const {parse} = argparse({
|
||||
name: arg('string', {positional: true, required: true}),
|
||||
namespace: arg('string', {default: '@rondo.dev'}),
|
||||
template: arg('string', {
|
||||
default: path.join(__dirname, '..', '..', 'template'),
|
||||
alias: 't',
|
||||
description: 'Path to project template directory',
|
||||
}),
|
||||
help: arg('boolean', {
|
||||
alias: 'h',
|
||||
description: 'Print help message',
|
||||
@ -23,7 +28,7 @@ export async function add(...argv: string[]) {
|
||||
|
||||
const libraryName = `${args.namespace}/${args.name}`
|
||||
|
||||
const templateDir = path.join('.', 'template')
|
||||
const templateDir = args.template
|
||||
for (const file of await walk(templateDir)) {
|
||||
const src = file
|
||||
const dest = path.join(destDir, path.relative(templateDir, file))
|
||||
|
||||
@ -10,5 +10,6 @@
|
||||
"dependencies": {
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
"types": "lib/index.d.ts"
|
||||
}
|
||||
8
packages/scripts/template/tsconfig.esm.json
Normal file
8
packages/scripts/template/tsconfig.esm.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "esm"
|
||||
},
|
||||
"references": [
|
||||
]
|
||||
}
|
||||
@ -4,6 +4,12 @@
|
||||
"outDir": "lib",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"template",
|
||||
"lib",
|
||||
"esm"
|
||||
],
|
||||
"references": [
|
||||
{"path": "../argparse"}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user