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.
@@ -10,11 +10,12 @@
10
10
  *
11
11
  * ## Wire shape vs Zod output shape
12
12
  *
13
- * The plugin serializes `modules` through `compactReplacer`, which strips
14
- * empty arrays and `false` values to keep the bundle small. So fields like
15
- * `declarations`, `members`, `props` that are `.default([])` in the schema
16
- * arrive as `undefined` on any module that has none, and `.default(false)`
17
- * booleans arrive as `undefined` when false.
13
+ * The module's shape is `AnalyzeResultJsonWire` — the input-side counterpart
14
+ * to `AnalyzeResultJson`. The plugin serializes `modules` through
15
+ * `compactReplacer`, which strips empty arrays and `false` values to keep the
16
+ * bundle small. So fields like `declarations`, `members`, `props` that are
17
+ * `.default([])` in the schema arrive as `undefined` on any module that has
18
+ * none, and `.default(false)` booleans arrive as `undefined` when false.
18
19
  *
19
20
  * `ModuleJsonInput` (the `z.input` of `ModuleJson`) reflects this — its
20
21
  * default-bearing fields are optional. Consumers either use optional
@@ -30,8 +31,8 @@
30
31
  * `svelte.config.js` aliases `'svelte-docinfo' → 'src/lib'` (load-bearing
31
32
  * for fuz_ui's `library_gen`, a circular dev-dep). `@sveltejs/package`
32
33
  * applies that alias to every file under `src/lib/`, including hand-written
33
- * `.d.ts`, rewriting the `'svelte-docinfo/...'` imports below to relative
34
- * paths. TypeScript doesn't resolve relative imports inside ambient
34
+ * `.d.ts`, rewriting the `'svelte-docinfo'` import below to a relative
35
+ * path. TypeScript doesn't resolve relative imports inside ambient
35
36
  * `declare module` blocks in consumer projects — types silently collapse
36
37
  * to `any`.
37
38
  *
@@ -40,10 +41,9 @@
40
41
  * Do not "fix" this by moving the file into `src/lib/`.
41
42
  */
42
43
  declare module 'virtual:svelte-docinfo' {
43
- import type {ModuleJsonInput} from 'svelte-docinfo/types.js';
44
- import type {Diagnostic} from 'svelte-docinfo/diagnostics.js';
45
- export const modules: Array<ModuleJsonInput>;
46
- export const diagnostics: Array<Diagnostic>;
47
- const data: {modules: Array<ModuleJsonInput>; diagnostics: Array<Diagnostic>};
44
+ import type {AnalyzeResultJsonWire} from 'svelte-docinfo';
45
+ export const modules: AnalyzeResultJsonWire['modules'];
46
+ export const diagnostics: AnalyzeResultJsonWire['diagnostics'];
47
+ const data: AnalyzeResultJsonWire;
48
48
  export default data;
49
49
  }