@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `metadata.deprecated` — the annotation's single reader.
|
|
3
|
+
*
|
|
4
|
+
* Structural validity belongs to `validate-module-metadata.ts` (the strict half,
|
|
5
|
+
* the `ref-slot.ts` split). This side is deliberately lenient: it reads a
|
|
6
|
+
* well-formed block and treats everything else as absent, so a malformed
|
|
7
|
+
* declaration in a published dependency never becomes a warning at a consumer's
|
|
8
|
+
* use site. The consumer can fix neither one, and reporting the second blames
|
|
9
|
+
* the wrong author.
|
|
10
|
+
*/
|
|
11
|
+
/** A deprecation as declared: why, and optionally what to use instead. */
|
|
12
|
+
export interface Deprecation {
|
|
13
|
+
/** What a consumer reads to know what to do instead. Always non-empty. */
|
|
14
|
+
reason: string;
|
|
15
|
+
/** Alias-qualified kind (kind docs) or module ref (module docs), **as written
|
|
16
|
+
* in the declaring file's own scope** — `Self.Thing` means nothing to a
|
|
17
|
+
* consumer, so a use site resolves it before quoting it. */
|
|
18
|
+
replacedBy?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function readDeprecation(metadata: unknown): Deprecation | undefined;
|
|
21
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../src/deprecation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf;;iEAE6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAc1E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `metadata.deprecated` — the annotation's single reader.
|
|
3
|
+
*
|
|
4
|
+
* Structural validity belongs to `validate-module-metadata.ts` (the strict half,
|
|
5
|
+
* the `ref-slot.ts` split). This side is deliberately lenient: it reads a
|
|
6
|
+
* well-formed block and treats everything else as absent, so a malformed
|
|
7
|
+
* declaration in a published dependency never becomes a warning at a consumer's
|
|
8
|
+
* use site. The consumer can fix neither one, and reporting the second blames
|
|
9
|
+
* the wrong author.
|
|
10
|
+
*/
|
|
11
|
+
export function readDeprecation(metadata) {
|
|
12
|
+
if (metadata === null || typeof metadata !== "object" || Array.isArray(metadata))
|
|
13
|
+
return undefined;
|
|
14
|
+
const block = metadata.deprecated;
|
|
15
|
+
if (block === null || typeof block !== "object" || Array.isArray(block))
|
|
16
|
+
return undefined;
|
|
17
|
+
const { reason, replacedBy } = block;
|
|
18
|
+
if (typeof reason !== "string" || reason.trim() === "")
|
|
19
|
+
return undefined;
|
|
20
|
+
return {
|
|
21
|
+
reason: reason.trim(),
|
|
22
|
+
...(typeof replacedBy === "string" && replacedBy.trim() !== ""
|
|
23
|
+
? { replacedBy: replacedBy.trim() }
|
|
24
|
+
: {}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResourceManifest } from "@telorun/sdk";
|
|
2
2
|
import type { LoadedGraph, LoadedModule } from "./loaded-types.js";
|
|
3
3
|
import { type ResourceInput } from "./resource-input.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ModuleDocuments } from "./module-documents.js";
|
|
5
5
|
/** One parsed `exports.resources` / `exports.kinds` entry. `name` is the exported
|
|
6
6
|
* instance name or kind suffix (the part after the dot, or the whole entry); `alias`
|
|
7
7
|
* (when set) is this library's own import the entry RE-EXPORTS from. */
|
|
@@ -179,7 +179,7 @@ export declare function stampRequiredResources(imports: ReadonlyArray<{
|
|
|
179
179
|
* projection needs the internal dispatch chain to derive an export's open
|
|
180
180
|
* requirements. Only libraries that actually export instances are included:
|
|
181
181
|
* a library exporting nothing has no export contract to derive. */
|
|
182
|
-
export declare function
|
|
182
|
+
export declare function collectModuleDocuments(graph: LoadedGraph): ModuleDocuments[];
|
|
183
183
|
/** Project a LoadedModule (owner + partials) to a flat ResourceManifest[]
|
|
184
184
|
* with `metadata.module` stamped on non-module docs. The kernel's runtime
|
|
185
185
|
* entry load uses this to convert a `Loader.loadModule` result into the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten-for-analyzer.d.ts","sourceRoot":"","sources":["../src/flatten-for-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EA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AAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GACpD,IAAI,CAMN;AA8DD;;;;yDAIyD;AACzD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,GAC3E,IAAI,CAIN;AAED;;;;cAIc;AACd,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAC1B,IAAI,CAKN;AAED;;;;;;;;;;;;qBAYqB;AACrB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC,EACvD,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GACnE,IAAI,CAeN;AAoBD;;;;;oEAKoE;AACpE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,EAAE,CAuB5E;AAED;;;;;6BAK6B;AAC7B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAEzE"}
|
|
@@ -483,7 +483,7 @@ function canonicalizeInputKind(kind, ownModule, aliasToModule) {
|
|
|
483
483
|
* projection needs the internal dispatch chain to derive an export's open
|
|
484
484
|
* requirements. Only libraries that actually export instances are included:
|
|
485
485
|
* a library exporting nothing has no export contract to derive. */
|
|
486
|
-
export function
|
|
486
|
+
export function collectModuleDocuments(graph) {
|
|
487
487
|
const out = [];
|
|
488
488
|
for (const [source, mod] of graph.modules) {
|
|
489
489
|
if (source === graph.rootSource)
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { RefFieldInfo } from "./analysis-registry.js";
|
|
|
3
3
|
export { StaticAnalyzer } from "./analyzer.js";
|
|
4
4
|
export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js";
|
|
5
5
|
export type { GraphLoadError, ImportEdge, LoadedFile, LoadedGraph, LoadedModule, ParseError, } from "./loaded-types.js";
|
|
6
|
-
export {
|
|
6
|
+
export { collectModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, stampRequiredResources, stampResolvedSource, stampSharedLifecycle, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
|
|
7
7
|
export { buildEvalPaths, celEvalModeAt, celEvalSites, declaresCelRegion, evalPathCovers, mergeCelEvalSites, pathMatchesScope, NO_CEL_EVAL_SITES, } from "./eval-paths.js";
|
|
8
8
|
export type { CelEvalSites } from "./eval-paths.js";
|
|
9
9
|
export { injectedDeclarations, isInjectedDeclaration, readLibraryLifecycle, readResourceInputs, readSuppliedResources, } from "./resource-input.js";
|
|
@@ -37,6 +37,8 @@ export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USE
|
|
|
37
37
|
export type { RefSlot, RefUse, RefUseCases } from "./ref-slot.js";
|
|
38
38
|
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
39
39
|
export type { StepSlot } from "./step-slot.js";
|
|
40
|
+
export { readDeprecation } from "./deprecation.js";
|
|
41
|
+
export type { Deprecation } from "./deprecation.js";
|
|
40
42
|
export { ANNOTATION_KEYWORDS, registerTeloKeywords, valueTypeKeyword, } from "./value-type-keyword.js";
|
|
41
43
|
export { applyTextEdits, isPlainSafe, quoteStyleOf, renderFixReplacement, } from "./yaml-source-edit.js";
|
|
42
44
|
export type { QuoteStyle, TextEdit } from "./yaml-source-edit.js";
|
|
@@ -53,7 +55,7 @@ export { hasProvidesZone, hasRequiresZone, providedZoneAttributes, readProvidesZ
|
|
|
53
55
|
export type { ProvidesZoneSlot, RequiresZoneSlot } from "./zone-slot.js";
|
|
54
56
|
export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalysis, zoneDocumentsSignature, } from "./resolve-zone-requirements.js";
|
|
55
57
|
export type { ZoneExportCache, ZoneExportCacheEntry, ZoneExportRequirements, ZoneRequirementSpec, } from "./resolve-zone-requirements.js";
|
|
56
|
-
export type {
|
|
58
|
+
export type { ModuleDocuments } from "./module-documents.js";
|
|
57
59
|
export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
|
|
58
60
|
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, dynamicNode, type DynamicLeaf, type ResourceRule, type ResourceRuleSeverity, type RuleSubject, } from "./resource-rule.js";
|
|
59
61
|
export { validateResourceRuleDeclarations, evaluateResourceRules, ruleExercised, RESOURCE_RULE_BUDGET_MS, type ResourceRuleIssue, type ResourceRuleFinding, } from "./validate-resource-rules.js";
|
|
@@ -125,7 +127,7 @@ export type { CelScopeQueryContext, ContextDeclarationSite } from "./cel-scope-q
|
|
|
125
127
|
export { navigateConcretePath } from "./manifest-path.js";
|
|
126
128
|
export { ManifestAnalysis } from "./manifest-analysis.js";
|
|
127
129
|
export type { ManifestRef } from "./manifest-analysis.js";
|
|
128
|
-
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, diagnosticFix } from "./types.js";
|
|
130
|
+
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, DiagnosticTag, diagnosticFix, } from "./types.js";
|
|
129
131
|
export type { AnalysisDiagnostic, AnalysisOptions, DiagnosticData, DiagnosticFix, LoaderInitOptions, LoadOptions, ManifestSource, Position, PositionIndex, Range } from "./types.js";
|
|
130
132
|
export * from "./manifest-schemas.js";
|
|
131
133
|
export * from "./schema-keywords.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,YAAY,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,YAAY,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GACpB,MAAM,2BAA2B,CAAC;AACnC,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gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC;AACpB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC;AAIrC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AnalysisRegistry } from "./analysis-registry.js";
|
|
2
2
|
export { StaticAnalyzer } from "./analyzer.js";
|
|
3
3
|
export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js";
|
|
4
|
-
export {
|
|
4
|
+
export { collectModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, stampRequiredResources, stampResolvedSource, stampSharedLifecycle, } from "./flatten-for-analyzer.js";
|
|
5
5
|
export { buildEvalPaths, celEvalModeAt, celEvalSites, declaresCelRegion, evalPathCovers, mergeCelEvalSites, pathMatchesScope, NO_CEL_EVAL_SITES, } from "./eval-paths.js";
|
|
6
6
|
export { injectedDeclarations, isInjectedDeclaration, readLibraryLifecycle, readResourceInputs, readSuppliedResources, } from "./resource-input.js";
|
|
7
7
|
export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
|
|
@@ -19,6 +19,7 @@ export { AMBIENT_CAPABILITIES, buildModuleGraph, contentKey, edgeClassOf, isAmbi
|
|
|
19
19
|
export { buildReferenceFieldMap, isRefEntry, isScopeEntry, satisfiesValueBranch, } from "./reference-field-map.js";
|
|
20
20
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
21
21
|
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
22
|
+
export { readDeprecation } from "./deprecation.js";
|
|
22
23
|
export { ANNOTATION_KEYWORDS, registerTeloKeywords, valueTypeKeyword, } from "./value-type-keyword.js";
|
|
23
24
|
export { applyTextEdits, isPlainSafe, quoteStyleOf, renderFixReplacement, } from "./yaml-source-edit.js";
|
|
24
25
|
export { KNOWN_HOST_AXES, evaluateRequires, readRequires } from "./requires-block.js";
|
|
@@ -82,7 +83,7 @@ export { CelScopeQuery } from "./cel-scope-query.js";
|
|
|
82
83
|
// threads for every question that needs both.
|
|
83
84
|
export { navigateConcretePath } from "./manifest-path.js";
|
|
84
85
|
export { ManifestAnalysis } from "./manifest-analysis.js";
|
|
85
|
-
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, diagnosticFix } from "./types.js";
|
|
86
|
+
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, DiagnosticTag, diagnosticFix, } from "./types.js";
|
|
86
87
|
export * from "./manifest-schemas.js";
|
|
87
88
|
// The JSON Schema vocabulary a manifest may write, as data — the source both the
|
|
88
89
|
// validating fragments and the IDE's completion are built from.
|
|
@@ -45,8 +45,24 @@ export interface ScopeBoundaryEvent {
|
|
|
45
45
|
source: ResourceManifest;
|
|
46
46
|
/** Dot-form prefixes of every `x-telo-scope` field on this resource. */
|
|
47
47
|
scopePrefixes: string[];
|
|
48
|
-
/**
|
|
48
|
+
/** VISIBILITY pointer (an `x-telo-scope` entry, e.g. `/steps`) → the manifests
|
|
49
|
+
* visible there. Keyed by where scoped names may be REFERENCED, which is not
|
|
50
|
+
* where they are DECLARED: `Run.Sequence` declares `x-telo-scope:
|
|
51
|
+
* ["/steps", "/targets"]` on its `with:` field, so one declaration appears
|
|
52
|
+
* under two keys and neither names `with`. Use {@link declarations} for the
|
|
53
|
+
* declaration site. */
|
|
49
54
|
manifestsByPointer: Map<string, ResourceManifest[]>;
|
|
55
|
+
/** Every inline declaration inside this resource's scopes, ONCE each, with the
|
|
56
|
+
* concrete path it is written at in the owner's document (`with[0]`).
|
|
57
|
+
*
|
|
58
|
+
* A diagnostic about a scoped resource has to anchor there: the resource is
|
|
59
|
+
* not a top-level document, so position lookup finds the OWNER and then walks
|
|
60
|
+
* this path into it. Deriving one from a visibility pointer instead names a
|
|
61
|
+
* region the declaration is not in (`steps[0]`). */
|
|
62
|
+
declarations: {
|
|
63
|
+
manifest: ResourceManifest;
|
|
64
|
+
path: string;
|
|
65
|
+
}[];
|
|
50
66
|
/** Names of every resource declared inside this resource's scopes. Used by
|
|
51
67
|
* the dependency graph to drop boot edges to scoped (on-demand) targets. */
|
|
52
68
|
enclosedNames: Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-visitor.d.ts","sourceRoot":"","sources":["../src/manifest-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAA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mB,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC7C,6EAA6E;IAC7E,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC;;+EAE2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;wDAMoD;IACpD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;6BAEyB;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACnC;AA+DD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,YAAiB,GACzB,IAAI,CA2MN"}
|
package/dist/manifest-visitor.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isRefSentinel, isTaggedSentinel, walkCelExpressions, } from "@telorun/templating";
|
|
2
2
|
import { isRefEntry, isSchemaFromEntry, isScopeEntry, resolveFieldEntries, } from "./reference-field-map.js";
|
|
3
|
+
import { moduleAliasScope } from "./module-alias-scope.js";
|
|
3
4
|
import { templateBodies, withTemplateSelf } from "./template-body.js";
|
|
4
5
|
import { extractContextsFromSchema, pathMatchesScope } from "./validate-cel-context.js";
|
|
5
6
|
/** Synthetic entry for a value-tree-discovered ref — these carry no declared
|
|
@@ -68,7 +69,14 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
68
69
|
continue;
|
|
69
70
|
if (skipKinds?.has(r.kind))
|
|
70
71
|
continue;
|
|
71
|
-
|
|
72
|
+
// A resource's own kind is written in the alias scope of the module that
|
|
73
|
+
// DECLARED it — see `moduleAliasScope`, which is the one place that rule
|
|
74
|
+
// lives. Resolving it through the entry's aliases alone left `definition`
|
|
75
|
+
// undefined for every forwarded resource, so its `x-telo-context` regions
|
|
76
|
+
// contributed nothing and `request` / `result` read as unknown identifiers
|
|
77
|
+
// inside the library's own routes, on a file the consumer cannot fix.
|
|
78
|
+
const moduleScope = moduleAliasScope(r.metadata, aliases, aliasesByModule);
|
|
79
|
+
const resolvedKind = moduleScope?.resolveKind(r.kind);
|
|
72
80
|
const definition = registry.resolve(r.kind) ??
|
|
73
81
|
(resolvedKind ? registry.resolve(resolvedKind) : undefined);
|
|
74
82
|
visitor.onResourceEnter?.({ source: r, definition });
|
|
@@ -76,8 +84,8 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
76
84
|
// doesn't re-emit a ref the field map already covered.
|
|
77
85
|
const emittedRefPaths = wantsNested ? new Set() : null;
|
|
78
86
|
if (wantsRefs || wantsScope || wantsSchemaFrom) {
|
|
79
|
-
const baseMap =
|
|
80
|
-
? registry.getFieldMapForKind(r.kind,
|
|
87
|
+
const baseMap = moduleScope
|
|
88
|
+
? registry.getFieldMapForKind(r.kind, moduleScope)
|
|
81
89
|
: registry.getFieldMap(r.kind);
|
|
82
90
|
// Expanded map drives ref/scope sites when requested; schema-from sites
|
|
83
91
|
// come from the base map (expansion replaces them with nested refs).
|
|
@@ -87,6 +95,7 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
87
95
|
if (refScopeMap && (wantsRefs || wantsScope)) {
|
|
88
96
|
const manifestsByPointer = new Map();
|
|
89
97
|
const scopeRefEntries = [];
|
|
98
|
+
const declarations = [];
|
|
90
99
|
for (const [fieldPath, entry] of refScopeMap) {
|
|
91
100
|
if (!isScopeEntry(entry))
|
|
92
101
|
continue;
|
|
@@ -96,6 +105,7 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
96
105
|
items.forEach((v, i) => {
|
|
97
106
|
if (!v || typeof v !== "object")
|
|
98
107
|
return;
|
|
108
|
+
const declarationPath = Array.isArray(fe.value) ? `${fe.path}[${i}]` : fe.path;
|
|
99
109
|
// A scope entry must be an inline resource definition; a `!ref`
|
|
100
110
|
// (tagged sentinel or resolved `{kind, name}`) is not — record it
|
|
101
111
|
// so a static diagnostic flags it instead of registering a
|
|
@@ -104,12 +114,13 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
104
114
|
if (isRefSentinel(v) ||
|
|
105
115
|
(typeof rec.kind === "string" && typeof rec.name === "string")) {
|
|
106
116
|
scopeRefEntries.push({
|
|
107
|
-
path:
|
|
117
|
+
path: declarationPath,
|
|
108
118
|
refName: isRefSentinel(v) ? v.source : String(rec.name),
|
|
109
119
|
});
|
|
110
120
|
return;
|
|
111
121
|
}
|
|
112
122
|
raw.push(v);
|
|
123
|
+
declarations.push({ manifest: v, path: declarationPath });
|
|
113
124
|
});
|
|
114
125
|
}
|
|
115
126
|
const pointers = Array.isArray(entry.scope) ? entry.scope : [entry.scope];
|
|
@@ -130,6 +141,7 @@ export function visitManifest(resources, registry, visitor, options = {}) {
|
|
|
130
141
|
source: r,
|
|
131
142
|
scopePrefixes,
|
|
132
143
|
manifestsByPointer,
|
|
144
|
+
declarations,
|
|
133
145
|
enclosedNames,
|
|
134
146
|
scopeRefEntries,
|
|
135
147
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { ResourceManifest } from "@telorun/sdk";
|
|
15
15
|
import { type PatchPlan } from "./patch.js";
|
|
16
16
|
import type { MigrationEntry, MigrationOperation, MigrationPath, MigrationRewrite } from "./types.js";
|
|
17
|
-
import type
|
|
17
|
+
import { type AnalysisDiagnostic } from "../types.js";
|
|
18
18
|
/** One patch that applied, as the reporting side needs to see it. */
|
|
19
19
|
export interface AppliedPatch {
|
|
20
20
|
readonly entry: MigrationEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/migrations/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;0CAY0C;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/migrations/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;0CAY0C;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAiB,KAAK,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AAEzF,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC7C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAUjE;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,aAAa,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAChD,kBAAkB,CAmCpB"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* a clause of the generated sentence. */
|
|
14
14
|
import { isTaggedSentinel } from "@telorun/templating";
|
|
15
15
|
import { formatMigrationPath } from "./patch.js";
|
|
16
|
+
import { DiagnosticTag } from "../types.js";
|
|
16
17
|
export function toRewrite(applied) {
|
|
17
18
|
return {
|
|
18
19
|
entryId: applied.entry.id,
|
|
@@ -36,6 +37,10 @@ export function toDiagnostic(applied, rewrite, source, manifests) {
|
|
|
36
37
|
severity: applied.entry.severity,
|
|
37
38
|
code: applied.entry.code,
|
|
38
39
|
source: "telo-analyzer",
|
|
40
|
+
// A migration IS a deprecation — a legacy spelling still read, and the one
|
|
41
|
+
// an author is being asked to stop writing — so the range carries the tag
|
|
42
|
+
// whatever severity the entry chose for itself.
|
|
43
|
+
tags: [DiagnosticTag.Deprecated],
|
|
39
44
|
message: `${rewrite.summary}\n${applied.entry.reason}\n${closing}`,
|
|
40
45
|
data: {
|
|
41
46
|
filePath: source,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AliasResolver, type ModuleScopes } from "./alias-resolver.js";
|
|
2
|
+
/**
|
|
3
|
+
* WHICH ALIAS TABLE A MANIFEST'S OWN NAMES ARE WRITTEN IN.
|
|
4
|
+
*
|
|
5
|
+
* An application analysis is flattened, so an imported library's definitions and
|
|
6
|
+
* exported instances are checked in the CONSUMER's pass. But every alias-qualified
|
|
7
|
+
* name on such a manifest — its `kind:`, its `extends:`, an `x-telo-schema-from`
|
|
8
|
+
* anchor — was written against the alias map of the module that DECLARED it. A
|
|
9
|
+
* library writes `kind: Http.Api` through an import the consumer has no reason to
|
|
10
|
+
* have, so resolving it through the entry's table finds nothing, and everything
|
|
11
|
+
* derived from the definition silently goes missing: the field map (Phase-5
|
|
12
|
+
* injection blind to a forwarded resource's ref slots) and the `x-telo-context`
|
|
13
|
+
* regions (`request` / `result` reported as unknown identifiers on a file the
|
|
14
|
+
* consumer cannot edit).
|
|
15
|
+
*
|
|
16
|
+
* **There are TWO fallbacks, not one, and this file is where they are told
|
|
17
|
+
* apart** — that is the whole reason they live together. They agree on every
|
|
18
|
+
* module that has a table, and differ on a non-root module that has none:
|
|
19
|
+
*
|
|
20
|
+
* - {@link moduleAliasScope} falls back to the GLOBAL table. For a question
|
|
21
|
+
* asked about an arbitrary manifest, where a missing entry means "this is the
|
|
22
|
+
* entry's own", which is what the global table answers correctly.
|
|
23
|
+
* - {@link declaringModuleScope} falls back to an EMPTY table for a non-root
|
|
24
|
+
* module. For canonicalizing what a library DECLARED, where resolving its
|
|
25
|
+
* `Http.Api` through the consumer's imports would silently bind a library's
|
|
26
|
+
* kind to whatever the app happens to import under that alias — a wrong
|
|
27
|
+
* answer, which is worse than none.
|
|
28
|
+
*
|
|
29
|
+
* Both rest on one invariant neither states inline: **a root module is never a
|
|
30
|
+
* key in `aliasesByModule`** — a root's imports are registered into the global
|
|
31
|
+
* table instead (see the `rootModules` guards in `analyze()`) — so for a
|
|
32
|
+
* consumer-owned manifest the two rules coincide and neither fallback is a
|
|
33
|
+
* degradation.
|
|
34
|
+
*
|
|
35
|
+
* Every READ of the rule goes through one of these two. What legitimately does
|
|
36
|
+
* not, and why, so the next reader does not have to re-derive it: the three
|
|
37
|
+
* sites in `analyze()` that POPULATE `aliasesByModule` (a write, not a lookup),
|
|
38
|
+
* and `resolve-ref-sentinels`, whose module is known non-root by construction and
|
|
39
|
+
* whose fallback is the raw kind rather than another table — a different rule
|
|
40
|
+
* that happens to read the same map.
|
|
41
|
+
*/
|
|
42
|
+
export declare function moduleAliasScope<A extends KindResolver, M extends KindResolver>(metadata: {
|
|
43
|
+
module?: unknown;
|
|
44
|
+
} | undefined, aliases: A, aliasesByModule: ReadonlyMap<string, M> | undefined): A | M;
|
|
45
|
+
export declare function moduleAliasScope<A extends KindResolver, M extends KindResolver>(metadata: {
|
|
46
|
+
module?: unknown;
|
|
47
|
+
} | undefined, aliases: A | undefined, aliasesByModule: ReadonlyMap<string, M> | undefined): A | M | undefined;
|
|
48
|
+
/** All this rule needs of a resolver, and deliberately all it asks for:
|
|
49
|
+
* `ModuleScopes` already types its map this way so a caller can hand over a
|
|
50
|
+
* lighter table, and requiring the full `AliasResolver` here would have made
|
|
51
|
+
* the one site that does (a template body) reach for a cast. */
|
|
52
|
+
interface KindResolver {
|
|
53
|
+
resolveKind(kind: string): string | undefined;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The scope a DECLARING module's own alias-form names are canonicalized in — the
|
|
57
|
+
* root-aware half of the rule above, and the one that must never fall through to
|
|
58
|
+
* the consumer's table. See this file's header for why the two differ.
|
|
59
|
+
*/
|
|
60
|
+
export declare function declaringModuleScope(ownModule: string | undefined, aliases: AliasResolver, scopes: {
|
|
61
|
+
aliasesByModule: Map<string, AliasResolver>;
|
|
62
|
+
rootModules: Set<string>;
|
|
63
|
+
}): AliasResolver;
|
|
64
|
+
export type { ModuleScopes };
|
|
65
|
+
//# sourceMappingURL=module-alias-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-alias-scope.d.ts","sourceRoot":"","sources":["../src/module-alias-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA0B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EAC7E,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAC1C,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAClD,CAAC,GAAG,CAAC,CAAC;AACT,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EAC7E,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAC1C,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAClD,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AAWrB;;;iEAGiE;AACjE,UAAU,YAAY;IACpB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC/C;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE;IAAE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GAChF,aAAa,CAMf;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AliasResolver, scopeResolverForModule } from "./alias-resolver.js";
|
|
2
|
+
export function moduleAliasScope(metadata, aliases, aliasesByModule) {
|
|
3
|
+
const declaringModule = metadata?.module;
|
|
4
|
+
if (typeof declaringModule !== "string")
|
|
5
|
+
return aliases;
|
|
6
|
+
return aliasesByModule?.get(declaringModule) ?? aliases;
|
|
7
|
+
}
|
|
8
|
+
/** An empty table, shared: a non-root module with no aliases of its own resolves
|
|
9
|
+
* nothing rather than resolving through the consumer's. One instance because it
|
|
10
|
+
* is immutable in use and allocating one per call put a resolver on a per-schema
|
|
11
|
+
* loop. */
|
|
12
|
+
const NO_ALIASES = new AliasResolver();
|
|
13
|
+
/**
|
|
14
|
+
* The scope a DECLARING module's own alias-form names are canonicalized in — the
|
|
15
|
+
* root-aware half of the rule above, and the one that must never fall through to
|
|
16
|
+
* the consumer's table. See this file's header for why the two differ.
|
|
17
|
+
*/
|
|
18
|
+
export function declaringModuleScope(ownModule, aliases, scopes) {
|
|
19
|
+
const own = scopeResolverForModule(ownModule, scopes.rootModules, scopes.aliasesByModule);
|
|
20
|
+
if (own)
|
|
21
|
+
return own;
|
|
22
|
+
// Root (or unknown-and-therefore-treated-as-root): the global table IS its
|
|
23
|
+
// import map. A non-root module with no table of its own resolves nothing.
|
|
24
|
+
return ownModule && !scopes.rootModules.has(ownModule) ? NO_ALIASES : aliases;
|
|
25
|
+
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import type { ResourceManifest } from "@telorun/sdk";
|
|
2
2
|
/**
|
|
3
|
-
* One imported library's FULL document set
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* One imported library's FULL document set — what the flattened analysis view
|
|
4
|
+
* no longer holds, since it forwards only each library's export surface and
|
|
5
|
+
* never its internal dispatch chain.
|
|
6
|
+
*
|
|
7
|
+
* Named for what it CARRIES rather than for who asked first: the zone stage's
|
|
8
|
+
* per-library export derivation was the original consumer, and the throws walk
|
|
9
|
+
* is the second — a third should not have to import "zone" to ask about
|
|
10
|
+
* something else again.
|
|
7
11
|
*
|
|
8
12
|
* Plain data in a module of its own, deliberately. It is produced by the
|
|
9
|
-
* loading side (`
|
|
13
|
+
* loading side (`collectModuleDocuments`), named in `AnalysisOptions`, and
|
|
10
14
|
* consumed by the projection; putting it in any of the three would make the
|
|
11
15
|
* other two import that one, and `types.ts` ↔ the projection is a genuine
|
|
12
16
|
* cycle. A leaf module with no imports of its own breaks it without an inline
|
|
13
17
|
* `import(...)` type expression standing in for the dependency nobody wanted.
|
|
14
18
|
*/
|
|
15
|
-
export interface
|
|
19
|
+
export interface ModuleDocuments {
|
|
16
20
|
/** The library's module name (its `Telo.Library` doc's `metadata.name`). */
|
|
17
21
|
module: string;
|
|
18
22
|
/** Stable source identity of the library's owner file — the cache key. */
|
|
@@ -24,4 +28,4 @@ export interface ZoneModuleDocuments {
|
|
|
24
28
|
/** The library's declared `exports.resources` entries (bare names). */
|
|
25
29
|
exportedNames: readonly string[];
|
|
26
30
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=module-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-documents.d.ts","sourceRoot":"","sources":["../src/module-documents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `!ref` names, parsed once.
|
|
3
|
+
*
|
|
4
|
+
* THE single reader of the tag's grammar, on the `ref-slot.ts` / `zone-slot.ts`
|
|
5
|
+
* precedent. Three passes had grown their own parse of the same scalar and they
|
|
6
|
+
* disagreed: one took the source verbatim, one split on the first dot and
|
|
7
|
+
* dropped every alias but `Self`, one split on the LAST dot and dropped the
|
|
8
|
+
* alias entirely — so the same `!ref Alias.name` named three different things
|
|
9
|
+
* depending on which pass was asking, and the loosest of the three resolved a
|
|
10
|
+
* bare name against whatever manifest happened to share it.
|
|
11
|
+
*
|
|
12
|
+
* The grammar itself is one line and is not in dispute: `!ref <name>` or
|
|
13
|
+
* `!ref <Alias>.<name>`, split on the FIRST dot, because that is what
|
|
14
|
+
* `resolveRefSentinels` does and a name may not contain one
|
|
15
|
+
* (`INVALID_NAME` rejects it at every declaration site).
|
|
16
|
+
*
|
|
17
|
+
* What this deliberately does NOT do is decide what to look up. A reduction is
|
|
18
|
+
* the caller's, and the three genuinely differ: an edge in the call graph points
|
|
19
|
+
* at a cross-module target and tolerates not resolving it; a zone correlation
|
|
20
|
+
* refuses to bind anything it cannot resolve exactly; a throws walk resolves in
|
|
21
|
+
* the DECLARING library first. Each states its own, over one parse.
|
|
22
|
+
*
|
|
23
|
+
* Browser-safe.
|
|
24
|
+
*/
|
|
25
|
+
export interface RefSentinelTarget {
|
|
26
|
+
/** The scalar as written, for a caller that wants the author's spelling. */
|
|
27
|
+
source: string;
|
|
28
|
+
/** The prefix before the first dot, `Self` included and not normalized away —
|
|
29
|
+
* a caller that treats `Self` as "no alias" says so itself. */
|
|
30
|
+
alias?: string;
|
|
31
|
+
/** The segment after the first dot, or the whole scalar when there is none. */
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
/** Parse a `!ref` sentinel. Returns `undefined` for anything that is not one —
|
|
35
|
+
* including the `{kind, name}` object `resolveRefSentinels` rewrites it into,
|
|
36
|
+
* which is a different shape with a different reader. */
|
|
37
|
+
export declare function refSentinelTarget(value: unknown): RefSentinelTarget | undefined;
|
|
38
|
+
//# sourceMappingURL=ref-sentinel-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-sentinel-target.d.ts","sourceRoot":"","sources":["../src/ref-sentinel-target.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf;oEACgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;0DAE0D;AAC1D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAM/E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isRefSentinel } from "@telorun/templating";
|
|
2
|
+
/** Parse a `!ref` sentinel. Returns `undefined` for anything that is not one —
|
|
3
|
+
* including the `{kind, name}` object `resolveRefSentinels` rewrites it into,
|
|
4
|
+
* which is a different shape with a different reader. */
|
|
5
|
+
export function refSentinelTarget(value) {
|
|
6
|
+
if (!isRefSentinel(value))
|
|
7
|
+
return undefined;
|
|
8
|
+
const source = value.source;
|
|
9
|
+
const dot = source.indexOf(".");
|
|
10
|
+
if (dot <= 0)
|
|
11
|
+
return { source, name: source };
|
|
12
|
+
return { source, alias: source.slice(0, dot), name: source.slice(dot + 1) };
|
|
13
|
+
}
|
package/dist/ref-slot.d.ts
CHANGED
|
@@ -77,6 +77,21 @@ export interface RefSlot {
|
|
|
77
77
|
* that carries this call's arguments. Replaces
|
|
78
78
|
* `x-telo-topology-role: inputs`. */
|
|
79
79
|
inputs?: string;
|
|
80
|
+
/** Throws raised by the target — or by anything the target drives — surface
|
|
81
|
+
* through the DECLARING resource, so its own throws union includes the
|
|
82
|
+
* target's and its catch scope encloses the target's.
|
|
83
|
+
*
|
|
84
|
+
* It exists because the relation is real where `use` correctly says nothing:
|
|
85
|
+
* `Http.Server.mounts[].mount` is a `dependency` (the server holds the mount
|
|
86
|
+
* and calls a convention method on it — control reaches a route through the
|
|
87
|
+
* MOUNT's own `trigger.inbound` slot, not through this one), yet a throw from
|
|
88
|
+
* that route is exactly what the server renders. Following every `dependency`
|
|
89
|
+
* edge instead would drag a connection's throws into a router's denominator.
|
|
90
|
+
*
|
|
91
|
+
* Declared by the kind that HOLDS, because only it knows the throws surface
|
|
92
|
+
* through it, and it is the same fact its runtime establishes by rethrowing —
|
|
93
|
+
* so the annotation and the behaviour cannot disagree. */
|
|
94
|
+
throwsThrough?: boolean;
|
|
80
95
|
/** `x-telo-inline: true` on the slot or any `anyOf` branch — accepts an inline
|
|
81
96
|
* `{kind, ...config}` definition, not only a `!ref`. */
|
|
82
97
|
inline: boolean;
|
package/dist/ref-slot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref-slot.d.ts","sourceRoot":"","sources":["../src/ref-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;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