From 08696dedd87437fa2bec045e8647eb63cb4ac36f Mon Sep 17 00:00:00 2001 From: abearxiong Date: Tue, 3 Feb 2026 01:12:23 +0800 Subject: [PATCH] chore: update package version to 0.0.69; modify import statements in loadTS function --- package.json | 2 +- src/auto/load-ts.ts | 10 ++++++---- src/index.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5ac7b2e..4114843 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "@kevisual/router", - "version": "0.0.68", + "version": "0.0.69", "description": "", "type": "module", "main": "./dist/router.js", diff --git a/src/auto/load-ts.ts b/src/auto/load-ts.ts index 71cf1b9..17fe364 100644 --- a/src/auto/load-ts.ts +++ b/src/auto/load-ts.ts @@ -17,9 +17,11 @@ export const getMatchFiles = async (match: string = './*.ts', { cwd = process.cw } if (runtime.isBun) { // Bun 环境下 + const bunPkgs = 'bun'; + const pathPkgs = 'node:path'; // @ts-ignore - const { Glob } = await import('bun'); - const path = await import('path'); + const { Glob } = await import(/*---*/bunPkgs); + const path = await import(/*---*/pathPkgs); // @ts-ignore const glob = new Glob(match, { cwd, absolute: true, onlyFiles: true }); const files: string[] = []; @@ -32,7 +34,7 @@ export const getMatchFiles = async (match: string = './*.ts', { cwd = process.cw return []; }; -export const loadTS = async (match: string = './*.ts', { cwd = process.cwd(), load }: GlobOptions = {}): Promise => { +export const loadTS = async (match: string = './*.ts', { cwd = process?.cwd?.(), load }: GlobOptions = {}): Promise => { const files = await getMatchFiles(match, { cwd }); - return Promise.all(files.map((file) => (load ? load(file) : import(file)))); + return Promise.all(files.map((file) => (load ? load(file) : import(/*---*/file)))); }; diff --git a/src/index.ts b/src/index.ts index 8a355f4..830d0bc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,4 +34,4 @@ export type { OnListener, } from './server/server-type.ts'; -export { loadTS } from './auto/load-ts.ts'; +// export { loadTS } from './auto/load-ts.ts';