koatty 3.6.8-2 → 3.6.10-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/.rollup.config.js +63 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -29
- package/dist/index.mjs +18 -29
- package/dist/package.json +24 -29
- package/package.json +24 -29
- package/jest-html-reporters-attach/index.js +0 -58
- package/jest-html-reporters-attach/result.js +0 -1
@@ -0,0 +1,63 @@
|
|
1
|
+
/*
|
2
|
+
* @Description:
|
3
|
+
* @Usage:
|
4
|
+
* @Author: richen
|
5
|
+
* @Date: 2021-12-17 10:20:44
|
6
|
+
* @LastEditTime: 2022-05-27 11:50:23
|
7
|
+
*/
|
8
|
+
import json from "@rollup/plugin-json";
|
9
|
+
import typescript from 'rollup-plugin-typescript2';
|
10
|
+
// import babel from '@rollup/plugin-babel';
|
11
|
+
|
12
|
+
export default [
|
13
|
+
{
|
14
|
+
input: './src/index.ts',
|
15
|
+
output: [{
|
16
|
+
format: 'cjs',
|
17
|
+
file: './dist/index.js',
|
18
|
+
banner: require('./scripts/copyright')
|
19
|
+
}],
|
20
|
+
plugins: [
|
21
|
+
// babel({
|
22
|
+
// babelHelpers: "runtime",
|
23
|
+
// configFile: './babel.config.js',
|
24
|
+
// exclude: 'node_modules/**',
|
25
|
+
// }),
|
26
|
+
json(),
|
27
|
+
typescript({
|
28
|
+
tsconfigOverride: {
|
29
|
+
compilerOptions: {
|
30
|
+
declaration: false,
|
31
|
+
declarationMap: false,
|
32
|
+
module: "ESNext"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
})
|
36
|
+
]
|
37
|
+
},
|
38
|
+
{
|
39
|
+
input: './src/index.ts',
|
40
|
+
output: [{
|
41
|
+
format: 'es',
|
42
|
+
file: './dist/index.mjs',
|
43
|
+
banner: require('./scripts/copyright')
|
44
|
+
}],
|
45
|
+
plugins: [
|
46
|
+
// babel({
|
47
|
+
// babelHelpers: "runtime",
|
48
|
+
// configFile: './babel.config.js',
|
49
|
+
// exclude: 'node_modules/**',
|
50
|
+
// }),
|
51
|
+
json(),
|
52
|
+
typescript({
|
53
|
+
tsconfigOverride: {
|
54
|
+
compilerOptions: {
|
55
|
+
declaration: false,
|
56
|
+
declarationMap: false,
|
57
|
+
module: "ESNext"
|
58
|
+
}
|
59
|
+
}
|
60
|
+
})
|
61
|
+
]
|
62
|
+
}
|
63
|
+
]
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
4
|
|
5
|
+
### [3.6.10-0](https://github.com/thinkkoa/koatty/compare/v3.6.9...v3.6.10-0) (2022-08-19)
|
6
|
+
|
7
|
+
### [3.6.9](https://github.com/thinkkoa/koatty/compare/v3.6.8...v3.6.9) (2022-07-27)
|
8
|
+
|
9
|
+
### [3.6.8](https://github.com/thinkkoa/koatty/compare/v3.6.8-2...v3.6.8) (2022-05-27)
|
10
|
+
|
5
11
|
### [3.6.8-2](https://github.com/thinkkoa/koatty/compare/v3.6.8-1...v3.6.8-2) (2022-03-15)
|
6
12
|
|
7
13
|
### [3.6.8-1](https://github.com/thinkkoa/koatty/compare/v3.6.8-0...v3.6.8-1) (2022-03-15)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2022-
|
3
|
+
* @Date: 2022-08-19 14:51:16
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -491,14 +491,13 @@ class Loader {
|
|
491
491
|
* @memberof Loader
|
492
492
|
*/
|
493
493
|
static initialize(app) {
|
494
|
-
|
495
|
-
const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
|
494
|
+
const env = (process.execArgv ?? []).join(",");
|
496
495
|
if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
|
497
496
|
app.appDebug = true;
|
498
497
|
}
|
499
498
|
// app.env
|
500
499
|
app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
|
501
|
-
if ((env.indexOf('--production') > -1) || ((
|
500
|
+
if ((env.indexOf('--production') > -1) || ((app.env ?? '').indexOf('pro') > -1)) {
|
502
501
|
app.appDebug = false;
|
503
502
|
}
|
504
503
|
if (app.appDebug) {
|
@@ -602,8 +601,7 @@ class Loader {
|
|
602
601
|
* @memberof Loader
|
603
602
|
*/
|
604
603
|
static SetLogger(app) {
|
605
|
-
|
606
|
-
const configs = (_a = app.getMetaData("_configs")) !== null && _a !== void 0 ? _a : {};
|
604
|
+
const configs = app.getMetaData("_configs") ?? {};
|
607
605
|
//Logger
|
608
606
|
if (configs.config) {
|
609
607
|
const opt = configs.config;
|
@@ -679,7 +677,6 @@ class Loader {
|
|
679
677
|
* @memberof Loader
|
680
678
|
*/
|
681
679
|
static async LoadMiddlewares(app, loadPath) {
|
682
|
-
var _a;
|
683
680
|
let middlewareConf = app.config(undefined, "middleware");
|
684
681
|
if (koatty_lib.Helper.isEmpty(middlewareConf)) {
|
685
682
|
middlewareConf = { config: {}, list: [] };
|
@@ -688,12 +685,11 @@ class Loader {
|
|
688
685
|
koatty_loader.Load(loadPath || ["./middleware"], app.thinkPath);
|
689
686
|
//Mount application middleware
|
690
687
|
// const middleware: any = {};
|
691
|
-
const appMiddleware =
|
688
|
+
const appMiddleware = koatty_container.IOCContainer.listClass("MIDDLEWARE") ?? [];
|
692
689
|
appMiddleware.push({ id: "TraceMiddleware", target: TraceMiddleware });
|
693
690
|
appMiddleware.push({ id: "PayloadMiddleware", target: PayloadMiddleware });
|
694
691
|
appMiddleware.forEach((item) => {
|
695
|
-
|
696
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("MIDDLEWARE:", "");
|
692
|
+
item.id = (item.id ?? "").replace("MIDDLEWARE:", "");
|
697
693
|
if (item.id && koatty_lib.Helper.isClass(item.target)) {
|
698
694
|
koatty_container.IOCContainer.reg(item.id, item.target, { scope: "Prototype", type: "MIDDLEWARE", args: [] });
|
699
695
|
}
|
@@ -751,8 +747,7 @@ class Loader {
|
|
751
747
|
const controllerList = koatty_container.IOCContainer.listClass("CONTROLLER");
|
752
748
|
const controllers = [];
|
753
749
|
controllerList.forEach((item) => {
|
754
|
-
|
755
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("CONTROLLER:", "");
|
750
|
+
item.id = (item.id ?? "").replace("CONTROLLER:", "");
|
756
751
|
if (item.id && koatty_lib.Helper.isClass(item.target)) {
|
757
752
|
Logger.Debug(`Load controller: ${item.id}`);
|
758
753
|
// registering to IOC
|
@@ -776,8 +771,7 @@ class Loader {
|
|
776
771
|
static LoadServices(app) {
|
777
772
|
const serviceList = koatty_container.IOCContainer.listClass("SERVICE");
|
778
773
|
serviceList.forEach((item) => {
|
779
|
-
|
780
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("SERVICE:", "");
|
774
|
+
item.id = (item.id ?? "").replace("SERVICE:", "");
|
781
775
|
if (item.id && koatty_lib.Helper.isClass(item.target)) {
|
782
776
|
Logger.Debug(`Load service: ${item.id}`);
|
783
777
|
// registering to IOC
|
@@ -795,8 +789,7 @@ class Loader {
|
|
795
789
|
static LoadComponents(app) {
|
796
790
|
const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
|
797
791
|
componentList.forEach((item) => {
|
798
|
-
|
799
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("COMPONENT:", "");
|
792
|
+
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
800
793
|
if (item.id && !(item.id).endsWith("Plugin") && koatty_lib.Helper.isClass(item.target)) {
|
801
794
|
Logger.Debug(`Load component: ${item.id}`);
|
802
795
|
// registering to IOC
|
@@ -812,7 +805,6 @@ class Loader {
|
|
812
805
|
* @memberof Loader
|
813
806
|
*/
|
814
807
|
static async LoadPlugins(app) {
|
815
|
-
var _a;
|
816
808
|
const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
|
817
809
|
let pluginsConf = app.config(undefined, "plugin");
|
818
810
|
if (koatty_lib.Helper.isEmpty(pluginsConf)) {
|
@@ -820,8 +812,7 @@ class Loader {
|
|
820
812
|
}
|
821
813
|
const pluginList = [];
|
822
814
|
componentList.forEach(async (item) => {
|
823
|
-
|
824
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("COMPONENT:", "");
|
815
|
+
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
825
816
|
if (item.id && (item.id).endsWith("Plugin") && koatty_lib.Helper.isClass(item.target)) {
|
826
817
|
// registering to IOC
|
827
818
|
koatty_container.IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
@@ -842,12 +833,12 @@ class Loader {
|
|
842
833
|
continue;
|
843
834
|
}
|
844
835
|
// sync exec
|
845
|
-
await handle.run(
|
836
|
+
await handle.run(pluginsConf.config[key] ?? {}, app);
|
846
837
|
}
|
847
838
|
}
|
848
839
|
}
|
849
840
|
|
850
|
-
var version = "3.6.
|
841
|
+
var version = "3.6.10-0";
|
851
842
|
var engines = {
|
852
843
|
node: ">12.0.0"
|
853
844
|
};
|
@@ -998,9 +989,8 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
|
|
998
989
|
* @returns {*}
|
999
990
|
*/
|
1000
991
|
const newRouter = function (app) {
|
1001
|
-
var _a;
|
1002
992
|
const protocol = app.config("protocol") || "http";
|
1003
|
-
const options =
|
993
|
+
const options = app.config(undefined, 'router') ?? {};
|
1004
994
|
const router = koatty_router.NewRouter(app, options, protocol);
|
1005
995
|
return router;
|
1006
996
|
};
|
@@ -1037,12 +1027,11 @@ const listenCallback = (app) => {
|
|
1037
1027
|
* @returns {*}
|
1038
1028
|
*/
|
1039
1029
|
const newServe = function (app) {
|
1040
|
-
var _a, _b, _c;
|
1041
1030
|
const protocol = app.config("protocol") || "http";
|
1042
1031
|
const port = process.env.PORT || process.env.APP_PORT ||
|
1043
1032
|
app.config('app_port') || 3000;
|
1044
1033
|
const hostname = process.env.IP ||
|
1045
|
-
|
1034
|
+
process.env.HOSTNAME?.replace(/-/g, '.') || app.config('app_host') || '127.0.0.1';
|
1046
1035
|
const options = {
|
1047
1036
|
hostname,
|
1048
1037
|
port,
|
@@ -1055,8 +1044,8 @@ const newServe = function (app) {
|
|
1055
1044
|
};
|
1056
1045
|
const pm = new Set(["https", "http2", "wss"]);
|
1057
1046
|
if (pm.has(options.protocol)) {
|
1058
|
-
const keyFile =
|
1059
|
-
const crtFile =
|
1047
|
+
const keyFile = app.config("key_file") ?? "";
|
1048
|
+
const crtFile = app.config("crt_file") ?? "";
|
1060
1049
|
options.ext.key = fs__default["default"].readFileSync(keyFile).toString();
|
1061
1050
|
options.ext.cert = fs__default["default"].readFileSync(crtFile).toString();
|
1062
1051
|
}
|
@@ -1127,7 +1116,7 @@ function ComponentScan(scanPath) {
|
|
1127
1116
|
if (!(target.prototype instanceof koatty_core.Koatty)) {
|
1128
1117
|
throw new Error(`class does not inherit from Koatty`);
|
1129
1118
|
}
|
1130
|
-
scanPath = scanPath
|
1119
|
+
scanPath = scanPath ?? '';
|
1131
1120
|
koatty_container.IOCContainer.saveClassMetadata(koatty_container.TAGGED_CLS, COMPONENT_SCAN, scanPath, target);
|
1132
1121
|
};
|
1133
1122
|
}
|
@@ -1143,7 +1132,7 @@ function ConfigurationScan(scanPath) {
|
|
1143
1132
|
if (!(target.prototype instanceof koatty_core.Koatty)) {
|
1144
1133
|
throw new Error(`class does not inherit from Koatty`);
|
1145
1134
|
}
|
1146
|
-
scanPath = scanPath
|
1135
|
+
scanPath = scanPath ?? '';
|
1147
1136
|
koatty_container.IOCContainer.saveClassMetadata(koatty_container.TAGGED_CLS, CONFIGURATION_SCAN, scanPath, target);
|
1148
1137
|
};
|
1149
1138
|
}
|
package/dist/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2022-
|
3
|
+
* @Date: 2022-08-19 14:51:16
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -471,14 +471,13 @@ class Loader {
|
|
471
471
|
* @memberof Loader
|
472
472
|
*/
|
473
473
|
static initialize(app) {
|
474
|
-
|
475
|
-
const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
|
474
|
+
const env = (process.execArgv ?? []).join(",");
|
476
475
|
if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
|
477
476
|
app.appDebug = true;
|
478
477
|
}
|
479
478
|
// app.env
|
480
479
|
app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
|
481
|
-
if ((env.indexOf('--production') > -1) || ((
|
480
|
+
if ((env.indexOf('--production') > -1) || ((app.env ?? '').indexOf('pro') > -1)) {
|
482
481
|
app.appDebug = false;
|
483
482
|
}
|
484
483
|
if (app.appDebug) {
|
@@ -582,8 +581,7 @@ class Loader {
|
|
582
581
|
* @memberof Loader
|
583
582
|
*/
|
584
583
|
static SetLogger(app) {
|
585
|
-
|
586
|
-
const configs = (_a = app.getMetaData("_configs")) !== null && _a !== void 0 ? _a : {};
|
584
|
+
const configs = app.getMetaData("_configs") ?? {};
|
587
585
|
//Logger
|
588
586
|
if (configs.config) {
|
589
587
|
const opt = configs.config;
|
@@ -659,7 +657,6 @@ class Loader {
|
|
659
657
|
* @memberof Loader
|
660
658
|
*/
|
661
659
|
static async LoadMiddlewares(app, loadPath) {
|
662
|
-
var _a;
|
663
660
|
let middlewareConf = app.config(undefined, "middleware");
|
664
661
|
if (Helper.isEmpty(middlewareConf)) {
|
665
662
|
middlewareConf = { config: {}, list: [] };
|
@@ -668,12 +665,11 @@ class Loader {
|
|
668
665
|
Load(loadPath || ["./middleware"], app.thinkPath);
|
669
666
|
//Mount application middleware
|
670
667
|
// const middleware: any = {};
|
671
|
-
const appMiddleware =
|
668
|
+
const appMiddleware = IOCContainer.listClass("MIDDLEWARE") ?? [];
|
672
669
|
appMiddleware.push({ id: "TraceMiddleware", target: TraceMiddleware });
|
673
670
|
appMiddleware.push({ id: "PayloadMiddleware", target: PayloadMiddleware });
|
674
671
|
appMiddleware.forEach((item) => {
|
675
|
-
|
676
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("MIDDLEWARE:", "");
|
672
|
+
item.id = (item.id ?? "").replace("MIDDLEWARE:", "");
|
677
673
|
if (item.id && Helper.isClass(item.target)) {
|
678
674
|
IOCContainer.reg(item.id, item.target, { scope: "Prototype", type: "MIDDLEWARE", args: [] });
|
679
675
|
}
|
@@ -731,8 +727,7 @@ class Loader {
|
|
731
727
|
const controllerList = IOCContainer.listClass("CONTROLLER");
|
732
728
|
const controllers = [];
|
733
729
|
controllerList.forEach((item) => {
|
734
|
-
|
735
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("CONTROLLER:", "");
|
730
|
+
item.id = (item.id ?? "").replace("CONTROLLER:", "");
|
736
731
|
if (item.id && Helper.isClass(item.target)) {
|
737
732
|
Logger.Debug(`Load controller: ${item.id}`);
|
738
733
|
// registering to IOC
|
@@ -756,8 +751,7 @@ class Loader {
|
|
756
751
|
static LoadServices(app) {
|
757
752
|
const serviceList = IOCContainer.listClass("SERVICE");
|
758
753
|
serviceList.forEach((item) => {
|
759
|
-
|
760
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("SERVICE:", "");
|
754
|
+
item.id = (item.id ?? "").replace("SERVICE:", "");
|
761
755
|
if (item.id && Helper.isClass(item.target)) {
|
762
756
|
Logger.Debug(`Load service: ${item.id}`);
|
763
757
|
// registering to IOC
|
@@ -775,8 +769,7 @@ class Loader {
|
|
775
769
|
static LoadComponents(app) {
|
776
770
|
const componentList = IOCContainer.listClass("COMPONENT");
|
777
771
|
componentList.forEach((item) => {
|
778
|
-
|
779
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("COMPONENT:", "");
|
772
|
+
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
780
773
|
if (item.id && !(item.id).endsWith("Plugin") && Helper.isClass(item.target)) {
|
781
774
|
Logger.Debug(`Load component: ${item.id}`);
|
782
775
|
// registering to IOC
|
@@ -792,7 +785,6 @@ class Loader {
|
|
792
785
|
* @memberof Loader
|
793
786
|
*/
|
794
787
|
static async LoadPlugins(app) {
|
795
|
-
var _a;
|
796
788
|
const componentList = IOCContainer.listClass("COMPONENT");
|
797
789
|
let pluginsConf = app.config(undefined, "plugin");
|
798
790
|
if (Helper.isEmpty(pluginsConf)) {
|
@@ -800,8 +792,7 @@ class Loader {
|
|
800
792
|
}
|
801
793
|
const pluginList = [];
|
802
794
|
componentList.forEach(async (item) => {
|
803
|
-
|
804
|
-
item.id = ((_a = item.id) !== null && _a !== void 0 ? _a : "").replace("COMPONENT:", "");
|
795
|
+
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
805
796
|
if (item.id && (item.id).endsWith("Plugin") && Helper.isClass(item.target)) {
|
806
797
|
// registering to IOC
|
807
798
|
IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
@@ -822,12 +813,12 @@ class Loader {
|
|
822
813
|
continue;
|
823
814
|
}
|
824
815
|
// sync exec
|
825
|
-
await handle.run(
|
816
|
+
await handle.run(pluginsConf.config[key] ?? {}, app);
|
826
817
|
}
|
827
818
|
}
|
828
819
|
}
|
829
820
|
|
830
|
-
var version = "3.6.
|
821
|
+
var version = "3.6.10-0";
|
831
822
|
var engines = {
|
832
823
|
node: ">12.0.0"
|
833
824
|
};
|
@@ -978,9 +969,8 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
|
|
978
969
|
* @returns {*}
|
979
970
|
*/
|
980
971
|
const newRouter = function (app) {
|
981
|
-
var _a;
|
982
972
|
const protocol = app.config("protocol") || "http";
|
983
|
-
const options =
|
973
|
+
const options = app.config(undefined, 'router') ?? {};
|
984
974
|
const router = NewRouter(app, options, protocol);
|
985
975
|
return router;
|
986
976
|
};
|
@@ -1017,12 +1007,11 @@ const listenCallback = (app) => {
|
|
1017
1007
|
* @returns {*}
|
1018
1008
|
*/
|
1019
1009
|
const newServe = function (app) {
|
1020
|
-
var _a, _b, _c;
|
1021
1010
|
const protocol = app.config("protocol") || "http";
|
1022
1011
|
const port = process.env.PORT || process.env.APP_PORT ||
|
1023
1012
|
app.config('app_port') || 3000;
|
1024
1013
|
const hostname = process.env.IP ||
|
1025
|
-
|
1014
|
+
process.env.HOSTNAME?.replace(/-/g, '.') || app.config('app_host') || '127.0.0.1';
|
1026
1015
|
const options = {
|
1027
1016
|
hostname,
|
1028
1017
|
port,
|
@@ -1035,8 +1024,8 @@ const newServe = function (app) {
|
|
1035
1024
|
};
|
1036
1025
|
const pm = new Set(["https", "http2", "wss"]);
|
1037
1026
|
if (pm.has(options.protocol)) {
|
1038
|
-
const keyFile =
|
1039
|
-
const crtFile =
|
1027
|
+
const keyFile = app.config("key_file") ?? "";
|
1028
|
+
const crtFile = app.config("crt_file") ?? "";
|
1040
1029
|
options.ext.key = fs.readFileSync(keyFile).toString();
|
1041
1030
|
options.ext.cert = fs.readFileSync(crtFile).toString();
|
1042
1031
|
}
|
@@ -1107,7 +1096,7 @@ function ComponentScan(scanPath) {
|
|
1107
1096
|
if (!(target.prototype instanceof Koatty)) {
|
1108
1097
|
throw new Error(`class does not inherit from Koatty`);
|
1109
1098
|
}
|
1110
|
-
scanPath = scanPath
|
1099
|
+
scanPath = scanPath ?? '';
|
1111
1100
|
IOCContainer.saveClassMetadata(TAGGED_CLS, COMPONENT_SCAN, scanPath, target);
|
1112
1101
|
};
|
1113
1102
|
}
|
@@ -1123,7 +1112,7 @@ function ConfigurationScan(scanPath) {
|
|
1123
1112
|
if (!(target.prototype instanceof Koatty)) {
|
1124
1113
|
throw new Error(`class does not inherit from Koatty`);
|
1125
1114
|
}
|
1126
|
-
scanPath = scanPath
|
1115
|
+
scanPath = scanPath ?? '';
|
1127
1116
|
IOCContainer.saveClassMetadata(TAGGED_CLS, CONFIGURATION_SCAN, scanPath, target);
|
1128
1117
|
};
|
1129
1118
|
}
|
package/dist/package.json
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.6.
|
3
|
+
"version": "3.6.10-0",
|
4
4
|
"description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
|
5
5
|
"scripts": {
|
6
6
|
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
7
7
|
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
8
|
-
"build:js": "del-cli --force dist && npx rollup -c",
|
8
|
+
"build:js": "del-cli --force dist && npx rollup -c .rollup.config.js",
|
9
9
|
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
10
10
|
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
11
11
|
"eslint": "eslint --ext .ts,.js ./",
|
12
12
|
"prepublishOnly": "npm test && npm run build",
|
13
13
|
"prerelease": "npm test && npm run build",
|
14
|
+
"pub": "git push --follow-tags origin && npm publish",
|
14
15
|
"release": "standard-version",
|
15
16
|
"release:pre": "npm run release -- --prerelease",
|
16
17
|
"release:major": "npm run release -- --release-as major",
|
@@ -50,54 +51,48 @@
|
|
50
51
|
}
|
51
52
|
],
|
52
53
|
"devDependencies": {
|
53
|
-
"@commitlint/cli": "^
|
54
|
-
"@commitlint/config-conventional": "^
|
54
|
+
"@commitlint/cli": "^17.x.x",
|
55
|
+
"@commitlint/config-conventional": "^17.x.x",
|
55
56
|
"@microsoft/api-documenter": "^7.x.x",
|
56
57
|
"@microsoft/api-extractor": "^7.x.x",
|
57
58
|
"@rollup/plugin-json": "^4.x.x",
|
58
59
|
"@types/jest": "^27.x.x",
|
59
60
|
"@types/koa": "^2.x.x",
|
60
|
-
"@types/koa__router": "^8.
|
61
|
+
"@types/koa__router": "^8.0.11",
|
61
62
|
"@types/node": "^16.x.x",
|
62
|
-
"@types/
|
63
|
-
"@types/ws": "^8.x.x",
|
63
|
+
"@types/ws": "^8.5.3",
|
64
64
|
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
65
65
|
"@typescript-eslint/parser": "^5.x.x",
|
66
66
|
"conventional-changelog-cli": "^2.x.x",
|
67
67
|
"copyfiles": "^2.x.x",
|
68
68
|
"del-cli": "^4.x.x",
|
69
69
|
"eslint": "^8.x.x",
|
70
|
-
"eslint-plugin-jest": "^
|
70
|
+
"eslint-plugin-jest": "^26.x.x",
|
71
71
|
"husky": "^4.x.x",
|
72
|
-
"jest": "^
|
73
|
-
"jest-html-reporters": "^
|
74
|
-
"koatty_cacheable": "^1.x.x",
|
75
|
-
"koatty_schedule": "^1.x.x",
|
76
|
-
"koatty_store": "^1.x.x",
|
77
|
-
"koatty_validation": "^1.x.x",
|
72
|
+
"jest": "^28.x.x",
|
73
|
+
"jest-html-reporters": "^3.x.x",
|
78
74
|
"rollup": "^2.x.x",
|
79
75
|
"rollup-plugin-typescript2": "^0.x.x",
|
80
76
|
"standard-version": "^9.x.x",
|
81
|
-
"
|
82
|
-
"ts-jest": "^27.x.x",
|
77
|
+
"ts-jest": "^28.x.x",
|
83
78
|
"ts-node": "^10.x.x",
|
84
79
|
"typescript": "^4.x.x"
|
85
80
|
},
|
86
81
|
"dependencies": {
|
87
82
|
"koa": "2.13.4",
|
88
|
-
"koatty_config": "1.1.
|
89
|
-
"koatty_container": "1.7.
|
90
|
-
"koatty_core": "1.6.
|
91
|
-
"koatty_exception": "1.2.
|
92
|
-
"koatty_lib": "1.2.
|
93
|
-
"koatty_loader": "1.0.
|
94
|
-
"koatty_logger": "1.3.
|
95
|
-
"koatty_payload": "1.3.
|
96
|
-
"koatty_proto": "1.1.
|
97
|
-
"koatty_router": "1.7.
|
98
|
-
"koatty_serve": "1.4.
|
99
|
-
"koatty_trace": "1.6.
|
83
|
+
"koatty_config": "1.1.5",
|
84
|
+
"koatty_container": "1.7.10",
|
85
|
+
"koatty_core": "1.6.8",
|
86
|
+
"koatty_exception": "1.2.7",
|
87
|
+
"koatty_lib": "1.2.12",
|
88
|
+
"koatty_loader": "1.0.3",
|
89
|
+
"koatty_logger": "1.3.14",
|
90
|
+
"koatty_payload": "1.3.18",
|
91
|
+
"koatty_proto": "1.1.8",
|
92
|
+
"koatty_router": "1.7.8",
|
93
|
+
"koatty_serve": "1.4.10",
|
94
|
+
"koatty_trace": "1.6.9",
|
100
95
|
"reflect-metadata": "0.1.13",
|
101
|
-
"tslib": "2.
|
96
|
+
"tslib": "2.4.0"
|
102
97
|
}
|
103
98
|
}
|
package/package.json
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.6.
|
3
|
+
"version": "3.6.10-0",
|
4
4
|
"description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
|
5
5
|
"scripts": {
|
6
6
|
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
7
7
|
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
8
|
-
"build:js": "del-cli --force dist && npx rollup -c",
|
8
|
+
"build:js": "del-cli --force dist && npx rollup -c .rollup.config.js",
|
9
9
|
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
10
10
|
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
11
11
|
"eslint": "eslint --ext .ts,.js ./",
|
12
12
|
"prepublishOnly": "npm test && npm run build",
|
13
13
|
"prerelease": "npm test && npm run build",
|
14
|
+
"pub": "git push --follow-tags origin && npm publish",
|
14
15
|
"release": "standard-version",
|
15
16
|
"release:pre": "npm run release -- --prerelease",
|
16
17
|
"release:major": "npm run release -- --release-as major",
|
@@ -50,54 +51,48 @@
|
|
50
51
|
}
|
51
52
|
],
|
52
53
|
"devDependencies": {
|
53
|
-
"@commitlint/cli": "^
|
54
|
-
"@commitlint/config-conventional": "^
|
54
|
+
"@commitlint/cli": "^17.x.x",
|
55
|
+
"@commitlint/config-conventional": "^17.x.x",
|
55
56
|
"@microsoft/api-documenter": "^7.x.x",
|
56
57
|
"@microsoft/api-extractor": "^7.x.x",
|
57
58
|
"@rollup/plugin-json": "^4.x.x",
|
58
59
|
"@types/jest": "^27.x.x",
|
59
60
|
"@types/koa": "^2.x.x",
|
60
|
-
"@types/koa__router": "^8.
|
61
|
+
"@types/koa__router": "^8.0.11",
|
61
62
|
"@types/node": "^16.x.x",
|
62
|
-
"@types/
|
63
|
-
"@types/ws": "^8.x.x",
|
63
|
+
"@types/ws": "^8.5.3",
|
64
64
|
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
65
65
|
"@typescript-eslint/parser": "^5.x.x",
|
66
66
|
"conventional-changelog-cli": "^2.x.x",
|
67
67
|
"copyfiles": "^2.x.x",
|
68
68
|
"del-cli": "^4.x.x",
|
69
69
|
"eslint": "^8.x.x",
|
70
|
-
"eslint-plugin-jest": "^
|
70
|
+
"eslint-plugin-jest": "^26.x.x",
|
71
71
|
"husky": "^4.x.x",
|
72
|
-
"jest": "^
|
73
|
-
"jest-html-reporters": "^
|
74
|
-
"koatty_cacheable": "^1.x.x",
|
75
|
-
"koatty_schedule": "^1.x.x",
|
76
|
-
"koatty_store": "^1.x.x",
|
77
|
-
"koatty_validation": "^1.x.x",
|
72
|
+
"jest": "^28.x.x",
|
73
|
+
"jest-html-reporters": "^3.x.x",
|
78
74
|
"rollup": "^2.x.x",
|
79
75
|
"rollup-plugin-typescript2": "^0.x.x",
|
80
76
|
"standard-version": "^9.x.x",
|
81
|
-
"
|
82
|
-
"ts-jest": "^27.x.x",
|
77
|
+
"ts-jest": "^28.x.x",
|
83
78
|
"ts-node": "^10.x.x",
|
84
79
|
"typescript": "^4.x.x"
|
85
80
|
},
|
86
81
|
"dependencies": {
|
87
82
|
"koa": "2.13.4",
|
88
|
-
"koatty_config": "1.1.
|
89
|
-
"koatty_container": "1.7.
|
90
|
-
"koatty_core": "1.6.
|
91
|
-
"koatty_exception": "1.2.
|
92
|
-
"koatty_lib": "1.2.
|
93
|
-
"koatty_loader": "1.0.
|
94
|
-
"koatty_logger": "1.3.
|
95
|
-
"koatty_payload": "1.3.
|
96
|
-
"koatty_proto": "1.1.
|
97
|
-
"koatty_router": "1.7.
|
98
|
-
"koatty_serve": "1.4.
|
99
|
-
"koatty_trace": "1.6.
|
83
|
+
"koatty_config": "1.1.5",
|
84
|
+
"koatty_container": "1.7.10",
|
85
|
+
"koatty_core": "1.6.8",
|
86
|
+
"koatty_exception": "1.2.7",
|
87
|
+
"koatty_lib": "1.2.12",
|
88
|
+
"koatty_loader": "1.0.3",
|
89
|
+
"koatty_logger": "1.3.14",
|
90
|
+
"koatty_payload": "1.3.18",
|
91
|
+
"koatty_proto": "1.1.8",
|
92
|
+
"koatty_router": "1.7.8",
|
93
|
+
"koatty_serve": "1.4.10",
|
94
|
+
"koatty_trace": "1.6.9",
|
100
95
|
"reflect-metadata": "0.1.13",
|
101
|
-
"tslib": "2.
|
96
|
+
"tslib": "2.4.0"
|
102
97
|
}
|
103
98
|
}
|