svelte-docinfo 0.4.1 → 0.5.1

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.
@@ -13,7 +13,6 @@
13
13
  * @module
14
14
  */
15
15
  import type { DeclarationJson, ModuleJson } from './types.js';
16
- import type { ReExportInfo } from './declaration-build.js';
17
16
  import type { SourceFileInfo } from './source.js';
18
17
  /**
19
18
  * A duplicate declaration with its full metadata and module path.
@@ -27,6 +26,14 @@ export interface DuplicateDeclaration {
27
26
  /**
28
27
  * Find duplicate declaration names across modules.
29
28
  *
29
+ * A duplicate is two *different things* sharing a name in the flat namespace.
30
+ * Occurrences are compared by canonical identity — `aliasOf` chains are
31
+ * resolved first, so an alias and its canonical (or two aliases of the same
32
+ * canonical) are one thing, not a collision. Documenting a same-name re-export
33
+ * (which synthesizes an alias) or re-exporting a component under its own name
34
+ * (`export {default as Foo} from './Foo.svelte'`) therefore doesn't flag.
35
+ * When a name does flag, all occurrences are reported, aliases included.
36
+ *
30
37
  * Callers can decide how to handle duplicates (throw, warn, ignore).
31
38
  *
32
39
  * @returns `Map` of declaration names to their `DuplicateDeclaration` occurrences (only includes duplicates)
@@ -46,59 +53,63 @@ export interface DuplicateDeclaration {
46
53
  * ```
47
54
  */
48
55
  export declare const findDuplicates: (modules: Array<ModuleJson>) => Map<string, Array<DuplicateDeclaration>>;
56
+ /**
57
+ * Case-insensitive string comparator for deterministic output ordering.
58
+ *
59
+ * Case-folded comparison first (so `Analyze` and `analyze` sort together
60
+ * instead of all uppercase before all lowercase), then a code-unit tiebreak —
61
+ * so equal-ignoring-case strings still compare unequal and the result is an
62
+ * exact total order. Unlike `localeCompare` (host-locale/ICU-dependent, so
63
+ * byte-identical input can serialize in different orders on different
64
+ * machines), both passes use Unicode default mappings only and are
65
+ * environment-independent. All output ordering goes through this comparator —
66
+ * never bare `localeCompare` or default `Array.prototype.sort`.
67
+ */
68
+ export declare const compareStrings: (a: string, b: string) => number;
49
69
  /**
50
70
  * Sort modules alphabetically by path for deterministic output and cleaner diffs.
51
71
  *
72
+ * Case-insensitive order (`compareStrings`) so the output is environment-independent.
73
+ *
52
74
  * @param modules - the modules to sort
53
75
  * @returns a new sorted array (does not mutate input)
54
76
  */
55
77
  export declare const sortModules: (modules: Array<ModuleJson>) => Array<ModuleJson>;
56
78
  /**
57
- * A collected re-export with its source module context.
58
- *
59
- * Used during the two-phase re-export resolution:
60
- * 1. Phase 1: Collect re-exports from each module during analysis
61
- * 2. Phase 2: Group by original module and merge into `alsoExportedFrom`
62
- */
63
- export interface ReExportEntry {
64
- /** The module that re-exports the declaration. */
65
- reExportingModule: string;
66
- /** The re-export info (name and original module). */
67
- reExport: ReExportInfo;
68
- }
69
- /**
70
- * Build `alsoExportedFrom` arrays from collected re-export data.
71
- *
72
- * This function resolves the two-phase re-export problem:
79
+ * Build `alsoExportedFrom` arrays from the modules' forward re-export edges.
73
80
  *
74
- * **Problem**: When module A re-exports from module B, we discover this while
75
- * analyzing A, but need to update B's declarations. However, B may already be
76
- * processed or may be processed later.
77
- *
78
- * **Solution**: Collect all re-exports in phase 1, then merge them in phase 2
79
- * after all modules are analyzed.
81
+ * Each module carries its same-name re-export edges as `ModuleJson.reExports`
82
+ * (collected in phase 1); this phase-2 pass inverts them onto the canonical
83
+ * declarations so both directions of the same fact are queryable. Edges whose
84
+ * canonical module or declaration is absent from `modules` are skipped — the
85
+ * forward entry remains without a back-link (see `ReExportJson` for the
86
+ * presence caveats).
80
87
  *
81
88
  * Component-only fields on renamed component aliases (`props`,
82
89
  * `acceptsChildren`, etc.) are populated separately by `resolveComponentAliases`
83
90
  * — call it after this function. They split because they touch disjoint fields
84
91
  * and have different inputs.
85
92
  *
86
- * @param modules - the modules array with all modules (will be mutated)
87
- * @param collectedReExports - array of re-exports collected during phase 1
88
- * @mutates modules - unions new re-exporters into `declaration.alsoExportedFrom`
93
+ * @param modules - the modules array with all modules (will be mutated).
94
+ * Must be parsed `ModuleJson`s — wire JSON strips empty arrays, so run
95
+ * raw JSON through `AnalyzeResultJson.parse` first or `reExports` may be
96
+ * `undefined`
97
+ * @mutates modules - unions re-exporters into `declaration.alsoExportedFrom`
89
98
  * (deduped + sorted), so a second call with the same inputs is a no-op
90
99
  *
91
100
  * @example
92
101
  * ```ts
93
102
  * // helpers.ts exports: foo, bar
94
- * // index.ts does: export {foo, bar} from './files.js'
103
+ * // index.ts does: export {foo, bar} from './helpers.js'
104
+ * // (so index.ts's ModuleJson carries reExports:
105
+ * // [{name: 'foo', module: 'helpers.ts'}, {name: 'bar', module: 'helpers.ts'}])
95
106
  * //
96
107
  * // After processing:
97
108
  * // - helpers.ts foo declaration gets: alsoExportedFrom: ['index.ts']
98
109
  * // - helpers.ts bar declaration gets: alsoExportedFrom: ['index.ts']
99
110
  * ```
100
111
  */
101
- export declare const mergeReExports: (modules: Array<ModuleJson>, collectedReExports: Array<ReExportEntry>) => void;
112
+ export declare const mergeReExports: (modules: Array<ModuleJson>) => void;
102
113
  /**
103
114
  * Copy props/acceptsChildren/lang/etc. from canonical component declarations
104
115
  * onto synthesized component-aliased declarations.
@@ -142,4 +153,87 @@ export declare const resolveComponentAliases: (modules: Array<ModuleJson>) => vo
142
153
  export declare const computeDependents: (files: ReadonlyArray<SourceFileInfo>) => Array<SourceFileInfo & {
143
154
  dependents?: ReadonlyArray<string>;
144
155
  }>;
156
+ /**
157
+ * One name on a module's resolved export surface.
158
+ */
159
+ export interface ExportSurfaceEntry {
160
+ /**
161
+ * Exported name, in the docinfo model's terms — Svelte components appear
162
+ * under their filename-derived name (the model's convention for default
163
+ * exports of `.svelte` files), not `'default'`.
164
+ */
165
+ name: string;
166
+ /**
167
+ * How the name reaches this module's surface: an own declaration
168
+ * (including synthesized aliases), a same-name re-export edge, a direct
169
+ * external re-export, or projection through `export * from './x'`.
170
+ */
171
+ via: 'declaration' | 'reExport' | 'external' | 'star';
172
+ /** Canonical module path, when known (`undefined` for external entries). */
173
+ module?: string;
174
+ /** The canonical declaration, when present in the analyzed set. */
175
+ declaration?: DeclarationJson;
176
+ /** Package specifier for external entries (as written in the statement). */
177
+ specifier?: string;
178
+ /** Name inside the external package when renamed. */
179
+ originalName?: string;
180
+ /** Type-only re-export — the name is erased at runtime. */
181
+ typeOnly?: boolean;
182
+ /** For star-projected entries: the `starExports` target the name arrived through. */
183
+ starFrom?: string;
184
+ }
185
+ /**
186
+ * A module's resolved export surface — see `resolveExportSurface`.
187
+ */
188
+ export interface ExportSurface {
189
+ /** Surface entries, sorted by `name` (case-insensitive order, `compareStrings`). */
190
+ entries: Array<ExportSurfaceEntry>;
191
+ /**
192
+ * Star targets (own or transitive) absent from the analyzed set — their
193
+ * projected names are unknown, so the surface is incomplete.
194
+ */
195
+ unresolvedStarExports: Array<string>;
196
+ /**
197
+ * External star specifiers reachable from this module (own or transitive)
198
+ * — their projected names are unknowable without analyzing the package.
199
+ */
200
+ externalStarExports: Array<string>;
201
+ }
202
+ /**
203
+ * Resolve a module's full export surface from the analyzed model, applying
204
+ * ES module semantics to star exports.
205
+ *
206
+ * Combines the module's own `declarations` (including synthesized aliases),
207
+ * `reExports` edges, `externalReExports`, and transitively-resolved
208
+ * `starExports` into one deduped, name-sorted list. The ES rules applied to
209
+ * star projection:
210
+ *
211
+ * - explicit exports (declarations, edges, externals) shadow star-projected
212
+ * names
213
+ * - a name projected by two stars that resolve to *different* canonicals is
214
+ * ambiguous and excluded (same canonical through a diamond is included
215
+ * once)
216
+ * - `default` is never star-projected — including canonical Svelte component
217
+ * declarations, which represent their file's default export. (Caveat: a
218
+ * star-projected re-export edge whose canonical is a component is treated
219
+ * as a default-slot re-export and skipped; a `<script module>` const
220
+ * sharing the component's exact name would be skipped with it.)
221
+ *
222
+ * A Position-3 alias and its `reExports` edge are the same fact — the
223
+ * declaration entry wins, inheriting the edge's `typeOnly`.
224
+ *
225
+ * Cyclic star graphs terminate by contributing nothing along the back-edge
226
+ * (an approximation of ES fixpoint resolution — fine in practice). Surfaces
227
+ * resolved inside a cycle are path-relative and not memoized, so sibling
228
+ * star paths resolve independently rather than inheriting them. Star
229
+ * targets missing from `modules` are reported in `unresolvedStarExports`
230
+ * rather than guessed at; `externalStarExports` aggregates external star
231
+ * specifiers reachable from the module, whose names are unknowable.
232
+ *
233
+ * @param modules - the analyzed modules (parsed `ModuleJson`s — run wire
234
+ * JSON through `AnalyzeResultJson.parse` first)
235
+ * @param path - the module to resolve, as a `ModuleJson.path` value
236
+ * @returns the resolved surface, or `null` when `path` isn't in `modules`
237
+ */
238
+ export declare const resolveExportSurface: (modules: Array<ModuleJson>, path: string) => ExportSurface | null;
145
239
  //# sourceMappingURL=postprocess.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postprocess.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/postprocess.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAA2B,eAAe,EAAE,UAAU,EAAC,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAuBhD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,qCAAqC;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc,GAC1B,SAAS,KAAK,CAAC,UAAU,CAAC,KACxB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,CA4BzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,KAAK,CAAC,UAAU,CAAC,KAAG,KAAK,CAAC,UAAU,CAExE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,E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;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,oBAAoB,GAChC,SAAS,KAAK,CAAC,UAAU,CAAC,EAC1B,MAAM,MAAM,KACV,aAAa,GAAG,IA+IlB,CAAC"}
@@ -32,9 +32,56 @@ const posixifyArray = (arr) => {
32
32
  }
33
33
  return changed ?? arr;
34
34
  };
35
+ /**
36
+ * Build the `(module, name)` → declaration lookup used for `aliasOf`-chain
37
+ * walking. Key format: `` `${modulePath}\n${name}` `` — `\n` can't appear in
38
+ * either part.
39
+ */
40
+ const buildDeclarationIndex = (modules) => {
41
+ const byIdentity = new Map();
42
+ for (const mod of modules) {
43
+ for (const declaration of mod.declarations) {
44
+ byIdentity.set(`${mod.path}\n${declaration.name}`, declaration);
45
+ }
46
+ }
47
+ return byIdentity;
48
+ };
49
+ /**
50
+ * Resolve a declaration to its canonical identity. A same-name re-export of
51
+ * an intermediate rename produces an alias pointing at another alias, so a
52
+ * single hop isn't enough — follow the chain through declarations present in
53
+ * the index. The terminal is the declaration *object* when it's in the set
54
+ * (object identity keeps two same-`(module, name)` declarations distinct in
55
+ * pathological inputs), else the dangling `(module, name)` key (two aliases
56
+ * of the same absent canonical still resolve to one identity). The visited
57
+ * set guards malformed cyclic input.
58
+ */
59
+ const resolveCanonicalIdentity = (byIdentity, modulePath, declaration) => {
60
+ let current = declaration;
61
+ const visited = new Set([`${modulePath}\n${declaration.name}`]);
62
+ while (current.aliasOf) {
63
+ const nextKey = `${current.aliasOf.module}\n${current.aliasOf.name}`;
64
+ if (visited.has(nextKey))
65
+ return nextKey;
66
+ visited.add(nextKey);
67
+ const next = byIdentity.get(nextKey);
68
+ if (!next)
69
+ return nextKey;
70
+ current = next;
71
+ }
72
+ return current;
73
+ };
35
74
  /**
36
75
  * Find duplicate declaration names across modules.
37
76
  *
77
+ * A duplicate is two *different things* sharing a name in the flat namespace.
78
+ * Occurrences are compared by canonical identity — `aliasOf` chains are
79
+ * resolved first, so an alias and its canonical (or two aliases of the same
80
+ * canonical) are one thing, not a collision. Documenting a same-name re-export
81
+ * (which synthesizes an alias) or re-exporting a component under its own name
82
+ * (`export {default as Foo} from './Foo.svelte'`) therefore doesn't flag.
83
+ * When a name does flag, all occurrences are reported, aliases included.
84
+ *
38
85
  * Callers can decide how to handle duplicates (throw, warn, ignore).
39
86
  *
40
87
  * @returns `Map` of declaration names to their `DuplicateDeclaration` occurrences (only includes duplicates)
@@ -54,10 +101,13 @@ const posixifyArray = (arr) => {
54
101
  * ```
55
102
  */
56
103
  export const findDuplicates = (modules) => {
104
+ const byIdentity = buildDeclarationIndex(modules);
105
+ const resolveCanonical = (modulePath, declaration) => resolveCanonicalIdentity(byIdentity, modulePath, declaration);
106
+ // Collect declaration names with their canonical identities. The default
107
+ // slot is module-scoped per the JS spec — every module can have its own
108
+ // `'default'` and they don't collide — so skip `name === 'default'`
109
+ // entries from this flat-namespace check.
57
110
  const allOccurrences = new Map();
58
- // Collect declaration names. The default slot is module-scoped per the JS
59
- // spec — every module can have its own `'default'` and they don't collide
60
- // — so skip `name === 'default'` entries from this flat-namespace check.
61
111
  for (const mod of modules) {
62
112
  for (const declaration of mod.declarations) {
63
113
  if (declaration.name === 'default')
@@ -68,74 +118,102 @@ export const findDuplicates = (modules) => {
68
118
  allOccurrences.get(declaration.name).push({
69
119
  declaration,
70
120
  module: mod.path,
121
+ canonical: resolveCanonical(mod.path, declaration),
71
122
  });
72
123
  }
73
124
  }
74
- // Filter to only duplicates
125
+ // A name is duplicated only when its occurrences span >1 canonical identity
75
126
  const duplicates = new Map();
76
127
  for (const [name, occurrences] of allOccurrences) {
77
- if (occurrences.length > 1) {
78
- duplicates.set(name, occurrences);
128
+ const identities = new Set(occurrences.map((o) => o.canonical));
129
+ if (identities.size > 1) {
130
+ duplicates.set(name, occurrences.map(({ declaration, module }) => ({ declaration, module })));
79
131
  }
80
132
  }
81
133
  return duplicates;
82
134
  };
135
+ /**
136
+ * Case-insensitive string comparator for deterministic output ordering.
137
+ *
138
+ * Case-folded comparison first (so `Analyze` and `analyze` sort together
139
+ * instead of all uppercase before all lowercase), then a code-unit tiebreak —
140
+ * so equal-ignoring-case strings still compare unequal and the result is an
141
+ * exact total order. Unlike `localeCompare` (host-locale/ICU-dependent, so
142
+ * byte-identical input can serialize in different orders on different
143
+ * machines), both passes use Unicode default mappings only and are
144
+ * environment-independent. All output ordering goes through this comparator —
145
+ * never bare `localeCompare` or default `Array.prototype.sort`.
146
+ */
147
+ export const compareStrings = (a, b) => {
148
+ const af = a.toLowerCase();
149
+ const bf = b.toLowerCase();
150
+ if (af < bf)
151
+ return -1;
152
+ if (af > bf)
153
+ return 1;
154
+ return a < b ? -1 : a > b ? 1 : 0;
155
+ };
83
156
  /**
84
157
  * Sort modules alphabetically by path for deterministic output and cleaner diffs.
85
158
  *
159
+ * Case-insensitive order (`compareStrings`) so the output is environment-independent.
160
+ *
86
161
  * @param modules - the modules to sort
87
162
  * @returns a new sorted array (does not mutate input)
88
163
  */
89
164
  export const sortModules = (modules) => {
90
- return modules.slice().sort((a, b) => a.path.localeCompare(b.path));
165
+ return modules.slice().sort((a, b) => compareStrings(a.path, b.path));
91
166
  };
92
167
  /**
93
- * Build `alsoExportedFrom` arrays from collected re-export data.
94
- *
95
- * This function resolves the two-phase re-export problem:
168
+ * Build `alsoExportedFrom` arrays from the modules' forward re-export edges.
96
169
  *
97
- * **Problem**: When module A re-exports from module B, we discover this while
98
- * analyzing A, but need to update B's declarations. However, B may already be
99
- * processed or may be processed later.
100
- *
101
- * **Solution**: Collect all re-exports in phase 1, then merge them in phase 2
102
- * after all modules are analyzed.
170
+ * Each module carries its same-name re-export edges as `ModuleJson.reExports`
171
+ * (collected in phase 1); this phase-2 pass inverts them onto the canonical
172
+ * declarations so both directions of the same fact are queryable. Edges whose
173
+ * canonical module or declaration is absent from `modules` are skipped — the
174
+ * forward entry remains without a back-link (see `ReExportJson` for the
175
+ * presence caveats).
103
176
  *
104
177
  * Component-only fields on renamed component aliases (`props`,
105
178
  * `acceptsChildren`, etc.) are populated separately by `resolveComponentAliases`
106
179
  * — call it after this function. They split because they touch disjoint fields
107
180
  * and have different inputs.
108
181
  *
109
- * @param modules - the modules array with all modules (will be mutated)
110
- * @param collectedReExports - array of re-exports collected during phase 1
111
- * @mutates modules - unions new re-exporters into `declaration.alsoExportedFrom`
182
+ * @param modules - the modules array with all modules (will be mutated).
183
+ * Must be parsed `ModuleJson`s — wire JSON strips empty arrays, so run
184
+ * raw JSON through `AnalyzeResultJson.parse` first or `reExports` may be
185
+ * `undefined`
186
+ * @mutates modules - unions re-exporters into `declaration.alsoExportedFrom`
112
187
  * (deduped + sorted), so a second call with the same inputs is a no-op
113
188
  *
114
189
  * @example
115
190
  * ```ts
116
191
  * // helpers.ts exports: foo, bar
117
- * // index.ts does: export {foo, bar} from './files.js'
192
+ * // index.ts does: export {foo, bar} from './helpers.js'
193
+ * // (so index.ts's ModuleJson carries reExports:
194
+ * // [{name: 'foo', module: 'helpers.ts'}, {name: 'bar', module: 'helpers.ts'}])
118
195
  * //
119
196
  * // After processing:
120
197
  * // - helpers.ts foo declaration gets: alsoExportedFrom: ['index.ts']
121
198
  * // - helpers.ts bar declaration gets: alsoExportedFrom: ['index.ts']
122
199
  * ```
123
200
  */
124
- export const mergeReExports = (modules, collectedReExports) => {
125
- // Group re-exports by `(originalModule, name)`. The default slot keys as
201
+ export const mergeReExports = (modules) => {
202
+ // Group edges by `(canonical module, name)`. The default slot keys as
126
203
  // `'default'` like any other name — each module owns its own default slot,
127
204
  // so the per-module map prevents cross-module collisions naturally.
128
205
  const reExportMap = new Map();
129
- for (const { reExportingModule, reExport } of collectedReExports) {
130
- const { name, originalModule } = reExport;
131
- if (!reExportMap.has(originalModule)) {
132
- reExportMap.set(originalModule, new Map());
133
- }
134
- const moduleMap = reExportMap.get(originalModule);
135
- if (!moduleMap.has(name)) {
136
- moduleMap.set(name, []);
206
+ for (const mod of modules) {
207
+ for (const { name, module: originalModule } of mod.reExports) {
208
+ if (!reExportMap.has(originalModule)) {
209
+ reExportMap.set(originalModule, new Map());
210
+ }
211
+ const moduleMap = reExportMap.get(originalModule);
212
+ if (!moduleMap.has(name)) {
213
+ moduleMap.set(name, []);
214
+ }
215
+ moduleMap.get(name).push(mod.path);
137
216
  }
138
- moduleMap.get(name).push(reExportingModule);
139
217
  }
140
218
  // Merge into original declarations
141
219
  for (const mod of modules) {
@@ -150,7 +228,7 @@ export const mergeReExports = (modules, collectedReExports) => {
150
228
  const merged = new Set(declaration.alsoExportedFrom);
151
229
  for (const reExporter of reExporters)
152
230
  merged.add(reExporter);
153
- declaration.alsoExportedFrom = Array.from(merged).sort();
231
+ declaration.alsoExportedFrom = Array.from(merged).sort(compareStrings);
154
232
  }
155
233
  }
156
234
  }
@@ -296,10 +374,192 @@ export const computeDependents = (files) => {
296
374
  return file;
297
375
  }
298
376
  // Sort for deterministic output
299
- const dependents = Array.from(computed).sort();
377
+ const dependents = Array.from(computed).sort(compareStrings);
300
378
  return {
301
379
  ...file,
302
380
  dependents,
303
381
  };
304
382
  });
305
383
  };
384
+ /**
385
+ * Resolve a module's full export surface from the analyzed model, applying
386
+ * ES module semantics to star exports.
387
+ *
388
+ * Combines the module's own `declarations` (including synthesized aliases),
389
+ * `reExports` edges, `externalReExports`, and transitively-resolved
390
+ * `starExports` into one deduped, name-sorted list. The ES rules applied to
391
+ * star projection:
392
+ *
393
+ * - explicit exports (declarations, edges, externals) shadow star-projected
394
+ * names
395
+ * - a name projected by two stars that resolve to *different* canonicals is
396
+ * ambiguous and excluded (same canonical through a diamond is included
397
+ * once)
398
+ * - `default` is never star-projected — including canonical Svelte component
399
+ * declarations, which represent their file's default export. (Caveat: a
400
+ * star-projected re-export edge whose canonical is a component is treated
401
+ * as a default-slot re-export and skipped; a `<script module>` const
402
+ * sharing the component's exact name would be skipped with it.)
403
+ *
404
+ * A Position-3 alias and its `reExports` edge are the same fact — the
405
+ * declaration entry wins, inheriting the edge's `typeOnly`.
406
+ *
407
+ * Cyclic star graphs terminate by contributing nothing along the back-edge
408
+ * (an approximation of ES fixpoint resolution — fine in practice). Surfaces
409
+ * resolved inside a cycle are path-relative and not memoized, so sibling
410
+ * star paths resolve independently rather than inheriting them. Star
411
+ * targets missing from `modules` are reported in `unresolvedStarExports`
412
+ * rather than guessed at; `externalStarExports` aggregates external star
413
+ * specifiers reachable from the module, whose names are unknowable.
414
+ *
415
+ * @param modules - the analyzed modules (parsed `ModuleJson`s — run wire
416
+ * JSON through `AnalyzeResultJson.parse` first)
417
+ * @param path - the module to resolve, as a `ModuleJson.path` value
418
+ * @returns the resolved surface, or `null` when `path` isn't in `modules`
419
+ */
420
+ export const resolveExportSurface = (modules, path) => {
421
+ const byPath = new Map(modules.map((m) => [m.path, m]));
422
+ if (!byPath.has(path))
423
+ return null;
424
+ const byIdentity = buildDeclarationIndex(modules);
425
+ const cache = new Map();
426
+ const visiting = new Set();
427
+ const emptySurface = () => ({
428
+ entries: new Map(),
429
+ unresolvedStars: new Set(),
430
+ externalStars: new Set(),
431
+ });
432
+ // Only surfaces resolved without hitting a cycle back-edge are memoized.
433
+ // A surface computed while one of its star ancestors is mid-resolution is
434
+ // relative to that path — it can carry names a full resolution would
435
+ // exclude as ambiguous (the back-edge contributed nothing to weigh them
436
+ // against). Caching it would leak the path-relative answer to sibling
437
+ // star paths; tainted surfaces are instead recomputed per consumer.
438
+ // Recomputation is bounded by `visiting` and only occurs inside cyclic
439
+ // clusters, which are pathological to begin with.
440
+ const resolveModule = (modulePath) => {
441
+ const cached = cache.get(modulePath);
442
+ if (cached)
443
+ return { surface: cached, tainted: false };
444
+ // Cycle break: a star back-edge contributes nothing
445
+ if (visiting.has(modulePath))
446
+ return { surface: emptySurface(), tainted: true };
447
+ visiting.add(modulePath);
448
+ const mod = byPath.get(modulePath);
449
+ const surface = emptySurface();
450
+ let tainted = false;
451
+ const { entries } = surface;
452
+ // 1. Own declarations — including synthesized aliases and `default`
453
+ const edgesByName = new Map(mod.reExports.map((e) => [e.name, e]));
454
+ for (const declaration of mod.declarations) {
455
+ // A Position-3 alias duplicates its edge; carry the edge's typeOnly
456
+ const matchingEdge = declaration.aliasOf &&
457
+ edgesByName.get(declaration.name)?.module === declaration.aliasOf.module
458
+ ? edgesByName.get(declaration.name)
459
+ : undefined;
460
+ entries.set(declaration.name, {
461
+ entry: {
462
+ name: declaration.name,
463
+ via: 'declaration',
464
+ module: modulePath,
465
+ declaration,
466
+ ...(matchingEdge?.typeOnly ? { typeOnly: true } : {}),
467
+ },
468
+ identity: resolveCanonicalIdentity(byIdentity, modulePath, declaration),
469
+ });
470
+ }
471
+ // 2. Same-name re-export edges not already covered by a declaration.
472
+ // Edges can collide on `name` (Svelte default re-keying — see
473
+ // `ReExportJson`); the surface is keyed by name, so the first edge in
474
+ // sort order wins and the collider is dropped
475
+ for (const edge of mod.reExports) {
476
+ if (entries.has(edge.name))
477
+ continue;
478
+ const canonical = byIdentity.get(`${edge.module}\n${edge.name}`);
479
+ entries.set(edge.name, {
480
+ entry: {
481
+ name: edge.name,
482
+ via: 'reExport',
483
+ module: edge.module,
484
+ ...(canonical ? { declaration: canonical } : {}),
485
+ ...(edge.typeOnly ? { typeOnly: true } : {}),
486
+ },
487
+ identity: canonical
488
+ ? resolveCanonicalIdentity(byIdentity, edge.module, canonical)
489
+ : `${edge.module}\n${edge.name}`,
490
+ });
491
+ }
492
+ // 3. Direct external re-exports
493
+ for (const external of mod.externalReExports) {
494
+ if (entries.has(external.name))
495
+ continue;
496
+ entries.set(external.name, {
497
+ entry: {
498
+ name: external.name,
499
+ via: 'external',
500
+ specifier: external.specifier,
501
+ ...(external.originalName !== undefined ? { originalName: external.originalName } : {}),
502
+ ...(external.typeOnly ? { typeOnly: true } : {}),
503
+ },
504
+ identity: `ext\n${external.specifier}\n${external.originalName ?? external.name}`,
505
+ });
506
+ }
507
+ // 4. External stars — names unknowable, surface incompleteness recorded
508
+ for (const specifier of mod.externalStarExports) {
509
+ surface.externalStars.add(specifier);
510
+ }
511
+ // 5. Star projection, with ES shadowing and ambiguity rules
512
+ const excluded = new Set();
513
+ for (const target of mod.starExports) {
514
+ if (!byPath.has(target)) {
515
+ surface.unresolvedStars.add(target);
516
+ continue;
517
+ }
518
+ const resolved = resolveModule(target);
519
+ if (resolved.tainted)
520
+ tainted = true;
521
+ const sub = resolved.surface;
522
+ for (const star of sub.unresolvedStars)
523
+ surface.unresolvedStars.add(star);
524
+ for (const star of sub.externalStars)
525
+ surface.externalStars.add(star);
526
+ for (const { entry, identity } of sub.entries.values()) {
527
+ // `default` never projects — nor do canonical Svelte components,
528
+ // which represent their file's default export (whether reached
529
+ // as a declaration or through a re-export edge)
530
+ if (entry.name === 'default')
531
+ continue;
532
+ if (entry.declaration?.kind === 'component' && !entry.declaration.aliasOf)
533
+ continue;
534
+ if (excluded.has(entry.name))
535
+ continue;
536
+ const existing = entries.get(entry.name);
537
+ if (existing) {
538
+ // Explicit exports shadow; identical canonicals (diamond) merge
539
+ if (existing.entry.via !== 'star' || existing.identity === identity)
540
+ continue;
541
+ // Ambiguous between two stars — excluded per ES semantics
542
+ entries.delete(entry.name);
543
+ excluded.add(entry.name);
544
+ continue;
545
+ }
546
+ entries.set(entry.name, {
547
+ entry: { ...entry, via: 'star', starFrom: target },
548
+ identity,
549
+ });
550
+ }
551
+ }
552
+ visiting.delete(modulePath);
553
+ if (!tainted)
554
+ cache.set(modulePath, surface);
555
+ return { surface, tainted };
556
+ };
557
+ const resolved = resolveModule(path).surface;
558
+ return {
559
+ entries: Array.from(resolved.entries.values())
560
+ .map(({ entry }) => entry)
561
+ .sort((a, b) => compareStrings(a.name, b.name)),
562
+ unresolvedStarExports: Array.from(resolved.unresolvedStars).sort(compareStrings),
563
+ externalStarExports: Array.from(resolved.externalStars).sort(compareStrings),
564
+ };
565
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"source-config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAC,KAAK,YAAY,EAAE,KA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,GAC/B,aAAa,MAAM,EACnB,YAAY,OAAO,CAAC,qBAAqB,CAAC,KACxC,mBAKA,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,KAAG,mBAmDrE,CAAC;AA+BF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,mBAAmB,KAAG,MAQ5D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,SAAS,mBAAmB,KAAG,MAgB5E,CAAC;AAwBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,SAAS,mBAAmB,KAAG,OAwBrE,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,YAAY,cAAc,GAAG;IAAC,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAC,EACjE,SAAS,mBAAmB,KAC1B;IAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CA2BzD,CAAC"}
@@ -14,6 +14,7 @@ import { resolve, relative } from 'node:path';
14
14
  import picomatch from 'picomatch';
15
15
  import { getDefaultAnalyzer } from './source.js';
16
16
  import { toPosixPath } from './paths.js';
17
+ import { compareStrings } from './postprocess.js';
17
18
  /**
18
19
  * Default partial options for standard SvelteKit library structure.
19
20
  *
@@ -350,7 +351,7 @@ export const extractDependencies = (sourceFile, options) => {
350
351
  }
351
352
  }
352
353
  // Sort for deterministic output
353
- dependencies.sort();
354
- dependents.sort();
354
+ dependencies.sort(compareStrings);
355
+ dependents.sort(compareStrings);
355
356
  return { dependencies, dependents };
356
357
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sv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