@telorun/analyzer 0.54.0 → 0.55.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.
|
@@ -36,6 +36,18 @@ export declare class AnalysisRegistry {
|
|
|
36
36
|
/** An alias crossing no import boundary, never gated — `Self`, the `Telo` built-ins. */
|
|
37
37
|
registerUngatedAlias(alias: string, target: string): void;
|
|
38
38
|
resolveKind(kind: string): string | undefined;
|
|
39
|
+
/** Rewrite `telo://Self/<type>` / `telo://<Alias>/<type>` schema references in
|
|
40
|
+
* `manifests` to the canonical id their type registered under, in the scope
|
|
41
|
+
* each doc was declared in. Idempotent — an already-canonical ref resolves to
|
|
42
|
+
* no module and is left alone.
|
|
43
|
+
*
|
|
44
|
+
* `analyze()` runs this over its own view; a caller holding a separately
|
|
45
|
+
* flattened projection (the kernel's build-time validator warm, which must
|
|
46
|
+
* resolve a `$ref` contract exactly as the runtime will) needs it applied to
|
|
47
|
+
* that projection too. Exposed as a method because the alias tables are this
|
|
48
|
+
* registry's, and handing them out would make every consumer's scoping its
|
|
49
|
+
* own problem. */
|
|
50
|
+
resolveSchemaTypeRefs(manifests: ResourceManifest[]): void;
|
|
39
51
|
/**
|
|
40
52
|
* Iterates a resource's reference and scope fields as declared by its definition.
|
|
41
53
|
* Calls onRef for each plain reference field and onScope for each scope field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis-registry.d.ts","sourceRoot":"","sources":["../src/analysis-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKzE,OAAO,EAAqC,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"analysis-registry.d.ts","sourceRoot":"","sources":["../src/analysis-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA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AAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAUzC,QAAQ,IAAI,MAAM,EAAE;IAIpB;mEAC+D;IAC/D,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;IAIxC;;;gCAG4B;IAC5B,oBAAoB,IAAI,MAAM,EAAE;IAIhC;wEACoE;IACpE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIhD;;;;;;;;iDAQ6C;IAC7C,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS;IAqB9D;;;;;gEAK4D;IAC5D,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAiB7D,qFAAqF;IACrF,QAAQ,IAAI,eAAe;CAG5B"}
|
|
@@ -5,6 +5,7 @@ import { computeSuggestKind, computeValidUserFacingKinds } from "./kind-suggest.
|
|
|
5
5
|
import { visitManifest as runVisitManifest } from "./manifest-visitor.js";
|
|
6
6
|
import { resolveContract } from "./invocation-contract.js";
|
|
7
7
|
import { isRefEntry, isScopeEntry } from "./reference-field-map.js";
|
|
8
|
+
import { resolveSchemaTypeRefs as resolveSchemaTypeRefsIn } from "./resolve-schema-type-refs.js";
|
|
8
9
|
/**
|
|
9
10
|
* Accumulates type and alias knowledge for a running kernel or analysis session.
|
|
10
11
|
* Wraps AliasResolver and DefinitionRegistry into a single domain-level interface
|
|
@@ -33,6 +34,20 @@ export class AnalysisRegistry {
|
|
|
33
34
|
resolveKind(kind) {
|
|
34
35
|
return this.aliases.resolveKind(kind);
|
|
35
36
|
}
|
|
37
|
+
/** Rewrite `telo://Self/<type>` / `telo://<Alias>/<type>` schema references in
|
|
38
|
+
* `manifests` to the canonical id their type registered under, in the scope
|
|
39
|
+
* each doc was declared in. Idempotent — an already-canonical ref resolves to
|
|
40
|
+
* no module and is left alone.
|
|
41
|
+
*
|
|
42
|
+
* `analyze()` runs this over its own view; a caller holding a separately
|
|
43
|
+
* flattened projection (the kernel's build-time validator warm, which must
|
|
44
|
+
* resolve a `$ref` contract exactly as the runtime will) needs it applied to
|
|
45
|
+
* that projection too. Exposed as a method because the alias tables are this
|
|
46
|
+
* registry's, and handing them out would make every consumer's scoping its
|
|
47
|
+
* own problem. */
|
|
48
|
+
resolveSchemaTypeRefs(manifests) {
|
|
49
|
+
resolveSchemaTypeRefsIn(manifests, this.aliases, this.aliasesByModule);
|
|
50
|
+
}
|
|
36
51
|
/**
|
|
37
52
|
* Iterates a resource's reference and scope fields as declared by its definition.
|
|
38
53
|
* Calls onRef for each plain reference field and onScope for each scope field.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/analyzer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Telo Analyzer - Static manifest validator for Telo manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/node": "^20.0.0",
|
|
49
49
|
"typescript": "^5.0.0",
|
|
50
50
|
"vitest": "^2.1.8",
|
|
51
|
-
"@telorun/sdk": "0.
|
|
51
|
+
"@telorun/sdk": "0.68.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@telorun/sdk": "*"
|
package/src/analysis-registry.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { visitManifest as runVisitManifest, type ManifestVisitor } from "./manif
|
|
|
7
7
|
import type { ContractDirection, DefResolver } from "./extends-resolution.js";
|
|
8
8
|
import { resolveContract } from "./invocation-contract.js";
|
|
9
9
|
import { isRefEntry, isScopeEntry } from "./reference-field-map.js";
|
|
10
|
+
import { resolveSchemaTypeRefs as resolveSchemaTypeRefsIn } from "./resolve-schema-type-refs.js";
|
|
10
11
|
import type { AnalysisContext } from "./types.js";
|
|
11
12
|
|
|
12
13
|
/** One reference field declared by a resource's definition, derived purely from
|
|
@@ -61,6 +62,21 @@ export class AnalysisRegistry {
|
|
|
61
62
|
return this.aliases.resolveKind(kind);
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
/** Rewrite `telo://Self/<type>` / `telo://<Alias>/<type>` schema references in
|
|
66
|
+
* `manifests` to the canonical id their type registered under, in the scope
|
|
67
|
+
* each doc was declared in. Idempotent — an already-canonical ref resolves to
|
|
68
|
+
* no module and is left alone.
|
|
69
|
+
*
|
|
70
|
+
* `analyze()` runs this over its own view; a caller holding a separately
|
|
71
|
+
* flattened projection (the kernel's build-time validator warm, which must
|
|
72
|
+
* resolve a `$ref` contract exactly as the runtime will) needs it applied to
|
|
73
|
+
* that projection too. Exposed as a method because the alias tables are this
|
|
74
|
+
* registry's, and handing them out would make every consumer's scoping its
|
|
75
|
+
* own problem. */
|
|
76
|
+
resolveSchemaTypeRefs(manifests: ResourceManifest[]): void {
|
|
77
|
+
resolveSchemaTypeRefsIn(manifests, this.aliases, this.aliasesByModule);
|
|
78
|
+
}
|
|
79
|
+
|
|
64
80
|
/**
|
|
65
81
|
* Iterates a resource's reference and scope fields as declared by its definition.
|
|
66
82
|
* Calls onRef for each plain reference field and onScope for each scope field.
|