@expressots/core 1.3.0 → 1.4.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 (41) hide show
  1. package/README.md +3 -3
  2. package/lib/CHANGELOG.md +23 -13
  3. package/lib/README.md +3 -3
  4. package/lib/cjs/application/app-container.js +28 -11
  5. package/lib/cjs/container-module/container-module.js +69 -16
  6. package/lib/cjs/container-module/index.js +2 -1
  7. package/lib/cjs/decorator/index.js +17 -0
  8. package/lib/cjs/decorator/scope-binding.js +12 -0
  9. package/lib/cjs/index.js +1 -0
  10. package/lib/cjs/types/application/app-container.d.ts +18 -6
  11. package/lib/cjs/types/application/app-container.d.ts.map +1 -1
  12. package/lib/cjs/types/container-module/container-module.d.ts +14 -8
  13. package/lib/cjs/types/container-module/container-module.d.ts.map +1 -1
  14. package/lib/cjs/types/container-module/index.d.ts +1 -1
  15. package/lib/cjs/types/container-module/index.d.ts.map +1 -1
  16. package/lib/cjs/types/decorator/index.d.ts +2 -0
  17. package/lib/cjs/types/decorator/index.d.ts.map +1 -0
  18. package/lib/cjs/types/decorator/scope-binding.d.ts +4 -0
  19. package/lib/cjs/types/decorator/scope-binding.d.ts.map +1 -0
  20. package/lib/cjs/types/index.d.ts +1 -0
  21. package/lib/cjs/types/index.d.ts.map +1 -1
  22. package/lib/esm/application/app-container.js +29 -12
  23. package/lib/esm/container-module/container-module.js +69 -17
  24. package/lib/esm/container-module/index.js +1 -1
  25. package/lib/esm/decorator/index.js +1 -0
  26. package/lib/esm/decorator/scope-binding.js +8 -0
  27. package/lib/esm/index.mjs +1 -0
  28. package/lib/esm/types/application/app-container.d.ts +18 -6
  29. package/lib/esm/types/application/app-container.d.ts.map +1 -1
  30. package/lib/esm/types/container-module/container-module.d.ts +14 -8
  31. package/lib/esm/types/container-module/container-module.d.ts.map +1 -1
  32. package/lib/esm/types/container-module/index.d.ts +1 -1
  33. package/lib/esm/types/container-module/index.d.ts.map +1 -1
  34. package/lib/esm/types/decorator/index.d.ts +2 -0
  35. package/lib/esm/types/decorator/index.d.ts.map +1 -0
  36. package/lib/esm/types/decorator/scope-binding.d.ts +4 -0
  37. package/lib/esm/types/decorator/scope-binding.d.ts.map +1 -0
  38. package/lib/esm/types/index.d.ts +1 -0
  39. package/lib/esm/types/index.d.ts.map +1 -1
  40. package/lib/package.json +3 -3
  41. package/package.json +3 -3
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://expresso-ts.com/" target="blank"><img src="https://github.com/expressots/expressots/blob/main/media/alogo.png" width="120" alt="Expresso TS Logo" /></a>
2
+ <a href="https://expresso-ts.com/" target="blank"><img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" width="120" alt="Expresso TS Logo" /></a>
3
3
  </p>
4
4
 
5
5
  # Expresso TS
@@ -46,7 +46,7 @@ ExpressoTS is an MIT-licensed open source project. It's an independent project w
46
46
  - [Daniel Boll](https://github.com/daniel-boll)
47
47
  - [Felipe Fontana](https://github.com/f0ntana)
48
48
  - [Juliano Soares](https://github.com/juliano-soares)
49
- - [Vitor Caminha](https://github.com/VitorCaminha)
49
+ - [Vitor Caminha](https://github.com/VitorCaminha)
50
50
  - [Ariel Betti](https://github.com/ArielBetti)
51
51
  - [Rodrigo da Hora](https://github.com/dahorarodrigo)
52
52
 
@@ -62,4 +62,4 @@ ExpressoTS is an MIT-licensed open source project. It's an independent project w
62
62
 
63
63
  ## License
64
64
 
65
- ExpressoTS is **[MIT licensed](LICENSE.md)**
65
+ ExpressoTS is **[MIT licensed](LICENSE.md)**
package/lib/CHANGELOG.md CHANGED
@@ -1,18 +1,28 @@
1
1
 
2
2
 
3
- ## [1.3.0](https://github.com/expressots/expressots/compare/v1.2.1...v1.3.0) (2023-04-21)
4
-
5
-
6
- ### Features
7
-
8
- * add user repository as singleton provider in opinionated template ([#24](https://github.com/expressots/expressots/issues/24)) ([3b5bded](https://github.com/expressots/expressots/commit/3b5bded07769d51f69b481e4b5e9b45c27d13a69))
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * add gitignore on opinionated template ([315d355](https://github.com/expressots/expressots/commit/315d355ed87eb6be85daddc250289d5e0d41cd21))
14
- * findall use case query db in memory ([ff8feea](https://github.com/expressots/expressots/commit/ff8feeaf36d0b74eebd9ab4e22f1910cff0a4df8))
15
- * the number of constructor arguments ([ccf2a48](https://github.com/expressots/expressots/commit/ccf2a4878e795e0182608546eae8cd83e3bea775))
3
+ ## [1.4.0](https://github.com/expressots/expressots/compare/v1.3.0...v1.4.0) (2023-05-14)
4
+
5
+ * add DI (dependency injection) singleton, transient, scope to container, providers, entities, etc
6
+
7
+ ### Bug Fixes
8
+
9
+ * update sponsor link on package
10
+ * add example with controller only ([11b4ce3](https://github.com/expressots/expressots/commit/11b4ce3124482122a4f47fb27b7a1b1e02731621))
11
+ * opinionated template ientity id ([dd50ca0](https://github.com/expressots/expressots/commit/dd50ca0926c98890cbe1342f804ca34152c4a9f9))
12
+
13
+ ## [1.3.0](https://github.com/expressots/expressots/compare/v1.2.1...v1.3.0) (2023-04-21)
14
+
15
+
16
+ ### Features
17
+
18
+ * add user repository as singleton provider in opinionated template ([#24](https://github.com/expressots/expressots/issues/24)) ([3b5bded](https://github.com/expressots/expressots/commit/3b5bded07769d51f69b481e4b5e9b45c27d13a69))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * add gitignore on opinionated template ([315d355](https://github.com/expressots/expressots/commit/315d355ed87eb6be85daddc250289d5e0d41cd21))
24
+ * findall use case query db in memory ([ff8feea](https://github.com/expressots/expressots/commit/ff8feeaf36d0b74eebd9ab4e22f1910cff0a4df8))
25
+ * the number of constructor arguments ([ccf2a48](https://github.com/expressots/expressots/commit/ccf2a4878e795e0182608546eae8cd83e3bea775))
16
26
  * update core pkg templates to always download latest ([ca443eb](https://github.com/expressots/expressots/commit/ca443eb6be103725c73442f49e2fec14d797bba1))
17
27
 
18
28
  ## [1.2.1](https://github.com/expressots/expressots/compare/v1.2.0...v1.2.1) (2023-04-18)
package/lib/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://expresso-ts.com/" target="blank"><img src="https://github.com/expressots/expressots/blob/main/media/alogo.png" width="120" alt="Expresso TS Logo" /></a>
2
+ <a href="https://expresso-ts.com/" target="blank"><img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" width="120" alt="Expresso TS Logo" /></a>
3
3
  </p>
4
4
 
5
5
  # Expresso TS
@@ -46,7 +46,7 @@ ExpressoTS is an MIT-licensed open source project. It's an independent project w
46
46
  - [Daniel Boll](https://github.com/daniel-boll)
47
47
  - [Felipe Fontana](https://github.com/f0ntana)
48
48
  - [Juliano Soares](https://github.com/juliano-soares)
49
- - [Vitor Caminha](https://github.com/VitorCaminha)
49
+ - [Vitor Caminha](https://github.com/VitorCaminha)
50
50
  - [Ariel Betti](https://github.com/ArielBetti)
51
51
  - [Rodrigo da Hora](https://github.com/dahorarodrigo)
52
52
 
@@ -62,4 +62,4 @@ ExpressoTS is an MIT-licensed open source project. It's an independent project w
62
62
 
63
63
  ## License
64
64
 
65
- ExpressoTS is **[MIT licensed](LICENSE.md)**
65
+ ExpressoTS is **[MIT licensed](LICENSE.md)**
@@ -5,9 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
8
  var AppContainer_1;
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  exports.AppContainer = void 0;
@@ -18,23 +15,43 @@ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
18
15
  * @provide AppContainer
19
16
  */
20
17
  let AppContainer = AppContainer_1 = class AppContainer {
21
- /**
22
- * Constructs a new instance of the AppContainer class.
23
- */
24
- constructor() { }
25
18
  /**
26
19
  * Creates and configures a new dependency injection container.
27
20
  * @param modules - An array of ContainerModule instances to load into the container.
21
+ * @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
28
22
  * @returns The configured dependency injection container.
29
23
  */
30
- create(modules) {
31
- this.container = new inversify_1.Container();
24
+ create(modules, defaultScope = inversify_1.BindingScopeEnum.Request) {
25
+ this.container = new inversify_1.Container({
26
+ autoBindInjectable: true,
27
+ defaultScope,
28
+ });
32
29
  this.container.load((0, inversify_binding_decorators_1.buildProviderModule)(), ...modules);
33
30
  return this.container;
34
31
  }
32
+ /**
33
+ * Retrieves the binding dictionary of the container.
34
+ * @returns The binding dictionary of the container.
35
+ */
36
+ getBindingDictionary() {
37
+ return this.container["_bindingDictionary"]._map;
38
+ }
39
+ /**
40
+ * Retrieves the container options.
41
+ * @returns The container options.
42
+ */
43
+ getContainerOptions() {
44
+ return this.container["options"];
45
+ }
46
+ /**
47
+ * Retrieves the container.
48
+ * @returns The container.
49
+ */
50
+ get Container() {
51
+ return this.container;
52
+ }
35
53
  };
36
54
  AppContainer = AppContainer_1 = __decorate([
37
- (0, inversify_binding_decorators_1.provide)(AppContainer_1),
38
- __metadata("design:paramtypes", [])
55
+ (0, inversify_binding_decorators_1.provide)(AppContainer_1)
39
56
  ], AppContainer);
40
57
  exports.AppContainer = AppContainer;
@@ -5,20 +5,45 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
8
  var BaseModule_1;
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.CreateModule = void 0;
10
+ exports.scope = exports.CreateModule = void 0;
14
11
  const inversify_1 = require("inversify");
15
12
  const inversify_binding_decorators_1 = require("inversify-binding-decorators");
13
+ const decorator_1 = require("../decorator");
14
+ /**
15
+ * Key to be used for storing and retrieving binding type metadata.
16
+ */
17
+ const BINDING_TYPE_METADATA_KEY = "binding-type";
18
+ /**
19
+ * The scope decorator is a higher order function that can be used to decorate a class with a binding type.
20
+ * @param binding An instance of interfaces.BindingScope which represents the binding type.
21
+ * @returns A decorator function that can be used to decorate a class with a binding type.
22
+ */
23
+ const scope = (binding) => {
24
+ return function (target) {
25
+ if (!Reflect.hasMetadata(BINDING_TYPE_METADATA_KEY, target)) {
26
+ Reflect.defineMetadata(BINDING_TYPE_METADATA_KEY, binding, target);
27
+ switch (binding) {
28
+ case inversify_1.BindingScopeEnum.Singleton:
29
+ (0, decorator_1.provideSingleton)(target);
30
+ break;
31
+ case inversify_1.BindingScopeEnum.Transient:
32
+ (0, decorator_1.provideTransient)(target);
33
+ break;
34
+ default:
35
+ (0, inversify_binding_decorators_1.provide)(target);
36
+ break;
37
+ }
38
+ }
39
+ };
40
+ };
41
+ exports.scope = scope;
16
42
  /**
17
43
  * The BaseModule class provides methods for creating InversifyJS container modules.
18
44
  * @provide BaseModule
19
45
  */
20
46
  let BaseModule = BaseModule_1 = class BaseModule {
21
- constructor() { }
22
47
  /**
23
48
  * Create a map of symbols for the provided controllers.
24
49
  * @param controllers - An array of controller classes.
@@ -34,23 +59,51 @@ let BaseModule = BaseModule_1 = class BaseModule {
34
59
  return symbols;
35
60
  }
36
61
  /**
37
- * Create an InversifyJS ContainerModule for the provided controllers.
38
- * @param controllers - An array of controller classes.
39
- * @returns A ContainerModule with the controller bindings.
40
- */
41
- static createContainerModule(controllers) {
62
+ * Create an InversifyJS ContainerModule for the provided controllers.
63
+ * @param controllers - An array of controller classes.
64
+ * @param scope - An optional binding scope to be used for all controllers.
65
+ * @returns A ContainerModule with the controller bindings.
66
+ */
67
+ static createContainerModule(controllers, scope) {
42
68
  const symbols = BaseModule_1.createSymbols(controllers);
43
- return new inversify_1.ContainerModule(bind => {
44
- for (const symbol of symbols) {
45
- const target = symbol.valueOf();
46
- bind(target[0]).to(target[1]);
69
+ return new inversify_1.ContainerModule((bind) => {
70
+ for (const [symbol, target] of symbols) {
71
+ if (scope) {
72
+ switch (scope) {
73
+ case inversify_1.BindingScopeEnum.Singleton:
74
+ bind(symbol).to(target).inSingletonScope();
75
+ break;
76
+ case inversify_1.BindingScopeEnum.Transient:
77
+ bind(symbol).to(target).inTransientScope();
78
+ break;
79
+ case inversify_1.BindingScopeEnum.Request:
80
+ bind(symbol).to(target).inRequestScope();
81
+ break;
82
+ }
83
+ }
84
+ else {
85
+ const bindingType = Reflect.getMetadata(BINDING_TYPE_METADATA_KEY, target);
86
+ switch (bindingType) {
87
+ case inversify_1.BindingScopeEnum.Singleton:
88
+ bind(symbol).to(target).inSingletonScope();
89
+ break;
90
+ case inversify_1.BindingScopeEnum.Transient:
91
+ bind(symbol).to(target).inTransientScope();
92
+ break;
93
+ case inversify_1.BindingScopeEnum.Request:
94
+ bind(symbol).to(target).inRequestScope();
95
+ break;
96
+ default:
97
+ bind(symbol).to(target).inRequestScope();
98
+ break;
99
+ }
100
+ }
47
101
  }
48
102
  });
49
103
  }
50
104
  };
51
105
  BaseModule = BaseModule_1 = __decorate([
52
- (0, inversify_binding_decorators_1.provide)(BaseModule_1),
53
- __metadata("design:paramtypes", [])
106
+ (0, inversify_binding_decorators_1.provide)(BaseModule_1)
54
107
  ], BaseModule);
55
108
  const CreateModule = BaseModule.createContainerModule;
56
109
  exports.CreateModule = CreateModule;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateModule = void 0;
3
+ exports.scope = exports.CreateModule = void 0;
4
4
  var container_module_1 = require("./container-module");
5
5
  Object.defineProperty(exports, "CreateModule", { enumerable: true, get: function () { return container_module_1.CreateModule; } });
6
+ Object.defineProperty(exports, "scope", { enumerable: true, get: function () { return container_module_1.scope; } });
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./scope-binding"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.provideTransient = exports.provideSingleton = void 0;
4
+ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
5
+ const provideSingleton = (identifier) => {
6
+ return (0, inversify_binding_decorators_1.fluentProvide)(identifier).inSingletonScope().done();
7
+ };
8
+ exports.provideSingleton = provideSingleton;
9
+ const provideTransient = (identifier) => {
10
+ return (0, inversify_binding_decorators_1.fluentProvide)(identifier).inTransientScope().done();
11
+ };
12
+ exports.provideTransient = provideTransient;
package/lib/cjs/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./common"), exports);
19
19
  __exportStar(require("./console"), exports);
20
20
  __exportStar(require("./container-module"), exports);
21
21
  __exportStar(require("./controller"), exports);
22
+ __exportStar(require("./decorator"), exports);
22
23
  __exportStar(require("./environment"), exports);
23
24
  __exportStar(require("./error"), exports);
24
25
  __exportStar(require("./logger"), exports);
@@ -1,20 +1,32 @@
1
- import { Container, ContainerModule } from "inversify";
1
+ import { Container, ContainerModule, interfaces } from "inversify";
2
2
  /**
3
3
  * The AppContainer class provides a container for managing dependency injection.
4
4
  * @provide AppContainer
5
5
  */
6
6
  declare class AppContainer {
7
7
  private container;
8
- /**
9
- * Constructs a new instance of the AppContainer class.
10
- */
11
- constructor();
12
8
  /**
13
9
  * Creates and configures a new dependency injection container.
14
10
  * @param modules - An array of ContainerModule instances to load into the container.
11
+ * @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
15
12
  * @returns The configured dependency injection container.
16
13
  */
17
- create(modules: ContainerModule[]): Container;
14
+ create(modules: ContainerModule[], defaultScope?: interfaces.BindingScope): Container;
15
+ /**
16
+ * Retrieves the binding dictionary of the container.
17
+ * @returns The binding dictionary of the container.
18
+ */
19
+ getBindingDictionary(): Map<any, any>;
20
+ /**
21
+ * Retrieves the container options.
22
+ * @returns The container options.
23
+ */
24
+ getContainerOptions(): interfaces.ContainerOptions;
25
+ /**
26
+ * Retrieves the container.
27
+ * @returns The container.
28
+ */
29
+ get Container(): Container;
18
30
  }
19
31
  export { AppContainer };
20
32
  //# sourceMappingURL=app-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGvD;;;GAGG;AACH,cACM,YAAY;IAEd,OAAO,CAAC,SAAS,CAAY;IAE7B;;OAEG;;IAGH;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS;CAKvD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrF;;;GAGG;AACH,cACM,YAAY;IAEd,OAAO,CAAC,SAAS,CAAa;IAC9B;;;;;OAKG;IACI,MAAM,CACT,OAAO,EAAE,eAAe,EAAE,EAC1B,YAAY,GAAE,UAAU,CAAC,YAAuC,GACjE,SAAS;IAWZ;;;OAGG;IACI,oBAAoB,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;IAI5C;;;OAGG;IACI,mBAAmB,IAAI,UAAU,CAAC,gBAAgB;IAIzD;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,10 +1,15 @@
1
- import { ContainerModule } from "inversify";
1
+ import { ContainerModule, interfaces } from "inversify";
2
+ /**
3
+ * The scope decorator is a higher order function that can be used to decorate a class with a binding type.
4
+ * @param binding An instance of interfaces.BindingScope which represents the binding type.
5
+ * @returns A decorator function that can be used to decorate a class with a binding type.
6
+ */
7
+ declare const scope: (binding: interfaces.BindingScope) => (target: any) => void;
2
8
  /**
3
9
  * The BaseModule class provides methods for creating InversifyJS container modules.
4
10
  * @provide BaseModule
5
11
  */
6
12
  declare class BaseModule {
7
- constructor();
8
13
  /**
9
14
  * Create a map of symbols for the provided controllers.
10
15
  * @param controllers - An array of controller classes.
@@ -12,12 +17,13 @@ declare class BaseModule {
12
17
  */
13
18
  private static createSymbols;
14
19
  /**
15
- * Create an InversifyJS ContainerModule for the provided controllers.
16
- * @param controllers - An array of controller classes.
17
- * @returns A ContainerModule with the controller bindings.
18
- */
19
- static createContainerModule(controllers: any[]): ContainerModule;
20
+ * Create an InversifyJS ContainerModule for the provided controllers.
21
+ * @param controllers - An array of controller classes.
22
+ * @param scope - An optional binding scope to be used for all controllers.
23
+ * @returns A ContainerModule with the controller bindings.
24
+ */
25
+ static createContainerModule(controllers: any[], scope?: interfaces.BindingScope): ContainerModule;
20
26
  }
21
27
  declare const CreateModule: typeof BaseModule.createContainerModule;
22
- export { CreateModule };
28
+ export { CreateModule, scope };
23
29
  //# sourceMappingURL=container-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQ5C;;;GAGG;AACH,cACM,UAAU;;IAIZ;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa3B;;;;MAIE;WACW,qBAAqB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,eAAe;CAY3E;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS1E;;;;GAIG;AACH,QAAA,MAAM,KAAK,YAAa,WAAW,YAAY,cAClB,GAAG,SAiB/B,CAAC;AAOF;;;GAGG;AACH,cACM,UAAU;IACZ;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B;;;;;OAKG;WACW,qBAAqB,CAC/B,WAAW,EAAE,GAAG,EAAE,EAClB,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,GAChC,eAAe;CAyCrB;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- export { CreateModule } from "./container-module";
1
+ export { CreateModule, scope } from "./container-module";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./scope-binding";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const provideSingleton: (identifier: any) => (target: any) => any;
2
+ declare const provideTransient: (identifier: any) => (target: any) => any;
3
+ export { provideSingleton, provideTransient };
4
+ //# sourceMappingURL=scope-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -3,6 +3,7 @@ export * from "./common";
3
3
  export * from "./console";
4
4
  export * from "./container-module";
5
5
  export * from "./controller";
6
+ export * from "./decorator";
6
7
  export * from "./environment";
7
8
  export * from "./error";
8
9
  export * from "./logger";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -4,11 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  var AppContainer_1;
11
- import { Container } from "inversify";
8
+ import { BindingScopeEnum, Container } from "inversify";
12
9
  import { buildProviderModule, provide } from "inversify-binding-decorators";
13
10
  /**
14
11
  * The AppContainer class provides a container for managing dependency injection.
@@ -16,23 +13,43 @@ import { buildProviderModule, provide } from "inversify-binding-decorators";
16
13
  */
17
14
  let AppContainer = AppContainer_1 = class AppContainer {
18
15
  container;
19
- /**
20
- * Constructs a new instance of the AppContainer class.
21
- */
22
- constructor() { }
23
16
  /**
24
17
  * Creates and configures a new dependency injection container.
25
18
  * @param modules - An array of ContainerModule instances to load into the container.
19
+ * @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
26
20
  * @returns The configured dependency injection container.
27
21
  */
28
- create(modules) {
29
- this.container = new Container();
22
+ create(modules, defaultScope = BindingScopeEnum.Request) {
23
+ this.container = new Container({
24
+ autoBindInjectable: true,
25
+ defaultScope,
26
+ });
30
27
  this.container.load(buildProviderModule(), ...modules);
31
28
  return this.container;
32
29
  }
30
+ /**
31
+ * Retrieves the binding dictionary of the container.
32
+ * @returns The binding dictionary of the container.
33
+ */
34
+ getBindingDictionary() {
35
+ return this.container["_bindingDictionary"]._map;
36
+ }
37
+ /**
38
+ * Retrieves the container options.
39
+ * @returns The container options.
40
+ */
41
+ getContainerOptions() {
42
+ return this.container["options"];
43
+ }
44
+ /**
45
+ * Retrieves the container.
46
+ * @returns The container.
47
+ */
48
+ get Container() {
49
+ return this.container;
50
+ }
33
51
  };
34
52
  AppContainer = AppContainer_1 = __decorate([
35
- provide(AppContainer_1),
36
- __metadata("design:paramtypes", [])
53
+ provide(AppContainer_1)
37
54
  ], AppContainer);
38
55
  export { AppContainer };
@@ -4,18 +4,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
7
  var BaseModule_1;
11
- import { ContainerModule } from "inversify";
8
+ import { BindingScopeEnum, ContainerModule } from "inversify";
12
9
  import { provide } from "inversify-binding-decorators";
10
+ import { provideSingleton, provideTransient } from "../decorator";
11
+ /**
12
+ * Key to be used for storing and retrieving binding type metadata.
13
+ */
14
+ const BINDING_TYPE_METADATA_KEY = "binding-type";
15
+ /**
16
+ * The scope decorator is a higher order function that can be used to decorate a class with a binding type.
17
+ * @param binding An instance of interfaces.BindingScope which represents the binding type.
18
+ * @returns A decorator function that can be used to decorate a class with a binding type.
19
+ */
20
+ const scope = (binding) => {
21
+ return function (target) {
22
+ if (!Reflect.hasMetadata(BINDING_TYPE_METADATA_KEY, target)) {
23
+ Reflect.defineMetadata(BINDING_TYPE_METADATA_KEY, binding, target);
24
+ switch (binding) {
25
+ case BindingScopeEnum.Singleton:
26
+ provideSingleton(target);
27
+ break;
28
+ case BindingScopeEnum.Transient:
29
+ provideTransient(target);
30
+ break;
31
+ default:
32
+ provide(target);
33
+ break;
34
+ }
35
+ }
36
+ };
37
+ };
13
38
  /**
14
39
  * The BaseModule class provides methods for creating InversifyJS container modules.
15
40
  * @provide BaseModule
16
41
  */
17
42
  let BaseModule = BaseModule_1 = class BaseModule {
18
- constructor() { }
19
43
  /**
20
44
  * Create a map of symbols for the provided controllers.
21
45
  * @param controllers - An array of controller classes.
@@ -31,23 +55,51 @@ let BaseModule = BaseModule_1 = class BaseModule {
31
55
  return symbols;
32
56
  }
33
57
  /**
34
- * Create an InversifyJS ContainerModule for the provided controllers.
35
- * @param controllers - An array of controller classes.
36
- * @returns A ContainerModule with the controller bindings.
37
- */
38
- static createContainerModule(controllers) {
58
+ * Create an InversifyJS ContainerModule for the provided controllers.
59
+ * @param controllers - An array of controller classes.
60
+ * @param scope - An optional binding scope to be used for all controllers.
61
+ * @returns A ContainerModule with the controller bindings.
62
+ */
63
+ static createContainerModule(controllers, scope) {
39
64
  const symbols = BaseModule_1.createSymbols(controllers);
40
- return new ContainerModule(bind => {
41
- for (const symbol of symbols) {
42
- const target = symbol.valueOf();
43
- bind(target[0]).to(target[1]);
65
+ return new ContainerModule((bind) => {
66
+ for (const [symbol, target] of symbols) {
67
+ if (scope) {
68
+ switch (scope) {
69
+ case BindingScopeEnum.Singleton:
70
+ bind(symbol).to(target).inSingletonScope();
71
+ break;
72
+ case BindingScopeEnum.Transient:
73
+ bind(symbol).to(target).inTransientScope();
74
+ break;
75
+ case BindingScopeEnum.Request:
76
+ bind(symbol).to(target).inRequestScope();
77
+ break;
78
+ }
79
+ }
80
+ else {
81
+ const bindingType = Reflect.getMetadata(BINDING_TYPE_METADATA_KEY, target);
82
+ switch (bindingType) {
83
+ case BindingScopeEnum.Singleton:
84
+ bind(symbol).to(target).inSingletonScope();
85
+ break;
86
+ case BindingScopeEnum.Transient:
87
+ bind(symbol).to(target).inTransientScope();
88
+ break;
89
+ case BindingScopeEnum.Request:
90
+ bind(symbol).to(target).inRequestScope();
91
+ break;
92
+ default:
93
+ bind(symbol).to(target).inRequestScope();
94
+ break;
95
+ }
96
+ }
44
97
  }
45
98
  });
46
99
  }
47
100
  };
48
101
  BaseModule = BaseModule_1 = __decorate([
49
- provide(BaseModule_1),
50
- __metadata("design:paramtypes", [])
102
+ provide(BaseModule_1)
51
103
  ], BaseModule);
52
104
  const CreateModule = BaseModule.createContainerModule;
53
- export { CreateModule };
105
+ export { CreateModule, scope };
@@ -1 +1 @@
1
- export { CreateModule } from "./container-module";
1
+ export { CreateModule, scope } from "./container-module";
@@ -0,0 +1 @@
1
+ export * from "./scope-binding";
@@ -0,0 +1,8 @@
1
+ import { fluentProvide } from "inversify-binding-decorators";
2
+ const provideSingleton = (identifier) => {
3
+ return fluentProvide(identifier).inSingletonScope().done();
4
+ };
5
+ const provideTransient = (identifier) => {
6
+ return fluentProvide(identifier).inTransientScope().done();
7
+ };
8
+ export { provideSingleton, provideTransient };
package/lib/esm/index.mjs CHANGED
@@ -3,6 +3,7 @@ export * from "./common";
3
3
  export * from "./console";
4
4
  export * from "./container-module";
5
5
  export * from "./controller";
6
+ export * from "./decorator";
6
7
  export * from "./environment";
7
8
  export * from "./error";
8
9
  export * from "./logger";
@@ -1,20 +1,32 @@
1
- import { Container, ContainerModule } from "inversify";
1
+ import { Container, ContainerModule, interfaces } from "inversify";
2
2
  /**
3
3
  * The AppContainer class provides a container for managing dependency injection.
4
4
  * @provide AppContainer
5
5
  */
6
6
  declare class AppContainer {
7
7
  private container;
8
- /**
9
- * Constructs a new instance of the AppContainer class.
10
- */
11
- constructor();
12
8
  /**
13
9
  * Creates and configures a new dependency injection container.
14
10
  * @param modules - An array of ContainerModule instances to load into the container.
11
+ * @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
15
12
  * @returns The configured dependency injection container.
16
13
  */
17
- create(modules: ContainerModule[]): Container;
14
+ create(modules: ContainerModule[], defaultScope?: interfaces.BindingScope): Container;
15
+ /**
16
+ * Retrieves the binding dictionary of the container.
17
+ * @returns The binding dictionary of the container.
18
+ */
19
+ getBindingDictionary(): Map<any, any>;
20
+ /**
21
+ * Retrieves the container options.
22
+ * @returns The container options.
23
+ */
24
+ getContainerOptions(): interfaces.ContainerOptions;
25
+ /**
26
+ * Retrieves the container.
27
+ * @returns The container.
28
+ */
29
+ get Container(): Container;
18
30
  }
19
31
  export { AppContainer };
20
32
  //# sourceMappingURL=app-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGvD;;;GAGG;AACH,cACM,YAAY;IAEd,OAAO,CAAC,SAAS,CAAY;IAE7B;;OAEG;;IAGH;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS;CAKvD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrF;;;GAGG;AACH,cACM,YAAY;IAEd,OAAO,CAAC,SAAS,CAAa;IAC9B;;;;;OAKG;IACI,MAAM,CACT,OAAO,EAAE,eAAe,EAAE,EAC1B,YAAY,GAAE,UAAU,CAAC,YAAuC,GACjE,SAAS;IAWZ;;;OAGG;IACI,oBAAoB,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;IAI5C;;;OAGG;IACI,mBAAmB,IAAI,UAAU,CAAC,gBAAgB;IAIzD;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,10 +1,15 @@
1
- import { ContainerModule } from "inversify";
1
+ import { ContainerModule, interfaces } from "inversify";
2
+ /**
3
+ * The scope decorator is a higher order function that can be used to decorate a class with a binding type.
4
+ * @param binding An instance of interfaces.BindingScope which represents the binding type.
5
+ * @returns A decorator function that can be used to decorate a class with a binding type.
6
+ */
7
+ declare const scope: (binding: interfaces.BindingScope) => (target: any) => void;
2
8
  /**
3
9
  * The BaseModule class provides methods for creating InversifyJS container modules.
4
10
  * @provide BaseModule
5
11
  */
6
12
  declare class BaseModule {
7
- constructor();
8
13
  /**
9
14
  * Create a map of symbols for the provided controllers.
10
15
  * @param controllers - An array of controller classes.
@@ -12,12 +17,13 @@ declare class BaseModule {
12
17
  */
13
18
  private static createSymbols;
14
19
  /**
15
- * Create an InversifyJS ContainerModule for the provided controllers.
16
- * @param controllers - An array of controller classes.
17
- * @returns A ContainerModule with the controller bindings.
18
- */
19
- static createContainerModule(controllers: any[]): ContainerModule;
20
+ * Create an InversifyJS ContainerModule for the provided controllers.
21
+ * @param controllers - An array of controller classes.
22
+ * @param scope - An optional binding scope to be used for all controllers.
23
+ * @returns A ContainerModule with the controller bindings.
24
+ */
25
+ static createContainerModule(controllers: any[], scope?: interfaces.BindingScope): ContainerModule;
20
26
  }
21
27
  declare const CreateModule: typeof BaseModule.createContainerModule;
22
- export { CreateModule };
28
+ export { CreateModule, scope };
23
29
  //# sourceMappingURL=container-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQ5C;;;GAGG;AACH,cACM,UAAU;;IAIZ;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa3B;;;;MAIE;WACW,qBAAqB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,eAAe;CAY3E;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS1E;;;;GAIG;AACH,QAAA,MAAM,KAAK,YAAa,WAAW,YAAY,cAClB,GAAG,SAiB/B,CAAC;AAOF;;;GAGG;AACH,cACM,UAAU;IACZ;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B;;;;;OAKG;WACW,qBAAqB,CAC/B,WAAW,EAAE,GAAG,EAAE,EAClB,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,GAChC,eAAe;CAyCrB;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- export { CreateModule } from "./container-module";
1
+ export { CreateModule, scope } from "./container-module";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./scope-binding";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const provideSingleton: (identifier: any) => (target: any) => any;
2
+ declare const provideTransient: (identifier: any) => (target: any) => any;
3
+ export { provideSingleton, provideTransient };
4
+ //# sourceMappingURL=scope-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -3,6 +3,7 @@ export * from "./common";
3
3
  export * from "./console";
4
4
  export * from "./container-module";
5
5
  export * from "./controller";
6
+ export * from "./decorator";
6
7
  export * from "./environment";
7
8
  export * from "./error";
8
9
  export * from "./logger";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressots/core",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
5
5
  "author": "Richard Zampieri",
6
6
  "main": "./lib/cjs/index.js",
@@ -23,8 +23,8 @@
23
23
  "license": "MIT",
24
24
  "homepage": "https://expresso-ts.com",
25
25
  "funding": {
26
- "type": "",
27
- "url": ""
26
+ "type": "github",
27
+ "url": "https://github.com/sponsors/expressots"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressots/core",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
5
5
  "author": "Richard Zampieri",
6
6
  "main": "./lib/cjs/index.js",
@@ -23,8 +23,8 @@
23
23
  "license": "MIT",
24
24
  "homepage": "https://expresso-ts.com",
25
25
  "funding": {
26
- "type": "",
27
- "url": ""
26
+ "type": "github",
27
+ "url": "https://github.com/sponsors/expressots"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",