koatty 3.11.7 → 3.11.8

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
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.11.8](https://github.com/thinkkoa/koatty/compare/v3.11.7...v3.11.8) (2025-01-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * 调整app.env定义逻辑 ([eb4ae59](https://github.com/thinkkoa/koatty/commit/eb4ae5983831543e93eabac52c272f0dad2fb907))
11
+ * enable debug mode and update dependencies ([651f1c8](https://github.com/thinkkoa/koatty/commit/651f1c85c85fcd166ee8f0c07d445baf4ffd662a))
12
+
5
13
  ### [3.11.7](https://github.com/thinkkoa/koatty/compare/v3.11.6...v3.11.7) (2024-12-06)
6
14
 
7
15
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-06 09:38:35
3
+ * @Date: 2025-01-14 15:03:16
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-06 09:38:17
3
+ * @Date: 2025-01-14 15:02:55
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -72,7 +72,7 @@ function SetLogger(app, config) {
72
72
  }
73
73
  }
74
74
 
75
- var version = "3.11.7";
75
+ var version = "3.11.8";
76
76
  var engines = {
77
77
  node: ">12.0.0"
78
78
  };
@@ -192,7 +192,7 @@ https://github.com/koatty
192
192
  * @Usage:
193
193
  * @Author: richen
194
194
  * @Date: 2023-12-09 22:55:49
195
- * @LastEditTime: 2024-11-29 18:20:23
195
+ * @LastEditTime: 2025-01-14 14:21:56
196
196
  * @License: BSD (3-Clause)
197
197
  * @Copyright (c): <richenlin(at)gmail.com>
198
198
  */
@@ -216,25 +216,10 @@ class Loader {
216
216
  * @memberof Loader
217
217
  */
218
218
  static initialize(app) {
219
- var _a, _b;
220
- const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
221
- if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
222
- app.appDebug = true;
223
- }
224
- // app.env
225
- app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
226
- if ((env.indexOf('--production') > -1) || (((_b = app.env) !== null && _b !== void 0 ? _b : '').indexOf('pro') > -1)) {
227
- app.appDebug = false;
228
- }
229
- if (app.appDebug) {
230
- app.env = 'development';
231
- process.env.NODE_ENV = 'development';
232
- process.env.APP_DEBUG = 'true';
219
+ if (app.env == 'development') {
233
220
  Logger.setLevel("debug");
234
221
  }
235
222
  else {
236
- app.env = 'production';
237
- process.env.NODE_ENV = 'production';
238
223
  Logger.setLevel("info");
239
224
  }
240
225
  // define path
@@ -401,7 +386,10 @@ class Loader {
401
386
  }
402
387
  }
403
388
  /**
404
- * LoadAllComponents
389
+ * @description: Load all components
390
+ * @param {KoattyApplication} app
391
+ * @param {any} target
392
+ * @return {*}
405
393
  */
406
394
  static async LoadAllComponents(app, target) {
407
395
  var _a;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-06 09:38:17
3
+ * @Date: 2025-01-14 15:02:55
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -56,7 +56,7 @@ function SetLogger(app, config) {
56
56
  }
57
57
  }
58
58
 
59
- var version = "3.11.7";
59
+ var version = "3.11.8";
60
60
  var engines = {
61
61
  node: ">12.0.0"
62
62
  };
@@ -176,7 +176,7 @@ https://github.com/koatty
176
176
  * @Usage:
177
177
  * @Author: richen
178
178
  * @Date: 2023-12-09 22:55:49
179
- * @LastEditTime: 2024-11-29 18:20:23
179
+ * @LastEditTime: 2025-01-14 14:21:56
180
180
  * @License: BSD (3-Clause)
181
181
  * @Copyright (c): <richenlin(at)gmail.com>
182
182
  */
@@ -200,25 +200,10 @@ class Loader {
200
200
  * @memberof Loader
201
201
  */
202
202
  static initialize(app) {
203
- var _a, _b;
204
- const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
205
- if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
206
- app.appDebug = true;
207
- }
208
- // app.env
209
- app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
210
- if ((env.indexOf('--production') > -1) || (((_b = app.env) !== null && _b !== void 0 ? _b : '').indexOf('pro') > -1)) {
211
- app.appDebug = false;
212
- }
213
- if (app.appDebug) {
214
- app.env = 'development';
215
- process.env.NODE_ENV = 'development';
216
- process.env.APP_DEBUG = 'true';
203
+ if (app.env == 'development') {
217
204
  Logger.setLevel("debug");
218
205
  }
219
206
  else {
220
- app.env = 'production';
221
- process.env.NODE_ENV = 'production';
222
207
  Logger.setLevel("info");
223
208
  }
224
209
  // define path
@@ -385,7 +370,10 @@ class Loader {
385
370
  }
386
371
  }
387
372
  /**
388
- * LoadAllComponents
373
+ * @description: Load all components
374
+ * @param {KoattyApplication} app
375
+ * @param {any} target
376
+ * @return {*}
389
377
  */
390
378
  static async LoadAllComponents(app, target) {
391
379
  var _a;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.11.7",
3
+ "version": "3.11.8",
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",
@@ -67,6 +67,7 @@
67
67
  "@types/lodash": "^4.x.x",
68
68
  "@types/node": "^22.x.x",
69
69
  "@types/on-finished": "^2.x.x",
70
+ "@types/supertest": "^6.x.x",
70
71
  "@types/ws": "^8.x.x",
71
72
  "@typescript-eslint/eslint-plugin": "^8.x.x",
72
73
  "@typescript-eslint/parser": "^8.x.x",
@@ -93,7 +94,7 @@
93
94
  "koa": "~2.15.3",
94
95
  "koatty_config": "~1.2.0",
95
96
  "koatty_container": "~1.9.4",
96
- "koatty_core": "~1.11.0",
97
+ "koatty_core": "~1.11.4",
97
98
  "koatty_exception": "~1.5.3",
98
99
  "koatty_lib": "~1.4.0",
99
100
  "koatty_loader": "~1.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.11.7",
3
+ "version": "3.11.8",
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",
@@ -67,6 +67,7 @@
67
67
  "@types/lodash": "^4.x.x",
68
68
  "@types/node": "^22.x.x",
69
69
  "@types/on-finished": "^2.x.x",
70
+ "@types/supertest": "^6.x.x",
70
71
  "@types/ws": "^8.x.x",
71
72
  "@typescript-eslint/eslint-plugin": "^8.x.x",
72
73
  "@typescript-eslint/parser": "^8.x.x",
@@ -93,7 +94,7 @@
93
94
  "koa": "~2.15.3",
94
95
  "koatty_config": "~1.2.0",
95
96
  "koatty_container": "~1.9.4",
96
- "koatty_core": "~1.11.0",
97
+ "koatty_core": "~1.11.4",
97
98
  "koatty_exception": "~1.5.3",
98
99
  "koatty_lib": "~1.4.0",
99
100
  "koatty_loader": "~1.1.0",