@telorun/analyzer 0.70.0 → 0.72.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/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +4 -5
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +92 -10
- package/dist/call-graph.d.ts.map +1 -1
- package/dist/call-graph.js +10 -4
- package/dist/catch-scope.d.ts +72 -0
- package/dist/catch-scope.d.ts.map +1 -0
- package/dist/catch-scope.js +102 -0
- package/dist/cel-scope-query.d.ts +14 -0
- package/dist/cel-scope-query.d.ts.map +1 -1
- package/dist/cel-scope-query.js +36 -6
- package/dist/definition-registry.d.ts.map +1 -1
- package/dist/definition-registry.js +3 -4
- package/dist/deprecation.d.ts +21 -0
- package/dist/deprecation.d.ts.map +1 -0
- package/dist/deprecation.js +26 -0
- package/dist/flatten-for-analyzer.d.ts +2 -2
- package/dist/flatten-for-analyzer.d.ts.map +1 -1
- package/dist/flatten-for-analyzer.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/manifest-visitor.d.ts +17 -1
- package/dist/manifest-visitor.d.ts.map +1 -1
- package/dist/manifest-visitor.js +16 -4
- package/dist/migrations/report.d.ts +1 -1
- package/dist/migrations/report.d.ts.map +1 -1
- package/dist/migrations/report.js +5 -0
- package/dist/module-alias-scope.d.ts +65 -0
- package/dist/module-alias-scope.d.ts.map +1 -0
- package/dist/module-alias-scope.js +25 -0
- package/dist/{zone-module-documents.d.ts → module-documents.d.ts} +11 -7
- package/dist/module-documents.d.ts.map +1 -0
- package/dist/ref-sentinel-target.d.ts +38 -0
- package/dist/ref-sentinel-target.d.ts.map +1 -0
- package/dist/ref-sentinel-target.js +13 -0
- package/dist/ref-slot.d.ts +15 -0
- package/dist/ref-slot.d.ts.map +1 -1
- package/dist/ref-slot.js +7 -0
- package/dist/resolve-schema-type-refs.d.ts.map +1 -1
- package/dist/resolve-schema-type-refs.js +2 -1
- package/dist/resolve-throws-union.d.ts +47 -2
- package/dist/resolve-throws-union.d.ts.map +1 -1
- package/dist/resolve-throws-union.js +199 -20
- package/dist/resolve-zone-requirements.d.ts +3 -3
- package/dist/resolve-zone-requirements.d.ts.map +1 -1
- package/dist/resolve-zone-requirements.js +12 -12
- package/dist/schema-compat.d.ts.map +1 -1
- package/dist/schema-compat.js +13 -1
- package/dist/schema-error-report.d.ts.map +1 -1
- package/dist/schema-error-report.js +48 -4
- package/dist/schema-keywords.d.ts.map +1 -1
- package/dist/schema-keywords.js +3 -1
- package/dist/schema-walk.d.ts +27 -0
- package/dist/schema-walk.d.ts.map +1 -1
- package/dist/schema-walk.js +44 -0
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/dist/template-body.d.ts.map +1 -1
- package/dist/template-body.js +2 -4
- package/dist/types.d.ts +20 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -0
- package/dist/validate-identifier-names.d.ts +2 -2
- package/dist/validate-identifier-names.d.ts.map +1 -1
- package/dist/validate-identifier-names.js +22 -7
- package/dist/validate-invocation-contract.d.ts +5 -0
- package/dist/validate-invocation-contract.d.ts.map +1 -1
- package/dist/validate-invocation-contract.js +114 -3
- package/dist/validate-logging.d.ts.map +1 -1
- package/dist/validate-logging.js +2 -2
- package/dist/validate-ref-slots.d.ts +1 -1
- package/dist/validate-ref-slots.d.ts.map +1 -1
- package/dist/validate-ref-slots.js +34 -0
- package/dist/validate-references.d.ts +16 -5
- package/dist/validate-references.d.ts.map +1 -1
- package/dist/validate-references.js +57 -15
- package/dist/validate-resource-inputs.d.ts +1 -26
- package/dist/validate-resource-inputs.d.ts.map +1 -1
- package/dist/validate-resource-inputs.js +12 -2
- package/dist/validate-schema-type-refs.d.ts.map +1 -1
- package/dist/validate-schema-type-refs.js +2 -1
- package/dist/validate-throws-coverage.d.ts +5 -1
- package/dist/validate-throws-coverage.d.ts.map +1 -1
- package/dist/validate-throws-coverage.js +241 -86
- package/package.json +3 -3
- package/src/analysis-registry.ts +4 -5
- package/src/analyzer.ts +115 -11
- package/src/call-graph.ts +9 -3
- package/src/catch-scope.ts +157 -0
- package/src/cel-scope-query.ts +45 -8
- package/src/definition-registry.ts +3 -6
- package/src/deprecation.ts +36 -0
- package/src/flatten-for-analyzer.ts +3 -3
- package/src/index.ts +10 -3
- package/src/manifest-visitor.ts +30 -5
- package/src/migrations/report.ts +5 -1
- package/src/module-alias-scope.ts +94 -0
- package/src/{zone-module-documents.ts → module-documents.ts} +10 -6
- package/src/ref-sentinel-target.ts +46 -0
- package/src/ref-slot.ts +19 -0
- package/src/resolve-schema-type-refs.ts +2 -1
- package/src/resolve-throws-union.ts +253 -20
- package/src/resolve-zone-requirements.ts +14 -14
- package/src/schema-compat.ts +13 -0
- package/src/schema-error-report.ts +50 -6
- package/src/schema-keywords.ts +4 -1
- package/src/schema-walk.ts +56 -0
- package/src/telo-version.ts +1 -1
- package/src/template-body.ts +2 -5
- package/src/types.ts +21 -3
- package/src/validate-identifier-names.ts +28 -9
- package/src/validate-invocation-contract.ts +128 -2
- package/src/validate-logging.ts +2 -3
- package/src/validate-ref-slots.ts +41 -1
- package/src/validate-references.ts +74 -14
- package/src/validate-resource-inputs.ts +26 -3
- package/src/validate-schema-type-refs.ts +2 -1
- package/src/validate-throws-coverage.ts +344 -92
- package/dist/zone-module-documents.d.ts.map +0 -1
- /package/dist/{zone-module-documents.js → module-documents.js} +0 -0
|
@@ -5,6 +5,8 @@ import { navigateJsonPointer, substituteCelFields } from "./schema-compat.js";
|
|
|
5
5
|
import { REF_VALIDATION_SKIP_KINDS as SYSTEM_KINDS } from "./system-kinds.js";
|
|
6
6
|
import { resolveTypeFieldToSchema } from "./validate-cel-context.js";
|
|
7
7
|
import { DiagnosticSeverity } from "./types.js";
|
|
8
|
+
import { moduleAliasScope } from "./module-alias-scope.js";
|
|
9
|
+
import { isInjectedDeclaration } from "./resource-input.js";
|
|
8
10
|
const SOURCE = "telo-analyzer";
|
|
9
11
|
/**
|
|
10
12
|
* Liskov substitutability at a kind constraint: is `resolved` (a canonical
|
|
@@ -16,17 +18,28 @@ const SOURCE = "telo-analyzer";
|
|
|
16
18
|
*
|
|
17
19
|
* A value satisfies the slot when it transitively extends the target kind, or —
|
|
18
20
|
* for a CONCRETE target — IS that kind; `getByExtends` is the same transitive
|
|
19
|
-
* subtype index for both
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* subtype index for both. Accepts a constraint that resolves to nothing, and an
|
|
22
|
+
* abstract with no loaded implementations: partial context, where a rejection
|
|
23
|
+
* would be a guess.
|
|
24
|
+
*
|
|
25
|
+
* An abstract is satisfied only by an implementer, never by the abstract itself,
|
|
26
|
+
* because a resource declared `kind: <some abstract>` is refused at `create()`
|
|
27
|
+
* and reported as `ABSTRACT_KIND_INSTANTIATED` at its declaration — so accepting
|
|
28
|
+
* it here would leave the reference sites silent about a manifest that cannot
|
|
29
|
+
* run. `isDeclaration` is the ONE exception and it is not an instance: a
|
|
30
|
+
* library's `resources:` entry is constrained by kind alone, so its kind-only
|
|
31
|
+
* stand-in routinely IS an abstract (`connection: {kind: Sql.Connection}`), and
|
|
32
|
+
* every use of that name inside the library is a reference to it.
|
|
23
33
|
*/
|
|
24
|
-
export function kindSatisfies(resolved, targetKind, registry
|
|
34
|
+
export function kindSatisfies(resolved, targetKind, registry,
|
|
35
|
+
/** The referent is a kind-only stand-in for a `resources:` entry rather than a
|
|
36
|
+
* resource anything instantiates, so identity satisfies an abstract slot. */
|
|
37
|
+
isDeclaration = false) {
|
|
25
38
|
const canonical = registry.resolveRef(targetKind) ?? targetKind;
|
|
26
39
|
const targetDef = registry.resolve(canonical);
|
|
27
40
|
if (!targetDef)
|
|
28
41
|
return true;
|
|
29
|
-
if (targetDef.kind !== "Telo.Abstract" && resolved === canonical)
|
|
42
|
+
if ((targetDef.kind !== "Telo.Abstract" || isDeclaration) && resolved === canonical)
|
|
30
43
|
return true;
|
|
31
44
|
const subtypes = registry.getByExtends(canonical);
|
|
32
45
|
if (subtypes.some((d) => `${d.metadata.module}.${d.metadata.name}` === resolved))
|
|
@@ -53,7 +66,9 @@ export function kindSatisfies(resolved, targetKind, registry) {
|
|
|
53
66
|
/** {@link kindSatisfies} at every kind a slot accepts, rendered as messages.
|
|
54
67
|
* The acceptance rule is not restated here — only what to say when it fails,
|
|
55
68
|
* which needs the slot's alternatives and the target's flavour. */
|
|
56
|
-
function checkKind(kind, entry, registry, aliases
|
|
69
|
+
function checkKind(kind, entry, registry, aliases,
|
|
70
|
+
/** See {@link kindSatisfies}: the referent is a `resources:` stand-in. */
|
|
71
|
+
isDeclaration = false) {
|
|
57
72
|
const resolved = aliases.resolveKind(kind) ?? kind;
|
|
58
73
|
// A qualified kind whose prefix names no import in this scope is a bad NAME
|
|
59
74
|
// rather than a bad type — `{kind: NotAnAlias.Script}` where only `Lib` is
|
|
@@ -76,7 +91,7 @@ function checkKind(kind, entry, registry, aliases) {
|
|
|
76
91
|
const targetDef = registry.resolve(targetKind);
|
|
77
92
|
if (!targetDef)
|
|
78
93
|
return [];
|
|
79
|
-
if (!unknownAlias && kindSatisfies(resolved, targetKind, registry))
|
|
94
|
+
if (!unknownAlias && kindSatisfies(resolved, targetKind, registry, isDeclaration))
|
|
80
95
|
return [];
|
|
81
96
|
const subtypes = registry.getByExtends(targetKind);
|
|
82
97
|
const subtypeKinds = new Set(subtypes.map((d) => `${d.metadata.module}.${d.metadata.name}`));
|
|
@@ -311,7 +326,7 @@ export function validateReferences(resources, context) {
|
|
|
311
326
|
});
|
|
312
327
|
return;
|
|
313
328
|
}
|
|
314
|
-
const kindErrors = checkKind(target.kind, entry, registry, aliases);
|
|
329
|
+
const kindErrors = checkKind(target.kind, entry, registry, aliases, isInjectedDeclaration(target));
|
|
315
330
|
if (kindErrors.length > 0) {
|
|
316
331
|
diagnostics.push({
|
|
317
332
|
severity: DiagnosticSeverity.Error,
|
|
@@ -359,7 +374,11 @@ export function validateReferences(resources, context) {
|
|
|
359
374
|
return;
|
|
360
375
|
}
|
|
361
376
|
// 2. Kind check
|
|
362
|
-
const
|
|
377
|
+
const objectTarget = typeof refVal.name === "string"
|
|
378
|
+
? (visibleScopeManifests.find((m) => m.metadata?.name === refVal.name) ??
|
|
379
|
+
byName.get(refVal.name))
|
|
380
|
+
: undefined;
|
|
381
|
+
const kindErrors = checkKind(refVal.kind, entry, registry, aliases, isInjectedDeclaration(objectTarget));
|
|
363
382
|
if (kindErrors.length > 0) {
|
|
364
383
|
diagnostics.push({
|
|
365
384
|
severity: DiagnosticSeverity.Error,
|
|
@@ -448,8 +467,7 @@ export function validateReferences(resources, context) {
|
|
|
448
467
|
if (!isAbsolute && anchorName.includes(".")) {
|
|
449
468
|
const resolvedResourceKind = aliases.resolveKind(r.kind) ?? r.kind;
|
|
450
469
|
const resourceDef = registry.resolve(r.kind) ?? registry.resolve(resolvedResourceKind);
|
|
451
|
-
const
|
|
452
|
-
const ownerScope = (owningModule ? aliasesByModule?.get(owningModule) : undefined) ?? aliases;
|
|
470
|
+
const ownerScope = moduleAliasScope(resourceDef?.metadata, aliases, aliasesByModule);
|
|
453
471
|
const targetKind = ownerScope.resolveKind(anchorName);
|
|
454
472
|
if (!targetKind) {
|
|
455
473
|
// Names the ALIAS, not the whole kind path: the alias is what an
|
|
@@ -491,14 +509,38 @@ export function validateReferences(resources, context) {
|
|
|
491
509
|
for (const { value: fieldValue, path: concretePath } of resolveFieldEntries(r, fieldPath)) {
|
|
492
510
|
if (fieldValue == null)
|
|
493
511
|
continue;
|
|
494
|
-
|
|
512
|
+
// CEL leaves become schema-shaped placeholders first, exactly as the
|
|
513
|
+
// sibling-ref branch below does and for the same reason: a slot
|
|
514
|
+
// anchored at a shared value-shape is overwhelmingly written as
|
|
515
|
+
// expressions, so validating it raw reports every one of them as a
|
|
516
|
+
// type error and the check fires only on the literal case nobody
|
|
517
|
+
// writes. Omitting it here made one annotation mean two different
|
|
518
|
+
// things depending on which branch resolved it — a `when:` typed
|
|
519
|
+
// `boolean` accepted a `!cel` at a route's inline slot and rejected
|
|
520
|
+
// the identical expression at a slot anchored on the carrier that
|
|
521
|
+
// declares that very shape.
|
|
522
|
+
const substituted = substituteCelFields(fieldValue, subSchema);
|
|
523
|
+
// Anchored at the offending node INSIDE the value, not at the slot:
|
|
524
|
+
// a `returns:` list is an array of entries, and reporting every one
|
|
525
|
+
// of its issues on the `returns:` line puts three diagnostics on one
|
|
526
|
+
// line and none on the entry that is wrong.
|
|
527
|
+
const issues = registry.validateResourceConfig(substituted, subSchema);
|
|
495
528
|
for (const issue of issues) {
|
|
496
529
|
diagnostics.push({
|
|
497
530
|
severity: DiagnosticSeverity.Error,
|
|
498
531
|
code: "DEPENDENT_SCHEMA_MISMATCH",
|
|
499
532
|
source: SOURCE,
|
|
500
|
-
message: `${resourceLabel}: '${concretePath}' does not match schema from '${anchorName}${jsonPointer}': ${issue}`,
|
|
501
|
-
data: {
|
|
533
|
+
message: `${resourceLabel}: '${concretePath}' does not match schema from '${anchorName}${jsonPointer}': ${issue.message}`,
|
|
534
|
+
data: {
|
|
535
|
+
resource: resourceData,
|
|
536
|
+
filePath,
|
|
537
|
+
// An index-first sub-path (`[0].content`) joins with no dot.
|
|
538
|
+
path: !issue.path
|
|
539
|
+
? concretePath
|
|
540
|
+
: issue.path.startsWith("[")
|
|
541
|
+
? `${concretePath}${issue.path}`
|
|
542
|
+
: `${concretePath}.${issue.path}`,
|
|
543
|
+
},
|
|
502
544
|
});
|
|
503
545
|
}
|
|
504
546
|
}
|
|
@@ -2,34 +2,9 @@ import type { ResourceManifest } from "@telorun/sdk";
|
|
|
2
2
|
import type { AliasResolver } from "./alias-resolver.js";
|
|
3
3
|
import type { DefinitionRegistry } from "./definition-registry.js";
|
|
4
4
|
import { type AnalysisDiagnostic } from "./types.js";
|
|
5
|
-
/**
|
|
6
|
-
* The strict half of {@link readResourceInputs} — the `validate-ref-slots.ts`
|
|
7
|
-
* split applied to the resource-input boundary, and not optional for the same
|
|
8
|
-
* reason: the two sides fail in OPPOSITE directions. An unreadable DECLARATION
|
|
9
|
-
* leaves the library referencing a name nothing stands behind; an unchecked
|
|
10
|
-
* INJECTION hands a library an instance of a kind it never asked for, which
|
|
11
|
-
* surfaces as a method-missing failure inside someone else's module.
|
|
12
|
-
*
|
|
13
|
-
* Two surfaces, scoped the same way every other declaration check is — to the
|
|
14
|
-
* entry's own modules, since a published dependency's block is not the
|
|
15
|
-
* consumer's to fix:
|
|
16
|
-
*
|
|
17
|
-
* - **The library's own declaration.** Each entry's alias-qualified `kind:` must
|
|
18
|
-
* resolve in the DECLARING module's scope (`RESOURCE_INPUT_KIND_UNRESOLVED`).
|
|
19
|
-
* A constraint that resolves to nothing accepts anything, which is the same
|
|
20
|
-
* hole `X_TELO_REF_UNRESOLVED` exists to close one level down.
|
|
21
|
-
* - **The injection site.** Every declared entry must be supplied
|
|
22
|
-
* (`RESOURCE_INPUT_MISSING` — the same failure as a missing required
|
|
23
|
-
* variable), nothing beyond them may be (`RESOURCE_INPUT_UNKNOWN`), the value
|
|
24
|
-
* must name a resource that exists (`RESOURCE_INPUT_UNRESOLVED`), and its
|
|
25
|
-
* kind must satisfy the declared constraint transitively
|
|
26
|
-
* (`RESOURCE_INPUT_KIND_MISMATCH`).
|
|
27
|
-
*
|
|
28
|
-
* Browser-safe.
|
|
29
|
-
*/
|
|
30
5
|
export declare function validateResourceInputs(manifests: ResourceManifest[], registry: DefinitionRegistry, aliases: AliasResolver, rootModules: Set<string>,
|
|
31
6
|
/** Kind acceptance, transitively — the `checkKind` rule `validate-references`
|
|
32
7
|
* applies at an ordinary ref slot, passed in rather than re-derived so the
|
|
33
8
|
* two cannot disagree about what satisfies a constraint. */
|
|
34
|
-
acceptsKind: (suppliedKind: string, requiredKind: string) => boolean): AnalysisDiagnostic[];
|
|
9
|
+
acceptsKind: (suppliedKind: string, requiredKind: string, suppliedIsDeclaration: boolean) => boolean): AnalysisDiagnostic[];
|
|
35
10
|
//# sourceMappingURL=validate-resource-inputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-resource-inputs.d.ts","sourceRoot":"","sources":["../src/validate-resource-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-resource-inputs.d.ts","sourceRoot":"","sources":["../src/validate-resource-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAOnE,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,YAAY,CAAC;AAqCzE,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC;AACxB;;6DAE6D;AAC7D,WAAW,EAAE,CACX,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,qBAAqB,EAAE,OAAO,KAC3B,OAAO,GACX,kBAAkB,EAAE,CAyMtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRefSentinel } from "@telorun/templating";
|
|
2
2
|
import { findDynamicLeaf } from "./resource-rule.js";
|
|
3
|
-
import { readResourceInputs, readSuppliedResources } from "./resource-input.js";
|
|
3
|
+
import { isInjectedDeclaration, readResourceInputs, readSuppliedResources, } from "./resource-input.js";
|
|
4
4
|
import { DiagnosticSeverity } from "./types.js";
|
|
5
5
|
const SOURCE = "telo-analyzer";
|
|
6
6
|
/**
|
|
@@ -28,6 +28,7 @@ const SOURCE = "telo-analyzer";
|
|
|
28
28
|
*
|
|
29
29
|
* Browser-safe.
|
|
30
30
|
*/
|
|
31
|
+
const declaringModule = (m) => m.metadata?.module;
|
|
31
32
|
export function validateResourceInputs(manifests, registry, aliases, rootModules,
|
|
32
33
|
/** Kind acceptance, transitively — the `checkKind` rule `validate-references`
|
|
33
34
|
* applies at an ordinary ref slot, passed in rather than re-derived so the
|
|
@@ -186,7 +187,16 @@ acceptsKind) {
|
|
|
186
187
|
if (typeof suppliedKind !== "string")
|
|
187
188
|
continue;
|
|
188
189
|
const canonical = aliases.resolveKind(suppliedKind) ?? suppliedKind;
|
|
189
|
-
|
|
190
|
+
// A library forwarding an input it was itself handed supplies a kind-only
|
|
191
|
+
// stand-in, whose kind is routinely the abstract the target declares. That
|
|
192
|
+
// is identity against an abstract, which an ordinary reference is refused
|
|
193
|
+
// — the referent there would be a resource nothing can instantiate, while
|
|
194
|
+
// here it is another declaration.
|
|
195
|
+
const suppliedName = value.name;
|
|
196
|
+
const supplied = typeof suppliedName === "string"
|
|
197
|
+
? manifests.find((c) => c.metadata?.name === suppliedName && isOwn(declaringModule(c)))
|
|
198
|
+
: undefined;
|
|
199
|
+
if (acceptsKind(canonical, entry, isInjectedDeclaration(supplied)))
|
|
190
200
|
continue;
|
|
191
201
|
out.push({
|
|
192
202
|
severity: DiagnosticSeverity.Error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-schema-type-refs.d.ts","sourceRoot":"","sources":["../src/validate-schema-type-refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-schema-type-refs.d.ts","sourceRoot":"","sources":["../src/validate-schema-type-refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3C,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,kBAAkB,EAAE,CAuDtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { canonicalTypeSchemaId, parseTeloTypeRef } from "@telorun/sdk";
|
|
2
2
|
import { DiagnosticSeverity } from "./types.js";
|
|
3
|
+
import { moduleAliasScope } from "./module-alias-scope.js";
|
|
3
4
|
const SOURCE = "telo-analyzer";
|
|
4
5
|
const SCHEMA_FIELDS = ["schema", "inputType", "outputType"];
|
|
5
6
|
/**
|
|
@@ -28,7 +29,7 @@ export function validateSchemaTypeRefs(manifests, registry, aliases, aliasesByMo
|
|
|
28
29
|
// validated against their own library when it's analyzed as a root.
|
|
29
30
|
if (ownModule && !rootModules.has(ownModule))
|
|
30
31
|
continue;
|
|
31
|
-
const resolver = (
|
|
32
|
+
const resolver = moduleAliasScope(m.metadata, aliases, aliasesByModule);
|
|
32
33
|
const filePath = m.metadata?.source;
|
|
33
34
|
const label = `${m.kind}/${name}`;
|
|
34
35
|
const walk = (value, path) => {
|
|
@@ -4,5 +4,9 @@ import { type AliasResolver } from "./alias-resolver.js";
|
|
|
4
4
|
import type { DefinitionRegistry } from "./definition-registry.js";
|
|
5
5
|
import { type AnalysisDiagnostic } from "./types.js";
|
|
6
6
|
/** Entry point — invoked once per analyze() run. */
|
|
7
|
-
export declare function validateThrowsCoverage(manifests: ResourceManifest[], defs: DefinitionRegistry, aliases: AliasResolver, env: Environment, aliasesByModule?: Map<string, AliasResolver>, rootModules?: Set<string
|
|
7
|
+
export declare function validateThrowsCoverage(manifests: ResourceManifest[], defs: DefinitionRegistry, aliases: AliasResolver, env: Environment, aliasesByModule?: Map<string, AliasResolver>, rootModules?: Set<string>,
|
|
8
|
+
/** Each imported library's full document set, so the walk can follow an
|
|
9
|
+
* exported entry point into the siblings it invokes — which a consumer's
|
|
10
|
+
* flat set does not carry. */
|
|
11
|
+
moduleManifests?: Map<string, ResourceManifest[]>): AnalysisDiagnostic[];
|
|
8
12
|
//# sourceMappingURL=validate-throws-coverage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-throws-coverage.d.ts","sourceRoot":"","sources":["../src/validate-throws-coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,
|
|
1
|
+
{"version":3,"file":"validate-throws-coverage.d.ts","sourceRoot":"","sources":["../src/validate-throws-coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAenE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA4kBzE,oDAAoD;AACpD,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,WAAW,EAChB,eAAe,GAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAa,EACvD,WAAW,GAAE,GAAG,CAAC,MAAM,CAAa;AACpC;;+BAE+B;AAC/B,eAAe,GAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAa,GAC3D,kBAAkB,EAAE,CAsLtB"}
|