svelte-docinfo 0.4.0 → 0.5.0

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/README.md CHANGED
@@ -5,17 +5,17 @@
5
5
  > static analysis for TypeScript and Svelte 📜
6
6
  > [**svelte-docinfo.fuz.dev**](https://svelte-docinfo.fuz.dev/)
7
7
 
8
- **svelte-docinfo** extracts JSON describing the exports
8
+ svelte-docinfo extracts JSON describing the exports
9
9
  of TypeScript and Svelte modules for open-ended use cases
10
10
  like docs, code search, and dev tools.
11
11
  It uses
12
12
  [svelte2tsx](https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx)
13
- and the TypeScript compiler API to resolve types, track exports, and extract semantic details.
13
+ and the TypeScript compiler API to resolve types, track exports+imports, and extract semantic details.
14
14
  It includes a Vite plugin, CLI, and programmatic API
15
15
  in the [npm package](https://www.npmjs.com/package/svelte-docinfo).
16
16
 
17
17
  ```bash
18
- npm install svelte-docinfo -D
18
+ npm i -D svelte-docinfo
19
19
  ```
20
20
 
21
21
  - [Quick start](#quick-start)
@@ -27,11 +27,6 @@ npm install svelte-docinfo -D
27
27
  - [Credits](#credits)
28
28
  - [License](#license)
29
29
 
30
- Dependencies are minimal and the tool's scope is limited to data, not presentation.
31
- The [docs website](https://svelte-docinfo.fuz.dev/docs/api)
32
- for svelte-docinfo is made using itself
33
- and [fuz_ui](https://github.com/fuzdev/fuz_ui) components.
34
-
35
30
  svelte-docinfo is largely inspired by [`sveld`](https://github.com/carbon-design-system/sveld),
36
31
  but instead of AST-only inspection it uses the TypeScript compiler API for richer information,
37
32
  and also analyzes TypeScript modules.
@@ -42,6 +37,11 @@ but you may find gaps and flaws -- please open issues for bugs
42
37
  and [discussions](https://github.com/fuzdev/svelte-docinfo/discussions)
43
38
  for everything else!
44
39
 
40
+ Dependencies are minimal and the tool's scope is limited to data, not presentation.
41
+ The [docs website](https://svelte-docinfo.fuz.dev/docs/api)
42
+ for svelte-docinfo is made using itself
43
+ and [fuz_ui](https://github.com/fuzdev/fuz_ui) components.
44
+
45
45
  **AI disclosure:** the code and docs beyond the intro
46
46
  were mostly written by Claude Code with uneven human guidance.
47
47
  The first release took 5 months of intermittent work and ~500 manual commits.
@@ -174,7 +174,11 @@ All three produce the same JSON shape:
174
174
  }
175
175
  ```
176
176
 
177
- For many more worked examples — source input paired with the exact JSON `svelte-docinfo` emits — browse the [test fixtures](https://github.com/fuzdev/svelte-docinfo/tree/main/src/test/fixtures), where each case sits beside its `expected.json`.
177
+ For examples of source input paired with the exact JSON `svelte-docinfo` emits:
178
+
179
+ - see svelte-docinfo's own source code's extracted JSON at
180
+ [svelte-docinfo.fuz.dev/demo/extraction](https://svelte-docinfo.fuz.dev/demo/extraction)
181
+ - browse the [test fixtures](https://github.com/fuzdev/svelte-docinfo/tree/main/src/test/fixtures)
178
182
 
179
183
  ## Vite plugin
180
184
 
@@ -314,14 +318,19 @@ See the [API docs](https://svelte-docinfo.fuz.dev/docs/api) for the full referen
314
318
  - **Enums**: regular and const, with member values and per-member JSDoc
315
319
  - **Function overloads**: all public overload signatures with per-overload JSDoc
316
320
  - **Dependency graphs**: tracks imports between modules and computes dependents
317
- - **Re-export tracking**: `alsoExportedFrom` arrays, `aliasOf` for renames, `starExports` for `export * from './x'`
321
+ - **Re-export tracking**: `alsoExportedFrom` arrays on canonical declarations plus the forward view `ModuleJson.reExports` (so barrels are self-describing), `aliasOf` for renames, `starExports` for `export * from './x'`, and `externalReExports`/`externalStarExports` for direct re-exports from packages — with `resolveExportSurface()` to combine them all into a module's full export surface using ES star semantics
318
322
  - **Namespace re-exports**: `export * as ns from './x'` synthesized as `kind: 'namespace'`
319
323
  - **Source locations**: file and line for every declaration
320
324
  - **Build-tool agnostic**: works with any source: file system, build pipeline, or in-memory
321
325
  - **Diagnostic collection**: accumulates warnings and errors without halting; `partial: true` flags incomplete declarations
322
326
 
323
- Known gaps: standalone `namespace Foo {}` declarations and decorators are not yet supported. Svelte 4 legacy features (slots, events, context, `$restProps`) are out of scope — Svelte 5 snippets and callback props replace most of them.
324
- [Issues](https://github.com/fuzdev/svelte-docinfo/issues) and
327
+ Known gaps:
328
+
329
+ - context tracking (transitive detection of common patterns seems tractable)
330
+ - standalone `namespace Foo {}` declarations and decorators are not yet supported
331
+ - Svelte 4 legacy features (slots, events, `$restProps`) are out of scope — Svelte 5 snippets and callback props replace most of them
332
+
333
+ [Issues](https://github.com/fuzdev/svelte-docinfo/issues) for bugs and
325
334
  [discussions](https://github.com/fuzdev/svelte-docinfo/discussions) are welcome!
326
335
 
327
336
  ## Documentation
@@ -27,8 +27,7 @@
27
27
  */
28
28
  import ts from 'typescript';
29
29
  import { z } from 'zod';
30
- import { ModuleJson } from './types.js';
31
- import type { ReExportInfo } from './declaration-build.js';
30
+ import { ModuleJson, type ModuleJsonInput } from './types.js';
32
31
  import { Diagnostic } from './diagnostics.js';
33
32
  import type { AnalysisLog } from './log.js';
34
33
  import { type SvelteVirtualFile } from './svelte.js';
@@ -96,6 +95,9 @@ export declare const throwOnDuplicates: OnDuplicatesCallback;
96
95
  * objects without re-running `.parse()` — the inner `modules` and
97
96
  * `diagnostics` arrays are already Zod-validated upstream, and the envelope
98
97
  * schema is the type contract, not a validation gate.
98
+ *
99
+ * See `AnalyzeResultJsonWire` for the serialized input-side shape published on
100
+ * `virtual:svelte-docinfo`.
99
101
  */
100
102
  export declare const AnalyzeResultJson: z.ZodObject<{
101
103
  modules: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1142,6 +1144,20 @@ export declare const AnalyzeResultJson: z.ZodObject<{
1142
1144
  dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
1143
1145
  dependents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1144
1146
  starExports: z.ZodDefault<z.ZodArray<z.ZodString>>;
1147
+ reExports: z.ZodDefault<z.ZodArray<z.ZodObject<{
1148
+ name: z.ZodString;
1149
+ module: z.ZodString;
1150
+ typeOnly: z.ZodDefault<z.ZodBoolean>;
1151
+ sourceLine: z.ZodOptional<z.ZodNumber>;
1152
+ }, z.core.$strict>>>;
1153
+ externalReExports: z.ZodDefault<z.ZodArray<z.ZodObject<{
1154
+ name: z.ZodString;
1155
+ specifier: z.ZodString;
1156
+ originalName: z.ZodOptional<z.ZodString>;
1157
+ typeOnly: z.ZodDefault<z.ZodBoolean>;
1158
+ sourceLine: z.ZodOptional<z.ZodNumber>;
1159
+ }, z.core.$strict>>>;
1160
+ externalStarExports: z.ZodDefault<z.ZodArray<z.ZodString>>;
1145
1161
  partial: z.ZodDefault<z.ZodBoolean>;
1146
1162
  }, z.core.$strict>>>;
1147
1163
  diagnostics: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1319,14 +1335,30 @@ export declare const AnalyzeResultJson: z.ZodObject<{
1319
1335
  }, z.core.$strict>;
1320
1336
  export type AnalyzeResultJson = z.infer<typeof AnalyzeResultJson>;
1321
1337
  /**
1322
- * Result of analyzing a single module.
1338
+ * Serialized wire shape of an analysis result, as published by the Vite plugin
1339
+ * on `virtual:svelte-docinfo` — the input-side counterpart to
1340
+ * `AnalyzeResultJson` (the validated output of `.parse()`).
1341
+ *
1342
+ * The two fields are deliberately asymmetric:
1343
+ *
1344
+ * - `modules` is `ModuleJsonInput` (the `z.input` of `ModuleJson`) because the
1345
+ * plugin runs it through `compactReplacer`, which strips `.default([])`
1346
+ * arrays and `.default(false)` booleans. Default-bearing fields therefore
1347
+ * arrive `undefined`.
1348
+ * - `diagnostics` is the output `Diagnostic` — the plugin serializes it
1349
+ * without the replacer, and `Diagnostic` has no defaults to strip, so the
1350
+ * array is always present and the shape matches runtime exactly.
1323
1351
  *
1324
- * `alsoExportedFrom` on declarations is always empty from this path —
1325
- * cross-module re-export resolution requires all modules.
1352
+ * Consumers restore defaults by parsing through `AnalyzeResultJson`.
1353
+ *
1354
+ * Note this describes the Vite virtual module specifically. The CLI runs the
1355
+ * whole envelope through `compactReplacer`, so its JSON may additionally omit
1356
+ * an empty `diagnostics` array — CLI consumers should parse through
1357
+ * `AnalyzeResultJson` rather than assume this shape.
1326
1358
  */
1327
- export interface ModuleAnalyzeResult {
1328
- module: ModuleJson;
1329
- reExports: Array<ReExportInfo>;
1359
+ export interface AnalyzeResultJsonWire {
1360
+ modules: Array<ModuleJsonInput>;
1361
+ diagnostics: Array<Diagnostic>;
1330
1362
  }
1331
1363
  /**
1332
1364
  * Analyze a single non-Svelte source file and extract module metadata.
@@ -1344,10 +1376,14 @@ export interface ModuleAnalyzeResult {
1344
1376
  *
1345
1377
  * Returns `undefined` when the file is skipped; the diagnostic is added to
1346
1378
  * `diagnostics` so the caller can keep iterating.
1379
+ *
1380
+ * `alsoExportedFrom` on returned declarations is always empty from this path —
1381
+ * cross-module re-export resolution requires all modules (`mergeReExports`
1382
+ * consumes the returned module's `reExports` in phase 2).
1347
1383
  */
1348
1384
  export declare const analyzeModule: (sourceFile: SourceFileInfo & {
1349
1385
  dependents?: ReadonlyArray<string>;
1350
- }, program: ts.Program, options: ModuleSourceOptions, diagnostics: Array<Diagnostic>, log?: AnalysisLog) => ModuleAnalyzeResult | undefined;
1386
+ }, program: ts.Program, options: ModuleSourceOptions, diagnostics: Array<Diagnostic>, log?: AnalysisLog) => ModuleJson | undefined;
1351
1387
  /**
1352
1388
  * Inputs to `analyzeCore`. The caller (one-shot wrapper or session.query)
1353
1389
  * is responsible for normalizing `sourceOptions`, obtaining the program,
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-core.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/analyze-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAiB,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACzE,OAAO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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,GACzB,YAAY,cAAc,GAAG;IAAC,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAC,EACjE,SAAS,EAAE,CAAC,OAAO,EACnB,SAAS,mBAAmB,EAC5B,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,MAAM,WAAW,KACf,UAAU,GAAG,SAgEf,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC3C,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IACpB,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3D,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,GAAG,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,iBAAiB,KAAG,iBA4FvD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,GACpC,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,aAAa,MAAM,KACjB,IAgBF,CAAC"}
@@ -34,7 +34,7 @@ import { analyzeSvelteModule } from './svelte.js';
34
34
  import { stripVirtualSuffix, getComponentName } from './source.js';
35
35
  import { extractPath, extractDependencies } from './source-config.js';
36
36
  import { toPosixPath } from './paths.js';
37
- import { sortModules, findDuplicates, mergeReExports, resolveComponentAliases, } from './postprocess.js';
37
+ import { sortModules, findDuplicates, mergeReExports, resolveComponentAliases, compareStrings, } from './postprocess.js';
38
38
  /**
39
39
  * Convenience `OnDuplicatesCallback` that throws on any duplicate.
40
40
  *
@@ -113,22 +113,46 @@ const dispatchOnDuplicates = (mode, duplicates, log) => {
113
113
  * objects without re-running `.parse()` — the inner `modules` and
114
114
  * `diagnostics` arrays are already Zod-validated upstream, and the envelope
115
115
  * schema is the type contract, not a validation gate.
116
+ *
117
+ * See `AnalyzeResultJsonWire` for the serialized input-side shape published on
118
+ * `virtual:svelte-docinfo`.
116
119
  */
117
120
  export const AnalyzeResultJson = z.strictObject({
118
121
  modules: z.array(ModuleJson).default([]),
119
122
  diagnostics: z.array(Diagnostic).default([]),
120
123
  });
121
- const toModuleAnalyzeResult = (raw) => {
124
+ const toModuleJson = (raw) => {
122
125
  const filtered = raw.declarations.filter((d) => !d.nodocs).map((d) => d.declaration);
123
- const module = ModuleJson.parse({
126
+ // sorted for deterministic, environment-independent output —
127
+ // getExportsOfModule order is a TS implementation detail. Module tie-break
128
+ // because names can collide: a Svelte default-slot re-export re-keys to
129
+ // the component name, which a same-name re-export from another module may
130
+ // also use. The same re-keying can produce exact-duplicate edges
131
+ // (component + same-name script-module export from one file) — deduped on
132
+ // `(name, module)` so those pairs stay unique; the sourceLine tie-break
133
+ // makes the dedup deterministic (smallest line survives)
134
+ const reExports = raw.reExports
135
+ .slice()
136
+ .sort((a, b) => compareStrings(a.name, b.name) ||
137
+ compareStrings(a.module, b.module) ||
138
+ (a.sourceLine ?? 0) - (b.sourceLine ?? 0))
139
+ .filter((r, i, arr) => i === 0 || r.name !== arr[i - 1].name || r.module !== arr[i - 1].module);
140
+ const externalReExports = raw.externalReExports
141
+ .slice()
142
+ .sort((a, b) => compareStrings(a.name, b.name) ||
143
+ compareStrings(a.specifier, b.specifier) ||
144
+ (a.sourceLine ?? 0) - (b.sourceLine ?? 0));
145
+ return ModuleJson.parse({
124
146
  path: raw.path,
125
147
  declarations: filtered,
126
148
  dependencies: raw.dependencies,
127
149
  dependents: raw.dependents,
128
150
  starExports: raw.starExports,
151
+ reExports,
152
+ externalReExports,
153
+ externalStarExports: raw.externalStarExports,
129
154
  ...(raw.moduleComment ? { moduleComment: raw.moduleComment } : {}),
130
155
  });
131
- return { module, reExports: raw.reExports };
132
156
  };
133
157
  // ── Module dispatch ──────────────────────────────────────────────────────────
134
158
  /**
@@ -147,6 +171,10 @@ const toModuleAnalyzeResult = (raw) => {
147
171
  *
148
172
  * Returns `undefined` when the file is skipped; the diagnostic is added to
149
173
  * `diagnostics` so the caller can keep iterating.
174
+ *
175
+ * `alsoExportedFrom` on returned declarations is always empty from this path —
176
+ * cross-module re-export resolution requires all modules (`mergeReExports`
177
+ * consumes the returned module's `reExports` in phase 2).
150
178
  */
151
179
  export const analyzeModule = (sourceFile, program, options, diagnostics, log) => {
152
180
  const checker = program.getTypeChecker();
@@ -188,6 +216,8 @@ export const analyzeModule = (sourceFile, program, options, diagnostics, log) =>
188
216
  dependents,
189
217
  starExports: [],
190
218
  reExports: [],
219
+ externalReExports: [],
220
+ externalStarExports: [],
191
221
  };
192
222
  }
193
223
  else {
@@ -201,7 +231,7 @@ export const analyzeModule = (sourceFile, program, options, diagnostics, log) =>
201
231
  log?.warn(`No analyzer for file: ${sourceFile.id}`);
202
232
  return undefined;
203
233
  }
204
- return toModuleAnalyzeResult(raw);
234
+ return toModuleJson(raw);
205
235
  };
206
236
  /**
207
237
  * Run the two-phase analysis loop on pre-prepared inputs.
@@ -225,8 +255,7 @@ export const analyzeCore = (inputs) => {
225
255
  const checker = program.getTypeChecker();
226
256
  const diagnostics = [];
227
257
  const modules = [];
228
- const collectedReExports = [];
229
- // Phase 1: analyze every module, collect re-exports
258
+ // Phase 1: analyze every module (forward re-export edges land on `ModuleJson.reExports`)
230
259
  for (const sourceFile of sourceFiles) {
231
260
  // Failed-transform Svelte file: synthesize placeholder ModuleJson so
232
261
  // the modules array reflects the full owned set. The originating
@@ -247,30 +276,27 @@ export const analyzeCore = (inputs) => {
247
276
  log?.warn(`Svelte component ${componentName} marked partial (transform failed at ingest)`);
248
277
  continue;
249
278
  }
250
- let result;
279
+ let mod;
251
280
  const virtualFile = svelteVirtualFiles.get(sourceFile.id);
252
281
  if (virtualFile) {
253
282
  const modulePath = extractPath(sourceFile.id, sourceOptions);
254
283
  const raw = analyzeSvelteModule(sourceFile, modulePath, checker, sourceOptions, diagnostics, program, virtualFile);
255
284
  if (raw) {
256
- result = toModuleAnalyzeResult(raw);
285
+ mod = toModuleJson(raw);
257
286
  }
258
287
  else {
259
288
  log?.error(`Svelte module analysis failed: ${sourceFile.id}`);
260
289
  }
261
290
  }
262
291
  else {
263
- result = analyzeModule(sourceFile, program, sourceOptions, diagnostics, log);
292
+ mod = analyzeModule(sourceFile, program, sourceOptions, diagnostics, log);
264
293
  }
265
- if (!result)
294
+ if (!mod)
266
295
  continue;
267
- modules.push(result.module);
268
- for (const reExport of result.reExports) {
269
- collectedReExports.push({ reExportingModule: result.module.path, reExport });
270
- }
296
+ modules.push(mod);
271
297
  }
272
- // Phase 2a: build alsoExportedFrom arrays
273
- mergeReExports(modules, collectedReExports);
298
+ // Phase 2a: build alsoExportedFrom arrays from the modules' forward edges
299
+ mergeReExports(modules);
274
300
  // Phase 2b: fill component-only fields on renamed component aliases —
275
301
  // canonical components are only fully populated after phase 1 finishes.
276
302
  resolveComponentAliases(modules);
@@ -13,23 +13,7 @@
13
13
  * @module
14
14
  */
15
15
  import { z } from 'zod';
16
- import type { DeclarationKind, DeclarationModifier, GenericParamJson, MemberKind, ParameterJson, OverloadJsonInput, ComponentPropJsonInput, Reactivity } from './types.js';
17
- /**
18
- * Information about a same-name re-export.
19
- *
20
- * Collected during phase 1 of analysis and passed to `mergeReExports`
21
- * in phase 2 to build `alsoExportedFrom` arrays on canonical declarations.
22
- */
23
- export interface ReExportInfo {
24
- /**
25
- * Name of the re-exported declaration. `'default'` for default-slot
26
- * re-exports (`export {default} from './x'`) — that's the canonical's
27
- * actual symbol name in the original module.
28
- */
29
- name: string;
30
- /** Module path (relative to `sourceRoot`) where the declaration is originally declared. */
31
- originalModule: string;
32
- }
16
+ import type { DeclarationKind, DeclarationModifier, GenericParamJson, MemberKind, ParameterJson, OverloadJsonInput, ComponentPropJsonInput, Reactivity, ReExportJsonInput, ExternalReExportJsonInput } from './types.js';
33
17
  /**
34
18
  * Permissive type for constructing members incrementally before Zod validation.
35
19
  *
@@ -141,10 +125,23 @@ export interface ModuleExportsAnalysis {
141
125
  moduleComment?: string;
142
126
  /** All exported declarations with `@nodocs` flags — consumer filters based on policy. */
143
127
  declarations: Array<DeclarationAnalysis>;
144
- /** Same-name re-exports (for building `alsoExportedFrom` in post-processing). */
145
- reExports: Array<ReExportInfo>;
128
+ /**
129
+ * Same-name re-exports. Published as `ModuleJson.reExports` and consumed
130
+ * by `mergeReExports` in phase 2 to build `alsoExportedFrom` arrays on
131
+ * canonical declarations. Unsorted here and may contain exact duplicates
132
+ * (Svelte default-slot re-keying) — ordering and dedup are applied at
133
+ * publication in `analyze-core.ts`.
134
+ */
135
+ reExports: Array<ReExportJsonInput>;
146
136
  /** Star exports (`export * from './module'`) — module paths that are fully re-exported. */
147
137
  starExports: Array<string>;
138
+ /**
139
+ * Direct re-exports from external packages. Published as
140
+ * `ModuleJson.externalReExports`; unsorted here, sorted at publication.
141
+ */
142
+ externalReExports: Array<ExternalReExportJsonInput>;
143
+ /** External star exports (`export * from 'pkg'`) — specifiers as written. */
144
+ externalStarExports: Array<string>;
148
145
  }
149
146
  /**
150
147
  * Result of analyzing a module (TypeScript or Svelte).
@@ -1 +1 @@
1
- {"version":3,"file":"declaration-build.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/declaration-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,IAAI,EAAE,MAAM,C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';
13
13
  export type { AnalyzeOptions, AnalyzeFromFilesOptions } from './analyze.js';
14
14
  export { throwOnDuplicates, AnalyzeResultJson } from './analyze-core.js';
15
- export type { OnDuplicates, OnDuplicatesCallback } from './analyze-core.js';
15
+ export type { AnalyzeResultJsonWire, OnDuplicates, OnDuplicatesCallback } from './analyze-core.js';
16
16
  export { createAnalysisSession } from './session.js';
17
17
  export type { AnalysisSession, AnalysisSessionOptions, SetFileOptions, SetFileResult, SetFilesResult, QueryOptions, } from './session.js';
18
18
  export { normalizeResolveImport } from './dep-resolver.js';
19
19
  export type { ImportResolver, ResolveImport, ResolveImportFn } from './dep-resolver.js';
20
- export { DeclarationKind, DeclarationModifier, MemberKind, Reactivity, GenericParamJson, ParameterJson, ComponentPropJson, OverloadJson, FunctionMemberJson, VariableMemberJson, ConstructorMemberJson, MemberJson, FunctionDeclarationJson, ClassDeclarationJson, InterfaceDeclarationJson, TypeDeclarationJson, VariableDeclarationJson, EnumDeclarationJson, ComponentDeclarationJson, SnippetDeclarationJson, NamespaceDeclarationJson, DeclarationJson, ModuleJson, } from './types.js';
20
+ export { DeclarationKind, DeclarationModifier, MemberKind, Reactivity, GenericParamJson, ParameterJson, ComponentPropJson, OverloadJson, FunctionMemberJson, VariableMemberJson, ConstructorMemberJson, MemberJson, FunctionDeclarationJson, ClassDeclarationJson, InterfaceDeclarationJson, TypeDeclarationJson, VariableDeclarationJson, EnumDeclarationJson, ComponentDeclarationJson, SnippetDeclarationJson, NamespaceDeclarationJson, DeclarationJson, ReExportJson, ExternalReExportJson, ModuleJson, } from './types.js';
21
21
  export { getDisplayName, generateImport, compactReplacer, isKind, findTypeReferences, buildTypeReferencePatterns, } from './declaration-helpers.js';
22
22
  export type { SourceFileInfo, AnalyzerType } from './source.js';
23
23
  export { createSourceOptions, DEFAULT_SOURCE_OPTIONS } from './source-config.js';
24
24
  export type { ModuleSourceOptions, SourceOptionsDefaults } from './source-config.js';
25
- export { findDuplicates, mergeReExports, resolveComponentAliases } from './postprocess.js';
26
- export type { DuplicateDeclaration, ReExportEntry } from './postprocess.js';
25
+ export { findDuplicates, mergeReExports, resolveComponentAliases, resolveExportSurface, } from './postprocess.js';
26
+ export type { DuplicateDeclaration, ExportSurface, ExportSurfaceEntry } from './postprocess.js';
27
27
  export { deriveIncludePatterns } from './files.js';
28
28
  export { discoverSourceFiles } from './discovery.js';
29
29
  export type { Discovery, DiscoverSourceFilesOptions, DiscoverSourceFilesResult, } from './discovery.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAC,OAAO,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AACvD,YAAY,EAAC,cAAc,EAAE,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAC,YAAY,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AACnD,YAAY,EACX,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAC,cAAc,EAAE,aAAa,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAItF,OAAO,EACN,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,w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EAAC,MAAM,gBAAgB,CAAC;AACnD,YAAY,EACX,SAAS,EACT,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EACN,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -15,13 +15,13 @@ export { throwOnDuplicates, AnalyzeResultJson } from './analyze-core.js';
15
15
  export { createAnalysisSession } from './session.js';
16
16
  export { normalizeResolveImport } from './dep-resolver.js';
17
17
  // ── Types (Zod schemas + TypeScript interfaces) ─────────────────────────────
18
- export { DeclarationKind, DeclarationModifier, MemberKind, Reactivity, GenericParamJson, ParameterJson, ComponentPropJson, OverloadJson, FunctionMemberJson, VariableMemberJson, ConstructorMemberJson, MemberJson, FunctionDeclarationJson, ClassDeclarationJson, InterfaceDeclarationJson, TypeDeclarationJson, VariableDeclarationJson, EnumDeclarationJson, ComponentDeclarationJson, SnippetDeclarationJson, NamespaceDeclarationJson, DeclarationJson, ModuleJson, } from './types.js';
18
+ export { DeclarationKind, DeclarationModifier, MemberKind, Reactivity, GenericParamJson, ParameterJson, ComponentPropJson, OverloadJson, FunctionMemberJson, VariableMemberJson, ConstructorMemberJson, MemberJson, FunctionDeclarationJson, ClassDeclarationJson, InterfaceDeclarationJson, TypeDeclarationJson, VariableDeclarationJson, EnumDeclarationJson, ComponentDeclarationJson, SnippetDeclarationJson, NamespaceDeclarationJson, DeclarationJson, ReExportJson, ExternalReExportJson, ModuleJson, } from './types.js';
19
19
  // ── Declaration helpers ────────────────────────────────────────────────────
20
20
  export { getDisplayName, generateImport, compactReplacer, isKind, findTypeReferences, buildTypeReferencePatterns, } from './declaration-helpers.js';
21
21
  // ── Source options ──────────────────────────────────────────────────────────
22
22
  export { createSourceOptions, DEFAULT_SOURCE_OPTIONS } from './source-config.js';
23
23
  // ── Post-processing ────────────────────────────────────────────────────────
24
- export { findDuplicates, mergeReExports, resolveComponentAliases } from './postprocess.js';
24
+ export { findDuplicates, mergeReExports, resolveComponentAliases, resolveExportSurface, } from './postprocess.js';
25
25
  // ── File system constants ──────────────────────────────────────────────────
26
26
  export { deriveIncludePatterns } from './files.js';
27
27
  // ── File discovery ──────────────────────────────────────────────────────────