@proteinjs/reflection-build 2.0.2 → 2.1.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.
Files changed (246) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/src/ReflectionDoctor.d.ts +6 -1
  3. package/dist/src/ReflectionDoctor.js +53 -51
  4. package/dist/src/ReflectionDoctor.js.map +1 -1
  5. package/dist/src/codegen/CanonicalSourceGraph.d.ts +22 -0
  6. package/dist/src/codegen/CanonicalSourceGraph.js +60 -0
  7. package/dist/src/codegen/CanonicalSourceGraph.js.map +1 -0
  8. package/dist/src/codegen/writeGeneratedIndex.d.ts +12 -3
  9. package/dist/src/codegen/writeGeneratedIndex.js +21 -13
  10. package/dist/src/codegen/writeGeneratedIndex.js.map +1 -1
  11. package/dist/src/parser/PackageSourceFiles.d.ts +30 -0
  12. package/dist/src/parser/PackageSourceFiles.js +151 -0
  13. package/dist/src/parser/PackageSourceFiles.js.map +1 -0
  14. package/dist/src/parser/SharedQualifiedNames.d.ts +43 -0
  15. package/dist/src/parser/SharedQualifiedNames.js +81 -0
  16. package/dist/src/parser/SharedQualifiedNames.js.map +1 -0
  17. package/dist/src/parser/createGraphBuilder.d.ts +6 -1
  18. package/dist/src/parser/createGraphBuilder.js +16 -31
  19. package/dist/src/parser/createGraphBuilder.js.map +1 -1
  20. package/dist/src/parser/createSourceGraph.d.ts +6 -1
  21. package/dist/src/parser/createSourceGraph.js +23 -38
  22. package/dist/src/parser/createSourceGraph.js.map +1 -1
  23. package/dist/test/Class.test.js +1 -1
  24. package/dist/test/Class.test.js.map +1 -1
  25. package/dist/test/ExamplePackageFixture.d.ts +47 -0
  26. package/dist/test/ExamplePackageFixture.js +207 -0
  27. package/dist/test/ExamplePackageFixture.js.map +1 -0
  28. package/dist/test/GraphEmitRelativePaths.test.js +1 -1
  29. package/dist/test/GraphEmitRelativePaths.test.js.map +1 -1
  30. package/dist/test/PackageSourceFiles.test.d.ts +1 -0
  31. package/dist/test/PackageSourceFiles.test.js +57 -0
  32. package/dist/test/PackageSourceFiles.test.js.map +1 -0
  33. package/dist/test/ReflectionDoctor.test.js +55 -18
  34. package/dist/test/ReflectionDoctor.test.js.map +1 -1
  35. package/dist/test/ReproducibleGeneratedIndex.test.d.ts +1 -0
  36. package/dist/test/ReproducibleGeneratedIndex.test.js +224 -0
  37. package/dist/test/ReproducibleGeneratedIndex.test.js.map +1 -0
  38. package/dist/test/SharedQualifiedNames.test.d.ts +1 -0
  39. package/dist/test/SharedQualifiedNames.test.js +186 -0
  40. package/dist/test/SharedQualifiedNames.test.js.map +1 -0
  41. package/dist/test/examples/reproducible/index.d.ts +4 -0
  42. package/dist/test/examples/reproducible/index.js +21 -0
  43. package/dist/test/examples/reproducible/index.js.map +1 -0
  44. package/dist/test/examples/reproducible/src/alpha/Alpha.d.ts +10 -0
  45. package/dist/test/examples/reproducible/src/alpha/Alpha.js +18 -0
  46. package/dist/test/examples/reproducible/src/alpha/Alpha.js.map +1 -0
  47. package/dist/test/examples/reproducible/src/alpha/Defaults.d.ts +2 -0
  48. package/dist/test/examples/reproducible/src/alpha/Defaults.js +6 -0
  49. package/dist/test/examples/reproducible/src/alpha/Defaults.js.map +1 -0
  50. package/dist/test/examples/reproducible/src/beta/Beta.d.ts +5 -0
  51. package/dist/test/examples/reproducible/src/beta/Beta.js +12 -0
  52. package/dist/test/examples/reproducible/src/beta/Beta.js.map +1 -0
  53. package/dist/test/examples/reproducible/src/beta/deep/Gamma.d.ts +4 -0
  54. package/dist/test/examples/reproducible/src/beta/deep/Gamma.js +11 -0
  55. package/dist/test/examples/reproducible/src/beta/deep/Gamma.js.map +1 -0
  56. package/dist/test/examples/reproducible/src/zeta/Defaults.d.ts +2 -0
  57. package/dist/test/examples/reproducible/src/zeta/Defaults.js +6 -0
  58. package/dist/test/examples/reproducible/src/zeta/Defaults.js.map +1 -0
  59. package/dist/test/examples/reproducible/src/zeta/Zeta.d.ts +7 -0
  60. package/dist/test/examples/reproducible/src/zeta/Zeta.js +18 -0
  61. package/dist/test/examples/reproducible/src/zeta/Zeta.js.map +1 -0
  62. package/dist/test/examples/shared-name/index.d.ts +1 -0
  63. package/dist/test/examples/shared-name/index.js +18 -0
  64. package/dist/test/examples/shared-name/index.js.map +1 -0
  65. package/dist/test/examples/shared-name/src/alpha/Widget.d.ts +4 -0
  66. package/dist/test/examples/shared-name/src/alpha/Widget.js +3 -0
  67. package/dist/test/examples/shared-name/src/alpha/Widget.js.map +1 -0
  68. package/dist/test/examples/shared-name/src/beta/Widget.d.ts +3 -0
  69. package/dist/test/examples/shared-name/src/beta/Widget.js +13 -0
  70. package/dist/test/examples/shared-name/src/beta/Widget.js.map +1 -0
  71. package/dist/test/examples/shared-name/src/gamma/Gear.d.ts +7 -0
  72. package/dist/test/examples/shared-name/src/gamma/Gear.js +5 -0
  73. package/dist/test/examples/shared-name/src/gamma/Gear.js.map +1 -0
  74. package/dist/test/examples/shared-name-pruned/index.d.ts +1 -0
  75. package/dist/test/examples/shared-name-pruned/index.js +18 -0
  76. package/dist/test/examples/shared-name-pruned/index.js.map +1 -0
  77. package/dist/test/examples/shared-name-pruned/src/alpha/Limits.d.ts +3 -0
  78. package/dist/test/examples/shared-name-pruned/src/alpha/Limits.js +6 -0
  79. package/dist/test/examples/shared-name-pruned/src/alpha/Limits.js.map +1 -0
  80. package/dist/test/examples/shared-name-pruned/src/alpha/Shape.d.ts +3 -0
  81. package/dist/test/examples/shared-name-pruned/src/alpha/Shape.js +3 -0
  82. package/dist/test/examples/shared-name-pruned/src/alpha/Shape.js.map +1 -0
  83. package/dist/test/examples/shared-name-pruned/src/alpha/Tile.d.ts +7 -0
  84. package/dist/test/examples/shared-name-pruned/src/alpha/Tile.js +11 -0
  85. package/dist/test/examples/shared-name-pruned/src/alpha/Tile.js.map +1 -0
  86. package/dist/test/examples/shared-name-pruned/src/beta/Limits.d.ts +3 -0
  87. package/dist/test/examples/shared-name-pruned/src/beta/Limits.js +6 -0
  88. package/dist/test/examples/shared-name-pruned/src/beta/Limits.js.map +1 -0
  89. package/dist/test/examples/shared-name-pruned/src/beta/Shape.d.ts +3 -0
  90. package/dist/test/examples/shared-name-pruned/src/beta/Shape.js +3 -0
  91. package/dist/test/examples/shared-name-pruned/src/beta/Shape.js.map +1 -0
  92. package/dist/test/examples/source-repository/a/generated/index.js +28 -28
  93. package/dist/test/examples/source-repository/a/generated/index.js.map +1 -1
  94. package/dist/test/examples/source-repository/a/src/ExtendsForeignType.d.ts +1 -1
  95. package/dist/test/examples/source-repository/a/src/ExtendsForeignType.js +5 -5
  96. package/dist/test/examples/source-repository/a/src/ExtendsForeignType.js.map +1 -1
  97. package/dist/test/examples/source-repository/b/generated/index.js +3 -3
  98. package/dist/test/examples/source-repository/b/generated/index.js.map +1 -1
  99. package/package.json +5 -5
  100. package/src/ReflectionDoctor.ts +37 -17
  101. package/src/codegen/CanonicalSourceGraph.ts +50 -0
  102. package/src/codegen/writeGeneratedIndex.ts +35 -9
  103. package/src/parser/PackageSourceFiles.ts +66 -0
  104. package/src/parser/SharedQualifiedNames.ts +76 -0
  105. package/src/parser/createGraphBuilder.ts +25 -10
  106. package/src/parser/createSourceGraph.ts +14 -16
  107. package/test/Class.test.ts +1 -1
  108. package/test/ExamplePackageFixture.ts +142 -0
  109. package/test/GraphEmitRelativePaths.test.ts +1 -1
  110. package/test/PackageSourceFiles.test.ts +42 -0
  111. package/test/ReflectionDoctor.test.ts +50 -12
  112. package/test/ReproducibleGeneratedIndex.test.ts +114 -0
  113. package/test/SharedQualifiedNames.test.ts +89 -0
  114. package/test/examples/reproducible/index.ts +4 -0
  115. package/test/examples/reproducible/src/alpha/Alpha.ts +13 -0
  116. package/test/examples/reproducible/src/alpha/Defaults.ts +4 -0
  117. package/test/examples/reproducible/src/beta/Beta.ts +7 -0
  118. package/test/examples/reproducible/src/beta/deep/Gamma.ts +5 -0
  119. package/test/examples/reproducible/src/zeta/Defaults.ts +4 -0
  120. package/test/examples/reproducible/src/zeta/Zeta.ts +9 -0
  121. package/test/examples/shared-name/index.ts +1 -0
  122. package/test/examples/shared-name/src/alpha/Widget.ts +6 -0
  123. package/test/examples/shared-name/src/beta/Widget.ts +5 -0
  124. package/test/examples/shared-name/src/gamma/Gear.ts +9 -0
  125. package/test/examples/shared-name-pruned/index.ts +1 -0
  126. package/test/examples/shared-name-pruned/src/alpha/Limits.ts +2 -0
  127. package/test/examples/shared-name-pruned/src/alpha/Shape.ts +3 -0
  128. package/test/examples/shared-name-pruned/src/alpha/Tile.ts +9 -0
  129. package/test/examples/shared-name-pruned/src/beta/Limits.ts +2 -0
  130. package/test/examples/shared-name-pruned/src/beta/Shape.ts +4 -0
  131. package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.d.ts +22 -0
  132. package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.js +60 -0
  133. package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.js.map +1 -0
  134. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.d.ts +12 -3
  135. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js +21 -13
  136. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js.map +1 -1
  137. package/test/examples/source-repository/a/dist/generated/index.js +28 -28
  138. package/test/examples/source-repository/a/dist/generated/index.js.map +1 -1
  139. package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.d.ts +30 -0
  140. package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.js +151 -0
  141. package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.js.map +1 -0
  142. package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.d.ts +43 -0
  143. package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.js +81 -0
  144. package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.js.map +1 -0
  145. package/test/examples/source-repository/a/dist/parser/createGraphBuilder.d.ts +6 -1
  146. package/test/examples/source-repository/a/dist/parser/createGraphBuilder.js +16 -31
  147. package/test/examples/source-repository/a/dist/parser/createGraphBuilder.js.map +1 -1
  148. package/test/examples/source-repository/a/dist/parser/createSourceGraph.d.ts +6 -1
  149. package/test/examples/source-repository/a/dist/parser/createSourceGraph.js +23 -38
  150. package/test/examples/source-repository/a/dist/parser/createSourceGraph.js.map +1 -1
  151. package/test/examples/source-repository/a/dist/src/ExtendsForeignType.d.ts +1 -1
  152. package/test/examples/source-repository/a/dist/src/ExtendsForeignType.js +5 -5
  153. package/test/examples/source-repository/a/dist/src/ExtendsForeignType.js.map +1 -1
  154. package/test/examples/source-repository/a/generated/index.ts +44 -44
  155. package/test/examples/source-repository/a/node_modules/.package-lock.json +13 -13
  156. package/test/examples/source-repository/a/node_modules/@proteinjs/util/CHANGELOG.md +8 -0
  157. package/test/examples/source-repository/a/node_modules/@proteinjs/util/LICENSE +21 -0
  158. package/test/examples/source-repository/a/node_modules/@proteinjs/util/package.json +3 -2
  159. package/test/examples/source-repository/a/node_modules/@proteinjs/util/tsconfig.json +1 -0
  160. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/CHANGELOG.md +63 -0
  161. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/LICENSE +21 -0
  162. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.d.ts +1 -0
  163. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.js +1 -0
  164. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.js.map +1 -1
  165. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js +7 -4
  166. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js.map +1 -1
  167. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/Fs.js +16 -12
  168. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/Fs.js.map +1 -1
  169. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.d.ts +59 -13
  170. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +119 -80
  171. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
  172. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.d.ts +91 -0
  173. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js +608 -0
  174. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js.map +1 -0
  175. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/promisifiedFs.d.ts +0 -1
  176. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/index.ts +1 -0
  177. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/package.json +4 -3
  178. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/ArgsMap.ts +7 -4
  179. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/Fs.ts +12 -9
  180. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -38
  181. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/WorkspaceDeclaration.ts +340 -0
  182. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/ArgsMap.test.ts +35 -0
  183. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/Fs.getFilePathsMatchingGlob.test.ts +70 -0
  184. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/PackageUtil.getLocalPackageMap.test.ts +107 -0
  185. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/PackageUtil.pathKeyedIdentity.test.ts +169 -0
  186. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/WorkspaceDeclaration.test.ts +174 -0
  187. package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/tsconfig.json +1 -0
  188. package/test/examples/source-repository/a/package-lock.json +16 -16
  189. package/test/examples/source-repository/a/package.json +3 -3
  190. package/test/examples/source-repository/a/src/ExtendsForeignType.ts +1 -1
  191. package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.d.ts +22 -0
  192. package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.js +60 -0
  193. package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.js.map +1 -0
  194. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.d.ts +12 -3
  195. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js +21 -13
  196. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js.map +1 -1
  197. package/test/examples/source-repository/b/dist/generated/index.js +3 -3
  198. package/test/examples/source-repository/b/dist/generated/index.js.map +1 -1
  199. package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.d.ts +30 -0
  200. package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.js +151 -0
  201. package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.js.map +1 -0
  202. package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.d.ts +43 -0
  203. package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.js +81 -0
  204. package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.js.map +1 -0
  205. package/test/examples/source-repository/b/dist/parser/createGraphBuilder.d.ts +6 -1
  206. package/test/examples/source-repository/b/dist/parser/createGraphBuilder.js +16 -31
  207. package/test/examples/source-repository/b/dist/parser/createGraphBuilder.js.map +1 -1
  208. package/test/examples/source-repository/b/dist/parser/createSourceGraph.d.ts +6 -1
  209. package/test/examples/source-repository/b/dist/parser/createSourceGraph.js +23 -38
  210. package/test/examples/source-repository/b/dist/parser/createSourceGraph.js.map +1 -1
  211. package/test/examples/source-repository/b/generated/index.ts +6 -6
  212. package/test/examples/source-repository/b/node_modules/.package-lock.json +10 -10
  213. package/test/examples/source-repository/b/node_modules/@proteinjs/util/CHANGELOG.md +8 -0
  214. package/test/examples/source-repository/b/node_modules/@proteinjs/util/LICENSE +21 -0
  215. package/test/examples/source-repository/b/node_modules/@proteinjs/util/package.json +3 -2
  216. package/test/examples/source-repository/b/node_modules/@proteinjs/util/tsconfig.json +1 -0
  217. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/CHANGELOG.md +63 -0
  218. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/LICENSE +21 -0
  219. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.d.ts +1 -0
  220. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.js +1 -0
  221. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.js.map +1 -1
  222. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js +7 -4
  223. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js.map +1 -1
  224. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/Fs.js +16 -12
  225. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/Fs.js.map +1 -1
  226. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.d.ts +59 -13
  227. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +119 -80
  228. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
  229. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.d.ts +91 -0
  230. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js +608 -0
  231. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js.map +1 -0
  232. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/promisifiedFs.d.ts +0 -1
  233. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/index.ts +1 -0
  234. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/package.json +4 -3
  235. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/ArgsMap.ts +7 -4
  236. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/Fs.ts +12 -9
  237. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -38
  238. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/WorkspaceDeclaration.ts +340 -0
  239. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/ArgsMap.test.ts +35 -0
  240. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/Fs.getFilePathsMatchingGlob.test.ts +70 -0
  241. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/PackageUtil.getLocalPackageMap.test.ts +107 -0
  242. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/PackageUtil.pathKeyedIdentity.test.ts +169 -0
  243. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/WorkspaceDeclaration.test.ts +174 -0
  244. package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/tsconfig.json +1 -0
  245. package/test/examples/source-repository/b/package-lock.json +13 -13
  246. package/test/examples/source-repository/b/package.json +3 -3
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ImplementsExtendsNotLoadableForeignAbstractClass = exports.ExtendsNotLoadableForeignAbstractClass = exports.ImplementsExtendsLoadableForeignAbstractClass = exports.ExtendsLoadableForeignAbstractClass = exports.ImplementsExtendsLocalNotLoadableInterface = exports.ImplementsExtendsLoadableForeignInterface = exports.ImplementsNotLoadableForeignAbstractClass = exports.ImplementsLoadableForeignAbstractClass = exports.ImplementsNotLoadableForeignInterface = exports.ImplementsLoadableForeignInterface = exports.implementsExtendsNotLoadableForeignType = exports.implementsExtendsLoadableForeignType = exports.implementsNotLoadableForeignType = exports.implementsLoadableForeignType = void 0;
18
+ exports.ImplementsExtendsNotLoadableForeignAbstractClass = exports.ExtendsNotLoadableForeignAbstractClass = exports.ImplementsExtendsLoadableForeignAbstractClass = exports.ExtendsLoadableForeignAbstractClass = exports.ImplementsExtendsNotLoadableForeignInterface = exports.ImplementsExtendsLoadableForeignInterface = exports.ImplementsNotLoadableForeignAbstractClass = exports.ImplementsLoadableForeignAbstractClass = exports.ImplementsNotLoadableForeignInterface = exports.ImplementsLoadableForeignInterface = exports.implementsExtendsNotLoadableForeignType = exports.implementsExtendsLoadableForeignType = exports.implementsNotLoadableForeignType = exports.implementsLoadableForeignType = void 0;
19
19
  var reflection_build_test_b_1 = require("@proteinjs/reflection-build-test-b");
20
20
  // variable <- type alias
21
21
  exports.implementsLoadableForeignType = { z: 1 };
@@ -66,14 +66,14 @@ var ImplementsExtendsLoadableForeignInterface = /** @class */ (function () {
66
66
  return ImplementsExtendsLoadableForeignInterface;
67
67
  }());
68
68
  exports.ImplementsExtendsLoadableForeignInterface = ImplementsExtendsLoadableForeignInterface;
69
- var ImplementsExtendsLocalNotLoadableInterface = /** @class */ (function () {
70
- function ImplementsExtendsLocalNotLoadableInterface() {
69
+ var ImplementsExtendsNotLoadableForeignInterface = /** @class */ (function () {
70
+ function ImplementsExtendsNotLoadableForeignInterface() {
71
71
  this.z = 1;
72
72
  this.b = 2;
73
73
  }
74
- return ImplementsExtendsLocalNotLoadableInterface;
74
+ return ImplementsExtendsNotLoadableForeignInterface;
75
75
  }());
76
- exports.ImplementsExtendsLocalNotLoadableInterface = ImplementsExtendsLocalNotLoadableInterface;
76
+ exports.ImplementsExtendsNotLoadableForeignInterface = ImplementsExtendsNotLoadableForeignInterface;
77
77
  // class <- abstract class <- abstract class
78
78
  var ExtendsLoadableForeignAbstractClass = /** @class */ (function (_super) {
79
79
  __extends(ExtendsLoadableForeignAbstractClass, _super);
@@ -1 +1 @@
1
- {"version":3,"file":"ExtendsForeignType.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/a/src/ExtendsForeignType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,8EAO4C;AAE5C,yBAAyB;AAEZ,QAAA,6BAA6B,GAAwB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE9D,QAAA,gCAAgC,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAMpE,QAAA,oCAAoC,GAA+B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAIrF,QAAA,uCAAuC,GAAkC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAExG,qBAAqB;AAErB;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,yCAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gFAAkC;AAI/C;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,4CAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sFAAqC;AAIlD,0BAA0B;AAE1B;IAA4D,0DAA4B;IAAxF;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAA4D,sDAA4B,GAEvF;AAFY,wFAAsC;AAInD;IAA+D,6DAA+B;IAA9F;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAFD,CAA+D,yDAA+B,GAE7F;AAFY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,iDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,gGAA0C;AAKvD,4CAA4C;AAC5C;IAAkE,uDAA4B;IAA9F;;IAEA,CAAC;IAAD,0CAAC;AAAD,CAAC,AAFD,CAAkE,sDAA4B,GAE7F;AAFqB,kFAAmC;AAIzD;IAAmE,iEAAmC;IAAtG;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,oDAAC;AAAD,CAAC,AAHD,CAAmE,mCAAmC,GAGrG;AAHY,sGAA6C;AAK1D;IAAqE,0DAA+B;IAApG;;IAEA,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAAqE,yDAA+B,GAEnG;AAFqB,wFAAsC;AAI5D;IAAsE,oEAAsC;IAA5G;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,uDAAC;AAAD,CAAC,AAHD,CAAsE,sCAAsC,GAG3G;AAHY,4GAAgD"}
1
+ {"version":3,"file":"ExtendsForeignType.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/a/src/ExtendsForeignType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,8EAO4C;AAE5C,yBAAyB;AAEZ,QAAA,6BAA6B,GAAwB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE9D,QAAA,gCAAgC,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAMpE,QAAA,oCAAoC,GAA+B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAIrF,QAAA,uCAAuC,GAAkC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAExG,qBAAqB;AAErB;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,yCAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gFAAkC;AAI/C;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,4CAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sFAAqC;AAIlD,0BAA0B;AAE1B;IAA4D,0DAA4B;IAAxF;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAA4D,sDAA4B,GAEvF;AAFY,wFAAsC;AAInD;IAA+D,6DAA+B;IAA9F;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAFD,CAA+D,yDAA+B,GAE7F;AAFY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,mDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,oGAA4C;AAKzD,4CAA4C;AAC5C;IAAkE,uDAA4B;IAA9F;;IAEA,CAAC;IAAD,0CAAC;AAAD,CAAC,AAFD,CAAkE,sDAA4B,GAE7F;AAFqB,kFAAmC;AAIzD;IAAmE,iEAAmC;IAAtG;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,oDAAC;AAAD,CAAC,AAHD,CAAmE,mCAAmC,GAGrG;AAHY,sGAA6C;AAK1D;IAAqE,0DAA+B;IAApG;;IAEA,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAAqE,yDAA+B,GAEnG;AAFqB,wFAAsC;AAI5D;IAAsE,oEAAsC;IAA5G;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,uDAAC;AAAD,CAAC,AAHD,CAAsE,sCAAsC,GAG3G;AAHY,4GAAgD"}
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  /** Generate Source Graph */
19
- var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"typeParameters\":[],\"directParents\":null},{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"{ z: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/{ z: number }\",\"typeParameters\":[],\"directParents\":null}],\"sourceType\":1}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"typeParameters\":[],\"directParents\":null},{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"{ z: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/{ z: number }\",\"typeParameters\":[],\"directParents\":null}],\"sourceType\":1}},{\"v\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"implementsOptionalLoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"type\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"ImplementsOptionalLoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignInterface\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"ImplementsOptionalLoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignAbstractClass\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}}],\"edges\":[{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends type\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends type\"},{\"v\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"value\":\"has type\"},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"value\":\"extends class\"}]}";
19
+ var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"ImplementsOptionalLoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignAbstractClass\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"ImplementsOptionalLoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignInterface\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"LoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"typeParameters\":[],\"directParents\":null},{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"{ z: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/{ z: number }\",\"typeParameters\":[],\"directParents\":null}],\"sourceType\":1}},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignAbstractClass\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignInterface\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"properties\":[{\"name\":\"z\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"typeParameters\":[],\"directParents\":null},{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"{ z: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/{ z: number }\",\"typeParameters\":[],\"directParents\":null}],\"sourceType\":1}},{\"v\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"value\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"implementsOptionalLoadableForeignType\",\"filePath\":\"src/LoadableForeignType.ts\",\"qualifiedName\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"type\":{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection-build-test-b\",\"name\":\"OptionalLoadableForeignType\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignInterface\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/LoadableForeignType\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends type\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends type\"},{\"v\":\"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType\",\"w\":\"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType\",\"value\":\"has type\"}]}";
20
20
  /** Generate Source Links */
21
21
  var LoadableForeignType_1 = require("../src/LoadableForeignType");
22
22
  var LoadableForeignType_2 = require("../src/LoadableForeignType");
@@ -24,11 +24,11 @@ var LoadableForeignType_3 = require("../src/LoadableForeignType");
24
24
  var LoadableForeignType_4 = require("../src/LoadableForeignType");
25
25
  var LoadableForeignType_5 = require("../src/LoadableForeignType");
26
26
  var sourceLinks = {
27
- '@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType': LoadableForeignType_1.implementsOptionalLoadableForeignType,
27
+ '@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass': LoadableForeignType_1.ImplementsOptionalLoadableForeignAbstractClass,
28
28
  '@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface': LoadableForeignType_2.ImplementsOptionalLoadableForeignInterface,
29
29
  '@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass': LoadableForeignType_3.LoadableForeignAbstractClass,
30
30
  '@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass': LoadableForeignType_4.OptionalLoadableForeignAbstractClass,
31
- '@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass': LoadableForeignType_5.ImplementsOptionalLoadableForeignAbstractClass,
31
+ '@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType': LoadableForeignType_5.implementsOptionalLoadableForeignType,
32
32
  };
33
33
  /** Load Source Graph and Links */
34
34
  var reflection_1 = require("@proteinjs/reflection");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/b/generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAIpC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,wiTAAwiT,CAAC;AAG7jT,4BAA4B;AAE5B,kEAAmF;AACnF,kEAAwF;AACxF,kEAA0E;AAC1E,kEAAkF;AAClF,kEAA4F;AAE5F,IAAM,WAAW,GAAG;IACnB,0EAA0E,EAAE,2DAAqC;IACjH,+EAA+E,EAAE,gEAA0C;IAC3H,iEAAiE,EAAE,kDAA4B;IAC/F,yEAAyE,EAAE,0DAAoC;IAC/G,mFAAmF,EAAE,oEAA8C;CACnI,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/b/generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAIpC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,wiTAAwiT,CAAC;AAG7jT,4BAA4B;AAE5B,kEAA4F;AAC5F,kEAAwF;AACxF,kEAA0E;AAC1E,kEAAkF;AAClF,kEAAmF;AAEnF,IAAM,WAAW,GAAG;IACnB,mFAAmF,EAAE,oEAA8C;IACnI,+EAA+E,EAAE,gEAA0C;IAC3H,iEAAiE,EAAE,kDAA4B;IAC/F,yEAAyE,EAAE,0DAAoC;IAC/G,0EAA0E,EAAE,2DAAqC;CACjH,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/reflection-build",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "Build system for reflection",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@dagrejs/graphlib": "2.1.4",
33
- "@proteinjs/reflection": "^1.2.0",
34
- "@proteinjs/util": "^1.6.1",
35
- "@proteinjs/util-node": "^1.10.1",
33
+ "@proteinjs/reflection": "^1.2.1",
34
+ "@proteinjs/util": "^1.6.2",
35
+ "@proteinjs/util-node": "^1.11.0",
36
36
  "globby": "11.0.1",
37
37
  "gulp": "4.0.2",
38
38
  "gulp-shell": "0.8.0",
@@ -56,5 +56,5 @@
56
56
  "ts-jest": "29.1.1",
57
57
  "typescript": "5.2.2"
58
58
  },
59
- "gitHead": "fde90018cf9e9b8b7103161536f7e25722c0dab4"
59
+ "gitHead": "dba60a9a16985d76264f9f9e29ccdbcc669543f3"
60
60
  }
@@ -1,8 +1,10 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
- import globby from 'globby';
4
3
  import { TypescriptParser } from '../modules/typescript-parser';
4
+ import { Graph } from '@dagrejs/graphlib';
5
5
  import { createEmittedSourceGraph, findDependencyDir, findDependencySourceGraph } from './codegen/writeGeneratedIndex';
6
+ import { PackageSourceFiles } from './parser/PackageSourceFiles';
7
+ import { SharedQualifiedName } from './parser/SharedQualifiedNames';
6
8
 
7
9
  const LOADABLE_QUALIFIED_NAME = '@proteinjs/reflection/Loadable';
8
10
  const SOURCE_REPOSITORY_FILTER_QUALIFIED_NAME = '@proteinjs/reflection/SourceRepositoryFilter';
@@ -27,6 +29,8 @@ export interface DoctorReport {
27
29
  /** declarations in the built artifact no longer in sources (stale dist) */
28
30
  onlyInDist: string[];
29
31
  };
32
+ /** names in current sources that two or more files declare and that reach the graph (reflection-build refuses these sources) */
33
+ sharedNames: SharedQualifiedName[];
30
34
  orphans: Orphan[];
31
35
  }
32
36
 
@@ -61,7 +65,9 @@ interface Universe {
61
65
  * the runtime would merge).
62
66
  *
63
67
  * - `diagnose()` prints the registered inventory (deps with graphs / without / skip-listed),
64
- * this package's node+edge+sourceLink counts, emitted-vs-source drift (stale dist), and
68
+ * this package's node+edge+sourceLink counts, emitted-vs-source drift (stale dist), SHARED
69
+ * NAMES: names in current sources that two files declare and that reach the graph (the build
70
+ * refuses these sources; an artifact built before the refusal kept one file's declaration), and
65
71
  * ORPHANS: nodes the build kept because a parent is foreign, whose parent's package
66
72
  * resolves to no loadable graph — the undeclared-dep / typo footgun that the runtime
67
73
  * silently prunes today.
@@ -83,11 +89,16 @@ export class ReflectionDoctor {
83
89
  const universe = this.harvestUniverse(packageJson);
84
90
  const own = universe.graphs[packageJson.name];
85
91
  const dependencies = this.dependencyInventory(packageJson);
86
- const drift = await this.computeDrift(packageJson, own.graph);
92
+ const fresh = await createEmittedSourceGraph(this.packageDir, ['src']);
93
+ const drift = this.computeDrift(fresh.graph, own.graph);
87
94
  const orphans = this.findOrphans(packageJson, universe);
88
95
  const sourceLinkCount = this.parseSourceLinkKeys(fs.readFileSync(own.artifactPath, 'utf-8')).length;
89
96
 
90
- const healthy = orphans.length === 0 && drift.missingFromDist.length === 0 && drift.onlyInDist.length === 0;
97
+ const healthy =
98
+ orphans.length === 0 &&
99
+ drift.missingFromDist.length === 0 &&
100
+ drift.onlyInDist.length === 0 &&
101
+ fresh.sharedNames.length === 0;
91
102
  const report: DoctorReport = {
92
103
  text: '',
93
104
  healthy,
@@ -96,6 +107,7 @@ export class ReflectionDoctor {
96
107
  edgeCount: own.graph.edges.length,
97
108
  sourceLinkCount,
98
109
  drift,
110
+ sharedNames: fresh.sharedNames,
99
111
  orphans,
100
112
  };
101
113
  report.text = this.formatReport(packageJson.name, own.artifactPath, report);
@@ -288,11 +300,10 @@ export class ReflectionDoctor {
288
300
  }
289
301
 
290
302
  /** Emitted-vs-source drift: rebuild-needed detection for the prod graph. */
291
- private async computeDrift(
292
- packageJson: any,
303
+ private computeDrift(
304
+ freshGraph: Graph,
293
305
  emittedGraph: GraphJson
294
- ): Promise<{ missingFromDist: string[]; onlyInDist: string[] }> {
295
- const freshGraph = await createEmittedSourceGraph(this.packageDir, ['src']);
306
+ ): { missingFromDist: string[]; onlyInDist: string[] } {
296
307
  const freshValued: { [qualifiedName: string]: boolean } = {};
297
308
  for (const nodeName of freshGraph.nodes()) {
298
309
  if (freshGraph.node(nodeName)) {
@@ -430,7 +441,7 @@ export class ReflectionDoctor {
430
441
  ? nameOrQualifiedName.substring(nameOrQualifiedName.lastIndexOf('/') + 1)
431
442
  : nameOrQualifiedName;
432
443
 
433
- const freshGraph = await createEmittedSourceGraph(this.packageDir, ['src']);
444
+ const { graph: freshGraph } = await createEmittedSourceGraph(this.packageDir, ['src']);
434
445
  const freshMatch = freshGraph
435
446
  .nodes()
436
447
  .find((qualifiedName: string) => freshGraph.node(qualifiedName) && qualifiedName.endsWith(`/${name}`));
@@ -457,20 +468,14 @@ export class ReflectionDoctor {
457
468
 
458
469
  /** Raw parser pass over src — sees non-exported declarations the graph never contains. */
459
470
  private async findDeclarationInSources(name: string): Promise<{ filePath: string; isExported: boolean } | undefined> {
460
- const patterns = [
461
- path.join(this.packageDir, 'src', '**/*.ts'),
462
- path.join(this.packageDir, 'src', '**/*.tsx'),
463
- '!**/node_modules/**',
464
- '!**/generated/**',
465
- ];
466
- const sourceFilePaths: string[] = await globby(patterns);
471
+ const sourceFilePaths = await new PackageSourceFiles(this.packageDir, ['src']).list();
467
472
  const parser = new TypescriptParser();
468
473
  for (const sourceFilePath of sourceFilePaths) {
469
474
  const parsedFile = await parser.parseFile(sourceFilePath, path.dirname(sourceFilePath));
470
475
  for (const declaration of parsedFile.declarations) {
471
476
  if (declaration.name === name) {
472
477
  return {
473
- filePath: path.relative(this.packageDir, sourceFilePath),
478
+ filePath: PackageSourceFiles.relativePath(this.packageDir, sourceFilePath),
474
479
  isExported: !!(declaration as any).isExported,
475
480
  };
476
481
  }
@@ -556,6 +561,21 @@ export class ReflectionDoctor {
556
561
  }
557
562
  }
558
563
 
564
+ if (report.sharedNames.length === 0) {
565
+ lines.push(`Shared names: none — each name in the graph has one declaring file`);
566
+ } else {
567
+ lines.push(
568
+ `Shared names: reflection-build refuses these sources — each name below reaches the graph from more than ` +
569
+ `one file, and the graph keeps one declaration per name; give each declaration its own name`
570
+ );
571
+ for (const { qualifiedName, filePaths } of report.sharedNames) {
572
+ lines.push(` ${qualifiedName}`);
573
+ for (const filePath of filePaths) {
574
+ lines.push(` declared in ${filePath}`);
575
+ }
576
+ }
577
+ }
578
+
559
579
  lines.push('');
560
580
  if (report.orphans.length === 0) {
561
581
  lines.push(`Orphans: none — every foreign parent resolves in a loaded graph`);
@@ -0,0 +1,50 @@
1
+ import { Edge, Graph } from '@dagrejs/graphlib';
2
+ import { PackageSourceFiles } from '../parser/PackageSourceFiles';
3
+
4
+ /**
5
+ * The emitted form of a source graph: the same nodes, values and edges, in an order that is a
6
+ * function of the graph's content alone — never of the order the builder happened to visit the
7
+ * sources or insert placeholder parents. The generated index serializes nodes and edges in
8
+ * insertion order, so this order is the artifact's byte order (and the runtime's `objects()`
9
+ * order within one package).
10
+ *
11
+ * - Nodes by the declaring file's package-relative path, then by qualified name. A placeholder
12
+ * (a parent referenced here but declared elsewhere) has no file and sorts by name ahead of
13
+ * the declared nodes.
14
+ * - Edges by child, then parent (a source graph is never a multigraph: one edge per pair).
15
+ *
16
+ * Both keys are package-relative strings compared by code unit, so they are the same on every
17
+ * machine and in every checkout location.
18
+ */
19
+ export class CanonicalSourceGraph {
20
+ /** A copy of `graph` whose node and edge order is canonical. */
21
+ static of(graph: Graph): Graph {
22
+ const canonical = new Graph({
23
+ directed: graph.isDirected(),
24
+ multigraph: graph.isMultigraph(),
25
+ compound: graph.isCompound(),
26
+ });
27
+ for (const nodeName of CanonicalSourceGraph.nodeOrder(graph)) {
28
+ canonical.setNode(nodeName, graph.node(nodeName));
29
+ }
30
+
31
+ for (const edge of CanonicalSourceGraph.edgeOrder(graph)) {
32
+ canonical.setEdge(edge, graph.edge(edge));
33
+ }
34
+
35
+ return canonical;
36
+ }
37
+
38
+ private static nodeOrder(graph: Graph): string[] {
39
+ const fileOf = (nodeName: string): string => graph.node(nodeName)?.filePath || '';
40
+ return [...graph.nodes()].sort(
41
+ (a, b) => PackageSourceFiles.compare(fileOf(a), fileOf(b)) || PackageSourceFiles.compare(a, b)
42
+ );
43
+ }
44
+
45
+ private static edgeOrder(graph: Graph): Edge[] {
46
+ return [...graph.edges()].sort(
47
+ (a, b) => PackageSourceFiles.compare(a.v, b.v) || PackageSourceFiles.compare(a.w, b.w)
48
+ );
49
+ }
50
+ }
@@ -5,6 +5,9 @@ import { graphSerializer, isInstanceOf } from '@proteinjs/util';
5
5
  import { Graph } from '@dagrejs/graphlib';
6
6
  import jsesc from 'jsesc';
7
7
  import { createSourceGraph } from '../parser/createSourceGraph';
8
+ import { PackageSourceFiles } from '../parser/PackageSourceFiles';
9
+ import { SharedQualifiedName, SharedQualifiedNames } from '../parser/SharedQualifiedNames';
10
+ import { CanonicalSourceGraph } from './CanonicalSourceGraph';
8
11
  import { VariableDeclaration, PackageScope, ClassDeclaration, LOADABLE_QUALIFIED_NAME } from '@proteinjs/reflection';
9
12
 
10
13
  /**
@@ -59,8 +62,11 @@ export async function writeGeneratedIndex(
59
62
  // - If override provided, re-export from that (path relative to generated dir, without extension)
60
63
  // - Else fallback to the current default: '<packageRoot>/index'
61
64
  const exportTargetNoExt = publicEntryRelOverride
62
- ? path.relative(packageGeneratedDir, path.join(packageDir, publicEntryRelOverride)).replace(/\.[^/.]+$/, '')
63
- : `${path.relative(packageGeneratedDir, packageDir)}/index`;
65
+ ? PackageSourceFiles.relativePath(packageGeneratedDir, path.join(packageDir, publicEntryRelOverride)).replace(
66
+ /\.[^/.]+$/,
67
+ ''
68
+ )
69
+ : `${PackageSourceFiles.relativePath(packageGeneratedDir, packageDir)}/index`;
64
70
 
65
71
  generatedIndex += `\n\n\nexport * from '${exportTargetNoExt}';`;
66
72
 
@@ -77,7 +83,8 @@ async function sourceRepositoryLoader(
77
83
 
78
84
  // Allow multiple roots (e.g., ['test','src']) to keep ancestry intact.
79
85
  const roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
80
- const sourceGraph: Graph = await createEmittedSourceGraph(packageDir, roots);
86
+ const { graph: sourceGraph, sharedNames } = await createEmittedSourceGraph(packageDir, roots);
87
+ SharedQualifiedNames.refuse(packageJson.name, sharedNames);
81
88
 
82
89
  code += generateSourceGraph(sourceGraph);
83
90
  code += generateSourceLinks(sourceGraph, packageJson, packageDir, generatedIndexPath);
@@ -230,16 +237,32 @@ function getDependencyImportSpecifier(packageDir: string, packageName: string):
230
237
  }
231
238
  }
232
239
 
240
+ export interface EmittedSourceGraph {
241
+ /** The pruned graph in canonical order: what the generated index serializes. */
242
+ graph: Graph;
243
+ /** The names in `graph` that two or more source files declare; the build refuses to emit while there is one. */
244
+ sharedNames: SharedQualifiedName[];
245
+ }
246
+
233
247
  /**
234
248
  * The graph exactly as a build emits it: parsed from the package's source roots, with
235
- * build-time-non-loadable declarations pruned. Owned here so build emit and diagnostic
236
- * tooling (reflection-doctor drift checks) share one pipeline.
249
+ * build-time-non-loadable declarations pruned, in canonical order (the serialized graph and
250
+ * the source links follow it, so the same sources emit the same bytes on every machine), and
251
+ * the names in it that more than one file declares. Owned here so build emit and diagnostic
252
+ * tooling (reflection-doctor drift and shared-name checks) share one pipeline.
237
253
  */
238
- export async function createEmittedSourceGraph(packageDir: string, sourceRootsRel: string[]): Promise<Graph> {
254
+ export async function createEmittedSourceGraph(
255
+ packageDir: string,
256
+ sourceRootsRel: string[]
257
+ ): Promise<EmittedSourceGraph> {
239
258
  const packageJson = await getPackageJson(packageDir);
240
- const sourceGraph = await createSourceGraph(packageDir, [], sourceRootsRel);
259
+ const declarations = new SharedQualifiedNames();
260
+ const sourceGraph = await createSourceGraph(packageDir, [], sourceRootsRel, declarations);
241
261
  removeNonLoadables(sourceGraph, packageJson.name);
242
- return sourceGraph;
262
+ // Shared names are read AFTER the prune, never before: a name whose declarations the prune
263
+ // drops never reaches the index, and two files exporting it is ordinary TypeScript.
264
+ const sharedNames = declarations.in(sourceGraph);
265
+ return { graph: CanonicalSourceGraph.of(sourceGraph), sharedNames };
243
266
  }
244
267
 
245
268
  function generateSourceGraph(sourceGraph: Graph): string {
@@ -347,7 +370,10 @@ function generateSourceLinks(
347
370
 
348
371
  // node.filePath is package-relative (never serialized absolute); resolve against the
349
372
  // package dir to compute the real import location for the generated index.
350
- const relativeImportPath = path.relative(path.dirname(generatedIndexPath), path.join(packageDir, node.filePath));
373
+ const relativeImportPath = PackageSourceFiles.relativePath(
374
+ path.dirname(generatedIndexPath),
375
+ path.join(packageDir, node.filePath)
376
+ );
351
377
  code += `import { ${node.name} } from '${relativeImportPath.replace(/\.[^/.]+$/, '')}';\n`;
352
378
  linkableNodes.push(node);
353
379
  }
@@ -0,0 +1,66 @@
1
+ import * as path from 'path';
2
+ import globby from 'globby';
3
+
4
+ /**
5
+ * The TypeScript sources of a package, in one reproducible order.
6
+ *
7
+ * Every build of the same sources must write the same bytes, whatever machine or directory it
8
+ * runs in. Two machine-specific inputs are closed here, where they enter:
9
+ *
10
+ * - ORDER. The glob returns files in the order its concurrent directory reads complete, which
11
+ * varies with the filesystem and from run to run. The parse order decides the graph's
12
+ * insertion order, which declaration a name exported by two files holds (the last one parsed;
13
+ * the build refuses such a name when it survives the prune — `SharedQualifiedNames`), and the
14
+ * order that refusal lists the files in. `list()` therefore orders the files by their
15
+ * package-relative path, compared by code unit — never by `localeCompare`, whose collation
16
+ * depends on the machine's locale data.
17
+ * - LOCATION. `relativePath()` is the only form a source path takes in a generated artifact:
18
+ * relative, with `/` separators on every platform, no leading `./`.
19
+ */
20
+ export class PackageSourceFiles {
21
+ constructor(
22
+ private readonly packageDir: string,
23
+ private readonly sourceRootsRel: string[],
24
+ private readonly excludedDirs: string[] = []
25
+ ) {}
26
+
27
+ /** Absolute paths of the package's `.ts`/`.tsx` sources under the source roots, in package-relative path order. */
28
+ async list(): Promise<string[]> {
29
+ const sourceFilePaths: string[] = await globby([...this.includePatterns(), ...this.excludePatterns()]);
30
+ return Array.from(new Set(sourceFilePaths))
31
+ .map((absolutePath) => ({
32
+ absolutePath,
33
+ relativePath: PackageSourceFiles.relativePath(this.packageDir, absolutePath),
34
+ }))
35
+ .sort((a, b) => PackageSourceFiles.compare(a.relativePath, b.relativePath))
36
+ .map(({ absolutePath }) => absolutePath);
37
+ }
38
+
39
+ /** `filePath` relative to `fromDir`, with `/` separators on every platform and no leading `./`. */
40
+ static relativePath(fromDir: string, filePath: string): string {
41
+ return path.relative(fromDir, filePath).split(path.sep).join('/');
42
+ }
43
+
44
+ /** Code-unit order: the same on every machine, unlike `localeCompare`. */
45
+ static compare(a: string, b: string): number {
46
+ if (a < b) {
47
+ return -1;
48
+ }
49
+
50
+ return a > b ? 1 : 0;
51
+ }
52
+
53
+ private includePatterns(): string[] {
54
+ const patterns: string[] = [];
55
+ for (const rel of this.sourceRootsRel) {
56
+ const root = path.join(this.packageDir, rel);
57
+ patterns.push(path.join(root, '**/*.ts'));
58
+ patterns.push(path.join(root, '**/*.tsx'));
59
+ }
60
+ return patterns;
61
+ }
62
+
63
+ private excludePatterns(): string[] {
64
+ return ['!**/node_modules/**', '!**/generated/**', ...this.excludedDirs.map((dir) => `!${dir}`)];
65
+ }
66
+ }
@@ -0,0 +1,76 @@
1
+ import { Graph } from '@dagrejs/graphlib';
2
+
3
+ /** A qualified name that two or more source files declare. */
4
+ export interface SharedQualifiedName {
5
+ qualifiedName: string;
6
+ /** Every file that declares it: package-relative, `/`-separated, in the order the sources parse. */
7
+ filePaths: string[];
8
+ }
9
+
10
+ /**
11
+ * One qualified name, one declaring file, for every name that reaches the generated index.
12
+ *
13
+ * The source graph holds ONE node per qualified name. When two files export the same name, the
14
+ * declaration parsed last takes the node (its value, its `filePath`, and so the class or value
15
+ * the source link hands `objects()`), while the parent edges of both stay on it. The other
16
+ * declaration leaves no trace, so the emitted graph cannot show the collision. This class records
17
+ * every file that declares each name while the graph is built, and names the collisions that are
18
+ * left in a graph.
19
+ *
20
+ * The rule applies to the graph AFTER `removeNonLoadables`, never before. Types, consts and
21
+ * functions exported under one name by two files are ordinary TypeScript: while none of them is
22
+ * Loadable, the prune drops the name and it never reaches the index. A name that survives the
23
+ * prune is an authoring error the graph cannot represent, and the build refuses it rather than
24
+ * ship the last file's declaration.
25
+ *
26
+ * Order: files are kept in the order they are recorded, which is the parse order —
27
+ * `PackageSourceFiles.list()` order, package-relative path by code unit — and names in the order
28
+ * their first declaration was recorded. Both are the same on every machine.
29
+ */
30
+ export class SharedQualifiedNames {
31
+ private readonly filePathsByName = new Map<string, string[]>();
32
+
33
+ /**
34
+ * The build's refusal: one error naming the package and, for each shared name, every file that
35
+ * declares it. Returns without effect when `sharedNames` is empty.
36
+ */
37
+ static refuse(packageName: string, sharedNames: SharedQualifiedName[]): void {
38
+ if (sharedNames.length === 0) {
39
+ return;
40
+ }
41
+
42
+ throw new Error(
43
+ [
44
+ `reflection-build refused ${packageName}: a name that reaches the generated index is declared in more than one file.`,
45
+ 'The index holds one declaration per qualified name, so the file parsed last would replace the others without a trace.',
46
+ 'Give each declaration its own name (no index was written):',
47
+ ...sharedNames.map(({ qualifiedName, filePaths }) => ` ${qualifiedName}: ${filePaths.join(', ')}`),
48
+ ].join('\n')
49
+ );
50
+ }
51
+
52
+ /** The names left in `prunedGraph` that two or more files declare. */
53
+ in(prunedGraph: Graph): SharedQualifiedName[] {
54
+ const shared: SharedQualifiedName[] = [];
55
+ this.filePathsByName.forEach((filePaths, qualifiedName) => {
56
+ if (filePaths.length > 1 && prunedGraph.hasNode(qualifiedName)) {
57
+ shared.push({ qualifiedName, filePaths: [...filePaths] });
58
+ }
59
+ });
60
+ return shared;
61
+ }
62
+
63
+ /**
64
+ * Records that the package-relative `filePath` declares `qualifiedName`. The graph builder calls
65
+ * this for every declaration it sets on the graph; a file that declares a name twice (a const
66
+ * and a type of one name, say) counts once.
67
+ */
68
+ record(qualifiedName: string, filePath: string): void {
69
+ const filePaths = this.filePathsByName.get(qualifiedName);
70
+ if (!filePaths) {
71
+ this.filePathsByName.set(qualifiedName, [filePath]);
72
+ } else if (!filePaths.includes(filePath)) {
73
+ filePaths.push(filePath);
74
+ }
75
+ }
76
+ }