svelte-docinfo 0.5.3 → 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/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.map +1 -1
- package/dist/svelte.js +5 -4
- 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);
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAIN,KAAK,8BAA8B,EACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAE1C,OAAO,EAEN,KAAK,aAAa,EAMlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,KA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AAG,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.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,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,EAA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G;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
|
}
|
|
@@ -589,7 +590,7 @@ const detectChildrenSnippet = (propsType, propsTypeNode, checker, diagnostics, c
|
|
|
589
590
|
diagnostics.push({
|
|
590
591
|
kind: 'svelte_prop_failed',
|
|
591
592
|
file: filePath,
|
|
592
|
-
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)}`,
|
|
593
594
|
severity: 'warning',
|
|
594
595
|
componentName,
|
|
595
596
|
propName: 'children',
|
|
@@ -697,7 +698,7 @@ const extractPropsViaChecker = (virtualSource, checker, componentName, filePath,
|
|
|
697
698
|
file: filePath,
|
|
698
699
|
line: finalLine,
|
|
699
700
|
column: finalColumn,
|
|
700
|
-
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)}`,
|
|
701
702
|
severity: 'warning',
|
|
702
703
|
componentName,
|
|
703
704
|
propName: prop.name,
|
|
@@ -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":[],"mapp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,EAAE,CAAC,IAAI,EACpC,aAAa,oBAAoB,EACjC,SAAS,EAAE,CAAC,WAAW,EACvB,aAAa,KAAK,CAAC,UAAU,CAAC,EAC9B,cAAc;IAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,KAC9C,IAmDF,CAAC"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import ts from 'typescript';
|
|
16
16
|
import {} from './diagnostics.js';
|
|
17
|
+
import { to_error_message } from './error.js';
|
|
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"
|