koatty 3.11.6 → 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,15 +2,30 @@
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.6](https://github.com/thinkkoa/koatty/compare/v3.11.4-2...v3.11.6) (2024-12-05)
5
+ ### [3.11.8](https://github.com/thinkkoa/koatty/compare/v3.11.7...v3.11.8) (2025-01-14)
6
6
 
7
7
 
8
8
  ### Bug Fixes
9
9
 
10
- * 暂存 ([4ba0d2b](https://github.com/thinkkoa/koatty/commit/4ba0d2b625a4a329d620a487456452907db9bc91))
11
- * apppath changed in debug mod ([95e0d7b](https://github.com/thinkkoa/koatty/commit/95e0d7b22387da1ecbce5cc0d6faccdb70aee179))
12
- * module ([25a7d7a](https://github.com/thinkkoa/koatty/commit/25a7d7a6a7cb58096907da7aeb6babc0ce2097fc))
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))
13
12
 
13
+ ### [3.11.7](https://github.com/thinkkoa/koatty/compare/v3.11.6...v3.11.7) (2024-12-06)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * export koatty_exception ([93e96bc](https://github.com/thinkkoa/koatty/commit/93e96bc703da57c0e555d5b384f0eb93501e3cfb))
19
+
20
+ ### [3.11.6](https://github.com/thinkkoa/koatty/compare/v3.11.4-2...v3.11.6) (2024-12-05)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * 暂存 ([4ba0d2b](https://github.com/thinkkoa/koatty/commit/4ba0d2b625a4a329d620a487456452907db9bc91))
26
+ * apppath changed in debug mod ([95e0d7b](https://github.com/thinkkoa/koatty/commit/95e0d7b22387da1ecbce5cc0d6faccdb70aee179))
27
+ * module ([25a7d7a](https://github.com/thinkkoa/koatty/commit/25a7d7a6a7cb58096907da7aeb6babc0ce2097fc))
28
+
14
29
  ### [3.11.4-2](https://github.com/thinkkoa/koatty/compare/v3.11.4-1...v3.11.4-2) (2024-04-14)
15
30
 
16
31
  ### [3.11.4-1](https://github.com/thinkkoa/koatty/compare/v3.11.4-0...v3.11.4-1) (2024-04-01)
package/README.md CHANGED
@@ -8,11 +8,13 @@ Use Typescript's decorator implement IOC and AOP.
8
8
 
9
9
  ## New features
10
10
 
11
- * HTTP、HTTPS、HTTP2、gRPC、WebSocket server.
12
- * Support loading environment configuration, parsing command line parameters (process.argv) and environment variables (process.env)
13
- * `@ExceptionHandler()` Register global exception handling
14
- * graceful shutdown and pre-exit event
15
- * custom decorator based on app events
11
+ * HTTP、HTTPS、HTTP2、gRPC、WebSocket server.✔️
12
+ * Support loading environment configuration, parsing command line parameters (process.argv) and environment variables (process.env).✔️
13
+ * `@ExceptionHandler()` Register global exception handling.✔️
14
+ * graceful shutdown and pre-exit event.✔️
15
+ * custom decorator based on app events.✔️
16
+ * GraphQL supporting. 💪
17
+ * OpenTelemetry . 💪
16
18
 
17
19
 
18
20
  ## Documentation
package/dist/README.md CHANGED
@@ -8,11 +8,13 @@ Use Typescript's decorator implement IOC and AOP.
8
8
 
9
9
  ## New features
10
10
 
11
- * HTTP、HTTPS、HTTP2、gRPC、WebSocket server.
12
- * Support loading environment configuration, parsing command line parameters (process.argv) and environment variables (process.env)
13
- * `@ExceptionHandler()` Register global exception handling
14
- * graceful shutdown and pre-exit event
15
- * custom decorator based on app events
11
+ * HTTP、HTTPS、HTTP2、gRPC、WebSocket server.✔️
12
+ * Support loading environment configuration, parsing command line parameters (process.argv) and environment variables (process.env).✔️
13
+ * `@ExceptionHandler()` Register global exception handling.✔️
14
+ * graceful shutdown and pre-exit event.✔️
15
+ * custom decorator based on app events.✔️
16
+ * GraphQL supporting. 💪
17
+ * OpenTelemetry . 💪
16
18
 
17
19
 
18
20
  ## Documentation
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-05 11:22:38
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/
@@ -75,6 +75,7 @@ export declare const Logger: Logger_2;
75
75
 
76
76
  export * from "koatty_container";
77
77
  export * from "koatty_core";
78
+ export * from "koatty_exception";
78
79
  export * from "koatty_router";
79
80
 
80
81
  export { }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-05 11:22:18
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/
@@ -10,6 +10,7 @@
10
10
  var koatty_config = require('koatty_config');
11
11
  var koatty_container = require('koatty_container');
12
12
  var koatty_core = require('koatty_core');
13
+ var koatty_exception = require('koatty_exception');
13
14
  var koatty_router = require('koatty_router');
14
15
  var koatty_lib = require('koatty_lib');
15
16
  var koatty_logger = require('koatty_logger');
@@ -71,7 +72,7 @@ function SetLogger(app, config) {
71
72
  }
72
73
  }
73
74
 
74
- var version = "3.11.6";
75
+ var version = "3.11.8";
75
76
  var engines = {
76
77
  node: ">12.0.0"
77
78
  };
@@ -191,7 +192,7 @@ https://github.com/koatty
191
192
  * @Usage:
192
193
  * @Author: richen
193
194
  * @Date: 2023-12-09 22:55:49
194
- * @LastEditTime: 2024-11-29 18:20:23
195
+ * @LastEditTime: 2025-01-14 14:21:56
195
196
  * @License: BSD (3-Clause)
196
197
  * @Copyright (c): <richenlin(at)gmail.com>
197
198
  */
@@ -215,25 +216,10 @@ class Loader {
215
216
  * @memberof Loader
216
217
  */
217
218
  static initialize(app) {
218
- var _a, _b;
219
- const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
220
- if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
221
- app.appDebug = true;
222
- }
223
- // app.env
224
- app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
225
- if ((env.indexOf('--production') > -1) || (((_b = app.env) !== null && _b !== void 0 ? _b : '').indexOf('pro') > -1)) {
226
- app.appDebug = false;
227
- }
228
- if (app.appDebug) {
229
- app.env = 'development';
230
- process.env.NODE_ENV = 'development';
231
- process.env.APP_DEBUG = 'true';
219
+ if (app.env == 'development') {
232
220
  Logger.setLevel("debug");
233
221
  }
234
222
  else {
235
- app.env = 'production';
236
- process.env.NODE_ENV = 'production';
237
223
  Logger.setLevel("info");
238
224
  }
239
225
  // define path
@@ -400,7 +386,10 @@ class Loader {
400
386
  }
401
387
  }
402
388
  /**
403
- * LoadAllComponents
389
+ * @description: Load all components
390
+ * @param {KoattyApplication} app
391
+ * @param {any} target
392
+ * @return {*}
404
393
  */
405
394
  static async LoadAllComponents(app, target) {
406
395
  var _a;
@@ -845,6 +834,12 @@ Object.keys(koatty_core).forEach(function (k) {
845
834
  get: function () { return koatty_core[k]; }
846
835
  });
847
836
  });
837
+ Object.keys(koatty_exception).forEach(function (k) {
838
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
839
+ enumerable: true,
840
+ get: function () { return koatty_exception[k]; }
841
+ });
842
+ });
848
843
  Object.keys(koatty_router).forEach(function (k) {
849
844
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
850
845
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-12-05 11:22:18
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/
@@ -11,6 +11,7 @@ import { IOC, TAGGED_CLS } from 'koatty_container';
11
11
  export * from 'koatty_container';
12
12
  import { AppEventArr, implementsMiddlewareInterface, implementsControllerInterface, implementsServiceInterface, implementsPluginInterface, implementsAspectInterface, Koatty } from 'koatty_core';
13
13
  export * from 'koatty_core';
14
+ export * from 'koatty_exception';
14
15
  import { NewRouter } from 'koatty_router';
15
16
  export * from 'koatty_router';
16
17
  import { Helper } from 'koatty_lib';
@@ -55,7 +56,7 @@ function SetLogger(app, config) {
55
56
  }
56
57
  }
57
58
 
58
- var version = "3.11.6";
59
+ var version = "3.11.8";
59
60
  var engines = {
60
61
  node: ">12.0.0"
61
62
  };
@@ -175,7 +176,7 @@ https://github.com/koatty
175
176
  * @Usage:
176
177
  * @Author: richen
177
178
  * @Date: 2023-12-09 22:55:49
178
- * @LastEditTime: 2024-11-29 18:20:23
179
+ * @LastEditTime: 2025-01-14 14:21:56
179
180
  * @License: BSD (3-Clause)
180
181
  * @Copyright (c): <richenlin(at)gmail.com>
181
182
  */
@@ -199,25 +200,10 @@ class Loader {
199
200
  * @memberof Loader
200
201
  */
201
202
  static initialize(app) {
202
- var _a, _b;
203
- const env = ((_a = process.execArgv) !== null && _a !== void 0 ? _a : []).join(",");
204
- if (env.indexOf('ts-node') > -1 || env.indexOf('--debug') > -1) {
205
- app.appDebug = true;
206
- }
207
- // app.env
208
- app.env = process.env.KOATTY_ENV || process.env.NODE_ENV;
209
- if ((env.indexOf('--production') > -1) || (((_b = app.env) !== null && _b !== void 0 ? _b : '').indexOf('pro') > -1)) {
210
- app.appDebug = false;
211
- }
212
- if (app.appDebug) {
213
- app.env = 'development';
214
- process.env.NODE_ENV = 'development';
215
- process.env.APP_DEBUG = 'true';
203
+ if (app.env == 'development') {
216
204
  Logger.setLevel("debug");
217
205
  }
218
206
  else {
219
- app.env = 'production';
220
- process.env.NODE_ENV = 'production';
221
207
  Logger.setLevel("info");
222
208
  }
223
209
  // define path
@@ -384,7 +370,10 @@ class Loader {
384
370
  }
385
371
  }
386
372
  /**
387
- * LoadAllComponents
373
+ * @description: Load all components
374
+ * @param {KoattyApplication} app
375
+ * @param {any} target
376
+ * @return {*}
388
377
  */
389
378
  static async LoadAllComponents(app, target) {
390
379
  var _a;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.11.6",
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",
@@ -9,7 +9,7 @@
9
9
  "build:doc": "npx api-documenter markdown --input temp --output docs/api",
10
10
  "build:dts": "npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
- "lock": "npx del-cli --force node_modules && npm i --package-lock-only && npx pnpm i",
12
+ "lock": "npx del-cli --force node_modules && npm i --package-lock-only && npm audit fix && npx pnpm i",
13
13
  "prepublishOnly": "npm test && npm run build && git push --follow-tags origin",
14
14
  "prerelease": "npm run lock && npm test && npm run build",
15
15
  "release": "standard-version",
@@ -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,8 @@
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",
98
+ "koatty_exception": "~1.5.3",
97
99
  "koatty_lib": "~1.4.0",
98
100
  "koatty_loader": "~1.1.0",
99
101
  "koatty_logger": "~2.1.8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.11.6",
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",
@@ -9,7 +9,7 @@
9
9
  "build:doc": "npx api-documenter markdown --input temp --output docs/api",
10
10
  "build:dts": "npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
- "lock": "npx del-cli --force node_modules && npm i --package-lock-only && npx pnpm i",
12
+ "lock": "npx del-cli --force node_modules && npm i --package-lock-only && npm audit fix && npx pnpm i",
13
13
  "prepublishOnly": "npm test && npm run build && git push --follow-tags origin",
14
14
  "prerelease": "npm run lock && npm test && npm run build",
15
15
  "release": "standard-version",
@@ -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,8 @@
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",
98
+ "koatty_exception": "~1.5.3",
97
99
  "koatty_lib": "~1.4.0",
98
100
  "koatty_loader": "~1.1.0",
99
101
  "koatty_logger": "~2.1.8",