diff --git a/bun.lockb b/bun.lockb index 0a4d382..c8309ce 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/dts.config.ts b/dts.config.ts index 1bf696f..ed17a96 100644 --- a/dts.config.ts +++ b/dts.config.ts @@ -7,6 +7,7 @@ const config: DtsGenerationOption = { outdir: './dist', keepComments: true, clean: true, + verbose: false, // bundle: true, // minify: true, diff --git a/package.json b/package.json index 9127dd9..9f3f39d 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@stacksjs/development": "^0.67.0", "@stacksjs/eslint-config": "^3.8.1-beta.2", "@types/bun": "^1.1.13", - "bun-config": "^0.1.0", + "bun-config": "^0.1.1", "tinyglobby": "^0.2.10", "vitepress": "^1.4.5" }, diff --git a/src/config.ts b/src/config.ts index 1f66ef7..e3a7e30 100644 --- a/src/config.ts +++ b/src/config.ts @@ -15,5 +15,6 @@ export const config: DtsGenerationConfig = await loadConfig({ keepComments: true, clean: true, tsconfigPath: './tsconfig.json', + verbose: false, }, }) diff --git a/src/extract.ts b/src/extract.ts index bc91c74..d0e581f 100644 --- a/src/extract.ts +++ b/src/extract.ts @@ -1,5 +1,6 @@ /* eslint-disable regexp/no-super-linear-backtracking, no-cond-assign, regexp/no-misleading-capturing-group */ import type { FunctionSignature, ImportTrackingState, ProcessedMethod, ProcessingState } from './types' +import { config } from './config' function cleanParameterTypes(params: string): string { debugLog('params', `Cleaning parameters: ${params}`) @@ -2502,8 +2503,10 @@ function trackValueUsage(content: string, state: ImportTrackingState): void { } function debugLog(category: string, message: string): void { - // eslint-disable-next-line no-console - console.debug(`[dtsx:${category}] ${message}`) + if (config.verbose) { + // eslint-disable-next-line no-console + console.debug(`[dtsx:${category}] ${message}`) + } } /** diff --git a/src/types.ts b/src/types.ts index f76ea4f..299c9cf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,6 +11,7 @@ export interface DtsGenerationConfig { keepComments: boolean clean: boolean tsconfigPath: string + verbose: boolean } /**