koatty 3.8.0-3 → 3.8.0-5

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,16 @@
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.8.0-5](https://github.com/thinkkoa/koatty/compare/v3.8.0-4...v3.8.0-5) (2023-02-26)
6
+
7
+ ## [3.8.0-4](https://github.com/thinkkoa/koatty/compare/v3.8.0-3...v3.8.0-4) (2023-02-26)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * app.version ([5e82cef](https://github.com/thinkkoa/koatty/commit/5e82cef804f5ae01f7fffd9c0ed3379f80995542))
13
+ * path of package.json ([6d4f2f6](https://github.com/thinkkoa/koatty/commit/6d4f2f664ad6b16053ae67be787436cacf2434f1))
14
+
5
15
  ## [3.8.0-3](https://github.com/thinkkoa/koatty/compare/v3.8.0-2...v3.8.0-3) (2023-02-26)
6
16
 
7
17
  ## [3.8.0-2](https://github.com/thinkkoa/koatty/compare/v3.8.0-1...v3.8.0-2) (2023-02-26)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2023-02-26 14:26:20
3
+ * @Date: 2023-02-27 00:10:15
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: 2023-02-26 14:26:04
3
+ * @Date: 2023-02-27 00:09:59
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -300,10 +300,10 @@ class Loader {
300
300
  koatty_lib.Helper.define(app, 'thinkPath', thinkPath);
301
301
  //
302
302
  if (koatty_lib.Helper.isEmpty(app.name)) {
303
- const pkg = koatty_lib.Helper.safeRequire(`${appPath}/package.json`);
303
+ const pkg = koatty_lib.Helper.safeRequire(`${path__namespace.dirname(appPath)}/package.json`);
304
304
  if (pkg.name) {
305
305
  app.name = pkg.name;
306
- // app.version = app.version || pkg.version; // TODO version is getter
306
+ app.version = app.version || pkg.version;
307
307
  }
308
308
  }
309
309
  process.env.ROOT_PATH = rootPath;
@@ -616,7 +616,7 @@ class Loader {
616
616
  }
617
617
  }
618
618
 
619
- var version = "3.8.0-3";
619
+ var version = "3.8.0-5";
620
620
  var engines = {
621
621
  node: ">12.0.0"
622
622
  };
@@ -696,8 +696,6 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
696
696
  if (!(app instanceof koatty_core.Koatty)) {
697
697
  throw new Error(`class ${target.name} does not inherit from Koatty`);
698
698
  }
699
- // version
700
- koatty_lib.Helper.define(app, "version", KOATTY_VERSION);
701
699
  // Initialize env
702
700
  Loader.initialize(app);
703
701
  // exec bootFunc
@@ -781,7 +779,7 @@ const listenCallback = (app) => {
781
779
  asyncEvent(app, 'appStart');
782
780
  Logger.Log('Koatty', '', '====================================');
783
781
  Logger.Log("Koatty", "", `Nodejs Version: ${process.version}`);
784
- Logger.Log("Koatty", "", `Koatty Version: v${app.version}`);
782
+ Logger.Log("Koatty", "", `Koatty Version: v${KOATTY_VERSION}`);
785
783
  Logger.Log("Koatty", "", `App Environment: ${app.env}`);
786
784
  Logger.Log('Koatty', '', `Server Protocol: ${(options.protocol).toUpperCase()}`);
787
785
  Logger.Log("Koatty", "", `Server running at ${options.protocol === "http2" ? "https" : options.protocol}://${options.hostname || '127.0.0.1'}:${options.port}/`);
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2023-02-26 14:26:04
3
+ * @Date: 2023-02-27 00:09:59
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -286,10 +286,10 @@ class Loader {
286
286
  Helper.define(app, 'thinkPath', thinkPath);
287
287
  //
288
288
  if (Helper.isEmpty(app.name)) {
289
- const pkg = Helper.safeRequire(`${appPath}/package.json`);
289
+ const pkg = Helper.safeRequire(`${path.dirname(appPath)}/package.json`);
290
290
  if (pkg.name) {
291
291
  app.name = pkg.name;
292
- // app.version = app.version || pkg.version; // TODO version is getter
292
+ app.version = app.version || pkg.version;
293
293
  }
294
294
  }
295
295
  process.env.ROOT_PATH = rootPath;
@@ -602,7 +602,7 @@ class Loader {
602
602
  }
603
603
  }
604
604
 
605
- var version = "3.8.0-3";
605
+ var version = "3.8.0-5";
606
606
  var engines = {
607
607
  node: ">12.0.0"
608
608
  };
@@ -682,8 +682,6 @@ const executeBootstrap = async function (target, bootFunc, isInitiative = false)
682
682
  if (!(app instanceof Koatty)) {
683
683
  throw new Error(`class ${target.name} does not inherit from Koatty`);
684
684
  }
685
- // version
686
- Helper.define(app, "version", KOATTY_VERSION);
687
685
  // Initialize env
688
686
  Loader.initialize(app);
689
687
  // exec bootFunc
@@ -767,7 +765,7 @@ const listenCallback = (app) => {
767
765
  asyncEvent(app, 'appStart');
768
766
  Logger.Log('Koatty', '', '====================================');
769
767
  Logger.Log("Koatty", "", `Nodejs Version: ${process.version}`);
770
- Logger.Log("Koatty", "", `Koatty Version: v${app.version}`);
768
+ Logger.Log("Koatty", "", `Koatty Version: v${KOATTY_VERSION}`);
771
769
  Logger.Log("Koatty", "", `App Environment: ${app.env}`);
772
770
  Logger.Log('Koatty', '', `Server Protocol: ${(options.protocol).toUpperCase()}`);
773
771
  Logger.Log("Koatty", "", `Server running at ${options.protocol === "http2" ? "https" : options.protocol}://${options.hostname || '127.0.0.1'}:${options.port}/`);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.8.0-3",
3
+ "version": "3.8.0-5",
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",
@@ -82,13 +82,13 @@
82
82
  "koa": "^2.14.1",
83
83
  "koatty_config": "^1.1.6",
84
84
  "koatty_container": "^1.8.0",
85
- "koatty_core": "^1.7.2",
85
+ "koatty_core": "^1.7.6",
86
86
  "koatty_exception": "^1.2.8",
87
- "koatty_lib": "^1.3.0",
87
+ "koatty_lib": "^1.3.2",
88
88
  "koatty_loader": "^1.1.0",
89
89
  "koatty_logger": "^2.1.0",
90
90
  "koatty_payload": "^1.4.2",
91
- "koatty_proto": "^1.1.10",
91
+ "koatty_proto": "^1.1.11",
92
92
  "koatty_router": "^1.8.6",
93
93
  "koatty_serve": "^1.5.6",
94
94
  "koatty_trace": "^1.8.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.8.0-3",
3
+ "version": "3.8.0-5",
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",
@@ -82,13 +82,13 @@
82
82
  "koa": "^2.14.1",
83
83
  "koatty_config": "^1.1.6",
84
84
  "koatty_container": "^1.8.0",
85
- "koatty_core": "^1.7.2",
85
+ "koatty_core": "^1.7.6",
86
86
  "koatty_exception": "^1.2.8",
87
- "koatty_lib": "^1.3.0",
87
+ "koatty_lib": "^1.3.2",
88
88
  "koatty_loader": "^1.1.0",
89
89
  "koatty_logger": "^2.1.0",
90
90
  "koatty_payload": "^1.4.2",
91
- "koatty_proto": "^1.1.10",
91
+ "koatty_proto": "^1.1.11",
92
92
  "koatty_router": "^1.8.6",
93
93
  "koatty_serve": "^1.5.6",
94
94
  "koatty_trace": "^1.8.4",