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 +21 -12
- package/dist/analyze-core.d.ts +45 -9
- package/dist/analyze-core.d.ts.map +1 -1
- package/dist/analyze-core.js +43 -17
- package/dist/declaration-build.d.ts +16 -19
- package/dist/declaration-build.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/postprocess.d.ts +118 -28
- package/dist/postprocess.d.ts.map +1 -1
- package/dist/postprocess.js +279 -31
- package/dist/svelte.d.ts.map +1 -1
- package/dist/svelte.js +47 -3
- package/dist/types.d.ts +145 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +115 -1
- package/dist/typescript-exports.d.ts +3 -1
- package/dist/typescript-exports.d.ts.map +1 -1
- package/dist/typescript-exports.js +237 -158
- package/package.json +9 -9
- package/virtual-svelte-docinfo.d.ts +12 -12
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
*
|
|
11
11
|
* ## Wire shape vs Zod output shape
|
|
12
12
|
*
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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
|
|
34
|
-
*
|
|
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 {
|
|
44
|
-
|
|
45
|
-
export const
|
|
46
|
-
|
|
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
|
}
|