also looking at this
chore(deps): update all non-major dependencies
#2997
29 files
+1047
-444
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | import type { ProcessingContext } from './types' |
| 2 | import { extractDeclarations } from './extractor' | |
| 2 | import { extractDeclarations } from './extractor/extract' | |
| 3 | import { scanDeclarations } from './extractor/scanner' | |
| 3 | 4 | import { processDeclarations } from './processor' |
| 4 | 5 | |
| 5 | 6 | /** |
| @@ -21,11 +22,27 @@ export function processSource( | ||
| 21 | 22 | filePath: filename, |
| 22 | 23 | sourceCode, |
| 23 | 24 | declarations, |
| 24 | imports: new Map(), | |
| 25 | exports: new Set(), | |
| 26 | usedTypes: new Set(), | |
| 27 | 25 | } |
| 28 | 26 | |
| 29 | 27 | // Process declarations to generate DTS |
| 30 | 28 | return processDeclarations(declarations, context, keepComments, importOrder) |
| 31 | 29 | } |
| 30 | ||
| 31 | /** | |
| 32 | * Fast path for project mode — skips cache lookup/store. | |
| 33 | * Use when processing many files once (no cache benefit). | |
| 34 | */ | |
| 35 | export function processSourceDirect( | |
| 36 | sourceCode: string, | |
| 37 | filename: string = 'stdin.ts', | |
| 38 | keepComments: boolean = true, | |
| 39 | importOrder: string[] = ['bun'], | |
| 40 | ): string { | |
| 41 | const declarations = scanDeclarations(sourceCode, filename, keepComments) | |
| 42 | const context: ProcessingContext = { | |
| 43 | filePath: filename, | |
| 44 | sourceCode, | |
| 45 | declarations, | |
| 46 | } | |
| 47 | return processDeclarations(declarations, context, keepComments, importOrder) | |
| 48 | } | |