@dtsx/dtsx 0.0.0-stage → 0.11.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +442 -2
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +12 -0
- package/dist/chunk-082w7zvy.js +4 -0
- package/dist/chunk-0k0fhq13.js +19 -0
- package/dist/chunk-0rmbc5zp.js +3 -0
- package/dist/chunk-0yg5mcrf.js +3 -0
- package/dist/chunk-0zfzhn19.js +31 -0
- package/dist/chunk-189nn4fc.js +3 -0
- package/dist/chunk-1j6092xz.js +7 -0
- package/dist/chunk-1qtghb2x.js +3 -0
- package/dist/chunk-2436cnmb.js +3 -0
- package/dist/chunk-2qd3axyx.js +5 -0
- package/dist/chunk-32qexm3w.js +3 -0
- package/dist/chunk-3fbt79hx.js +3 -0
- package/dist/chunk-3t57mzvf.js +3 -0
- package/dist/chunk-42j9cfte.js +3 -0
- package/dist/chunk-4fygcxtb.js +4 -0
- package/dist/chunk-50h54rax.js +177 -0
- package/dist/chunk-5hyv43ps.js +12 -0
- package/dist/chunk-6yvk3q1e.js +3 -0
- package/dist/chunk-73dzve1s.js +3 -0
- package/dist/chunk-7tremqhs.js +14 -0
- package/dist/chunk-83qnrx0m.js +7 -0
- package/dist/chunk-88gwzbew.js +4 -0
- package/dist/chunk-8d3sdkv4.js +24 -0
- package/dist/chunk-8tzd98q8.js +22 -0
- package/dist/chunk-96atbsd3.js +3 -0
- package/dist/chunk-9gts9ymh.js +3 -0
- package/dist/chunk-9menejdz.js +3 -0
- package/dist/chunk-a7nvyxpg.js +6 -0
- package/dist/chunk-ag1b6d30.js +3 -0
- package/dist/chunk-asws39qs.js +31 -0
- package/dist/chunk-bnry23ve.js +4 -0
- package/dist/chunk-bxc2herz.js +9 -0
- package/dist/chunk-cpmqa8kd.js +4 -0
- package/dist/chunk-cv29b4zb.js +7 -0
- package/dist/chunk-cyr45de1.js +8 -0
- package/dist/chunk-d0bazr3p.js +3 -0
- package/dist/chunk-danfamyx.js +3 -0
- package/dist/chunk-davy89dj.js +8 -0
- package/dist/chunk-e29rp5xj.js +7 -0
- package/dist/chunk-eba562w8.js +9 -0
- package/dist/chunk-ebjafajx.js +62 -0
- package/dist/chunk-ft2zk7jx.js +3 -0
- package/dist/chunk-g2120ysy.js +3 -0
- package/dist/chunk-ghfd34r7.js +3 -0
- package/dist/chunk-gspsxc9d.js +34 -0
- package/dist/chunk-h3n6256r.js +3 -0
- package/dist/chunk-hnqm1zb3.js +5 -0
- package/dist/chunk-htgy94y3.js +2 -0
- package/dist/chunk-hv8bx8xx.js +102 -0
- package/dist/chunk-hzn9kmq7.js +3 -0
- package/dist/chunk-ja7bp731.js +3 -0
- package/dist/chunk-jcckwgb9.js +3 -0
- package/dist/chunk-kfk554fj.js +3 -0
- package/dist/chunk-kkshxyex.js +18 -0
- package/dist/chunk-kpbz61yy.js +4 -0
- package/dist/chunk-mkakbjvs.js +3 -0
- package/dist/chunk-mwyjxjqa.js +3 -0
- package/dist/chunk-p023fhce.js +8 -0
- package/dist/chunk-p9vfxn8g.js +3 -0
- package/dist/chunk-pga5m4wm.js +3 -0
- package/dist/chunk-pjqzkgzk.js +6 -0
- package/dist/chunk-qzjzw9p2.js +3 -0
- package/dist/chunk-rbx6q1r0.js +18 -0
- package/dist/chunk-rkstz4w1.js +6 -0
- package/dist/chunk-rz060wxt.js +6 -0
- package/dist/chunk-sd8bywh9.js +21 -0
- package/dist/chunk-sv8h007a.js +3 -0
- package/dist/chunk-t4va49p3.js +10 -0
- package/dist/chunk-tka2m4af.js +7 -0
- package/dist/chunk-v6fwy63g.js +3 -0
- package/dist/chunk-v93389xm.js +3 -0
- package/dist/chunk-vf3ybe5r.js +3 -0
- package/dist/chunk-vkahj2ab.js +10 -0
- package/dist/chunk-wnqg6hem.js +27 -0
- package/dist/chunk-xa6rsd4b.js +29 -0
- package/dist/chunk-xfjfhe9d.js +3 -0
- package/dist/chunk-xwpn40p0.js +6 -0
- package/dist/chunk-y1g6v96c.js +10 -0
- package/dist/chunk-y5k0szq6.js +3 -0
- package/dist/chunk-yay68832.js +3 -0
- package/dist/chunk-yrv6z221.js +3 -0
- package/dist/chunk-yx1jy7fx.js +37 -0
- package/dist/chunk-zgcdx773.js +4 -0
- package/dist/chunk-zk3w5sqv.js +4 -0
- package/dist/chunk-zq93f8ca.js +5 -0
- package/dist/src/augmentation-graph.d.ts +11 -0
- package/dist/src/augmentation-graph.js +2 -0
- package/dist/src/binding-patterns.d.ts +18 -0
- package/dist/src/binding-patterns.js +2 -0
- package/dist/src/branded-types.d.ts +159 -0
- package/dist/src/branded-types.js +2 -0
- package/dist/src/bundle-linker.d.ts +38 -0
- package/dist/src/bundle-linker.js +2 -0
- package/dist/src/bundler.d.ts +55 -0
- package/dist/src/bundler.js +2 -0
- package/dist/src/cache.d.ts +53 -0
- package/dist/src/cache.js +2 -0
- package/dist/src/call-signatures.d.ts +1 -0
- package/dist/src/call-signatures.js +2 -0
- package/dist/src/checker.d.ts +107 -0
- package/dist/src/circular.d.ts +82 -0
- package/dist/src/circular.js +2 -0
- package/dist/src/compat.d.ts +114 -0
- package/dist/src/compat.js +2 -0
- package/dist/src/computed-keys.d.ts +12 -0
- package/dist/src/computed-keys.js +2 -0
- package/dist/src/concurrency.d.ts +4 -0
- package/dist/src/concurrency.js +2 -0
- package/dist/src/config.d.ts +35 -0
- package/dist/src/config.js +2 -0
- package/dist/src/dangling-refs.d.ts +11 -0
- package/dist/src/dangling-refs.js +2 -0
- package/dist/src/declaration-project.d.ts +33 -0
- package/dist/src/declaration-project.js +2 -0
- package/dist/src/declaration-publication.d.ts +15 -0
- package/dist/src/declaration-publication.js +2 -0
- package/dist/src/declaration-references.d.ts +19 -0
- package/dist/src/declaration-references.js +2 -0
- package/dist/src/diff.d.ts +82 -0
- package/dist/src/diff.js +2 -0
- package/dist/src/docs.d.ts +97 -0
- package/dist/src/docs.js +2 -0
- package/dist/src/enum-declarations.d.ts +6 -0
- package/dist/src/enum-declarations.js +2 -0
- package/dist/src/errors.d.ts +113 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/extractor/directives.d.ts +5 -0
- package/dist/src/extractor/directives.js +2 -0
- package/dist/src/extractor/extract.d.ts +10 -0
- package/dist/src/extractor/extract.js +2 -0
- package/dist/src/extractor/hash.d.ts +1 -0
- package/dist/src/extractor/hash.js +2 -0
- package/dist/src/extractor/scanner.d.ts +32 -0
- package/dist/src/extractor/scanner.js +2 -0
- package/dist/src/extractor.d.ts +5 -0
- package/dist/src/extractor.js +2 -0
- package/dist/src/formats.d.ts +50 -0
- package/dist/src/formats.js +2 -0
- package/dist/src/formatter.d.ts +61 -0
- package/dist/src/formatter.js +2 -0
- package/dist/src/function-properties.d.ts +3 -0
- package/dist/src/function-properties.js +2 -0
- package/dist/src/generator.d.ts +18 -0
- package/dist/src/generator.js +2 -0
- package/dist/src/global-types.d.ts +17 -0
- package/dist/src/global-types.js +2 -0
- package/dist/src/import-sorter.d.ts +99 -0
- package/dist/src/import-sorter.js +2 -0
- package/dist/src/incremental.d.ts +103 -0
- package/dist/src/incremental.js +2 -0
- package/dist/src/index.d.ts +62 -0
- package/dist/src/index.js +2 -0
- package/dist/src/inferred-imports.d.ts +4 -0
- package/dist/src/inferred-imports.js +2 -0
- package/dist/src/json-config.d.ts +2 -0
- package/dist/src/json-config.js +2 -0
- package/dist/src/lexical.d.ts +6 -0
- package/dist/src/lexical.js +2 -0
- package/dist/src/logger.d.ts +57 -0
- package/dist/src/logger.js +2 -0
- package/dist/src/lsp.d.ts +333 -0
- package/dist/src/lsp.js +2 -0
- package/dist/src/memory.d.ts +127 -0
- package/dist/src/memory.js +2 -0
- package/dist/src/merger.d.ts +38 -0
- package/dist/src/merger.js +2 -0
- package/dist/src/module-graph.d.ts +70 -0
- package/dist/src/module-graph.js +2 -0
- package/dist/src/module-references.d.ts +30 -0
- package/dist/src/module-references.js +2 -0
- package/dist/src/native-checker.d.ts +55 -0
- package/dist/src/native-checker.js +2 -0
- package/dist/src/native-engine.d.ts +16 -0
- package/dist/src/native-engine.js +2 -0
- package/dist/src/native-extractor.d.ts +9 -0
- package/dist/src/native-extractor.js +2 -0
- package/dist/src/native-generation.d.ts +20 -0
- package/dist/src/native-generation.js +2 -0
- package/dist/src/native-project.d.ts +35 -0
- package/dist/src/native-project.js +2 -0
- package/dist/src/optimizer.d.ts +56 -0
- package/dist/src/optimizer.js +2 -0
- package/dist/src/output-normalizer.d.ts +123 -0
- package/dist/src/output-normalizer.js +2 -0
- package/dist/src/parallel-processor.d.ts +63 -0
- package/dist/src/parallel-processor.js +2 -0
- package/dist/src/parameters.d.ts +5 -0
- package/dist/src/parameters.js +2 -0
- package/dist/src/parser.d.ts +68 -0
- package/dist/src/parser.js +2 -0
- package/dist/src/plugins/bun.d.ts +58 -0
- package/dist/src/plugins/bun.js +2 -0
- package/dist/src/plugins/esbuild.d.ts +63 -0
- package/dist/src/plugins/esbuild.js +2 -0
- package/dist/src/plugins/index.d.ts +16 -0
- package/dist/src/plugins/index.js +2 -0
- package/dist/src/plugins/tsdown.d.ts +30 -0
- package/dist/src/plugins/tsdown.js +2 -0
- package/dist/src/plugins/tsup.d.ts +53 -0
- package/dist/src/plugins/tsup.js +2 -0
- package/dist/src/plugins/vite.d.ts +49 -0
- package/dist/src/plugins/vite.js +2 -0
- package/dist/src/plugins/webpack.d.ts +69 -0
- package/dist/src/plugins/webpack.js +2 -0
- package/dist/src/plugins.d.ts +88 -0
- package/dist/src/plugins.js +2 -0
- package/dist/src/process-source.d.ts +28 -0
- package/dist/src/process-source.js +2 -0
- package/dist/src/processor/cache.d.ts +18 -0
- package/dist/src/processor/cache.js +2 -0
- package/dist/src/processor/comments.d.ts +9 -0
- package/dist/src/processor/comments.js +2 -0
- package/dist/src/processor/declarations.d.ts +37 -0
- package/dist/src/processor/declarations.js +2 -0
- package/dist/src/processor/import-usage.d.ts +6 -0
- package/dist/src/processor/import-usage.js +2 -0
- package/dist/src/processor/imports.d.ts +68 -0
- package/dist/src/processor/imports.js +2 -0
- package/dist/src/processor/index.d.ts +33 -0
- package/dist/src/processor/index.js +2 -0
- package/dist/src/processor/type-inference.d.ts +116 -0
- package/dist/src/processor/type-inference.js +2 -0
- package/dist/src/processor.d.ts +5 -0
- package/dist/src/processor.js +2 -0
- package/dist/src/profiling.d.ts +114 -0
- package/dist/src/profiling.js +2 -0
- package/dist/src/return-type-scope.d.ts +3 -0
- package/dist/src/return-type-scope.js +2 -0
- package/dist/src/security.d.ts +100 -0
- package/dist/src/security.js +2 -0
- package/dist/src/source-cache.d.ts +16 -0
- package/dist/src/source-cache.js +2 -0
- package/dist/src/sourcemap.d.ts +137 -0
- package/dist/src/sourcemap.js +2 -0
- package/dist/src/stx.d.ts +20 -0
- package/dist/src/stx.js +2 -0
- package/dist/src/syntax-validator.d.ts +7 -0
- package/dist/src/syntax-validator.js +2 -0
- package/dist/src/tracking.d.ts +95 -0
- package/dist/src/tracking.js +2 -0
- package/dist/src/transformers.d.ts +188 -0
- package/dist/src/transformers.js +2 -0
- package/dist/src/tree-shaker.d.ts +69 -0
- package/dist/src/tree-shaker.js +2 -0
- package/dist/src/tsconfig.d.ts +8 -0
- package/dist/src/tsconfig.js +2 -0
- package/dist/src/type-mappings.d.ts +145 -0
- package/dist/src/type-mappings.js +2 -0
- package/dist/src/types.d.ts +230 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +63 -0
- package/dist/src/utils.js +2 -0
- package/dist/src/value-inference.d.ts +6 -0
- package/dist/src/value-inference.js +2 -0
- package/dist/src/vue.d.ts +108 -0
- package/dist/src/vue.js +2 -0
- package/dist/src/watcher.d.ts +64 -0
- package/dist/src/watcher.js +2 -0
- package/dist/src/worker-thread.d.ts +1 -0
- package/dist/src/worker-thread.js +2 -0
- package/dist/src/worker.d.ts +98 -0
- package/dist/src/worker.js +2 -0
- package/dist/src/workspace.d.ts +62 -0
- package/dist/src/workspace.js +2 -0
- package/native/README.md +6 -0
- package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
- package/native/darwin-x64/libzig-dtsx.dylib +0 -0
- package/native/freebsd-x64/libzig-dtsx.so +0 -0
- package/native/linux-arm64/libzig-dtsx.so +0 -0
- package/native/linux-x64/libzig-dtsx.so +0 -0
- package/native/windows-x64/zig-dtsx.dll +0 -0
- package/package.json +120 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { batchParseSourceFiles, getPendingParseCount, getSourceFile, getSourceFileAsync, getSourceFileCacheSize, shouldUseAsyncParsing } from './source-cache.js';
|
|
2
|
+
import type { AsyncParseConfig, CachedSourceFile } from './source-cache.js';
|
|
3
|
+
import type { Declaration } from './types.js';
|
|
4
|
+
export type { AsyncParseConfig, CachedSourceFile };
|
|
5
|
+
export declare function clearSourceFileCache(): void;
|
|
6
|
+
export declare function extractDeclarations(sourceCode: string, filePath: string, keepComments?: boolean, isolatedDeclarations?: boolean, importedFunctions?: ReadonlySet<string>): Declaration[];
|
|
7
|
+
export declare function extractDeclarationsAsync(sourceCode: string, filePath: string, keepComments?: boolean, config?: AsyncParseConfig): Promise<Declaration[]>;
|
|
8
|
+
export declare function batchExtractDeclarations(files: Array<{ filePath: string, sourceCode: string, keepComments?: boolean }>, config?: AsyncParseConfig & { concurrency?: number }): Promise<Map<string, Declaration[]>>;
|
|
9
|
+
export { batchParseSourceFiles, getPendingParseCount, getSourceFile, getSourceFileAsync, getSourceFileCacheSize, shouldUseAsyncParsing };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hi,r,$n,yi}from"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import{At,Q,kn,An,Pn,Dn}from"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{yi as batchExtractDeclarations,kn as batchParseSourceFiles,hi as clearSourceFileCache,r as extractDeclarations,$n as extractDeclarationsAsync,Pn as getPendingParseCount,At as getSourceFile,Q as getSourceFileAsync,An as getSourceFileCacheSize,Dn as shouldUseAsyncParsing};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Plan actual source snapshots, emit one checked native batch, then publish its
|
|
4
|
+
* declarations through the shared transaction owner. The caller selects an
|
|
5
|
+
* actual zig-dtsx executable. There is no JS-emitter or legacy-binary fallback.
|
|
6
|
+
*/
|
|
7
|
+
export declare function generateNativeDeclarationProject(executable: string, options?: NativeProjectOptions, execution?: NativeProjectExecution): Promise<NativeGenerationResult>;
|
|
8
|
+
export declare interface NativeProjectExecution {
|
|
9
|
+
timeoutMs?: number
|
|
10
|
+
signal?: AbortSignal
|
|
11
|
+
}
|
|
12
|
+
export declare interface NativeGenerationResult {
|
|
13
|
+
readonly filesGenerated: number
|
|
14
|
+
readonly outputFiles: readonly string[]
|
|
15
|
+
}
|
|
16
|
+
export type NativeProjectOptions = Partial<Pick<DtsGenerationConfig,
|
|
17
|
+
| 'cwd' | 'root' | 'outdir' | 'entrypoints' | 'include' | 'exclude'
|
|
18
|
+
| 'autoIncludeReExports' | 'outputStructure' | 'tsconfigPath'
|
|
19
|
+
| 'moduleSpecifierMode' | 'keepComments' | 'isolatedDeclarations' | 'clean' | 'lineEnding'
|
|
20
|
+
>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Si}from"../chunk-y5k0szq6.js";import"../chunk-kfk554fj.js";import"../chunk-7tremqhs.js";import"../chunk-danfamyx.js";import"../chunk-p023fhce.js";import"../chunk-6yvk3q1e.js";import"../chunk-96atbsd3.js";import"../chunk-davy89dj.js";import"../chunk-g2120ysy.js";import"../chunk-4fygcxtb.js";import"../chunk-ebjafajx.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Si as generateNativeDeclarationProject};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Snapshot actual sources and resolved references for native emission. This
|
|
4
|
+
* plans intended outputs only; it neither emits nor proves package delivery.
|
|
5
|
+
* No TypeScript declaration emitter or native binding runs during planning.
|
|
6
|
+
*/
|
|
7
|
+
export declare function planNativeDeclarationProject(options?: Partial<DtsGenerationConfig>): Promise<NativeDeclarationProject>;
|
|
8
|
+
/** Versioned data consumed by the native emitter, without a binding dependency. */
|
|
9
|
+
export declare interface NativeSourceEmissionContext {
|
|
10
|
+
version: 1
|
|
11
|
+
moduleSpecifierMode: 'preserve' | 'node'
|
|
12
|
+
sourceFile: string
|
|
13
|
+
outputFile: string
|
|
14
|
+
sourceHash: string
|
|
15
|
+
inferenceSources?: Array<{ specifier: string, source: string }>
|
|
16
|
+
augmentationImports?: string[]
|
|
17
|
+
rewrites: Array<{
|
|
18
|
+
specifier: string
|
|
19
|
+
resolvedSource: string
|
|
20
|
+
declarationOutput: string
|
|
21
|
+
emittedSpecifier: string
|
|
22
|
+
}>
|
|
23
|
+
}
|
|
24
|
+
export declare interface NativeDeclarationFile {
|
|
25
|
+
readonly sourceFile: string
|
|
26
|
+
readonly outputFile: string
|
|
27
|
+
readonly source: string
|
|
28
|
+
readonly context: NativeSourceEmissionContext
|
|
29
|
+
}
|
|
30
|
+
export declare interface NativeDeclarationProject {
|
|
31
|
+
readonly version: 1
|
|
32
|
+
readonly rootPath: string
|
|
33
|
+
readonly outdirPath: string
|
|
34
|
+
readonly files: readonly NativeDeclarationFile[]
|
|
35
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{vn}from"../chunk-96atbsd3.js";import"../chunk-davy89dj.js";import"../chunk-g2120ysy.js";import"../chunk-4fygcxtb.js";import"../chunk-ebjafajx.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{vn as planNativeDeclarationProject};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Optimize declarations
|
|
4
|
+
*/
|
|
5
|
+
export declare function optimizeDeclarations(declarations: Declaration[], config?: OptimizerConfig): { declarations: Declaration[], result: OptimizationResult };
|
|
6
|
+
/**
|
|
7
|
+
* Optimize a .d.ts file
|
|
8
|
+
*/
|
|
9
|
+
export declare function optimizeFile(filePath: string, config?: OptimizerConfig): Promise<OptimizationResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Minify .d.ts content
|
|
12
|
+
*/
|
|
13
|
+
export declare function minifyDts(content: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Optimizer configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare interface OptimizerConfig {
|
|
18
|
+
removeUnusedImports?: boolean
|
|
19
|
+
deduplicateDeclarations?: boolean
|
|
20
|
+
inlineSimpleTypes?: boolean
|
|
21
|
+
removeEmptyInterfaces?: boolean
|
|
22
|
+
mergeInterfaces?: boolean
|
|
23
|
+
sortDeclarations?: boolean
|
|
24
|
+
sortImports?: boolean
|
|
25
|
+
removeComments?: boolean
|
|
26
|
+
minify?: boolean
|
|
27
|
+
treeShake?: boolean
|
|
28
|
+
entryPoints?: string[]
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Optimization result
|
|
32
|
+
*/
|
|
33
|
+
export declare interface OptimizationResult {
|
|
34
|
+
originalSize: number
|
|
35
|
+
optimizedSize: number
|
|
36
|
+
savings: number
|
|
37
|
+
savingsPercent: number
|
|
38
|
+
removedImports: number
|
|
39
|
+
removedDeclarations: number
|
|
40
|
+
mergedInterfaces: number
|
|
41
|
+
inlinedTypes: number
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Type usage tracker for tree shaking
|
|
45
|
+
*/
|
|
46
|
+
declare class _TypeUsageTracker {
|
|
47
|
+
private usedTypes;
|
|
48
|
+
private declaredTypes;
|
|
49
|
+
private typeReferences;
|
|
50
|
+
addDeclaration(decl: Declaration): void;
|
|
51
|
+
addUsage(typeName: string): void;
|
|
52
|
+
addReference(fromType: string, toType: string): void;
|
|
53
|
+
getReachableTypes(): Set<string>;
|
|
54
|
+
isUsed(typeName: string): boolean;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qn,vi,er}from"../chunk-bnry23ve.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{er as minifyDts,Qn as optimizeDeclarations,vi as optimizeFile};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { DeclarationKind } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize output content
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeOutput(content: string, config?: OutputNormalizerConfig): string;
|
|
6
|
+
/**
|
|
7
|
+
* Normalize line endings
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeLineEndings(content: string, style: LineEnding): string;
|
|
10
|
+
/**
|
|
11
|
+
* Detect current line ending style
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectLineEnding(content: string): LineEnding;
|
|
14
|
+
/**
|
|
15
|
+
* Remove trailing whitespace from all lines
|
|
16
|
+
*/
|
|
17
|
+
export declare function removeTrailingWhitespace(content: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize blank lines (limit consecutive blank lines)
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeBlankLines(content: string, max: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Ensure content ends with exactly one newline
|
|
24
|
+
*/
|
|
25
|
+
export declare function ensureTrailingNewline(content: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Normalize indentation
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeIndent(content: string, config: { style?: 'spaces' | 'tabs', size?: number }): string;
|
|
30
|
+
/**
|
|
31
|
+
* Process and organize imports
|
|
32
|
+
*/
|
|
33
|
+
export declare function processImports(content: string, config: ImportGrouping): string;
|
|
34
|
+
/**
|
|
35
|
+
* Order declarations by kind
|
|
36
|
+
*/
|
|
37
|
+
export declare function orderDeclarations(content: string, config: DeclarationOrder): string;
|
|
38
|
+
/**
|
|
39
|
+
* Preserve and format comments
|
|
40
|
+
*/
|
|
41
|
+
export declare function preserveCommentFormatting(content: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Create a configured normalizer
|
|
44
|
+
*/
|
|
45
|
+
export declare function createOutputNormalizer(config?: OutputNormalizerConfig): {
|
|
46
|
+
normalize: (content: string) => string
|
|
47
|
+
normalizeLineEndings: (content: string) => string
|
|
48
|
+
removeTrailingWhitespace: typeof removeTrailingWhitespace
|
|
49
|
+
normalizeBlankLines: (content: string) => string
|
|
50
|
+
ensureTrailingNewline: typeof ensureTrailingNewline
|
|
51
|
+
processImports: (content: string) => string
|
|
52
|
+
orderDeclarations: (content: string) => string
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Default declaration order
|
|
56
|
+
*/
|
|
57
|
+
export declare const DEFAULT_DECLARATION_ORDER: DeclarationKind[];
|
|
58
|
+
/**
|
|
59
|
+
* Default import group order
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_IMPORT_GROUP_ORDER: ImportGroupType[];
|
|
62
|
+
/**
|
|
63
|
+
* Preset configurations
|
|
64
|
+
*/
|
|
65
|
+
export declare const normalizerPresets: {
|
|
66
|
+
/** Default preset - LF, trailing newline, basic cleanup */
|
|
67
|
+
default: unknown;
|
|
68
|
+
/** Minimal preset - just line endings and trailing newline */
|
|
69
|
+
minimal: unknown;
|
|
70
|
+
/** Strict preset - all normalization enabled */
|
|
71
|
+
strict: unknown;
|
|
72
|
+
/** Windows preset - CRLF line endings */
|
|
73
|
+
windows: unknown;
|
|
74
|
+
/** Tabs preset - use tabs for indentation */
|
|
75
|
+
tabs: unknown
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Declaration ordering configuration
|
|
79
|
+
*/
|
|
80
|
+
export declare interface DeclarationOrder {
|
|
81
|
+
kinds?: DeclarationKind[]
|
|
82
|
+
alphabetize?: boolean
|
|
83
|
+
groupExports?: boolean
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Import grouping configuration
|
|
87
|
+
*/
|
|
88
|
+
export declare interface ImportGrouping {
|
|
89
|
+
enabled?: boolean
|
|
90
|
+
groups?: ImportGroupType[]
|
|
91
|
+
separateGroups?: boolean
|
|
92
|
+
alphabetize?: boolean
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Output normalizer configuration
|
|
96
|
+
*/
|
|
97
|
+
export declare interface OutputNormalizerConfig {
|
|
98
|
+
lineEnding?: LineEnding
|
|
99
|
+
trailingNewline?: boolean
|
|
100
|
+
maxBlankLines?: number
|
|
101
|
+
trimTrailingWhitespace?: boolean
|
|
102
|
+
normalizeIndentation?: boolean
|
|
103
|
+
indent?: {
|
|
104
|
+
style?: 'spaces' | 'tabs'
|
|
105
|
+
size?: number
|
|
106
|
+
}
|
|
107
|
+
declarationOrder?: DeclarationOrder
|
|
108
|
+
importGrouping?: ImportGrouping
|
|
109
|
+
preserveComments?: boolean
|
|
110
|
+
insertFinalNewline?: boolean
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Line ending style
|
|
114
|
+
*/
|
|
115
|
+
export type LineEnding = 'lf' | 'crlf' | 'auto';
|
|
116
|
+
export type ImportGroupType = | 'builtin' // node:* modules
|
|
117
|
+
| 'external' // npm packages
|
|
118
|
+
| 'scoped' // @org/* packages
|
|
119
|
+
| 'internal' // @/* or ~/* aliases
|
|
120
|
+
| 'parent' // ../* imports
|
|
121
|
+
| 'sibling' // ./* imports
|
|
122
|
+
| 'index' // . or ./index
|
|
123
|
+
| 'type' // import type;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rn,zr,We,sn,eo,on,an,cn,Hr,ln,un,to,no,ro}from"../chunk-0k0fhq13.js";export{rn as DEFAULT_DECLARATION_ORDER,zr as DEFAULT_IMPORT_GROUP_ORDER,no as createOutputNormalizer,eo as detectLineEnding,cn as ensureTrailingNewline,an as normalizeBlankLines,Hr as normalizeIndent,sn as normalizeLineEndings,We as normalizeOutput,ro as normalizerPresets,un as orderDeclarations,to as preserveCommentFormatting,ln as processImports,on as removeTrailingWhitespace};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build dependency graph from source files
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildProcessingGraph(files: string[], rootDir?: string): Promise<Map<string, ProcessingNode>>;
|
|
6
|
+
/**
|
|
7
|
+
* Process files in parallel respecting dependencies
|
|
8
|
+
*/
|
|
9
|
+
export declare function processInParallel(files: string[], options?: ParallelProcessorConfig): Promise<ParallelProcessingResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Get topological processing order (respects dependencies)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTopologicalOrder(graph: Map<string, ProcessingNode>): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Find files that can be processed independently (no dependencies on other files in the set)
|
|
16
|
+
*/
|
|
17
|
+
export declare function findIndependentFiles(graph: Map<string, ProcessingNode>): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Get processing levels (files at same level can be processed in parallel)
|
|
20
|
+
*/
|
|
21
|
+
export declare function getProcessingLevels(graph: Map<string, ProcessingNode>): string[][];
|
|
22
|
+
/**
|
|
23
|
+
* Analyze graph for parallelization potential
|
|
24
|
+
*/
|
|
25
|
+
export declare function analyzeParallelizationPotential(graph: Map<string, ProcessingNode>): {
|
|
26
|
+
totalFiles: number
|
|
27
|
+
independentFiles: number
|
|
28
|
+
maxParallelism: number
|
|
29
|
+
levels: number
|
|
30
|
+
estimatedSpeedup: number
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Node in the processing dependency graph
|
|
34
|
+
*/
|
|
35
|
+
export declare interface ProcessingNode {
|
|
36
|
+
path: string
|
|
37
|
+
dependencies: Set<string>
|
|
38
|
+
dependents: Set<string>
|
|
39
|
+
state: 'pending' | 'processing' | 'completed' | 'failed'
|
|
40
|
+
result?: string
|
|
41
|
+
error?: Error
|
|
42
|
+
duration?: number
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configuration for parallel processing
|
|
46
|
+
*/
|
|
47
|
+
export declare interface ParallelProcessorConfig {
|
|
48
|
+
maxConcurrency?: number
|
|
49
|
+
rootDir?: string
|
|
50
|
+
config?: Partial<DtsGenerationConfig>
|
|
51
|
+
onProgress?: (completed: number, total: number, current: string) => void
|
|
52
|
+
onError?: (path: string, error: Error) => boolean
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Result of parallel processing
|
|
56
|
+
*/
|
|
57
|
+
export declare interface ParallelProcessingResult {
|
|
58
|
+
success: Map<string, string>
|
|
59
|
+
failed: Map<string, Error>
|
|
60
|
+
totalTimeMs: number
|
|
61
|
+
maxConcurrent: number
|
|
62
|
+
processingOrder: string[]
|
|
63
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ur,Xi,Zi,fr,dr,Qi}from"../chunk-sv8h007a.js";import"../chunk-y1g6v96c.js";import"../chunk-zk3w5sqv.js";import"../chunk-4fygcxtb.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Qi as analyzeParallelizationPotential,ur as buildProcessingGraph,fr as findIndependentFiles,dr as getProcessingLevels,Zi as getTopologicalOrder,Xi as processInParallel};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { tokenizeDeclarationSyntax } from './module-references.js';
|
|
2
|
+
/** A default before a required argument admits undefined, but keeps its position. */
|
|
3
|
+
export declare function normalizeDefaultParameterOrder(parameters: string): string;
|
|
4
|
+
declare type Token = ReturnType<typeof tokenizeDeclarationSyntax>[number];
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare function getNodeText(node: SourceRange, sourceCode: string): string;
|
|
2
|
+
export declare function extractLeadingCommentsFromNode(node: SourceRange): string[];
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use TypeScript AST-based extraction instead
|
|
5
|
+
*/
|
|
6
|
+
export declare function removeLeadingComments(text: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Not used by the extractor, which reads comments while it scans.
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractLeadingComments(source: string, position: number): string[];
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Not commonly used - use inline logic instead
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractTrailingComment(line: string): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use findMatchingBracket from processor/type-inference instead
|
|
17
|
+
*/
|
|
18
|
+
export declare function extractBalancedSymbols(text: string, openSymbol: string, closeSymbol: string): { content: string, rest: string } | null;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use TypeScript AST-based extraction instead
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseFunctionDeclaration(text: string): FunctionSignature | null;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Not used by the extractor, which reads modifiers while it scans.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isExportStatement(line: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Not commonly used
|
|
29
|
+
*/
|
|
30
|
+
export declare function isTypeOnlyExport(line: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use TypeScript AST-based extraction instead
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseVariableDeclaration(text: string): {
|
|
35
|
+
name: string
|
|
36
|
+
kind: 'const' | 'let' | 'var'
|
|
37
|
+
typeAnnotation?: string
|
|
38
|
+
value?: string
|
|
39
|
+
} | null;
|
|
40
|
+
declare interface SourceRange {
|
|
41
|
+
pos?: number
|
|
42
|
+
end?: number
|
|
43
|
+
getText?: () => string
|
|
44
|
+
getFullText?: () => string
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Interface kept for backward compatibility
|
|
48
|
+
*/
|
|
49
|
+
export declare interface FunctionSignature {
|
|
50
|
+
name: string
|
|
51
|
+
generics: string
|
|
52
|
+
parameters: string
|
|
53
|
+
returnType: string
|
|
54
|
+
modifiers: string[]
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Parser utilities - DEPRECATED
|
|
58
|
+
*
|
|
59
|
+
* This module contains legacy string-based parsing utilities.
|
|
60
|
+
* Most functionality has been superseded by TypeScript AST-based extraction
|
|
61
|
+
* in the extractor module.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Use extractor module for AST-based extraction and
|
|
64
|
+
* processor/type-inference for type inference utilities.
|
|
65
|
+
*/
|
|
66
|
+
export { formatComments } from './processor/comments.js';
|
|
67
|
+
// Re-export commonly used utilities from their new locations
|
|
68
|
+
export { findMatchingBracket } from './processor/type-inference.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ls,Ns,Zt,Bs,Ws,Qt,js,_s,Gs,Vs}from"../chunk-hnqm1zb3.js";import{o}from"../chunk-8d3sdkv4.js";import{f}from"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Qt as extractBalancedSymbols,Bs as extractLeadingComments,Ns as extractLeadingCommentsFromNode,Ws as extractTrailingComment,o as findMatchingBracket,f as formatComments,Ls as getNodeText,_s as isExportStatement,Gs as isTypeOnlyExport,js as parseFunctionDeclaration,Vs as parseVariableDeclaration,Zt as removeLeadingComments};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { DtsGenerationConfig, GenerationStats } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a Bun build plugin for dtsx
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // build.ts
|
|
8
|
+
* import { dts } from '@dtsx/dtsx/plugins/bun'
|
|
9
|
+
*
|
|
10
|
+
* await Bun.build({
|
|
11
|
+
* entrypoints: ['./src/index.ts'],
|
|
12
|
+
* outdir: './dist',
|
|
13
|
+
* plugins: [
|
|
14
|
+
* dts({
|
|
15
|
+
* root: './src',
|
|
16
|
+
* outdir: './dist',
|
|
17
|
+
* }),
|
|
18
|
+
* ],
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function dts(options?: BunPluginOptions): BunPlugin;
|
|
23
|
+
/**
|
|
24
|
+
* Alias for dts
|
|
25
|
+
*/
|
|
26
|
+
export declare const bunDts: typeof dts;
|
|
27
|
+
/**
|
|
28
|
+
* Bun plugin options
|
|
29
|
+
*/
|
|
30
|
+
export declare interface BunPluginOptions extends Partial<DtsGenerationConfig> {
|
|
31
|
+
preBuild?: boolean
|
|
32
|
+
postBuild?: boolean
|
|
33
|
+
onGenerated?: (stats: GenerationStats) => void
|
|
34
|
+
onError?: (error: Error) => void
|
|
35
|
+
failOnError?: boolean
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Bun plugin interface
|
|
39
|
+
*/
|
|
40
|
+
declare interface BunPlugin {
|
|
41
|
+
name: string
|
|
42
|
+
setup: (build: BunBuild) => void | Promise<void>
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Bun build interface (minimal type)
|
|
46
|
+
*/
|
|
47
|
+
declare interface BunBuild {
|
|
48
|
+
config: {
|
|
49
|
+
entrypoints: string[]
|
|
50
|
+
outdir?: string
|
|
51
|
+
root?: string
|
|
52
|
+
target?: 'bun' | 'browser' | 'node'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Default export
|
|
57
|
+
*/
|
|
58
|
+
export default dts;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fe,pa,ma}from"../../chunk-ja7bp731.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{pa as bunDts,ma as default,Fe as dts};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { DtsGenerationConfig, GenerationStats } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create an esbuild plugin for dtsx
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // build.ts
|
|
8
|
+
* import { dtsx } from '@dtsx/dtsx/plugins/esbuild'
|
|
9
|
+
* import * as esbuild from 'esbuild'
|
|
10
|
+
*
|
|
11
|
+
* await esbuild.build({
|
|
12
|
+
* entryPoints: ['./src/index.ts'],
|
|
13
|
+
* outdir: './dist',
|
|
14
|
+
* plugins: [
|
|
15
|
+
* dtsx({
|
|
16
|
+
* root: './src',
|
|
17
|
+
* outdir: './dist',
|
|
18
|
+
* }),
|
|
19
|
+
* ],
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function dtsx(options?: EsbuildPluginOptions): EsbuildPlugin;
|
|
24
|
+
/**
|
|
25
|
+
* Alias for dtsx
|
|
26
|
+
*/
|
|
27
|
+
export declare const esbuildDts: typeof dtsx;
|
|
28
|
+
/**
|
|
29
|
+
* Alias matching common naming convention
|
|
30
|
+
*/
|
|
31
|
+
export declare const dts: typeof dtsx;
|
|
32
|
+
/**
|
|
33
|
+
* esbuild plugin options
|
|
34
|
+
*/
|
|
35
|
+
export declare interface EsbuildPluginOptions extends Partial<DtsGenerationConfig> {
|
|
36
|
+
onStart?: boolean
|
|
37
|
+
onEnd?: boolean
|
|
38
|
+
onGenerated?: (stats: GenerationStats) => void
|
|
39
|
+
onError?: (error: Error) => void
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* esbuild plugin interface
|
|
43
|
+
*/
|
|
44
|
+
declare interface EsbuildPlugin {
|
|
45
|
+
name: string
|
|
46
|
+
setup: (build: EsbuildBuild) => void | Promise<void>
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* esbuild build interface (minimal type)
|
|
50
|
+
*/
|
|
51
|
+
declare interface EsbuildBuild {
|
|
52
|
+
onStart: (callback: () => { errors?: Array<{ text: string }> } | Promise<{ errors?: Array<{ text: string }> } | void> | void) => void
|
|
53
|
+
onEnd: (callback: (result: { errors: unknown[] }) => void | Promise<void>) => void
|
|
54
|
+
initialOptions: {
|
|
55
|
+
entryPoints?: string[] | Record<string, string>
|
|
56
|
+
outdir?: string
|
|
57
|
+
outfile?: string
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Default export
|
|
62
|
+
*/
|
|
63
|
+
export default dtsx;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ue,wa,Zn,xa}from"../../chunk-d0bazr3p.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{xa as default,Zn as dts,ue as dtsx,wa as esbuildDts};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build tool plugins for dtsx
|
|
3
|
+
* Re-exports all available build tool integrations
|
|
4
|
+
*/
|
|
5
|
+
// Vite
|
|
6
|
+
export { dts as viteDts, dts as vite, type VitePluginOptions } from './vite.js';
|
|
7
|
+
// Bun
|
|
8
|
+
export { dts as bunDts, dts as bun, type BunPluginOptions } from './bun.js';
|
|
9
|
+
// esbuild
|
|
10
|
+
export { dtsx as esbuildDts, dtsx as esbuild, dts as esbuildPlugin, type EsbuildPluginOptions } from './esbuild.js';
|
|
11
|
+
// tsup
|
|
12
|
+
export { dtsxPlugin as tsupDts, dtsxPlugin as tsup, dts as tsupPlugin, type TsupPluginOptions } from './tsup.js';
|
|
13
|
+
// tsdown
|
|
14
|
+
export { dts as tsdownDts, dts as tsdown, type TsdownDtsOptions, type TsdownDeclarationPlugin } from './tsdown.js';
|
|
15
|
+
// webpack
|
|
16
|
+
export { DtsxWebpackPlugin, dtsxWebpack as webpackDts, dts as webpackPlugin, type WebpackPluginOptions } from './webpack.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"../../chunk-73dzve1s.js";import"../../chunk-pga5m4wm.js";import"../../chunk-sd8bywh9.js";import"../../chunk-83qnrx0m.js";import"../../chunk-zq93f8ca.js";import"../../chunk-1j6092xz.js";import"../../chunk-v6fwy63g.js";import"../../chunk-1qtghb2x.js";import"../../chunk-42j9cfte.js";import"../../chunk-32qexm3w.js";import"../../chunk-ag1b6d30.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-cv29b4zb.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cyr45de1.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-3t57mzvf.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-189nn4fc.js";import"../../chunk-3fbt79hx.js";import"../../chunk-jcckwgb9.js";import"../../chunk-4fygcxtb.js";import"../../chunk-g2120ysy.js";import"../../chunk-yay68832.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-wnqg6hem.js";import"../../chunk-tka2m4af.js";import"../../chunk-ebjafajx.js";import"../../chunk-davy89dj.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-p023fhce.js";import"../../chunk-danfamyx.js";import"../../chunk-7tremqhs.js";import"../../chunk-kfk554fj.js";import"../../chunk-vkahj2ab.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-ghfd34r7.js";import"../../chunk-mkakbjvs.js";import"../../chunk-0k0fhq13.js";import"../../chunk-bxc2herz.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-y1g6v96c.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-0zfzhn19.js";import{Ie}from"../../chunk-mwyjxjqa.js";import{Fe}from"../../chunk-ja7bp731.js";import{ue,Zn}from"../../chunk-d0bazr3p.js";import{le,Yn}from"../../chunk-9menejdz.js";import{nt}from"../../chunk-yrv6z221.js";import{Le,It,Xn}from"../../chunk-v93389xm.js";export{Le as DtsxWebpackPlugin,Fe as bun,Fe as bunDts,ue as esbuild,ue as esbuildDts,Zn as esbuildPlugin,nt as tsdown,nt as tsdownDts,le as tsup,le as tsupDts,Yn as tsupPlugin,Ie as vite,Ie as viteDts,It as webpackDts,Xn as webpackPlugin};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from '../types.js';
|
|
2
|
+
/** Use in tsdown's plugins array. No TypeScript compiler or tsdown runtime import. */
|
|
3
|
+
export declare function dts(options?: TsdownDtsOptions): TsdownDeclarationPlugin;
|
|
4
|
+
declare interface ResolvedBuild {
|
|
5
|
+
cwd?: string
|
|
6
|
+
root: string
|
|
7
|
+
outDir?: string
|
|
8
|
+
format: string
|
|
9
|
+
}
|
|
10
|
+
declare interface OutputFile {
|
|
11
|
+
type: string
|
|
12
|
+
fileName: string
|
|
13
|
+
isEntry?: boolean
|
|
14
|
+
facadeModuleId?: string | null
|
|
15
|
+
}
|
|
16
|
+
/** Structural host contract keeps the core SDK independent of tsdown and Rolldown. */
|
|
17
|
+
export declare interface TsdownDeclarationPlugin {
|
|
18
|
+
name: string
|
|
19
|
+
tsdownConfig: () => { dts: false }
|
|
20
|
+
tsdownConfigResolved: (config: ResolvedBuild) => void
|
|
21
|
+
generateBundle: (
|
|
22
|
+
this: { emitFile: (asset: { type: 'asset', fileName: string, source: string }) => string },
|
|
23
|
+
output: { dir?: string, format?: string },
|
|
24
|
+
bundle: Record<string, OutputFile>,
|
|
25
|
+
) => Promise<void>
|
|
26
|
+
}
|
|
27
|
+
/** Declaration generation options; tsdown owns entries, output names and cleaning. */
|
|
28
|
+
export type TsdownDtsOptions = Omit<Partial<DtsGenerationConfig>,
|
|
29
|
+
'entrypoints' | 'outdir' | 'bundle' | 'bundleOutput' | 'clean' | 'dryRun' | 'outputStructure' | 'declarationMap'>;
|
|
30
|
+
export default dts;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nt,ga}from"../../chunk-yrv6z221.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{ga as default,nt as dts};
|