From c0844ef6599e859f64da16e5da99a4080876e078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=B8=E4=BE=A0?= <675567585@qq.com> Date: Thu, 4 Apr 2024 12:13:08 +0800 Subject: [PATCH] r --- packages/handler/package.json | 4 ++-- packages/handler/src/index.ts | 8 ++------ packages/handler/tsconfig.json | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/handler/package.json b/packages/handler/package.json index e9429cc..f2dbe87 100644 --- a/packages/handler/package.json +++ b/packages/handler/package.json @@ -1,6 +1,6 @@ { "name": "@feiyun/handler", - "version": "0.0.24", + "version": "0.0.25", "license": "MIT", "type": "module", "main": "./src/index.ts", @@ -46,7 +46,7 @@ } }, "scripts": { - "build": "rimraf **/dist && tsc && rollup -c", + "build": "rimraf dist types && tsc && rollup -c", "prepublishOnly": "pnpm build" }, "devDependencies": { diff --git a/packages/handler/src/index.ts b/packages/handler/src/index.ts index dbb248d..b4bdef5 100644 --- a/packages/handler/src/index.ts +++ b/packages/handler/src/index.ts @@ -180,12 +180,8 @@ const runHandler = async (handler: any, ctx: Context) => { * @param rule 导入路径规则 * @returns */ -export const include = async (baseDir: string, rule = '**/*.handler.ts'): Promise => { - // const dirs = await readdir(path); - // const files = await findUp(path + '/' + rule); - // console.log(files); - console.log(path.resolve(baseDir, rule)); - const handlerPaths = await glob(path.resolve(baseDir, rule)); +export const include = async (rule = '**/*.handler.ts'): Promise => { + const handlerPaths = await glob(rule); const handlers = []; diff --git a/packages/handler/tsconfig.json b/packages/handler/tsconfig.json index c067635..458fa18 100644 --- a/packages/handler/tsconfig.json +++ b/packages/handler/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "emitDeclarationOnly": true, "noUnusedLocals": false, "noUnusedParameters": false, "noImplicitReturns": false,