@vercube/core 0.0.5 → 0.0.7

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.d.mts CHANGED
@@ -46,6 +46,10 @@ declare namespace ConfigTypes {
46
46
  */
47
47
  duration?: number;
48
48
  };
49
+ /**
50
+ * Additional user configuration
51
+ */
52
+ [key: string]: unknown;
49
53
  }
50
54
  /**
51
55
  * Configuration options for experimental features.
@@ -170,7 +174,7 @@ declare class App {
170
174
  private gPluginsRegistry;
171
175
  private gHttpServer;
172
176
  private gStaticRequestHandler;
173
- private gLogger;
177
+ private gRuntimeConfig;
174
178
  /** Holds the initialization status of the application */
175
179
  private fIsInitialized;
176
180
  /** Holds the dependency injection container */
package/dist/index.mjs CHANGED
@@ -5,8 +5,8 @@ import { addRoute, createRouter, findRoute } from "rou3";
5
5
  import { createReadStream } from "node:fs";
6
6
  import { extname, join, normalize } from "node:path";
7
7
  import { stat } from "node:fs/promises";
8
- import { BaseLogger, Logger, colors } from "@vercube/logger";
9
- import { ConsoleProvider } from "@vercube/logger/providers";
8
+ import { BaseLogger, Logger } from "@vercube/logger";
9
+ import { ConsoleProvider } from "@vercube/logger/providers/ConsoleProvider";
10
10
  import { loadConfig } from "c12";
11
11
  import { defu } from "defu";
12
12
 
@@ -36,8 +36,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  }) : target, mod));
37
37
 
38
38
  //#endregion
39
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.1/node_modules/@oxc-project/runtime/src/helpers/decorate.js
40
- var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.1/node_modules/@oxc-project/runtime/src/helpers/decorate.js"(exports, module) {
39
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/decorate.js
40
+ var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/decorate.js"(exports, module) {
41
41
  function __decorate(decorators, target, key, desc) {
42
42
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
43
43
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -49,7 +49,7 @@ var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runti
49
49
 
50
50
  //#endregion
51
51
  //#region src/Services/Plugins/PluginsRegistry.ts
52
- var import_decorate$18 = __toESM(require_decorate());
52
+ var import_decorate$18 = __toESM(require_decorate(), 1);
53
53
  var PluginsRegistry = class {
54
54
  gContainer;
55
55
  /** Holds the list of plugins */
@@ -533,7 +533,7 @@ var GlobalMiddlewareRegistry = class {
533
533
 
534
534
  //#endregion
535
535
  //#region src/Services/Router/RequestHandler.ts
536
- var import_decorate$16 = __toESM(require_decorate());
536
+ var import_decorate$16 = __toESM(require_decorate(), 1);
537
537
  /**
538
538
  * Handles HTTP requests by preparing and executing route handlers with their associated middlewares
539
539
  *
@@ -858,6 +858,34 @@ var HttpServer = class {
858
858
  (0, import_decorate$15.default)([Inject(RequestHandler)], HttpServer.prototype, "gRequestHandler", void 0);
859
859
  (0, import_decorate$15.default)([Inject(StaticRequestHandler)], HttpServer.prototype, "gStaticRequestHandler", void 0);
860
860
 
861
+ //#endregion
862
+ //#region src/Services/Config/RuntimeConfig.ts
863
+ /**
864
+ * RuntimeConfig class manages the runtime configuration for the Vercube application.
865
+ * This class provides a centralized way to access and modify runtime configuration settings.
866
+ */
867
+ var RuntimeConfig = class {
868
+ /**
869
+ * Private field to store the runtime configuration object.
870
+ * @private
871
+ */
872
+ fRuntimeConfig;
873
+ /**
874
+ * Gets the current runtime configuration.
875
+ * @returns {ConfigTypes.RuntimeConfig} The current runtime configuration object.
876
+ */
877
+ get runtimeConfig() {
878
+ return this.fRuntimeConfig;
879
+ }
880
+ /**
881
+ * Sets the runtime configuration.
882
+ * @param {ConfigTypes.RuntimeConfig} value - The new runtime configuration object to set.
883
+ */
884
+ set runtimeConfig(value) {
885
+ this.fRuntimeConfig = value;
886
+ }
887
+ };
888
+
861
889
  //#endregion
862
890
  //#region src/Common/App.ts
863
891
  var import_decorate$14 = __toESM(require_decorate());
@@ -869,7 +897,7 @@ var App = class {
869
897
  gPluginsRegistry;
870
898
  gHttpServer;
871
899
  gStaticRequestHandler;
872
- gLogger;
900
+ gRuntimeConfig;
873
901
  /** Holds the initialization status of the application */
874
902
  fIsInitialized = false;
875
903
  /** Holds the dependency injection container */
@@ -901,6 +929,7 @@ var App = class {
901
929
  this.fConfig = cfg;
902
930
  await this.gHttpServer.initialize(this.fConfig);
903
931
  if (this.fConfig.server?.static) this.gStaticRequestHandler.initialize(this.fConfig.server?.static);
932
+ if (this.fConfig.runtime) this.gRuntimeConfig.runtimeConfig = this.fConfig.runtime;
904
933
  this.gRouter.initialize();
905
934
  }
906
935
  /**
@@ -923,7 +952,6 @@ var App = class {
923
952
  await this.resolvePlugins();
924
953
  initializeContainer(this.container);
925
954
  await this.gHttpServer.listen();
926
- this.gLogger?.info(`\n${colors.green("➜")} App listening on port ${colors.bold(this.fConfig.server?.port?.toString() ?? "3000")}`);
927
955
  this.fIsInitialized = true;
928
956
  }
929
957
  /**
@@ -949,7 +977,7 @@ var App = class {
949
977
  (0, import_decorate$14.default)([Inject(PluginsRegistry)], App.prototype, "gPluginsRegistry", void 0);
950
978
  (0, import_decorate$14.default)([Inject(HttpServer)], App.prototype, "gHttpServer", void 0);
951
979
  (0, import_decorate$14.default)([Inject(StaticRequestHandler)], App.prototype, "gStaticRequestHandler", void 0);
952
- (0, import_decorate$14.default)([InjectOptional(Logger)], App.prototype, "gLogger", void 0);
980
+ (0, import_decorate$14.default)([Inject(RuntimeConfig)], App.prototype, "gRuntimeConfig", void 0);
953
981
 
954
982
  //#endregion
955
983
  //#region src/Services/Validation/ValidationProvider.ts
@@ -982,34 +1010,6 @@ var StandardSchemaValidationProvider = class {
982
1010
  }
983
1011
  };
984
1012
 
985
- //#endregion
986
- //#region src/Services/Config/RuntimeConfig.ts
987
- /**
988
- * RuntimeConfig class manages the runtime configuration for the Vercube application.
989
- * This class provides a centralized way to access and modify runtime configuration settings.
990
- */
991
- var RuntimeConfig = class {
992
- /**
993
- * Private field to store the runtime configuration object.
994
- * @private
995
- */
996
- fRuntimeConfig;
997
- /**
998
- * Gets the current runtime configuration.
999
- * @returns {ConfigTypes.RuntimeConfig} The current runtime configuration object.
1000
- */
1001
- get runtimeConfig() {
1002
- return this.fRuntimeConfig;
1003
- }
1004
- /**
1005
- * Sets the runtime configuration.
1006
- * @param {ConfigTypes.RuntimeConfig} value - The new runtime configuration object to set.
1007
- */
1008
- set runtimeConfig(value) {
1009
- this.fRuntimeConfig = value;
1010
- }
1011
- };
1012
-
1013
1013
  //#endregion
1014
1014
  //#region src/Errors/Http/InternalServerError.ts
1015
1015
  /**
@@ -1035,7 +1035,7 @@ var InternalServerError = class InternalServerError extends HttpError {
1035
1035
 
1036
1036
  //#endregion
1037
1037
  //#region src/Services/ErrorHandler/DefaultErrorHandlerProvider.ts
1038
- var import_decorate$13 = __toESM(require_decorate());
1038
+ var import_decorate$13 = __toESM(require_decorate(), 1);
1039
1039
  /**
1040
1040
  * Default error handler provider
1041
1041
  *
@@ -1186,7 +1186,7 @@ function defineConfig(config) {
1186
1186
 
1187
1187
  //#endregion
1188
1188
  //#region src/Middleware/ValidationMiddleware.ts
1189
- var import_decorate$12 = __toESM(require_decorate());
1189
+ var import_decorate$12 = __toESM(require_decorate(), 1);
1190
1190
  /**
1191
1191
  * Middleware for validating request data against a schema
1192
1192
  * @class ValidationMiddleware
@@ -2080,7 +2080,7 @@ function Response$1() {
2080
2080
 
2081
2081
  //#endregion
2082
2082
  //#region src/Decorators/Http/Trace.ts
2083
- var import_decorate$2 = __toESM(require_decorate());
2083
+ var import_decorate$2 = __toESM(require_decorate(), 1);
2084
2084
  /**
2085
2085
  * A decorator class for handling HTTP TRACE requests.
2086
2086
  *
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@vercube/core",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Core module for Vercube framework",
5
5
  "repository": "@vercube/core",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
+ "main": "./dist/index.mjs",
10
+ "module": "./dist/index.mjs",
9
11
  "exports": {
10
- ".": "./dist/index.mjs"
12
+ ".": "./dist/index.mjs",
13
+ "./package.json": "./package.json"
11
14
  },
12
15
  "types": "./dist/index.d.mts",
13
16
  "files": [
@@ -21,8 +24,8 @@
21
24
  "pathe": "2.0.3",
22
25
  "rou3": "0.6.3",
23
26
  "srvx": "0.7.5",
24
- "@vercube/di": "0.0.5",
25
- "@vercube/logger": "0.0.5"
27
+ "@vercube/di": "0.0.7",
28
+ "@vercube/logger": "0.0.7"
26
29
  },
27
30
  "publishConfig": {
28
31
  "access": "public"