@dtsx/dtsx 0.0.0-stage → 0.11.37
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-0azm93j9.js +31 -0
- package/dist/chunk-0ke9xh7t.js +4 -0
- package/dist/chunk-1bpv3tck.js +10 -0
- package/dist/chunk-1e10w914.js +18 -0
- package/dist/chunk-1h6ycqza.js +6 -0
- package/dist/chunk-1j6092xz.js +7 -0
- package/dist/chunk-1pz7zxhc.js +3 -0
- package/dist/chunk-25vyhfzh.js +3 -0
- package/dist/chunk-2kwjbk55.js +3 -0
- package/dist/chunk-437g8zz6.js +177 -0
- package/dist/chunk-4f2mwn7p.js +5 -0
- package/dist/chunk-5hyv43ps.js +12 -0
- package/dist/chunk-5n0tfrpc.js +6 -0
- package/dist/chunk-60ssvwc8.js +4 -0
- package/dist/chunk-69dbf6de.js +3 -0
- package/dist/chunk-7610h2tf.js +3 -0
- package/dist/chunk-79nv7twc.js +14 -0
- package/dist/chunk-853ftm92.js +8 -0
- package/dist/chunk-90aptjh6.js +24 -0
- package/dist/chunk-acyj1dev.js +18 -0
- package/dist/chunk-asws39qs.js +31 -0
- package/dist/chunk-aw48mk3t.js +3 -0
- package/dist/chunk-bdxq6500.js +4 -0
- package/dist/chunk-bqabznps.js +7 -0
- package/dist/chunk-cen2t56g.js +3 -0
- package/dist/chunk-ckq8g1ck.js +4 -0
- package/dist/chunk-cs4gwz1k.js +27 -0
- package/dist/chunk-d43bpfk6.js +3 -0
- package/dist/chunk-dfye109x.js +3 -0
- package/dist/chunk-dv5hhg1a.js +3 -0
- package/dist/chunk-ezbp8tss.js +10 -0
- package/dist/chunk-fgbdm1y6.js +6 -0
- package/dist/chunk-fy97syc2.js +3 -0
- package/dist/chunk-g9d5r6a8.js +3 -0
- package/dist/chunk-ggbahdr2.js +4 -0
- package/dist/chunk-gpq2kggq.js +3 -0
- package/dist/chunk-gs7wfk8b.js +2 -0
- package/dist/chunk-gsb3ty07.js +3 -0
- package/dist/chunk-gsv5yc32.js +6 -0
- package/dist/chunk-h7k9wamx.js +3 -0
- package/dist/chunk-j6pfxvy8.js +3 -0
- package/dist/chunk-km8t8gqg.js +3 -0
- package/dist/chunk-knrtwppp.js +102 -0
- package/dist/chunk-m1khpcqb.js +3 -0
- package/dist/chunk-mt9219xc.js +7 -0
- package/dist/chunk-n2nyd0ck.js +3 -0
- package/dist/chunk-n37yj3xv.js +8 -0
- package/dist/chunk-n3p7wedp.js +3 -0
- package/dist/chunk-n6nw7sn2.js +7 -0
- package/dist/chunk-n94729d9.js +3 -0
- package/dist/chunk-nchp0pqa.js +3 -0
- package/dist/chunk-nn9tpxx3.js +3 -0
- package/dist/chunk-p2qz2nk2.js +3 -0
- package/dist/chunk-p7w9ydhe.js +9 -0
- package/dist/chunk-pga5m4wm.js +3 -0
- package/dist/chunk-psrgw9f8.js +19 -0
- package/dist/chunk-py7pj8aj.js +5 -0
- package/dist/chunk-pzedkn7z.js +4 -0
- package/dist/chunk-q0hn0ymb.js +6 -0
- package/dist/chunk-qnf4byak.js +3 -0
- package/dist/chunk-r4s18nn5.js +3 -0
- package/dist/chunk-r4zkf9ag.js +3 -0
- package/dist/chunk-rdzfdjkb.js +7 -0
- package/dist/chunk-rmdwvzgn.js +3 -0
- package/dist/chunk-s0mvstt0.js +3 -0
- package/dist/chunk-s6c98nad.js +29 -0
- package/dist/chunk-sjneg7p7.js +34 -0
- package/dist/chunk-sq34kkhy.js +3 -0
- package/dist/chunk-srg5qhch.js +22 -0
- package/dist/chunk-strqhcqs.js +3 -0
- package/dist/chunk-t1jtn2r0.js +10 -0
- package/dist/chunk-ttc5pr8y.js +37 -0
- package/dist/chunk-v44crx69.js +62 -0
- package/dist/chunk-v6fwy63g.js +3 -0
- package/dist/chunk-vae5wxar.js +3 -0
- package/dist/chunk-vtskg4r2.js +4 -0
- package/dist/chunk-w9av39jy.js +3 -0
- package/dist/chunk-wnk9yjw2.js +3 -0
- package/dist/chunk-wrnz0e76.js +4 -0
- package/dist/chunk-wzcwctba.js +9 -0
- package/dist/chunk-xb92nrsm.js +3 -0
- package/dist/chunk-xr1h3tv2.js +8 -0
- package/dist/chunk-xsf941gw.js +3 -0
- package/dist/chunk-z4mvkazp.js +21 -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,63 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build the source-map directive without embedding the complete marker in
|
|
4
|
+
* dtsx's own bundle, where Bun can mistake a string literal for a real map.
|
|
5
|
+
*/
|
|
6
|
+
export declare function sourceMapCommentPrefix(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Exhaustive check helper for switch statements
|
|
9
|
+
* This function should never be called if all cases are handled
|
|
10
|
+
* TypeScript will error if a case is missing
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertNever(value: never, message?: string): never;
|
|
13
|
+
export declare function writeToFile(filePath: string, content: string, lineEnding?: 'lf' | 'crlf' | 'auto'): Promise<void>;
|
|
14
|
+
export declare function getAllTypeScriptFiles(directory?: string): Promise<string[]>;
|
|
15
|
+
/** Resolve the effective isolatedDeclarations option across a tsconfig hierarchy. */
|
|
16
|
+
export declare function checkIsolatedDeclarationsConfig(options?: Pick<DtsGenerationConfig, 'cwd' | 'tsconfigPath'>): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Validate declaration syntax with the dtsx scanner
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line pickier/no-unused-vars
|
|
21
|
+
export declare function validateDtsContent(content: string, filename: string): ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Simple line-by-line diff between two strings
|
|
24
|
+
* Returns formatted diff output with +/- prefixes
|
|
25
|
+
*/
|
|
26
|
+
export declare function createDiff(oldContent: string, newContent: string, filename: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Generate a simple source map for a declaration file
|
|
29
|
+
* This creates a basic 1:1 mapping since we're doing declaration extraction
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateDeclarationMap(dtsContent: string, dtsFilename: string, sourceFilename: string, sourceContent: string): DeclarationSourceMap;
|
|
32
|
+
/**
|
|
33
|
+
* Add source map URL comment to declaration content
|
|
34
|
+
*/
|
|
35
|
+
export declare function addSourceMapComment(dtsContent: string, mapFilename: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Validation error details
|
|
38
|
+
*/
|
|
39
|
+
export declare interface ValidationError {
|
|
40
|
+
line: number
|
|
41
|
+
column: number
|
|
42
|
+
message: string
|
|
43
|
+
code?: string
|
|
44
|
+
suggestion?: string
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validation result for a .d.ts file
|
|
48
|
+
*/
|
|
49
|
+
export declare interface ValidationResult {
|
|
50
|
+
isValid: boolean
|
|
51
|
+
errors: ValidationError[]
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Source map for declaration files
|
|
55
|
+
*/
|
|
56
|
+
export declare interface DeclarationSourceMap {
|
|
57
|
+
version: 3
|
|
58
|
+
file: string
|
|
59
|
+
sourceRoot: string
|
|
60
|
+
sources: string[]
|
|
61
|
+
sourcesContent: string[]
|
|
62
|
+
mappings: string
|
|
63
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ve,$o,_,si,q,mt,gt,ht,yt}from"../chunk-79nv7twc.js";import"../chunk-n37yj3xv.js";import"../chunk-aw48mk3t.js";import"../chunk-v44crx69.js";import"../chunk-vae5wxar.js";import"../chunk-rmdwvzgn.js";import"../chunk-pzedkn7z.js";import"../chunk-km8t8gqg.js";import"../chunk-dfye109x.js";export{yt as addSourceMapComment,$o as assertNever,q as checkIsolatedDeclarationsConfig,gt as createDiff,ht as generateDeclarationMap,si as getAllTypeScriptFiles,Ve as sourceMapCommentPrefix,mt as validateDtsContent,_ as writeToFile};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Infer identifier aliases and monomorphic local calls before private closure.
|
|
4
|
+
* This models straight-line assignments, not TypeScript's complete control-flow graph.
|
|
5
|
+
*/
|
|
6
|
+
export declare function inferDeclarationValueAliases(source: string, declarations: Declaration[], candidates: ReadonlyMap<string, Declaration>, importedFunctions?: ReadonlySet<string>): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{In}from"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{In as inferDeclarationValueAliases};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/** Check whether a file path points at a Vue SFC. */
|
|
2
|
+
export declare function isVueFile(filePath: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Parse the script blocks of a Vue SFC. Template/style content is ignored —
|
|
5
|
+
* declarations only depend on the component's script.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseVueSfc(source: string): VueSfc;
|
|
8
|
+
/** Return the end of a string/template/comment at `i`, or `i` for normal code. */
|
|
9
|
+
export declare function skipNonCode(text: string, i: number): number;
|
|
10
|
+
/** Replace strings, template literals and comments with spaces, preserving offsets and newlines. */
|
|
11
|
+
export declare function maskNonCode(text: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Find the index of the closer matching the opener at `start`
|
|
14
|
+
* (`text[start]` must be the opener). Returns -1 when unbalanced.
|
|
15
|
+
*/
|
|
16
|
+
export declare function findMatching(text: string, start: number, open: string, close: string): number;
|
|
17
|
+
/** Locate the first `name(...)` / `name<T>(...)` call in `text`. */
|
|
18
|
+
export declare function findMacroCall(text: string, name: string): MacroCall | null;
|
|
19
|
+
/** Map a runtime props option (`{...}` or `[...]`) to a type literal. */
|
|
20
|
+
export declare function mapRuntimeProps(propsText: string): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Remove `defineProps` / `defineEmits` / `defineExpose` / `defineSlots` /
|
|
23
|
+
* `defineOptions`
|
|
24
|
+
* statements (including `withDefaults(defineProps(), ...)` wrappers) from
|
|
25
|
+
* `<script setup>` content. Their type information has already been captured
|
|
26
|
+
* in the synthesized component type; keeping the calls would only add noise
|
|
27
|
+
* the declaration scanner does not need. Macros are only valid as top-level
|
|
28
|
+
* statements, so a statement always starts at the beginning of a line.
|
|
29
|
+
*/
|
|
30
|
+
export declare function stripMacroStatements(content: string): string;
|
|
31
|
+
/** Extract the options object from `export default {...}` / `export default defineComponent({...})`. */
|
|
32
|
+
export declare function extractDefaultExportOptions(script: string): OptionsExtraction;
|
|
33
|
+
/** Pull a named option (`props`, `emits`) out of an options object literal. */
|
|
34
|
+
export declare function getOptionValue(options: string, name: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Drop local value statements (`const count = ref(0)`, `function increment()`)
|
|
37
|
+
* that are not referenced anywhere else. Script-setup bindings are component
|
|
38
|
+
* internals — keeping them would let the declaration pipeline's word-based
|
|
39
|
+
* reference matching pull them into the output whenever a prop or event
|
|
40
|
+
* happens to share their name. Statements whose names appear in the remaining
|
|
41
|
+
* source or in the synthesized component type (e.g. via `typeof sizes`) are
|
|
42
|
+
* kept, as are exported declarations.
|
|
43
|
+
*/
|
|
44
|
+
export declare function filterLocalValueStatements(content: string, componentType: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Remove an inlined interface/alias declaration from script content, unless
|
|
47
|
+
* the name is still referenced elsewhere or the declaration is exported.
|
|
48
|
+
*/
|
|
49
|
+
export declare function removeInlinedDeclaration(content: string, name: string, declText: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Collapse a type expression to a single line. Newlines separating object
|
|
52
|
+
* literal members become `;`, continuation newlines (after an opener, comma,
|
|
53
|
+
* colon, or before a closer, comma, union/intersection bar) become spaces.
|
|
54
|
+
*/
|
|
55
|
+
export declare function collapseTypeText(text: string): string;
|
|
56
|
+
export declare function resolvePropsType(scriptSetup: string | null, script: string | null): PropsResolution | null;
|
|
57
|
+
export declare function resolveEmitsType(scriptSetup: string | null, script: string | null): string | null;
|
|
58
|
+
export declare function resolveExposedType(scriptSetup: string | null, script: string | null): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Transform a Vue SFC into a virtual TypeScript module whose declarations the
|
|
61
|
+
* regular pipeline can emit. Always returns a module — a template-only SFC
|
|
62
|
+
* still gets a bare `DefineComponent` default export.
|
|
63
|
+
*/
|
|
64
|
+
export declare function transformVueSfcToTs(source: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Vue Single-File Component (SFC) support.
|
|
67
|
+
*
|
|
68
|
+
* Parses the `<script>` / `<script setup>` blocks of a `.vue` file and
|
|
69
|
+
* transforms them into a virtual TypeScript module whose default export is a
|
|
70
|
+
* `DefineComponent` typed from:
|
|
71
|
+
* - `defineProps<T>()` generics, runtime `defineProps({...})` objects, or
|
|
72
|
+
* Options-API `props` (including `PropType<T>` casts)
|
|
73
|
+
* - `defineEmits` generics / arrays and Options-API `emits`
|
|
74
|
+
* - `defineExpose({...})` exposed keys
|
|
75
|
+
*
|
|
76
|
+
* The virtual module is fed through the regular declaration pipeline, so every
|
|
77
|
+
* plugin surface (bun, vite, esbuild, tsup, webpack) emits component
|
|
78
|
+
* declarations without knowing anything about Vue.
|
|
79
|
+
*/
|
|
80
|
+
export declare interface VueSfcBlock {
|
|
81
|
+
content: string
|
|
82
|
+
attrs: string
|
|
83
|
+
setup: boolean
|
|
84
|
+
lang: string
|
|
85
|
+
}
|
|
86
|
+
export declare interface VueSfc {
|
|
87
|
+
script: VueSfcBlock | null
|
|
88
|
+
scriptSetup: VueSfcBlock | null
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Compiler-macro extraction (defineProps / defineEmits / defineExpose)
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
export declare interface MacroCall {
|
|
94
|
+
generic: string | null
|
|
95
|
+
arg: string | null
|
|
96
|
+
}
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Options API default-export extraction
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
export declare interface OptionsExtraction {
|
|
101
|
+
options: string | null
|
|
102
|
+
script: string
|
|
103
|
+
passthrough: boolean
|
|
104
|
+
}
|
|
105
|
+
export declare interface PropsResolution {
|
|
106
|
+
type: string
|
|
107
|
+
inlinedLocal?: { name: string, declText: string }
|
|
108
|
+
}
|
package/dist/src/vue.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{R,Yo,vt,St,a,ve,Ke,$t,Et,qe,Je,Ye,kt,Xe,Tt,At,M}from"../chunk-z4mvkazp.js";export{kt as collapseTypeText,Et as extractDefaultExportOptions,Je as filterLocalValueStatements,ve as findMacroCall,a as findMatching,qe as getOptionValue,R as isVueFile,Ke as mapRuntimeProps,St as maskNonCode,Yo as parseVueSfc,Ye as removeInlinedDeclaration,Tt as resolveEmitsType,At as resolveExposedType,Xe as resolvePropsType,vt as skipNonCode,$t as stripMacroStatements,M as transformVueSfcToTs};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a file watcher for .d.ts generation
|
|
4
|
+
*/
|
|
5
|
+
export declare function createWatcher(config: WatchConfig, buildFn: (files?: string[]) => Promise<WatchBuildResult>): Watcher;
|
|
6
|
+
/**
|
|
7
|
+
* Watch and generate .d.ts files
|
|
8
|
+
*/
|
|
9
|
+
export declare function watchAndGenerate(config: DtsGenerationConfig & WatchConfig, generator: (config: DtsGenerationConfig) => Promise<{ filesProcessed: number, errors: string[] }>): Promise<Watcher>;
|
|
10
|
+
/**
|
|
11
|
+
* Format watch build result for display
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatWatchResult(result: WatchBuildResult): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a simple console logger for watch mode
|
|
16
|
+
*/
|
|
17
|
+
export declare function createWatchLogger(): {
|
|
18
|
+
onChange: (event: WatchEvent) => void
|
|
19
|
+
onBuildStart: () => void
|
|
20
|
+
onBuildComplete: (result: WatchBuildResult) => void
|
|
21
|
+
onError: (error: Error) => void
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Watch configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare interface WatchConfig {
|
|
27
|
+
root: string
|
|
28
|
+
include?: string[]
|
|
29
|
+
exclude?: string[]
|
|
30
|
+
debounce?: number
|
|
31
|
+
initialBuild?: boolean
|
|
32
|
+
clearScreen?: boolean
|
|
33
|
+
onChange?: (event: WatchEvent) => void | Promise<void>
|
|
34
|
+
onBuildStart?: () => void | Promise<void>
|
|
35
|
+
onBuildComplete?: (result: WatchBuildResult) => void | Promise<void>
|
|
36
|
+
onError?: (error: Error) => void | Promise<void>
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Watch event
|
|
40
|
+
*/
|
|
41
|
+
export declare interface WatchEvent {
|
|
42
|
+
type: 'add' | 'change' | 'unlink'
|
|
43
|
+
path: string
|
|
44
|
+
relativePath: string
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build result from watch
|
|
48
|
+
*/
|
|
49
|
+
export declare interface WatchBuildResult {
|
|
50
|
+
success: boolean
|
|
51
|
+
duration: number
|
|
52
|
+
filesProcessed: number
|
|
53
|
+
errors: string[]
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Watcher instance
|
|
57
|
+
*/
|
|
58
|
+
export declare interface Watcher {
|
|
59
|
+
start: () => Promise<void>
|
|
60
|
+
stop: () => void
|
|
61
|
+
rebuild: () => Promise<WatchBuildResult>
|
|
62
|
+
isWatching: () => boolean
|
|
63
|
+
getWatchedFiles: () => string[]
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"../chunk-pga5m4wm.js";import"../chunk-z4mvkazp.js";import"../chunk-mt9219xc.js";import"../chunk-zq93f8ca.js";import"../chunk-1j6092xz.js";import"../chunk-v6fwy63g.js";import"../chunk-cen2t56g.js";import"../chunk-2kwjbk55.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-gsb3ty07.js";import"../chunk-69dbf6de.js";import"../chunk-rdzfdjkb.js";import"../chunk-90aptjh6.js";import"../chunk-xr1h3tv2.js";import"../chunk-s6c98nad.js";import"../chunk-ttc5pr8y.js";import"../chunk-gpq2kggq.js";import"../chunk-wnk9yjw2.js";import"../chunk-g9d5r6a8.js";import"../chunk-25vyhfzh.js";import"../chunk-1pz7zxhc.js";import{r}from"../chunk-qnf4byak.js";import"../chunk-60ssvwc8.js";import"../chunk-vtskg4r2.js";import{l}from"../chunk-t1jtn2r0.js";import"../chunk-w9av39jy.js";import{Ue}from"../chunk-n94729d9.js";import*as E from"fs";import{parentPort as M}from"worker_threads";var P=typeof Bun<"u"?Bun:null,S=P?null:E,R=Promise.resolve({extractDeclarations:r,processDeclarations:l});async function T(e){let u=Date.now();try{let{extractDeclarations:m,processDeclarations:A}=await R,f=e.config?.keepComments,C=e.config?.isolatedDeclarations,v=e.config?.importOrder;if(e.type==="process-batch"){let{filePaths:o,outPaths:D}=e,p=o?null:e.files||[],d=o?o.length:p.length,w=e.writeOutput===!0,y=w?null:Array(d),c=null,b=e.sources;if(!b&&d>0){let t=Array(d);for(let s=0;s<d;s++){let i=p?p[s]:null,h=i?i.sourceCode:void 0,n=o?o[s]:i.filePath;if(h!=null)t[s]=Promise.resolve(h);else if(P)t[s]=P.file(n).text();else t[s]=Promise.resolve(S.readFileSync(n,"utf-8"))}b=await Promise.all(t)}let x={filePath:"",sourceCode:"",declarations:[]},O=w&&P?Array(d):null,F=!0;for(let t=0;t<d;t++){let s=p?p[t]:null,i=o?o[t]:s.filePath,h=D?D[t]:s?s.outPath:void 0;try{let n=b?b[t]:s?.sourceCode||"",a=null,g=Ue(n,i,f??!0,v??["bun"],C??!1);if(g===null)a=m(n,i,f,C),x.filePath=i,x.sourceCode=n,x.declarations=a,g=A(a,x,f??!0,v);if(w){if(!h)throw Error(`Missing outPath for ${i}`);if(P)O[t]=P.write(h,g);else S.writeFileSync(h,g)}else if(y)y[t]={filePath:i,success:!0,content:g,declarations:a}}catch(n){let a=n&&n.message?n.message:String(n);if(w){if(!c)c=[];c.push({filePath:i,success:!1,error:a})}else if(y)y[t]={filePath:i,success:!1,error:a};F=!1}}if(O)await Promise.all(O);let B=c?.length?`${c[0].filePath}: ${c[0].error||"Worker batch failed"}`:void 0;return{id:e.id,success:F,filePath:e.filePath,batchResults:w?c||void 0:y,error:B,duration:Date.now()-u}}if(e.type==="extract"){let o=m(e.sourceCode,e.filePath,f,C);return{id:e.id,success:!0,filePath:e.filePath,declarations:o,duration:Date.now()-u}}if(e.type==="process"){let o=m(e.sourceCode,e.filePath,f,C),D=A(o,{filePath:e.filePath,sourceCode:e.sourceCode,declarations:o},f??!0,v);return{id:e.id,success:!0,filePath:e.filePath,content:D,declarations:o,duration:Date.now()-u}}throw Error(`Unknown task type: ${e.type}`)}catch(m){return{id:e.id,success:!1,filePath:e.filePath,error:m.message,duration:Date.now()-u}}}M?.on("message",async(e)=>{let u=await T(e);M.postMessage(u)});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Declaration, DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a worker pool with default configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare function createWorkerPool(config?: WorkerPoolConfig): WorkerPool;
|
|
6
|
+
/**
|
|
7
|
+
* Process files in parallel using a temporary worker pool
|
|
8
|
+
*/
|
|
9
|
+
export declare function parallelProcess(files: Array<{ path: string, content: string }>, config?: Partial<DtsGenerationConfig>, poolConfig?: WorkerPoolConfig): Promise<WorkerResult[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Batch files into chunks for processing
|
|
12
|
+
*/
|
|
13
|
+
export declare function batchFiles<T>(files: T[], batchSize: number): T[][];
|
|
14
|
+
/**
|
|
15
|
+
* Calculate optimal batch size based on file count and CPU cores
|
|
16
|
+
*/
|
|
17
|
+
export declare function calculateOptimalBatchSize(fileCount: number, cpuCount?: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* Worker pool configuration
|
|
20
|
+
*/
|
|
21
|
+
export declare interface WorkerPoolConfig {
|
|
22
|
+
maxWorkers?: number
|
|
23
|
+
taskTimeout?: number
|
|
24
|
+
recycleAfter?: number
|
|
25
|
+
idleTimeout?: number
|
|
26
|
+
initialWorkers?: number
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Task to be processed by a worker
|
|
30
|
+
*/
|
|
31
|
+
export declare interface WorkerTask {
|
|
32
|
+
id: string
|
|
33
|
+
type: 'process' | 'extract' | 'transform' | 'process-batch'
|
|
34
|
+
filePath: string
|
|
35
|
+
sourceCode?: string
|
|
36
|
+
files?: Array<{ filePath: string, sourceCode?: string, outPath?: string }>
|
|
37
|
+
filePaths?: string[]
|
|
38
|
+
sources?: string[]
|
|
39
|
+
outPaths?: string[]
|
|
40
|
+
config: Partial<DtsGenerationConfig>
|
|
41
|
+
writeOutput?: boolean
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Result from a worker task
|
|
45
|
+
*/
|
|
46
|
+
export declare interface WorkerBatchResult {
|
|
47
|
+
filePath: string
|
|
48
|
+
success: boolean
|
|
49
|
+
content?: string
|
|
50
|
+
declarations?: Declaration[]
|
|
51
|
+
error?: string
|
|
52
|
+
}
|
|
53
|
+
export declare interface WorkerResult {
|
|
54
|
+
id: string
|
|
55
|
+
success: boolean
|
|
56
|
+
filePath: string
|
|
57
|
+
content?: string
|
|
58
|
+
declarations?: Declaration[]
|
|
59
|
+
batchResults?: WorkerBatchResult[]
|
|
60
|
+
error?: string
|
|
61
|
+
duration: number
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Worker statistics
|
|
65
|
+
*/
|
|
66
|
+
export declare interface WorkerStats {
|
|
67
|
+
totalTasks: number
|
|
68
|
+
completedTasks: number
|
|
69
|
+
failedTasks: number
|
|
70
|
+
averageDuration: number
|
|
71
|
+
activeWorkers: number
|
|
72
|
+
idleWorkers: number
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Worker pool for parallel processing
|
|
76
|
+
*/
|
|
77
|
+
export declare class WorkerPool {
|
|
78
|
+
private workers;
|
|
79
|
+
private taskQueue;
|
|
80
|
+
private config;
|
|
81
|
+
private stats;
|
|
82
|
+
private isShuttingDown;
|
|
83
|
+
private idleCheckInterval;
|
|
84
|
+
constructor(config?: WorkerPoolConfig);
|
|
85
|
+
init(): Promise<void>;
|
|
86
|
+
private createWorker;
|
|
87
|
+
private handleWorkerResult;
|
|
88
|
+
private handleWorkerError;
|
|
89
|
+
private removeWorker;
|
|
90
|
+
private recycleWorker;
|
|
91
|
+
private checkIdleWorkers;
|
|
92
|
+
private processQueue;
|
|
93
|
+
submit(task: WorkerTask): Promise<WorkerResult>;
|
|
94
|
+
processFiles(files: Array<{ path: string, content: string }>, config?: Partial<DtsGenerationConfig>): Promise<WorkerResult[]>;
|
|
95
|
+
private updateStats;
|
|
96
|
+
getStats(): WorkerStats;
|
|
97
|
+
shutdown(): Promise<void>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { DtsGenerationConfig, GenerationStats } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Discover workspace projects from TypeScript project references
|
|
4
|
+
*/
|
|
5
|
+
export declare function discoverWorkspaceProjects(rootTsConfig: string): Promise<WorkspaceProject[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Sort projects by their dependencies (topological sort)
|
|
8
|
+
* Projects with no dependencies come first
|
|
9
|
+
*/
|
|
10
|
+
export declare function sortProjectsByDependencies(projects: WorkspaceProject[]): WorkspaceProject[];
|
|
11
|
+
/**
|
|
12
|
+
* Generate declarations for all projects in a workspace
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateWorkspace(config: WorkspaceConfig): Promise<WorkspaceGenerationResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Discover and generate declarations for a monorepo
|
|
17
|
+
* Automatically discovers projects from TypeScript project references
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateMonorepo(rootPath: string, options?: Partial<DtsGenerationConfig>): Promise<WorkspaceGenerationResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Parse workspace patterns from package.json workspaces field
|
|
22
|
+
*/
|
|
23
|
+
export declare function discoverWorkspaceFromPackageJson(rootPath: string): Promise<string[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve workspace patterns to actual project paths
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveWorkspacePatterns(rootPath: string, patterns: string[]): Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Generate declarations for a workspace defined in package.json
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateFromPackageWorkspaces(rootPath: string, options?: Partial<DtsGenerationConfig>): Promise<WorkspaceGenerationResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Workspace project configuration
|
|
34
|
+
*/
|
|
35
|
+
export declare interface WorkspaceProject {
|
|
36
|
+
name: string
|
|
37
|
+
root: string
|
|
38
|
+
tsconfigPath: string
|
|
39
|
+
references: string[]
|
|
40
|
+
config?: Partial<DtsGenerationConfig>
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Workspace configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare interface WorkspaceConfig {
|
|
46
|
+
root: string
|
|
47
|
+
projects: WorkspaceProject[]
|
|
48
|
+
sharedConfig?: Partial<DtsGenerationConfig>
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result of workspace generation
|
|
52
|
+
*/
|
|
53
|
+
export declare interface WorkspaceGenerationResult {
|
|
54
|
+
success: boolean
|
|
55
|
+
projects: Array<{
|
|
56
|
+
name: string
|
|
57
|
+
stats: GenerationStats
|
|
58
|
+
success: boolean
|
|
59
|
+
error?: string
|
|
60
|
+
}>
|
|
61
|
+
durationMs: number
|
|
62
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hr,Kr,nn,oo,qr,Jr,ao}from"../chunk-5n0tfrpc.js";import"../chunk-0azm93j9.js";import"../chunk-psrgw9f8.js";import"../chunk-nn9tpxx3.js";import"../chunk-acyj1dev.js";import"../chunk-wzcwctba.js";import"../chunk-p2qz2nk2.js";import"../chunk-bqabznps.js";import"../chunk-s0mvstt0.js";import"../chunk-79nv7twc.js";import"../chunk-n37yj3xv.js";import"../chunk-aw48mk3t.js";import"../chunk-853ftm92.js";import"../chunk-xb92nrsm.js";import"../chunk-v44crx69.js";import"../chunk-n94729d9.js";import"../chunk-w9av39jy.js";import"../chunk-vae5wxar.js";import"../chunk-t1jtn2r0.js";import"../chunk-60ssvwc8.js";import"../chunk-vtskg4r2.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-ezbp8tss.js";import"../chunk-v6fwy63g.js";import"../chunk-cs4gwz1k.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-d43bpfk6.js";import"../chunk-rmdwvzgn.js";import"../chunk-pzedkn7z.js";import"../chunk-km8t8gqg.js";import"../chunk-dfye109x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{qr as discoverWorkspaceFromPackageJson,Hr as discoverWorkspaceProjects,ao as generateFromPackageWorkspaces,oo as generateMonorepo,nn as generateWorkspace,Jr as resolveWorkspacePatterns,Kr as sortProjectsByDependencies};
|
package/native/README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Native engine libraries
|
|
2
|
+
|
|
3
|
+
Release builds place the native declaration engine for each platform here
|
|
4
|
+
(`<platform>-<arch>/libzig-dtsx.{dylib,so}` or `zig-dtsx.dll`). The SDK loads
|
|
5
|
+
the one for the running platform in-process through Bun FFI and uses its
|
|
6
|
+
TypeScript engine when none applies.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,122 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtsx/dtsx",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"version": "0.11.37",
|
|
6
|
+
"description": "A modern, fast .d.ts generation tool, powered by Bun.",
|
|
7
|
+
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://github.com/stacksjs/dtsx#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/stacksjs/dtsx.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/stacksjs/dtsx/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"dts",
|
|
19
|
+
"generation",
|
|
20
|
+
"isolated declarations",
|
|
21
|
+
"development",
|
|
22
|
+
"bun",
|
|
23
|
+
"stacks",
|
|
24
|
+
"typescript",
|
|
25
|
+
"javascript"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/src/index.d.ts",
|
|
30
|
+
"import": "./dist/src/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./vite": {
|
|
33
|
+
"types": "./dist/src/plugins/vite.d.ts",
|
|
34
|
+
"import": "./dist/src/plugins/vite.js"
|
|
35
|
+
},
|
|
36
|
+
"./esbuild": {
|
|
37
|
+
"types": "./dist/src/plugins/esbuild.d.ts",
|
|
38
|
+
"import": "./dist/src/plugins/esbuild.js"
|
|
39
|
+
},
|
|
40
|
+
"./tsup": {
|
|
41
|
+
"types": "./dist/src/plugins/tsup.d.ts",
|
|
42
|
+
"import": "./dist/src/plugins/tsup.js"
|
|
43
|
+
},
|
|
44
|
+
"./tsdown": {
|
|
45
|
+
"types": "./dist/src/plugins/tsdown.d.ts",
|
|
46
|
+
"import": "./dist/src/plugins/tsdown.js"
|
|
47
|
+
},
|
|
48
|
+
"./webpack": {
|
|
49
|
+
"types": "./dist/src/plugins/webpack.d.ts",
|
|
50
|
+
"import": "./dist/src/plugins/webpack.js"
|
|
51
|
+
},
|
|
52
|
+
"./plugins": {
|
|
53
|
+
"types": "./dist/src/plugins/index.d.ts",
|
|
54
|
+
"import": "./dist/src/plugins/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./checker": {
|
|
57
|
+
"types": "./dist/src/native-checker.d.ts",
|
|
58
|
+
"import": "./dist/src/native-checker.js"
|
|
59
|
+
},
|
|
60
|
+
"./*": {
|
|
61
|
+
"types": "./dist/src/*.d.ts",
|
|
62
|
+
"import": "./dist/src/*.js"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"module": "./dist/src/index.js",
|
|
66
|
+
"types": "./dist/src/index.d.ts",
|
|
67
|
+
"bin": {
|
|
68
|
+
"dtsx": "./dist/bin/cli.js"
|
|
69
|
+
},
|
|
70
|
+
"files": [
|
|
71
|
+
"dist",
|
|
72
|
+
"native"
|
|
73
|
+
],
|
|
74
|
+
"scripts": {
|
|
75
|
+
"benchmark": "bun run benchmark.ts",
|
|
76
|
+
"benchmark:ci": "bun run benchmark.ts --ci --json",
|
|
77
|
+
"benchmark:quick": "bun run benchmark.ts --quick",
|
|
78
|
+
"build": "bun build.ts && bun run compile",
|
|
79
|
+
"compile": "bun build ./bin/cli.ts ./src/worker-thread.ts --compile --splitting --bytecode --external prettier --minify --format=esm --outfile bin/dtsx",
|
|
80
|
+
"compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
|
|
81
|
+
"compile:linux-x64": "bun build ./bin/cli.ts --compile --splitting --bytecode --external prettier --minify --format=esm --target=bun-linux-x64 --outfile bin/dtsx-linux-x64",
|
|
82
|
+
"compile:linux-arm64": "bun build ./bin/cli.ts --compile --splitting --bytecode --external prettier --minify --format=esm --target=bun-linux-arm64 --outfile bin/dtsx-linux-arm64",
|
|
83
|
+
"compile:windows-x64": "bun build ./bin/cli.ts --compile --splitting --bytecode --external prettier --minify --format=esm --target=bun-windows-x64 --outfile bin/dtsx-windows-x64.exe",
|
|
84
|
+
"compile:darwin-x64": "bun build ./bin/cli.ts --compile --splitting --bytecode --external prettier --minify --format=esm --target=bun-darwin-x64 --outfile bin/dtsx-darwin-x64",
|
|
85
|
+
"compile:darwin-arm64": "bun build ./bin/cli.ts --compile --splitting --bytecode --external prettier --minify --format=esm --target=bun-darwin-arm64 --outfile bin/dtsx-darwin-arm64",
|
|
86
|
+
"lint": "bunx --bun pickier run . --mode lint",
|
|
87
|
+
"lint:fix": "bunx --bun pickier run . --mode lint --fix",
|
|
88
|
+
"fresh": "bunx rimraf node_modules/ bun.lock && bun i",
|
|
89
|
+
"changelog": "bunx changelogen --output CHANGELOG.md",
|
|
90
|
+
"prepublishOnly": "bun --bun run build",
|
|
91
|
+
"release": "bun run changelog && bunx bumpp package.json --all",
|
|
92
|
+
"test": "bun test",
|
|
93
|
+
"typecheck": "bunx tsc --noEmit",
|
|
94
|
+
"zip": "bun run zip:all",
|
|
95
|
+
"zip:all": "bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:windows-x64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64",
|
|
96
|
+
"zip:linux-x64": "zip -j bin/dtsx-linux-x64.zip bin/dtsx-linux-x64",
|
|
97
|
+
"zip:linux-arm64": "zip -j bin/dtsx-linux-arm64.zip bin/dtsx-linux-arm64",
|
|
98
|
+
"zip:windows-x64": "zip -j bin/dtsx-windows-x64.zip bin/dtsx-windows-x64.exe",
|
|
99
|
+
"zip:darwin-x64": "zip -j bin/dtsx-darwin-x64.zip bin/dtsx-darwin-x64",
|
|
100
|
+
"zip:darwin-arm64": "zip -j bin/dtsx-darwin-arm64.zip bin/dtsx-darwin-arm64"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@stacksjs/clapp": "^0.2.16",
|
|
104
|
+
"bunfig": "^0.15.21",
|
|
105
|
+
"prettier": "^3.9.10"
|
|
106
|
+
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"prettier": "^3.9.10"
|
|
109
|
+
},
|
|
110
|
+
"peerDependenciesMeta": {
|
|
111
|
+
"prettier": {
|
|
112
|
+
"optional": true
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"git-hooks": {
|
|
116
|
+
"pre-commit": {
|
|
117
|
+
"staged-lint": {
|
|
118
|
+
"*.{js,ts,json,yaml,yml,md}": "bunx --bun pickier run . --mode lint --fix"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|