@h3ravel/core 0.4.0 → 1.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.
package/dist/index.cjs CHANGED
@@ -6,6 +6,9 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ };
9
12
  var __export = (target, all) => {
10
13
  for (var name in all)
11
14
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -28,372 +31,488 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
31
  ));
29
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
33
 
31
- // src/index.ts
32
- var src_exports = {};
33
- __export(src_exports, {
34
- AppServiceProvider: () => AppServiceProvider,
35
- Application: () => Application,
36
- Container: () => Container,
37
- Controller: () => Controller,
38
- Kernel: () => Kernel,
39
- PathLoader: () => PathLoader,
40
- ServiceProvider: () => ServiceProvider,
41
- ViewServiceProvider: () => ViewServiceProvider
42
- });
43
- module.exports = __toCommonJS(src_exports);
44
-
45
34
  // src/Container.ts
46
- var Container = class {
47
- static {
48
- __name(this, "Container");
49
- }
50
- bindings = /* @__PURE__ */ new Map();
51
- singletons = /* @__PURE__ */ new Map();
52
- bind(key, factory) {
53
- this.bindings.set(key, factory);
54
- }
55
- /**
56
- * Bind a singleton service to the container
57
- */
58
- singleton(key, factory) {
59
- this.bindings.set(key, () => {
60
- if (!this.singletons.has(key)) {
61
- this.singletons.set(key, factory());
62
- }
63
- return this.singletons.get(key);
64
- });
65
- }
66
- /**
67
- * Resolve a service from the container
68
- */
69
- make(key) {
70
- if (this.bindings.has(key)) {
71
- return this.bindings.get(key)();
72
- }
73
- if (typeof key === "function") {
74
- return this.build(key);
75
- }
76
- throw new Error(`No binding found for key: ${typeof key === "string" ? key : key?.name}`);
77
- }
78
- /**
79
- * Automatically build a class with constructor dependency injection
80
- */
81
- build(ClassType) {
82
- const paramTypes = Reflect.getMetadata("design:paramtypes", ClassType) || [];
83
- const dependencies = paramTypes.map((dep) => this.make(dep));
84
- return new ClassType(...dependencies);
85
- }
86
- /**
87
- * Check if a service is registered
88
- */
89
- has(key) {
90
- return this.bindings.has(key);
35
+ var Container;
36
+ var init_Container = __esm({
37
+ "src/Container.ts"() {
38
+ "use strict";
39
+ Container = class {
40
+ static {
41
+ __name(this, "Container");
42
+ }
43
+ bindings = /* @__PURE__ */ new Map();
44
+ singletons = /* @__PURE__ */ new Map();
45
+ bind(key, factory) {
46
+ this.bindings.set(key, factory);
47
+ }
48
+ /**
49
+ * Bind a singleton service to the container
50
+ */
51
+ singleton(key, factory) {
52
+ this.bindings.set(key, () => {
53
+ if (!this.singletons.has(key)) {
54
+ this.singletons.set(key, factory());
55
+ }
56
+ return this.singletons.get(key);
57
+ });
58
+ }
59
+ /**
60
+ * Resolve a service from the container
61
+ */
62
+ make(key) {
63
+ if (this.bindings.has(key)) {
64
+ return this.bindings.get(key)();
65
+ }
66
+ if (typeof key === "function") {
67
+ return this.build(key);
68
+ }
69
+ throw new Error(`No binding found for key: ${typeof key === "string" ? key : key?.name}`);
70
+ }
71
+ /**
72
+ * Automatically build a class with constructor dependency injection
73
+ */
74
+ build(ClassType) {
75
+ const paramTypes = Reflect.getMetadata("design:paramtypes", ClassType) || [];
76
+ const dependencies = paramTypes.map((dep) => this.make(dep));
77
+ return new ClassType(...dependencies);
78
+ }
79
+ /**
80
+ * Check if a service is registered
81
+ */
82
+ has(key) {
83
+ return this.bindings.has(key);
84
+ }
85
+ };
91
86
  }
92
- };
87
+ });
93
88
 
94
89
  // src/Utils/PathLoader.ts
95
- var import_path = __toESM(require("path"), 1);
96
- var PathLoader = class {
97
- static {
98
- __name(this, "PathLoader");
99
- }
100
- paths = {
101
- base: "",
102
- views: "/src/resources/views",
103
- assets: "/public/assets",
104
- routes: "/src/routes",
105
- config: "/src/config",
106
- public: "/public",
107
- storage: "/storage"
108
- };
109
- /**
110
- * Dynamically retrieves a path property from the class.
111
- * Any property ending with "Path" is accessible automatically.
112
- *
113
- * @param name - The base name of the path property
114
- * @param base - The base path to include to the path
115
- * @returns
116
- */
117
- getPath(name, base) {
118
- if (base && name !== "base") {
119
- return import_path.default.join(base, this.paths[name]);
120
- }
121
- return this.paths[name];
122
- }
123
- /**
124
- * Programatically set the paths.
125
- *
126
- * @param name - The base name of the path property
127
- * @param path - The new path
128
- * @param base - The base path to include to the path
129
- */
130
- setPath(name, path2, base) {
131
- if (base && name !== "base") {
132
- this.paths[name] = import_path.default.join(base, path2);
133
- }
134
- this.paths[name] = path2;
90
+ var import_path, PathLoader;
91
+ var init_PathLoader = __esm({
92
+ "src/Utils/PathLoader.ts"() {
93
+ "use strict";
94
+ import_path = __toESM(require("path"), 1);
95
+ PathLoader = class {
96
+ static {
97
+ __name(this, "PathLoader");
98
+ }
99
+ paths = {
100
+ base: "",
101
+ views: "/src/resources/views",
102
+ assets: "/public/assets",
103
+ routes: "/src/routes",
104
+ config: "/src/config",
105
+ public: "/public",
106
+ storage: "/storage"
107
+ };
108
+ /**
109
+ * Dynamically retrieves a path property from the class.
110
+ * Any property ending with "Path" is accessible automatically.
111
+ *
112
+ * @param name - The base name of the path property
113
+ * @param base - The base path to include to the path
114
+ * @returns
115
+ */
116
+ getPath(name, base) {
117
+ if (base && name !== "base") {
118
+ return import_path.default.join(base, this.paths[name]);
119
+ }
120
+ return this.paths[name];
121
+ }
122
+ /**
123
+ * Programatically set the paths.
124
+ *
125
+ * @param name - The base name of the path property
126
+ * @param path - The new path
127
+ * @param base - The base path to include to the path
128
+ */
129
+ setPath(name, path2, base) {
130
+ if (base && name !== "base") {
131
+ this.paths[name] = import_path.default.join(base, path2);
132
+ }
133
+ this.paths[name] = path2;
134
+ }
135
+ };
135
136
  }
136
- };
137
+ });
137
138
 
138
139
  // src/Application.ts
139
- var import_node_path = __toESM(require("path"), 1);
140
- var Application = class _Application extends Container {
141
- static {
142
- __name(this, "Application");
143
- }
144
- paths = new PathLoader();
145
- booted = false;
146
- versions = {
147
- app: "0",
148
- ts: "0"
149
- };
150
- basePath;
151
- providers = [];
152
- externalProviders = [];
153
- constructor(basePath) {
154
- super();
155
- this.basePath = basePath;
156
- this.setPath("base", basePath);
157
- this.loadOptions();
158
- this.registerBaseBindings();
159
- }
160
- /**
161
- * Register core bindings into the container
162
- */
163
- registerBaseBindings() {
164
- this.bind(_Application, () => this);
165
- this.bind("path.base", () => this.basePath);
166
- this.bind("app.paths", () => this.paths);
167
- }
168
- /**
169
- * Dynamically register all configured providers
170
- */
171
- async registerConfiguredProviders() {
172
- const providers = await this.getAllProviders();
173
- for (const ProviderClass of providers) {
174
- if (!ProviderClass)
175
- continue;
176
- const provider = new ProviderClass(this);
177
- await this.register(provider);
178
- }
179
- }
180
- async loadOptions() {
181
- const app = await this.safeImport(this.getPath("base", "package.json"));
182
- const core = await this.safeImport("../package.json");
183
- if (app && app.dependencies) {
184
- this.versions.app = app.dependencies["@h3ravel/core"];
185
- }
186
- if (core && core.devDependencies) {
187
- this.versions.ts = app.devDependencies.typescript;
188
- }
189
- }
190
- /**
191
- * Load default and optional providers dynamically
192
- *
193
- * Auto-Registration Behavior
194
- *
195
- * Minimal App: Loads only core, config, http, router by default.
196
- * Full-Stack App: Installs database, mail, queue, cache → they self-register via their providers.
197
- */
198
- async getConfiguredProviders() {
199
- return [
200
- (await this.safeImport("@h3ravel/core")).AppServiceProvider,
201
- (await this.safeImport("@h3ravel/http")).HttpServiceProvider,
202
- (await this.safeImport("@h3ravel/config")).ConfigServiceProvider,
203
- (await this.safeImport("@h3ravel/router")).RouteServiceProvider,
204
- (await this.safeImport("@h3ravel/router")).AssetsServiceProvider,
205
- (await this.safeImport("@h3ravel/core")).ViewServiceProvider,
206
- (await this.safeImport("@h3ravel/database"))?.DatabaseServiceProvider,
207
- (await this.safeImport("@h3ravel/cache"))?.CacheServiceProvider,
208
- (await this.safeImport("@h3ravel/console"))?.ConsoleServiceProvider,
209
- (await this.safeImport("@h3ravel/queue"))?.QueueServiceProvider,
210
- (await this.safeImport("@h3ravel/mail"))?.MailServiceProvider
211
- ];
212
- }
213
- async getAllProviders() {
214
- const coreProviders = await this.getConfiguredProviders();
215
- return [
216
- ...coreProviders,
217
- ...this.externalProviders
218
- ];
219
- }
220
- registerProviders(providers) {
221
- this.externalProviders.push(...providers);
222
- }
223
- /**
224
- * Register a provider
225
- */
226
- async register(provider) {
227
- await provider.register();
228
- this.providers.push(provider);
229
- }
230
- /**
231
- * Boot all providers after registration
232
- */
233
- async boot() {
234
- if (this.booted)
235
- return;
236
- for (const provider of this.providers) {
237
- if (provider.boot) {
238
- await provider.boot();
239
- }
240
- }
241
- this.booted = true;
242
- }
243
- /**
244
- * Attempt to dynamically import an optional module
245
- */
246
- async safeImport(moduleName) {
247
- console.log(moduleName);
248
- try {
249
- const mod = await import(moduleName);
250
- return mod.default ?? mod ?? {};
251
- } catch {
252
- return null;
253
- }
254
- }
255
- /**
256
- * Get the base path of the app
257
- *
258
- * @returns
259
- */
260
- getBasePath() {
261
- return this.basePath;
262
- }
263
- /**
264
- * Dynamically retrieves a path property from the class.
265
- * Any property ending with "Path" is accessible automatically.
266
- *
267
- * @param name - The base name of the path property
268
- * @returns
269
- */
270
- getPath(name, pth) {
271
- return import_node_path.default.join(this.paths.getPath(name, this.basePath), pth ?? "");
272
- }
273
- /**
274
- * Programatically set the paths.
275
- *
276
- * @param name - The base name of the path property
277
- * @param path - The new path
278
- * @returns
279
- */
280
- setPath(name, path2) {
281
- return this.paths.setPath(name, path2, this.basePath);
282
- }
283
- /**
284
- * Returns the installed version of the system core and typescript.
285
- *
286
- * @returns
287
- */
288
- getVersion(key) {
289
- return this.versions[key]?.replaceAll(/\^|\~/g, "");
140
+ var import_dotenv, import_node_path, Application;
141
+ var init_Application = __esm({
142
+ "src/Application.ts"() {
143
+ "use strict";
144
+ init_Container();
145
+ init_PathLoader();
146
+ import_dotenv = __toESM(require("dotenv"), 1);
147
+ import_node_path = __toESM(require("path"), 1);
148
+ Application = class _Application extends Container {
149
+ static {
150
+ __name(this, "Application");
151
+ }
152
+ paths = new PathLoader();
153
+ booted = false;
154
+ versions = {
155
+ app: "0",
156
+ ts: "0"
157
+ };
158
+ basePath;
159
+ providers = [];
160
+ externalProviders = [];
161
+ constructor(basePath) {
162
+ super();
163
+ this.basePath = basePath;
164
+ this.setPath("base", basePath);
165
+ this.loadOptions();
166
+ this.registerBaseBindings();
167
+ import_dotenv.default.config({
168
+ quiet: true
169
+ });
170
+ }
171
+ /**
172
+ * Register core bindings into the container
173
+ */
174
+ registerBaseBindings() {
175
+ this.bind(_Application, () => this);
176
+ this.bind("path.base", () => this.basePath);
177
+ this.bind("app.paths", () => this.paths);
178
+ }
179
+ /**
180
+ * Dynamically register all configured providers
181
+ */
182
+ async registerConfiguredProviders() {
183
+ const providers = await this.getAllProviders();
184
+ for (const ProviderClass of providers) {
185
+ if (!ProviderClass)
186
+ continue;
187
+ const provider = new ProviderClass(this);
188
+ await this.register(provider);
189
+ }
190
+ }
191
+ async loadOptions() {
192
+ const app = await this.safeImport(this.getPath("base", "package.json"));
193
+ const core = await this.safeImport("../package.json");
194
+ if (app && app.dependencies) {
195
+ this.versions.app = app.dependencies["@h3ravel/core"];
196
+ }
197
+ if (core && core.devDependencies) {
198
+ this.versions.ts = app.devDependencies.typescript;
199
+ }
200
+ }
201
+ /**
202
+ * Load default and optional providers dynamically
203
+ *
204
+ * Auto-Registration Behavior
205
+ *
206
+ * Minimal App: Loads only core, config, http, router by default.
207
+ * Full-Stack App: Installs database, mail, queue, cache → they self-register via their providers.
208
+ */
209
+ async getConfiguredProviders() {
210
+ return [
211
+ (await Promise.resolve().then(() => (init_src(), src_exports))).AppServiceProvider,
212
+ (await Promise.resolve().then(() => (init_src(), src_exports))).ViewServiceProvider
213
+ ];
214
+ }
215
+ async getAllProviders() {
216
+ const coreProviders = await this.getConfiguredProviders();
217
+ const allProviders = [
218
+ ...coreProviders,
219
+ ...this.externalProviders
220
+ ];
221
+ const uniqueProviders = Array.from(new Set(allProviders));
222
+ return this.sortProviders(uniqueProviders);
223
+ }
224
+ sortProviders(providers) {
225
+ const priorityMap = /* @__PURE__ */ new Map();
226
+ providers.forEach((Provider) => {
227
+ priorityMap.set(Provider.name, Provider.priority ?? 0);
228
+ });
229
+ providers.forEach((Provider) => {
230
+ const order = Provider.order;
231
+ if (!order)
232
+ return;
233
+ const [direction, target] = order.split(":");
234
+ const targetPriority = priorityMap.get(target) ?? 0;
235
+ if (direction === "before") {
236
+ priorityMap.set(Provider.name, targetPriority - 1);
237
+ } else if (direction === "after") {
238
+ priorityMap.set(Provider.name, targetPriority + 1);
239
+ }
240
+ });
241
+ const sorted = providers.sort((A, B) => (priorityMap.get(B.name) ?? 0) - (priorityMap.get(A.name) ?? 0));
242
+ if (process.env.APP_DEBUG === "true") {
243
+ console.table(sorted.map((P) => ({
244
+ Provider: P.name,
245
+ Priority: priorityMap.get(P.name),
246
+ Order: P.order || "N/A"
247
+ })));
248
+ }
249
+ return sorted;
250
+ }
251
+ registerProviders(providers) {
252
+ this.externalProviders.push(...providers);
253
+ }
254
+ /**
255
+ * Register a provider
256
+ */
257
+ async register(provider) {
258
+ await provider.register();
259
+ this.providers.push(provider);
260
+ }
261
+ /**
262
+ * Boot all providers after registration
263
+ */
264
+ async boot() {
265
+ if (this.booted)
266
+ return;
267
+ for (const provider of this.providers) {
268
+ if (provider.boot) {
269
+ await provider.boot();
270
+ }
271
+ }
272
+ this.booted = true;
273
+ }
274
+ /**
275
+ * Attempt to dynamically import an optional module
276
+ */
277
+ async safeImport(moduleName) {
278
+ try {
279
+ const mod = await import(moduleName);
280
+ return mod.default ?? mod ?? {};
281
+ } catch {
282
+ return null;
283
+ }
284
+ }
285
+ /**
286
+ * Get the base path of the app
287
+ *
288
+ * @returns
289
+ */
290
+ getBasePath() {
291
+ return this.basePath;
292
+ }
293
+ /**
294
+ * Dynamically retrieves a path property from the class.
295
+ * Any property ending with "Path" is accessible automatically.
296
+ *
297
+ * @param name - The base name of the path property
298
+ * @returns
299
+ */
300
+ getPath(name, pth) {
301
+ return import_node_path.default.join(this.paths.getPath(name, this.basePath), pth ?? "");
302
+ }
303
+ /**
304
+ * Programatically set the paths.
305
+ *
306
+ * @param name - The base name of the path property
307
+ * @param path - The new path
308
+ * @returns
309
+ */
310
+ setPath(name, path2) {
311
+ return this.paths.setPath(name, path2, this.basePath);
312
+ }
313
+ /**
314
+ * Returns the installed version of the system core and typescript.
315
+ *
316
+ * @returns
317
+ */
318
+ getVersion(key) {
319
+ return this.versions[key]?.replaceAll(/\^|~/g, "");
320
+ }
321
+ };
290
322
  }
291
- };
323
+ });
292
324
 
293
325
  // src/Controller.ts
294
- var Controller = class {
295
- static {
296
- __name(this, "Controller");
297
- }
298
- app;
299
- constructor(app) {
300
- this.app = app;
301
- }
302
- show(_ctx) {
303
- return;
304
- }
305
- index(_ctx) {
306
- return;
307
- }
308
- store(_ctx) {
309
- return;
310
- }
311
- update(_ctx) {
312
- return;
313
- }
314
- destroy(_ctx) {
315
- return;
326
+ var Controller;
327
+ var init_Controller = __esm({
328
+ "src/Controller.ts"() {
329
+ "use strict";
330
+ Controller = class {
331
+ static {
332
+ __name(this, "Controller");
333
+ }
334
+ app;
335
+ constructor(app) {
336
+ this.app = app;
337
+ }
338
+ show(_ctx) {
339
+ return;
340
+ }
341
+ index(_ctx) {
342
+ return;
343
+ }
344
+ store(_ctx) {
345
+ return;
346
+ }
347
+ update(_ctx) {
348
+ return;
349
+ }
350
+ destroy(_ctx) {
351
+ return;
352
+ }
353
+ };
316
354
  }
317
- };
355
+ });
318
356
 
319
357
  // src/ServiceProvider.ts
320
- var ServiceProvider = class {
321
- static {
322
- __name(this, "ServiceProvider");
323
- }
324
- app;
325
- constructor(app) {
326
- this.app = app;
358
+ var ServiceProvider;
359
+ var init_ServiceProvider = __esm({
360
+ "src/ServiceProvider.ts"() {
361
+ "use strict";
362
+ ServiceProvider = class {
363
+ static {
364
+ __name(this, "ServiceProvider");
365
+ }
366
+ static order;
367
+ static priority = 0;
368
+ app;
369
+ constructor(app) {
370
+ this.app = app;
371
+ }
372
+ };
327
373
  }
328
- };
374
+ });
329
375
 
330
- // src/Http/Kernel.ts
331
- var Kernel = class {
332
- static {
333
- __name(this, "Kernel");
376
+ // src/Contracts/BindingsContract.ts
377
+ var init_BindingsContract = __esm({
378
+ "src/Contracts/BindingsContract.ts"() {
379
+ "use strict";
334
380
  }
335
- context;
336
- middleware;
337
- constructor(context, middleware = []) {
338
- this.context = context;
339
- this.middleware = middleware;
340
- }
341
- async handle(event, next) {
342
- const ctx = this.context(event);
343
- const result = await this.runMiddleware(ctx, () => next(ctx));
344
- if (result !== void 0 && this.isPlainObject(result)) {
345
- event.res.headers.set("Content-Type", "application/json; charset=UTF-8");
346
- }
347
- return result;
381
+ });
382
+
383
+ // src/Contracts/ServiceProviderConstructor.ts
384
+ var init_ServiceProviderConstructor = __esm({
385
+ "src/Contracts/ServiceProviderConstructor.ts"() {
386
+ "use strict";
348
387
  }
349
- async runMiddleware(context, next) {
350
- let index = -1;
351
- const runner = /* @__PURE__ */ __name(async (i) => {
352
- if (i <= index)
353
- throw new Error("next() called multiple times");
354
- index = i;
355
- const middleware = this.middleware[i];
356
- if (middleware) {
357
- return middleware.handle(context, () => runner(i + 1));
358
- } else {
359
- return next(context);
360
- }
361
- }, "runner");
362
- return runner(0);
388
+ });
389
+
390
+ // src/Exceptions/Handler.ts
391
+ var init_Handler = __esm({
392
+ "src/Exceptions/Handler.ts"() {
393
+ "use strict";
363
394
  }
364
- isPlainObject(value) {
365
- return typeof value === "object" && value !== null && (value.constructor === Object || value.constructor === Array);
395
+ });
396
+
397
+ // src/Http/Kernel.ts
398
+ var Kernel;
399
+ var init_Kernel = __esm({
400
+ "src/Http/Kernel.ts"() {
401
+ "use strict";
402
+ Kernel = class {
403
+ static {
404
+ __name(this, "Kernel");
405
+ }
406
+ context;
407
+ middleware;
408
+ constructor(context, middleware = []) {
409
+ this.context = context;
410
+ this.middleware = middleware;
411
+ }
412
+ async handle(event, next) {
413
+ const ctx = this.context(event);
414
+ const result = await this.runMiddleware(ctx, () => next(ctx));
415
+ if (result !== void 0 && this.isPlainObject(result)) {
416
+ event.res.headers.set("Content-Type", "application/json; charset=UTF-8");
417
+ }
418
+ return result;
419
+ }
420
+ async runMiddleware(context, next) {
421
+ let index = -1;
422
+ const runner = /* @__PURE__ */ __name(async (i) => {
423
+ if (i <= index)
424
+ throw new Error("next() called multiple times");
425
+ index = i;
426
+ const middleware = this.middleware[i];
427
+ if (middleware) {
428
+ return middleware.handle(context, () => runner(i + 1));
429
+ } else {
430
+ return next(context);
431
+ }
432
+ }, "runner");
433
+ return runner(0);
434
+ }
435
+ isPlainObject(value) {
436
+ return typeof value === "object" && value !== null && (value.constructor === Object || value.constructor === Array);
437
+ }
438
+ };
366
439
  }
367
- };
440
+ });
368
441
 
369
442
  // src/Providers/AppServiceProvider.ts
370
- var import_reflect_metadata = require("reflect-metadata");
371
- var AppServiceProvider = class extends ServiceProvider {
372
- static {
373
- __name(this, "AppServiceProvider");
374
- }
375
- register() {
443
+ var import_reflect_metadata, AppServiceProvider;
444
+ var init_AppServiceProvider = __esm({
445
+ "src/Providers/AppServiceProvider.ts"() {
446
+ "use strict";
447
+ import_reflect_metadata = require("reflect-metadata");
448
+ init_ServiceProvider();
449
+ AppServiceProvider = class extends ServiceProvider {
450
+ static {
451
+ __name(this, "AppServiceProvider");
452
+ }
453
+ static priority = 999;
454
+ register() {
455
+ }
456
+ };
376
457
  }
377
- };
458
+ });
378
459
 
379
460
  // src/Providers/ViewServiceProvider.ts
380
- var import_edge = require("edge.js");
381
- var ViewServiceProvider = class extends ServiceProvider {
382
- static {
383
- __name(this, "ViewServiceProvider");
461
+ var import_edge, ViewServiceProvider;
462
+ var init_ViewServiceProvider = __esm({
463
+ "src/Providers/ViewServiceProvider.ts"() {
464
+ "use strict";
465
+ import_edge = require("edge.js");
466
+ init_ServiceProvider();
467
+ ViewServiceProvider = class extends ServiceProvider {
468
+ static {
469
+ __name(this, "ViewServiceProvider");
470
+ }
471
+ static priority = 995;
472
+ register() {
473
+ const config = this.app.make("config");
474
+ const edge = import_edge.Edge.create({
475
+ cache: process.env.NODE_ENV === "production"
476
+ });
477
+ edge.mount(this.app.getPath("views"));
478
+ edge.global("asset", this.app.make("asset"));
479
+ edge.global("config", config.get);
480
+ edge.global("app", this.app);
481
+ this.app.bind("view", () => edge);
482
+ }
483
+ };
384
484
  }
385
- register() {
386
- const config = this.app.make("config");
387
- const edge = import_edge.Edge.create({
388
- cache: process.env.NODE_ENV === "production"
389
- });
390
- edge.mount(this.app.getPath("views"));
391
- edge.global("asset", this.app.make("asset"));
392
- edge.global("config", config.get);
393
- edge.global("app", this.app);
394
- this.app.bind("view", () => edge);
485
+ });
486
+
487
+ // src/index.ts
488
+ var src_exports = {};
489
+ __export(src_exports, {
490
+ AppServiceProvider: () => AppServiceProvider,
491
+ Application: () => Application,
492
+ Container: () => Container,
493
+ Controller: () => Controller,
494
+ Kernel: () => Kernel,
495
+ PathLoader: () => PathLoader,
496
+ ServiceProvider: () => ServiceProvider,
497
+ ViewServiceProvider: () => ViewServiceProvider
498
+ });
499
+ module.exports = __toCommonJS(src_exports);
500
+ var init_src = __esm({
501
+ "src/index.ts"() {
502
+ init_Application();
503
+ init_Container();
504
+ init_Controller();
505
+ init_ServiceProvider();
506
+ init_BindingsContract();
507
+ init_ServiceProviderConstructor();
508
+ init_Handler();
509
+ init_Kernel();
510
+ init_AppServiceProvider();
511
+ init_ViewServiceProvider();
512
+ init_PathLoader();
395
513
  }
396
- };
514
+ });
515
+ init_src();
397
516
  // Annotate the CommonJS export names for ESM import in node:
398
517
  0 && (module.exports = {
399
518
  AppServiceProvider,