svelte-docinfo 0.5.2 → 0.5.4
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/declaration-build.d.ts +5 -1
- package/dist/declaration-build.d.ts.map +1 -1
- package/dist/error.d.ts +15 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +14 -0
- package/dist/exports.d.ts.map +1 -1
- package/dist/exports.js +40 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +3 -2
- package/dist/svelte.d.ts +14 -2
- package/dist/svelte.d.ts.map +1 -1
- package/dist/svelte.js +43 -19
- package/dist/typescript-exports.d.ts +2 -1
- package/dist/typescript-exports.d.ts.map +1 -1
- package/dist/typescript-exports.js +8 -3
- package/dist/typescript-extract-class.d.ts.map +1 -1
- package/dist/typescript-extract-class.js +3 -2
- package/dist/typescript-extract-function.d.ts.map +1 -1
- package/dist/typescript-extract-function.js +3 -2
- package/dist/typescript-extract-shared.d.ts.map +1 -1
- package/dist/typescript-extract-shared.js +2 -1
- package/dist/typescript-extract-type-properties.d.ts.map +1 -1
- package/dist/typescript-extract-type-properties.js +2 -1
- package/dist/typescript-extract-type.d.ts.map +1 -1
- package/dist/typescript-extract-type.js +5 -4
- package/dist/vite.js +3 -3
- package/package.json +8 -7
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAU9C,4CAA4C;AAC5C,QAAA,MAAM,oBAAoB,4BAA6B,CAAC;AACxD,KAAK,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAS9D;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,gFAAgF;IAChF,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,sFAAsF;IACtF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAU,OAAM,KAAK,CAAC,MAAM,CAAgB,KAAG,OAAO,CAAC,MAAM,CA2N/E,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -23,6 +23,7 @@ import { resolve } from 'node:path';
|
|
|
23
23
|
import picomatch from 'picomatch';
|
|
24
24
|
import { analyzeFromFiles } from './analyze.js';
|
|
25
25
|
import { hasErrors } from './diagnostics.js';
|
|
26
|
+
import { to_error_message } from './error.js';
|
|
26
27
|
import { compactReplacer } from './declaration-helpers.js';
|
|
27
28
|
/** Collect repeatable option values into an array. */
|
|
28
29
|
const collect = (value, previous) => previous ? [...previous, value] : [value];
|
|
@@ -193,7 +194,7 @@ Examples:
|
|
|
193
194
|
catch (error) {
|
|
194
195
|
// Friendly one-line error for users; full stack only on DEBUG=1
|
|
195
196
|
// so CI logs and bug reports can still capture it on demand.
|
|
196
|
-
const message =
|
|
197
|
+
const message = to_error_message(error);
|
|
197
198
|
console.error(`error: ${message}`);
|
|
198
199
|
if (process.env.DEBUG) {
|
|
199
200
|
console.error(error);
|
|
@@ -121,7 +121,11 @@ export interface DeclarationAnalysis {
|
|
|
121
121
|
* Produced by `analyzeExports` in `typescript-exports.ts`.
|
|
122
122
|
*/
|
|
123
123
|
export interface ModuleExportsAnalysis {
|
|
124
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Module-level documentation comment. Always `undefined` for svelte2tsx
|
|
126
|
+
* virtual files — `analyzeSvelteModule` extracts Svelte module comments
|
|
127
|
+
* from the original source instead.
|
|
128
|
+
*/
|
|
125
129
|
moduleComment?: string;
|
|
126
130
|
/** All exported declarations with `@nodocs` flags — consumer filters based on policy. */
|
|
127
131
|
declarations: Array<DeclarationAnalysis>;
|
|
@@ -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,iBAAiB,EACjB,yBAAyB,EACzB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACj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ACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IACnC,0DAA0D;IAC1D,WAAW,EAAE,oBAAoB,CAAC;IAClC,2FAA2F;IAC3F,MAAM,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC
|
|
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,iBAAiB,EACjB,yBAAyB,EACzB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;I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C;IACzC;;;;;;OAMG;IACH,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,2FAA2F;IAC3F,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACpD,6EAA6E;IAC7E,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAC5D,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,gFAAgF;IAChF,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC1B"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error-message normalization.
|
|
3
|
+
*
|
|
4
|
+
* `to_error_message` is the single primitive for coercing an unknown caught
|
|
5
|
+
* value to a human-readable string — `value.message` for an `Error`, otherwise
|
|
6
|
+
* a caller-supplied fallback or `String(value)`. Used wherever a `catch (err)`
|
|
7
|
+
* binding (typed `unknown`) feeds a diagnostic message, log line, or error
|
|
8
|
+
* field, replacing the inline `err instanceof Error ? err.message : String(err)`
|
|
9
|
+
* idiom.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/** Extract a human-readable message from an unknown thrown value. */
|
|
14
|
+
export declare const to_error_message: (value: unknown, fallback?: string) => string;
|
|
15
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,EAAE,WAAW,MAAM,KAAG,MACA,CAAC"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error-message normalization.
|
|
3
|
+
*
|
|
4
|
+
* `to_error_message` is the single primitive for coercing an unknown caught
|
|
5
|
+
* value to a human-readable string — `value.message` for an `Error`, otherwise
|
|
6
|
+
* a caller-supplied fallback or `String(value)`. Used wherever a `catch (err)`
|
|
7
|
+
* binding (typed `unknown`) feeds a diagnostic message, log line, or error
|
|
8
|
+
* field, replacing the inline `err instanceof Error ? err.message : String(err)`
|
|
9
|
+
* idiom.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/** Extract a human-readable message from an unknown thrown value. */
|
|
14
|
+
export const to_error_message = (value, fallback) => value instanceof Error ? value.message : (fallback ?? String(value));
|
package/dist/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAOjD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,2GAA2G;IAC3G,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACpC,oEAAoE;IACpE,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,iCAAiC;IACjC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5B,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;CACpB;AASD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAU,aAAa,MAAM,KAAG,OAAO,CAAC,aAAa,CA+BpF,CAAC;AAoCF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAC3B,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,SAAS;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,KAC3C,MAAM,GAAG,IAwCX,CAAC;AAkBF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,GAC/B,SAAS,uBAAuB,KAC9B,OAAO,CAAC,sBAAsB,CA0DhC,CAAC"}
|
package/dist/exports.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { readFile, access } from 'node:fs/promises';
|
|
13
13
|
import { join, relative, resolve } from 'node:path';
|
|
14
14
|
import { glob } from 'tinyglobby';
|
|
15
|
+
import { to_error_message } from './error.js';
|
|
15
16
|
import { toPosixPath } from './paths.js';
|
|
16
17
|
import { MAX_FILE_CONCURRENCY, map_concurrent } from './concurrency.js';
|
|
17
18
|
// Condition priority
|
|
@@ -200,7 +201,7 @@ export const discoverFromExports = async (options) => {
|
|
|
200
201
|
kind: 'module_unreadable',
|
|
201
202
|
severity: 'error',
|
|
202
203
|
file: toPosixPath(relative(projectRoot, absPath)),
|
|
203
|
-
message: `Could not read file discovered via package.json exports: ${
|
|
204
|
+
message: `Could not read file discovered via package.json exports: ${to_error_message(err)}`,
|
|
204
205
|
});
|
|
205
206
|
return null;
|
|
206
207
|
}
|
|
@@ -230,14 +231,49 @@ const resolveConcreteExport = async (distPath, condition, mappingOptions, projec
|
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
233
|
};
|
|
234
|
+
/**
|
|
235
|
+
* Widen an exports-derived source pattern into a directory-crossing glob.
|
|
236
|
+
*
|
|
237
|
+
* A package.json `exports` wildcard matches subpaths *including* `/` — the
|
|
238
|
+
* `./*.js` key resolves `./auth/session.js` with `*` capturing `auth/session`.
|
|
239
|
+
* A plain glob `*`, by contrast, stops at a directory separator, so globbing
|
|
240
|
+
* the mapped `src/lib/*.ts` would match only top-level modules and silently
|
|
241
|
+
* drop every nested one. When the wildcard sits after a directory separator
|
|
242
|
+
* (the ubiquitous `<dir>/*.ext` shape), splice in a globstar segment so the
|
|
243
|
+
* glob crosses directories the way Node's resolver does; the globstar matches
|
|
244
|
+
* zero-or-more segments, so top-level files still match.
|
|
245
|
+
*
|
|
246
|
+
* Two shapes are deliberately left un-widened:
|
|
247
|
+
* - A mid-segment wildcard (`prefix-*.ts`) has no faithful globstar translation.
|
|
248
|
+
* - A bare-root wildcard (`*.ts`, from an empty `sourceDir`) would widen to a
|
|
249
|
+
* project-root `**` that rakes in `node_modules`/`dist`. Empty `sourceDir`
|
|
250
|
+
* only arises from the multi-`sourcePaths` no-common-prefix layout (which
|
|
251
|
+
* `discoverSourceFiles` short-circuits before reaching here) or an explicit
|
|
252
|
+
* `sourceRoot: ''`; leaving it non-recursive matches the prior behavior
|
|
253
|
+
* without the explosion risk.
|
|
254
|
+
*
|
|
255
|
+
* Both fall through to matching same-directory files only.
|
|
256
|
+
*/
|
|
257
|
+
const toRecursiveExportGlob = (pattern) => {
|
|
258
|
+
const star = pattern.indexOf('*');
|
|
259
|
+
if (star === -1)
|
|
260
|
+
return pattern;
|
|
261
|
+
const before = pattern.slice(0, star);
|
|
262
|
+
const after = pattern.slice(star + 1);
|
|
263
|
+
if (before.endsWith('/'))
|
|
264
|
+
return `${before}**/*${after}`;
|
|
265
|
+
return pattern;
|
|
266
|
+
};
|
|
233
267
|
/**
|
|
234
268
|
* Expand a wildcard export pattern to matching source files.
|
|
235
269
|
*/
|
|
236
270
|
const expandWildcardExport = async (distPath, condition, mappingOptions, projectRoot, exclude, discovered) => {
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
271
|
+
const mappedPattern = mapDistToSource(distPath, condition, mappingOptions);
|
|
272
|
+
if (!mappedPattern)
|
|
239
273
|
return;
|
|
240
|
-
//
|
|
274
|
+
// The exports `*` crosses directory separators; a glob `*` does not — widen
|
|
275
|
+
// it so nested modules aren't silently dropped.
|
|
276
|
+
const sourcePattern = toRecursiveExportGlob(mappedPattern);
|
|
241
277
|
const patterns = [sourcePattern];
|
|
242
278
|
// For .ts patterns, also try .svelte and .js
|
|
243
279
|
if (sourcePattern.endsWith('.ts')) {
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAIN,KAAK,8BAA8B,EACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/F,0DAA0D;IAC1D,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mEAAmE;IACnE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,4EAA4E;IAC5E,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9B;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC;IAC9C;;;;;;;;OAQG;IACH,oBAAoB,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CACnD,8BAA8B,EAC9B,aAAa,GAAG,cAAc,CAC9B;IACA;;;;;;;;;OASG;IACH,aAAa,EAAE,mBAAmB,CAAC;IACnC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,kDAAkD;IAClD,GAAG,CAAC,EAAE,WAAW,CAAC;CAClB;AA+FD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,sBAAsB,KAAG,eAsdvE,CAAC"}
|
package/dist/session.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* @module
|
|
30
30
|
*/
|
|
31
31
|
import { createAnalysisLanguageService, loadTsconfig, } from './typescript-program.js';
|
|
32
|
+
import { to_error_message } from './error.js';
|
|
32
33
|
import { transformSvelteSource } from './svelte.js';
|
|
33
34
|
import { createDefaultResolver, ensureLexerReady, isNodeBuiltin, lexImports, normalizeResolveImport, } from './dep-resolver.js';
|
|
34
35
|
import { isSource, normalizeSourceOptions } from './source-config.js';
|
|
@@ -214,7 +215,7 @@ export const createAnalysisSession = (options) => {
|
|
|
214
215
|
ingestDiagnostics.push({
|
|
215
216
|
kind: 'import_parse_failed',
|
|
216
217
|
file: file.id,
|
|
217
|
-
message: `Failed to parse imports: ${
|
|
218
|
+
message: `Failed to parse imports: ${to_error_message(err)}`,
|
|
218
219
|
severity: 'warning',
|
|
219
220
|
});
|
|
220
221
|
}
|
|
@@ -385,7 +386,7 @@ export const createAnalysisSession = (options) => {
|
|
|
385
386
|
return {
|
|
386
387
|
...t,
|
|
387
388
|
resolved: null,
|
|
388
|
-
error:
|
|
389
|
+
error: to_error_message(err),
|
|
389
390
|
};
|
|
390
391
|
}
|
|
391
392
|
});
|
package/dist/svelte.d.ts
CHANGED
|
@@ -90,6 +90,16 @@ export declare const transformSvelteSource: (sourceFile: SourceFileInfo) => Tran
|
|
|
90
90
|
* @returns the script tag content, or undefined if no matching script tag is found
|
|
91
91
|
*/
|
|
92
92
|
export declare const extractScriptContent: (svelteSource: string) => string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Extract the content of the module `<script>` tag from Svelte source.
|
|
95
|
+
*
|
|
96
|
+
* Counterpart of `extractScriptContent` with the same attribute test inverted:
|
|
97
|
+
* matches only module scripts (`<script module>`, `<script context="module">`),
|
|
98
|
+
* so the two partition a source's script tags consistently.
|
|
99
|
+
*
|
|
100
|
+
* @returns the module script tag content, or undefined if no module script is found
|
|
101
|
+
*/
|
|
102
|
+
export declare const extractModuleScriptContent: (svelteSource: string) => string | undefined;
|
|
93
103
|
/**
|
|
94
104
|
* Extract `@module` comment from HTML comments in Svelte source.
|
|
95
105
|
*
|
|
@@ -105,9 +115,11 @@ export declare const extractHtmlModuleComment: (svelteSource: string) => string
|
|
|
105
115
|
* Extract module-level comment from Svelte script content.
|
|
106
116
|
*
|
|
107
117
|
* Parses the script content as TypeScript and delegates to `extractModuleComment`
|
|
108
|
-
* for the shared `@module` tag detection logic.
|
|
118
|
+
* for the shared `@module` tag detection logic. Works on either script's
|
|
119
|
+
* content — instance `<script>` and `<script module>` (see
|
|
120
|
+
* `extractScriptContent`/`extractModuleScriptContent`).
|
|
109
121
|
*
|
|
110
|
-
* @param scriptContent - the content of
|
|
122
|
+
* @param scriptContent - the content of a `<script>` or `<script module>` tag
|
|
111
123
|
* @returns the cleaned module comment text, or undefined if none found
|
|
112
124
|
*/
|
|
113
125
|
export declare const extractSvelteModuleComment: (scriptContent: string) => string | undefined;
|
package/dist/svelte.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAC,QAAQ,EAAsB,MAAM,2BAA2B,CAAC;AAGxE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAA2C,kBAAkB,EAAC,MAAM,YAAY,CAAC;AAC7F,OAAO,KAAK,EAGX,cAAc,EACd,MAAM,wBAAwB,CAAC;AAShC,OAAO,EAAC,KAAK,cAAc,EAA0C,MAAM,aAAa,CAAC;AACzF,OAAO,EAAC,KAAK,mBAAmB,EAAsB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAC,QAAQ,EAAsB,MAAM,2BAA2B,CAAC;AAGxE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAA2C,kBAAkB,EAAC,MAAM,YAAY,CAAC;AAC7F,OAAO,KAAK,EAGX,cAAc,EACd,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EF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,GACpC,aAAa,EAAE,CAAC,IAAI,EACpB,SAAS,EAAE,CAAC,WAAW,KACrB,KAAK,CAAC,kBAAkB,CAqB1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAI,YAAY,MAAM,KAAG,OAKxD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GAAI,YAAY,KAAK,CAAC,kBAAkB,CAAC,KAAG,MAGtF,CAAC;AA8NF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,YAAY,cAAc,GAAG;IAAC,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAC,EACjE,YAAY,MAAM,EAClB,SAAS,EAAE,CAAC,WAAW,EACvB,SAAS,mBAAmB,EAC5B,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,SAAS,EAAE,CAAC,OAAO,EACnB,aAAa,iBAAiB,KAC5B,cAAc,GAAG,SAiRnB,CAAC"}
|
package/dist/svelte.js
CHANGED
|
@@ -33,6 +33,7 @@ import { extractModuleComment, analyzeExports, warnModuleCommentNodocs, } from '
|
|
|
33
33
|
import { getComponentName, SVELTE_VIRTUAL_SUFFIX } from './source.js';
|
|
34
34
|
import { extractDependencies } from './source-config.js';
|
|
35
35
|
import {} from './diagnostics.js';
|
|
36
|
+
import { to_error_message } from './error.js';
|
|
36
37
|
import { toPosixPath } from './paths.js';
|
|
37
38
|
/**
|
|
38
39
|
* Pre-transform a Svelte source file via svelte2tsx.
|
|
@@ -75,7 +76,7 @@ export const transformSvelteSource = (sourceFile) => {
|
|
|
75
76
|
diagnostics.push({
|
|
76
77
|
kind: 'transform_failed',
|
|
77
78
|
file: posixId,
|
|
78
|
-
message: `svelte2tsx failed to transform Svelte source: ${
|
|
79
|
+
message: `svelte2tsx failed to transform Svelte source: ${to_error_message(err)}`,
|
|
79
80
|
severity: 'error',
|
|
80
81
|
});
|
|
81
82
|
return { virtual: undefined, diagnostics };
|
|
@@ -89,7 +90,7 @@ export const transformSvelteSource = (sourceFile) => {
|
|
|
89
90
|
diagnostics.push({
|
|
90
91
|
kind: 'source_map_failed',
|
|
91
92
|
file: posixId,
|
|
92
|
-
message: `Failed to parse svelte2tsx source map: ${
|
|
93
|
+
message: `Failed to parse svelte2tsx source map: ${to_error_message(err)}. Line/column positions for this file will reference virtual TypeScript output instead of the original Svelte source.`,
|
|
93
94
|
severity: 'warning',
|
|
94
95
|
});
|
|
95
96
|
}
|
|
@@ -204,19 +205,31 @@ const extractComponentSourceLine = (virtualSource, sourceMap) => {
|
|
|
204
205
|
*
|
|
205
206
|
* @returns the script tag content, or undefined if no matching script tag is found
|
|
206
207
|
*/
|
|
207
|
-
export const extractScriptContent = (svelteSource) =>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
export const extractScriptContent = (svelteSource) => findScriptContent(svelteSource, false);
|
|
209
|
+
/**
|
|
210
|
+
* Extract the content of the module `<script>` tag from Svelte source.
|
|
211
|
+
*
|
|
212
|
+
* Counterpart of `extractScriptContent` with the same attribute test inverted:
|
|
213
|
+
* matches only module scripts (`<script module>`, `<script context="module">`),
|
|
214
|
+
* so the two partition a source's script tags consistently.
|
|
215
|
+
*
|
|
216
|
+
* @returns the module script tag content, or undefined if no module script is found
|
|
217
|
+
*/
|
|
218
|
+
export const extractModuleScriptContent = (svelteSource) => findScriptContent(svelteSource, true);
|
|
219
|
+
/**
|
|
220
|
+
* Shared scan behind `extractScriptContent`/`extractModuleScriptContent`.
|
|
221
|
+
*
|
|
222
|
+
* A script tag is a module script when its attributes contain the word
|
|
223
|
+
* `module` — covers Svelte 5 `<script module>` (with any `lang`) and
|
|
224
|
+
* Svelte 4 `<script context="module">`.
|
|
225
|
+
*/
|
|
226
|
+
const findScriptContent = (svelteSource, wantModule) => {
|
|
212
227
|
const scriptRegex = /<script(\s+[^>]*)?>([^]*?)<\/script>/gi;
|
|
213
228
|
let match;
|
|
214
229
|
while ((match = scriptRegex.exec(svelteSource)) !== null) {
|
|
215
230
|
const attrs = match[1] ?? '';
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
continue;
|
|
219
|
-
return match[2];
|
|
231
|
+
if (/\bmodule\b/.test(attrs) === wantModule)
|
|
232
|
+
return match[2];
|
|
220
233
|
}
|
|
221
234
|
return undefined;
|
|
222
235
|
};
|
|
@@ -259,9 +272,11 @@ export const extractHtmlModuleComment = (svelteSource) => {
|
|
|
259
272
|
* Extract module-level comment from Svelte script content.
|
|
260
273
|
*
|
|
261
274
|
* Parses the script content as TypeScript and delegates to `extractModuleComment`
|
|
262
|
-
* for the shared `@module` tag detection logic.
|
|
275
|
+
* for the shared `@module` tag detection logic. Works on either script's
|
|
276
|
+
* content — instance `<script>` and `<script module>` (see
|
|
277
|
+
* `extractScriptContent`/`extractModuleScriptContent`).
|
|
263
278
|
*
|
|
264
|
-
* @param scriptContent - the content of
|
|
279
|
+
* @param scriptContent - the content of a `<script>` or `<script module>` tag
|
|
265
280
|
* @returns the cleaned module comment text, or undefined if none found
|
|
266
281
|
*/
|
|
267
282
|
export const extractSvelteModuleComment = (scriptContent) => {
|
|
@@ -575,7 +590,7 @@ const detectChildrenSnippet = (propsType, propsTypeNode, checker, diagnostics, c
|
|
|
575
590
|
diagnostics.push({
|
|
576
591
|
kind: 'svelte_prop_failed',
|
|
577
592
|
file: filePath,
|
|
578
|
-
message: `Failed to resolve type for "children" in ${componentName} while detecting acceptsChildren: ${
|
|
593
|
+
message: `Failed to resolve type for "children" in ${componentName} while detecting acceptsChildren: ${to_error_message(err)}`,
|
|
579
594
|
severity: 'warning',
|
|
580
595
|
componentName,
|
|
581
596
|
propName: 'children',
|
|
@@ -683,7 +698,7 @@ const extractPropsViaChecker = (virtualSource, checker, componentName, filePath,
|
|
|
683
698
|
file: filePath,
|
|
684
699
|
line: finalLine,
|
|
685
700
|
column: finalColumn,
|
|
686
|
-
message: `Failed to resolve type for prop "${prop.name}" in ${componentName}, falling back to 'any': ${
|
|
701
|
+
message: `Failed to resolve type for prop "${prop.name}" in ${componentName}, falling back to 'any': ${to_error_message(err)}`,
|
|
687
702
|
severity: 'warning',
|
|
688
703
|
componentName,
|
|
689
704
|
propName: prop.name,
|
|
@@ -726,8 +741,13 @@ export const analyzeSvelteModule = (sourceFile, modulePath, checker, options, di
|
|
|
726
741
|
});
|
|
727
742
|
return undefined;
|
|
728
743
|
}
|
|
729
|
-
// 1. Use analyzeExports for full checker-backed analysis (same as .ts files)
|
|
730
|
-
|
|
744
|
+
// 1. Use analyzeExports for full checker-backed analysis (same as .ts files).
|
|
745
|
+
// Its `moduleComment` is undefined for virtuals — the `<script module>`
|
|
746
|
+
// comment is extracted from the original source in step 4, because svelte2tsx
|
|
747
|
+
// hoists instance-script imports (with their leading JSDoc) to the virtual's
|
|
748
|
+
// top level, where an instance `@module` comment would masquerade as a
|
|
749
|
+
// `<script module>` one.
|
|
750
|
+
const { declarations: rawDeclarations, reExports, starExports, externalReExports, externalStarExports, } = analyzeExports(virtualTsSource, checker, options, diagnostics);
|
|
731
751
|
// 2. Filter internal svelte2tsx symbols and the default export (generated component class),
|
|
732
752
|
// and reclassify exported snippets from 'function' to 'snippet'
|
|
733
753
|
const moduleDeclarations = [];
|
|
@@ -903,11 +923,15 @@ export const analyzeSvelteModule = (sourceFile, modulePath, checker, options, di
|
|
|
903
923
|
const instanceModuleComment = scriptContent
|
|
904
924
|
? extractSvelteModuleComment(scriptContent)
|
|
905
925
|
: undefined;
|
|
926
|
+
const moduleScriptContent = extractModuleScriptContent(sourceFile.content);
|
|
927
|
+
const scriptModuleComment = moduleScriptContent
|
|
928
|
+
? extractSvelteModuleComment(moduleScriptContent)
|
|
929
|
+
: undefined;
|
|
906
930
|
const htmlModuleComment = extractHtmlModuleComment(sourceFile.content);
|
|
907
931
|
const moduleComment = instanceModuleComment ?? scriptModuleComment ?? htmlModuleComment;
|
|
908
|
-
// @nodocs has no module-level meaning — warn per misplaced comment
|
|
909
|
-
// <script module> source is covered by analyzeExports on the virtual above.
|
|
932
|
+
// @nodocs has no module-level meaning — warn per misplaced comment
|
|
910
933
|
warnModuleCommentNodocs(instanceModuleComment, modulePath, diagnostics);
|
|
934
|
+
warnModuleCommentNodocs(scriptModuleComment, modulePath, diagnostics);
|
|
911
935
|
warnModuleCommentNodocs(htmlModuleComment, modulePath, diagnostics);
|
|
912
936
|
// Warn if multiple @module sources exist
|
|
913
937
|
const moduleCommentSources = [
|
|
@@ -40,7 +40,8 @@ export declare const analyzeTypescriptModule: (sourceFileInfo: SourceFileInfo &
|
|
|
40
40
|
/**
|
|
41
41
|
* Analyze all exports from a TypeScript source file.
|
|
42
42
|
*
|
|
43
|
-
* Extracts the module-level comment via `extractModuleComment
|
|
43
|
+
* Extracts the module-level comment via `extractModuleComment` (skipped for
|
|
44
|
+
* svelte2tsx virtual files — see the inline note), star exports via
|
|
44
45
|
* `extractStarExports`, and all exported declarations with complete metadata.
|
|
45
46
|
* Handles re-exports by:
|
|
46
47
|
* - Same-name re-exports: tracked in `reExports` for `alsoExportedFrom` building
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-exports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EAErB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACN,KAAK,cAAc,EAInB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,mBAAmB,EAIxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,KAAK,cAAc,EAAuB,MAAM,yBAAyB,CAAC;AAMlF;;;;;;;;;;;;;;;;GAg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C,KAC5B,qBAgVF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC9B,QAAQ,EAAE,CAAC,MAAM,EACjB,YAAY,EAAE,CAAC,UAAU,EACzB,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,gBAAgB,cAAc,KAC5B,mBA+CF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,YAAY,EAAE,CAAC,UAAU,KAAG,MAAM,GAAG,SAqCzE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,GACnC,eAAe,MAAM,GAAG,SAAS,EACjC,MAAM,MAAM,EACZ,aAAa,KAAK,CAAC,UAAU,CAAC,KAC5B,IAUF,CAAC"}
|
|
@@ -266,7 +266,8 @@ const synthesizeCrossFileAlias = (publicName, aliasedSymbol, originalSource, ori
|
|
|
266
266
|
/**
|
|
267
267
|
* Analyze all exports from a TypeScript source file.
|
|
268
268
|
*
|
|
269
|
-
* Extracts the module-level comment via `extractModuleComment
|
|
269
|
+
* Extracts the module-level comment via `extractModuleComment` (skipped for
|
|
270
|
+
* svelte2tsx virtual files — see the inline note), star exports via
|
|
270
271
|
* `extractStarExports`, and all exported declarations with complete metadata.
|
|
271
272
|
* Handles re-exports by:
|
|
272
273
|
* - Same-name re-exports: tracked in `reExports` for `alsoExportedFrom` building
|
|
@@ -290,13 +291,17 @@ export const analyzeExports = (sourceFile, checker, options, diagnostics) => {
|
|
|
290
291
|
const reExports = [];
|
|
291
292
|
const externalReExports = [];
|
|
292
293
|
const isExternalFile = createIsExternalFile(options);
|
|
293
|
-
// Extract module-level comment
|
|
294
|
-
const moduleComment = extractModuleComment(sourceFile);
|
|
295
294
|
// Extract star exports (export * from './module' / 'pkg')
|
|
296
295
|
const { starExports, externalStarExports } = extractStarExports(sourceFile, checker, options);
|
|
297
296
|
// Normalize virtual paths once (e.g., Foo.svelte.__svelte2tsx__.ts → Foo.svelte)
|
|
298
297
|
// so re-export tracking matches real module paths
|
|
299
298
|
const currentFileName = stripVirtualSuffix(sourceFile.fileName);
|
|
299
|
+
// Extract module-level comment — skipped for svelte2tsx virtuals, where
|
|
300
|
+
// hoisted instance-script comments would read as module comments;
|
|
301
|
+
// `analyzeSvelteModule` extracts the `<script module>` comment from the
|
|
302
|
+
// original source instead (and owns its `@nodocs` warning)
|
|
303
|
+
const isVirtual = currentFileName !== sourceFile.fileName;
|
|
304
|
+
const moduleComment = isVirtual ? undefined : extractModuleComment(sourceFile);
|
|
300
305
|
warnModuleCommentNodocs(moduleComment, currentFileName, diagnostics);
|
|
301
306
|
// 1-based line of a node in this file. Virtual coordinates for Svelte
|
|
302
307
|
// `<script module>` sources — remapped in `analyzeSvelteModule`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-extract-class.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-extract-class.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAWjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC5B,MAAM,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,aAAa,KAAK,CAAC,UAAU,CAAC,KAC5B,IAwPF,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import ts from 'typescript';
|
|
15
15
|
import {} from './diagnostics.js';
|
|
16
|
+
import { to_error_message } from './error.js';
|
|
16
17
|
import { parseComment, applyToDeclaration } from './tsdoc.js';
|
|
17
18
|
import { detectReactivity, extractModifiers, getNodeLocation, parseGenericParam, populateCallableMember, } from './typescript-extract-shared.js';
|
|
18
19
|
/**
|
|
@@ -151,7 +152,7 @@ export const extractClassInfo = (node, checker, declaration, diagnostics) => {
|
|
|
151
152
|
file: loc.file,
|
|
152
153
|
line: loc.line,
|
|
153
154
|
column: loc.column,
|
|
154
|
-
message: `Failed to analyze member "${memberName}" in class "${className}": ${
|
|
155
|
+
message: `Failed to analyze member "${memberName}" in class "${className}": ${to_error_message(err)}`,
|
|
155
156
|
severity: 'warning',
|
|
156
157
|
className,
|
|
157
158
|
memberName,
|
|
@@ -240,7 +241,7 @@ export const extractClassInfo = (node, checker, declaration, diagnostics) => {
|
|
|
240
241
|
file: loc.file,
|
|
241
242
|
line: loc.line,
|
|
242
243
|
column: loc.column,
|
|
243
|
-
message: `Failed to analyze accessor "${accessorName}" in class "${className}": ${
|
|
244
|
+
message: `Failed to analyze accessor "${accessorName}" in class "${className}": ${to_error_message(err)}`,
|
|
244
245
|
severity: 'warning',
|
|
245
246
|
className,
|
|
246
247
|
memberName: accessorName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-extract-function.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-function.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-extract-function.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-function.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAC;AAQnD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,CAAC,MAAM,EACjB,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,OAAO,kBAAkB,GAAG,SAAS,EACrC,aAAa,KAAK,CAAC,UAAU,CAAC,KAC5B,IAuCF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,CAAC,MAAM,EACjB,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,aAAa,KAAK,CAAC,UAAU,CAAC,KAC5B,IAuBF,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import ts from 'typescript';
|
|
15
15
|
import {} from './diagnostics.js';
|
|
16
|
+
import { to_error_message } from './error.js';
|
|
16
17
|
import { detectReactivity, getNodeLocation, parseGenericParam, populateCallableMember, } from './typescript-extract-shared.js';
|
|
17
18
|
/**
|
|
18
19
|
* Extract function/method information including parameters
|
|
@@ -43,7 +44,7 @@ export const extractFunctionInfo = (node, symbol, checker, declaration, tsdoc, d
|
|
|
43
44
|
file: loc.file,
|
|
44
45
|
line: loc.line,
|
|
45
46
|
column: loc.column,
|
|
46
|
-
message: `Failed to analyze signature for "${symbol.name}": ${
|
|
47
|
+
message: `Failed to analyze signature for "${symbol.name}": ${to_error_message(err)}`,
|
|
47
48
|
severity: 'warning',
|
|
48
49
|
functionName: symbol.name,
|
|
49
50
|
});
|
|
@@ -94,7 +95,7 @@ export const extractVariableInfo = (node, symbol, checker, declaration, diagnost
|
|
|
94
95
|
file: loc.file,
|
|
95
96
|
line: loc.line,
|
|
96
97
|
column: loc.column,
|
|
97
|
-
message: `Failed to extract type for variable "${symbol.name}": ${
|
|
98
|
+
message: `Failed to extract type for variable "${symbol.name}": ${to_error_message(err)}`,
|
|
98
99
|
severity: 'warning',
|
|
99
100
|
symbolName: symbol.name,
|
|
100
101
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-extract-shared.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EACX,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EAEnB,aAAa,EAEb,UAAU,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAC,oBAAoB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAA8B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-extract-shared.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EACX,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EAEnB,aAAa,EAEb,UAAU,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAC,oBAAoB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAA8B,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAmC,KAAK,kBAAkB,EAAC,MA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';
|
|
17
18
|
import { applyToDeclaration, parseComment } from './tsdoc.js';
|
|
18
19
|
import {} from './typescript-program.js';
|
|
19
20
|
/**
|
|
@@ -595,7 +596,7 @@ export const emitCallOrConstructSignature = (getSignatures, signatureKind, resol
|
|
|
595
596
|
file: loc.file,
|
|
596
597
|
line: loc.line,
|
|
597
598
|
column: loc.column,
|
|
598
|
-
message: `Failed to analyze ${signatureKind} signatures for ${errorContext.kindLabel} "${declaration.name}": ${
|
|
599
|
+
message: `Failed to analyze ${signatureKind} signatures for ${errorContext.kindLabel} "${declaration.name}": ${to_error_message(err)}`,
|
|
599
600
|
severity: 'warning',
|
|
600
601
|
functionName: declaration.name ?? '<default export>',
|
|
601
602
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-extract-type-properties.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-type-properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-extract-type-properties.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-type-properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAC,KAAK,cAAc,EAAC,MAAM,yBAAyB,CAAC;AA+J5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACtC,MAAM,EAAE,CAAC,oBAAoB,EAC7B,UAAU,EAAE,CAAC,IAAI,EACjB,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,gBAAgB,cAAc,KAC5B,IA8IF,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import ts from 'typescript';
|
|
18
18
|
import {} from './diagnostics.js';
|
|
19
|
+
import { to_error_message } from './error.js';
|
|
19
20
|
import { parseComment, applyToDeclaration } from './tsdoc.js';
|
|
20
21
|
import {} from './typescript-program.js';
|
|
21
22
|
import { emitCallOrConstructSignature, filterExternalProperties, getNodeLocation, isExternalIntersectionBranch, populateCallableMember, resolveIntersectionTypeNode, } from './typescript-extract-shared.js';
|
|
@@ -116,7 +117,7 @@ const emitLocalIndexSignature = (declaration, nodeType, node, checker, diagnosti
|
|
|
116
117
|
file: loc.file,
|
|
117
118
|
line: loc.line,
|
|
118
119
|
column: loc.column,
|
|
119
|
-
message: `Failed to extract ${kind} index signature for type "${declaration.name ?? '<default export>'}": ${
|
|
120
|
+
message: `Failed to extract ${kind} index signature for type "${declaration.name ?? '<default export>'}": ${to_error_message(err)}`,
|
|
120
121
|
severity: 'warning',
|
|
121
122
|
symbolName: declaration.name ?? '<default export>',
|
|
122
123
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-extract-type.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-extract-type.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typescript-extract-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAC,KAAK,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAU5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC3B,MAAM,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,gBAAgB,cAAc,KAC5B,IA4KF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC3B,MAAM,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,oBAAoB,EACjC,aAAa,KAAK,CAAC,UAAU,CAAC,KAC5B,IA6DF,CAAC"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import ts from 'typescript';
|
|
21
21
|
import {} from './diagnostics.js';
|
|
22
|
+
import { to_error_message } from './error.js';
|
|
22
23
|
import { parseComment, applyToDeclaration } from './tsdoc.js';
|
|
23
24
|
import {} from './typescript-program.js';
|
|
24
25
|
import { emitCallOrConstructSignature, extractModifiers, getNodeLocation, parseGenericParam, populateCallableMember, } from './typescript-extract-shared.js';
|
|
@@ -49,7 +50,7 @@ export const extractTypeInfo = (node, checker, declaration, diagnostics, isExter
|
|
|
49
50
|
file: loc.file,
|
|
50
51
|
line: loc.line,
|
|
51
52
|
column: loc.column,
|
|
52
|
-
message: `Failed to extract type for "${declaration.name}": ${
|
|
53
|
+
message: `Failed to extract type for "${declaration.name}": ${to_error_message(err)}`,
|
|
53
54
|
severity: 'warning',
|
|
54
55
|
symbolName: declaration.name ?? '<default export>',
|
|
55
56
|
});
|
|
@@ -134,7 +135,7 @@ export const extractTypeInfo = (node, checker, declaration, diagnostics, isExter
|
|
|
134
135
|
file: loc.file,
|
|
135
136
|
line: loc.line,
|
|
136
137
|
column: loc.column,
|
|
137
|
-
message: `Failed to analyze interface method "${methodName}": ${
|
|
138
|
+
message: `Failed to analyze interface method "${methodName}": ${to_error_message(err)}`,
|
|
138
139
|
severity: 'warning',
|
|
139
140
|
functionName: methodName,
|
|
140
141
|
});
|
|
@@ -190,7 +191,7 @@ export const extractEnumInfo = (node, checker, declaration, diagnostics) => {
|
|
|
190
191
|
file: loc.file,
|
|
191
192
|
line: loc.line,
|
|
192
193
|
column: loc.column,
|
|
193
|
-
message: `Failed to extract type for "${declaration.name}": ${
|
|
194
|
+
message: `Failed to extract type for "${declaration.name}": ${to_error_message(err)}`,
|
|
194
195
|
severity: 'warning',
|
|
195
196
|
symbolName: declaration.name ?? '<default export>',
|
|
196
197
|
});
|
|
@@ -228,7 +229,7 @@ export const extractEnumInfo = (node, checker, declaration, diagnostics) => {
|
|
|
228
229
|
file: loc.file,
|
|
229
230
|
line: loc.line,
|
|
230
231
|
column: loc.column,
|
|
231
|
-
message: `Failed to extract type for enum member "${memberName}" in "${declaration.name}": ${
|
|
232
|
+
message: `Failed to extract type for enum member "${memberName}" in "${declaration.name}": ${to_error_message(err)}`,
|
|
232
233
|
severity: 'warning',
|
|
233
234
|
symbolName: memberName,
|
|
234
235
|
});
|
package/dist/vite.js
CHANGED
|
@@ -158,11 +158,11 @@ const svelteDocinfo = (options = {}) => {
|
|
|
158
158
|
if (!mod)
|
|
159
159
|
return;
|
|
160
160
|
server.moduleGraph.invalidateModule(mod);
|
|
161
|
-
// Hardcoded Vite URL encoding for
|
|
161
|
+
// Hardcoded Vite URL encoding for the `\0` prefix on virtual modules.
|
|
162
162
|
// Not a documented Vite public API — if Vite changes the encoding in a
|
|
163
163
|
// future release, HMR silently stops firing (initial load still works
|
|
164
|
-
// through the public resolveId/load hooks).
|
|
165
|
-
//
|
|
164
|
+
// through the public resolveId/load hooks). Revisit if Vite exposes a
|
|
165
|
+
// proper API for invalidating a virtual module by id.
|
|
166
166
|
const hmrPath = '/@id/__x00__virtual:svelte-docinfo';
|
|
167
167
|
server.hot.send({
|
|
168
168
|
type: 'update',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-docinfo",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "static analysis for TypeScript and Svelte",
|
|
5
5
|
"glyph": "📜",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -51,17 +51,18 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@fuzdev/blake3_wasm": "^0.1.1",
|
|
54
|
-
"@fuzdev/fuz_code": "^0.46.
|
|
55
|
-
"@fuzdev/fuz_css": "^0.
|
|
56
|
-
"@fuzdev/fuz_ui": "^0.
|
|
54
|
+
"@fuzdev/fuz_code": "^0.46.1",
|
|
55
|
+
"@fuzdev/fuz_css": "^0.63.2",
|
|
56
|
+
"@fuzdev/fuz_ui": "^0.205.1",
|
|
57
57
|
"@fuzdev/fuz_util": "^0.65.1",
|
|
58
|
-
"@fuzdev/gro": "^0.
|
|
58
|
+
"@fuzdev/gro": "^0.205.1",
|
|
59
|
+
"@fuzdev/mdz": "^0.1.0",
|
|
59
60
|
"@ryanatkn/eslint-config": "^0.12.1",
|
|
60
61
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
61
62
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
62
63
|
"@sveltejs/kit": "^2.64.0",
|
|
63
64
|
"@sveltejs/package": "^2.5.7",
|
|
64
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
65
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
65
66
|
"@types/estree": "^1.0.8",
|
|
66
67
|
"@types/node": "^24.10.4",
|
|
67
68
|
"@types/picomatch": "^4.0.2",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"svelte2tsx": "^0.7.55",
|
|
78
79
|
"tslib": "^2.8.1",
|
|
79
80
|
"typescript-eslint": "^8.48.1",
|
|
80
|
-
"vite": "^
|
|
81
|
+
"vite": "^8.0.16",
|
|
81
82
|
"vitest": "^4.0.15",
|
|
82
83
|
"zimmerframe": "^1.1.4",
|
|
83
84
|
"zod": "^4.3.6"
|