svelte-docinfo 0.5.4 → 0.6.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 +69 -50
- package/dist/analyze-core.d.ts +179 -24
- package/dist/analyze-core.d.ts.map +1 -1
- package/dist/analyze-core.js +462 -42
- package/dist/analyze.d.ts +31 -6
- package/dist/analyze.d.ts.map +1 -1
- package/dist/analyze.js +29 -9
- package/dist/cli.d.ts +17 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +12 -9
- package/dist/declaration-build.d.ts +14 -4
- package/dist/declaration-build.d.ts.map +1 -1
- package/dist/declaration-helpers.d.ts +65 -42
- package/dist/declaration-helpers.d.ts.map +1 -1
- package/dist/declaration-helpers.js +167 -72
- package/dist/dep-resolver.d.ts +38 -13
- package/dist/dep-resolver.d.ts.map +1 -1
- package/dist/dep-resolver.js +40 -22
- package/dist/diagnostics.d.ts +365 -14
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +112 -28
- package/dist/discovery.d.ts +7 -2
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +11 -5
- package/dist/exports.d.ts +39 -2
- package/dist/exports.d.ts.map +1 -1
- package/dist/exports.js +251 -46
- package/dist/files.d.ts +14 -2
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +49 -8
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/logo.js +3 -3
- package/dist/paths.d.ts +22 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -1
- package/dist/postprocess.d.ts +31 -10
- package/dist/postprocess.d.ts.map +1 -1
- package/dist/postprocess.js +124 -76
- package/dist/session.d.ts +101 -11
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +457 -127
- package/dist/source-config.d.ts +210 -33
- package/dist/source-config.d.ts.map +1 -1
- package/dist/source-config.js +313 -26
- package/dist/source.d.ts +35 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +37 -0
- package/dist/svelte.d.ts +81 -23
- package/dist/svelte.d.ts.map +1 -1
- package/dist/svelte.js +686 -359
- package/dist/tsdoc.d.ts +47 -12
- package/dist/tsdoc.d.ts.map +1 -1
- package/dist/tsdoc.js +70 -17
- package/dist/types.d.ts +967 -45
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +259 -48
- package/dist/typescript-alias-registry.d.ts +76 -0
- package/dist/typescript-alias-registry.d.ts.map +1 -0
- package/dist/typescript-alias-registry.js +206 -0
- package/dist/typescript-exports.d.ts +20 -15
- package/dist/typescript-exports.d.ts.map +1 -1
- package/dist/typescript-exports.js +264 -137
- package/dist/typescript-extract-class.d.ts +3 -4
- package/dist/typescript-extract-class.d.ts.map +1 -1
- package/dist/typescript-extract-class.js +71 -52
- package/dist/typescript-extract-function.d.ts +6 -8
- package/dist/typescript-extract-function.d.ts.map +1 -1
- package/dist/typescript-extract-function.js +20 -15
- package/dist/typescript-extract-shared.d.ts +309 -29
- package/dist/typescript-extract-shared.d.ts.map +1 -1
- package/dist/typescript-extract-shared.js +957 -127
- package/dist/typescript-extract-type-json.d.ts +286 -0
- package/dist/typescript-extract-type-json.d.ts.map +1 -0
- package/dist/typescript-extract-type-json.js +854 -0
- package/dist/typescript-extract-type-properties.d.ts +2 -3
- package/dist/typescript-extract-type-properties.d.ts.map +1 -1
- package/dist/typescript-extract-type-properties.js +91 -84
- package/dist/typescript-extract-type.d.ts +6 -8
- package/dist/typescript-extract-type.d.ts.map +1 -1
- package/dist/typescript-extract-type.js +138 -40
- package/dist/typescript-program.d.ts +106 -23
- package/dist/typescript-program.d.ts.map +1 -1
- package/dist/typescript-program.js +182 -54
- package/dist/vite.d.ts +23 -8
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +34 -14
- package/package.json +17 -15
- package/virtual-svelte-docinfo.d.ts +1 -1
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
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
|
-
It uses
|
|
12
|
-
[svelte2tsx](https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx)
|
|
13
|
-
|
|
11
|
+
It uses the TypeScript compiler API
|
|
12
|
+
and [svelte2tsx](https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx)
|
|
13
|
+
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
|
|
|
@@ -44,7 +44,9 @@ and [fuz_ui](https://github.com/fuzdev/fuz_ui) components.
|
|
|
44
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
|
-
The first release took 5 months of intermittent work and ~500 manual commits
|
|
47
|
+
The first release took 5 months of intermittent work and ~500 manual commits
|
|
48
|
+
to [extract its initial implementation from fuz_ui](https://github.com/fuzdev/fuz_ui/pull/107),
|
|
49
|
+
which was more limited, lacking the fancy TS compiler usage, and grew slowly over years without AI assistance.
|
|
48
50
|
|
|
49
51
|
## Quick start
|
|
50
52
|
|
|
@@ -73,7 +75,7 @@ export const add = (a: number, b: number): number => a + b;
|
|
|
73
75
|
let {
|
|
74
76
|
result = $bindable(0),
|
|
75
77
|
mode = 'add',
|
|
76
|
-
disabled = false
|
|
78
|
+
disabled = false
|
|
77
79
|
}: {
|
|
78
80
|
/** Current result (bindable). */
|
|
79
81
|
result?: number;
|
|
@@ -93,7 +95,7 @@ Three ways to integrate `svelte-docinfo`:
|
|
|
93
95
|
// vite.config.ts
|
|
94
96
|
import svelteDocinfo from 'svelte-docinfo/vite.js';
|
|
95
97
|
|
|
96
|
-
export default defineConfig({plugins: [sveltekit(), svelteDocinfo()]});
|
|
98
|
+
export default defineConfig({ plugins: [sveltekit(), svelteDocinfo()] });
|
|
97
99
|
// then anywhere in your app:
|
|
98
100
|
// import {modules} from 'virtual:svelte-docinfo';
|
|
99
101
|
```
|
|
@@ -107,9 +109,9 @@ npx svelte-docinfo --pretty
|
|
|
107
109
|
3. [API](#api) - programmatic access for build tools, custom pipelines, and standalone scripts:
|
|
108
110
|
|
|
109
111
|
```ts
|
|
110
|
-
import {analyzeFromFiles} from 'svelte-docinfo';
|
|
112
|
+
import { analyzeFromFiles } from 'svelte-docinfo';
|
|
111
113
|
|
|
112
|
-
const {modules} = await analyzeFromFiles({projectRoot: process.cwd()});
|
|
114
|
+
const { modules } = await analyzeFromFiles({ projectRoot: process.cwd() });
|
|
113
115
|
```
|
|
114
116
|
|
|
115
117
|
All three produce the same JSON shape:
|
|
@@ -137,6 +139,13 @@ All three produce the same JSON shape:
|
|
|
137
139
|
{
|
|
138
140
|
"name": "mode",
|
|
139
141
|
"type": "\"add\" | \"multiply\"",
|
|
142
|
+
"typeInfo": {
|
|
143
|
+
"kind": "union",
|
|
144
|
+
"members": [
|
|
145
|
+
{ "kind": "literal", "value": "add", "text": "\"add\"" },
|
|
146
|
+
{ "kind": "literal", "value": "multiply", "text": "\"multiply\"" }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
140
149
|
"optional": true,
|
|
141
150
|
"description": "Operation mode.",
|
|
142
151
|
"defaultValue": "'add'"
|
|
@@ -162,8 +171,8 @@ All three produce the same JSON shape:
|
|
|
162
171
|
"typeSignature": "(a: number, b: number): number",
|
|
163
172
|
"sourceLine": 7,
|
|
164
173
|
"parameters": [
|
|
165
|
-
{"name": "a", "type": "number", "description": "first number"},
|
|
166
|
-
{"name": "b", "type": "number", "description": "second number"}
|
|
174
|
+
{ "name": "a", "type": "number", "description": "first number" },
|
|
175
|
+
{ "name": "b", "type": "number", "description": "second number" }
|
|
167
176
|
],
|
|
168
177
|
"returnType": "number",
|
|
169
178
|
"returnDescription": "the sum"
|
|
@@ -174,23 +183,21 @@ All three produce the same JSON shape:
|
|
|
174
183
|
}
|
|
175
184
|
```
|
|
176
185
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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)
|
|
186
|
+
The [extraction demo](https://svelte-docinfo.fuz.dev/demo/extraction) has more examples,
|
|
187
|
+
and see the docs for the complete [output format](https://svelte-docinfo.fuz.dev/docs/output-format).
|
|
188
|
+
You may also want to browse the [test fixtures](https://github.com/fuzdev/svelte-docinfo/tree/main/src/test/fixtures).
|
|
182
189
|
|
|
183
190
|
## Vite plugin
|
|
184
191
|
|
|
185
192
|
1. Add the plugin to `vite.config.ts`:
|
|
186
193
|
|
|
187
194
|
```ts
|
|
188
|
-
import {defineConfig} from 'vite';
|
|
189
|
-
import {sveltekit} from '@sveltejs/kit/vite';
|
|
195
|
+
import { defineConfig } from 'vite';
|
|
196
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
190
197
|
import svelteDocinfo from 'svelte-docinfo/vite.js';
|
|
191
198
|
|
|
192
199
|
export default defineConfig({
|
|
193
|
-
plugins: [sveltekit(), svelteDocinfo()]
|
|
200
|
+
plugins: [sveltekit(), svelteDocinfo()]
|
|
194
201
|
});
|
|
195
202
|
```
|
|
196
203
|
|
|
@@ -203,23 +210,30 @@ export default defineConfig({
|
|
|
203
210
|
3. Import the virtual module anywhere in your app:
|
|
204
211
|
|
|
205
212
|
```ts
|
|
206
|
-
import {modules, diagnostics} from 'virtual:svelte-docinfo';
|
|
213
|
+
import { modules, diagnostics } from 'virtual:svelte-docinfo';
|
|
207
214
|
// or: import data from 'virtual:svelte-docinfo';
|
|
208
215
|
```
|
|
209
216
|
|
|
210
217
|
Plugin options:
|
|
211
218
|
|
|
212
|
-
| Option | Default
|
|
213
|
-
| --------------------- |
|
|
214
|
-
| `projectRoot` | Vite's resolved `config.root`
|
|
215
|
-
| `include` | —
|
|
216
|
-
| `exclude` | `['**/*.test.ts', '**/*.spec.ts']` | Glob patterns to exclude
|
|
217
|
-
| `discovery` | `'auto'`
|
|
218
|
-
| `distDir` | `'dist'`
|
|
219
|
-
| `sourceOptions` | `{sourcePaths: ['src/lib'], …}`
|
|
220
|
-
| `resolveDependencies` | `true`
|
|
221
|
-
| `onDuplicates` | —
|
|
222
|
-
| `hmrDebounceMs` | `100`
|
|
219
|
+
| Option | Default | Description |
|
|
220
|
+
| --------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
221
|
+
| `projectRoot` | Vite's resolved `config.root` | Absolute path to project root. |
|
|
222
|
+
| `include` | — | Glob patterns to include (relative to `projectRoot`; absolute inside it accepted). Collapses `discovery: 'auto'` to glob; combining with `discovery: 'exports'` throws. Widens the source scope — see the notes below. |
|
|
223
|
+
| `exclude` | `['**/*.test.ts', '**/*.spec.ts', '**/internal/**']` | Glob patterns to exclude. An array fully replaces the defaults; the callback form extends them (`(defaults) => [...defaults, '**/*.gen.ts']`). The always-on baseline below still applies. |
|
|
224
|
+
| `discovery` | `'auto'` | Discovery strategy: `'auto'` \| `'exports'` \| `'glob'`. `'exports'` is strict and fails if `package.json` exports is missing or empty. |
|
|
225
|
+
| `distDir` | `'dist'` | Dist directory name for exports-based discovery. |
|
|
226
|
+
| `sourceOptions` | `{sourcePaths: ['src/lib'], …}` | Partial overrides for default source options (SvelteKit `src/lib` layout). |
|
|
227
|
+
| `resolveDependencies` | `true` | Resolve import dependencies. When `false`, `dependencies`/`dependents` stay empty. |
|
|
228
|
+
| `onDuplicates` | — | Dispatch on duplicate declaration names: `'throw'` \| `'warn'` \| callback. Diagnostic emits regardless of dispatch. |
|
|
229
|
+
| `hmrDebounceMs` | `100` | HMR debounce delay in milliseconds. |
|
|
230
|
+
|
|
231
|
+
Source-scope notes (shared with the [CLI](#cli) and `analyzeFromFiles`):
|
|
232
|
+
|
|
233
|
+
- Explicit `include` patterns **widen the source scope**: each pattern's static base joins `sourceOptions.sourcePaths`, so include-discovered files emit modules (with paths relative to the widened set's common root) and the dev-mode watcher tracks them. A pattern with no base (`'**/*.ts'`, a literal root file) scopes the whole project root as source and logs an info line naming it.
|
|
234
|
+
- An **always-on baseline** applies beneath any `exclude`: `node_modules` and dot-directories below a matched source path are never source. It's matched relative to the matched source path — an explicit dot-directory source path (`sourcePaths: ['.hidden/src']`) still works — and is independent of `exclude` overrides. `dist`/`build`/`coverage` are ordinary names and stay in.
|
|
235
|
+
- The **`src/lib/internal/` convention**: `internal/` directories are excluded by default (the `**/internal/**` default pattern) — internal modules ship in the package for public modules to import but aren't documented. Packages typically pair the directory with an `"./internal/*": null` package.json exports entry blocking consumer imports; exports-based discovery honors null-target keys with Node's best-match resolution semantics, so blocked subpaths are never discovered. Internal modules stay live in dev: the analysis session owns them as watched context files, so editing an internal type re-analyzes the public modules that use it. A public re-export of an internal symbol (`export { x } from './internal/helper.js'`) documents at the re-export site as a full synthesized declaration. Re-include internal modules wholesale with the exclude callback: `exclude: (defaults) => defaults.filter((p) => p !== '**/internal/**')`.
|
|
236
|
+
- Paths and patterns resolve against `projectRoot`: absolute entries inside the root are accepted (stored root-relative), and anything resolving outside the root **throws** at options creation instead of silently emitting nothing — a root-anchored `'/src/lib'` is filesystem-absolute, not shorthand for `'src/lib'`.
|
|
223
237
|
|
|
224
238
|
The options interface is `VitePluginSvelteDocinfoOptions` from `svelte-docinfo/vite.js` (not re-exported from the main barrel).
|
|
225
239
|
See the [docs site](https://svelte-docinfo.fuz.dev/) and [examples/vite/](examples/vite/README.md) for more.
|
|
@@ -249,22 +263,24 @@ stderr (warnings and errors still print).
|
|
|
249
263
|
|
|
250
264
|
All CLI options:
|
|
251
265
|
|
|
252
|
-
| Flag | Description
|
|
253
|
-
| --------------------------- |
|
|
254
|
-
| `[project-root]` | Project root directory (default: cwd)
|
|
255
|
-
| `-i, --include <pattern>` | Include pattern (repeatable, replaces exports discovery; incompatible with `--discovery exports`)
|
|
256
|
-
| `-e, --exclude <pattern>` | Exclude glob, applied at discovery and analysis (repeatable; fully replaces defaults
|
|
257
|
-
| `-o, --output <file>` | Output file (default: stdout; pass `-` for explicit stdout, so `-o "$OUT"` works when `$OUT=-`)
|
|
258
|
-
| `--discovery <mode>` | `auto` \| `exports` \| `glob` (default: `auto` — exports first, glob fallback). `exports` is strict and fails if package.json exports is missing
|
|
259
|
-
| `--dist-dir <dir>` | Dist directory for exports discovery (default: dist)
|
|
260
|
-
| `--source-dir <dir>` | Source directory relative to project root (default: src/lib). Repeatable for monorepos; drives the implicit include glob when no `--include` is provided
|
|
261
|
-
| `--source-root <dir>` | Source root for module-path stripping (default: single source-dir or longest common prefix; pass `.` for project-relative paths)
|
|
262
|
-
| `--on-duplicates <mode>` | Dispatch on duplicate declaration names: `throw` \| `warn` (default: emit `duplicate_declaration` diagnostic, no dispatch)
|
|
263
|
-
| `--only <pattern>` | Glob filter applied to module paths in output (repeatable). Full project is still analyzed (re-exports/dependents stay correct); diagnostics aren't filtered
|
|
264
|
-
| `--no-resolve-dependencies` | Disable dependency resolution
|
|
265
|
-
| `--pretty` | Pretty-print JSON output (default: compact)
|
|
266
|
-
| `-q, --quiet` | Suppress info messages on stderr (warnings and errors still print)
|
|
267
|
-
| `-V, --version` | Show version number
|
|
266
|
+
| Flag | Description |
|
|
267
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
268
|
+
| `[project-root]` | Project root directory (default: cwd) |
|
|
269
|
+
| `-i, --include <pattern>` | Include pattern (repeatable, replaces exports discovery, widens the source scope; incompatible with `--discovery exports`) |
|
|
270
|
+
| `-e, --exclude <pattern>` | Exclude glob, applied at discovery and analysis (repeatable; fully replaces the defaults `**/*.test.ts`, `**/*.spec.ts`, `**/internal/**` — no merge; the always-on baseline applies beneath) |
|
|
271
|
+
| `-o, --output <file>` | Output file (default: stdout; pass `-` for explicit stdout, so `-o "$OUT"` works when `$OUT=-`) |
|
|
272
|
+
| `--discovery <mode>` | `auto` \| `exports` \| `glob` (default: `auto` — exports first, glob fallback). `exports` is strict and fails if package.json exports is missing |
|
|
273
|
+
| `--dist-dir <dir>` | Dist directory for exports discovery (default: dist) |
|
|
274
|
+
| `--source-dir <dir>` | Source directory, relative to project root or absolute inside it (default: src/lib). Repeatable for monorepos; drives the implicit include glob when no `--include` is provided |
|
|
275
|
+
| `--source-root <dir>` | Source root for module-path stripping (default: single source-dir or longest common prefix; pass `.` for project-relative paths) |
|
|
276
|
+
| `--on-duplicates <mode>` | Dispatch on duplicate declaration names: `throw` \| `warn` (default: emit `duplicate_declaration` diagnostic, no dispatch) |
|
|
277
|
+
| `--only <pattern>` | Glob filter applied to module paths in output (repeatable). Full project is still analyzed (re-exports/dependents stay correct); diagnostics aren't filtered |
|
|
278
|
+
| `--no-resolve-dependencies` | Disable dependency resolution |
|
|
279
|
+
| `--pretty` | Pretty-print JSON output (default: compact) |
|
|
280
|
+
| `-q, --quiet` | Suppress info messages on stderr (warnings and errors still print) |
|
|
281
|
+
| `-V, --version` | Show version number |
|
|
282
|
+
|
|
283
|
+
The [Vite plugin](#vite-plugin)'s source-scope notes apply here too: explicit `--include` patterns widen the source scope (module paths become relative to the widened root, and a pattern with no base scopes the whole project root and logs an info line); `node_modules` and dot-directories below a source dir are always excluded regardless of `--exclude`; absolute paths and patterns inside the project root are accepted, and out-of-root ones fail loudly.
|
|
268
284
|
|
|
269
285
|
Exit codes: 0 (success), 1 (analysis errors), 2 (CLI errors).
|
|
270
286
|
|
|
@@ -284,9 +300,9 @@ For most projects, `analyzeFromFiles` is all you need. It reads your `package.js
|
|
|
284
300
|
to discover source files, falling back to glob patterns:
|
|
285
301
|
|
|
286
302
|
```ts
|
|
287
|
-
import {analyzeFromFiles} from 'svelte-docinfo';
|
|
303
|
+
import { analyzeFromFiles } from 'svelte-docinfo';
|
|
288
304
|
|
|
289
|
-
const {modules} = await analyzeFromFiles({projectRoot: process.cwd()});
|
|
305
|
+
const { modules } = await analyzeFromFiles({ projectRoot: process.cwd() });
|
|
290
306
|
```
|
|
291
307
|
|
|
292
308
|
Pass `include` for custom patterns or `discovery: 'glob'` to always use glob.
|
|
@@ -294,7 +310,7 @@ Use `discovery: 'exports'` for strict mode that throws if `package.json` has no
|
|
|
294
310
|
When you already have file contents in memory,
|
|
295
311
|
use `analyze` instead of `analyzeFromFiles` to skip file discovery.
|
|
296
312
|
For just the discovery step (without running analysis), use
|
|
297
|
-
`discoverSourceFiles`
|
|
313
|
+
`discoverSourceFiles` (also in the main `svelte-docinfo` import).
|
|
298
314
|
|
|
299
315
|
For long-lived consumers (a Vite plugin reacting to file edits, an LSP-style tool),
|
|
300
316
|
`createAnalysisSession` returns a persistent handle that reuses parsed ASTs across calls
|
|
@@ -310,7 +326,10 @@ See the [API docs](https://svelte-docinfo.fuz.dev/docs/api) for the full referen
|
|
|
310
326
|
## Features
|
|
311
327
|
|
|
312
328
|
- **Full type resolution**: infers complex types without manual annotations, including generics, imported types, and inferred return types
|
|
313
|
-
- **
|
|
329
|
+
- **Structured types**: an optional `typeInfo` tree (`TypeJson`) beside the flat type strings on props, parameters, return types (`returnTypeInfo`, overloads included), type members, and variable/type declarations — union and intersection members (alias names kept, enum members as `{value, text}` pairs), reference type arguments (named generic instantiations like `Snippet<[a: string]>` classify as references), array and tuple elements (with `readonly` markers), so a union alias documents more than its own name — and absent wherever the flat string already says everything
|
|
330
|
+
- **TSDoc/JSDoc parsing**: the common doc tags (`@param`, `@returns`, `@throws`, `@example`, `@deprecated`, `@internal`, `@see`, `@since`, `@default`) plus `@nodocs`, `@mutates`, and `@module` for file-level comments; divergent spellings parse as synonyms (`@return`, TSDoc's `@defaultValue`). `@internal` is a marker (`internalMessage`, prose kept), not an exclusion — that's `@nodocs`
|
|
331
|
+
- **Alias-lost name recovery**: schema-inferred aliases (`type Foo = z.infer<typeof S>` — any indexed-access or conditional right-hand side) lose their name in the checker, which expands their structure at every use; `typeInfo` recovers the name as `{kind: 'reference', name}` from the written annotation where one exists, and — via an identity-keyed registry of the analyzed set's exported lost aliases — at unannotated inferred positions too, `null`-bearing optionals included; registry-recovered references also carry `module` (the declaring module's `ModuleJson.path`, always an emitted module) for collision-exact linking. Losses nothing recovers surface as `alias_lost` warnings (readable degradations like `z.enum` literal unions and `.brand()` intersections excluded)
|
|
332
|
+
- **Merged value+type symbols**: `export const Foo = z.strictObject({...})` + `export type Foo = z.infer<typeof Foo>` (one symbol, both spaces) documents the type meaning — structure and members like the un-merged equivalent — with `mergedValue: true` marking the name as also importable as a runtime value; JSDoc falls back to the const's docs, and `generateImport` emits a value import
|
|
314
333
|
- **Svelte 5 component props**: extracts prop types, descriptions, defaults, and bindability via svelte2tsx
|
|
315
334
|
- **Svelte 5 snippets**: `kind: 'snippet'` for template snippets (with structured parameters), `acceptsChildren` on components
|
|
316
335
|
- **Svelte 5 reactivity runes**: detects `$state`, `$state.raw`, `$derived`, `$derived.by` on variables and class fields (`reactivity` field) — syntactic detection, surfaces wherever the rune pattern appears
|