@adonisjs/core 7.0.0-next.2 → 7.0.0-next.21

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 (217) hide show
  1. package/build/ace-sWl9sgM1.js +16 -0
  2. package/build/app-B6oge7b3.js +5 -0
  3. package/build/app-DNvbxVWl.js +5 -0
  4. package/build/bodyparser_middleware-BmARtnYe.js +3 -0
  5. package/build/chunk-B88MteZI.js +26 -0
  6. package/build/commands/add.d.ts +4 -3
  7. package/build/commands/add.js +76 -110
  8. package/build/commands/build.js +51 -107
  9. package/build/commands/commands.json +1 -1
  10. package/build/commands/configure.js +82 -177
  11. package/build/commands/eject.js +17 -60
  12. package/build/commands/env/add.js +55 -134
  13. package/build/commands/generate_key.js +22 -66
  14. package/build/commands/inspect_rcfile.js +27 -55
  15. package/build/commands/list/routes.js +246 -116
  16. package/build/commands/make/command.js +15 -57
  17. package/build/commands/make/controller.js +43 -120
  18. package/build/commands/make/event.js +16 -62
  19. package/build/commands/make/exception.js +16 -62
  20. package/build/commands/make/listener.js +36 -93
  21. package/build/commands/make/middleware.js +41 -101
  22. package/build/commands/make/preload.js +47 -113
  23. package/build/commands/make/provider.js +47 -112
  24. package/build/commands/make/service.js +16 -55
  25. package/build/commands/make/test.js +47 -132
  26. package/build/commands/make/transformer.js +17 -64
  27. package/build/commands/make/validator.js +20 -80
  28. package/build/commands/make/view.js +15 -56
  29. package/build/commands/repl.js +17 -50
  30. package/build/commands/serve.js +80 -156
  31. package/build/commands/test.js +92 -208
  32. package/build/config-Dd2H6-_e.js +5 -0
  33. package/build/config_provider-DWVFHOQX.js +15 -0
  34. package/build/container-uxa8LpGI.js +5 -0
  35. package/build/core-BuPP8K6N.js +140 -0
  36. package/build/create_kernel-Cn8zVtvt.js +3 -0
  37. package/build/create_kernel-Cpqqa931.js +38 -0
  38. package/build/decorate-CJcHOoD-.js +7 -0
  39. package/build/define_config-CoWy5lbf.js +62 -0
  40. package/build/dumper-BTjb8j4y.js +147 -0
  41. package/build/edge-BVYR-Vjr.js +47 -0
  42. package/build/events-C4d0OPUI.js +5 -0
  43. package/build/exceptions-DNMesP42.js +2 -0
  44. package/build/factories/app.js +2 -9
  45. package/build/factories/bodyparser.js +2 -9
  46. package/build/factories/core/ace.js +16 -46
  47. package/build/factories/core/ignitor.js +13 -180
  48. package/build/factories/core/main.js +24 -11
  49. package/build/factories/core/test_utils.js +21 -43
  50. package/build/factories/encryption.d.ts +1 -1
  51. package/build/factories/encryption.js +2 -9
  52. package/build/factories/events.js +2 -9
  53. package/build/factories/hash.js +2 -9
  54. package/build/factories/http.js +2 -9
  55. package/build/factories/logger.js +2 -9
  56. package/build/factories/stubs.js +27 -91
  57. package/build/ignitor-BrmVPN5N.js +71 -0
  58. package/build/index.d.ts +1 -1
  59. package/build/index.js +12 -46
  60. package/build/logger-0KKSqgPG.js +13 -0
  61. package/build/main-BU8NWUEG.js +73 -0
  62. package/build/main-Bfnr5tAw.js +2 -0
  63. package/build/main-BlJhxJJ2.js +81 -0
  64. package/build/main-C4B2SPOT.js +5 -0
  65. package/build/main-CZZ21eXm.js +171 -0
  66. package/build/main-D-WhqOOn.js +51 -0
  67. package/build/main-DOY5Q8Av.js +5 -0
  68. package/build/main-kn40V-hF.js +2 -0
  69. package/build/main-nojlltNo.js +30 -0
  70. package/build/{stubs/make → make}/health/controller.stub +5 -2
  71. package/build/modules/ace/codemods.d.ts +109 -14
  72. package/build/modules/ace/codemods.js +222 -382
  73. package/build/modules/ace/main.d.ts +30 -0
  74. package/build/modules/ace/main.js +2 -11
  75. package/build/modules/app.d.ts +17 -0
  76. package/build/modules/app.js +4 -9
  77. package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
  78. package/build/modules/bodyparser/main.js +4 -9
  79. package/build/modules/config.d.ts +17 -0
  80. package/build/modules/config.js +4 -9
  81. package/build/modules/container.js +4 -9
  82. package/build/modules/dumper/dumper.d.ts +5 -0
  83. package/build/modules/dumper/main.d.ts +21 -0
  84. package/build/modules/dumper/main.js +6 -11
  85. package/build/modules/dumper/plugins/edge.js +2 -62
  86. package/build/modules/encryption/define_config.d.ts +128 -0
  87. package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
  88. package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
  89. package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
  90. package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
  91. package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
  92. package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
  93. package/build/modules/encryption/main.d.ts +85 -0
  94. package/build/modules/encryption/main.js +5 -0
  95. package/build/modules/env/editor.js +2 -9
  96. package/build/modules/env/main.d.ts +19 -0
  97. package/build/modules/env/main.js +2 -9
  98. package/build/modules/events.js +4 -9
  99. package/build/modules/hash/drivers/argon.js +2 -9
  100. package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
  101. package/build/modules/hash/drivers/bcrypt.js +2 -9
  102. package/build/modules/hash/drivers/scrypt.js +2 -9
  103. package/build/modules/hash/main.d.ts +18 -0
  104. package/build/modules/hash/main.js +5 -10
  105. package/build/modules/hash/phc_formatter.js +2 -9
  106. package/build/modules/health.js +2 -9
  107. package/build/modules/http/main.js +4 -15
  108. package/build/modules/http/request_validator.d.ts +1 -3
  109. package/build/modules/http/url_builder_client.d.ts +1 -0
  110. package/build/modules/http/url_builder_client.js +2 -0
  111. package/build/modules/logger.d.ts +30 -0
  112. package/build/modules/logger.js +4 -9
  113. package/build/modules/repl.js +4 -9
  114. package/build/modules/transformers/main.js +4 -9
  115. package/build/providers/app_provider.d.ts +14 -25
  116. package/build/providers/app_provider.js +155 -363
  117. package/build/providers/edge_provider.js +97 -114
  118. package/build/providers/hash_provider.js +28 -91
  119. package/build/providers/repl_provider.js +66 -152
  120. package/build/providers/vinejs_provider.d.ts +1 -1
  121. package/build/providers/vinejs_provider.js +19 -66
  122. package/build/repl-GSxgovJQ.js +5 -0
  123. package/build/services/ace.js +2 -17
  124. package/build/services/app.js +2 -21
  125. package/build/services/config.js +2 -13
  126. package/build/services/dumper.js +5 -21
  127. package/build/services/emitter.js +2 -14
  128. package/build/services/encryption.js +2 -14
  129. package/build/services/hash.js +2 -14
  130. package/build/services/logger.js +2 -14
  131. package/build/services/repl.js +2 -14
  132. package/build/services/router.js +2 -14
  133. package/build/services/server.js +2 -14
  134. package/build/services/test_utils.js +2 -17
  135. package/build/services/url_builder.d.ts +3 -3
  136. package/build/services/url_builder.js +5 -17
  137. package/build/src/assembler_hooks/index_entities.d.ts +29 -1
  138. package/build/src/debug.d.ts +1 -1
  139. package/build/src/exceptions.js +2 -49
  140. package/build/src/helpers/assert.js +2 -55
  141. package/build/src/helpers/http.d.ts +20 -0
  142. package/build/src/helpers/http.js +2 -0
  143. package/build/src/helpers/is.js +3 -31
  144. package/build/src/helpers/main.d.ts +1 -5
  145. package/build/src/helpers/main.js +5 -56
  146. package/build/src/helpers/string.js +2 -60
  147. package/build/src/helpers/types.js +26 -135
  148. package/build/src/helpers/verification_token.js +2 -120
  149. package/build/src/test_utils/main.js +8 -77
  150. package/build/src/types.d.ts +53 -99
  151. package/build/src/types.js +0 -8
  152. package/build/src/utils.d.ts +1 -1
  153. package/build/src/vine.js +2 -97
  154. package/build/string-Cx6q_win.js +28 -0
  155. package/build/test_utils-hkQDmNpX.js +10 -0
  156. package/build/toolkit/main.js +19 -21
  157. package/build/types/ace.js +2 -9
  158. package/build/types/app.js +2 -9
  159. package/build/types/bodyparser.js +2 -9
  160. package/build/types/common.js +2 -9
  161. package/build/types/container.js +2 -9
  162. package/build/types/encryption.d.ts +39 -1
  163. package/build/types/encryption.js +1 -9
  164. package/build/types/events.js +2 -9
  165. package/build/types/hash.js +2 -9
  166. package/build/types/health.js +2 -9
  167. package/build/types/helpers.d.ts +20 -0
  168. package/build/types/helpers.js +0 -8
  169. package/build/types/http.js +2 -9
  170. package/build/types/logger.js +2 -9
  171. package/build/types/repl.js +2 -9
  172. package/build/types/transformers.js +2 -9
  173. package/build/utils-CtGytdtt.js +42 -0
  174. package/build/verification_token-DrdoU4RH.js +46 -0
  175. package/build/vine-DGint2rk.js +32 -0
  176. package/package.json +113 -60
  177. package/build/modules/ace/commands.js +0 -157
  178. package/build/modules/ace/create_kernel.js +0 -91
  179. package/build/modules/ace/kernel.js +0 -40
  180. package/build/modules/dumper/define_config.js +0 -36
  181. package/build/modules/dumper/dumper.js +0 -256
  182. package/build/modules/dumper/errors.js +0 -119
  183. package/build/modules/encryption.d.ts +0 -1
  184. package/build/modules/encryption.js +0 -9
  185. package/build/modules/hash/define_config.js +0 -125
  186. package/build/modules/http/request_validator.js +0 -100
  187. package/build/src/assembler_hooks/index_entities.js +0 -107
  188. package/build/src/cli_formatters/routes_list.js +0 -381
  189. package/build/src/config_provider.js +0 -71
  190. package/build/src/debug.js +0 -25
  191. package/build/src/ignitor/ace.js +0 -102
  192. package/build/src/ignitor/http.js +0 -146
  193. package/build/src/ignitor/main.js +0 -124
  194. package/build/src/ignitor/test.js +0 -66
  195. package/build/src/test_utils/http.js +0 -82
  196. package/build/src/utils.js +0 -104
  197. package/build/stubs/main.js +0 -9
  198. package/build/toolkit/commands/index_commands.js +0 -30
  199. /package/build/{stubs/make → make}/command/main.stub +0 -0
  200. /package/build/{stubs/make → make}/controller/actions.stub +0 -0
  201. /package/build/{stubs/make → make}/controller/api.stub +0 -0
  202. /package/build/{stubs/make → make}/controller/main.stub +0 -0
  203. /package/build/{stubs/make → make}/controller/resource.stub +0 -0
  204. /package/build/{stubs/make → make}/event/main.stub +0 -0
  205. /package/build/{stubs/make → make}/exception/main.stub +0 -0
  206. /package/build/{stubs/make → make}/health/main.stub +0 -0
  207. /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
  208. /package/build/{stubs/make → make}/listener/main.stub +0 -0
  209. /package/build/{stubs/make → make}/middleware/main.stub +0 -0
  210. /package/build/{stubs/make → make}/preload/main.stub +0 -0
  211. /package/build/{stubs/make → make}/provider/main.stub +0 -0
  212. /package/build/{stubs/make → make}/service/main.stub +0 -0
  213. /package/build/{stubs/make → make}/test/main.stub +0 -0
  214. /package/build/{stubs/make → make}/transformer/main.stub +0 -0
  215. /package/build/{stubs/make → make}/validator/main.stub +0 -0
  216. /package/build/{stubs/make → make}/validator/resource.stub +0 -0
  217. /package/build/{stubs/make → make}/view/main.stub +0 -0
package/package.json CHANGED
@@ -1,24 +1,16 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "7.0.0-next.2",
4
+ "version": "7.0.0-next.21",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
8
8
  "main": "build/index.js",
9
9
  "type": "module",
10
10
  "files": [
11
- "build/modules",
12
- "build/commands",
13
- "build/providers",
14
- "build/services",
15
- "build/factories",
16
- "build/toolkit",
17
- "build/types",
18
- "build/src",
19
- "build/stubs",
20
- "build/index.d.ts",
21
- "build/index.js"
11
+ "build",
12
+ "!build/bin",
13
+ "!build/tests"
22
14
  ],
23
15
  "bin": {
24
16
  "adonis-kit": "./build/toolkit/main.js"
@@ -47,13 +39,17 @@
47
39
  "./app": "./build/modules/app.js",
48
40
  "./config": "./build/modules/config.js",
49
41
  "./container": "./build/modules/container.js",
50
- "./encryption": "./build/modules/encryption.js",
42
+ "./encryption": "./build/modules/encryption/main.js",
43
+ "./encryption/drivers/aes_256_cbc": "./build/modules/encryption/drivers/aes_256_cbc.js",
44
+ "./encryption/drivers/aes_256_gcm": "./build/modules/encryption/drivers/aes_256_gcm.js",
45
+ "./encryption/drivers/chacha20_poly1305": "./build/modules/encryption/drivers/chacha20_poly1305.js",
51
46
  "./env": "./build/modules/env/main.js",
52
47
  "./dumper": "./build/modules/dumper/main.js",
53
48
  "./dumper/plugin_edge": "./build/modules/dumper/plugins/edge.js",
54
49
  "./env/editor": "./build/modules/env/editor.js",
55
50
  "./events": "./build/modules/events.js",
56
51
  "./http": "./build/modules/http/main.js",
52
+ "./http/url_builder_client": "./build/modules/http/url_builder_client.js",
57
53
  "./logger": "./build/modules/logger.js",
58
54
  "./repl": "./build/modules/repl.js",
59
55
  "./transformers": "./build/modules/transformers/main.js",
@@ -67,9 +63,9 @@
67
63
  "pretest": "npm run lint",
68
64
  "test": "cross-env NODE_DEBUG=adonisjs:core c8 npm run quick:test",
69
65
  "clean": "del-cli build",
70
- "copy:templates": "copyfiles \"stubs/**/**/*.stub\" build",
66
+ "copy:templates": "copyfiles \"stubs/**/**/*.stub\" --up=1 build",
71
67
  "precompile": "npm run lint",
72
- "compile": "npm run clean && tsc",
68
+ "compile": "npm run clean && tsdown && tsc --emitDeclarationOnly --declaration",
73
69
  "postcompile": "npm run copy:templates && npm run index:commands",
74
70
  "build": "npm run compile",
75
71
  "docs": "typedoc",
@@ -84,63 +80,65 @@
84
80
  "index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
85
81
  },
86
82
  "devDependencies": {
87
- "@adonisjs/assembler": "^8.0.0-next.10",
88
- "@adonisjs/eslint-config": "^3.0.0-next.1",
83
+ "@adonisjs/assembler": "^8.0.0-next.29",
84
+ "@adonisjs/eslint-config": "^3.0.0-next.9",
89
85
  "@adonisjs/prettier-config": "^1.4.5",
90
- "@adonisjs/tsconfig": "^2.0.0-next.0",
91
- "@japa/assert": "^4.1.1",
92
- "@japa/expect-type": "^2.0.3",
93
- "@japa/file-system": "^2.3.2",
94
- "@japa/runner": "^4.4.0",
95
- "@japa/snapshot": "^2.0.9",
86
+ "@adonisjs/tsconfig": "^2.0.0-next.3",
87
+ "@japa/assert": "^4.2.0",
88
+ "@japa/expect-type": "^2.0.4",
89
+ "@japa/file-system": "^3.0.0",
90
+ "@japa/runner": "^5.0.0",
91
+ "@japa/snapshot": "^2.0.10",
96
92
  "@poppinss/ts-exec": "^1.4.1",
97
- "@release-it/conventional-changelog": "^10.0.1",
98
- "@types/node": "^24.5.2",
93
+ "@release-it/conventional-changelog": "^10.0.4",
94
+ "@types/node": "^25.0.3",
99
95
  "@types/pretty-hrtime": "^1.0.3",
100
- "@types/sinon": "^17.0.4",
96
+ "@types/sinon": "^21.0.0",
101
97
  "@types/supertest": "^6.0.3",
102
98
  "@types/test-console": "^2.0.3",
103
- "@vinejs/vine": "^3.0.1",
99
+ "@vinejs/vine": "^4.2.0",
104
100
  "argon2": "^0.44.0",
105
101
  "bcrypt": "^6.0.0",
106
102
  "c8": "^10.1.3",
107
103
  "copyfiles": "^2.4.1",
108
- "cross-env": "^10.0.0",
104
+ "cross-env": "^10.1.0",
109
105
  "del-cli": "^7.0.0",
110
- "edge.js": "^6.3.0",
111
- "eslint": "^9.35.0",
112
- "execa": "^9.6.0",
106
+ "edge.js": "^6.4.0",
107
+ "eslint": "^9.39.2",
108
+ "execa": "^9.6.1",
113
109
  "get-port": "^7.1.0",
114
- "prettier": "^3.6.2",
115
- "release-it": "^19.0.5",
116
- "sinon": "^21.0.0",
117
- "supertest": "^7.1.4",
110
+ "pino-pretty": "^13.1.3",
111
+ "prettier": "^3.7.4",
112
+ "release-it": "^19.2.3",
113
+ "sinon": "^21.0.1",
114
+ "supertest": "^7.2.2",
118
115
  "test-console": "^2.0.0",
119
116
  "timekeeper": "^2.3.1",
120
- "typedoc": "^0.28.13",
121
- "typescript": "^5.9.2",
122
- "youch": "^4.1.0-beta.11"
117
+ "tsdown": "^0.18.4",
118
+ "typedoc": "^0.28.15",
119
+ "typescript": "^5.9.3",
120
+ "youch": "^4.1.0-beta.13"
123
121
  },
124
122
  "dependencies": {
125
- "@adonisjs/ace": "^14.0.1-next.1",
126
- "@adonisjs/application": "^9.0.0-next.9",
127
- "@adonisjs/bodyparser": "^11.0.0-next.1",
128
- "@adonisjs/config": "^6.0.0-next.1",
129
- "@adonisjs/encryption": "^7.0.0-next.1",
130
- "@adonisjs/env": "^7.0.0-next.1",
131
- "@adonisjs/events": "^10.1.0-next.2",
132
- "@adonisjs/fold": "^11.0.0-next.2",
133
- "@adonisjs/hash": "^10.0.0-next.1",
134
- "@adonisjs/health": "^3.0.0-next.0",
135
- "@adonisjs/http-server": "^8.0.0-next.7",
136
- "@adonisjs/http-transformers": "^1.4.0",
137
- "@adonisjs/logger": "^7.1.0-next.0",
138
- "@adonisjs/repl": "^5.0.0-next.0",
139
- "@poppinss/colors": "^4.1.5",
140
- "@poppinss/dumper": "^0.6.4",
123
+ "@adonisjs/ace": "^14.0.1-next.4",
124
+ "@adonisjs/application": "^9.0.0-next.14",
125
+ "@adonisjs/bodyparser": "^11.0.0-next.6",
126
+ "@adonisjs/config": "^6.1.0-next.0",
127
+ "@adonisjs/env": "^7.0.0-next.3",
128
+ "@adonisjs/events": "^10.1.0-next.4",
129
+ "@adonisjs/fold": "^11.0.0-next.4",
130
+ "@adonisjs/hash": "^10.0.0-next.2",
131
+ "@adonisjs/health": "^3.1.0-next.1",
132
+ "@adonisjs/http-server": "^8.0.0-next.17",
133
+ "@adonisjs/http-transformers": "^1.6.2",
134
+ "@adonisjs/logger": "^7.1.0-next.3",
135
+ "@adonisjs/repl": "^5.0.0-next.1",
136
+ "@boringnode/encryption": "^0.2.4",
137
+ "@poppinss/colors": "^4.1.6",
138
+ "@poppinss/dumper": "^0.7.0",
141
139
  "@poppinss/macroable": "^1.1.0",
142
- "@poppinss/utils": "^7.0.0-next.3",
143
- "@sindresorhus/is": "^7.1.0",
140
+ "@poppinss/utils": "^7.0.0-next.5",
141
+ "@sindresorhus/is": "^7.2.0",
144
142
  "@types/he": "^1.2.3",
145
143
  "error-stack-parser-es": "^1.0.5",
146
144
  "he": "^1.2.0",
@@ -148,12 +146,13 @@
148
146
  "string-width": "^8.1.0"
149
147
  },
150
148
  "peerDependencies": {
151
- "@adonisjs/assembler": "^8.0.0-next.10",
152
- "@vinejs/vine": "^3.0.0",
153
- "argon2": "^0.43.0",
149
+ "@adonisjs/assembler": "^8.0.0-next.23",
150
+ "@vinejs/vine": "^4.0.0",
151
+ "argon2": "^0.44.0",
154
152
  "bcrypt": "^6.0.0",
155
153
  "edge.js": "^6.2.0",
156
- "youch": "^4.1.0-beta.11"
154
+ "pino-pretty": "^13.1.3",
155
+ "youch": "^4.1.0-beta.13"
157
156
  },
158
157
  "peerDependenciesMeta": {
159
158
  "argon2": {
@@ -173,6 +172,9 @@
173
172
  },
174
173
  "youch": {
175
174
  "optional": true
175
+ },
176
+ "pino-pretty": {
177
+ "optional": true
176
178
  }
177
179
  },
178
180
  "homepage": "https://github.com/adonisjs/core#readme",
@@ -216,6 +218,57 @@
216
218
  "@commitlint/config-conventional"
217
219
  ]
218
220
  },
221
+ "tsdown": {
222
+ "entry": [
223
+ "index.ts",
224
+ "commands/main.ts",
225
+ "commands/**/*.ts",
226
+ "factories/core/main.ts",
227
+ "factories/**/*.ts",
228
+ "src/types.ts",
229
+ "toolkit/main.ts",
230
+ "types/**/*.ts",
231
+ "services/**/*.ts",
232
+ "providers/**/*.ts",
233
+ "src/helpers/main.ts",
234
+ "src/helpers/**/*.ts",
235
+ "modules/ace/main.ts",
236
+ "modules/ace/codemods.ts",
237
+ "modules/bodyparser/main.ts",
238
+ "modules/bodyparser/bodyparser_middleware.ts",
239
+ "modules/hash/main.ts",
240
+ "modules/hash/phc_formatter.ts",
241
+ "modules/hash/drivers/*.ts",
242
+ "modules/app.ts",
243
+ "modules/config.ts",
244
+ "modules/container.ts",
245
+ "modules/encryption/main.ts",
246
+ "modules/encryption/drivers/*.ts",
247
+ "modules/env/main.ts",
248
+ "modules/dumper/main.ts",
249
+ "modules/dumper/plugins/edge.ts",
250
+ "modules/env/editor.ts",
251
+ "modules/events.ts",
252
+ "modules/http/main.ts",
253
+ "modules/http/url_builder_client.ts",
254
+ "modules/logger.ts",
255
+ "modules/repl.ts",
256
+ "modules/transformers/main.ts",
257
+ "src/exceptions.ts",
258
+ "src/test_utils/main.ts",
259
+ "modules/health.ts",
260
+ "src/vine.ts"
261
+ ],
262
+ "outDir": "./build",
263
+ "clean": true,
264
+ "format": "esm",
265
+ "minify": "dce-only",
266
+ "fixedExtension": false,
267
+ "dts": false,
268
+ "treeshake": false,
269
+ "sourcemaps": false,
270
+ "target": "esnext"
271
+ },
219
272
  "release-it": {
220
273
  "git": {
221
274
  "requireCleanWorkingDir": true,
@@ -1,157 +0,0 @@
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
- import { BaseCommand as AceBaseCommand, ListCommand as AceListCommand } from '@adonisjs/ace';
10
- /**
11
- * The base command class for creating custom Ace commands in AdonisJS applications.
12
- * This class extends the base Ace command with AdonisJS-specific functionality like
13
- * dependency injection and application lifecycle management.
14
- *
15
- * @example
16
- * ```ts
17
- * export default class MakeUser extends BaseCommand {
18
- * static commandName = 'make:user'
19
- * static description = 'Create a new user'
20
- *
21
- * async run() {
22
- * this.logger.info('Creating user...')
23
- * // Command implementation
24
- * }
25
- * }
26
- * ```
27
- */
28
- export class BaseCommand extends AceBaseCommand {
29
- app;
30
- kernel;
31
- static options = {};
32
- get staysAlive() {
33
- return this.constructor.options.staysAlive;
34
- }
35
- get startApp() {
36
- return this.constructor.options.startApp;
37
- }
38
- constructor(app, kernel, parsed, ui, prompt) {
39
- super(kernel, parsed, ui, prompt);
40
- this.app = app;
41
- this.kernel = kernel;
42
- }
43
- /**
44
- * Creates the codemods module to modify source files programmatically.
45
- * This method provides access to AST-based code transformations.
46
- *
47
- * @example
48
- * ```ts
49
- * const codemods = await this.createCodemods()
50
- * await codemods.makeUsingStub(stubsRoot, 'controller.stub', {
51
- * filename: 'UserController',
52
- * entity: { name: 'User' }
53
- * })
54
- * ```
55
- */
56
- async createCodemods() {
57
- const { Codemods } = await import('./codemods.js');
58
- const codemods = new Codemods(this.app, this.logger);
59
- codemods.on('error', () => {
60
- this.exitCode = 1;
61
- });
62
- return codemods;
63
- }
64
- /**
65
- * Executes the lifecycle hooks and the run method from the command
66
- */
67
- async exec() {
68
- this.hydrate();
69
- try {
70
- /**
71
- * Executing the template methods
72
- */
73
- this.prepare && (await this.app.container.call(this, 'prepare'));
74
- this.interact && (await this.app.container.call(this, 'interact'));
75
- const result = await this.app.container.call(this, 'run');
76
- /**
77
- * Set exit code
78
- */
79
- this.result = this.result === undefined ? result : this.result;
80
- this.exitCode = this.exitCode ?? 0;
81
- }
82
- catch (error) {
83
- this.error = error;
84
- this.exitCode = this.exitCode ?? 1;
85
- }
86
- /**
87
- * Run the completed method (if exists) and check if has handled
88
- * the error
89
- */
90
- let errorHandled = this.completed
91
- ? await this.app.container.call(this, 'completed')
92
- : false;
93
- if (this.error && !errorHandled) {
94
- await this.kernel.errorHandler.render(this.error, this.kernel);
95
- }
96
- return this.result;
97
- }
98
- /**
99
- * Terminate the application gracefully. This method should be preferred over
100
- * calling `app.terminate()` directly as it only triggers termination when
101
- * the current command is the main command responsible for the process.
102
- *
103
- * @example
104
- * ```ts
105
- * export default class SomeCommand extends BaseCommand {
106
- * async run() {
107
- * // Do some work
108
- * await this.terminate()
109
- * }
110
- * }
111
- * ```
112
- */
113
- async terminate() {
114
- if (this.kernel.getMainCommand() === this) {
115
- await this.app.terminate();
116
- }
117
- }
118
- }
119
- /**
120
- * The List command is used to display a list of available commands.
121
- * This command extends the base Ace ListCommand with AdonisJS-specific functionality.
122
- */
123
- export class ListCommand extends AceListCommand {
124
- app;
125
- kernel;
126
- static options = {};
127
- get staysAlive() {
128
- return this.constructor.options.staysAlive;
129
- }
130
- get startApp() {
131
- return this.constructor.options.startApp;
132
- }
133
- constructor(app, kernel, parsed, ui, prompt) {
134
- super(kernel, parsed, ui, prompt);
135
- this.app = app;
136
- this.kernel = kernel;
137
- }
138
- /**
139
- * Creates the codemods module to modify source files programmatically.
140
- * This method provides access to AST-based code transformations.
141
- */
142
- async createCodemods() {
143
- const { Codemods } = await import('./codemods.js');
144
- return new Codemods(this.app, this.logger);
145
- }
146
- /**
147
- * Terminate the app. A command should prefer calling this method
148
- * over the "app.terminate", because this method only triggers
149
- * app termination when the current command is in the charge
150
- * of the process.
151
- */
152
- async terminate() {
153
- if (this.kernel.getMainCommand() === this) {
154
- await this.app.terminate();
155
- }
156
- }
157
- }
@@ -1,91 +0,0 @@
1
- /*
2
- * @adonisjs/ace
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
- import { Kernel } from "./main.js";
10
- import { FsLoader, HelpCommand } from "../../modules/ace/main.js";
11
- /**
12
- * Create and configure an Ace command kernel for AdonisJS applications.
13
- * This function abstracts the kernel setup logic and can be used in different
14
- * environments with appropriate configurations.
15
- *
16
- * - In console environment, Ace manages the lifecycle of the process
17
- * - In other environments, Ace can be pulled from the container to run commands
18
- *
19
- * @param app - The AdonisJS application service instance
20
- * @param commandName - Optional specific command name for optimized loading
21
- *
22
- * @example
23
- * ```ts
24
- * const app = new Application(new URL('../', import.meta.url))
25
- * const kernel = createAceKernel(app)
26
- *
27
- * // Run a specific command
28
- * await kernel.handle(['make:controller', 'UserController'])
29
- * ```
30
- */
31
- export function createAceKernel(app, commandName) {
32
- const kernel = new Kernel(app);
33
- kernel.info.set('binary', 'node ace');
34
- /**
35
- * Lazy import commands mentioned in the "commands" array
36
- * of rcFile
37
- */
38
- app.rcFile.commands.forEach((commandModule) => {
39
- kernel.addLoader(() => typeof commandModule === 'function' ? commandModule() : app.import(commandModule));
40
- });
41
- /**
42
- * When we know the command we are running ahead of time, then we
43
- * defer loading the application commands if the command has
44
- * already been registered by other loaders.
45
- */
46
- const fsLoader = new FsLoader(app.commandsPath());
47
- kernel.addLoader({
48
- async getMetaData() {
49
- if (!commandName || !kernel.getCommand(commandName)) {
50
- return fsLoader.getMetaData();
51
- }
52
- return [];
53
- },
54
- getCommand(command) {
55
- return fsLoader.getCommand(command);
56
- },
57
- });
58
- /**
59
- * Custom global flags
60
- */
61
- kernel.defineFlag('ansi', {
62
- type: 'boolean',
63
- showNegatedVariantInHelp: true,
64
- description: 'Force enable or disable colorful output',
65
- });
66
- kernel.defineFlag('help', {
67
- type: 'boolean',
68
- description: HelpCommand.description,
69
- });
70
- /**
71
- * Flag listener to turn colors on/off
72
- */
73
- kernel.on('ansi', (_, $kernel, parsed) => {
74
- if (parsed.flags.ansi === false) {
75
- $kernel.ui.switchMode('silent');
76
- }
77
- if (parsed.flags.ansi === true) {
78
- $kernel.ui.switchMode('normal');
79
- }
80
- });
81
- /**
82
- * Flag listener to display the help
83
- */
84
- kernel.on('help', async (command, $kernel, parsed) => {
85
- parsed.args.unshift(command.commandName);
86
- const help = new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt);
87
- await help.exec();
88
- return $kernel.shortcircuit();
89
- });
90
- return kernel;
91
- }
@@ -1,40 +0,0 @@
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
- import { Kernel as AceKernel } from '@adonisjs/ace';
10
- import { ListCommand } from "./commands.js";
11
- /**
12
- * The Ace command kernel for AdonisJS applications. This kernel extends the base
13
- * Ace kernel with AdonisJS-specific functionality like dependency injection and
14
- * application lifecycle management.
15
- *
16
- * @example
17
- * ```ts
18
- * const app = new Application(new URL('../', import.meta.url))
19
- * const kernel = new Kernel(app)
20
- *
21
- * await kernel.handle(['make:controller', 'UserController'])
22
- * ```
23
- */
24
- export class Kernel extends AceKernel {
25
- app;
26
- /**
27
- * Create a new Ace kernel instance
28
- *
29
- * @param app - The AdonisJS application instance
30
- */
31
- constructor(app) {
32
- super(ListCommand, {
33
- create: async (command, parsedOutput, $kernel) => {
34
- return app.container.make(command, [app, $kernel, parsedOutput, $kernel.ui, $kernel.prompt]);
35
- },
36
- run: (command) => command.exec(),
37
- });
38
- this.app = app;
39
- }
40
- }
@@ -1,36 +0,0 @@
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
- * Define configuration for the dumper service exported by the
11
- * "@adonisjs/core/services/dumper" module. This function allows
12
- * you to customize HTML and console output formatting options.
13
- *
14
- * @param dumperConfig - Configuration object with HTML and console options
15
- * @param dumperConfig.html - HTML output formatting configuration
16
- * @param dumperConfig.console - Console output formatting configuration
17
- *
18
- * @example
19
- * ```ts
20
- * export default defineConfig({
21
- * html: {
22
- * showHidden: true,
23
- * depth: 5,
24
- * colors: true
25
- * },
26
- * console: {
27
- * showHidden: false,
28
- * depth: 3,
29
- * collapse: ['Date', 'DateTime']
30
- * }
31
- * })
32
- * ```
33
- */
34
- export function defineConfig(dumperConfig) {
35
- return dumperConfig;
36
- }