jimpex 10.0.1 → 11.0.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 (346) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +7 -9
  3. package/dist/app/index.d.ts +1 -1
  4. package/dist/app/index.js +1 -22
  5. package/dist/app/index.js.map +1 -1
  6. package/dist/app/jimpex.d.ts +1 -1
  7. package/dist/app/jimpex.js +104 -145
  8. package/dist/app/jimpex.js.map +1 -1
  9. package/dist/controllers/common/config.d.ts +2 -2
  10. package/dist/controllers/common/config.js +12 -42
  11. package/dist/controllers/common/config.js.map +1 -1
  12. package/dist/controllers/common/health.d.ts +4 -4
  13. package/dist/controllers/common/health.js +20 -50
  14. package/dist/controllers/common/health.js.map +1 -1
  15. package/dist/controllers/common/index.d.ts +1 -1
  16. package/dist/controllers/common/index.js +3 -26
  17. package/dist/controllers/common/index.js.map +1 -1
  18. package/dist/controllers/common/statics.d.ts +3 -3
  19. package/dist/controllers/common/statics.js +32 -68
  20. package/dist/controllers/common/statics.js.map +1 -1
  21. package/dist/controllers/index.d.ts +1 -1
  22. package/dist/controllers/index.js +2 -24
  23. package/dist/controllers/index.js.map +1 -1
  24. package/dist/controllers/utils/gateway.d.ts +5 -5
  25. package/dist/controllers/utils/gateway.js +70 -94
  26. package/dist/controllers/utils/gateway.js.map +1 -1
  27. package/dist/controllers/utils/index.d.ts +1 -1
  28. package/dist/controllers/utils/index.js +1 -22
  29. package/dist/controllers/utils/index.js.map +1 -1
  30. package/dist/{index-C6I3NCC-.d.ts → index-BlSpNHox.d.ts} +13 -13
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.js +6 -32
  33. package/dist/index.js.map +1 -1
  34. package/dist/middlewares/common/errorHandler.d.ts +5 -5
  35. package/dist/middlewares/common/errorHandler.js +31 -59
  36. package/dist/middlewares/common/errorHandler.js.map +1 -1
  37. package/dist/middlewares/common/forceHTTPS.d.ts +1 -1
  38. package/dist/middlewares/common/forceHTTPS.js +9 -40
  39. package/dist/middlewares/common/forceHTTPS.js.map +1 -1
  40. package/dist/middlewares/common/hsts.d.ts +1 -1
  41. package/dist/middlewares/common/hsts.js +12 -42
  42. package/dist/middlewares/common/hsts.js.map +1 -1
  43. package/dist/middlewares/common/index.d.ts +3 -3
  44. package/dist/middlewares/common/index.js +3 -26
  45. package/dist/middlewares/common/index.js.map +1 -1
  46. package/dist/middlewares/html/fastHTML.d.ts +4 -4
  47. package/dist/middlewares/html/fastHTML.js +44 -71
  48. package/dist/middlewares/html/fastHTML.js.map +1 -1
  49. package/dist/middlewares/html/index.d.ts +2 -2
  50. package/dist/middlewares/html/index.js +2 -24
  51. package/dist/middlewares/html/index.js.map +1 -1
  52. package/dist/middlewares/html/showHTML.d.ts +3 -3
  53. package/dist/middlewares/html/showHTML.js +25 -55
  54. package/dist/middlewares/html/showHTML.js.map +1 -1
  55. package/dist/middlewares/index.d.ts +4 -4
  56. package/dist/middlewares/index.js +3 -26
  57. package/dist/middlewares/index.js.map +1 -1
  58. package/dist/middlewares/utils/index.d.ts +3 -3
  59. package/dist/middlewares/utils/index.js +1 -22
  60. package/dist/middlewares/utils/index.js.map +1 -1
  61. package/dist/middlewares/utils/versionValidator.d.ts +5 -5
  62. package/dist/middlewares/utils/versionValidator.js +24 -54
  63. package/dist/middlewares/utils/versionValidator.js.map +1 -1
  64. package/dist/services/common/appError.d.ts +2 -2
  65. package/dist/services/common/appError.js +18 -49
  66. package/dist/services/common/appError.js.map +1 -1
  67. package/dist/services/common/httpError.d.ts +2 -2
  68. package/dist/services/common/httpError.js +7 -33
  69. package/dist/services/common/httpError.js.map +1 -1
  70. package/dist/services/common/index.d.ts +1 -1
  71. package/dist/services/common/index.js +14 -42
  72. package/dist/services/common/index.js.map +1 -1
  73. package/dist/services/common/sendFile.d.ts +1 -1
  74. package/dist/services/common/sendFile.js +4 -29
  75. package/dist/services/common/sendFile.js.map +1 -1
  76. package/dist/services/frontend/frontendFs.d.ts +2 -2
  77. package/dist/services/frontend/frontendFs.js +12 -52
  78. package/dist/services/frontend/frontendFs.js.map +1 -1
  79. package/dist/services/frontend/index.d.ts +2 -2
  80. package/dist/services/frontend/index.js +8 -34
  81. package/dist/services/frontend/index.js.map +1 -1
  82. package/dist/services/html/htmlGenerator.d.ts +5 -5
  83. package/dist/services/html/htmlGenerator.js +48 -82
  84. package/dist/services/html/htmlGenerator.js.map +1 -1
  85. package/dist/services/html/index.d.ts +2 -2
  86. package/dist/services/html/index.js +8 -34
  87. package/dist/services/html/index.js.map +1 -1
  88. package/dist/services/http/apiClient.d.ts +1 -1
  89. package/dist/services/http/apiClient.js +26 -57
  90. package/dist/services/http/apiClient.js.map +1 -1
  91. package/dist/services/http/http.d.ts +5 -5
  92. package/dist/services/http/http.js +23 -63
  93. package/dist/services/http/http.js.map +1 -1
  94. package/dist/services/http/index.d.ts +2 -2
  95. package/dist/services/http/index.js +14 -42
  96. package/dist/services/http/index.js.map +1 -1
  97. package/dist/services/http/responsesBuilder.d.ts +4 -4
  98. package/dist/services/http/responsesBuilder.js +14 -44
  99. package/dist/services/http/responsesBuilder.js.map +1 -1
  100. package/dist/services/index.d.ts +3 -3
  101. package/dist/services/index.js +5 -30
  102. package/dist/services/index.js.map +1 -1
  103. package/dist/services/utils/ensureBearerToken.d.ts +2 -2
  104. package/dist/services/utils/ensureBearerToken.js +15 -45
  105. package/dist/services/utils/ensureBearerToken.js.map +1 -1
  106. package/dist/services/utils/index.d.ts +1 -1
  107. package/dist/services/utils/index.js +8 -34
  108. package/dist/services/utils/index.js.map +1 -1
  109. package/dist/types/events.d.ts +1 -1
  110. package/dist/types/events.js +0 -16
  111. package/dist/types/events.js.map +1 -1
  112. package/dist/types/express.js +0 -16
  113. package/dist/types/express.js.map +1 -1
  114. package/dist/types/http.js +0 -16
  115. package/dist/types/http.js.map +1 -1
  116. package/dist/types/index.d.ts +1 -1
  117. package/dist/types/index.js +6 -32
  118. package/dist/types/index.js.map +1 -1
  119. package/dist/types/options.d.ts +1 -1
  120. package/dist/types/options.js +0 -16
  121. package/dist/types/options.js.map +1 -1
  122. package/dist/types/utils.js +0 -16
  123. package/dist/types/utils.js.map +1 -1
  124. package/dist/types/wootils.js +0 -16
  125. package/dist/types/wootils.js.map +1 -1
  126. package/dist/utils/fns/index.js +4 -28
  127. package/dist/utils/fns/index.js.map +1 -1
  128. package/dist/utils/fns/others.js +2 -26
  129. package/dist/utils/fns/others.js.map +1 -1
  130. package/dist/utils/fns/routes.js +4 -31
  131. package/dist/utils/fns/routes.js.map +1 -1
  132. package/dist/utils/fns/statuses.js +3 -37
  133. package/dist/utils/fns/statuses.js.map +1 -1
  134. package/dist/utils/fns/text.js +2 -26
  135. package/dist/utils/fns/text.js.map +1 -1
  136. package/dist/utils/index.d.ts +1 -1
  137. package/dist/utils/index.js +2 -24
  138. package/dist/utils/index.js.map +1 -1
  139. package/dist/utils/wrappers.d.ts +1 -1
  140. package/dist/utils/wrappers.js +20 -48
  141. package/dist/utils/wrappers.js.map +1 -1
  142. package/eslint.config.js +19 -0
  143. package/examples/basic/app.ts +4 -4
  144. package/examples/basic/controller.ts +2 -2
  145. package/examples/basic/index.ts +4 -4
  146. package/examples/basic/middleware.ts +2 -2
  147. package/examples/basic/service.ts +1 -1
  148. package/package.json +64 -49
  149. package/pnpm-workspace.yaml +4 -0
  150. package/src/app/index.ts +1 -1
  151. package/src/app/jimpex.ts +23 -20
  152. package/src/controllers/common/config.ts +4 -4
  153. package/src/controllers/common/health.ts +9 -5
  154. package/src/controllers/common/index.ts +3 -3
  155. package/src/controllers/common/statics.ts +12 -7
  156. package/src/controllers/index.ts +2 -2
  157. package/src/controllers/utils/gateway.ts +8 -8
  158. package/src/controllers/utils/index.ts +1 -1
  159. package/src/index.ts +6 -6
  160. package/src/middlewares/common/errorHandler.ts +9 -5
  161. package/src/middlewares/common/forceHTTPS.ts +2 -2
  162. package/src/middlewares/common/hsts.ts +2 -2
  163. package/src/middlewares/common/index.ts +3 -3
  164. package/src/middlewares/html/fastHTML.ts +14 -5
  165. package/src/middlewares/html/index.ts +2 -2
  166. package/src/middlewares/html/showHTML.ts +8 -4
  167. package/src/middlewares/index.ts +3 -3
  168. package/src/middlewares/utils/index.ts +1 -1
  169. package/src/middlewares/utils/versionValidator.ts +6 -6
  170. package/src/services/common/appError.ts +1 -1
  171. package/src/services/common/httpError.ts +2 -2
  172. package/src/services/common/index.ts +7 -7
  173. package/src/services/common/sendFile.ts +2 -2
  174. package/src/services/frontend/frontendFs.ts +3 -3
  175. package/src/services/frontend/index.ts +3 -3
  176. package/src/services/html/htmlGenerator.ts +11 -13
  177. package/src/services/html/index.ts +3 -3
  178. package/src/services/http/apiClient.ts +3 -3
  179. package/src/services/http/http.ts +5 -5
  180. package/src/services/http/index.ts +7 -7
  181. package/src/services/http/responsesBuilder.ts +6 -6
  182. package/src/services/index.ts +5 -5
  183. package/src/services/utils/ensureBearerToken.ts +4 -4
  184. package/src/services/utils/index.ts +3 -3
  185. package/src/types/events.ts +8 -8
  186. package/src/types/http.ts +1 -1
  187. package/src/types/index.ts +6 -6
  188. package/src/types/options.ts +2 -2
  189. package/src/types/utils.ts +4 -4
  190. package/src/utils/fns/index.ts +4 -4
  191. package/src/utils/fns/routes.ts +1 -1
  192. package/src/utils/index.ts +2 -2
  193. package/src/utils/wrappers.ts +6 -6
  194. package/tsconfig.json +9 -4
  195. package/tsup.config.ts +1 -2
  196. package/vitest.config.ts +24 -0
  197. package/dist/app/index.d.mts +0 -14
  198. package/dist/app/jimpex.d.mts +0 -14
  199. package/dist/controllers/common/config.d.mts +0 -79
  200. package/dist/controllers/common/health.d.mts +0 -83
  201. package/dist/controllers/common/index.d.mts +0 -22
  202. package/dist/controllers/common/statics.d.mts +0 -223
  203. package/dist/controllers/index.d.mts +0 -25
  204. package/dist/controllers/utils/gateway.d.mts +0 -725
  205. package/dist/controllers/utils/index.d.mts +0 -17
  206. package/dist/esm/app/index.js +0 -2
  207. package/dist/esm/app/index.js.map +0 -1
  208. package/dist/esm/app/jimpex.js +0 -647
  209. package/dist/esm/app/jimpex.js.map +0 -1
  210. package/dist/esm/chunk-F3FYYIAV.js +0 -11
  211. package/dist/esm/chunk-F3FYYIAV.js.map +0 -1
  212. package/dist/esm/controllers/common/config.js +0 -80
  213. package/dist/esm/controllers/common/config.js.map +0 -1
  214. package/dist/esm/controllers/common/health.js +0 -88
  215. package/dist/esm/controllers/common/health.js.map +0 -1
  216. package/dist/esm/controllers/common/index.js +0 -4
  217. package/dist/esm/controllers/common/index.js.map +0 -1
  218. package/dist/esm/controllers/common/statics.js +0 -226
  219. package/dist/esm/controllers/common/statics.js.map +0 -1
  220. package/dist/esm/controllers/index.js +0 -3
  221. package/dist/esm/controllers/index.js.map +0 -1
  222. package/dist/esm/controllers/utils/gateway.js +0 -559
  223. package/dist/esm/controllers/utils/gateway.js.map +0 -1
  224. package/dist/esm/controllers/utils/index.js +0 -2
  225. package/dist/esm/controllers/utils/index.js.map +0 -1
  226. package/dist/esm/index.js +0 -7
  227. package/dist/esm/index.js.map +0 -1
  228. package/dist/esm/middlewares/common/errorHandler.js +0 -116
  229. package/dist/esm/middlewares/common/errorHandler.js.map +0 -1
  230. package/dist/esm/middlewares/common/forceHTTPS.js +0 -53
  231. package/dist/esm/middlewares/common/forceHTTPS.js.map +0 -1
  232. package/dist/esm/middlewares/common/hsts.js +0 -74
  233. package/dist/esm/middlewares/common/hsts.js.map +0 -1
  234. package/dist/esm/middlewares/common/index.js +0 -4
  235. package/dist/esm/middlewares/common/index.js.map +0 -1
  236. package/dist/esm/middlewares/html/fastHTML.js +0 -158
  237. package/dist/esm/middlewares/html/fastHTML.js.map +0 -1
  238. package/dist/esm/middlewares/html/index.js +0 -3
  239. package/dist/esm/middlewares/html/index.js.map +0 -1
  240. package/dist/esm/middlewares/html/showHTML.js +0 -100
  241. package/dist/esm/middlewares/html/showHTML.js.map +0 -1
  242. package/dist/esm/middlewares/index.js +0 -4
  243. package/dist/esm/middlewares/index.js.map +0 -1
  244. package/dist/esm/middlewares/utils/index.js +0 -2
  245. package/dist/esm/middlewares/utils/index.js.map +0 -1
  246. package/dist/esm/middlewares/utils/versionValidator.js +0 -135
  247. package/dist/esm/middlewares/utils/versionValidator.js.map +0 -1
  248. package/dist/esm/services/common/appError.js +0 -98
  249. package/dist/esm/services/common/appError.js.map +0 -1
  250. package/dist/esm/services/common/httpError.js +0 -28
  251. package/dist/esm/services/common/httpError.js.map +0 -1
  252. package/dist/esm/services/common/index.js +0 -17
  253. package/dist/esm/services/common/index.js.map +0 -1
  254. package/dist/esm/services/common/sendFile.js +0 -27
  255. package/dist/esm/services/common/sendFile.js.map +0 -1
  256. package/dist/esm/services/frontend/frontendFs.js +0 -66
  257. package/dist/esm/services/frontend/frontendFs.js.map +0 -1
  258. package/dist/esm/services/frontend/index.js +0 -11
  259. package/dist/esm/services/frontend/index.js.map +0 -1
  260. package/dist/esm/services/html/htmlGenerator.js +0 -194
  261. package/dist/esm/services/html/htmlGenerator.js.map +0 -1
  262. package/dist/esm/services/html/index.js +0 -11
  263. package/dist/esm/services/html/index.js.map +0 -1
  264. package/dist/esm/services/http/apiClient.js +0 -97
  265. package/dist/esm/services/http/apiClient.js.map +0 -1
  266. package/dist/esm/services/http/http.js +0 -180
  267. package/dist/esm/services/http/http.js.map +0 -1
  268. package/dist/esm/services/http/index.js +0 -17
  269. package/dist/esm/services/http/index.js.map +0 -1
  270. package/dist/esm/services/http/responsesBuilder.js +0 -152
  271. package/dist/esm/services/http/responsesBuilder.js.map +0 -1
  272. package/dist/esm/services/index.js +0 -6
  273. package/dist/esm/services/index.js.map +0 -1
  274. package/dist/esm/services/utils/ensureBearerToken.js +0 -94
  275. package/dist/esm/services/utils/ensureBearerToken.js.map +0 -1
  276. package/dist/esm/services/utils/index.js +0 -11
  277. package/dist/esm/services/utils/index.js.map +0 -1
  278. package/dist/esm/types/events.js +0 -1
  279. package/dist/esm/types/events.js.map +0 -1
  280. package/dist/esm/types/express.js +0 -1
  281. package/dist/esm/types/express.js.map +0 -1
  282. package/dist/esm/types/http.js +0 -1
  283. package/dist/esm/types/http.js.map +0 -1
  284. package/dist/esm/types/index.js +0 -7
  285. package/dist/esm/types/index.js.map +0 -1
  286. package/dist/esm/types/options.js +0 -1
  287. package/dist/esm/types/options.js.map +0 -1
  288. package/dist/esm/types/utils.js +0 -1
  289. package/dist/esm/types/utils.js.map +0 -1
  290. package/dist/esm/types/wootils.js +0 -1
  291. package/dist/esm/types/wootils.js.map +0 -1
  292. package/dist/esm/utils/fns/index.js +0 -5
  293. package/dist/esm/utils/fns/index.js.map +0 -1
  294. package/dist/esm/utils/fns/others.js +0 -6
  295. package/dist/esm/utils/fns/others.js.map +0 -1
  296. package/dist/esm/utils/fns/routes.js +0 -25
  297. package/dist/esm/utils/fns/routes.js.map +0 -1
  298. package/dist/esm/utils/fns/statuses.js +0 -6
  299. package/dist/esm/utils/fns/statuses.js.map +0 -1
  300. package/dist/esm/utils/fns/text.js +0 -6
  301. package/dist/esm/utils/fns/text.js.map +0 -1
  302. package/dist/esm/utils/index.js +0 -3
  303. package/dist/esm/utils/index.js.map +0 -1
  304. package/dist/esm/utils/wrappers.js +0 -41
  305. package/dist/esm/utils/wrappers.js.map +0 -1
  306. package/dist/index-Bwf7JHu9.d.mts +0 -1287
  307. package/dist/index.d.mts +0 -47
  308. package/dist/middlewares/common/errorHandler.d.mts +0 -132
  309. package/dist/middlewares/common/forceHTTPS.d.mts +0 -69
  310. package/dist/middlewares/common/hsts.d.mts +0 -110
  311. package/dist/middlewares/common/index.d.mts +0 -22
  312. package/dist/middlewares/html/fastHTML.d.mts +0 -180
  313. package/dist/middlewares/html/index.d.mts +0 -21
  314. package/dist/middlewares/html/showHTML.d.mts +0 -127
  315. package/dist/middlewares/index.d.mts +0 -30
  316. package/dist/middlewares/utils/index.d.mts +0 -20
  317. package/dist/middlewares/utils/versionValidator.d.mts +0 -215
  318. package/dist/services/common/appError.d.mts +0 -139
  319. package/dist/services/common/httpError.d.mts +0 -80
  320. package/dist/services/common/index.d.mts +0 -47
  321. package/dist/services/common/sendFile.d.mts +0 -102
  322. package/dist/services/frontend/frontendFs.d.mts +0 -96
  323. package/dist/services/frontend/index.d.mts +0 -40
  324. package/dist/services/html/htmlGenerator.d.mts +0 -237
  325. package/dist/services/html/index.d.mts +0 -43
  326. package/dist/services/http/apiClient.d.mts +0 -170
  327. package/dist/services/http/http.d.mts +0 -182
  328. package/dist/services/http/index.d.mts +0 -51
  329. package/dist/services/http/responsesBuilder.d.mts +0 -179
  330. package/dist/services/index.d.mts +0 -33
  331. package/dist/services/utils/ensureBearerToken.d.mts +0 -158
  332. package/dist/services/utils/index.d.mts +0 -44
  333. package/dist/types/events.d.mts +0 -14
  334. package/dist/types/express.d.mts +0 -10
  335. package/dist/types/http.d.mts +0 -82
  336. package/dist/types/index.d.mts +0 -14
  337. package/dist/types/options.d.mts +0 -14
  338. package/dist/types/utils.d.mts +0 -48
  339. package/dist/types/wootils.d.mts +0 -4
  340. package/dist/utils/fns/index.d.mts +0 -5
  341. package/dist/utils/fns/others.d.mts +0 -17
  342. package/dist/utils/fns/routes.d.mts +0 -39
  343. package/dist/utils/fns/statuses.d.mts +0 -45
  344. package/dist/utils/fns/text.d.mts +0 -9
  345. package/dist/utils/index.d.mts +0 -19
  346. package/dist/utils/wrappers.d.mts +0 -14
package/CHANGELOG.md CHANGED
@@ -1,3 +1,41 @@
1
+ # [11.0.0](https://github.com/homer0/jimpex/compare/10.0.2...11.0.0) (2025-12-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add missing extensions for esm ([c08930d](https://github.com/homer0/jimpex/commit/c08930d559f6b656c7fe9aa84b4ab894141439aa))
7
+ * define module exports for the package and set the type to module ([935a9d2](https://github.com/homer0/jimpex/commit/935a9d273f9495f833a0e976e12ffe8d1f4cba3a))
8
+ * drop Node v18 ([46de5f2](https://github.com/homer0/jimpex/commit/46de5f20e185cea701a57de46ed92fb5f8c1c854))
9
+ * import a single obj from spdy ([ee96af3](https://github.com/homer0/jimpex/commit/ee96af3c0a64b4bc1d115a77ef26e635a852a3df))
10
+ * import spdy only when using it ([385b70f](https://github.com/homer0/jimpex/commit/385b70fd14127cbc4510ab2364476d7dad2ba99d))
11
+ * remove unnecessary check ([7530b2b](https://github.com/homer0/jimpex/commit/7530b2b0a16abdddb608c0541a56a765bfc36e35))
12
+ * typo on default value ([9fd84c5](https://github.com/homer0/jimpex/commit/9fd84c5e1ba6ca9908e0e8da45a71b37e8d76206))
13
+ * typo on type name ([c0c3118](https://github.com/homer0/jimpex/commit/c0c311825e9f8895b08b5d8ae09a93111264724c))
14
+ * update dependencies ([8245c8f](https://github.com/homer0/jimpex/commit/8245c8fc11863d27b98652c09b0df9a2345498e3))
15
+ * update regex to cover new stack trace ([c6672ef](https://github.com/homer0/jimpex/commit/c6672ef08c9e4880759fe9a615b5e28419cc0239))
16
+ * use node prefix for importing internals ([ed1df9e](https://github.com/homer0/jimpex/commit/ed1df9e295368a0de417298b38b8fcbd95101492))
17
+ * use the right import path ([7ed1721](https://github.com/homer0/jimpex/commit/7ed1721ddccb170a5ff45e61fee874c040c2d5ad))
18
+
19
+
20
+ ### BREAKING CHANGES
21
+
22
+ * The VersionValidator default option for `popup.message`
23
+ was changed from `vesion:conflict` to `version:confict`
24
+ * The type HTTPContructorOptions was renamed to
25
+ HTTPConstructorOptions
26
+ * This package is now esm only
27
+ * Node v18 is not longer supported. Node v20.19 is the minimum
28
+ required version now.
29
+
30
+ ## [10.0.2](https://github.com/homer0/jimpex/compare/10.0.1...10.0.2) (2024-11-09)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * add support for Node v22 and set v20 for dev ([743f987](https://github.com/homer0/jimpex/commit/743f987c19a5ef93329a05b633eadf82ed52859d))
36
+ * get rid of unused variable ([09c92b5](https://github.com/homer0/jimpex/commit/09c92b5aadff5fb914c4ebdff8159472a1b04d05))
37
+ * update dependencies ([e7ed985](https://github.com/homer0/jimpex/commit/e7ed9855b12743686f5ba64965f86241e0025db6))
38
+
1
39
  ## [10.0.1](https://github.com/homer0/jimpex/compare/10.0.0...10.0.1) (2024-04-07)
2
40
 
3
41
 
package/README.md CHANGED
@@ -96,7 +96,7 @@ app.set('message', 'Hello Pili!');
96
96
  app.boot();
97
97
  ```
98
98
 
99
- Now, this may look like an unnecessary feature, but if you consider the possiblity of different entry points based on environment, maybe to enable debugging tools on dev, this becomes really useful.
99
+ Now, this may look like an unnecessary feature, but if you consider the possibility of different entry points based on environment, maybe to enable debugging tools on dev, this becomes really useful.
100
100
 
101
101
  ### ⚙️ Options and configuration
102
102
 
@@ -356,7 +356,7 @@ Jimpex already comes with a few built-in service providers ready to be used, and
356
356
 
357
357
  ##### Configurable services
358
358
 
359
- Since the version of Jimple that Jimpex uses under the hood is [`@homer0/jimple`](https://www.npmjs.com/package/@homer0/jimple), my custom "fork", you can also create "configureable providers":
359
+ Since the version of Jimple that Jimpex uses under the hood is [`@homer0/jimple`](https://www.npmjs.com/package/@homer0/jimple), my custom "fork", you can also create "configurable providers":
360
360
 
361
361
  ```ts
362
362
  // src/my-service.js
@@ -502,7 +502,7 @@ class MyApp extends Jimpex {
502
502
 
503
503
  #### Controllers with services
504
504
 
505
- If for some reason, your controller needs to register a service that the rest of the container needs to have access to, and you plan to do it on the `controller`/`controllerCreator` callback, you could end up messing with the _lazyness_ of the container: If a middleware or another controller tries to access the service and the controller that registers it is mounted after it, it will get an error as the service _doesn't exist yet_.
505
+ If for some reason, your controller needs to register a service that the rest of the container needs to have access to, and you plan to do it on the `controller`/`controllerCreator` callback, you could end up messing with the _laziness_ of the container: If a middleware or another controller tries to access the service and the controller that registers it is mounted after it, it will get an error as the service _doesn't exist yet_.
506
506
 
507
507
  A way to solve this issue would be with a `provider`/`providerCreator`, mounting the controller:
508
508
 
@@ -623,7 +623,7 @@ Just like the `controllerCreator` wrapper, you can also use the `middlewareCreat
623
623
 
624
624
  ```ts
625
625
  // my-middleware.js
626
- import { middlwareCreator } from 'jimpex';
626
+ import { middlewareCreator } from 'jimpex';
627
627
 
628
628
  // Define your middleware function (or class if it gets more complex)
629
629
  export const greetingsMiddleware = (message) => (req, res, next) => {
@@ -743,15 +743,13 @@ The configuration for `semantic-release` is on `./releaserc` and the workflow fo
743
743
 
744
744
  ### Testing
745
745
 
746
- I use [Jest](https://jestjs.io) to test the project.
746
+ I use [Vitest](https://vitest.dev) to test the project.
747
747
 
748
748
  The configuration file is on `./.jestrc.js`, the tests are on `./tests` and the script that runs it is on `./utils/scripts/test`.
749
749
 
750
750
  ### Code linting and formatting
751
751
 
752
- For linting, I use [ESlint](https://eslint.org) with [my own custom configuration](https://npmjs.com/package/@homer0/eslint-plugin).
753
-
754
- There are two configuration files, `./.eslintrc` for the source and the tooling, and `./tests/.eslintrc`, and there's also a `./.eslintignore` to exclude some files.
752
+ For linting, I use [ESlint](https://eslint.org) with [my own custom configuration](https://npmjs.com/package/@homer0/eslint-plugin). The configuration file is `./eslint.config.js`.
755
753
 
756
754
  For formatting, I use [Prettier](https://prettier.io) with [my JSDoc plugin](https://npmjs.com/package/@homer0/prettier-plugin-jsdoc) and [my own custom configuration](https://npmjs.com/package/@homer0/prettier-config). The configuration file is `./.prettierrc`.
757
755
 
@@ -767,4 +765,4 @@ The configuration file is `./.typedoc.json` and the script that runs it is on `.
767
765
 
768
766
  A friend, who's also web developer, brought the idea of start using a dependency injection container on Node, and how Jimple was a great tool for it; from the moment I tried Jimple, I could never think of starting another project without it: It not only allows you to implement dependency injection on a simple and clean way, but it also kind of forces you to have a really good organization of your code.
769
767
 
770
- A couple of months after that, the same friend told me that we should do something similar to [Silex](https://github.com/silexphp/Silex), which is based on Pimple, butwith Express. I ran with the idea and... this project is what I think a mix of Jimple and Express would look like. To be clear, **this is not a port of Silex**.
768
+ A couple of months after that, the same friend told me that we should do something similar to [Silex](https://github.com/silexphp/Silex), which is based on Pimple, but with Express. I ran with the idea and... this project is what I think a mix of Jimple and Express would look like. To be clear, **this is not a port of Silex**.
@@ -1,4 +1,4 @@
1
- export { J as Jimpex, j as jimpex } from '../index-C6I3NCC-.js';
1
+ export { J as Jimpex, j as jimpex } from '../index-BlSpNHox.js';
2
2
  import '../types/express.js';
3
3
  import 'express';
4
4
  import '../types/http.js';
package/dist/app/index.js CHANGED
@@ -1,23 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var app_exports = {};
17
- module.exports = __toCommonJS(app_exports);
18
- __reExport(app_exports, require("./jimpex"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./jimpex")
22
- });
1
+ export * from "./jimpex.js";
23
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/app/index.ts"],"sourcesContent":["export * from './jimpex';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,qBAAd;","names":[]}
1
+ {"version":3,"sources":["../../src/app/index.ts"],"sourcesContent":["export * from './jimpex.js';\n"],"mappings":"AAAA,cAAc;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import '@homer0/jimple';
2
2
  import '@homer0/events-hub';
3
- export { J as Jimpex, j as jimpex } from '../index-C6I3NCC-.js';
3
+ export { J as Jimpex, j as jimpex } from '../index-BlSpNHox.js';
4
4
  import 'express';
5
5
  import '../types/http.js';
6
6
  import '../types/utils.js';
@@ -1,109 +1,75 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var __publicField = (obj, key, value) => {
31
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
- return value;
33
- };
34
- var jimpex_exports = {};
35
- __export(jimpex_exports, {
36
- Jimpex: () => Jimpex,
37
- jimpex: () => jimpex
38
- });
39
- module.exports = __toCommonJS(jimpex_exports);
40
- var path = __toESM(require("path"));
41
- var import_promises = __toESM(require("fs/promises"));
42
- var import_https = require("https");
43
- var import_jimple = require("@homer0/jimple");
44
- var import_deep_assign = require("@homer0/deep-assign");
45
- var import_simple_logger = require("@homer0/simple-logger");
46
- var import_env_utils = require("@homer0/env-utils");
47
- var import_package_info = require("@homer0/package-info");
48
- var import_path_utils = require("@homer0/path-utils");
49
- var import_root_file = require("@homer0/root-file");
50
- var import_ts_async_import = require("@homer0/ts-async-import");
51
- var import_events_hub = require("@homer0/events-hub");
52
- var import_simple_config = require("@homer0/simple-config");
53
- var import_compression = __toESM(require("compression"));
54
- var import_body_parser = __toESM(require("body-parser"));
55
- var import_multer = __toESM(require("multer"));
56
- var import_spdy = require("spdy");
57
- var import_express = __toESM(require("express"));
58
- var import_services = require("../services");
59
- var import_utils = require("../utils");
60
- class Jimpex extends import_jimple.Jimple {
1
+ import * as path from "node:path";
2
+ import fs from "node:fs/promises";
3
+ import { createServer as createHTTPSServer } from "https";
4
+ import { Jimple } from "@homer0/jimple";
5
+ import { deepAssignWithOverwrite } from "@homer0/deep-assign";
6
+ import { appLoggerProvider } from "@homer0/simple-logger";
7
+ import { envUtilsProvider } from "@homer0/env-utils";
8
+ import { packageInfoProvider } from "@homer0/package-info";
9
+ import { pathUtilsProvider } from "@homer0/path-utils";
10
+ import { rootFileProvider } from "@homer0/root-file";
11
+ import { tsAsyncImport } from "@homer0/ts-async-import";
12
+ import { EventsHub } from "@homer0/events-hub";
13
+ import { simpleConfigProvider } from "@homer0/simple-config";
14
+ import compression from "compression";
15
+ import bodyParser from "body-parser";
16
+ import multer from "multer";
17
+ import express from "express";
18
+ import {
19
+ commonServicesProvider,
20
+ httpServicesProvider,
21
+ utilsServicesProvider
22
+ } from "../services/index.js";
23
+ import {
24
+ statuses
25
+ } from "../utils/index.js";
26
+ class Jimpex extends Jimple {
27
+ /**
28
+ * The customization settings for the application.
29
+ */
30
+ _options;
31
+ /**
32
+ * The Express application Jimpex uses under the hood.
33
+ */
34
+ _express;
35
+ /**
36
+ * Since the configuration service has an async initialization, the class uses this flag
37
+ * internally to validate if the configuration has been initialized or not.
38
+ */
39
+ _configReady = false;
40
+ /**
41
+ * A reference to the actual HTTP the application will use. This can vary depending on
42
+ * whether HTTPS, or HTTP2 are enabled. If HTTPS is not enabled, it will be the same as
43
+ * the `express` property; if HTTPS is enabled, it will be an `https` server; and if
44
+ * HTTP2 is enabled, it will be an `spdy` server.
45
+ */
46
+ _server;
47
+ /**
48
+ * The instance of the server that is listening for requests.
49
+ */
50
+ _instance;
51
+ /**
52
+ * A list of functions that implement controllers and middlewares. When the application
53
+ * starts, the queue will be processed and those controllers and middlewares will be
54
+ * added to the server instance. The reason they are not added directly like with a
55
+ * regular Express implementation is that services on Jimple use lazy loading, and
56
+ * adding middlewares and controllers as they come could cause errors if they depend on
57
+ * services that are not yet registered.
58
+ */
59
+ _mountQueue = [];
60
+ /**
61
+ * A list with all the top routes controlled by the application. Every time a controller
62
+ * is mounted, its route will be added here.
63
+ */
64
+ _controlledRoutes = [];
61
65
  /**
62
66
  * @param options Preferences to customize the application.
63
67
  * @param config The default settings for the configuration service. It's a
64
- * shortcuit for `options.config.default`
68
+ * short-circuit for `options.config.default`
65
69
  */
66
70
  constructor(options = {}, config = {}) {
67
71
  super();
68
- /**
69
- * The customization settings for the application.
70
- */
71
- __publicField(this, "_options");
72
- /**
73
- * The Express application Jimpex uses under the hood.
74
- */
75
- __publicField(this, "_express");
76
- /**
77
- * Since the configuration service has an async initialization, the class uses this flag
78
- * internally to validate if the configuration has been initialized or not.
79
- */
80
- __publicField(this, "_configReady", false);
81
- /**
82
- * A reference to the actuall HTTP the application will use. This can vary depending on
83
- * whether HTTPS, or HTTP2 are enabled. If HTTPS is not enabled, it will be the same as
84
- * the `express` property; if HTTPS is enabled, it will be an `https` server; and if
85
- * HTTP2 is enabled, it will be an `spdy` server.
86
- */
87
- __publicField(this, "_server");
88
- /**
89
- * The instance of the server that is listening for requests.
90
- */
91
- __publicField(this, "_instance");
92
- /**
93
- * A list of functions that implement controllers and middlewares. When the application
94
- * starts, the queue will be processed and those controllers and middlewares will be
95
- * added to the server instance. The reason they are not added directly like with a
96
- * regular Express implementation is that services on Jimple use lazy loading, and
97
- * adding middlewares and controllers as they come could cause errors if they depend on
98
- * services that are not yet registered.
99
- */
100
- __publicField(this, "_mountQueue", []);
101
- /**
102
- * A list with all the top routes controlled by the application. Every time a controller
103
- * is mounted, its route will be added here.
104
- */
105
- __publicField(this, "_controlledRoutes", []);
106
- this._options = (0, import_deep_assign.deepAssignWithOverwrite)(
72
+ this._options = deepAssignWithOverwrite(
107
73
  {
108
74
  filesizeLimit: "15MB",
109
75
  boot: true,
@@ -143,7 +109,7 @@ class Jimpex extends import_jimple.Jimple {
143
109
  options,
144
110
  this._initOptions()
145
111
  );
146
- this._express = (0, import_express.default)();
112
+ this._express = express();
147
113
  this._setupCoreServices();
148
114
  this._setupExpress();
149
115
  this._configurePath();
@@ -214,8 +180,7 @@ class Jimpex extends import_jimple.Jimple {
214
180
  * Stops the server instance.
215
181
  */
216
182
  stop() {
217
- if (!this._instance)
218
- return;
183
+ if (!this._instance) return;
219
184
  this._emitEvent("beforeStop", { app: this });
220
185
  this._instance.close();
221
186
  this._instance = void 0;
@@ -241,8 +206,7 @@ class Jimpex extends import_jimple.Jimple {
241
206
  }
242
207
  this._mountQueue.push((server) => {
243
208
  const connected = useController.connect(this, route);
244
- if (!connected)
245
- return;
209
+ if (!connected) return;
246
210
  const router = this._reduceWithEvent("controllerWillBeMounted", connected, {
247
211
  route,
248
212
  controller: useController,
@@ -326,7 +290,7 @@ class Jimpex extends import_jimple.Jimple {
326
290
  * The application customization options.
327
291
  */
328
292
  get options() {
329
- return (0, import_deep_assign.deepAssignWithOverwrite)({}, this._options);
293
+ return deepAssignWithOverwrite({}, this._options);
330
294
  }
331
295
  /**
332
296
  * Gets the events service.
@@ -353,7 +317,7 @@ class Jimpex extends import_jimple.Jimple {
353
317
  return this.eventsHub.on(eventName, listener);
354
318
  }
355
319
  /**
356
- * Adds a listener for an application event that will only be execuded once: the first
320
+ * Adds a listener for an application event that will only be executed once: the first
357
321
  * time the event is triggered.
358
322
  *
359
323
  * @param eventName The name of the event to listen for.
@@ -366,7 +330,7 @@ class Jimpex extends import_jimple.Jimple {
366
330
  return this.eventsHub.once(eventName, listener);
367
331
  }
368
332
  /**
369
- * Based on the application options, it returns wheter the application is healthy or
333
+ * Based on the application options, it returns whether the application is healthy or
370
334
  * not.
371
335
  */
372
336
  isHealthy() {
@@ -375,7 +339,7 @@ class Jimpex extends import_jimple.Jimple {
375
339
  /**
376
340
  * This method is like a "lifecycle method", it gets executed on the constructor right
377
341
  * before the "boot step". The idea is for the method to be a helper when the
378
- * application is defined by subclassing {@link Jimpex}: the application could register
342
+ * application is defined by sub-classing {@link Jimpex}: the application could register
379
343
  * all important services here and the routes on boot, then, if the implementation needs
380
344
  * to access or overwrite a something, it can send `boot: false`, access/register what
381
345
  * it needs, and then call `boot()`. That would be impossible for an application without
@@ -385,7 +349,7 @@ class Jimpex extends import_jimple.Jimple {
385
349
  }
386
350
  /**
387
351
  * It generates overwrites for the application options when it gets created. This method
388
- * is a helper for when the application is defined by subclassing {@link Jimpex}: It's
352
+ * is a helper for when the application is defined by sub-classing {@link Jimpex}: It's
389
353
  * highly probable that if the application needs to change the default options, it would
390
354
  * want to do it right from the class, instead of having to do it on every
391
355
  * implementation. A way to do it would be overwriting the constructor and calling
@@ -401,23 +365,20 @@ class Jimpex extends import_jimple.Jimple {
401
365
  */
402
366
  _setupCoreServices() {
403
367
  this.register(
404
- (0, import_simple_logger.appLoggerProvider)({
368
+ appLoggerProvider({
405
369
  serviceName: "logger"
406
370
  })
407
371
  );
408
- this.register(import_env_utils.envUtilsProvider);
409
- this.register(import_package_info.packageInfoProvider);
410
- this.register(import_path_utils.pathUtilsProvider);
411
- this.register(import_root_file.rootFileProvider);
372
+ this.register(envUtilsProvider);
373
+ this.register(packageInfoProvider);
374
+ this.register(pathUtilsProvider);
375
+ this.register(rootFileProvider);
412
376
  const { services: enabledServices } = this._options;
413
- if (enabledServices.common)
414
- this.register(import_services.commonServicesProvider);
415
- if (enabledServices.http)
416
- this.register(import_services.httpServicesProvider);
417
- if (enabledServices.utils)
418
- this.register(import_services.utilsServicesProvider);
419
- this.set("events", () => new import_events_hub.EventsHub());
420
- this.set("statuses", () => import_utils.statuses);
377
+ if (enabledServices.common) this.register(commonServicesProvider);
378
+ if (enabledServices.http) this.register(httpServicesProvider);
379
+ if (enabledServices.utils) this.register(utilsServicesProvider);
380
+ this.set("events", () => new EventsHub());
381
+ this.set("statuses", () => statuses);
421
382
  }
422
383
  /**
423
384
  * Configures the Express application based on the class options.
@@ -431,30 +392,30 @@ class Jimpex extends import_jimple.Jimple {
431
392
  this._express.disable("x-powered-by");
432
393
  }
433
394
  if (expressOptions.compression) {
434
- this._express.use((0, import_compression.default)());
395
+ this._express.use(compression());
435
396
  }
436
397
  if (statics.enabled) {
437
398
  this._addStaticsFolder(statics.route, statics.folder, statics.onHome);
438
399
  }
439
400
  if (expressOptions.bodyParser) {
440
401
  this._express.use(
441
- import_body_parser.default.json({
402
+ bodyParser.json({
442
403
  limit: filesizeLimit
443
404
  })
444
405
  );
445
406
  this._express.use(
446
- import_body_parser.default.urlencoded({
407
+ bodyParser.urlencoded({
447
408
  extended: true,
448
409
  limit: filesizeLimit
449
410
  })
450
411
  );
451
412
  }
452
413
  if (expressOptions.multer) {
453
- this._express.use((0, import_multer.default)().any());
414
+ this._express.use(multer().any());
454
415
  }
455
416
  this.set(
456
417
  "router",
457
- this.factory(() => import_express.default.Router())
418
+ this.factory(() => express.Router())
458
419
  );
459
420
  }
460
421
  /**
@@ -475,7 +436,7 @@ class Jimpex extends import_jimple.Jimple {
475
436
  const pathUtils = this.get("pathUtils");
476
437
  const staticFolder = pathUtils.joinFrom(location, folder || staticRoute);
477
438
  this.mount(`/${staticRoute}`, {
478
- connect: () => import_express.default.static(staticFolder),
439
+ connect: () => express.static(staticFolder),
479
440
  controller: true
480
441
  });
481
442
  }
@@ -483,7 +444,7 @@ class Jimpex extends import_jimple.Jimple {
483
444
  * This helper method validates the `path` options in order to register the `app`
484
445
  * location in the `pathUtils` service. The `app` location should be the path to where
485
446
  * the application executable is located, but due to how ESM works, we can't infer it
486
- * from the `module` object, so we need either recieved as the `appPath` setting, or try
447
+ * from the `module` object, so we need either received as the `appPath` setting, or try
487
448
  * to get it from the parent module.
488
449
  *
489
450
  * @throws If the method should use the path from the parent module, but can't find
@@ -505,7 +466,7 @@ class Jimpex extends import_jimple.Jimple {
505
466
  stackList.shift();
506
467
  const parentFromStack = stackList.find((line) => !line.includes(__filename));
507
468
  if (parentFromStack) {
508
- const parentFile = parentFromStack.replace(/^.*?\s\(([^\s]+):\d+:\d+\)/, "$1");
469
+ const parentFile = parentFromStack.replace(/^.*?\s\(?([^\s]+):\d+:\d+\)?/, "$1");
509
470
  if (parentFile !== parentFromStack) {
510
471
  foundPath = true;
511
472
  pathUtils.addLocation("app", path.dirname(parentFile));
@@ -525,8 +486,7 @@ class Jimpex extends import_jimple.Jimple {
525
486
  * This method is called just before starting the application.
526
487
  */
527
488
  async _setupConfig() {
528
- if (this._configReady)
529
- return;
489
+ if (this._configReady) return;
530
490
  this._configReady = true;
531
491
  const { config: options } = this._options;
532
492
  let configsPath = options.path.replace(/\/$/, "");
@@ -539,7 +499,7 @@ class Jimpex extends import_jimple.Jimple {
539
499
  options.name
540
500
  );
541
501
  this.register(
542
- (0, import_simple_config.simpleConfigProvider)({
502
+ simpleConfigProvider({
543
503
  name: options.name,
544
504
  defaultConfig: options.default,
545
505
  defaultConfigFilename,
@@ -559,8 +519,8 @@ class Jimpex extends import_jimple.Jimple {
559
519
  * the application so they'll be available for all the services.
560
520
  */
561
521
  async _loadESMModules() {
562
- const { default: nodeFetch } = await (0, import_ts_async_import.tsAsyncImport)("node-fetch");
563
- const { default: mime } = await (0, import_ts_async_import.tsAsyncImport)("mime");
522
+ const { default: nodeFetch } = await tsAsyncImport("node-fetch");
523
+ const { default: mime } = await tsAsyncImport("mime");
564
524
  this.set("node-fetch", () => nodeFetch);
565
525
  this.set("mime", () => mime);
566
526
  }
@@ -611,9 +571,8 @@ class Jimpex extends import_jimple.Jimple {
611
571
  const info = await Promise.all(
612
572
  keys.map(async (key) => {
613
573
  const filepath = credentialsInfo[key];
614
- if (!filepath)
615
- return void 0;
616
- const file = await import_promises.default.readFile(pathUtils.joinFrom(location, filepath), "utf8");
574
+ if (!filepath) return void 0;
575
+ const file = await fs.readFile(pathUtils.joinFrom(location, filepath), "utf8");
617
576
  return {
618
577
  key,
619
578
  file
@@ -635,7 +594,7 @@ class Jimpex extends import_jimple.Jimple {
635
594
  * @returns {Server}
636
595
  * @throws {Error} If HTTP2 is enabled but HTTPS is not.
637
596
  * @throws {Error} If HTTPS is enabled but there's no `https.credentials` object.
638
- * @throws {Error} If HTTPS is enabled and no creadentials are found.
597
+ * @throws {Error} If HTTPS is enabled and no credentials are found.
639
598
  * @access protected
640
599
  * @ignore
641
600
  */
@@ -662,15 +621,15 @@ class Jimpex extends import_jimple.Jimple {
662
621
  ...credentials,
663
622
  spdy: http2Config.spdy
664
623
  };
665
- return (0, import_spdy.createServer)(serverOptions, this._express);
624
+ const spdyModule = await tsAsyncImport("spdy");
625
+ return spdyModule.default.createServer(serverOptions, this._express);
666
626
  }
667
- return (0, import_https.createServer)(credentials, this._express);
627
+ return createHTTPSServer(credentials, this._express);
668
628
  }
669
629
  }
670
630
  const jimpex = (...args) => new Jimpex(...args);
671
- // Annotate the CommonJS export names for ESM import in node:
672
- 0 && (module.exports = {
631
+ export {
673
632
  Jimpex,
674
633
  jimpex
675
- });
634
+ };
676
635
  //# sourceMappingURL=jimpex.js.map