@telorun/kernel 0.24.0 → 0.24.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/module/import-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAI1E,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,GAAG,EACb,GAAG,EAAE,wBAAwB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"import-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/module/import-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAI1E,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,GAAG,EACb,GAAG,EAAE,wBAAwB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAmN3B;AAeD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagnosticSeverity, StaticAnalyzer } from "@telorun/analyzer";
|
|
1
|
+
import { AnalysisRegistry, DiagnosticSeverity, StaticAnalyzer } from "@telorun/analyzer";
|
|
2
2
|
import { RuntimeError } from "@telorun/sdk";
|
|
3
3
|
import { ModuleContext } from "../../module-context.js";
|
|
4
4
|
import { isDefaultPolicy, normalizeRuntime } from "../../runtime-registry.js";
|
|
@@ -23,18 +23,29 @@ export async function create(resource, ctx) {
|
|
|
23
23
|
// loader keyed its caches under — without which fast paths like
|
|
24
24
|
// `isImportValidatedAtLoad` silently miss.
|
|
25
25
|
const resolvedUrl = ctx.resolveImportUrl(base, moduleSource);
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
// The analysis-flattened graph (follows Telo.Import chains, includes forwarded
|
|
27
|
+
// sub-import exports) serves two purposes here: validating the imported subtree,
|
|
28
|
+
// and populating a CHILD-SCOPED analysis registry whose top-level alias scope is
|
|
29
|
+
// the imported library's own. That child scope is required to normalize the
|
|
30
|
+
// library's `!ref` sentinels (resolve them to `{kind, name}`) before its
|
|
31
|
+
// resources are registered below — the same step the root load performs via
|
|
32
|
+
// `analyzer.normalize`. Without it a `!ref` inside the library reaches its
|
|
33
|
+
// controller as a raw sentinel and Phase-5 injection (which only recognizes
|
|
34
|
+
// `{kind, name}`) silently skips it.
|
|
35
|
+
const analysisManifests = await ctx.loadManifests(resolvedUrl);
|
|
36
|
+
const analyzer = new StaticAnalyzer();
|
|
37
|
+
const childRegistry = new AnalysisRegistry();
|
|
38
|
+
// Fast path: when the kernel's load-time `analyzeErrors` already covered this
|
|
39
|
+
// import's subtree (the common case — every Telo.Import declared in the entry
|
|
40
|
+
// graph is walked by `loadGraph` and validated by `kernel.load`), skip the
|
|
41
|
+
// per-resource diagnostic passes. Registration of identities / aliases /
|
|
42
|
+
// definitions still runs (it precedes the skipValidation early-return), so the
|
|
43
|
+
// child registry is populated for normalization either way. The full analysis
|
|
44
|
+
// runs for URLs that arrived programmatically after `load()` (e.g. dynamically
|
|
45
|
+
// constructed imports in tests).
|
|
46
|
+
const validatedAtLoad = ctx.isImportValidatedAtLoad(resolvedUrl);
|
|
47
|
+
const diagnostics = analyzer.analyze(analysisManifests, { skipValidation: validatedAtLoad }, childRegistry);
|
|
48
|
+
if (!validatedAtLoad) {
|
|
38
49
|
const errors = diagnostics
|
|
39
50
|
.filter((d) => d.severity === DiagnosticSeverity.Error)
|
|
40
51
|
.map((d) => d.message);
|
|
@@ -49,10 +60,16 @@ export async function create(resource, ctx) {
|
|
|
49
60
|
// those expanded into Telo.Import manifests and registered in its child
|
|
50
61
|
// context — without it, a transitively-imported library's inline imports
|
|
51
62
|
// would load but never execute (the execute-gap, one level down).
|
|
52
|
-
const
|
|
63
|
+
const rawManifests = await ctx.loadModule(resolvedUrl, {
|
|
53
64
|
compile: true,
|
|
54
65
|
desugarImports: true,
|
|
55
66
|
});
|
|
67
|
+
// Normalize in the library's own scope: extract inline resources and resolve
|
|
68
|
+
// `!ref` sentinels to `{kind, name}` (mirrors the root load at kernel.ts).
|
|
69
|
+
// `analysisManifests` are passed as cross-module resolution targets so a library
|
|
70
|
+
// that references its OWN sub-imports' exported instances (`!ref SubAlias.name`)
|
|
71
|
+
// resolves across that inner boundary too.
|
|
72
|
+
const manifests = analyzer.normalize(rawManifests, childRegistry, analysisManifests);
|
|
56
73
|
// Import targets must be Telo.Library — Applications are run directly, not imported.
|
|
57
74
|
const moduleManifest = manifests.find((m) => m.kind === "Telo.Library");
|
|
58
75
|
if (!moduleManifest) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-controller.js","sourceRoot":"","sources":["../../../src/controllers/module/import-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"import-controller.js","sourceRoot":"","sources":["../../../src/controllers/module/import-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,C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HANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagnosticSeverity, StaticAnalyzer } from "@telorun/analyzer";
|
|
1
|
+
import { AnalysisRegistry, DiagnosticSeverity, StaticAnalyzer } from "@telorun/analyzer";
|
|
2
2
|
import type { ResourceInstance } from "@telorun/sdk";
|
|
3
3
|
import { RuntimeError } from "@telorun/sdk";
|
|
4
4
|
import type { BuiltinControllerContext } from "../../internal-context.js";
|
|
@@ -33,18 +33,34 @@ export async function create(
|
|
|
33
33
|
// `isImportValidatedAtLoad` silently miss.
|
|
34
34
|
const resolvedUrl = ctx.resolveImportUrl(base, moduleSource);
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
// The analysis-flattened graph (follows Telo.Import chains, includes forwarded
|
|
37
|
+
// sub-import exports) serves two purposes here: validating the imported subtree,
|
|
38
|
+
// and populating a CHILD-SCOPED analysis registry whose top-level alias scope is
|
|
39
|
+
// the imported library's own. That child scope is required to normalize the
|
|
40
|
+
// library's `!ref` sentinels (resolve them to `{kind, name}`) before its
|
|
41
|
+
// resources are registered below — the same step the root load performs via
|
|
42
|
+
// `analyzer.normalize`. Without it a `!ref` inside the library reaches its
|
|
43
|
+
// controller as a raw sentinel and Phase-5 injection (which only recognizes
|
|
44
|
+
// `{kind, name}`) silently skips it.
|
|
45
|
+
const analysisManifests = await ctx.loadManifests(resolvedUrl);
|
|
46
|
+
const analyzer = new StaticAnalyzer();
|
|
47
|
+
const childRegistry = new AnalysisRegistry();
|
|
48
|
+
|
|
49
|
+
// Fast path: when the kernel's load-time `analyzeErrors` already covered this
|
|
50
|
+
// import's subtree (the common case — every Telo.Import declared in the entry
|
|
51
|
+
// graph is walked by `loadGraph` and validated by `kernel.load`), skip the
|
|
52
|
+
// per-resource diagnostic passes. Registration of identities / aliases /
|
|
53
|
+
// definitions still runs (it precedes the skipValidation early-return), so the
|
|
54
|
+
// child registry is populated for normalization either way. The full analysis
|
|
55
|
+
// runs for URLs that arrived programmatically after `load()` (e.g. dynamically
|
|
56
|
+
// constructed imports in tests).
|
|
57
|
+
const validatedAtLoad = ctx.isImportValidatedAtLoad(resolvedUrl);
|
|
58
|
+
const diagnostics = analyzer.analyze(
|
|
59
|
+
analysisManifests,
|
|
60
|
+
{ skipValidation: validatedAtLoad },
|
|
61
|
+
childRegistry,
|
|
62
|
+
);
|
|
63
|
+
if (!validatedAtLoad) {
|
|
48
64
|
const errors = diagnostics
|
|
49
65
|
.filter((d) => d.severity === DiagnosticSeverity.Error)
|
|
50
66
|
.map((d) => d.message);
|
|
@@ -63,10 +79,17 @@ export async function create(
|
|
|
63
79
|
// those expanded into Telo.Import manifests and registered in its child
|
|
64
80
|
// context — without it, a transitively-imported library's inline imports
|
|
65
81
|
// would load but never execute (the execute-gap, one level down).
|
|
66
|
-
const
|
|
82
|
+
const rawManifests = await ctx.loadModule(resolvedUrl, {
|
|
67
83
|
compile: true,
|
|
68
84
|
desugarImports: true,
|
|
69
85
|
});
|
|
86
|
+
|
|
87
|
+
// Normalize in the library's own scope: extract inline resources and resolve
|
|
88
|
+
// `!ref` sentinels to `{kind, name}` (mirrors the root load at kernel.ts).
|
|
89
|
+
// `analysisManifests` are passed as cross-module resolution targets so a library
|
|
90
|
+
// that references its OWN sub-imports' exported instances (`!ref SubAlias.name`)
|
|
91
|
+
// resolves across that inner boundary too.
|
|
92
|
+
const manifests = analyzer.normalize(rawManifests, childRegistry, analysisManifests);
|
|
70
93
|
// Import targets must be Telo.Library — Applications are run directly, not imported.
|
|
71
94
|
const moduleManifest = manifests.find((m: any) => m.kind === "Telo.Library");
|
|
72
95
|
if (!moduleManifest) {
|