@ditojs/server 2.11.3 → 2.12.1
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/package.json +10 -10
- package/src/app/Application.js +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/master/packages/server",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"node >= 18"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ditojs/admin": "^2.
|
|
26
|
-
"@ditojs/build": "^2.
|
|
27
|
-
"@ditojs/router": "^2.
|
|
28
|
-
"@ditojs/utils": "^2.
|
|
25
|
+
"@ditojs/admin": "^2.12.1",
|
|
26
|
+
"@ditojs/build": "^2.12.0",
|
|
27
|
+
"@ditojs/router": "^2.12.0",
|
|
28
|
+
"@ditojs/utils": "^2.12.0",
|
|
29
29
|
"@koa/cors": "^4.0.0",
|
|
30
30
|
"@koa/multer": "^3.0.2",
|
|
31
31
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
32
|
-
"@vitejs/plugin-vue": "^4.
|
|
32
|
+
"@vitejs/plugin-vue": "^4.3.4",
|
|
33
33
|
"@vue/compiler-sfc": "^3.3.4",
|
|
34
34
|
"ajv": "^8.12.0",
|
|
35
35
|
"ajv-formats": "^2.1.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"pino-pretty": "^10.2.0",
|
|
65
65
|
"pluralize": "^8.0.0",
|
|
66
66
|
"repl": "^0.1.3",
|
|
67
|
-
"type-fest": "^4.1
|
|
67
|
+
"type-fest": "^4.3.1",
|
|
68
68
|
"uuid": "^9.0.0",
|
|
69
69
|
"vite": "^4.4.9",
|
|
70
70
|
"vue": "^3.3.4"
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"@types/koa-session": "^6.4.1",
|
|
83
83
|
"@types/koa-static": "^4.0.2",
|
|
84
84
|
"@types/koa__cors": "^4.0.0",
|
|
85
|
-
"@types/node": "^20.
|
|
85
|
+
"@types/node": "^20.5.9",
|
|
86
86
|
"knex": "^2.5.1",
|
|
87
87
|
"objection": "^3.1.1",
|
|
88
|
-
"typescript": "^5.
|
|
88
|
+
"typescript": "^5.2.2"
|
|
89
89
|
},
|
|
90
90
|
"types": "types",
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "8fd13e75795f65ef5991263d6b385d2f2fb99f08",
|
|
92
92
|
"scripts": {
|
|
93
93
|
"types": "tsc --noEmit --esModuleInterop ./types/index.d.ts"
|
|
94
94
|
},
|
package/src/app/Application.js
CHANGED
|
@@ -61,6 +61,8 @@ import {
|
|
|
61
61
|
import { AsyncLocalStorage } from 'async_hooks'
|
|
62
62
|
|
|
63
63
|
export class Application extends Koa {
|
|
64
|
+
#logger
|
|
65
|
+
|
|
64
66
|
constructor({
|
|
65
67
|
config = {},
|
|
66
68
|
validator,
|
|
@@ -564,7 +566,7 @@ export class Application extends Koa {
|
|
|
564
566
|
|
|
565
567
|
// Setup global middleware
|
|
566
568
|
|
|
567
|
-
this.use(attachLogger(this
|
|
569
|
+
this.use(attachLogger(this.#logger))
|
|
568
570
|
if (app.responseTime !== false) {
|
|
569
571
|
this.use(responseTime(getOptions(app.responseTime)))
|
|
570
572
|
}
|
|
@@ -644,7 +646,7 @@ export class Application extends Koa {
|
|
|
644
646
|
options: prettyPrint
|
|
645
647
|
})
|
|
646
648
|
: null
|
|
647
|
-
this
|
|
649
|
+
this.#logger = pino(options, transport).child({ name: 'app' })
|
|
648
650
|
}
|
|
649
651
|
|
|
650
652
|
setupKnex() {
|
|
@@ -1087,6 +1089,10 @@ export class Application extends Koa {
|
|
|
1087
1089
|
get requestLocals() {
|
|
1088
1090
|
return this.requestStorage.getStore() ?? {}
|
|
1089
1091
|
}
|
|
1092
|
+
|
|
1093
|
+
get logger() {
|
|
1094
|
+
return this.requestLocals.logger ?? this.#logger
|
|
1095
|
+
}
|
|
1090
1096
|
}
|
|
1091
1097
|
|
|
1092
1098
|
// Override Koa's events with our own EventEmitter that adds support for
|