@expressots/core 2.11.0 → 2.12.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/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<a name="readme-top"></a>
|
|
2
2
|
|
|
3
3
|
<!-- PROJECT SHIELDS -->
|
|
4
|
+
|
|
5
|
+
[![Codecov][codecov-shield]][codecov-url]
|
|
6
|
+
[![NPM][npm-shield]][npm-url]
|
|
7
|
+
![Build][build-shield]
|
|
4
8
|
[![Contributors][contributors-shield]][contributors-url]
|
|
5
9
|
[![Forks][forks-shield]][forks-url]
|
|
6
10
|
[![Stargazers][stars-shield]][stars-url]
|
|
@@ -44,6 +48,7 @@
|
|
|
44
48
|
</details>
|
|
45
49
|
|
|
46
50
|
<!-- ABOUT THE PROJECT -->
|
|
51
|
+
|
|
47
52
|
# About The Project
|
|
48
53
|
|
|
49
54
|
ExpressoTS is a [Typescript](https://www.typescriptlang.org/) + [Node.js](https://nodejs.org/en/) lightweight framework for quick building scalable, easy to read and maintain, server-side applications 🐎
|
|
@@ -92,6 +97,12 @@ Distributed under the MIT License. See [`LICENSE.txt`](https://github.com/expres
|
|
|
92
97
|
|
|
93
98
|
<!-- MARKDOWN LINKS & IMAGES -->
|
|
94
99
|
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
|
100
|
+
|
|
101
|
+
[codecov-url]: https://codecov.io/gh/expressots/expressots
|
|
102
|
+
[codecov-shield]: https://img.shields.io/codecov/c/gh/expressots/expressots/main?style=for-the-badge&logo=codecov&labelColor=FB9AD1
|
|
103
|
+
[npm-url]: https://www.npmjs.com/package/@expressots/core
|
|
104
|
+
[npm-shield]: https://img.shields.io/npm/v/%40expressots%2Fcore?style=for-the-badge&logo=npm&color=9B3922
|
|
105
|
+
[build-shield]: https://img.shields.io/github/actions/workflow/status/expressots/expressots/build.yml?branch=main&style=for-the-badge&logo=github
|
|
95
106
|
[contributors-shield]: https://img.shields.io/github/contributors/expressots/expressots?style=for-the-badge
|
|
96
107
|
[contributors-url]: https://github.com/expressots/expressots/graphs/contributors
|
|
97
108
|
[forks-shield]: https://img.shields.io/github/forks/expressots/expressots?style=for-the-badge
|
package/lib/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [2.12.0](https://github.com/expressots/expressots/compare/2.11.0...2.12.0) (2024-06-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add code coverage report ([b4d4982](https://github.com/expressots/expressots/commit/b4d4982cf4cd8a0af647c5c20c5ce9aa1818d754))
|
|
9
|
+
* add codecov plugin bundler ([9cef3c2](https://github.com/expressots/expressots/commit/9cef3c2cf6624d24eb82b70e87dd0a2ba4ed50f6))
|
|
10
|
+
* add codecov plugin bundler ([1edd11f](https://github.com/expressots/expressots/commit/1edd11ff618aaeb0c51d286941c0792038fab982))
|
|
11
|
+
* bump @expressots/adapter-express from 1.2.1 to 1.2.2 ([6492983](https://github.com/expressots/expressots/commit/6492983a14a37589937a0586975b92969c7cbfa6))
|
|
12
|
+
* bump @types/node from 20.12.3 to 20.12.5 ([74924bf](https://github.com/expressots/expressots/commit/74924bf07cb5b7033c8faa70afa2462c6b37a527))
|
|
13
|
+
* bump @types/node from 20.12.5 to 20.12.7 ([a040456](https://github.com/expressots/expressots/commit/a04045644b140044f75ffa950adc8f132648da00))
|
|
14
|
+
* bump @typescript-eslint/eslint-plugin from 7.5.0 to 7.6.0 ([05e60bc](https://github.com/expressots/expressots/commit/05e60bc05e8b183b0a219df185a8fbb371e78e4e))
|
|
15
|
+
* bump @typescript-eslint/parser from 6.6.0 to 7.5.0 ([d2ade4b](https://github.com/expressots/expressots/commit/d2ade4b11bf3eebf996d34a8df7bf4ef96a33fcf))
|
|
16
|
+
* bump @typescript-eslint/parser from 7.5.0 to 7.6.0 ([6e06f7c](https://github.com/expressots/expressots/commit/6e06f7c71dc332908ac309a1ddb009b5d21c4d13))
|
|
17
|
+
* bump prettier from 3.2.5 to 3.3.0 ([8f68fa4](https://github.com/expressots/expressots/commit/8f68fa442cc58c92ada69577d3956e7681f701f2))
|
|
18
|
+
* update adapter express ver ([afcfd42](https://github.com/expressots/expressots/commit/afcfd4242e7c26291c84cacbde56902901a526bc))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* update codecov actions ([e1637e1](https://github.com/expressots/expressots/commit/e1637e19aabdd93960f29d3c1bd11ca7504443ee))
|
|
24
|
+
* update codecov actions ([4c2330f](https://github.com/expressots/expressots/commit/4c2330f01426332b01233c1ecd91e9e68b353ba1))
|
|
25
|
+
* upgrade dotenv from 16.0.3 to 16.4.5 ([29fb00f](https://github.com/expressots/expressots/commit/29fb00f3de2ce398634662244ef454efebceb20a))
|
|
26
|
+
* upgrade dotenv from 16.0.3 to 16.4.5 ([de7f53e](https://github.com/expressots/expressots/commit/de7f53e4d442296bd8e6da5bf41a2acbb0f421f1))
|
|
27
|
+
* upgrade dotenv from 16.0.3 to 16.4.5 ([e325d6c](https://github.com/expressots/expressots/commit/e325d6cdfa834b8cde67dd993e9f1c7b9cd19e84))
|
|
28
|
+
* upgrade inversify from 6.0.1 to 6.0.2 ([0975b5c](https://github.com/expressots/expressots/commit/0975b5c02079575104e0c2b151c4ec0e85dcbd0e))
|
|
29
|
+
* upgrade reflect-metadata from 0.2.1 to 0.2.2 ([ff93c46](https://github.com/expressots/expressots/commit/ff93c4698630bd0c202012188e13fcd1b06c0c15))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
|
|
34
|
+
* add codecov badge ([3964037](https://github.com/expressots/expressots/commit/39640373ed98db226b4d7ec4b6dce0fe48d6b53c))
|
|
35
|
+
* add npm and build badge ([79a0b87](https://github.com/expressots/expressots/commit/79a0b87b0c09007221cf618e664a4ae9fedea67d))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Code Refactoring
|
|
39
|
+
|
|
40
|
+
* container module scope binding for unit test and remove vitest config from tsconfig base ([a93bd31](https://github.com/expressots/expressots/commit/a93bd3115ad855281f9783915d93c74d689c3fae))
|
|
41
|
+
* remove vitest/eslint conflict, review pr template ([5e63d64](https://github.com/expressots/expressots/commit/5e63d6475034ca62db4991a77bc5fb0581b1b0e0))
|
|
42
|
+
* update adapter version to 1.4 ([ab53902](https://github.com/expressots/expressots/commit/ab53902edbc94d79b69a814d90d26030702c7465))
|
|
43
|
+
* update dependencies and jest config ([807c03e](https://github.com/expressots/expressots/commit/807c03e3dbf3441d3535392ecabd5246e462059a))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Tests
|
|
47
|
+
|
|
48
|
+
* add unit test application, common, console ([78c1989](https://github.com/expressots/expressots/commit/78c19895c1ed441fb5eee255fd28f1639fa89989))
|
|
49
|
+
* add unit test container, controller. decorator ([20591ea](https://github.com/expressots/expressots/commit/20591ea164a95fd2bbe5caa3483fd25d3582c2d7))
|
|
50
|
+
* add unit test env validator ([4eb63d5](https://github.com/expressots/expressots/commit/4eb63d5f16f4dcc73c4b3dff56c9cd07ef4f4f0d))
|
|
51
|
+
* add unit test error module ([4442d8e](https://github.com/expressots/expressots/commit/4442d8e9130fd16ed5698c6d395adf391d5c6224))
|
|
52
|
+
* add unit test middleware, provider, db, dto ([65e88ce](https://github.com/expressots/expressots/commit/65e88ce942aa8053b2a2cf6b0ae8283538ae44f0))
|
|
53
|
+
|
|
3
54
|
## [2.11.0](https://github.com/expressots/expressots/compare/2.10.0...2.11.0) (2024-04-04)
|
|
4
55
|
|
|
5
56
|
|
package/lib/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<a name="readme-top"></a>
|
|
2
2
|
|
|
3
3
|
<!-- PROJECT SHIELDS -->
|
|
4
|
+
|
|
5
|
+
[![Codecov][codecov-shield]][codecov-url]
|
|
6
|
+
[![NPM][npm-shield]][npm-url]
|
|
7
|
+
![Build][build-shield]
|
|
4
8
|
[![Contributors][contributors-shield]][contributors-url]
|
|
5
9
|
[![Forks][forks-shield]][forks-url]
|
|
6
10
|
[![Stargazers][stars-shield]][stars-url]
|
|
@@ -44,6 +48,7 @@
|
|
|
44
48
|
</details>
|
|
45
49
|
|
|
46
50
|
<!-- ABOUT THE PROJECT -->
|
|
51
|
+
|
|
47
52
|
# About The Project
|
|
48
53
|
|
|
49
54
|
ExpressoTS is a [Typescript](https://www.typescriptlang.org/) + [Node.js](https://nodejs.org/en/) lightweight framework for quick building scalable, easy to read and maintain, server-side applications 🐎
|
|
@@ -92,6 +97,12 @@ Distributed under the MIT License. See [`LICENSE.txt`](https://github.com/expres
|
|
|
92
97
|
|
|
93
98
|
<!-- MARKDOWN LINKS & IMAGES -->
|
|
94
99
|
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
|
100
|
+
|
|
101
|
+
[codecov-url]: https://codecov.io/gh/expressots/expressots
|
|
102
|
+
[codecov-shield]: https://img.shields.io/codecov/c/gh/expressots/expressots/main?style=for-the-badge&logo=codecov&labelColor=FB9AD1
|
|
103
|
+
[npm-url]: https://www.npmjs.com/package/@expressots/core
|
|
104
|
+
[npm-shield]: https://img.shields.io/npm/v/%40expressots%2Fcore?style=for-the-badge&logo=npm&color=9B3922
|
|
105
|
+
[build-shield]: https://img.shields.io/github/actions/workflow/status/expressots/expressots/build.yml?branch=main&style=for-the-badge&logo=github
|
|
95
106
|
[contributors-shield]: https://img.shields.io/github/contributors/expressots/expressots?style=for-the-badge
|
|
96
107
|
[contributors-url]: https://github.com/expressots/expressots/graphs/contributors
|
|
97
108
|
[forks-shield]: https://img.shields.io/github/forks/expressots/expressots?style=for-the-badge
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
var BaseModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.scope = exports.CreateModule = void 0;
|
|
10
|
+
exports.scope = exports.CreateModule = exports.BaseModule = exports.BINDING_TYPE_METADATA_KEY = void 0;
|
|
11
11
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
13
|
const inversify_1 = require("inversify");
|
|
@@ -16,7 +16,7 @@ const decorator_1 = require("../decorator");
|
|
|
16
16
|
/**
|
|
17
17
|
* Key to be used for storing and retrieving binding type metadata.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
exports.BINDING_TYPE_METADATA_KEY = "binding-type";
|
|
20
20
|
/**
|
|
21
21
|
* The scope decorator is a higher order function that can be used to decorate a class with a binding type.
|
|
22
22
|
* @param binding An instance of interfaces.BindingScope which represents the binding type.
|
|
@@ -24,8 +24,8 @@ const BINDING_TYPE_METADATA_KEY = "binding-type";
|
|
|
24
24
|
*/
|
|
25
25
|
const scope = (binding) => {
|
|
26
26
|
return function (target) {
|
|
27
|
-
if (!Reflect.hasMetadata(BINDING_TYPE_METADATA_KEY, target)) {
|
|
28
|
-
Reflect.defineMetadata(BINDING_TYPE_METADATA_KEY, binding, target);
|
|
27
|
+
if (!Reflect.hasMetadata(exports.BINDING_TYPE_METADATA_KEY, target)) {
|
|
28
|
+
Reflect.defineMetadata(exports.BINDING_TYPE_METADATA_KEY, binding, target);
|
|
29
29
|
switch (binding) {
|
|
30
30
|
case inversify_1.BindingScopeEnum.Singleton:
|
|
31
31
|
(0, decorator_1.provideSingleton)(target);
|
|
@@ -60,6 +60,23 @@ let BaseModule = BaseModule_1 = class BaseModule {
|
|
|
60
60
|
}
|
|
61
61
|
return symbols;
|
|
62
62
|
}
|
|
63
|
+
static bindToScope(symbol, target, bindingType, bind) {
|
|
64
|
+
switch (bindingType) {
|
|
65
|
+
case inversify_1.BindingScopeEnum.Singleton:
|
|
66
|
+
bind(symbol).to(target).inSingletonScope();
|
|
67
|
+
break;
|
|
68
|
+
case inversify_1.BindingScopeEnum.Transient:
|
|
69
|
+
bind(symbol).to(target).inTransientScope();
|
|
70
|
+
(0, decorator_1.provideTransient)(target);
|
|
71
|
+
break;
|
|
72
|
+
case inversify_1.BindingScopeEnum.Request:
|
|
73
|
+
bind(symbol).to(target).inRequestScope();
|
|
74
|
+
break;
|
|
75
|
+
default:
|
|
76
|
+
bind(symbol).to(target).inRequestScope();
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
63
80
|
/**
|
|
64
81
|
* Create an InversifyJS ContainerModule for the provided controllers.
|
|
65
82
|
* @param controllers - An array of controller classes.
|
|
@@ -71,40 +88,18 @@ let BaseModule = BaseModule_1 = class BaseModule {
|
|
|
71
88
|
return new inversify_1.ContainerModule((bind) => {
|
|
72
89
|
for (const [symbol, target] of symbols) {
|
|
73
90
|
if (scope) {
|
|
74
|
-
|
|
75
|
-
case inversify_1.BindingScopeEnum.Singleton:
|
|
76
|
-
bind(symbol).to(target).inSingletonScope();
|
|
77
|
-
break;
|
|
78
|
-
case inversify_1.BindingScopeEnum.Transient:
|
|
79
|
-
bind(symbol).to(target).inTransientScope();
|
|
80
|
-
break;
|
|
81
|
-
case inversify_1.BindingScopeEnum.Request:
|
|
82
|
-
bind(symbol).to(target).inRequestScope();
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
91
|
+
BaseModule_1.bindToScope(symbol, target, scope, bind);
|
|
85
92
|
}
|
|
86
93
|
else {
|
|
87
|
-
const bindingType = Reflect.getMetadata(BINDING_TYPE_METADATA_KEY, target);
|
|
88
|
-
|
|
89
|
-
case inversify_1.BindingScopeEnum.Singleton:
|
|
90
|
-
bind(symbol).to(target).inSingletonScope();
|
|
91
|
-
break;
|
|
92
|
-
case inversify_1.BindingScopeEnum.Transient:
|
|
93
|
-
bind(symbol).to(target).inTransientScope();
|
|
94
|
-
break;
|
|
95
|
-
case inversify_1.BindingScopeEnum.Request:
|
|
96
|
-
bind(symbol).to(target).inRequestScope();
|
|
97
|
-
break;
|
|
98
|
-
default:
|
|
99
|
-
bind(symbol).to(target).inRequestScope();
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
94
|
+
const bindingType = Reflect.getMetadata(exports.BINDING_TYPE_METADATA_KEY, target);
|
|
95
|
+
BaseModule_1.bindToScope(symbol, target, bindingType, bind);
|
|
102
96
|
}
|
|
103
97
|
}
|
|
104
98
|
});
|
|
105
99
|
}
|
|
106
100
|
};
|
|
107
|
-
BaseModule =
|
|
101
|
+
exports.BaseModule = BaseModule;
|
|
102
|
+
exports.BaseModule = BaseModule = BaseModule_1 = __decorate([
|
|
108
103
|
(0, inversify_binding_decorators_1.provide)(BaseModule)
|
|
109
104
|
], BaseModule);
|
|
110
105
|
const CreateModule = BaseModule.createContainerModule;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ContainerModule, interfaces } from "inversify";
|
|
2
|
+
/**
|
|
3
|
+
* Key to be used for storing and retrieving binding type metadata.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BINDING_TYPE_METADATA_KEY = "binding-type";
|
|
2
6
|
/**
|
|
3
7
|
* The scope decorator is a higher order function that can be used to decorate a class with a binding type.
|
|
4
8
|
* @param binding An instance of interfaces.BindingScope which represents the binding type.
|
|
@@ -9,13 +13,14 @@ declare const scope: (binding: interfaces.BindingScope) => (target: any) => void
|
|
|
9
13
|
* The BaseModule class provides methods for creating InversifyJS container modules.
|
|
10
14
|
* @provide BaseModule
|
|
11
15
|
*/
|
|
12
|
-
declare class BaseModule {
|
|
16
|
+
export declare class BaseModule {
|
|
13
17
|
/**
|
|
14
18
|
* Create a map of symbols for the provided controllers.
|
|
15
19
|
* @param controllers - An array of controller classes.
|
|
16
20
|
* @returns A map of symbols mapped to controller constructor functions.
|
|
17
21
|
*/
|
|
18
22
|
private static createSymbols;
|
|
23
|
+
static bindToScope(symbol: symbol, target: new () => any, bindingType: interfaces.BindingScope, bind: interfaces.Bind): void;
|
|
19
24
|
/**
|
|
20
25
|
* Create an InversifyJS ContainerModule for the provided controllers.
|
|
21
26
|
* @param controllers - An array of controller classes.
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -73,22 +73,24 @@
|
|
|
73
73
|
"reflect-metadata": "0.2.2"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
+
"@codecov/vite-plugin": "^0.0.1-beta.5",
|
|
76
77
|
"@commitlint/cli": "19.2.1",
|
|
77
78
|
"@commitlint/config-conventional": "19.1.0",
|
|
78
|
-
"@expressots/adapter-express": "
|
|
79
|
+
"@expressots/adapter-express": "1.4.0",
|
|
79
80
|
"@release-it/conventional-changelog": "7.0.2",
|
|
80
81
|
"@types/express": "4.17.21",
|
|
81
|
-
"@types/node": "20.12.
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
83
|
-
"@typescript-eslint/parser": "
|
|
82
|
+
"@types/node": "20.12.7",
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
84
|
+
"@typescript-eslint/parser": "7.6.0",
|
|
84
85
|
"@vitest/coverage-v8": "1.4.0",
|
|
85
86
|
"eslint": "8.57.0",
|
|
86
87
|
"eslint-config-prettier": "9.1.0",
|
|
87
88
|
"husky": "9.0.11",
|
|
88
|
-
"prettier": "3.
|
|
89
|
+
"prettier": "3.3.0",
|
|
89
90
|
"release-it": "16.3.0",
|
|
90
91
|
"typescript": "5.2.2",
|
|
91
|
-
"vite": "5.2.
|
|
92
|
+
"vite": "5.2.8",
|
|
93
|
+
"vite-tsconfig-paths": "4.3.2",
|
|
92
94
|
"vitest": "1.4.0"
|
|
93
95
|
},
|
|
94
96
|
"release-it": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -73,22 +73,24 @@
|
|
|
73
73
|
"reflect-metadata": "0.2.2"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
+
"@codecov/vite-plugin": "^0.0.1-beta.5",
|
|
76
77
|
"@commitlint/cli": "19.2.1",
|
|
77
78
|
"@commitlint/config-conventional": "19.1.0",
|
|
78
|
-
"@expressots/adapter-express": "
|
|
79
|
+
"@expressots/adapter-express": "1.4.0",
|
|
79
80
|
"@release-it/conventional-changelog": "7.0.2",
|
|
80
81
|
"@types/express": "4.17.21",
|
|
81
|
-
"@types/node": "20.12.
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
83
|
-
"@typescript-eslint/parser": "
|
|
82
|
+
"@types/node": "20.12.7",
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
84
|
+
"@typescript-eslint/parser": "7.6.0",
|
|
84
85
|
"@vitest/coverage-v8": "1.4.0",
|
|
85
86
|
"eslint": "8.57.0",
|
|
86
87
|
"eslint-config-prettier": "9.1.0",
|
|
87
88
|
"husky": "9.0.11",
|
|
88
|
-
"prettier": "3.
|
|
89
|
+
"prettier": "3.3.0",
|
|
89
90
|
"release-it": "16.3.0",
|
|
90
91
|
"typescript": "5.2.2",
|
|
91
|
-
"vite": "5.2.
|
|
92
|
+
"vite": "5.2.8",
|
|
93
|
+
"vite-tsconfig-paths": "4.3.2",
|
|
92
94
|
"vitest": "1.4.0"
|
|
93
95
|
},
|
|
94
96
|
"release-it": {
|