Skip to content

Commit 77daa03

Browse files
committed
chore: wip
1 parent ea6b0a0 commit 77daa03

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bin/cli.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { CAC } from '@stacksjs/cli'
22
import { version } from '../package.json'
33
import { generate } from '../src/generate'
4-
import type { DtsGenerationOption } from '../src/types'
4+
import type { DtsGenerationOption, DtsGenerationConfig } from '../src/types'
55
import { resolve } from 'node:path'
66

77
const cli = new CAC('dtsx')
88

9-
const defaultOptions: DtsGenerationOption = {
9+
const defaultOptions: DtsGenerationConfig = {
1010
cwd: process.cwd(),
1111
root: './src',
1212
entrypoints: ['**/*.ts'],
@@ -33,21 +33,21 @@ cli
3333
.example('dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types')
3434
.action(async (options: DtsGenerationOption) => {
3535
try {
36-
const mergedOptions: DtsGenerationOption = {
37-
...defaultOptions,
38-
...options,
39-
entrypoints: options.entrypoints ? options.entrypoints.split(',') : defaultOptions.entrypoints,
36+
const config: DtsGenerationConfig = {
37+
entrypoints: options.entrypoints ? options.entrypoints : defaultOptions.entrypoints,
4038
cwd: resolve(options.cwd || defaultOptions.cwd),
4139
root: resolve(options.root || defaultOptions.root),
4240
outdir: resolve(options.outdir || defaultOptions.outdir),
4341
tsconfigPath: resolve(options.tsconfigPath || defaultOptions.tsconfigPath),
42+
keepComments: options.keepComments || defaultOptions.keepComments,
43+
clean: options.clean || defaultOptions.clean,
4444
}
4545

4646
// if (options.verbose) {
4747
// console.log('Using options:', mergedOptions)
4848
// }
4949

50-
await generate(mergedOptions)
50+
await generate(config)
5151
} catch (error) {
5252
console.error('Error generating .d.ts files:', error)
5353
process.exit(1)

0 commit comments

Comments
 (0)