Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 6, 2024
1 parent 36e997b commit 57d017d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions dts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config: DtsGenerationOption = {
outdir: './dist',
keepComments: true,
clean: true,
verbose: false,

// bundle: true,
// minify: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export const config: DtsGenerationConfig = await loadConfig({
keepComments: true,
clean: true,
tsconfigPath: './tsconfig.json',
verbose: false,
},
})
7 changes: 5 additions & 2 deletions src/extract.ts
Original file line number Diff line number Diff line change
@@ -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}`)
Expand Down Expand Up @@ -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}`)
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface DtsGenerationConfig {
keepComments: boolean
clean: boolean
tsconfigPath: string
verbose: boolean
}

/**
Expand Down

0 comments on commit 57d017d

Please sign in to comment.