koatty 3.10.2 → 3.10.3
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/.vscode/settings.json +2 -1
- package/CHANGELOG.md +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -28
- package/dist/index.mjs +29 -28
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
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.10.3](https://github.com/thinkkoa/koatty/compare/v3.10.3-0...v3.10.3) (2023-12-06)
|
6
|
+
|
7
|
+
### [3.10.3-0](https://github.com/thinkkoa/koatty/compare/v3.10.2...v3.10.3-0) (2023-12-06)
|
8
|
+
|
5
9
|
### [3.10.2](https://github.com/thinkkoa/koatty/compare/v3.10.2-4...v3.10.2) (2023-11-11)
|
6
10
|
|
7
11
|
### [3.10.2-4](https://github.com/thinkkoa/koatty/compare/v3.10.2-3...v3.10.2-4) (2023-11-11)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2023-
|
3
|
+
* @Date: 2023-12-07 00:35:50
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -592,40 +592,44 @@ class Loader {
|
|
592
592
|
* @param {*} app
|
593
593
|
* @memberof Loader
|
594
594
|
*/
|
595
|
-
static LoadComponents(app) {
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
}
|
595
|
+
// public static LoadComponents(app: Koatty) {
|
596
|
+
// const componentList = IOCContainer.listClass("COMPONENT");
|
597
|
+
// componentList.forEach((item: ComponentItem) => {
|
598
|
+
// item.id = (item.id ?? "").replace("COMPONENT:", "");
|
599
|
+
// if (item.id && !(item.id).endsWith("Plugin") && Helper.isClass(item.target)) {
|
600
|
+
// Logger.Debug(`Load component: ${item.id}`);
|
601
|
+
// // registering to IOC
|
602
|
+
// IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
603
|
+
// }
|
604
|
+
// });
|
605
|
+
// }
|
606
606
|
/**
|
607
|
-
* Load
|
607
|
+
* Load components
|
608
608
|
*
|
609
609
|
* @static
|
610
610
|
* @param {*} app
|
611
611
|
* @memberof Loader
|
612
612
|
*/
|
613
|
-
static async
|
613
|
+
static async LoadComponents(app) {
|
614
614
|
const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
|
615
|
-
let pluginsConf = app.config(undefined, "plugin");
|
616
|
-
if (koatty_lib.Helper.isEmpty(pluginsConf)) {
|
617
|
-
pluginsConf = { config: {}, list: [] };
|
618
|
-
}
|
619
615
|
const pluginList = [];
|
620
616
|
componentList.forEach(async (item) => {
|
621
617
|
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
622
|
-
if (
|
618
|
+
if (koatty_lib.Helper.isClass(item.target)) {
|
619
|
+
if (item.id && (item.id).endsWith("Plugin")) {
|
620
|
+
pluginList.push(item.id);
|
621
|
+
}
|
623
622
|
// registering to IOC
|
624
623
|
koatty_container.IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
625
|
-
pluginList.push(item.id);
|
626
624
|
}
|
627
625
|
});
|
628
|
-
|
626
|
+
// load plugin config
|
627
|
+
let pluginsConf = app.config(undefined, "plugin");
|
628
|
+
if (koatty_lib.Helper.isEmpty(pluginsConf)) {
|
629
|
+
pluginsConf = { config: {}, list: [] };
|
630
|
+
}
|
631
|
+
const pluginConfList = pluginsConf.list ?? [];
|
632
|
+
// load plugin list
|
629
633
|
for (const key of pluginConfList) {
|
630
634
|
const handle = koatty_container.IOCContainer.get(key, "COMPONENT");
|
631
635
|
if (!handle) {
|
@@ -646,7 +650,7 @@ class Loader {
|
|
646
650
|
}
|
647
651
|
}
|
648
652
|
|
649
|
-
var version = "3.10.
|
653
|
+
var version = "3.10.3";
|
650
654
|
var engines = {
|
651
655
|
node: ">12.0.0"
|
652
656
|
};
|
@@ -746,15 +750,12 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
|
|
746
750
|
Loader.LoadAppEventHooks(app, target);
|
747
751
|
Logger.Log('Koatty', '', 'Emit App Boot ...');
|
748
752
|
await asyncEvent(app, "appBoot" /* AppEvent.appBoot */);
|
749
|
-
// Load
|
750
|
-
Logger.Log('Koatty', '', 'Load
|
751
|
-
await Loader.
|
753
|
+
// Load Components
|
754
|
+
Logger.Log('Koatty', '', 'Load Components ...');
|
755
|
+
await Loader.LoadComponents(app);
|
752
756
|
// Load Middleware
|
753
757
|
Logger.Log('Koatty', '', 'Load Middlewares ...');
|
754
758
|
await Loader.LoadMiddlewares(app);
|
755
|
-
// Load Components
|
756
|
-
Logger.Log('Koatty', '', 'Load Components ...');
|
757
|
-
Loader.LoadComponents(app);
|
758
759
|
// Load Services
|
759
760
|
Logger.Log('Koatty', '', 'Load Services ...');
|
760
761
|
Loader.LoadServices(app);
|
package/dist/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2023-
|
3
|
+
* @Date: 2023-12-07 00:35:50
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -578,40 +578,44 @@ class Loader {
|
|
578
578
|
* @param {*} app
|
579
579
|
* @memberof Loader
|
580
580
|
*/
|
581
|
-
static LoadComponents(app) {
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
}
|
581
|
+
// public static LoadComponents(app: Koatty) {
|
582
|
+
// const componentList = IOCContainer.listClass("COMPONENT");
|
583
|
+
// componentList.forEach((item: ComponentItem) => {
|
584
|
+
// item.id = (item.id ?? "").replace("COMPONENT:", "");
|
585
|
+
// if (item.id && !(item.id).endsWith("Plugin") && Helper.isClass(item.target)) {
|
586
|
+
// Logger.Debug(`Load component: ${item.id}`);
|
587
|
+
// // registering to IOC
|
588
|
+
// IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
589
|
+
// }
|
590
|
+
// });
|
591
|
+
// }
|
592
592
|
/**
|
593
|
-
* Load
|
593
|
+
* Load components
|
594
594
|
*
|
595
595
|
* @static
|
596
596
|
* @param {*} app
|
597
597
|
* @memberof Loader
|
598
598
|
*/
|
599
|
-
static async
|
599
|
+
static async LoadComponents(app) {
|
600
600
|
const componentList = IOCContainer.listClass("COMPONENT");
|
601
|
-
let pluginsConf = app.config(undefined, "plugin");
|
602
|
-
if (Helper.isEmpty(pluginsConf)) {
|
603
|
-
pluginsConf = { config: {}, list: [] };
|
604
|
-
}
|
605
601
|
const pluginList = [];
|
606
602
|
componentList.forEach(async (item) => {
|
607
603
|
item.id = (item.id ?? "").replace("COMPONENT:", "");
|
608
|
-
if (
|
604
|
+
if (Helper.isClass(item.target)) {
|
605
|
+
if (item.id && (item.id).endsWith("Plugin")) {
|
606
|
+
pluginList.push(item.id);
|
607
|
+
}
|
609
608
|
// registering to IOC
|
610
609
|
IOCContainer.reg(item.id, item.target, { scope: "Singleton", type: "COMPONENT", args: [] });
|
611
|
-
pluginList.push(item.id);
|
612
610
|
}
|
613
611
|
});
|
614
|
-
|
612
|
+
// load plugin config
|
613
|
+
let pluginsConf = app.config(undefined, "plugin");
|
614
|
+
if (Helper.isEmpty(pluginsConf)) {
|
615
|
+
pluginsConf = { config: {}, list: [] };
|
616
|
+
}
|
617
|
+
const pluginConfList = pluginsConf.list ?? [];
|
618
|
+
// load plugin list
|
615
619
|
for (const key of pluginConfList) {
|
616
620
|
const handle = IOCContainer.get(key, "COMPONENT");
|
617
621
|
if (!handle) {
|
@@ -632,7 +636,7 @@ class Loader {
|
|
632
636
|
}
|
633
637
|
}
|
634
638
|
|
635
|
-
var version = "3.10.
|
639
|
+
var version = "3.10.3";
|
636
640
|
var engines = {
|
637
641
|
node: ">12.0.0"
|
638
642
|
};
|
@@ -732,15 +736,12 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
|
|
732
736
|
Loader.LoadAppEventHooks(app, target);
|
733
737
|
Logger.Log('Koatty', '', 'Emit App Boot ...');
|
734
738
|
await asyncEvent(app, "appBoot" /* AppEvent.appBoot */);
|
735
|
-
// Load
|
736
|
-
Logger.Log('Koatty', '', 'Load
|
737
|
-
await Loader.
|
739
|
+
// Load Components
|
740
|
+
Logger.Log('Koatty', '', 'Load Components ...');
|
741
|
+
await Loader.LoadComponents(app);
|
738
742
|
// Load Middleware
|
739
743
|
Logger.Log('Koatty', '', 'Load Middlewares ...');
|
740
744
|
await Loader.LoadMiddlewares(app);
|
741
|
-
// Load Components
|
742
|
-
Logger.Log('Koatty', '', 'Load Components ...');
|
743
|
-
Loader.LoadComponents(app);
|
744
745
|
// Load Services
|
745
746
|
Logger.Log('Koatty', '', 'Load Services ...');
|
746
747
|
Loader.LoadServices(app);
|
package/dist/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.10.
|
3
|
+
"version": "3.10.3",
|
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",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"dependencies": {
|
81
81
|
"koa": "^2.14.2",
|
82
82
|
"koatty_config": "^1.1.6",
|
83
|
-
"koatty_container": "^1.8.
|
83
|
+
"koatty_container": "^1.8.7",
|
84
84
|
"koatty_core": "^1.8.2",
|
85
85
|
"koatty_exception": "^1.2.8",
|
86
86
|
"koatty_lib": "^1.3.4",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.10.
|
3
|
+
"version": "3.10.3",
|
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",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"dependencies": {
|
81
81
|
"koa": "^2.14.2",
|
82
82
|
"koatty_config": "^1.1.6",
|
83
|
-
"koatty_container": "^1.8.
|
83
|
+
"koatty_container": "^1.8.7",
|
84
84
|
"koatty_core": "^1.8.2",
|
85
85
|
"koatty_exception": "^1.2.8",
|
86
86
|
"koatty_lib": "^1.3.4",
|