@adonisjs/core 6.1.5-1 → 6.1.5-3

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 (309) hide show
  1. package/build/commands/build.d.ts +3 -0
  2. package/build/commands/build.d.ts.map +1 -0
  3. package/build/commands/build.js +22 -2
  4. package/build/commands/commands.json +1 -1
  5. package/build/commands/configure.d.ts +1 -0
  6. package/build/commands/configure.d.ts.map +1 -0
  7. package/build/commands/configure.js +2 -1
  8. package/build/commands/eject.d.ts +1 -0
  9. package/build/commands/eject.d.ts.map +1 -0
  10. package/build/commands/eject.js +2 -1
  11. package/build/commands/generate_key.d.ts +1 -0
  12. package/build/commands/generate_key.d.ts.map +1 -0
  13. package/build/commands/generate_key.js +2 -1
  14. package/build/commands/inspect_rcfile.d.ts +7 -0
  15. package/build/commands/inspect_rcfile.d.ts.map +1 -0
  16. package/build/commands/inspect_rcfile.js +10 -0
  17. package/build/commands/list/routes.d.ts +14 -0
  18. package/build/commands/list/routes.d.ts.map +1 -0
  19. package/build/commands/list/routes.js +79 -0
  20. package/build/commands/make/_base.d.ts +23 -1
  21. package/build/commands/make/_base.d.ts.map +1 -0
  22. package/build/commands/make/_base.js +11 -2
  23. package/build/commands/make/command.d.ts +1 -0
  24. package/build/commands/make/command.d.ts.map +1 -0
  25. package/build/commands/make/command.js +2 -1
  26. package/build/commands/make/controller.d.ts +1 -0
  27. package/build/commands/make/controller.d.ts.map +1 -0
  28. package/build/commands/make/controller.js +2 -1
  29. package/build/commands/make/event.d.ts +1 -0
  30. package/build/commands/make/event.d.ts.map +1 -0
  31. package/build/commands/make/event.js +2 -1
  32. package/build/commands/make/listener.d.ts +1 -0
  33. package/build/commands/make/listener.d.ts.map +1 -0
  34. package/build/commands/make/listener.js +2 -1
  35. package/build/commands/make/middleware.d.ts +1 -0
  36. package/build/commands/make/middleware.d.ts.map +1 -0
  37. package/build/commands/make/middleware.js +2 -1
  38. package/build/commands/make/prldfile.d.ts +9 -0
  39. package/build/commands/make/prldfile.d.ts.map +1 -0
  40. package/build/commands/make/prldfile.js +28 -0
  41. package/build/commands/make/provider.d.ts +1 -0
  42. package/build/commands/make/provider.d.ts.map +1 -0
  43. package/build/commands/make/provider.js +5 -2
  44. package/build/commands/make/service.d.ts +9 -0
  45. package/build/commands/make/service.d.ts.map +1 -0
  46. package/build/commands/make/service.js +26 -0
  47. package/build/commands/make/test.d.ts +1 -0
  48. package/build/commands/make/test.d.ts.map +1 -0
  49. package/build/commands/make/test.js +2 -1
  50. package/build/commands/serve.d.ts +3 -0
  51. package/build/commands/serve.d.ts.map +1 -0
  52. package/build/commands/serve.js +21 -1
  53. package/build/commands/test.d.ts +21 -0
  54. package/build/commands/test.d.ts.map +1 -0
  55. package/build/commands/test.js +156 -0
  56. package/build/factories/app.d.ts +1 -0
  57. package/build/factories/app.d.ts.map +1 -0
  58. package/build/factories/bodyparser.d.ts +1 -0
  59. package/build/factories/bodyparser.d.ts.map +1 -0
  60. package/build/factories/core/ace.d.ts +1 -0
  61. package/build/factories/core/ace.d.ts.map +1 -0
  62. package/build/factories/core/ignitor.d.ts +1 -0
  63. package/build/factories/core/ignitor.d.ts.map +1 -0
  64. package/build/factories/core/main.d.ts +1 -0
  65. package/build/factories/core/main.d.ts.map +1 -0
  66. package/build/factories/core/test_utils.d.ts +1 -0
  67. package/build/factories/core/test_utils.d.ts.map +1 -0
  68. package/build/factories/encryption.d.ts +1 -0
  69. package/build/factories/encryption.d.ts.map +1 -0
  70. package/build/factories/events.d.ts +1 -0
  71. package/build/factories/events.d.ts.map +1 -0
  72. package/build/factories/hash.d.ts +1 -0
  73. package/build/factories/hash.d.ts.map +1 -0
  74. package/build/factories/http.d.ts +1 -0
  75. package/build/factories/http.d.ts.map +1 -0
  76. package/build/factories/logger.d.ts +1 -0
  77. package/build/factories/logger.d.ts.map +1 -0
  78. package/build/factories/stubs.d.ts +1 -0
  79. package/build/factories/stubs.d.ts.map +1 -0
  80. package/build/index.d.ts +1 -0
  81. package/build/index.d.ts.map +1 -0
  82. package/build/legacy/validator.d.ts +1 -0
  83. package/build/legacy/validator.d.ts.map +1 -0
  84. package/build/modules/ace/commands.d.ts +1 -0
  85. package/build/modules/ace/commands.d.ts.map +1 -0
  86. package/build/modules/ace/commands.js +4 -2
  87. package/build/modules/ace/create_kernel.d.ts +1 -0
  88. package/build/modules/ace/create_kernel.d.ts.map +1 -0
  89. package/build/modules/ace/kernel.d.ts +1 -0
  90. package/build/modules/ace/kernel.d.ts.map +1 -0
  91. package/build/modules/ace/main.d.ts +2 -1
  92. package/build/modules/ace/main.d.ts.map +1 -0
  93. package/build/modules/ace/main.js +1 -1
  94. package/build/modules/ace/shell.d.ts +1 -0
  95. package/build/modules/ace/shell.d.ts.map +1 -0
  96. package/build/modules/app.d.ts +1 -0
  97. package/build/modules/app.d.ts.map +1 -0
  98. package/build/modules/bodyparser/bodyparser_middleware.d.ts +1 -0
  99. package/build/modules/bodyparser/bodyparser_middleware.d.ts.map +1 -0
  100. package/build/modules/bodyparser/main.d.ts +1 -0
  101. package/build/modules/bodyparser/main.d.ts.map +1 -0
  102. package/build/modules/config.d.ts +1 -0
  103. package/build/modules/config.d.ts.map +1 -0
  104. package/build/modules/container.d.ts +1 -0
  105. package/build/modules/container.d.ts.map +1 -0
  106. package/build/modules/encryption.d.ts +1 -0
  107. package/build/modules/encryption.d.ts.map +1 -0
  108. package/build/modules/env.d.ts +1 -0
  109. package/build/modules/env.d.ts.map +1 -0
  110. package/build/modules/events.d.ts +1 -0
  111. package/build/modules/events.d.ts.map +1 -0
  112. package/build/modules/hash/define_config.d.ts +1 -0
  113. package/build/modules/hash/define_config.d.ts.map +1 -0
  114. package/build/modules/hash/drivers_collection.d.ts +4 -4
  115. package/build/modules/hash/drivers_collection.d.ts.map +1 -0
  116. package/build/modules/hash/drivers_collection.js +2 -8
  117. package/build/modules/hash/main.d.ts +2 -0
  118. package/build/modules/hash/main.d.ts.map +1 -0
  119. package/build/modules/hash/main.js +1 -0
  120. package/build/modules/http.d.ts +1 -0
  121. package/build/modules/http.d.ts.map +1 -0
  122. package/build/modules/logger.d.ts +1 -0
  123. package/build/modules/logger.d.ts.map +1 -0
  124. package/build/providers/app_provider.d.ts +1 -0
  125. package/build/providers/app_provider.d.ts.map +1 -0
  126. package/build/providers/app_provider.js +5 -7
  127. package/build/providers/hash_provider.d.ts +1 -0
  128. package/build/providers/hash_provider.d.ts.map +1 -0
  129. package/build/providers/hash_provider.js +7 -6
  130. package/build/providers/http_provider.d.ts +1 -0
  131. package/build/providers/http_provider.d.ts.map +1 -0
  132. package/build/services/ace.d.ts +1 -0
  133. package/build/services/ace.d.ts.map +1 -0
  134. package/build/services/app.d.ts +1 -0
  135. package/build/services/app.d.ts.map +1 -0
  136. package/build/services/config.d.ts +1 -0
  137. package/build/services/config.d.ts.map +1 -0
  138. package/build/services/emitter.d.ts +1 -0
  139. package/build/services/emitter.d.ts.map +1 -0
  140. package/build/services/emitter.js +1 -2
  141. package/build/services/encryption.d.ts +1 -0
  142. package/build/services/encryption.d.ts.map +1 -0
  143. package/build/services/encryption.js +1 -2
  144. package/build/services/hash.d.ts +1 -0
  145. package/build/services/hash.d.ts.map +1 -0
  146. package/build/services/hash.js +1 -2
  147. package/build/services/logger.d.ts +1 -0
  148. package/build/services/logger.d.ts.map +1 -0
  149. package/build/services/logger.js +1 -2
  150. package/build/services/router.d.ts +1 -0
  151. package/build/services/router.d.ts.map +1 -0
  152. package/build/services/router.js +1 -2
  153. package/build/services/server.d.ts +1 -0
  154. package/build/services/server.d.ts.map +1 -0
  155. package/build/services/server.js +1 -2
  156. package/build/services/test_utils.d.ts +1 -0
  157. package/build/services/test_utils.d.ts.map +1 -0
  158. package/build/src/cli_formatters/routes_list.d.ts +41 -0
  159. package/build/src/cli_formatters/routes_list.d.ts.map +1 -0
  160. package/build/src/cli_formatters/routes_list.js +258 -0
  161. package/build/src/debug.d.ts +1 -0
  162. package/build/src/debug.d.ts.map +1 -0
  163. package/build/src/helpers/is.d.ts +1 -0
  164. package/build/src/helpers/is.d.ts.map +1 -0
  165. package/build/src/helpers/main.d.ts +3 -0
  166. package/build/src/helpers/main.d.ts.map +1 -0
  167. package/build/src/helpers/main.js +2 -0
  168. package/build/src/helpers/parse_binding_reference.d.ts +6 -0
  169. package/build/src/helpers/parse_binding_reference.d.ts.map +1 -0
  170. package/build/src/helpers/parse_binding_reference.js +23 -0
  171. package/build/src/helpers/string.d.ts +3 -0
  172. package/build/src/helpers/string.d.ts.map +1 -0
  173. package/build/src/helpers/string.js +4 -0
  174. package/build/src/helpers/types.d.ts +1 -0
  175. package/build/src/helpers/types.d.ts.map +1 -0
  176. package/build/src/ignitor/ace.d.ts +1 -0
  177. package/build/src/ignitor/ace.d.ts.map +1 -0
  178. package/build/src/ignitor/http.d.ts +1 -0
  179. package/build/src/ignitor/http.d.ts.map +1 -0
  180. package/build/src/ignitor/main.d.ts +1 -0
  181. package/build/src/ignitor/main.d.ts.map +1 -0
  182. package/build/src/ignitor/test.d.ts +1 -0
  183. package/build/src/ignitor/test.d.ts.map +1 -0
  184. package/build/src/internal_helpers.d.ts +1 -0
  185. package/build/src/internal_helpers.d.ts.map +1 -0
  186. package/build/src/internal_helpers.js +3 -3
  187. package/build/src/test_utils/http.d.ts +1 -0
  188. package/build/src/test_utils/http.d.ts.map +1 -0
  189. package/build/src/test_utils/main.d.ts +2 -1
  190. package/build/src/test_utils/main.d.ts.map +1 -0
  191. package/build/src/types.d.ts +3 -2
  192. package/build/src/types.d.ts.map +1 -0
  193. package/build/stubs/index.d.ts +1 -0
  194. package/build/stubs/index.d.ts.map +1 -0
  195. package/build/stubs/make/preload_file/main.stub +4 -0
  196. package/build/stubs/make/service/main.stub +4 -0
  197. package/build/toolkit/commands/index_commands.d.ts +1 -0
  198. package/build/toolkit/commands/index_commands.d.ts.map +1 -0
  199. package/build/toolkit/commands/index_commands.js +2 -1
  200. package/build/toolkit/main.d.ts +1 -0
  201. package/build/toolkit/main.d.ts.map +1 -0
  202. package/build/types/ace.d.ts +1 -0
  203. package/build/types/ace.d.ts.map +1 -0
  204. package/build/types/app.d.ts +1 -0
  205. package/build/types/app.d.ts.map +1 -0
  206. package/build/types/bodyparser.d.ts +1 -0
  207. package/build/types/bodyparser.d.ts.map +1 -0
  208. package/build/types/container.d.ts +1 -0
  209. package/build/types/container.d.ts.map +1 -0
  210. package/build/types/encryption.d.ts +1 -0
  211. package/build/types/encryption.d.ts.map +1 -0
  212. package/build/types/events.d.ts +1 -0
  213. package/build/types/events.d.ts.map +1 -0
  214. package/build/types/hash.d.ts +1 -0
  215. package/build/types/hash.d.ts.map +1 -0
  216. package/build/types/http.d.ts +1 -0
  217. package/build/types/http.d.ts.map +1 -0
  218. package/build/types/logger.d.ts +1 -0
  219. package/build/types/logger.d.ts.map +1 -0
  220. package/commands/build.ts +122 -0
  221. package/commands/configure.ts +179 -0
  222. package/commands/eject.ts +39 -0
  223. package/commands/generate_key.ts +53 -0
  224. package/commands/inspect_rcfile.ts +23 -0
  225. package/commands/list/routes.ts +121 -0
  226. package/commands/make/_base.ts +55 -0
  227. package/commands/make/command.ts +33 -0
  228. package/commands/make/controller.ts +77 -0
  229. package/commands/make/event.ts +33 -0
  230. package/commands/make/listener.ts +63 -0
  231. package/commands/make/middleware.ts +34 -0
  232. package/commands/make/prldfile.ts +40 -0
  233. package/commands/make/provider.ts +40 -0
  234. package/commands/make/service.ts +33 -0
  235. package/commands/make/test.ts +115 -0
  236. package/commands/serve.ts +146 -0
  237. package/commands/test.ts +189 -0
  238. package/factories/app.ts +10 -0
  239. package/factories/bodyparser.ts +10 -0
  240. package/factories/core/ace.ts +38 -0
  241. package/factories/core/ignitor.ts +132 -0
  242. package/factories/core/main.ts +13 -0
  243. package/factories/core/test_utils.ts +34 -0
  244. package/factories/encryption.ts +10 -0
  245. package/factories/events.ts +10 -0
  246. package/factories/hash.ts +10 -0
  247. package/factories/http.ts +10 -0
  248. package/factories/logger.ts +10 -0
  249. package/factories/stubs.ts +53 -0
  250. package/index.ts +39 -0
  251. package/legacy/validator.ts +10 -0
  252. package/modules/ace/commands.ts +152 -0
  253. package/modules/ace/create_kernel.ts +73 -0
  254. package/modules/ace/kernel.ts +28 -0
  255. package/modules/ace/main.ts +22 -0
  256. package/modules/ace/shell.ts +49 -0
  257. package/modules/app.ts +10 -0
  258. package/modules/bodyparser/bodyparser_middleware.ts +16 -0
  259. package/modules/bodyparser/main.ts +10 -0
  260. package/modules/config.ts +10 -0
  261. package/modules/container.ts +10 -0
  262. package/modules/encryption.ts +10 -0
  263. package/modules/env.ts +10 -0
  264. package/modules/events.ts +10 -0
  265. package/modules/hash/define_config.ts +64 -0
  266. package/modules/hash/drivers_collection.ts +61 -0
  267. package/modules/hash/main.ts +12 -0
  268. package/modules/http.ts +10 -0
  269. package/modules/logger.ts +10 -0
  270. package/package.json +43 -36
  271. package/providers/app_provider.ts +125 -0
  272. package/providers/hash_provider.ts +58 -0
  273. package/providers/http_provider.ts +66 -0
  274. package/services/ace.ts +26 -0
  275. package/services/app.ts +26 -0
  276. package/services/config.ts +22 -0
  277. package/services/emitter.ts +23 -0
  278. package/services/encryption.ts +23 -0
  279. package/services/hash.ts +23 -0
  280. package/services/logger.ts +23 -0
  281. package/services/router.ts +23 -0
  282. package/services/server.ts +23 -0
  283. package/services/test_utils.ts +26 -0
  284. package/src/cli_formatters/routes_list.ts +480 -0
  285. package/src/debug.ts +12 -0
  286. package/src/helpers/is.ts +11 -0
  287. package/src/helpers/main.ts +13 -0
  288. package/src/helpers/parse_binding_reference.ts +93 -0
  289. package/src/helpers/string.ts +89 -0
  290. package/src/helpers/types.ts +46 -0
  291. package/src/ignitor/ace.ts +90 -0
  292. package/src/ignitor/http.ts +167 -0
  293. package/src/ignitor/main.ts +118 -0
  294. package/src/ignitor/test.ts +51 -0
  295. package/src/internal_helpers.ts +59 -0
  296. package/src/test_utils/http.ts +79 -0
  297. package/src/test_utils/main.ts +69 -0
  298. package/src/types.ts +136 -0
  299. package/types/ace.ts +15 -0
  300. package/types/app.ts +10 -0
  301. package/types/bodyparser.ts +10 -0
  302. package/types/container.ts +10 -0
  303. package/types/encryption.ts +10 -0
  304. package/types/events.ts +10 -0
  305. package/types/hash.ts +10 -0
  306. package/types/http.ts +10 -0
  307. package/types/logger.ts +10 -0
  308. package/build/src/helpers/string_builder.d.ts +0 -23
  309. package/build/src/helpers/string_builder.js +0 -86
@@ -0,0 +1,6 @@
1
+ import { LazyImport, Constructor } from '../../types/http.js';
2
+ export declare function parseBindingReference(binding: string | [LazyImport<Constructor<any>> | Constructor<any>, any?]): Promise<{
3
+ moduleNameOrPath: string;
4
+ method: string;
5
+ }>;
6
+ //# sourceMappingURL=parse_binding_reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse_binding_reference.d.ts","sourceRoot":"","sources":["../../../src/helpers/parse_binding_reference.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AA0C7D,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GACxE,OAAO,CAAC;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAsCvD"}
@@ -0,0 +1,23 @@
1
+ import parseImports from 'parse-imports';
2
+ export async function parseBindingReference(binding) {
3
+ if (typeof binding === 'string') {
4
+ const tokens = binding.split('.');
5
+ if (tokens.length === 1) {
6
+ return { moduleNameOrPath: binding, method: 'handle' };
7
+ }
8
+ return { method: tokens.pop(), moduleNameOrPath: tokens.join('.') };
9
+ }
10
+ const [bindingReference, method] = binding;
11
+ const imports = [...(await parseImports(bindingReference.toString()))];
12
+ const importedModule = imports.find(($import) => $import.isDynamicImport && $import.moduleSpecifier.value);
13
+ if (importedModule) {
14
+ return {
15
+ moduleNameOrPath: importedModule.moduleSpecifier.value,
16
+ method: method || 'handle',
17
+ };
18
+ }
19
+ return {
20
+ moduleNameOrPath: bindingReference.name,
21
+ method: method || 'handle',
22
+ };
23
+ }
@@ -1,6 +1,8 @@
1
1
  import { EncodeOptions } from 'he';
2
2
  import string from '@poppinss/utils/string';
3
+ import StringBuilder from '@poppinss/utils/string_builder';
3
4
  declare const stringHelpers: typeof string & {
5
+ create(value: string | StringBuilder): StringBuilder;
4
6
  ordinalize: (typeof string)['ordinal'];
5
7
  toSentence: (typeof string)['sentence'];
6
8
  generateRandom: (typeof string)['random'];
@@ -15,3 +17,4 @@ declare const stringHelpers: typeof string & {
15
17
  encodeSymbols(value: string, options?: EncodeOptions): string;
16
18
  };
17
19
  export default stringHelpers;
20
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/helpers/string.ts"],"names":[],"mappings":"AASA,OAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAEtC,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAK1D,QAAA,MAAM,aAAa,EAAE,OAAO,MAAM,GAAG;IAInC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,aAAa,CAAA;IAEpD,UAAU,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;IAKtC,UAAU,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;IAKvC,cAAc,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAA;IAKzC,YAAY,CACV,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,GACzE,MAAM,CAAA;IAKT,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;IAK/B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAA;IAKxE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;CA8B9D,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,11 +1,15 @@
1
1
  import he from 'he';
2
2
  import prettyHrTime from 'pretty-hrtime';
3
3
  import string from '@poppinss/utils/string';
4
+ import StringBuilder from '@poppinss/utils/string_builder';
4
5
  const stringHelpers = {
5
6
  ...string,
6
7
  toSentence: string.sentence,
7
8
  ordinalize: string.ordinal,
8
9
  generateRandom: string.random,
10
+ create(value) {
11
+ return new StringBuilder(value);
12
+ },
9
13
  prettyHrTime(time, options) {
10
14
  return prettyHrTime(time, options);
11
15
  },
@@ -22,3 +22,4 @@ declare const types: {
22
22
  }): boolean;
23
23
  };
24
24
  export default types;
25
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/helpers/types.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAOjC,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;mBAgBM,MAAM;qBAGJ,MAAM,GAAG,MAAM,YAAY;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;CAQjF,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -6,3 +6,4 @@ export declare class AceProcess {
6
6
  configure(callback: (app: ApplicationService) => Promise<void> | void): this;
7
7
  handle(argv: string[]): Promise<void>;
8
8
  }
9
+ //# sourceMappingURL=ace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ace.d.ts","sourceRoot":"","sources":["../../../src/ignitor/ace.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAMrD,qBAAa,UAAU;;gBAYT,OAAO,EAAE,OAAO;IAQ5B,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAStE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE;CA4C5B"}
@@ -8,3 +8,4 @@ export declare class HttpServerProcess {
8
8
  constructor(ignitor: Ignitor);
9
9
  start(serverCallback?: (handler: (req: IncomingMessage, res: ServerResponse) => any) => NodeHttpsServer | NodeHttpServer): Promise<void>;
10
10
  }
11
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/ignitor/http.ts"],"names":[],"mappings":";;AASA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,IAAI,cAAc,EAAgB,MAAM,WAAW,CAAA;AAGnG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,qBAAa,iBAAiB;;gBAMhB,OAAO,EAAE,OAAO;IA8FtB,KAAK,CACT,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,GAAG,KACxD,eAAe,GAAG,cAAc;CA2CxC"}
@@ -15,3 +15,4 @@ export declare class Ignitor {
15
15
  testRunner(): TestRunnerProcess;
16
16
  terminate(): Promise<void>;
17
17
  }
18
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/ignitor/main.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMrE,qBAAa,OAAO;;gBA0BN,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc;IAiBjD,MAAM;IAON,SAAS,CAAC,WAAW,EAAE,eAAe;IAYtC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,IAAI;IAQtD,UAAU;IAOV,GAAG;IAOH,UAAU;IAQJ,SAAS;CAGhB"}
@@ -6,3 +6,4 @@ export declare class TestRunnerProcess {
6
6
  configure(callback: (app: ApplicationService) => Promise<void> | void): this;
7
7
  run(callback: (app: ApplicationService) => Promise<void> | void): Promise<void>;
8
8
  }
9
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/ignitor/test.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAKrD,qBAAa,iBAAiB;;gBAYhB,OAAO,EAAE,OAAO;IAQ5B,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAQtE,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CAOtE"}
@@ -6,3 +6,4 @@ export declare function detectAssetsBundler(app: ApplicationService): Promise<{
6
6
  devServerCommand: string;
7
7
  buildCommand: string;
8
8
  } | undefined>;
9
+ //# sourceMappingURL=internal_helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal_helpers.d.ts","sourceRoot":"","sources":["../../src/internal_helpers.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAK/C,wBAAsB,eAAe,CACnC,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,cAAc,qBAAqB,CAAC,GAAG,SAAS,CAAC,CAI3D;AAKD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,cAAc,YAAY,CAAC,GAAG,SAAS,CAAC,CAIlD;AAMD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB;;;;eAoBhE"}
@@ -1,4 +1,4 @@
1
- import fs from 'fs-extra';
1
+ import fs from 'node:fs';
2
2
  export async function importAssembler(app) {
3
3
  try {
4
4
  return await app.import('@adonisjs/assembler');
@@ -15,14 +15,14 @@ export async function detectAssetsBundler(app) {
15
15
  if (app.rcFile.assetsBundler) {
16
16
  return app.rcFile.assetsBundler;
17
17
  }
18
- if (await fs.exists(app.makePath('vite.config.js'))) {
18
+ if (fs.existsSync(app.makePath('vite.config.js'))) {
19
19
  return {
20
20
  name: 'vite',
21
21
  devServerCommand: 'vite',
22
22
  buildCommand: 'vite build',
23
23
  };
24
24
  }
25
- if (await fs.exists(app.makePath('webpack.config.js'))) {
25
+ if (fs.existsSync(app.makePath('webpack.config.js'))) {
26
26
  return {
27
27
  name: 'encore',
28
28
  devServerCommand: 'encore dev-server',
@@ -8,3 +8,4 @@ export declare class HttpServerUtils {
8
8
  constructor(utils: TestUtils);
9
9
  start(serverCallback?: (handler: (req: IncomingMessage, res: ServerResponse) => any) => NodeHttpsServer | NodeHttpServer): Promise<() => Promise<void>>;
10
10
  }
11
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/test_utils/http.ts"],"names":[],"mappings":";;AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,IAAI,cAAc,EAAgB,MAAM,WAAW,CAAA;AAMnG,qBAAa,eAAe;;gBAGd,KAAK,EAAE,SAAS;IA8BtB,KAAK,CACT,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,GAAG,KACxD,eAAe,GAAG,cAAc,GACpC,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAuBhC"}
@@ -2,8 +2,8 @@
2
2
  import Macroable from '@poppinss/macroable';
3
3
  import { IncomingMessage, ServerResponse } from 'node:http';
4
4
  import { HttpServerUtils } from './http.js';
5
- import type { ApplicationService } from '../types.js';
6
5
  import { CookieClient } from '../../modules/http.js';
6
+ import type { ApplicationService } from '../types.js';
7
7
  export declare class TestUtils extends Macroable {
8
8
  #private;
9
9
  app: ApplicationService;
@@ -17,3 +17,4 @@ export declare class TestUtils extends Macroable {
17
17
  res?: ServerResponse;
18
18
  }): Promise<import("../../modules/http.js").HttpContext>;
19
19
  }
20
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/test_utils/main.ts"],"names":[],"mappings":";AAUA,OAAO,SAAS,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAMrD,qBAAa,SAAU,SAAQ,SAAS;;IAYnB,GAAG,EAAE,kBAAkB;IAN1C,IAAI,QAAQ,YAEX;IAEO,OAAO,EAAE,YAAY,CAAA;gBAEV,GAAG,EAAE,kBAAkB;IAQpC,IAAI;IAWV,UAAU;IAOJ,iBAAiB,CAAC,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAC;QAAC,GAAG,CAAC,EAAE,cAAc,CAAA;KAAO;CAStF"}
@@ -7,14 +7,15 @@ import type { Router, Server } from '../modules/http.js';
7
7
  import type { LoggerManager } from '../modules/logger.js';
8
8
  import type { Encryption } from '../modules/encryption.js';
9
9
  import type { HttpRequestFinishedPayload } from '../types/http.js';
10
+ import type { ContainerResolveEventData } from '../types/container.js';
10
11
  import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.js';
11
- import type hashDriversCollection from '../modules/hash/drivers_collection.js';
12
12
  import type { Argon, Bcrypt, HashManager, Scrypt } from '../modules/hash/main.js';
13
13
  import type { ArgonConfig, BcryptConfig, ScryptConfig, ManagerDriverFactory } from '../types/hash.js';
14
14
  export type IgnitorOptions = {
15
15
  importer: Importer;
16
16
  };
17
17
  export interface EventsList {
18
+ 'container:resolved': ContainerResolveEventData<ContainerBindings>;
18
19
  'http:request_handled': HttpRequestFinishedPayload;
19
20
  'http:server_ready': {
20
21
  port: number;
@@ -56,8 +57,8 @@ export interface ContainerBindings {
56
57
  emitter: EmitterService;
57
58
  encryption: EncryptionService;
58
59
  hash: HashService;
59
- hashDrivers: typeof hashDriversCollection;
60
60
  server: HttpServerService;
61
61
  router: HttpRouterService;
62
62
  testUtils: TestUtils;
63
63
  }
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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"}
@@ -1 +1,2 @@
1
1
  export declare const stubsRoot: string;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../stubs/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,QAA8B,CAAA"}
@@ -0,0 +1,4 @@
1
+ {{#var preloadFileName = string(entity.name).snakeCase().removeExtension().ext('.ts').toString()}}
2
+ ---
3
+ to: {{ app.startPath(entity.path, preloadFileName) }}
4
+ ---
@@ -0,0 +1,4 @@
1
+ {{#var serviceFileName = generators.serviceFileName(entity.name)}}
2
+ ---
3
+ to: {{ app.servicesPath(entity.path, serviceFileName) }}
4
+ ---
@@ -5,3 +5,4 @@ export default class IndexCommand extends BaseCommand {
5
5
  commandsDir: string;
6
6
  run(): Promise<any>;
7
7
  }
8
+ //# sourceMappingURL=index_commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index_commands.d.ts","sourceRoot":"","sources":["../../../toolkit/commands/index_commands.ts"],"names":[],"mappings":"AAUA,OAAO,EAAQ,WAAW,EAAkB,MAAM,eAAe,CAAA;AAMjE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACnD,MAAM,CAAC,WAAW,SAAU;IAC5B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAyD;IAG3E,WAAW,EAAE,MAAM,CAAA;IAErB,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAG1B"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { join } from 'node:path';
11
11
  import { args, BaseCommand, IndexGenerator } from '@adonisjs/ace';
12
- export default class IndexCommand extends BaseCommand {
12
+ class IndexCommand extends BaseCommand {
13
13
  static commandName = 'index';
14
14
  static description = 'Create an index of commands along with a lazy loader';
15
15
  async run() {
@@ -20,3 +20,4 @@ __decorate([
20
20
  args.string({ description: 'Relative path from cwd to the commands directory' }),
21
21
  __metadata("design:type", String)
22
22
  ], IndexCommand.prototype, "commandsDir", void 0);
23
+ export default IndexCommand;
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../toolkit/main.ts"],"names":[],"mappings":""}
@@ -3,3 +3,4 @@ export type CommandOptions = BaseCommandOptions & {
3
3
  startApp?: boolean;
4
4
  };
5
5
  export * from '@adonisjs/ace/types';
6
+ //# sourceMappingURL=ace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ace.d.ts","sourceRoot":"","sources":["../../types/ace.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,cAAc,qBAAqB,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/application/types';
2
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../types/app.ts"],"names":[],"mappings":"AASA,cAAc,6BAA6B,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/bodyparser/types';
2
+ //# sourceMappingURL=bodyparser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bodyparser.d.ts","sourceRoot":"","sources":["../../types/bodyparser.ts"],"names":[],"mappings":"AASA,cAAc,4BAA4B,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/fold/types';
2
+ //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../types/container.ts"],"names":[],"mappings":"AASA,cAAc,sBAAsB,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/encryption/types';
2
+ //# sourceMappingURL=encryption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../types/encryption.ts"],"names":[],"mappings":"AASA,cAAc,4BAA4B,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/events/types';
2
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../types/events.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/hash/types';
2
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../types/hash.ts"],"names":[],"mappings":"AASA,cAAc,sBAAsB,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/http-server/types';
2
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../types/http.ts"],"names":[],"mappings":"AASA,cAAc,6BAA6B,CAAA"}
@@ -1 +1,2 @@
1
1
  export * from '@adonisjs/logger/types';
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../types/logger.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,122 @@
1
+ /*
2
+ * @adonisjs/core
3
+ *
4
+ * (c) AdonisJS
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+
10
+ import { BaseCommand, flags } from '../modules/ace/main.js'
11
+ import { detectAssetsBundler, importAssembler, importTypeScript } from '../src/internal_helpers.js'
12
+
13
+ /**
14
+ * Serve command is used to run the AdonisJS HTTP server during development. The
15
+ * command under the hood runs the "bin/server.ts" file and watches for file
16
+ * system changes
17
+ */
18
+ export default class Build extends BaseCommand {
19
+ static commandName = 'build'
20
+ static description =
21
+ 'Build application for production by compiling frontend assets and TypeScript source to JavaScript'
22
+
23
+ static help = [
24
+ 'Create the production build using the following command.',
25
+ '```',
26
+ '{{ binaryName }} build',
27
+ '```',
28
+ '',
29
+ 'The assets bundler dev server runs automatically after detecting vite config or webpack config files',
30
+ 'You may pass vite CLI args using the --assets-args command line flag.',
31
+ '```',
32
+ '{{ binaryName }} build --assets-args="--debug --base=/public"',
33
+ '```',
34
+ ]
35
+
36
+ @flags.boolean({ description: 'Watch filesystem and restart the HTTP server on file change' })
37
+ declare watch?: boolean
38
+
39
+ @flags.boolean({ description: 'Ignore TypeScript errors and continue with the build process' })
40
+ declare ignoreTsErrors?: boolean
41
+
42
+ @flags.string({
43
+ description: 'Select the package manager you want to use to install production dependencies',
44
+ })
45
+ declare packageManager?: 'npm' | 'pnpm' | 'yarn'
46
+
47
+ @flags.boolean({
48
+ description: 'Build frontend assets',
49
+ showNegatedVariantInHelp: true,
50
+ default: true,
51
+ })
52
+ declare assets?: boolean
53
+
54
+ @flags.array({
55
+ description: 'Define CLI arguments to pass to the assets bundler',
56
+ })
57
+ declare assetsArgs?: string[]
58
+
59
+ /**
60
+ * Log a development dependency is missing
61
+ */
62
+ #logMissingDevelopmentDependency(dependency: string) {
63
+ this.logger.error(
64
+ [
65
+ `Cannot find package "${dependency}"`,
66
+ '',
67
+ `The "${dependency}" package is a development dependency and therefore you should use the build command with development dependencies installed.`,
68
+ '',
69
+ 'If you are using the build command inside a CI or with a deployment platform, make sure the NODE_ENV is set to "development"',
70
+ ].join('\n')
71
+ )
72
+ }
73
+
74
+ /**
75
+ * Build application
76
+ */
77
+ async run() {
78
+ const assembler = await importAssembler(this.app)
79
+ if (!assembler) {
80
+ this.#logMissingDevelopmentDependency('@adonisjs/assembler')
81
+ this.exitCode = 1
82
+ return
83
+ }
84
+
85
+ const ts = await importTypeScript(this.app)
86
+ if (!ts) {
87
+ this.#logMissingDevelopmentDependency('typescript')
88
+ this.exitCode = 1
89
+ return
90
+ }
91
+
92
+ const assetsBundler = await detectAssetsBundler(this.app)
93
+ const bundler = new assembler.Bundler(this.app.appRoot, ts, {
94
+ assets: assetsBundler
95
+ ? {
96
+ serve: this.assets === false ? false : true,
97
+ driver: assetsBundler.name,
98
+ cmd: assetsBundler.buildCommand,
99
+ args: this.assetsArgs || [],
100
+ }
101
+ : {
102
+ serve: false,
103
+ },
104
+ metaFiles: this.app.rcFile.metaFiles,
105
+ })
106
+
107
+ /**
108
+ * Share command logger with assembler, so that CLI flags like --no-ansi has
109
+ * similar impact for assembler logs as well.
110
+ */
111
+ bundler.setLogger(this.logger)
112
+
113
+ /**
114
+ * Bundle project for production
115
+ */
116
+ const stopOnError = this.ignoreTsErrors === true ? false : true
117
+ const builtSuccessfully = await bundler.bundle(stopOnError, this.packageManager)
118
+ if (!builtSuccessfully) {
119
+ this.exitCode = 1
120
+ }
121
+ }
122
+ }