@hono-filebased-route/core 0.2.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import dts from 'bun-plugin-dts'
2
2
 
3
3
  await Bun.build({
4
- minify: true,
5
- target: 'node',
6
- outdir: './dist',
7
- plugins: [dts()],
8
- entrypoints: ['./index.ts'],
4
+ minify: true,
5
+ target: 'node',
6
+ outdir: './dist',
7
+ plugins: [dts()],
8
+ entrypoints: ['./index.ts'],
9
+ external: ['typescript'],
9
10
  })
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import pino from 'pino';
4
+
3
5
  declare const METHODS: readonly [
4
6
  "GET",
5
7
  "POST"
@@ -8,12 +10,20 @@ export type Method = (typeof METHODS)[number];
8
10
  export type ExportedMethods = {
9
11
  [key in Method]: boolean;
10
12
  };
13
+ export type Config = {
14
+ dir: string;
15
+ output: string;
16
+ write: boolean;
17
+ verbose: boolean;
18
+ externals: string[];
19
+ typescript: boolean;
20
+ };
11
21
  /**
12
22
  * 遍历指定目录并获取所有文件路径
13
23
  * @param dir 要遍历的目录
14
24
  * @returns 目录内所有文件绝对路径的数组
15
25
  */
16
- export declare function getFiles(dir: string): Promise<string[]>;
26
+ export declare function getFiles(dir: string, externals?: string[]): Promise<string[]>;
17
27
  /**
18
28
  * 将文件路径转换为 Hono 路由路径
19
29
  * @param filePath 文件的绝对路径
@@ -27,6 +37,7 @@ export declare function getRoutePath(filePath: string, baseDir: string): string;
27
37
  * @returns 导出的 HTTP 方法对象
28
38
  */
29
39
  export declare function getExportedHttpMethods(filePath: string): ExportedMethods;
30
- export declare function generateRoutesFile(dir?: string, output?: string, write?: boolean): Promise<string>;
40
+ export declare function generateRoutesFile(config?: Partial<Config>): Promise<string>;
41
+ export declare const createLogger: (verbose?: boolean) => pino.Logger<never, boolean>;
31
42
 
32
43
  export {};