diff --git a/bin/cli.ts b/bin/cli.ts index 9d8f83a..d37bdf1 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -15,6 +15,7 @@ const defaultOptions: DtsGenerationConfig = { keepComments: true, clean: false, tsconfigPath: 'tsconfig.json', + verbose: false, } cli @@ -29,7 +30,7 @@ cli .option('--keep-comments', 'Keep comments in generated .d.ts files', { default: defaultOptions.keepComments }) .option('--clean', 'Clean output directory before generation', { default: defaultOptions.clean }) .option('--tsconfig ', 'Path to tsconfig.json', { default: defaultOptions.tsconfigPath }) - // .option('--verbose', 'Enable verbose logging', { default: false }) + .option('--verbose', 'Enable verbose logging', { default: defaultOptions.verbose }) .example('dtsx generate') .example('dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types') .action(async (options: DtsGenerationOption) => { @@ -42,12 +43,9 @@ cli tsconfigPath: resolve(options.tsconfigPath || defaultOptions.tsconfigPath), keepComments: options.keepComments || defaultOptions.keepComments, clean: options.clean || defaultOptions.clean, + verbose: options.verbose || defaultOptions.verbose, } - // if (options.verbose) { - // console.log('Using options:', mergedOptions) - // } - await generate(config) } catch (error) { diff --git a/src/config.ts b/src/config.ts index e3a7e30..f4f8439 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,6 @@ import type { DtsGenerationConfig } from './types' import process from 'node:process' +// @ts-expect-error - types are missing for now import { loadConfig } from 'bun-config' // Get loaded config