@stacksjs/dtsx 0.9.12 → 0.9.14

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.
Files changed (87) hide show
  1. package/README.md +5 -3
  2. package/dist/bin/cli.js +6 -6
  3. package/dist/branded-types.d.ts +10 -18
  4. package/dist/chunk-1bge31tv.js +2 -0
  5. package/dist/chunk-27nzyfdd.js +2 -0
  6. package/dist/chunk-285mqzvx.js +16 -0
  7. package/dist/chunk-2n1bbm2c.js +448 -0
  8. package/dist/chunk-3w5aqasc.js +33 -0
  9. package/dist/chunk-3xqchdwd.js +2 -0
  10. package/dist/chunk-7tyhhk7c.js +2 -0
  11. package/dist/chunk-8kz02py2.js +2 -0
  12. package/dist/{chunk-xe1z54pq.js → chunk-abhx1v3w.js} +1 -1
  13. package/dist/chunk-ayvw3402.js +2 -0
  14. package/dist/chunk-cbz06k9p.js +2 -0
  15. package/dist/chunk-d1xj2pjv.js +24 -0
  16. package/dist/chunk-dk914hsr.js +2 -0
  17. package/dist/chunk-dzgms5s6.js +80 -0
  18. package/dist/{chunk-91gpfz27.js → chunk-enqtx6te.js} +1 -1
  19. package/dist/{chunk-57agx6g8.js → chunk-gssantc8.js} +1 -1
  20. package/dist/chunk-j1zrbs2z.js +2 -0
  21. package/dist/{chunk-20kdv9bh.js → chunk-j8zksbkn.js} +1 -1
  22. package/dist/chunk-mcdb3q06.js +3 -0
  23. package/dist/{chunk-7vj8vtzh.js → chunk-mwfja9e3.js} +1 -1
  24. package/dist/{chunk-jm5ywn4e.js → chunk-mxam9312.js} +8 -8
  25. package/dist/chunk-nf54b52t.js +6 -0
  26. package/dist/{chunk-kge8a5vc.js → chunk-p50ms07x.js} +1 -1
  27. package/dist/{chunk-p09jmjq8.js → chunk-pj8142by.js} +1 -1
  28. package/dist/chunk-pt2txw6z.js +2 -0
  29. package/dist/chunk-r6v1qdqb.js +6 -0
  30. package/dist/chunk-rsv17jh8.js +3 -0
  31. package/dist/{chunk-7cpp6v8f.js → chunk-sw3m29sw.js} +1 -1
  32. package/dist/chunk-thhd43x5.js +19 -0
  33. package/dist/{chunk-3j7r0fxz.js → chunk-tne5n3h1.js} +1 -1
  34. package/dist/{chunk-v96rjx7x.js → chunk-trm0gptj.js} +1 -1
  35. package/dist/{chunk-jddkdjap.js → chunk-vgm83r4p.js} +1 -1
  36. package/dist/chunk-vpjw38x7.js +34 -0
  37. package/dist/chunk-wzq881r8.js +4 -0
  38. package/dist/chunk-x4v9kajr.js +3 -0
  39. package/dist/{chunk-8j312sjx.js → chunk-xmje6xfw.js} +1 -1
  40. package/dist/{chunk-3g2v2ns2.js → chunk-xtee8g1a.js} +1 -1
  41. package/dist/{chunk-fjjs2r77.js → chunk-y6m8mmyg.js} +1 -1
  42. package/dist/{chunk-6qv7p9sg.js → chunk-zf17s33e.js} +18 -11
  43. package/dist/compat.d.ts +5 -2
  44. package/dist/extractor/cache.d.ts +6 -2
  45. package/dist/extractor/directives.d.ts +0 -4
  46. package/dist/generator.d.ts +1 -1
  47. package/dist/logger.d.ts +4 -0
  48. package/dist/optimizer.d.ts +4 -0
  49. package/dist/process-source.d.ts +1 -0
  50. package/dist/processor/cache.d.ts +4 -2
  51. package/dist/processor/imports.d.ts +1 -0
  52. package/dist/src/index.js +52 -51
  53. package/dist/src/plugins/bun.js +1 -1
  54. package/dist/src/plugins/esbuild.js +1 -1
  55. package/dist/src/plugins/index.js +1 -1
  56. package/dist/src/plugins/tsup.js +1 -1
  57. package/dist/src/plugins/vite.js +1 -1
  58. package/dist/src/plugins/webpack.js +1 -1
  59. package/dist/transformers.d.ts +16 -1
  60. package/dist/type-mappings.d.ts +32 -16
  61. package/dist/types.d.ts +2 -0
  62. package/package.json +3 -3
  63. package/dist/chunk-0fhq2wva.js +0 -17
  64. package/dist/chunk-1e5c83wa.js +0 -2
  65. package/dist/chunk-1vc477cq.js +0 -2
  66. package/dist/chunk-2w3g3g00.js +0 -19
  67. package/dist/chunk-5fveksya.js +0 -6
  68. package/dist/chunk-6s7n1gt0.js +0 -2
  69. package/dist/chunk-7p1sfeeg.js +0 -2
  70. package/dist/chunk-8dx98fd5.js +0 -75
  71. package/dist/chunk-97pgeywh.js +0 -33
  72. package/dist/chunk-bzsvvb81.js +0 -2
  73. package/dist/chunk-d9my0n30.js +0 -2
  74. package/dist/chunk-efkpkyz9.js +0 -4
  75. package/dist/chunk-f18nyrrb.js +0 -32
  76. package/dist/chunk-gpxdn99a.js +0 -3
  77. package/dist/chunk-j40mkvfg.js +0 -2
  78. package/dist/chunk-kpp6ajgg.js +0 -2
  79. package/dist/chunk-me2ae6f0.js +0 -23
  80. package/dist/chunk-p1d09y82.js +0 -449
  81. package/dist/chunk-qn0xktfx.js +0 -3
  82. package/dist/chunk-r1m3q3dj.js +0 -2
  83. package/dist/chunk-r1ywapeb.js +0 -6
  84. package/dist/chunk-rw6j20e2.js +0 -3
  85. package/dist/chunk-zsznaama.js +0 -2
  86. package/dist/extractor/extract.d.ts +0 -10
  87. package/dist/extractor/scanner.d.ts +0 -6
package/dist/compat.d.ts CHANGED
@@ -15,11 +15,14 @@ export declare function write(path: string, content: string | Uint8Array | Array
15
15
  */
16
16
  export declare function spawnProcess(command: string | string[], options?: CompatSpawnOptions): SpawnResult;
17
17
  /**
18
- * Read a file as text with cross-runtime compatibility
18
+ * Read a file as text with cross-runtime compatibility.
19
+ * On Node.js we skip the FileHandle wrapper allocation and call readFile directly.
19
20
  */
20
21
  export declare function readTextFile(path: string): Promise<string>;
21
22
  /**
22
- * Check if a file exists with cross-runtime compatibility
23
+ * Check if a file exists with cross-runtime compatibility.
24
+ * On Node.js we go straight to stat() — the FileHandle indirection only
25
+ * mattered for Bun's optimized exists() check.
23
26
  */
24
27
  export declare function fileExists(path: string): Promise<boolean>;
25
28
  /**
@@ -1,8 +1,12 @@
1
1
  import { hashContent } from './hash';
2
2
  import type { SourceFile } from 'typescript';
3
3
  /**
4
- * Evict oldest entry if cache exceeds max size
5
- * Uses O(n) scan instead of O(n log n) sort since we add one entry at a time
4
+ * Evict the oldest entry if the cache exceeds max size.
5
+ *
6
+ * Map preserves insertion order, and the get* helpers below now promote on
7
+ * hit (delete + re-set), so the first key Map yields is always the LRU
8
+ * entry. That gives O(1) eviction — the previous implementation walked the
9
+ * full cache to find the oldest `lastAccess`.
6
10
  */
7
11
  export declare function evictOldestEntries(): void;
8
12
  /**
@@ -1,7 +1,3 @@
1
- /**
2
- * Triple-slash directive extraction — NO TypeScript dependency.
3
- * Pure string processing for maximum startup speed.
4
- */
5
1
  /**
6
2
  * Extract triple-slash directives from source code.
7
3
  * These are special comments like /// <reference types="..." />
@@ -15,4 +15,4 @@ export declare function watch(options?: Partial<DtsGenerationConfig>): Promise<v
15
15
  * Process TypeScript source code from a string (for stdin support)
16
16
  * Re-exported from process-source.ts for backward compatibility
17
17
  */
18
- export { processSource } from './process-source';
18
+ export { clearResultCache, processSource } from './process-source';
package/dist/logger.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Output to appropriate console method
3
+ */
4
+ declare function output(level: LogLevel, prefix: string, args: unknown[]): void;
1
5
  /**
2
6
  * Create a logger instance
3
7
  */
@@ -1,4 +1,8 @@
1
1
  import type { Declaration } from './types';
2
+ /**
3
+ * Sort import declarations
4
+ */
5
+ declare function sortImports(declarations: Declaration[]): Declaration[];
2
6
  /**
3
7
  * Optimize declarations
4
8
  */
@@ -4,6 +4,7 @@
4
4
  * like bun Glob, fs/promises, bundler, cache, config, etc.
5
5
  */
6
6
  export declare function processSource(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[], isolatedDeclarations?: boolean): string;
7
+ export declare function clearResultCache(): void;
7
8
  /**
8
9
  * Fast path for project mode — skips cache lookup/store.
9
10
  * Use when processing many files once (no cache benefit).
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Get or create a cached RegExp for word boundary matching
2
+ * Get or create a cached RegExp for word boundary matching.
3
+ * Promotes the entry on a hit so the FIFO eviction approximates LRU.
3
4
  */
4
5
  export declare function getCachedRegex(pattern: string): RegExp;
5
6
  /**
6
- * Get cached import items or null if not cached
7
+ * Get cached import items or null if not cached.
8
+ * Promotes on hit for LRU-like semantics.
7
9
  */
8
10
  export declare function getImportItemsFromCache(importText: string): string[] | null;
9
11
  /**
@@ -7,6 +7,7 @@ export declare function parseImportStatement(importText: string): {
7
7
  namedItems: string[]
8
8
  source: string
9
9
  isTypeOnly: boolean
10
+ isNamespace: boolean
10
11
  } | null;
11
12
  /**
12
13
  * Extract all imported items from an import statement (with caching)