@antelopejs/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +52 -0
  3. package/dist/cli/common.d.ts +21 -0
  4. package/dist/cli/common.js +86 -0
  5. package/dist/cli/common.js.map +1 -0
  6. package/dist/cli/config/get.d.ts +2 -0
  7. package/dist/cli/config/get.js +36 -0
  8. package/dist/cli/config/get.js.map +1 -0
  9. package/dist/cli/config/index.d.ts +2 -0
  10. package/dist/cli/config/index.js +20 -0
  11. package/dist/cli/config/index.js.map +1 -0
  12. package/dist/cli/config/reset.d.ts +2 -0
  13. package/dist/cli/config/reset.js +88 -0
  14. package/dist/cli/config/reset.js.map +1 -0
  15. package/dist/cli/config/set.d.ts +2 -0
  16. package/dist/cli/config/set.js +46 -0
  17. package/dist/cli/config/set.js.map +1 -0
  18. package/dist/cli/config/show.d.ts +2 -0
  19. package/dist/cli/config/show.js +27 -0
  20. package/dist/cli/config/show.js.map +1 -0
  21. package/dist/cli/git.d.ts +49 -0
  22. package/dist/cli/git.js +248 -0
  23. package/dist/cli/git.js.map +1 -0
  24. package/dist/cli/index.d.ts +2 -0
  25. package/dist/cli/index.js +61 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/cli/module/exports/generate.d.ts +2 -0
  28. package/dist/cli/module/exports/generate.js +178 -0
  29. package/dist/cli/module/exports/generate.js.map +1 -0
  30. package/dist/cli/module/exports/index.d.ts +2 -0
  31. package/dist/cli/module/exports/index.js +16 -0
  32. package/dist/cli/module/exports/index.js.map +1 -0
  33. package/dist/cli/module/exports/set.d.ts +2 -0
  34. package/dist/cli/module/exports/set.js +43 -0
  35. package/dist/cli/module/exports/set.js.map +1 -0
  36. package/dist/cli/module/imports/add.d.ts +9 -0
  37. package/dist/cli/module/imports/add.js +127 -0
  38. package/dist/cli/module/imports/add.js.map +1 -0
  39. package/dist/cli/module/imports/index.d.ts +2 -0
  40. package/dist/cli/module/imports/index.js +20 -0
  41. package/dist/cli/module/imports/index.js.map +1 -0
  42. package/dist/cli/module/imports/list.d.ts +2 -0
  43. package/dist/cli/module/imports/list.js +89 -0
  44. package/dist/cli/module/imports/list.js.map +1 -0
  45. package/dist/cli/module/imports/remove.d.ts +2 -0
  46. package/dist/cli/module/imports/remove.js +97 -0
  47. package/dist/cli/module/imports/remove.js.map +1 -0
  48. package/dist/cli/module/imports/update.d.ts +2 -0
  49. package/dist/cli/module/imports/update.js +157 -0
  50. package/dist/cli/module/imports/update.js.map +1 -0
  51. package/dist/cli/module/index.d.ts +2 -0
  52. package/dist/cli/module/index.js +20 -0
  53. package/dist/cli/module/index.js.map +1 -0
  54. package/dist/cli/module/init.d.ts +7 -0
  55. package/dist/cli/module/init.js +120 -0
  56. package/dist/cli/module/init.js.map +1 -0
  57. package/dist/cli/module/test.d.ts +3 -0
  58. package/dist/cli/module/test.js +33 -0
  59. package/dist/cli/module/test.js.map +1 -0
  60. package/dist/cli/project/index.d.ts +2 -0
  61. package/dist/cli/project/index.js +20 -0
  62. package/dist/cli/project/index.js.map +1 -0
  63. package/dist/cli/project/init.d.ts +2 -0
  64. package/dist/cli/project/init.js +122 -0
  65. package/dist/cli/project/init.js.map +1 -0
  66. package/dist/cli/project/logging/index.d.ts +2 -0
  67. package/dist/cli/project/logging/index.js +16 -0
  68. package/dist/cli/project/logging/index.js.map +1 -0
  69. package/dist/cli/project/logging/set.d.ts +2 -0
  70. package/dist/cli/project/logging/set.js +352 -0
  71. package/dist/cli/project/logging/set.js.map +1 -0
  72. package/dist/cli/project/logging/show.d.ts +2 -0
  73. package/dist/cli/project/logging/show.js +92 -0
  74. package/dist/cli/project/logging/show.js.map +1 -0
  75. package/dist/cli/project/modules/add.d.ts +11 -0
  76. package/dist/cli/project/modules/add.js +157 -0
  77. package/dist/cli/project/modules/add.js.map +1 -0
  78. package/dist/cli/project/modules/fix.d.ts +2 -0
  79. package/dist/cli/project/modules/fix.js +201 -0
  80. package/dist/cli/project/modules/fix.js.map +1 -0
  81. package/dist/cli/project/modules/index.d.ts +2 -0
  82. package/dist/cli/project/modules/index.js +20 -0
  83. package/dist/cli/project/modules/index.js.map +1 -0
  84. package/dist/cli/project/modules/remove.d.ts +9 -0
  85. package/dist/cli/project/modules/remove.js +102 -0
  86. package/dist/cli/project/modules/remove.js.map +1 -0
  87. package/dist/cli/project/modules/update.d.ts +2 -0
  88. package/dist/cli/project/modules/update.js +117 -0
  89. package/dist/cli/project/modules/update.js.map +1 -0
  90. package/dist/cli/project/run.d.ts +2 -0
  91. package/dist/cli/project/run.js +107 -0
  92. package/dist/cli/project/run.js.map +1 -0
  93. package/dist/common/cache.d.ts +14 -0
  94. package/dist/common/cache.js +100 -0
  95. package/dist/common/cache.js.map +1 -0
  96. package/dist/common/config.d.ts +54 -0
  97. package/dist/common/config.js +160 -0
  98. package/dist/common/config.js.map +1 -0
  99. package/dist/common/downloader/git.d.ts +8 -0
  100. package/dist/common/downloader/git.js +61 -0
  101. package/dist/common/downloader/git.js.map +1 -0
  102. package/dist/common/downloader/index.d.ts +10 -0
  103. package/dist/common/downloader/index.js +57 -0
  104. package/dist/common/downloader/index.js.map +1 -0
  105. package/dist/common/downloader/local.d.ts +11 -0
  106. package/dist/common/downloader/local.js +58 -0
  107. package/dist/common/downloader/local.js.map +1 -0
  108. package/dist/common/downloader/package.d.ts +6 -0
  109. package/dist/common/downloader/package.js +53 -0
  110. package/dist/common/downloader/package.js.map +1 -0
  111. package/dist/common/manifest.d.ts +45 -0
  112. package/dist/common/manifest.js +116 -0
  113. package/dist/common/manifest.js.map +1 -0
  114. package/dist/eslint.config.d.mts +2 -0
  115. package/dist/eslint.config.mjs +85 -0
  116. package/dist/eslint.config.mjs.map +1 -0
  117. package/dist/index.d.ts +6 -0
  118. package/dist/index.js +118 -0
  119. package/dist/index.js.map +1 -0
  120. package/dist/interfaces/core/1/decorators.d.ts +29 -0
  121. package/dist/interfaces/core/1/decorators.js +72 -0
  122. package/dist/interfaces/core/1/decorators.js.map +1 -0
  123. package/dist/interfaces/core/1/index.d.ts +54 -0
  124. package/dist/interfaces/core/1/index.js +237 -0
  125. package/dist/interfaces/core/1/index.js.map +1 -0
  126. package/dist/interfaces/core/1/modules.d.ts +26 -0
  127. package/dist/interfaces/core/1/modules.js +31 -0
  128. package/dist/interfaces/core/1/modules.js.map +1 -0
  129. package/dist/interfaces/core/beta/decorators.d.ts +29 -0
  130. package/dist/interfaces/core/beta/decorators.js +72 -0
  131. package/dist/interfaces/core/beta/decorators.js.map +1 -0
  132. package/dist/interfaces/core/beta/index.d.ts +54 -0
  133. package/dist/interfaces/core/beta/index.js +237 -0
  134. package/dist/interfaces/core/beta/index.js.map +1 -0
  135. package/dist/interfaces/core/beta/modules.d.ts +26 -0
  136. package/dist/interfaces/core/beta/modules.js +31 -0
  137. package/dist/interfaces/core/beta/modules.js.map +1 -0
  138. package/dist/interfaces/logging/1/index.d.ts +16 -0
  139. package/dist/interfaces/logging/1/index.js +49 -0
  140. package/dist/interfaces/logging/1/index.js.map +1 -0
  141. package/dist/interfaces/logging/1/listener.d.ts +9 -0
  142. package/dist/interfaces/logging/1/listener.js +5 -0
  143. package/dist/interfaces/logging/1/listener.js.map +1 -0
  144. package/dist/interfaces/logging/beta/index.d.ts +16 -0
  145. package/dist/interfaces/logging/beta/index.js +49 -0
  146. package/dist/interfaces/logging/beta/index.js.map +1 -0
  147. package/dist/interfaces/logging/beta/listener.d.ts +9 -0
  148. package/dist/interfaces/logging/beta/listener.js +5 -0
  149. package/dist/interfaces/logging/beta/listener.js.map +1 -0
  150. package/dist/loader/index.d.ts +45 -0
  151. package/dist/loader/index.js +472 -0
  152. package/dist/loader/index.js.map +1 -0
  153. package/dist/loader/module.d.ts +29 -0
  154. package/dist/loader/module.js +142 -0
  155. package/dist/loader/module.js.map +1 -0
  156. package/dist/logging/index.d.ts +5 -0
  157. package/dist/logging/index.js +124 -0
  158. package/dist/logging/index.js.map +1 -0
  159. package/dist/src/cli/common.d.ts +18 -0
  160. package/dist/src/cli/common.js +105 -0
  161. package/dist/src/cli/common.js.map +1 -0
  162. package/dist/src/cli/config/get.d.ts +2 -0
  163. package/dist/src/cli/config/get.js +36 -0
  164. package/dist/src/cli/config/get.js.map +1 -0
  165. package/dist/src/cli/config/index.d.ts +2 -0
  166. package/dist/src/cli/config/index.js +20 -0
  167. package/dist/src/cli/config/index.js.map +1 -0
  168. package/dist/src/cli/config/reset.d.ts +2 -0
  169. package/dist/src/cli/config/reset.js +88 -0
  170. package/dist/src/cli/config/reset.js.map +1 -0
  171. package/dist/src/cli/config/set.d.ts +2 -0
  172. package/dist/src/cli/config/set.js +42 -0
  173. package/dist/src/cli/config/set.js.map +1 -0
  174. package/dist/src/cli/config/show.d.ts +2 -0
  175. package/dist/src/cli/config/show.js +27 -0
  176. package/dist/src/cli/config/show.js.map +1 -0
  177. package/dist/src/cli/git.d.ts +43 -0
  178. package/dist/src/cli/git.js +227 -0
  179. package/dist/src/cli/git.js.map +1 -0
  180. package/dist/src/cli/index.d.ts +2 -0
  181. package/dist/src/cli/index.js +43 -0
  182. package/dist/src/cli/index.js.map +1 -0
  183. package/dist/src/cli/module/exports/generate.d.ts +2 -0
  184. package/dist/src/cli/module/exports/generate.js +71 -0
  185. package/dist/src/cli/module/exports/generate.js.map +1 -0
  186. package/dist/src/cli/module/exports/index.d.ts +2 -0
  187. package/dist/src/cli/module/exports/index.js +16 -0
  188. package/dist/src/cli/module/exports/index.js.map +1 -0
  189. package/dist/src/cli/module/exports/set.d.ts +2 -0
  190. package/dist/src/cli/module/exports/set.js +43 -0
  191. package/dist/src/cli/module/exports/set.js.map +1 -0
  192. package/dist/src/cli/module/imports/add.d.ts +9 -0
  193. package/dist/src/cli/module/imports/add.js +98 -0
  194. package/dist/src/cli/module/imports/add.js.map +1 -0
  195. package/dist/src/cli/module/imports/index.d.ts +2 -0
  196. package/dist/src/cli/module/imports/index.js +20 -0
  197. package/dist/src/cli/module/imports/index.js.map +1 -0
  198. package/dist/src/cli/module/imports/list.d.ts +2 -0
  199. package/dist/src/cli/module/imports/list.js +89 -0
  200. package/dist/src/cli/module/imports/list.js.map +1 -0
  201. package/dist/src/cli/module/imports/remove.d.ts +2 -0
  202. package/dist/src/cli/module/imports/remove.js +97 -0
  203. package/dist/src/cli/module/imports/remove.js.map +1 -0
  204. package/dist/src/cli/module/imports/update.d.ts +2 -0
  205. package/dist/src/cli/module/imports/update.js +129 -0
  206. package/dist/src/cli/module/imports/update.js.map +1 -0
  207. package/dist/src/cli/module/index.d.ts +2 -0
  208. package/dist/src/cli/module/index.js +20 -0
  209. package/dist/src/cli/module/index.js.map +1 -0
  210. package/dist/src/cli/module/init.d.ts +7 -0
  211. package/dist/src/cli/module/init.js +136 -0
  212. package/dist/src/cli/module/init.js.map +1 -0
  213. package/dist/src/cli/module/test.d.ts +6 -0
  214. package/dist/src/cli/module/test.js +20 -0
  215. package/dist/src/cli/module/test.js.map +1 -0
  216. package/dist/src/cli/project/index.d.ts +2 -0
  217. package/dist/src/cli/project/index.js +20 -0
  218. package/dist/src/cli/project/index.js.map +1 -0
  219. package/dist/src/cli/project/init.d.ts +2 -0
  220. package/dist/src/cli/project/init.js +116 -0
  221. package/dist/src/cli/project/init.js.map +1 -0
  222. package/dist/src/cli/project/logging/index.d.ts +2 -0
  223. package/dist/src/cli/project/logging/index.js +16 -0
  224. package/dist/src/cli/project/logging/index.js.map +1 -0
  225. package/dist/src/cli/project/logging/set.d.ts +2 -0
  226. package/dist/src/cli/project/logging/set.js +353 -0
  227. package/dist/src/cli/project/logging/set.js.map +1 -0
  228. package/dist/src/cli/project/logging/show.d.ts +2 -0
  229. package/dist/src/cli/project/logging/show.js +93 -0
  230. package/dist/src/cli/project/logging/show.js.map +1 -0
  231. package/dist/src/cli/project/modules/add.d.ts +11 -0
  232. package/dist/src/cli/project/modules/add.js +161 -0
  233. package/dist/src/cli/project/modules/add.js.map +1 -0
  234. package/dist/src/cli/project/modules/fix.d.ts +2 -0
  235. package/dist/src/cli/project/modules/fix.js +224 -0
  236. package/dist/src/cli/project/modules/fix.js.map +1 -0
  237. package/dist/src/cli/project/modules/index.d.ts +2 -0
  238. package/dist/src/cli/project/modules/index.js +20 -0
  239. package/dist/src/cli/project/modules/index.js.map +1 -0
  240. package/dist/src/cli/project/modules/remove.d.ts +9 -0
  241. package/dist/src/cli/project/modules/remove.js +102 -0
  242. package/dist/src/cli/project/modules/remove.js.map +1 -0
  243. package/dist/src/cli/project/modules/update.d.ts +2 -0
  244. package/dist/src/cli/project/modules/update.js +117 -0
  245. package/dist/src/cli/project/modules/update.js.map +1 -0
  246. package/dist/src/cli/project/run.d.ts +2 -0
  247. package/dist/src/cli/project/run.js +60 -0
  248. package/dist/src/cli/project/run.js.map +1 -0
  249. package/dist/src/common/cache.d.ts +14 -0
  250. package/dist/src/common/cache.js +99 -0
  251. package/dist/src/common/cache.js.map +1 -0
  252. package/dist/src/common/config.d.ts +58 -0
  253. package/dist/src/common/config.js +159 -0
  254. package/dist/src/common/config.js.map +1 -0
  255. package/dist/src/common/downloader/git.d.ts +8 -0
  256. package/dist/src/common/downloader/git.js +64 -0
  257. package/dist/src/common/downloader/git.js.map +1 -0
  258. package/dist/src/common/downloader/index.d.ts +10 -0
  259. package/dist/src/common/downloader/index.js +50 -0
  260. package/dist/src/common/downloader/index.js.map +1 -0
  261. package/dist/src/common/downloader/local.d.ts +11 -0
  262. package/dist/src/common/downloader/local.js +39 -0
  263. package/dist/src/common/downloader/local.js.map +1 -0
  264. package/dist/src/common/downloader/package.d.ts +6 -0
  265. package/dist/src/common/downloader/package.js +79 -0
  266. package/dist/src/common/downloader/package.js.map +1 -0
  267. package/dist/src/common/manifest.d.ts +45 -0
  268. package/dist/src/common/manifest.js +114 -0
  269. package/dist/src/common/manifest.js.map +1 -0
  270. package/dist/src/index.d.ts +5 -0
  271. package/dist/src/index.js +117 -0
  272. package/dist/src/index.js.map +1 -0
  273. package/dist/src/interfaces/core/1/decorators.d.ts +29 -0
  274. package/dist/src/interfaces/core/1/decorators.js +72 -0
  275. package/dist/src/interfaces/core/1/decorators.js.map +1 -0
  276. package/dist/src/interfaces/core/1/index.d.ts +54 -0
  277. package/dist/src/interfaces/core/1/index.js +237 -0
  278. package/dist/src/interfaces/core/1/index.js.map +1 -0
  279. package/dist/src/interfaces/core/1/modules.d.ts +26 -0
  280. package/dist/src/interfaces/core/1/modules.js +31 -0
  281. package/dist/src/interfaces/core/1/modules.js.map +1 -0
  282. package/dist/src/interfaces/logging/1/index.d.ts +16 -0
  283. package/dist/src/interfaces/logging/1/index.js +49 -0
  284. package/dist/src/interfaces/logging/1/index.js.map +1 -0
  285. package/dist/src/interfaces/logging/1/listener.d.ts +9 -0
  286. package/dist/src/interfaces/logging/1/listener.js +5 -0
  287. package/dist/src/interfaces/logging/1/listener.js.map +1 -0
  288. package/dist/src/loader/index.d.ts +42 -0
  289. package/dist/src/loader/index.js +428 -0
  290. package/dist/src/loader/index.js.map +1 -0
  291. package/dist/src/loader/module.d.ts +29 -0
  292. package/dist/src/loader/module.js +139 -0
  293. package/dist/src/loader/module.js.map +1 -0
  294. package/dist/src/logging/index.d.ts +5 -0
  295. package/dist/src/logging/index.js +118 -0
  296. package/dist/src/logging/index.js.map +1 -0
  297. package/dist/src/utils/cli-ui.d.ts +34 -0
  298. package/dist/src/utils/cli-ui.js +173 -0
  299. package/dist/src/utils/cli-ui.js.map +1 -0
  300. package/dist/src/utils/command.d.ts +3 -0
  301. package/dist/src/utils/command.js +33 -0
  302. package/dist/src/utils/command.js.map +1 -0
  303. package/dist/src/utils/object.d.ts +2 -0
  304. package/dist/src/utils/object.js +26 -0
  305. package/dist/src/utils/object.js.map +1 -0
  306. package/dist/src/utils/promise.d.ts +3 -0
  307. package/dist/src/utils/promise.js +24 -0
  308. package/dist/src/utils/promise.js.map +1 -0
  309. package/dist/utils/antelope-runner.d.ts +1 -0
  310. package/dist/utils/antelope-runner.js +29 -0
  311. package/dist/utils/antelope-runner.js.map +1 -0
  312. package/dist/utils/cli-ui.d.ts +34 -0
  313. package/dist/utils/cli-ui.js +173 -0
  314. package/dist/utils/cli-ui.js.map +1 -0
  315. package/dist/utils/command.d.ts +2 -0
  316. package/dist/utils/command.js +19 -0
  317. package/dist/utils/command.js.map +1 -0
  318. package/dist/utils/logger.d.ts +5 -0
  319. package/dist/utils/logger.js +14 -0
  320. package/dist/utils/logger.js.map +1 -0
  321. package/dist/utils/object.d.ts +2 -0
  322. package/dist/utils/object.js +26 -0
  323. package/dist/utils/object.js.map +1 -0
  324. package/dist/utils/package-manager.d.ts +3 -0
  325. package/dist/utils/package-manager.js +39 -0
  326. package/dist/utils/package-manager.js.map +1 -0
  327. package/dist/utils/promise.d.ts +3 -0
  328. package/dist/utils/promise.js +24 -0
  329. package/dist/utils/promise.js.map +1 -0
  330. package/package.json +77 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["../../../src/common/downloader/package.ts"],"names":[],"mappings":";;;;;AAAA,wBAAiD;AACjD,oCAAuC;AACvC,gDAAwB;AACxB,wDAAwD;AAGxD,gDAAwB;AACxB,iDAAiD;AACjD,iEAAgE;AAChE,0CAAgE;AAChE,SAAS,OAAO,CAAC,IAAY,EAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,IAAA,cAAI,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACtB,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AAQD,IAAA,iBAAc,EAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAkB,EAAE,MAA2B,EAAE,EAAE;IAC7F,cAAO,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,OAAO,IAAI,MAAM,CAA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AAE,CAAC,CAAC,CAAC;YACnF,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC7C,QAAQ,GAAG,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;QAE1D,cAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;QAC1E,MAAM,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE5E,cAAO,CAAC,IAAI,CAAC,+BAA+B,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAChF,MAAM,UAAU,GAAG,MAAM,IAAA,mCAAiB,GAAE,CAAC;QAC7C,MAAM,IAAA,oBAAU,EAAC,UAAU,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IACD,cAAO,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,OAAO,CAAC,IAAI,yBAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { ModuleSource } from './downloader';
2
+ export type ModuleImport = string | {
3
+ name: string;
4
+ git?: string;
5
+ };
6
+ export declare function mapModuleImport(moduleImport: ModuleImport): string;
7
+ export interface ModulePackageJson {
8
+ name: string;
9
+ version: string;
10
+ description?: string;
11
+ author?: string | Array<string>;
12
+ antelopeJs?: {
13
+ imports: ModuleImport[];
14
+ importsOptional: ModuleImport[];
15
+ exports?: string[];
16
+ exportsPath?: string;
17
+ baseUrl?: string;
18
+ paths?: Record<string, string[]>;
19
+ moduleAliases?: Record<string, string>;
20
+ };
21
+ _moduleAliases?: Record<string, string>;
22
+ }
23
+ export declare class ModuleManifest {
24
+ readonly source: ModuleSource;
25
+ readonly name: string;
26
+ version: string;
27
+ readonly folder: string;
28
+ readonly baseUrl: string;
29
+ readonly paths: {
30
+ key: string;
31
+ values: string[];
32
+ }[];
33
+ private manifest;
34
+ exportsPath: string;
35
+ exports: Record<string, string>;
36
+ imports: string[];
37
+ srcAliases?: Array<{
38
+ alias: string;
39
+ replace: string;
40
+ }>;
41
+ private static readManifest;
42
+ constructor(folder: string, source: ModuleSource);
43
+ loadExports(): Promise<void>;
44
+ reload(): Promise<void>;
45
+ }
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ModuleManifest = void 0;
7
+ exports.mapModuleImport = mapModuleImport;
8
+ const path_1 = __importDefault(require("path"));
9
+ const promises_1 = require("fs/promises");
10
+ const beta_1 = require("../interfaces/logging/beta");
11
+ function mapModuleImport(moduleImport) {
12
+ return typeof moduleImport === 'object' ? moduleImport.name : moduleImport;
13
+ }
14
+ class ModuleManifest {
15
+ source;
16
+ name;
17
+ version;
18
+ folder;
19
+ baseUrl;
20
+ paths = [];
21
+ manifest;
22
+ exportsPath;
23
+ exports = {};
24
+ imports = [];
25
+ srcAliases;
26
+ static readManifest(folder) {
27
+ try {
28
+ return require(path_1.default.join(folder, 'package.json'));
29
+ }
30
+ catch {
31
+ beta_1.Logging.Error(`Missing package.json in '${folder}'`);
32
+ return {
33
+ name: folder,
34
+ version: '0.0.0',
35
+ };
36
+ }
37
+ }
38
+ constructor(folder, source) {
39
+ this.source = source;
40
+ this.folder = path_1.default.resolve(folder);
41
+ this.manifest = ModuleManifest.readManifest(this.folder);
42
+ this.name = this.manifest.name;
43
+ this.version = this.manifest.version;
44
+ this.exportsPath = path_1.default.join(this.folder, this.manifest.antelopeJs?.exportsPath || 'interfaces');
45
+ this.imports = this.manifest.antelopeJs?.imports?.map(mapModuleImport) ?? [];
46
+ this.baseUrl = path_1.default.join(this.folder, this.manifest.antelopeJs?.baseUrl ?? '');
47
+ if (this.manifest.antelopeJs?.paths) {
48
+ for (const [key, values] of Object.entries(this.manifest.antelopeJs?.paths)) {
49
+ this.paths.push({
50
+ key: key.replace(/\*$/, ''),
51
+ values: values.map((value) => path_1.default.join(this.baseUrl, value.replace(/\*$/, ''))),
52
+ });
53
+ }
54
+ }
55
+ if (this.manifest._moduleAliases) {
56
+ this.srcAliases = Object.entries(this.manifest._moduleAliases).map(([alias, replace]) => ({
57
+ alias,
58
+ replace: path_1.default.join(this.folder, replace),
59
+ }));
60
+ }
61
+ if (this.manifest.antelopeJs?.moduleAliases) {
62
+ this.srcAliases = [
63
+ ...(this.srcAliases || []),
64
+ ...Object.entries(this.manifest.antelopeJs.moduleAliases).map(([alias, replace]) => ({
65
+ alias,
66
+ replace: path_1.default.join(this.folder, replace),
67
+ })),
68
+ ];
69
+ }
70
+ }
71
+ async loadExports() {
72
+ this.exports = {};
73
+ const addIfFolder = async (name, ifFolder) => {
74
+ for (const version of await (0, promises_1.readdir)(ifFolder)) {
75
+ const versionName = version.match(/^([^.]+)(?:\.js)?$/);
76
+ if (versionName) {
77
+ this.exports[`${name}@${versionName[1]}`] = path_1.default.join(ifFolder, versionName[1]);
78
+ this.imports.push(`${name}@${versionName[1]}`);
79
+ }
80
+ }
81
+ };
82
+ if (this.manifest.antelopeJs?.exports) {
83
+ for (const nameVersion of this.manifest.antelopeJs.exports) {
84
+ const match = nameVersion.match(/^([^@]*)(?:@(.*))?$/);
85
+ if (match) {
86
+ if (match[2]) {
87
+ this.exports[nameVersion] = path_1.default.join(this.exportsPath, match[1], match[2]);
88
+ this.imports.push(nameVersion);
89
+ }
90
+ else {
91
+ await addIfFolder(match[1], path_1.default.join(this.exportsPath, match[1]));
92
+ }
93
+ }
94
+ }
95
+ }
96
+ else if (await (0, promises_1.lstat)(this.exportsPath)
97
+ .then((s) => s.isDirectory())
98
+ .catch(() => false)) {
99
+ for (const name of await (0, promises_1.readdir)(this.exportsPath)) {
100
+ const ifFolder = path_1.default.join(this.exportsPath, name);
101
+ if ((await (0, promises_1.lstat)(ifFolder)).isDirectory()) {
102
+ await addIfFolder(name, ifFolder);
103
+ }
104
+ }
105
+ }
106
+ }
107
+ async reload() {
108
+ this.manifest = ModuleManifest.readManifest(this.folder);
109
+ this.version = this.manifest.version;
110
+ this.exportsPath = path_1.default.join(this.folder, this.manifest.antelopeJs?.exportsPath || 'interfaces');
111
+ this.imports = this.manifest.antelopeJs?.imports.map(mapModuleImport) ?? [];
112
+ await this.loadExports();
113
+ }
114
+ }
115
+ exports.ModuleManifest = ModuleManifest;
116
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/common/manifest.ts"],"names":[],"mappings":";;;;;;AAOA,0CAEC;AATD,gDAAwB;AAExB,0CAA6C;AAC7C,qDAAqD;AAIrD,SAAgB,eAAe,CAAC,YAA0B;IACxD,OAAO,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;AAC7E,CAAC;AA2BD,MAAa,cAAc;IAiCP;IAhCF,IAAI,CAAS;IACtB,OAAO,CAAS;IACP,MAAM,CAAS;IAEf,OAAO,CAAS;IAChB,KAAK,GAGf,EAAE,CAAC;IAED,QAAQ,CAAoB;IAC7B,WAAW,CAAS;IAEpB,OAAO,GAA2B,EAAE,CAAC;IACrC,OAAO,GAAa,EAAE,CAAC;IAEvB,UAAU,CAA6C;IAEtD,MAAM,CAAC,YAAY,CAAC,MAAc;QACxC,IAAI,CAAC;YACH,OAAO,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CA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M,IACL,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,WAAW,CAAC;aAC1B,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;aAC5B,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EACrB,CAAC;YACD,KAAK,MAAM,IAAI,IAAI,MAAM,IAAA,kBAAO,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBACnD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBACnD,IAAI,CAAC,MAAM,IAAA,gBAAK,EAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;oBAC1C,MAAM,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,IAAI,YAAY,CAAC,CAAC;QACjG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAC5E,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AAjHD,wCAiHC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ import eslint from '@eslint/js';
3
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4
+ import eslintPluginImport from 'eslint-plugin-import';
5
+ import globals from 'globals';
6
+ import tseslint from 'typescript-eslint';
7
+ export default tseslint.config({
8
+ ignores: [
9
+ 'node_modules',
10
+ 'tmp',
11
+ 'dist',
12
+ 'antelope_cache',
13
+ 'coverage',
14
+ '.git',
15
+ '*.log',
16
+ '**/*.min.js',
17
+ 'pnpm-lock.yaml',
18
+ '.antelope',
19
+ ],
20
+ }, eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, eslintPluginPrettierRecommended, eslintPluginImport.flatConfigs.recommended, eslintPluginImport.flatConfigs.typescript, {
21
+ languageOptions: {
22
+ globals: {
23
+ ...globals.node,
24
+ ...globals.jest,
25
+ },
26
+ ecmaVersion: 12,
27
+ sourceType: 'module',
28
+ parserOptions: {
29
+ project: ['tsconfig.json'],
30
+ projectService: true,
31
+ tsconfigRootDir: import.meta.dirname,
32
+ },
33
+ },
34
+ }, {
35
+ rules: {
36
+ 'no-console': 'warn',
37
+ 'no-unused-vars': 'off',
38
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
39
+ '@typescript-eslint/explicit-function-return-type': 'off',
40
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
41
+ '@typescript-eslint/no-explicit-any': 'warn',
42
+ '@typescript-eslint/no-floating-promises': 'error',
43
+ '@typescript-eslint/no-misused-promises': 'error',
44
+ '@typescript-eslint/no-throw-literal': 'off',
45
+ '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
46
+ '@typescript-eslint/no-unsafe-assignment': 'warn',
47
+ '@typescript-eslint/restrict-template-expressions': 'warn',
48
+ 'import/prefer-default-export': 'off',
49
+ 'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts', '**/*.spec.ts'] }],
50
+ 'import/extensions': [
51
+ 'error',
52
+ 'ignorePackages',
53
+ {
54
+ js: 'never',
55
+ jsx: 'never',
56
+ ts: 'never',
57
+ tsx: 'never',
58
+ },
59
+ ],
60
+ 'max-len': ['warn', { code: 120 }],
61
+ quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
62
+ 'import/no-unresolved': ['error', { ignore: ['^@ajs(/.*)?$', '^@ajs\\.local(/.*)?$'] }],
63
+ '@typescript-eslint/no-explicit-any': 'off',
64
+ '@typescript-eslint/no-unsafe-return': 'off',
65
+ '@typescript-eslint/no-unsafe-member-access': 'off',
66
+ '@typescript-eslint/no-unsafe-argument': 'off',
67
+ '@typescript-eslint/no-unsafe-call': 'off',
68
+ '@typescript-eslint/require-await': 'off',
69
+ '@typescript-eslint/no-implied-eval': 'off',
70
+ '@typescript-eslint/no-floating-promises': 'off',
71
+ '@typescript-eslint/no-misused-promises': 'off',
72
+ '@typescript-eslint/no-unsafe-assignment': 'off',
73
+ '@typescript-eslint/no-require-imports': 'off',
74
+ '@typescript-eslint/prefer-promise-reject-errors': 'off',
75
+ '@typescript-eslint/no-namespace': 'off',
76
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
77
+ 'no-useless-escape': 'off',
78
+ '@typescript-eslint/no-unused-vars': 'off',
79
+ '@typescript-eslint/no-empty-object-type': 'off',
80
+ '@typescript-eslint/await-thenable': 'off',
81
+ 'prefer-const': 'off',
82
+ '@typescript-eslint/ban-ts-comment': 'off',
83
+ },
84
+ });
85
+ //# sourceMappingURL=eslint.config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.mjs","sourceRoot":"","sources":["../eslint.config.mjs"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,+BAA+B,MAAM,oCAAoC,CAAC;AACjF,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,eAAe,QAAQ,CAAC,MAAM,CAC5B;IACE,OAAO,EAAE;QACP,cAAc;QACd,KAAK;QACL,MAAM;Q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BACX,GAAG,EAAE,OAAO;aACb;SACF;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAClC,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC;QAC/E,sBAAsB,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,cAAc,EAAE,sBAAsB,CAAC,EAAE,CAAC;QAGvF,oCAAoC,EAAE,KAAK;QAC3C,qCAAqC,EAAE,KAAK;QAC5C,4CAA4C,EAAE,KAAK;QACnD,uCAAuC,EAAE,KAAK;QAC9C,mCAAmC,EAAE,KAAK;QAC1C,kCAAkC,EAAE,KAAK;QACzC,oCAAoC,EAAE,KAAK;QAC3C,yCAAyC,EAAE,KAAK;QAChD,wCAAwC,EAAE,KAAK;QAC/C,yCAAyC,EAAE,KAAK;QAChD,uCAAuC,EAAE,KAAK;QAC9C,iDAAiD,EAAE,KAAK;QACxD,iCAAiC,EAAE,KAAK;QACxC,mDAAmD,EAAE,KAAK;QAC1D,mBAAmB,EAAE,KAAK;QAC1B,mCAAmC,EAAE,KAAK;QAC1C,yCAAyC,EAAE,KAAK;QAChD,mCAAmC,EAAE,KAAK;QAC1C,cAAc,EAAE,KAAK;QACrB,mCAAmC,EAAE,KAAK;KAC3C;CACF,CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface LaunchOptions {
2
+ watch?: boolean;
3
+ concurrency?: number;
4
+ }
5
+ export declare function TestModule(moduleFolder?: string): Promise<void>;
6
+ export default function (projectFolder?: string, env?: string, options?: LaunchOptions): Promise<void>;
package/dist/index.js ADDED
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TestModule = TestModule;
7
+ exports.default = default_1;
8
+ const config_1 = require("./common/config");
9
+ const loader_1 = require("./loader");
10
+ const async_exit_hook_1 = __importDefault(require("async-exit-hook"));
11
+ const path_1 = __importDefault(require("path"));
12
+ const logging_1 = __importDefault(require("./logging"));
13
+ const beta_1 = require("./interfaces/logging/beta");
14
+ const assert_1 = __importDefault(require("assert"));
15
+ const mocha_1 = __importDefault(require("mocha"));
16
+ const promises_1 = require("fs/promises");
17
+ const stream_1 = require("stream");
18
+ stream_1.Writable.prototype.setMaxListeners(20);
19
+ async function ConvertConfig(config) {
20
+ return {
21
+ sources: Object.entries(config.modules)
22
+ .filter(([, module]) => 'source' in module)
23
+ .map(([id, module]) => ({ id, ...module.source })),
24
+ configs: Object.entries(config.modules).reduce((configs, [name, module]) => {
25
+ configs[name] = {
26
+ config: module.config,
27
+ importOverrides: (module.importOverrides ?? []).reduce((prev, override) => {
28
+ if (!prev.has(override.interface)) {
29
+ prev.set(override.interface, []);
30
+ }
31
+ prev.get(override.interface).push({
32
+ module: override.source,
33
+ id: override.id,
34
+ });
35
+ return prev;
36
+ }, new Map()),
37
+ disabledExports: new Set(module.disabledExports),
38
+ };
39
+ return configs;
40
+ }, {}),
41
+ };
42
+ }
43
+ async function addTestFolder(mocha, folder, matcher) {
44
+ const files = await (0, promises_1.readdir)(folder);
45
+ for (const file of files) {
46
+ const filePath = path_1.default.join(folder, file);
47
+ if ((await (0, promises_1.stat)(filePath)).isDirectory()) {
48
+ await addTestFolder(mocha, filePath, matcher);
49
+ }
50
+ else if (matcher.test(filePath)) {
51
+ console.log('adding test file', filePath);
52
+ mocha.addFile(filePath);
53
+ }
54
+ }
55
+ }
56
+ async function TestModule(moduleFolder = '.') {
57
+ const moduleRoot = path_1.default.resolve(moduleFolder);
58
+ const pack = require(path_1.default.join(moduleRoot, 'package.json'));
59
+ (0, assert_1.default)(pack, 'Missing package.json');
60
+ const testConfig = pack.antelopeJs?.test;
61
+ if (!testConfig) {
62
+ console.error('Missing AntelopeJS test config');
63
+ return;
64
+ }
65
+ const testProject = path_1.default.join(moduleRoot, testConfig.project);
66
+ const config = require(testProject);
67
+ (0, logging_1.default)(config);
68
+ const moduleManager = new loader_1.ModuleManager(moduleRoot, path_1.default.resolve(path_1.default.join(__dirname, '..')), config.cacheFolder);
69
+ const legacyModuleList = await ConvertConfig(config);
70
+ try {
71
+ await moduleManager.init(legacyModuleList);
72
+ }
73
+ catch (err) {
74
+ beta_1.Logging.Error('Error during module manager initialization', err);
75
+ console.error(err);
76
+ return;
77
+ }
78
+ moduleManager.startModules();
79
+ const testFolder = path_1.default.join(moduleRoot, testConfig.folder);
80
+ const mocha = new mocha_1.default();
81
+ await addTestFolder(mocha, testFolder, /\.js$/);
82
+ await new Promise((resolve) => mocha.run().on('end', resolve));
83
+ try {
84
+ await moduleManager.shutdown();
85
+ }
86
+ catch (err) {
87
+ beta_1.Logging.Error('Error during shutdown', err);
88
+ }
89
+ }
90
+ async function default_1(projectFolder = '.', env = 'default', options = {}) {
91
+ const config = await (0, config_1.LoadConfig)(projectFolder, env);
92
+ (0, logging_1.default)(config);
93
+ const moduleManager = new loader_1.ModuleManager(path_1.default.resolve(projectFolder), path_1.default.resolve(path_1.default.join(__dirname, '..')), path_1.default.join(projectFolder, config.cacheFolder), options.concurrency);
94
+ const legacyModuleList = await ConvertConfig(config);
95
+ try {
96
+ await moduleManager.init(legacyModuleList);
97
+ }
98
+ catch (err) {
99
+ beta_1.Logging.Error('Error during module manager initialization', err);
100
+ process.exit(1);
101
+ }
102
+ if (options.watch) {
103
+ await moduleManager.startWatcher().catch(beta_1.Logging.Error);
104
+ }
105
+ moduleManager.startModules();
106
+ (0, async_exit_hook_1.default)(async (callback) => {
107
+ try {
108
+ await moduleManager.shutdown();
109
+ }
110
+ catch (err) {
111
+ beta_1.Logging.Error('Error during shutdown', err);
112
+ }
113
+ finally {
114
+ callback();
115
+ }
116
+ });
117
+ }
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,cAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;gBAAS,CAAC;YACT,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,29 @@
1
+ export type Func<A extends any[] = any[], R = any> = (...args: A) => R;
2
+ export type Class<T = any, A extends any[] = any[]> = {
3
+ new (...args: A): T;
4
+ };
5
+ export type ClassDecorator<C = Class> = (t: C) => any;
6
+ export type PropertyDecorator = (t: any, key: PropertyKey) => void;
7
+ export type MethodDecorator = (t: any, key: PropertyKey, descriptor: PropertyDescriptor) => void;
8
+ export type ParameterDecorator = (t: any, key: PropertyKey, index: number) => void;
9
+ type MergeArray<A extends any[], B extends any[]> = A extends [infer P, ...infer PR] ? B extends [infer Q, ...infer QR] ? [P | Q, ...MergeArray<PR, QR>] : [P | undefined, ...MergeArray<PR, []>] : B extends [infer Q, ...infer QR] ? [Q | undefined, ...MergeArray<[], QR>] : [];
10
+ type UnwrapFunctions<T extends Func[]> = T extends [infer F] ? Parameters<F extends Func ? F : never> : T extends [infer F1, ...infer F2] ? MergeArray<Parameters<F1 extends Func ? F1 : never>, UnwrapFunctions<F2 extends Func[] ? F2 : never>> : [];
11
+ type Function1<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], ...args: A) => R;
12
+ type Function2<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], a2: AR[1], ...args: A) => R;
13
+ type Function3<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], a2: AR[1], a3: AR[2], ...args: A) => R;
14
+ export declare function MakeClassDecorator<T extends any[]>(handler: Function1<[ClassDecorator], T, any>): (...args: T) => ClassDecorator<Class<any, any[]>>;
15
+ export declare function MakePropertyDecorator<T extends any[]>(handler: Function2<[PropertyDecorator], T, void>): (...args: T) => PropertyDecorator;
16
+ export declare function MakePropertyAndClassDecorator<T extends any[]>(handler: Function2<[PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator;
17
+ export declare function MakeMethodDecorator<T extends any[]>(handler: Function3<[MethodDecorator], T, void>): (...args: T) => MethodDecorator;
18
+ export declare function MakeMethodAndClassDecorator<T extends any[]>(handler: Function3<[MethodDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & MethodDecorator;
19
+ export declare function MakeMethodAndPropertyDecorator<T extends any[]>(handler: Function3<[MethodDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & MethodDecorator;
20
+ export declare function MakeMethodAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[MethodDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & MethodDecorator;
21
+ export declare function MakeParameterDecorator<T extends any[]>(handler: Function3<[ParameterDecorator], T, void>): (...args: T) => ParameterDecorator;
22
+ export declare function MakeParameterAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & ParameterDecorator;
23
+ export declare function MakeParameterAndPropertyDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & ParameterDecorator;
24
+ export declare function MakeParameterAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & ParameterDecorator;
25
+ export declare function MakeParameterAndMethodDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator], T, void>): (...args: T) => MethodDecorator & ParameterDecorator;
26
+ export declare function MakeParameterAndMethodAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & MethodDecorator & ParameterDecorator;
27
+ export declare function MakeParameterAndMethodAndPropertyDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & MethodDecorator & ParameterDecorator;
28
+ export declare function MakeParameterAndMethodAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & MethodDecorator & ParameterDecorator;
29
+ export {};
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MakeClassDecorator = MakeClassDecorator;
4
+ exports.MakePropertyDecorator = MakePropertyDecorator;
5
+ exports.MakePropertyAndClassDecorator = MakePropertyAndClassDecorator;
6
+ exports.MakeMethodDecorator = MakeMethodDecorator;
7
+ exports.MakeMethodAndClassDecorator = MakeMethodAndClassDecorator;
8
+ exports.MakeMethodAndPropertyDecorator = MakeMethodAndPropertyDecorator;
9
+ exports.MakeMethodAndPropertyAndClassDecorator = MakeMethodAndPropertyAndClassDecorator;
10
+ exports.MakeParameterDecorator = MakeParameterDecorator;
11
+ exports.MakeParameterAndClassDecorator = MakeParameterAndClassDecorator;
12
+ exports.MakeParameterAndPropertyDecorator = MakeParameterAndPropertyDecorator;
13
+ exports.MakeParameterAndPropertyAndClassDecorator = MakeParameterAndPropertyAndClassDecorator;
14
+ exports.MakeParameterAndMethodDecorator = MakeParameterAndMethodDecorator;
15
+ exports.MakeParameterAndMethodAndClassDecorator = MakeParameterAndMethodAndClassDecorator;
16
+ exports.MakeParameterAndMethodAndPropertyDecorator = MakeParameterAndMethodAndPropertyDecorator;
17
+ exports.MakeParameterAndMethodAndPropertyAndClassDecorator = MakeParameterAndMethodAndPropertyAndClassDecorator;
18
+ function Decorator1(handler) {
19
+ return (...args) => (a) => handler(a, ...args);
20
+ }
21
+ function Decorator2(handler) {
22
+ return (...args) => (a, b) => handler(a, b, ...args);
23
+ }
24
+ function Decorator3(handler) {
25
+ return (...args) => (a, b, c) => handler(a, b, c, ...args);
26
+ }
27
+ function MakeClassDecorator(handler) {
28
+ return Decorator1(handler);
29
+ }
30
+ function MakePropertyDecorator(handler) {
31
+ return Decorator2(handler);
32
+ }
33
+ function MakePropertyAndClassDecorator(handler) {
34
+ return Decorator2(handler);
35
+ }
36
+ function MakeMethodDecorator(handler) {
37
+ return Decorator3(handler);
38
+ }
39
+ function MakeMethodAndClassDecorator(handler) {
40
+ return Decorator3(handler);
41
+ }
42
+ function MakeMethodAndPropertyDecorator(handler) {
43
+ return Decorator3(handler);
44
+ }
45
+ function MakeMethodAndPropertyAndClassDecorator(handler) {
46
+ return Decorator3(handler);
47
+ }
48
+ function MakeParameterDecorator(handler) {
49
+ return Decorator3(handler);
50
+ }
51
+ function MakeParameterAndClassDecorator(handler) {
52
+ return Decorator3(handler);
53
+ }
54
+ function MakeParameterAndPropertyDecorator(handler) {
55
+ return Decorator3(handler);
56
+ }
57
+ function MakeParameterAndPropertyAndClassDecorator(handler) {
58
+ return Decorator3(handler);
59
+ }
60
+ function MakeParameterAndMethodDecorator(handler) {
61
+ return Decorator3(handler);
62
+ }
63
+ function MakeParameterAndMethodAndClassDecorator(handler) {
64
+ return Decorator3(handler);
65
+ }
66
+ function MakeParameterAndMethodAndPropertyDecorator(handler) {
67
+ return Decorator3(handler);
68
+ }
69
+ function MakeParameterAndMethodAndPropertyAndClassDecorator(handler) {
70
+ return Decorator3(handler);
71
+ }
72
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/interfaces/core/1/decorators.ts"],"names":[],"mappings":";;AAyGA,gDAEC;AAYD,sDAEC;AAaD,sEAIC;AAUD,kDAEC;AAUD,kEAIC;AAUD,wEAIC;AAUD,wFAIC;AAU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C5E,CAAC;AAUD,SAAgB,sCAAsC,CACpD,OAA4F;IAE5F,OAAO,UAAU,CAA2E,OAAO,CAAC,CAAC;AACvG,CAAC;AAUD,SAAgB,sBAAsB,CAAkB,OAAiD;IACvG,OAAO,UAAU,CAAgC,OAAO,CAAC,CAAC;AAC5D,CAAC;AAUD,SAAgB,8BAA8B,CAC5C,OAA4E;IAE5E,OAAO,UAAU,CAA2D,OAAO,CAAC,CAAC;AACvF,CAAC;AAUD,SAAgB,iCAAiC,CAC/C,OAAoE;IAEpE,OAAO,UAAU,CAAmD,OAAO,CAAC,CAAC;AAC/E,CAAC;AAUD,SAAgB,yCAAyC,CACvD,OAA+F;IAE/F,OAAO,UAAU,CAA8E,OAAO,CAAC,CAAC;AAC1G,CAAC;AAUD,SAAgB,+BAA+B,CAC7C,OAAkE;IAElE,OAAO,UAAU,CAAiD,OAAO,CAAC,CAAC;AAC7E,CAAC;AAUD,SAAgB,uCAAuC,CACrD,OAA6F;IAE7F,OAAO,UAAU,CAA4E,OAAO,CAAC,CAAC;AACxG,CAAC;AAUD,SAAgB,0CAA0C,CACxD,OAAqF;IAErF,OAAO,UAAU,CAAoE,OAAO,CAAC,CAAC;AAChG,CAAC;AAUD,SAAgB,kDAAkD,CAChE,OAAgH;IAEhH,OAAO,UAAU,CACf,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ import 'reflect-metadata';
2
+ import { Class } from './decorators';
3
+ interface InterfaceConnection {
4
+ id?: string;
5
+ path: string;
6
+ }
7
+ type Func<A extends any[] = any[], R = any> = (...args: A) => R;
8
+ export declare class AsyncProxy<T extends Func = Func, R = Awaited<ReturnType<T>>> {
9
+ private callback?;
10
+ private queue;
11
+ onCall(callback: T, manualDetach?: boolean): void;
12
+ detach(): void;
13
+ call(...args: Parameters<T>): Promise<R>;
14
+ }
15
+ type RegisterFunction = (id: any, ...args: any[]) => void;
16
+ type RID<T> = T extends (id: infer P, ...args: any[]) => void ? P : never;
17
+ type RArgs<T> = T extends (id: any, ...args: infer P) => void ? P : never;
18
+ export declare class RegisteringProxy<T extends RegisterFunction = RegisterFunction> {
19
+ private registerCallback?;
20
+ private unregisterCallback?;
21
+ private registered;
22
+ onRegister(callback: T, manualDetach?: boolean): void;
23
+ onUnregister(callback: (id: RID<T>) => void): void;
24
+ detach(): void;
25
+ register(id: RID<T>, ...args: RArgs<T>): void;
26
+ unregister(id: RID<T>): void;
27
+ }
28
+ type EventFunction = (...args: any[]) => void;
29
+ export declare class EventProxy<T extends EventFunction = EventFunction> {
30
+ private registered;
31
+ constructor();
32
+ emit(...args: Parameters<T>): void;
33
+ register(func: T): void;
34
+ unregister(fn: T): void;
35
+ }
36
+ export declare function GetResponsibleModule(ignoreInterfaces?: boolean, startFrame?: number): string | undefined;
37
+ export declare function GetMetadata<T extends Record<string, any>, U extends Record<string, any>>(target: U, meta: Class<T, [U]> & {
38
+ key: symbol;
39
+ }, inherit?: boolean): T;
40
+ export declare function InterfaceFunction<T extends Func = Func, R = Awaited<ReturnType<T>>>(): (...args: Parameters<T>) => Promise<R>;
41
+ type InterfaceImplType<T> = T extends RegisteringProxy<infer P> ? {
42
+ register: P;
43
+ unregister: (id: RID<P>) => void;
44
+ } : T extends EventProxy ? never : T extends (...args: any[]) => any ? T : T extends Record<string, any> ? InterfaceToImpl<T> : never;
45
+ type InterfaceToImpl<T> = T extends infer P ? {
46
+ [K in keyof P]?: InterfaceImplType<P[K]>;
47
+ } : never;
48
+ export declare function ImplementInterface<T, T2 = InterfaceToImpl<Awaited<T>>>(declaration: T, implementation: T2 | Promise<T2>): Promise<{
49
+ declaration: Awaited<T>;
50
+ implementation: T2;
51
+ }>;
52
+ export declare function GetInterfaceInstances(interfaceID: string): InterfaceConnection[];
53
+ export declare function GetInterfaceInstance(interfaceID: string, connectionID: string): InterfaceConnection | undefined;
54
+ export {};