@telorun/analyzer 0.16.0 → 0.16.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.
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +23 -0
- package/package.json +1 -1
- package/src/analyzer.ts +22 -0
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAiB9B,OAAO,EAAsB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAuhB/F,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,OAAO,GAAE,qBAA0B;IAI/C;;;;;;;;;;;;;;OAcG;IACH,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAiB9B,OAAO,EAAsB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAuhB/F,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,OAAO,GAAE,qBAA0B;IAI/C;;;;;;;;;;;;;;OAcG;IACH,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;IAypBvB,aAAa,CACX,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;IAMvB,SAAS,CACP,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,EAI1B,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,GACtC,gBAAgB,EAAE;IAqBrB,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,GACzB;QAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;CAsB5F"}
|
package/dist/analyzer.js
CHANGED
|
@@ -590,6 +590,29 @@ export class StaticAnalyzer {
|
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
+
// Seed `Self` for every module that contributes definitions but whose own
|
|
594
|
+
// Telo.Library doc isn't in this manifest set. `flattenForAnalyzer` forwards an
|
|
595
|
+
// imported library's definitions/abstracts/imports but NOT its module doc, so the
|
|
596
|
+
// module-doc loop above can't register `Self` for imported modules. Without this, a
|
|
597
|
+
// definition's `extends: Self.X` (a kind defined in the same library as the abstract)
|
|
598
|
+
// can't resolve and its `extendedBy` edge mis-keys under the literal "Self.X" — which
|
|
599
|
+
// stays invisible until another module also implements that abstract and flips the
|
|
600
|
+
// reference check from lenient to strict. `Self` always maps a module to its own name.
|
|
601
|
+
for (const m of manifests) {
|
|
602
|
+
if (m.kind !== "Telo.Definition" && m.kind !== "Telo.Abstract")
|
|
603
|
+
continue;
|
|
604
|
+
const ownModule = m.metadata?.module;
|
|
605
|
+
if (!ownModule || rootModules.has(ownModule))
|
|
606
|
+
continue;
|
|
607
|
+
let libResolver = aliasesByModule.get(ownModule);
|
|
608
|
+
if (!libResolver) {
|
|
609
|
+
libResolver = new AliasResolver();
|
|
610
|
+
aliasesByModule.set(ownModule, libResolver);
|
|
611
|
+
}
|
|
612
|
+
if (!libResolver.hasAlias("Self")) {
|
|
613
|
+
libResolver.registerImport("Self", ownModule, []);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
593
616
|
// Register definitions from Telo.Definition AND Telo.Abstract resources.
|
|
594
617
|
// Abstracts declare contracts that implementations target via `extends` (canonical)
|
|
595
618
|
// or `capability: <AbstractKind>` (legacy). Until they're registered, validateReferences
|
package/package.json
CHANGED
package/src/analyzer.ts
CHANGED
|
@@ -716,6 +716,28 @@ export class StaticAnalyzer {
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
+
// Seed `Self` for every module that contributes definitions but whose own
|
|
720
|
+
// Telo.Library doc isn't in this manifest set. `flattenForAnalyzer` forwards an
|
|
721
|
+
// imported library's definitions/abstracts/imports but NOT its module doc, so the
|
|
722
|
+
// module-doc loop above can't register `Self` for imported modules. Without this, a
|
|
723
|
+
// definition's `extends: Self.X` (a kind defined in the same library as the abstract)
|
|
724
|
+
// can't resolve and its `extendedBy` edge mis-keys under the literal "Self.X" — which
|
|
725
|
+
// stays invisible until another module also implements that abstract and flips the
|
|
726
|
+
// reference check from lenient to strict. `Self` always maps a module to its own name.
|
|
727
|
+
for (const m of manifests) {
|
|
728
|
+
if (m.kind !== "Telo.Definition" && m.kind !== "Telo.Abstract") continue;
|
|
729
|
+
const ownModule = (m.metadata as { module?: string } | undefined)?.module;
|
|
730
|
+
if (!ownModule || rootModules.has(ownModule)) continue;
|
|
731
|
+
let libResolver = aliasesByModule.get(ownModule);
|
|
732
|
+
if (!libResolver) {
|
|
733
|
+
libResolver = new AliasResolver();
|
|
734
|
+
aliasesByModule.set(ownModule, libResolver);
|
|
735
|
+
}
|
|
736
|
+
if (!libResolver.hasAlias("Self")) {
|
|
737
|
+
libResolver.registerImport("Self", ownModule, []);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
719
741
|
// Register definitions from Telo.Definition AND Telo.Abstract resources.
|
|
720
742
|
// Abstracts declare contracts that implementations target via `extends` (canonical)
|
|
721
743
|
// or `capability: <AbstractKind>` (legacy). Until they're registered, validateReferences
|