@proteinjs/reflection-build 1.2.1 → 1.4.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 (293) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/{test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/LICENSE → LICENSE} +5 -6
  3. package/dist/src/build.js +31 -15
  4. package/dist/src/build.js.map +1 -1
  5. package/dist/src/codegen/writeGeneratedIndex.d.ts +10 -1
  6. package/dist/src/codegen/writeGeneratedIndex.js +43 -12
  7. package/dist/src/codegen/writeGeneratedIndex.js.map +1 -1
  8. package/dist/src/parser/createSourceGraph.d.ts +1 -1
  9. package/dist/src/parser/createSourceGraph.js +36 -22
  10. package/dist/src/parser/createSourceGraph.js.map +1 -1
  11. package/dist/test/examples/source-repository/a/generated/index.js +1 -1
  12. package/dist/test/examples/source-repository/a/generated/index.js.map +1 -1
  13. package/dist/test/examples/source-repository/b/generated/index.js +1 -1
  14. package/dist/test/examples/source-repository/b/generated/index.js.map +1 -1
  15. package/package.json +4 -3
  16. package/src/build.ts +52 -14
  17. package/src/codegen/writeGeneratedIndex.ts +60 -7
  18. package/src/parser/createSourceGraph.ts +21 -12
  19. package/test/examples/source-repository/a/dist/build.js +31 -15
  20. package/test/examples/source-repository/a/dist/build.js.map +1 -1
  21. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.d.ts +10 -1
  22. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js +43 -12
  23. package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js.map +1 -1
  24. package/test/examples/source-repository/a/dist/generated/index.js +1 -1
  25. package/test/examples/source-repository/a/dist/generated/index.js.map +1 -1
  26. package/test/examples/source-repository/a/dist/parser/createSourceGraph.d.ts +1 -1
  27. package/test/examples/source-repository/a/dist/parser/createSourceGraph.js +36 -22
  28. package/test/examples/source-repository/a/dist/parser/createSourceGraph.js.map +1 -1
  29. package/test/examples/source-repository/a/generated/index.ts +38 -33
  30. package/test/examples/source-repository/a/node_modules/.package-lock.json +0 -53
  31. package/test/examples/source-repository/a/package.json +1 -1
  32. package/test/examples/source-repository/b/dist/build.js +31 -15
  33. package/test/examples/source-repository/b/dist/build.js.map +1 -1
  34. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.d.ts +10 -1
  35. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js +43 -12
  36. package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js.map +1 -1
  37. package/test/examples/source-repository/b/dist/generated/index.js +1 -1
  38. package/test/examples/source-repository/b/dist/generated/index.js.map +1 -1
  39. package/test/examples/source-repository/b/dist/parser/createSourceGraph.d.ts +1 -1
  40. package/test/examples/source-repository/b/dist/parser/createSourceGraph.js +36 -22
  41. package/test/examples/source-repository/b/dist/parser/createSourceGraph.js.map +1 -1
  42. package/test/examples/source-repository/b/generated/index.ts +10 -11
  43. package/test/examples/source-repository/b/node_modules/.package-lock.json +0 -53
  44. package/test/examples/source-repository/b/package.json +1 -1
  45. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.eslintrc.js +0 -20
  46. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierignore +0 -4
  47. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierrc +0 -8
  48. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/CHANGELOG.md +0 -58
  49. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.d.ts +0 -5
  50. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js +0 -18
  51. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js.map +0 -1
  52. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +0 -19
  53. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +0 -555
  54. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +0 -1
  55. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +0 -3
  56. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js +0 -5
  57. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +0 -1
  58. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +0 -45
  59. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +0 -176
  60. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +0 -1
  61. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +0 -11
  62. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +0 -9
  63. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +0 -1
  64. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +0 -13
  65. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +0 -19
  66. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +0 -1
  67. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.d.ts +0 -221
  68. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js +0 -234
  69. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js.map +0 -1
  70. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/index.ts +0 -5
  71. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/jest.config.js +0 -9
  72. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/package.json +0 -42
  73. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +0 -702
  74. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/Loadable.ts +0 -2
  75. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepository.ts +0 -250
  76. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +0 -15
  77. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +0 -14
  78. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/types.ts +0 -236
  79. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/tsconfig.json +0 -19
  80. package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +0 -1
  81. package/test/examples/source-repository/a/node_modules/bindings/LICENSE.md +0 -22
  82. package/test/examples/source-repository/a/node_modules/bindings/README.md +0 -98
  83. package/test/examples/source-repository/a/node_modules/bindings/bindings.js +0 -221
  84. package/test/examples/source-repository/a/node_modules/bindings/package.json +0 -28
  85. package/test/examples/source-repository/a/node_modules/file-uri-to-path/.travis.yml +0 -30
  86. package/test/examples/source-repository/a/node_modules/file-uri-to-path/History.md +0 -21
  87. package/test/examples/source-repository/a/node_modules/file-uri-to-path/LICENSE +0 -20
  88. package/test/examples/source-repository/a/node_modules/file-uri-to-path/README.md +0 -74
  89. package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.d.ts +0 -2
  90. package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.js +0 -66
  91. package/test/examples/source-repository/a/node_modules/file-uri-to-path/package.json +0 -32
  92. package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/test.js +0 -24
  93. package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/tests.json +0 -13
  94. package/test/examples/source-repository/a/node_modules/fsevents/LICENSE +0 -22
  95. package/test/examples/source-repository/a/node_modules/fsevents/README.md +0 -89
  96. package/test/examples/source-repository/a/node_modules/fsevents/fsevents.d.ts +0 -46
  97. package/test/examples/source-repository/a/node_modules/fsevents/fsevents.js +0 -83
  98. package/test/examples/source-repository/a/node_modules/fsevents/fsevents.node +0 -0
  99. package/test/examples/source-repository/a/node_modules/fsevents/package.json +0 -62
  100. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +0 -103
  101. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +0 -8
  102. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/Readme.md +0 -78
  103. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +0 -21
  104. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +0 -53
  105. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +0 -352
  106. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +0 -1
  107. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +0 -75
  108. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
  109. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +0 -6
  110. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +0 -188
  111. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +0 -772
  112. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +0 -88
  113. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +0 -106
  114. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/install.js +0 -13
  115. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/package.json +0 -34
  116. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +0 -43
  117. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +0 -110
  118. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +0 -44
  119. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +0 -27
  120. package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +0 -71
  121. package/test/examples/source-repository/a/node_modules/nan/CHANGELOG.md +0 -557
  122. package/test/examples/source-repository/a/node_modules/nan/CMakeLists.txt +0 -138
  123. package/test/examples/source-repository/a/node_modules/nan/LICENSE.md +0 -9
  124. package/test/examples/source-repository/a/node_modules/nan/README.md +0 -456
  125. package/test/examples/source-repository/a/node_modules/nan/doc/asyncworker.md +0 -146
  126. package/test/examples/source-repository/a/node_modules/nan/doc/buffers.md +0 -54
  127. package/test/examples/source-repository/a/node_modules/nan/doc/callback.md +0 -76
  128. package/test/examples/source-repository/a/node_modules/nan/doc/converters.md +0 -41
  129. package/test/examples/source-repository/a/node_modules/nan/doc/errors.md +0 -226
  130. package/test/examples/source-repository/a/node_modules/nan/doc/json.md +0 -62
  131. package/test/examples/source-repository/a/node_modules/nan/doc/maybe_types.md +0 -583
  132. package/test/examples/source-repository/a/node_modules/nan/doc/methods.md +0 -672
  133. package/test/examples/source-repository/a/node_modules/nan/doc/new.md +0 -147
  134. package/test/examples/source-repository/a/node_modules/nan/doc/node_misc.md +0 -123
  135. package/test/examples/source-repository/a/node_modules/nan/doc/object_wrappers.md +0 -263
  136. package/test/examples/source-repository/a/node_modules/nan/doc/persistent.md +0 -296
  137. package/test/examples/source-repository/a/node_modules/nan/doc/scopes.md +0 -73
  138. package/test/examples/source-repository/a/node_modules/nan/doc/script.md +0 -58
  139. package/test/examples/source-repository/a/node_modules/nan/doc/string_bytes.md +0 -62
  140. package/test/examples/source-repository/a/node_modules/nan/doc/v8_internals.md +0 -199
  141. package/test/examples/source-repository/a/node_modules/nan/doc/v8_misc.md +0 -85
  142. package/test/examples/source-repository/a/node_modules/nan/include_dirs.js +0 -1
  143. package/test/examples/source-repository/a/node_modules/nan/nan.h +0 -2958
  144. package/test/examples/source-repository/a/node_modules/nan/nan_callbacks.h +0 -92
  145. package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_12_inl.h +0 -520
  146. package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
  147. package/test/examples/source-repository/a/node_modules/nan/nan_converters.h +0 -72
  148. package/test/examples/source-repository/a/node_modules/nan/nan_converters_43_inl.h +0 -68
  149. package/test/examples/source-repository/a/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
  150. package/test/examples/source-repository/a/node_modules/nan/nan_define_own_property_helper.h +0 -29
  151. package/test/examples/source-repository/a/node_modules/nan/nan_implementation_12_inl.h +0 -430
  152. package/test/examples/source-repository/a/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
  153. package/test/examples/source-repository/a/node_modules/nan/nan_json.h +0 -166
  154. package/test/examples/source-repository/a/node_modules/nan/nan_maybe_43_inl.h +0 -356
  155. package/test/examples/source-repository/a/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
  156. package/test/examples/source-repository/a/node_modules/nan/nan_new.h +0 -340
  157. package/test/examples/source-repository/a/node_modules/nan/nan_object_wrap.h +0 -156
  158. package/test/examples/source-repository/a/node_modules/nan/nan_persistent_12_inl.h +0 -132
  159. package/test/examples/source-repository/a/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
  160. package/test/examples/source-repository/a/node_modules/nan/nan_private.h +0 -73
  161. package/test/examples/source-repository/a/node_modules/nan/nan_scriptorigin.h +0 -76
  162. package/test/examples/source-repository/a/node_modules/nan/nan_string_bytes.h +0 -305
  163. package/test/examples/source-repository/a/node_modules/nan/nan_typedarray_contents.h +0 -96
  164. package/test/examples/source-repository/a/node_modules/nan/nan_weak.h +0 -437
  165. package/test/examples/source-repository/a/node_modules/nan/package.json +0 -38
  166. package/test/examples/source-repository/a/node_modules/nan/tools/1to2.js +0 -412
  167. package/test/examples/source-repository/a/node_modules/nan/tools/README.md +0 -14
  168. package/test/examples/source-repository/a/node_modules/nan/tools/package.json +0 -19
  169. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.eslintrc.js +0 -20
  170. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierignore +0 -4
  171. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierrc +0 -8
  172. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/CHANGELOG.md +0 -58
  173. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.d.ts +0 -5
  174. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js +0 -18
  175. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js.map +0 -1
  176. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +0 -19
  177. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +0 -555
  178. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +0 -1
  179. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +0 -3
  180. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js +0 -5
  181. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +0 -1
  182. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +0 -45
  183. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +0 -176
  184. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +0 -1
  185. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +0 -11
  186. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +0 -9
  187. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +0 -1
  188. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +0 -13
  189. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +0 -19
  190. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +0 -1
  191. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.d.ts +0 -221
  192. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js +0 -234
  193. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js.map +0 -1
  194. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/index.ts +0 -5
  195. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/jest.config.js +0 -9
  196. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/package.json +0 -42
  197. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +0 -702
  198. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/Loadable.ts +0 -2
  199. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepository.ts +0 -250
  200. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +0 -15
  201. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +0 -14
  202. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/types.ts +0 -236
  203. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/tsconfig.json +0 -19
  204. package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +0 -1
  205. package/test/examples/source-repository/b/node_modules/bindings/LICENSE.md +0 -22
  206. package/test/examples/source-repository/b/node_modules/bindings/README.md +0 -98
  207. package/test/examples/source-repository/b/node_modules/bindings/bindings.js +0 -221
  208. package/test/examples/source-repository/b/node_modules/bindings/package.json +0 -28
  209. package/test/examples/source-repository/b/node_modules/file-uri-to-path/.travis.yml +0 -30
  210. package/test/examples/source-repository/b/node_modules/file-uri-to-path/History.md +0 -21
  211. package/test/examples/source-repository/b/node_modules/file-uri-to-path/LICENSE +0 -20
  212. package/test/examples/source-repository/b/node_modules/file-uri-to-path/README.md +0 -74
  213. package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.d.ts +0 -2
  214. package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.js +0 -66
  215. package/test/examples/source-repository/b/node_modules/file-uri-to-path/package.json +0 -32
  216. package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/test.js +0 -24
  217. package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/tests.json +0 -13
  218. package/test/examples/source-repository/b/node_modules/fsevents/LICENSE +0 -22
  219. package/test/examples/source-repository/b/node_modules/fsevents/README.md +0 -89
  220. package/test/examples/source-repository/b/node_modules/fsevents/fsevents.d.ts +0 -46
  221. package/test/examples/source-repository/b/node_modules/fsevents/fsevents.js +0 -83
  222. package/test/examples/source-repository/b/node_modules/fsevents/fsevents.node +0 -0
  223. package/test/examples/source-repository/b/node_modules/fsevents/package.json +0 -62
  224. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +0 -103
  225. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +0 -8
  226. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/LICENSE +0 -22
  227. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/Readme.md +0 -78
  228. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +0 -21
  229. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +0 -53
  230. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +0 -352
  231. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +0 -1
  232. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +0 -75
  233. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
  234. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +0 -6
  235. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +0 -188
  236. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +0 -772
  237. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +0 -88
  238. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +0 -106
  239. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/install.js +0 -13
  240. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/package.json +0 -34
  241. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +0 -43
  242. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +0 -110
  243. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +0 -44
  244. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +0 -27
  245. package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +0 -71
  246. package/test/examples/source-repository/b/node_modules/nan/CHANGELOG.md +0 -557
  247. package/test/examples/source-repository/b/node_modules/nan/CMakeLists.txt +0 -138
  248. package/test/examples/source-repository/b/node_modules/nan/LICENSE.md +0 -9
  249. package/test/examples/source-repository/b/node_modules/nan/README.md +0 -456
  250. package/test/examples/source-repository/b/node_modules/nan/doc/asyncworker.md +0 -146
  251. package/test/examples/source-repository/b/node_modules/nan/doc/buffers.md +0 -54
  252. package/test/examples/source-repository/b/node_modules/nan/doc/callback.md +0 -76
  253. package/test/examples/source-repository/b/node_modules/nan/doc/converters.md +0 -41
  254. package/test/examples/source-repository/b/node_modules/nan/doc/errors.md +0 -226
  255. package/test/examples/source-repository/b/node_modules/nan/doc/json.md +0 -62
  256. package/test/examples/source-repository/b/node_modules/nan/doc/maybe_types.md +0 -583
  257. package/test/examples/source-repository/b/node_modules/nan/doc/methods.md +0 -672
  258. package/test/examples/source-repository/b/node_modules/nan/doc/new.md +0 -147
  259. package/test/examples/source-repository/b/node_modules/nan/doc/node_misc.md +0 -123
  260. package/test/examples/source-repository/b/node_modules/nan/doc/object_wrappers.md +0 -263
  261. package/test/examples/source-repository/b/node_modules/nan/doc/persistent.md +0 -296
  262. package/test/examples/source-repository/b/node_modules/nan/doc/scopes.md +0 -73
  263. package/test/examples/source-repository/b/node_modules/nan/doc/script.md +0 -58
  264. package/test/examples/source-repository/b/node_modules/nan/doc/string_bytes.md +0 -62
  265. package/test/examples/source-repository/b/node_modules/nan/doc/v8_internals.md +0 -199
  266. package/test/examples/source-repository/b/node_modules/nan/doc/v8_misc.md +0 -85
  267. package/test/examples/source-repository/b/node_modules/nan/include_dirs.js +0 -1
  268. package/test/examples/source-repository/b/node_modules/nan/nan.h +0 -2958
  269. package/test/examples/source-repository/b/node_modules/nan/nan_callbacks.h +0 -92
  270. package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_12_inl.h +0 -520
  271. package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
  272. package/test/examples/source-repository/b/node_modules/nan/nan_converters.h +0 -72
  273. package/test/examples/source-repository/b/node_modules/nan/nan_converters_43_inl.h +0 -68
  274. package/test/examples/source-repository/b/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
  275. package/test/examples/source-repository/b/node_modules/nan/nan_define_own_property_helper.h +0 -29
  276. package/test/examples/source-repository/b/node_modules/nan/nan_implementation_12_inl.h +0 -430
  277. package/test/examples/source-repository/b/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
  278. package/test/examples/source-repository/b/node_modules/nan/nan_json.h +0 -166
  279. package/test/examples/source-repository/b/node_modules/nan/nan_maybe_43_inl.h +0 -356
  280. package/test/examples/source-repository/b/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
  281. package/test/examples/source-repository/b/node_modules/nan/nan_new.h +0 -340
  282. package/test/examples/source-repository/b/node_modules/nan/nan_object_wrap.h +0 -156
  283. package/test/examples/source-repository/b/node_modules/nan/nan_persistent_12_inl.h +0 -132
  284. package/test/examples/source-repository/b/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
  285. package/test/examples/source-repository/b/node_modules/nan/nan_private.h +0 -73
  286. package/test/examples/source-repository/b/node_modules/nan/nan_scriptorigin.h +0 -76
  287. package/test/examples/source-repository/b/node_modules/nan/nan_string_bytes.h +0 -305
  288. package/test/examples/source-repository/b/node_modules/nan/nan_typedarray_contents.h +0 -96
  289. package/test/examples/source-repository/b/node_modules/nan/nan_weak.h +0 -437
  290. package/test/examples/source-repository/b/node_modules/nan/package.json +0 -38
  291. package/test/examples/source-repository/b/node_modules/nan/tools/1to2.js +0 -412
  292. package/test/examples/source-repository/b/node_modules/nan/tools/README.md +0 -14
  293. package/test/examples/source-repository/b/node_modules/nan/tools/package.json +0 -19
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.4.0](https://github.com/proteinjs/reflection/compare/@proteinjs/reflection-build@1.3.0...@proteinjs/reflection-build@1.4.0) (2025-11-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * `refelction-build` added `REFLECTION_EXPORT_FROM` so consumers can use reflection to build a generated test index and specify where test code is exported from (ie. `from ./test/index instead of ./index which was the hardcoded default). ([3a1411d](https://github.com/proteinjs/reflection/commit/3a1411dfdf7ba53c923ba46efe6c0ddf651373c4))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.3.0](https://github.com/proteinjs/reflection/compare/@proteinjs/reflection-build@1.2.1...@proteinjs/reflection-build@1.3.0) (2025-11-08)
18
+
19
+
20
+ ### Features
21
+
22
+ * `relfection-build` now supports `REFLECTION_SOURCE_DIRS` and `REFLECTION_DIST_DIR` env vars. ([#3](https://github.com/proteinjs/reflection/issues/3)) ([95d6836](https://github.com/proteinjs/reflection/commit/95d68364859e8526f2218cfeda85c23ade9a210f))
23
+
24
+
25
+
26
+
27
+
6
28
  # [1.2.0](https://github.com/proteinjs/reflection/compare/@proteinjs/reflection-build@1.1.1...@proteinjs/reflection-build@1.2.0) (2025-06-03)
7
29
 
8
30
 
@@ -1,7 +1,6 @@
1
1
  MIT License
2
- -----------
3
2
 
4
- Copyright (C) 2010-2014 Philipp Dunkel
3
+ Copyright (c) 2023 Brent Bahry
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
6
  of this software and associated documentation files (the "Software"), to deal
@@ -10,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
9
  copies of the Software, and to permit persons to whom the Software is
11
10
  furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
15
14
 
16
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/src/build.js CHANGED
@@ -69,7 +69,7 @@ function build() {
69
69
  // TODO save their index location in package.json and pass it in to writeGeneratedIndex above
70
70
  function updatePackageJson() {
71
71
  return __awaiter(this, void 0, void 0, function () {
72
- var targetDirPackageJson, targetPackageJson, originalPackageJsonString, targetDirDist, targetDirDistGenerated, generatedIndexJs, generatedIndexDts, updatedPackageJsonString;
72
+ var targetDirPackageJson, targetPackageJson, originalPackageJsonString, isProd, targetDirDist, relGenPath, targetDirDistGenerated, generatedIndexJs, generatedIndexDts, updatedPackageJsonString;
73
73
  return __generator(this, function (_a) {
74
74
  switch (_a.label) {
75
75
  case 0:
@@ -81,15 +81,21 @@ function build() {
81
81
  }
82
82
  targetPackageJson = require(targetDirPackageJson);
83
83
  originalPackageJsonString = JSON.stringify(targetPackageJson, null, 2);
84
- targetDirDist = path.join(targetDir, 'dist');
85
- targetDirDistGenerated = path.join(targetDirDist, 'generated');
86
- generatedIndexJs = path.join(targetDirDistGenerated, 'index.js');
87
- generatedIndexDts = path.join(targetDirDistGenerated, 'index.d.ts');
88
- targetPackageJson.main = "./".concat(path.relative(targetDir, generatedIndexJs));
89
- targetPackageJson.types = "./".concat(path.relative(targetDir, generatedIndexDts));
84
+ isProd = primaryRoot === 'src';
85
+ if (isProd) {
86
+ targetDirDist = path.join(targetDir, distDirRel);
87
+ relGenPath = primaryRoot && primaryRoot !== 'src'
88
+ ? path.relative(targetDir, path.join(targetDir, 'generated', primaryRoot))
89
+ : path.relative(targetDir, path.join(targetDir, 'generated'));
90
+ targetDirDistGenerated = path.join(targetDirDist, relGenPath);
91
+ generatedIndexJs = path.join(targetDirDistGenerated, 'index.js');
92
+ generatedIndexDts = path.join(targetDirDistGenerated, 'index.d.ts');
93
+ targetPackageJson.main = "./".concat(path.relative(targetDir, generatedIndexJs));
94
+ targetPackageJson.types = "./".concat(path.relative(targetDir, generatedIndexDts));
95
+ }
90
96
  updatedPackageJsonString = JSON.stringify(targetPackageJson, null, 2);
91
97
  if (!(originalPackageJsonString !== updatedPackageJsonString)) return [3 /*break*/, 3];
92
- return [4 /*yield*/, util_node_1.promisifiedFs.writeFile(targetDirPackageJson, JSON.stringify(targetPackageJson, null, 2))];
98
+ return [4 /*yield*/, util_node_1.promisifiedFs.writeFile(targetDirPackageJson, updatedPackageJsonString)];
93
99
  case 2:
94
100
  _a.sent();
95
101
  _a.label = 3;
@@ -100,16 +106,16 @@ function build() {
100
106
  }
101
107
  function writeTsconfig() {
102
108
  return __awaiter(this, void 0, void 0, function () {
103
- var existingTsconfig, generatedTsconfig;
109
+ var existingTsconfig, includePath, generatedTsconfig;
104
110
  return __generator(this, function (_a) {
105
111
  switch (_a.label) {
106
112
  case 0: return [4 /*yield*/, util_node_1.promisifiedFs.exists(targetDirTsconfig)];
107
113
  case 1:
108
114
  if (!_a.sent()) return [3 /*break*/, 4];
109
115
  existingTsconfig = require(targetDirTsconfig);
110
- if (!(existingTsconfig.include &&
111
- !existingTsconfig.include.includes("./".concat(path.relative(targetDir, generatedIndex))))) return [3 /*break*/, 3];
112
- existingTsconfig.include.push("./".concat(path.relative(targetDir, generatedIndex)));
116
+ includePath = "./".concat(path.relative(targetDir, generatedIndex));
117
+ if (!(existingTsconfig.include && !existingTsconfig.include.includes(includePath))) return [3 /*break*/, 3];
118
+ existingTsconfig.include.push(includePath);
113
119
  return [4 /*yield*/, util_node_1.promisifiedFs.writeFile(targetDirTsconfig, JSON.stringify(existingTsconfig, null, 4))];
114
120
  case 2:
115
121
  _a.sent();
@@ -127,13 +133,23 @@ function build() {
127
133
  });
128
134
  });
129
135
  }
130
- var targetDir, targetDirTsconfig, targetDirGenerated, generatedIndex;
136
+ var targetDir, targetDirTsconfig, sourceRootsRaw, sourceRoots, primaryRoot, publicEntryRelOverride, distDirRel, targetDirGenerated, generatedIndex;
131
137
  return __generator(this, function (_a) {
132
138
  switch (_a.label) {
133
139
  case 0:
134
140
  targetDir = process.env.INIT_CWD;
135
141
  targetDirTsconfig = path.join(targetDir, 'tsconfig.json');
136
- targetDirGenerated = path.join(targetDir, 'generated');
142
+ sourceRootsRaw = (process.env.REFLECTION_SOURCE_DIRS || '')
143
+ .split(',')
144
+ .map(function (s) { return s.trim(); })
145
+ .filter(Boolean);
146
+ sourceRoots = sourceRootsRaw.length > 0 ? sourceRootsRaw : ['src'];
147
+ primaryRoot = sourceRoots[0];
148
+ publicEntryRelOverride = process.env.REFLECTION_EXPORT_FROM;
149
+ distDirRel = process.env.REFLECTION_DIST_DIR || 'dist';
150
+ targetDirGenerated = primaryRoot && primaryRoot !== 'src'
151
+ ? path.join(targetDir, 'generated', primaryRoot)
152
+ : path.join(targetDir, 'generated');
137
153
  generatedIndex = path.join(targetDirGenerated, 'index.ts');
138
154
  return [4 /*yield*/, updatePackageJson()];
139
155
  case 1:
@@ -141,7 +157,7 @@ function build() {
141
157
  return [4 /*yield*/, writeTsconfig()];
142
158
  case 2:
143
159
  _a.sent();
144
- return [4 /*yield*/, (0, writeGeneratedIndex_1.writeGeneratedIndex)(targetDir, targetDirGenerated, generatedIndex)];
160
+ return [4 /*yield*/, (0, writeGeneratedIndex_1.writeGeneratedIndex)(targetDir, targetDirGenerated, generatedIndex, sourceRoots, publicEntryRelOverride)];
145
161
  case 3:
146
162
  _a.sent();
147
163
  return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/build.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,IAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACpD,kDAAqD;AACrD,qEAAoE;AAEpE,SAAsB,KAAK;;QASzB,6FAA6F;QAC7F,SAAe,iBAAiB;;;;;;4BACxB,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,C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I,WAAW,KAAK,KAAK;wBAClC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC;wBAChD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;oBAElC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;oBAEjE,qBAAM,iBAAiB,EAAE,EAAA;;oBAAzB,SAAyB,CAAC;oBAC1B,qBAAM,aAAa,EAAE,EAAA;;oBAArB,SAAqB,CAAC;oBACtB,qBAAM,IAAA,yCAAmB,EAAC,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,CAAC,EAAA;;oBAA7G,SAA6G,CAAC;;;;;CAmD/G;AArFD,sBAqFC"}
@@ -1 +1,10 @@
1
- export declare function writeGeneratedIndex(packageDir: string, packageGeneratedDir: string, generatedIndexPath: string): Promise<void>;
1
+ /**
2
+ * @param packageDir Root of the package (contains package.json)
3
+ * @param packageGeneratedDir Directory where generated/index.ts will be written
4
+ * @param generatedIndexPath Full path to generated/index.ts
5
+ * @param sourceRootsRel Relative directories to scan (e.g. ['test','src']) — defaults to 'src'
6
+ * @param publicEntryRelOverride Optional relative path (from package root) to the public entry that the
7
+ * generated index should re-export from (e.g. 'test/index.ts').
8
+ * If omitted, we re-export from '<packageRoot>/index'.
9
+ */
10
+ export declare function writeGeneratedIndex(packageDir: string, packageGeneratedDir: string, generatedIndexPath: string, sourceRootsRel?: string | string[], publicEntryRelOverride?: string): Promise<void>;
@@ -69,9 +69,19 @@ var util_1 = require("@proteinjs/util");
69
69
  var jsesc_1 = __importDefault(require("jsesc"));
70
70
  var createSourceGraph_1 = require("../parser/createSourceGraph");
71
71
  var reflection_1 = require("@proteinjs/reflection");
72
- function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath) {
72
+ /**
73
+ * @param packageDir Root of the package (contains package.json)
74
+ * @param packageGeneratedDir Directory where generated/index.ts will be written
75
+ * @param generatedIndexPath Full path to generated/index.ts
76
+ * @param sourceRootsRel Relative directories to scan (e.g. ['test','src']) — defaults to 'src'
77
+ * @param publicEntryRelOverride Optional relative path (from package root) to the public entry that the
78
+ * generated index should re-export from (e.g. 'test/index.ts').
79
+ * If omitted, we re-export from '<packageRoot>/index'.
80
+ */
81
+ function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath, sourceRootsRel, publicEntryRelOverride) {
82
+ if (sourceRootsRel === void 0) { sourceRootsRel = 'src'; }
73
83
  return __awaiter(this, void 0, void 0, function () {
74
- var packageIndexPath, generatedIndex;
84
+ var packageIndexPath, overrideAbsCandidates, exists, generatedIndex, exportTargetNoExt;
75
85
  return __generator(this, function (_a) {
76
86
  switch (_a.label) {
77
87
  case 0:
@@ -86,15 +96,35 @@ function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath
86
96
  throw new Error('Cannot find index.ts at ./index.ts or ./src/index.ts');
87
97
  }
88
98
  _a.label = 3;
89
- case 3: return [4 /*yield*/, util_node_1.promisifiedFs.mkdir(packageGeneratedDir, { recursive: true })];
99
+ case 3:
100
+ if (!publicEntryRelOverride) return [3 /*break*/, 5];
101
+ overrideAbsCandidates = [
102
+ path.join(packageDir, publicEntryRelOverride),
103
+ path.join(packageDir, publicEntryRelOverride.replace(/\.[^/.]+$/, '') + '.ts'),
104
+ path.join(packageDir, publicEntryRelOverride.replace(/\.[^/.]+$/, '') + '.tsx'),
105
+ ];
106
+ return [4 /*yield*/, Promise.all(overrideAbsCandidates.map(function (p) { return util_node_1.promisifiedFs.exists(p); }))];
90
107
  case 4:
108
+ exists = _a.sent();
109
+ if (!exists.some(Boolean)) {
110
+ // Soft fail with a better message; do not throw, to keep behavior minimal and predictable.
111
+ // If it truly doesn't exist, the final 'export * from' will fail at compile time which is also explicit.
112
+ // eslint-disable-next-line no-console
113
+ console.warn("[reflection-build] WARN: REFLECTION_EXPORT_FROM points at '".concat(publicEntryRelOverride, "', but no .ts/.tsx file was found under the package root."));
114
+ }
115
+ _a.label = 5;
116
+ case 5: return [4 /*yield*/, util_node_1.promisifiedFs.mkdir(packageGeneratedDir, { recursive: true })];
117
+ case 6:
91
118
  _a.sent();
92
- return [4 /*yield*/, sourceRepositoryLoader(packageDir, generatedIndexPath)];
93
- case 5:
119
+ return [4 /*yield*/, sourceRepositoryLoader(packageDir, generatedIndexPath, sourceRootsRel)];
120
+ case 7:
94
121
  generatedIndex = _a.sent();
95
- generatedIndex += "\n\n\nexport * from '".concat(path.relative(packageGeneratedDir, packageDir), "/index';");
122
+ exportTargetNoExt = publicEntryRelOverride
123
+ ? path.relative(packageGeneratedDir, path.join(packageDir, publicEntryRelOverride)).replace(/\.[^/.]+$/, '')
124
+ : "".concat(path.relative(packageGeneratedDir, packageDir), "/index");
125
+ generatedIndex += "\n\n\nexport * from '".concat(exportTargetNoExt, "';");
96
126
  return [4 /*yield*/, util_node_1.promisifiedFs.writeFile(generatedIndexPath, generatedIndex)];
97
- case 6:
127
+ case 8:
98
128
  _a.sent();
99
129
  return [2 /*return*/];
100
130
  }
@@ -102,16 +132,17 @@ function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath
102
132
  });
103
133
  }
104
134
  exports.writeGeneratedIndex = writeGeneratedIndex;
105
- function sourceRepositoryLoader(packageDir, generatedIndexPath) {
135
+ function sourceRepositoryLoader(packageDir, generatedIndexPath, sourceRootsRel) {
106
136
  return __awaiter(this, void 0, void 0, function () {
107
- var packageJson, code, sourceGraph;
137
+ var packageJson, code, roots, sourceGraph;
108
138
  return __generator(this, function (_a) {
109
139
  switch (_a.label) {
110
140
  case 0: return [4 /*yield*/, getPackageJson(packageDir)];
111
141
  case 1:
112
142
  packageJson = _a.sent();
113
143
  code = loadDependencySourceGraphs(packageDir, packageJson);
114
- return [4 /*yield*/, (0, createSourceGraph_1.createSourceGraph)(packageDir)];
144
+ roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
145
+ return [4 /*yield*/, (0, createSourceGraph_1.createSourceGraph)(packageDir, [], roots)];
115
146
  case 2:
116
147
  sourceGraph = _a.sent();
117
148
  code += generateSourceGraph(sourceGraph, packageJson.name);
@@ -173,7 +204,7 @@ function getDependencyImportSpecifier(packageDir, packageName) {
173
204
  return packageName;
174
205
  }
175
206
  catch (_a) {
176
- // Load the dependency's package.json to inspect exports or entryfields
207
+ // Load the dependency's package.json to inspect exports or entry fields
177
208
  var depPkgJson = void 0;
178
209
  try {
179
210
  var pkgJsonPath = require.resolve(path.join(packageName, 'package.json'), { paths: [packageDir] });
@@ -241,7 +272,7 @@ function removeNonLoadables(sourceGraph, buildTargetPackageName) {
241
272
  var nodeName = _a[_i];
242
273
  var node = sourceGraph.node(nodeName);
243
274
  if (!node) {
244
- // may have been removed by a previous interation
275
+ // may have been removed by a previous iteration
245
276
  continue;
246
277
  }
247
278
  removeNonLoadableNode(node, buildTargetPackageName, sourceGraph);
@@ -1 +1 @@
1
- {"version":3,"file":"writeGeneratedIndex.js","sourceRoot":"","sources":["../../../src/codegen/writeGeneratedIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,kDAAqD;AACrD,wCAAgE;AAEhE,gDAA0B;AAC1B,iEAAgE;AAChE,oDAAqH;AAErH,SAAsB,mBAAmB,CAAC,UAAkB,EAAE,mBAA2B,EAAE,kBAA0B;;;;;;oBAC/G,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;oBACnD,qBAAM,yBAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAA;;yBAA9C,CAAC,CAAC,SAA4C,CAAC,EAA/C,wBAA+C;oBACjD,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;oBACnD,qBAAM,yBAAa,CAAC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,CAAC,IAAI,CAAC,CAAC;KAC1B;IAED,IAAI,IAAI,2BAA2B,CAAC;IACpC,KAAmB,UAAa,EAAb,+BAAa,EAAb,2BAAa,EAAb,IAAa,EAAE;QAA7B,IAAM,IAAI,sBAAA;QACb,IAAI,IAAI,aAAM,IAAI,CAAC,aAAa,gBAAM,IAAI,CAAC,IAAI,QAAK,CAAC;KACtD;IACD,IAAI,IAAI,MAAM,CAAC;IAEf,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB;IACvB,IAAI,IAAI,GAAG,4CAA4C,CAAC;IACxD,IAAI,IAAI,6DAA6D,CAAC;IACtE,IAAI,IAAI,mDAAmD,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import * as graphlib from '@dagrejs/graphlib';
2
- export declare function createSourceGraph(dir: string, excludedDirs?: string[]): Promise<graphlib.Graph>;
2
+ export declare function createSourceGraph(dir: string, excludedDirs?: string[], sourceRootsRel?: string | string[]): Promise<graphlib.Graph>;
@@ -58,6 +58,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
58
58
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
59
  }
60
60
  };
61
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
62
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
63
+ if (ar || !(i in from)) {
64
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
65
+ ar[i] = from[i];
66
+ }
67
+ }
68
+ return to.concat(ar || Array.prototype.slice.call(from));
69
+ };
61
70
  var __importDefault = (this && this.__importDefault) || function (mod) {
62
71
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
72
  };
@@ -69,48 +78,53 @@ var path = __importStar(require("path"));
69
78
  var typescript_parser_1 = require("../../modules/typescript-parser");
70
79
  var util_node_1 = require("@proteinjs/util-node");
71
80
  var createGraphBuilder_1 = require("./createGraphBuilder");
72
- function createSourceGraph(dir, excludedDirs) {
81
+ function createSourceGraph(dir, excludedDirs, sourceRootsRel) {
73
82
  if (excludedDirs === void 0) { excludedDirs = []; }
83
+ if (sourceRootsRel === void 0) { sourceRootsRel = 'src'; }
74
84
  return __awaiter(this, void 0, void 0, function () {
75
- var packageJsonPath, packageJson, sourceFilePaths, graph, addSourceFile, parser, _i, sourceFilePaths_1, sourceFilePath, sourceFile;
76
- return __generator(this, function (_a) {
77
- switch (_a.label) {
85
+ var packageJsonPath, packageJson, roots, patterns, _i, roots_1, rel, root, excludePatterns, sourceFilePaths, uniqueFilePaths, graph, addSourceFile, parser, _a, uniqueFilePaths_1, sourceFilePath, sourceFile;
86
+ return __generator(this, function (_b) {
87
+ switch (_b.label) {
78
88
  case 0:
79
89
  packageJsonPath = path.join(dir, 'package.json');
80
90
  return [4 /*yield*/, util_node_1.promisifiedFs.exists(packageJsonPath)];
81
91
  case 1:
82
- if (!(_a.sent())) {
92
+ if (!(_b.sent())) {
83
93
  throw new Error("Unable to find package.json in dir: ".concat(dir));
84
94
  }
85
95
  packageJson = require(packageJsonPath);
86
- return [4 /*yield*/, (0, globby_1.default)([path.join(dir, 'src/**/*.ts'), path.join(dir, 'src/**/*.tsx'), '!**/node_modules/**'].concat(excludedDirs.map(function (dir) { return "!".concat(dir); })))];
96
+ roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
97
+ patterns = [];
98
+ for (_i = 0, roots_1 = roots; _i < roots_1.length; _i++) {
99
+ rel = roots_1[_i];
100
+ root = path.join(dir, rel);
101
+ patterns.push(path.join(root, '**/*.ts'));
102
+ patterns.push(path.join(root, '**/*.tsx'));
103
+ }
104
+ excludePatterns = __spreadArray(['!**/node_modules/**', '!**/generated/**'], excludedDirs.map(function (d) { return "!".concat(d); }), true);
105
+ return [4 /*yield*/, (0, globby_1.default)(__spreadArray(__spreadArray([], patterns, true), excludePatterns, true))];
87
106
  case 2:
88
- sourceFilePaths = _a.sent();
107
+ sourceFilePaths = _b.sent();
108
+ uniqueFilePaths = Array.from(new Set(sourceFilePaths));
89
109
  graph = new graphlib.Graph();
90
110
  addSourceFile = (0, createGraphBuilder_1.createGraphBuilder)(graph, packageJson, dir);
91
111
  parser = new typescript_parser_1.TypescriptParser();
92
- _i = 0, sourceFilePaths_1 = sourceFilePaths;
93
- _a.label = 3;
112
+ _a = 0, uniqueFilePaths_1 = uniqueFilePaths;
113
+ _b.label = 3;
94
114
  case 3:
95
- if (!(_i < sourceFilePaths_1.length)) return [3 /*break*/, 7];
96
- sourceFilePath = sourceFilePaths_1[_i];
115
+ if (!(_a < uniqueFilePaths_1.length)) return [3 /*break*/, 7];
116
+ sourceFilePath = uniqueFilePaths_1[_a];
97
117
  return [4 /*yield*/, parser.parseFile(sourceFilePath, path.dirname(sourceFilePath))];
98
118
  case 4:
99
- sourceFile = _a.sent();
100
- // console.log(`File imports (${sourceFile.filePath}): ${JSON.stringify(sourceFile.imports, null, 2)}`);
119
+ sourceFile = _b.sent();
101
120
  return [4 /*yield*/, addSourceFile(sourceFile)];
102
121
  case 5:
103
- // console.log(`File imports (${sourceFile.filePath}): ${JSON.stringify(sourceFile.imports, null, 2)}`);
104
- _a.sent();
105
- _a.label = 6;
122
+ _b.sent();
123
+ _b.label = 6;
106
124
  case 6:
107
- _i++;
125
+ _a++;
108
126
  return [3 /*break*/, 3];
109
- case 7:
110
- // for (const node of graph.nodes()) {
111
- // console.log(JSON.stringify(graph.node(node), null, 2));
112
- // }
113
- return [2 /*return*/, graph];
127
+ case 7: return [2 /*return*/, graph];
114
128
  }
115
129
  });
116
130
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createSourceGraph.js","sourceRoot":"","sources":["../../../src/parser/createSourceGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA8C;AAC9C,kDAA4B;AAC5B,yCAA6B;AAC7B,qEAAmE;AACnE,kDAAq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