@adonisjs/core 5.9.0 → 6.0.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 (256) hide show
  1. package/README.md +6 -15
  2. package/build/commands/commands.json +1 -0
  3. package/build/commands/eject.d.ts +8 -0
  4. package/build/commands/eject.js +34 -0
  5. package/build/commands/{GenerateKey.d.ts → generate_key.d.ts} +3 -4
  6. package/build/commands/generate_key.js +47 -0
  7. package/build/commands/main.js +36 -0
  8. package/build/commands/make/_base.d.ts +6 -0
  9. package/build/commands/make/_base.js +19 -0
  10. package/build/commands/make/command.d.ts +8 -0
  11. package/build/commands/make/command.js +25 -0
  12. package/build/commands/make/controller.d.ts +12 -0
  13. package/build/commands/make/controller.js +57 -0
  14. package/build/commands/make/event.d.ts +8 -0
  15. package/build/commands/make/event.js +25 -0
  16. package/build/commands/make/listener.d.ts +10 -0
  17. package/build/commands/make/listener.js +48 -0
  18. package/build/commands/make/middleware.d.ts +8 -0
  19. package/build/commands/make/middleware.js +25 -0
  20. package/build/commands/make/provider.d.ts +8 -0
  21. package/build/commands/make/provider.js +25 -0
  22. package/build/index.d.ts +140 -0
  23. package/build/index.js +21 -0
  24. package/build/legacy/validator.d.ts +1 -0
  25. package/build/legacy/validator.js +1 -0
  26. package/build/modules/ace/commands.d.ts +26 -0
  27. package/build/modules/ace/commands.js +63 -0
  28. package/build/modules/ace/create_kernel.d.ts +3 -0
  29. package/build/modules/ace/create_kernel.js +33 -0
  30. package/build/modules/ace/kernel.d.ts +7 -0
  31. package/build/modules/ace/kernel.js +14 -0
  32. package/build/modules/ace/main.d.ts +3 -0
  33. package/build/modules/ace/main.js +3 -0
  34. package/build/modules/app.d.ts +1 -0
  35. package/build/modules/app.js +1 -0
  36. package/build/modules/bodyparser/bodyparser_middleware.d.ts +2 -0
  37. package/build/modules/bodyparser/bodyparser_middleware.js +2 -0
  38. package/build/modules/bodyparser/main.d.ts +1 -0
  39. package/build/modules/bodyparser/main.js +1 -0
  40. package/build/modules/config.d.ts +1 -0
  41. package/build/modules/config.js +1 -0
  42. package/build/modules/container.d.ts +1 -0
  43. package/build/modules/container.js +1 -0
  44. package/build/modules/encryption.d.ts +1 -0
  45. package/build/modules/encryption.js +1 -0
  46. package/build/modules/env.d.ts +1 -0
  47. package/build/modules/env.js +1 -0
  48. package/build/modules/events.d.ts +1 -0
  49. package/build/modules/events.js +1 -0
  50. package/build/modules/hash/define_config.d.ts +15 -0
  51. package/build/modules/hash/define_config.js +19 -0
  52. package/build/modules/hash/drivers_collection.d.ts +9 -0
  53. package/build/modules/hash/drivers_collection.js +22 -0
  54. package/build/modules/hash/main.d.ts +2 -0
  55. package/build/modules/hash/main.js +2 -0
  56. package/build/modules/http.d.ts +1 -0
  57. package/build/modules/http.js +1 -0
  58. package/build/modules/logger.d.ts +1 -0
  59. package/build/modules/logger.js +1 -0
  60. package/build/providers/app_provider.d.ts +16 -0
  61. package/build/providers/app_provider.js +74 -0
  62. package/build/providers/hash_provider.d.ts +9 -0
  63. package/build/providers/hash_provider.js +29 -0
  64. package/build/providers/http_provider.d.ts +9 -0
  65. package/build/providers/http_provider.js +36 -0
  66. package/build/services/ace.d.ts +3 -0
  67. package/build/services/ace.js +6 -0
  68. package/build/services/app.d.ts +4 -12
  69. package/build/services/app.js +5 -12
  70. package/build/services/config.d.ts +3 -3
  71. package/build/services/config.js +6 -12
  72. package/build/services/emitter.d.ts +3 -0
  73. package/build/services/emitter.js +7 -0
  74. package/build/services/encryption.d.ts +3 -3
  75. package/build/services/encryption.js +7 -12
  76. package/build/services/hash.d.ts +3 -3
  77. package/build/services/hash.js +7 -12
  78. package/build/services/logger.d.ts +3 -0
  79. package/build/services/logger.js +7 -0
  80. package/build/services/router.d.ts +3 -0
  81. package/build/services/router.js +7 -0
  82. package/build/services/server.d.ts +3 -0
  83. package/build/services/server.js +7 -0
  84. package/build/services/test_utils.d.ts +3 -0
  85. package/build/services/test_utils.js +6 -0
  86. package/build/src/debug.d.ts +3 -0
  87. package/build/src/debug.js +2 -0
  88. package/build/src/helpers/is.d.ts +2 -0
  89. package/build/src/helpers/is.js +2 -0
  90. package/build/src/helpers/main.d.ts +2 -0
  91. package/build/src/helpers/main.js +2 -0
  92. package/build/src/helpers/string.d.ts +17 -0
  93. package/build/src/helpers/string.js +26 -0
  94. package/build/src/helpers/string_builder.d.ts +23 -0
  95. package/build/src/helpers/string_builder.js +86 -0
  96. package/build/src/helpers/types.d.ts +24 -0
  97. package/build/src/helpers/types.js +29 -0
  98. package/build/src/ignitor/ace.d.ts +8 -0
  99. package/build/src/ignitor/ace.js +31 -0
  100. package/build/src/ignitor/http.d.ts +10 -0
  101. package/build/src/ignitor/http.js +62 -0
  102. package/build/src/ignitor/main.d.ts +17 -0
  103. package/build/src/ignitor/main.js +45 -0
  104. package/build/src/ignitor/test.d.ts +8 -0
  105. package/build/src/ignitor/test.js +18 -0
  106. package/build/src/test_utils/http.d.ts +10 -0
  107. package/build/src/test_utils/http.js +42 -0
  108. package/build/src/test_utils/main.d.ts +19 -0
  109. package/build/src/test_utils/main.js +33 -0
  110. package/build/src/types.d.ts +63 -0
  111. package/build/src/types.js +1 -0
  112. package/build/stubs/index.d.ts +1 -0
  113. package/build/stubs/index.js +2 -0
  114. package/build/stubs/make/command/main.stub +19 -0
  115. package/build/stubs/make/controller/api.stub +33 -0
  116. package/build/stubs/make/controller/main.stub +9 -0
  117. package/build/stubs/make/controller/resource.stub +43 -0
  118. package/build/stubs/make/event/main.stub +15 -0
  119. package/build/stubs/make/listener/for_event.stub +13 -0
  120. package/build/stubs/make/listener/main.stub +7 -0
  121. package/build/stubs/make/middleware/main.stub +22 -0
  122. package/build/stubs/make/provider/main.stub +35 -0
  123. package/build/types/ace.d.ts +5 -0
  124. package/build/types/ace.js +1 -0
  125. package/build/types/app.d.ts +1 -0
  126. package/build/types/app.js +1 -0
  127. package/build/types/bodyparser.d.ts +1 -0
  128. package/build/types/bodyparser.js +1 -0
  129. package/build/types/container.d.ts +1 -0
  130. package/build/types/container.js +1 -0
  131. package/build/types/encryption.d.ts +1 -0
  132. package/build/types/encryption.js +1 -0
  133. package/build/types/events.d.ts +1 -0
  134. package/build/types/events.js +1 -0
  135. package/build/types/hash.d.ts +1 -0
  136. package/build/types/hash.js +1 -0
  137. package/build/types/http.d.ts +1 -0
  138. package/build/types/http.js +1 -0
  139. package/build/types/logger.d.ts +1 -0
  140. package/build/types/logger.js +1 -0
  141. package/package.json +226 -245
  142. package/build/adonis-typings/ace.d.ts +0 -5
  143. package/build/adonis-typings/ace.js +0 -8
  144. package/build/adonis-typings/assets-manager.d.ts +0 -92
  145. package/build/adonis-typings/assets-manager.js +0 -8
  146. package/build/adonis-typings/container.d.ts +0 -14
  147. package/build/adonis-typings/container.js +0 -8
  148. package/build/adonis-typings/cors.d.ts +0 -15
  149. package/build/adonis-typings/cors.js +0 -8
  150. package/build/adonis-typings/exception-handler.d.ts +0 -31
  151. package/build/adonis-typings/exception-handler.js +0 -8
  152. package/build/adonis-typings/health-check.d.ts +0 -40
  153. package/build/adonis-typings/health-check.js +0 -8
  154. package/build/adonis-typings/index.d.ts +0 -17
  155. package/build/adonis-typings/index.js +0 -25
  156. package/build/adonis-typings/static.d.ts +0 -15
  157. package/build/adonis-typings/static.js +0 -8
  158. package/build/adonis-typings/test-utils.d.ts +0 -24
  159. package/build/adonis-typings/test-utils.js +0 -8
  160. package/build/adonis-typings/tests.d.ts +0 -13
  161. package/build/adonis-typings/tests.js +0 -11
  162. package/build/commands/DumpRc.d.ts +0 -13
  163. package/build/commands/DumpRc.js +0 -33
  164. package/build/commands/GenerateKey.js +0 -25
  165. package/build/commands/ListRoutes/Renderers/Base.d.ts +0 -31
  166. package/build/commands/ListRoutes/Renderers/Base.js +0 -70
  167. package/build/commands/ListRoutes/Renderers/PrettyRenderer.d.ts +0 -51
  168. package/build/commands/ListRoutes/Renderers/PrettyRenderer.js +0 -135
  169. package/build/commands/ListRoutes/Renderers/TableRenderer.d.ts +0 -36
  170. package/build/commands/ListRoutes/Renderers/TableRenderer.js +0 -137
  171. package/build/commands/ListRoutes/index.d.ts +0 -75
  172. package/build/commands/ListRoutes/index.js +0 -166
  173. package/build/commands/index.d.ts +0 -2
  174. package/build/commands/index.js +0 -15
  175. package/build/config.d.ts +0 -2
  176. package/build/config.js +0 -15
  177. package/build/instructions.js +0 -81
  178. package/build/providers/AppProvider.d.ts +0 -68
  179. package/build/providers/AppProvider.js +0 -201
  180. package/build/services/base.d.ts +0 -3
  181. package/build/services/base.js +0 -23
  182. package/build/services/bodyparser.d.ts +0 -2
  183. package/build/services/bodyparser.js +0 -12
  184. package/build/services/drive.d.ts +0 -3
  185. package/build/services/drive.js +0 -12
  186. package/build/services/event.d.ts +0 -3
  187. package/build/services/event.js +0 -12
  188. package/build/services/healthChecks.d.ts +0 -3
  189. package/build/services/healthChecks.js +0 -12
  190. package/build/services/httpContext.d.ts +0 -3
  191. package/build/services/httpContext.js +0 -12
  192. package/build/services/route.d.ts +0 -3
  193. package/build/services/route.js +0 -12
  194. package/build/services/validator.d.ts +0 -3
  195. package/build/services/validator.js +0 -12
  196. package/build/src/AssetsManager/Drivers/Base.d.ts +0 -27
  197. package/build/src/AssetsManager/Drivers/Base.js +0 -66
  198. package/build/src/AssetsManager/Drivers/Encore.d.ts +0 -58
  199. package/build/src/AssetsManager/Drivers/Encore.js +0 -93
  200. package/build/src/AssetsManager/Drivers/Fake.d.ts +0 -38
  201. package/build/src/AssetsManager/Drivers/Fake.js +0 -61
  202. package/build/src/AssetsManager/Drivers/Vite.d.ts +0 -84
  203. package/build/src/AssetsManager/Drivers/Vite.js +0 -139
  204. package/build/src/AssetsManager/index.d.ts +0 -87
  205. package/build/src/AssetsManager/index.js +0 -184
  206. package/build/src/Bindings/Repl.d.ts +0 -8
  207. package/build/src/Bindings/Repl.js +0 -90
  208. package/build/src/Bindings/Tests.d.ts +0 -7
  209. package/build/src/Bindings/Tests.js +0 -66
  210. package/build/src/HealthCheck/Checkers/AppKey.d.ts +0 -6
  211. package/build/src/HealthCheck/Checkers/AppKey.js +0 -60
  212. package/build/src/HealthCheck/Checkers/Env.d.ts +0 -6
  213. package/build/src/HealthCheck/Checkers/Env.js +0 -42
  214. package/build/src/HealthCheck/index.d.ts +0 -48
  215. package/build/src/HealthCheck/index.js +0 -99
  216. package/build/src/Hooks/Cors/index.d.ts +0 -70
  217. package/build/src/Hooks/Cors/index.js +0 -314
  218. package/build/src/Hooks/Static/index.d.ts +0 -18
  219. package/build/src/Hooks/Static/index.js +0 -66
  220. package/build/src/HttpExceptionHandler/index.d.ts +0 -82
  221. package/build/src/HttpExceptionHandler/index.js +0 -213
  222. package/build/src/Ignitor/Ace/App/index.d.ts +0 -60
  223. package/build/src/Ignitor/Ace/App/index.js +0 -236
  224. package/build/src/Ignitor/Ace/Exceptions/index.d.ts +0 -4
  225. package/build/src/Ignitor/Ace/Exceptions/index.js +0 -19
  226. package/build/src/Ignitor/Ace/GenerateManifest/index.d.ts +0 -28
  227. package/build/src/Ignitor/Ace/GenerateManifest/index.js +0 -75
  228. package/build/src/Ignitor/Ace/index.d.ts +0 -11
  229. package/build/src/Ignitor/Ace/index.js +0 -36
  230. package/build/src/Ignitor/HttpServer/index.d.ts +0 -56
  231. package/build/src/Ignitor/HttpServer/index.js +0 -127
  232. package/build/src/Ignitor/Kernel/index.d.ts +0 -56
  233. package/build/src/Ignitor/Kernel/index.js +0 -123
  234. package/build/src/Ignitor/SignalsListener/index.d.ts +0 -23
  235. package/build/src/Ignitor/SignalsListener/index.js +0 -66
  236. package/build/src/Ignitor/index.d.ts +0 -32
  237. package/build/src/Ignitor/index.js +0 -58
  238. package/build/src/TestUtils/HttpServer/index.d.ts +0 -27
  239. package/build/src/TestUtils/HttpServer/index.js +0 -56
  240. package/build/src/TestUtils/index.d.ts +0 -24
  241. package/build/src/TestUtils/index.js +0 -43
  242. package/build/src/utils/index.d.ts +0 -18
  243. package/build/src/utils/index.js +0 -82
  244. package/build/standalone.d.ts +0 -9
  245. package/build/standalone.js +0 -52
  246. package/build/templates/config/app.txt +0 -303
  247. package/build/templates/config/bodyparser.txt +0 -211
  248. package/build/templates/config/cors.txt +0 -134
  249. package/build/templates/config/drive.txt +0 -149
  250. package/build/templates/config/hash.txt +0 -96
  251. package/build/templates/config/static.txt +0 -89
  252. package/build/templates/contracts/drive.txt +0 -13
  253. package/build/templates/contracts/env.txt +0 -24
  254. package/build/templates/contracts/events.txt +0 -31
  255. package/build/templates/contracts/hash.txt +0 -13
  256. package/build/templates/env.txt +0 -31
@@ -1,201 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("../services/base");
12
- /**
13
- * The application provider that sticks all core components
14
- * to the container.
15
- */
16
- class AppProvider {
17
- constructor(app) {
18
- this.app = app;
19
- /**
20
- * Find if web or test environment
21
- */
22
- this.isWebOrTestEnvironment = ['web', 'test'].includes(this.app.environment);
23
- /**
24
- * Additional providers to load
25
- */
26
- this.provides = [
27
- '@adonisjs/encryption',
28
- '@adonisjs/events',
29
- '@adonisjs/drive',
30
- '@adonisjs/hash',
31
- '@adonisjs/http-server',
32
- '@adonisjs/bodyparser',
33
- '@adonisjs/validator',
34
- ];
35
- }
36
- /**
37
- * Register `HttpExceptionHandler` to the container.
38
- */
39
- registerHttpExceptionHandler() {
40
- this.app.container.bind('Adonis/Core/HttpExceptionHandler', () => {
41
- const { HttpExceptionHandler } = require('../src/HttpExceptionHandler');
42
- return HttpExceptionHandler;
43
- });
44
- }
45
- /**
46
- * Registering the health check provider
47
- */
48
- registerHealthCheck() {
49
- this.app.container.singleton('Adonis/Core/HealthCheck', () => {
50
- const { HealthCheck } = require('../src/HealthCheck');
51
- return new HealthCheck(this.app);
52
- });
53
- }
54
- /**
55
- * Registering the assets manager
56
- */
57
- registerAssetsManager() {
58
- this.app.container.singleton('Adonis/Core/AssetsManager', () => {
59
- const { AssetsManager } = require('../src/AssetsManager');
60
- const config = this.app.container.resolveBinding('Adonis/Core/Config').get('app.assets', {});
61
- return new AssetsManager(config, this.app);
62
- });
63
- }
64
- /**
65
- * Lazy initialize the cors hook, if enabled inside the config
66
- */
67
- registerCorsHook() {
68
- /**
69
- * Do not register hooks when not running in web
70
- * environment
71
- */
72
- if (!this.isWebOrTestEnvironment) {
73
- return;
74
- }
75
- /**
76
- * Register the cors before hook with the server
77
- */
78
- this.app.container.withBindings(['Adonis/Core/Config', 'Adonis/Core/Server'], (Config, Server) => {
79
- const config = Config.get('cors', {});
80
- if (!config.enabled) {
81
- return;
82
- }
83
- const { Cors } = require('../src/Hooks/Cors');
84
- const cors = new Cors(config);
85
- Server.hooks.before(cors.handle.bind(cors));
86
- });
87
- }
88
- /**
89
- * Lazy initialize the static assets hook, if enabled inside the config
90
- */
91
- registerStaticAssetsHook() {
92
- /**
93
- * Do not register hooks when not running in web
94
- * environment
95
- */
96
- if (!this.isWebOrTestEnvironment) {
97
- return;
98
- }
99
- /**
100
- * Register the cors before hook with the server
101
- */
102
- this.app.container.withBindings(['Adonis/Core/Config', 'Adonis/Core/Server', 'Adonis/Core/Application'], (Config, Server, Application) => {
103
- const config = Config.get('static', {});
104
- if (!config.enabled) {
105
- return;
106
- }
107
- const ServeStatic = require('../src/Hooks/Static').ServeStatic;
108
- const serveStatic = new ServeStatic(Application.publicPath(), config);
109
- Server.hooks.before(serveStatic.handle.bind(serveStatic));
110
- });
111
- }
112
- /**
113
- * Registers base health checkers
114
- */
115
- registerHealthCheckers() {
116
- /**
117
- * Do not register hooks when not running in web
118
- * environment
119
- */
120
- if (!this.isWebOrTestEnvironment) {
121
- return;
122
- }
123
- this.app.container.withBindings(['Adonis/Core/HealthCheck'], (healthCheck) => {
124
- require('../src/HealthCheck/Checkers/Env').default(healthCheck);
125
- require('../src/HealthCheck/Checkers/AppKey').default(healthCheck);
126
- });
127
- }
128
- /**
129
- * Register ace kernel to the container. When the process is started
130
- * by running an ace command, then the "Adonis/Core/Ace" binding
131
- * will already be in place and hence we do not overwrite it.
132
- */
133
- registerAceKernel() {
134
- if (!this.app.container.hasBinding('Adonis/Core/Ace')) {
135
- this.app.container.singleton('Adonis/Core/Ace', () => {
136
- const { Kernel } = require('@adonisjs/ace');
137
- return new Kernel(this.app);
138
- });
139
- }
140
- }
141
- /**
142
- * Register utilities object required during testing
143
- */
144
- registerTestUtils() {
145
- this.app.container.singleton('Adonis/Core/TestUtils', () => {
146
- const { TestUtils } = require('../src/TestUtils');
147
- return new TestUtils(this.app);
148
- });
149
- }
150
- /**
151
- * Define repl bindings
152
- */
153
- defineReplBindings() {
154
- /**
155
- * Do not register repl bindings when not running in "repl"
156
- * environment
157
- */
158
- if (this.app.environment !== 'repl') {
159
- return;
160
- }
161
- /**
162
- * Define REPL bindings
163
- */
164
- this.app.container.withBindings(['Adonis/Addons/Repl'], (Repl) => {
165
- const { defineReplBindings } = require('../src/Bindings/Repl');
166
- defineReplBindings(this.app, Repl);
167
- });
168
- }
169
- /**
170
- * Define bindings for japa tests
171
- */
172
- defineTestsBindings() {
173
- this.app.container.withBindings(['Japa/Preset/ApiRequest', 'Japa/Preset/ApiClient', 'Adonis/Core/CookieClient'], (ApiRequest, ApiClient, CookieClient) => {
174
- const { defineTestsBindings } = require('../src/Bindings/Tests');
175
- defineTestsBindings(ApiRequest, ApiClient, CookieClient);
176
- });
177
- }
178
- /**
179
- * Registering all required bindings to the container
180
- */
181
- register() {
182
- (0, base_1.setApp)(this.app);
183
- this.registerHttpExceptionHandler();
184
- this.registerHealthCheck();
185
- this.registerAssetsManager();
186
- this.registerAceKernel();
187
- this.registerTestUtils();
188
- }
189
- /**
190
- * Register hooks and health checkers on boot
191
- */
192
- boot() {
193
- this.registerCorsHook();
194
- this.registerStaticAssetsHook();
195
- this.registerHealthCheckers();
196
- this.defineReplBindings();
197
- this.defineTestsBindings();
198
- }
199
- }
200
- exports.default = AppProvider;
201
- AppProvider.needsApplication = true;
@@ -1,3 +0,0 @@
1
- import { ApplicationContract } from '@ioc:Adonis/Core/Application';
2
- export declare function setApp(app: ApplicationContract): void;
3
- export declare function getApp(): ApplicationContract;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.getApp = exports.setApp = void 0;
12
- let appInstance;
13
- function setApp(app) {
14
- appInstance = app;
15
- }
16
- exports.setApp = setApp;
17
- function getApp() {
18
- if (!appInstance) {
19
- throw new Error('Cannot get AdonisJS application instance. Make sure to boot the application');
20
- }
21
- return appInstance;
22
- }
23
- exports.getApp = getApp;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/BodyParser');
@@ -1,3 +0,0 @@
1
- /// <reference types="@adonisjs/drive/build/adonis-typings/drive" />
2
- declare const _default: import("@ioc:Adonis/Core/Drive").DriveManagerContract;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/Drive');
@@ -1,3 +0,0 @@
1
- /// <reference types="@adonisjs/events/build/adonis-typings/events" />
2
- declare const _default: import("@ioc:Adonis/Core/Event").EmitterContract;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/Event');
@@ -1,3 +0,0 @@
1
- /// <reference path="../adonis-typings/health-check.d.ts" />
2
- declare const _default: import("@ioc:Adonis/Core/HealthCheck").HealthCheckContract;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/HealthCheck');
@@ -1,3 +0,0 @@
1
- /// <reference types="@adonisjs/http-server/build/adonis-typings" />
2
- declare const _default: import("@ioc:Adonis/Core/HttpContext").HttpContextConstructorContract;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/HttpContext');
@@ -1,3 +0,0 @@
1
- /// <reference types="@adonisjs/http-server/build/adonis-typings" />
2
- declare const _default: import("@ioc:Adonis/Core/Route").RouterContract;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/Route');
@@ -1,3 +0,0 @@
1
- /// <reference types="@adonisjs/validator/build/adonis-typings/validator" />
2
- declare const _default: typeof import("@ioc:Adonis/Core/Validator");
3
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const base_1 = require("./base");
12
- exports.default = (0, base_1.getApp)().container.resolveBinding('Adonis/Core/Validator');
@@ -1,27 +0,0 @@
1
- import { ApplicationContract } from '@ioc:Adonis/Core/Application';
2
- export declare abstract class BaseDriver {
3
- protected application: ApplicationContract;
4
- /**
5
- * We cache the manifest contents and the entrypoints contents
6
- * in production
7
- */
8
- private manifestCache?;
9
- private entrypointsCache?;
10
- /**
11
- * Path to the output public dir. Defaults to `/public/assets`
12
- */
13
- publicPath: string;
14
- constructor(application: ApplicationContract);
15
- /**
16
- * Reads the file contents as JSON
17
- */
18
- protected readFileAsJSON(filePath: string): any;
19
- /**
20
- * Returns the manifest contents as object
21
- */
22
- manifest(): any;
23
- /**
24
- * Returns the entrypoints contents as object
25
- */
26
- entryPoints(): any;
27
- }
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseDriver = void 0;
4
- const fs_extra_1 = require("fs-extra");
5
- const path_1 = require("path");
6
- class BaseDriver {
7
- constructor(application) {
8
- this.application = application;
9
- /**
10
- * Path to the output public dir. Defaults to `/public/assets`
11
- */
12
- this.publicPath = this.application.publicPath('assets');
13
- }
14
- /**
15
- * Reads the file contents as JSON
16
- */
17
- readFileAsJSON(filePath) {
18
- if (!(0, fs_extra_1.pathExistsSync)(filePath)) {
19
- throw new Error(`Cannot find "${filePath}" file. Make sure you are compiling assets`);
20
- }
21
- return JSON.parse((0, fs_extra_1.readFileSync)(filePath, 'utf-8'));
22
- }
23
- /**
24
- * Returns the manifest contents as object
25
- */
26
- manifest() {
27
- /**
28
- * Use in-memory cache when exists
29
- */
30
- if (this.manifestCache) {
31
- this.application.logger.trace('reading manifest from cache');
32
- return this.manifestCache;
33
- }
34
- const manifest = this.readFileAsJSON((0, path_1.join)(this.publicPath, 'manifest.json'));
35
- this.application.logger.trace('reading manifest from %s', this.publicPath);
36
- /**
37
- * Cache manifest in production to avoid re-reading the file from disk
38
- */
39
- if (this.application.inProduction) {
40
- this.manifestCache = manifest;
41
- }
42
- return manifest;
43
- }
44
- /**
45
- * Returns the entrypoints contents as object
46
- */
47
- entryPoints() {
48
- /**
49
- * Use in-memory cache when exists
50
- */
51
- if (this.entrypointsCache) {
52
- this.application.logger.trace('reading entrypoints from cache');
53
- return this.entrypointsCache;
54
- }
55
- const entryPoints = this.readFileAsJSON((0, path_1.join)(this.publicPath, 'entrypoints.json'));
56
- this.application.logger.trace('reading entrypoints from %s', this.publicPath);
57
- /**
58
- * Cache entrypoints file in production to avoid re-reading the file from disk
59
- */
60
- if (this.application.inProduction) {
61
- this.entrypointsCache = entryPoints.entrypoints || {};
62
- }
63
- return entryPoints.entrypoints || {};
64
- }
65
- }
66
- exports.BaseDriver = BaseDriver;
@@ -1,58 +0,0 @@
1
- import { AssetsDriverContract } from '@ioc:Adonis/Core/AssetsManager';
2
- import { BaseDriver } from './Base';
3
- /**
4
- * Resolves entry points and assets path for webpack encore. Relies
5
- * on the "manifest.json" and "entrypoints.json" files.
6
- *
7
- **********************************************************************
8
- * The driver assumes following format for the manifest.json file
9
- **********************************************************************
10
- *
11
- * ```json
12
- * {
13
- * "assetName": "assetUrl"
14
- * }
15
- * ```
16
- **********************************************************************
17
- * The driver assumes following format for the entrypoints.json file
18
- ***********************************************************************
19
- *
20
- * ```json
21
- * {
22
- * "entrypoints": {
23
- * "entrypointName": {
24
- * "js": ["path1", "path2"],
25
- * "css": ["path1", "path2"]
26
- * }
27
- * }
28
- * }
29
- * ```
30
- */
31
- export declare class EncoreDriver extends BaseDriver implements AssetsDriverContract {
32
- name: string;
33
- /**
34
- * Encore driver has support for entrypoints
35
- */
36
- hasEntrypoints: boolean;
37
- /**
38
- * Attributes to apply to the script tag
39
- */
40
- scriptAttributes: Record<string, any>;
41
- /**
42
- * Returns the version of the assets by hashing the manifest file
43
- * contents
44
- */
45
- get version(): string;
46
- /**
47
- * Returns path to a given asset file
48
- */
49
- assetPath(name: string): string;
50
- /**
51
- * Returns list for all the javascript files for a given entry point
52
- */
53
- entryPointJsFiles(name: string): string[];
54
- /**
55
- * Returns list for all the css files for a given entry point
56
- */
57
- entryPointCssFiles(name: string): string[];
58
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EncoreDriver = void 0;
12
- const crypto_1 = require("crypto");
13
- const Base_1 = require("./Base");
14
- /**
15
- * Resolves entry points and assets path for webpack encore. Relies
16
- * on the "manifest.json" and "entrypoints.json" files.
17
- *
18
- **********************************************************************
19
- * The driver assumes following format for the manifest.json file
20
- **********************************************************************
21
- *
22
- * ```json
23
- * {
24
- * "assetName": "assetUrl"
25
- * }
26
- * ```
27
- **********************************************************************
28
- * The driver assumes following format for the entrypoints.json file
29
- ***********************************************************************
30
- *
31
- * ```json
32
- * {
33
- * "entrypoints": {
34
- * "entrypointName": {
35
- * "js": ["path1", "path2"],
36
- * "css": ["path1", "path2"]
37
- * }
38
- * }
39
- * }
40
- * ```
41
- */
42
- class EncoreDriver extends Base_1.BaseDriver {
43
- constructor() {
44
- super(...arguments);
45
- this.name = 'encore';
46
- /**
47
- * Encore driver has support for entrypoints
48
- */
49
- this.hasEntrypoints = true;
50
- /**
51
- * Attributes to apply to the script tag
52
- */
53
- this.scriptAttributes = {};
54
- }
55
- /**
56
- * Returns the version of the assets by hashing the manifest file
57
- * contents
58
- */
59
- get version() {
60
- return (0, crypto_1.createHash)('md5').update(JSON.stringify(this.manifest())).digest('hex').slice(0, 10);
61
- }
62
- /**
63
- * Returns path to a given asset file
64
- */
65
- assetPath(name) {
66
- const manifest = this.manifest();
67
- if (!manifest[name]) {
68
- throw new Error(`Cannot find path for "${name}" asset. Make sure you are compiling assets`);
69
- }
70
- return manifest[name];
71
- }
72
- /**
73
- * Returns list for all the javascript files for a given entry point
74
- */
75
- entryPointJsFiles(name) {
76
- const entrypoints = this.entryPoints();
77
- if (!entrypoints[name]) {
78
- throw new Error(`Cannot find assets for "${name}" entrypoint. Make sure you are compiling assets`);
79
- }
80
- return entrypoints[name].js || [];
81
- }
82
- /**
83
- * Returns list for all the css files for a given entry point
84
- */
85
- entryPointCssFiles(name) {
86
- const entrypoints = this.entryPoints();
87
- if (!entrypoints[name]) {
88
- throw new Error(`Cannot find assets for "${name}" entrypoint. Make sure you are compiling assets`);
89
- }
90
- return entrypoints[name].css || [];
91
- }
92
- }
93
- exports.EncoreDriver = EncoreDriver;
@@ -1,38 +0,0 @@
1
- import { ApplicationContract } from '@ioc:Adonis/Core/Application';
2
- import { AssetsDriverContract } from '@ioc:Adonis/Core/AssetsManager';
3
- /**
4
- * Fake driver stubs out the implementation of the Assets
5
- * manager with empty return data.
6
- *
7
- * The main use case is to make assets manager work during
8
- * testing without compiling the real assets
9
- */
10
- export declare class FakeDriver implements AssetsDriverContract {
11
- private application;
12
- name: string;
13
- hasEntrypoints: boolean;
14
- publicPath: string;
15
- scriptAttributes: Record<string, any>;
16
- get version(): string;
17
- constructor(application: ApplicationContract);
18
- /**
19
- * Returns the manifest contents as object
20
- */
21
- manifest(): {};
22
- /**
23
- * Returns path to a given asset file
24
- */
25
- assetPath(name: string): string;
26
- /**
27
- * Returns the entrypoints contents as object
28
- */
29
- entryPoints(): {};
30
- /**
31
- * Returns list for all the javascript files for a given entry point
32
- */
33
- entryPointJsFiles(_: string): string[];
34
- /**
35
- * Returns list for all the css files for a given entry point
36
- */
37
- entryPointCssFiles(_: string): string[];
38
- }