@stonyx/orm 0.3.2-beta.52 → 0.3.2-beta.54
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/dist/main.js +4 -0
- package/dist/types/orm-types.d.ts +2 -0
- package/package.json +3 -3
- package/src/main.ts +5 -0
- package/src/types/orm-types.ts +2 -0
- package/src/types/stonyx.d.ts +7 -1
package/dist/main.js
CHANGED
|
@@ -54,6 +54,10 @@ export default class Orm {
|
|
|
54
54
|
Orm.instance = this;
|
|
55
55
|
}
|
|
56
56
|
async init() {
|
|
57
|
+
// Self-register so log.db works even when @stonyx/orm is in the
|
|
58
|
+
// consumer's `dependencies` (stonyx loader only merges devDependencies).
|
|
59
|
+
const { logColor = 'white', logMethod = 'db' } = config.orm;
|
|
60
|
+
log.defineType(logMethod, logColor);
|
|
57
61
|
const { paths, restServer } = config.orm;
|
|
58
62
|
const promises = ['Model', 'Serializer', 'Transform'].map(type => {
|
|
59
63
|
const lowerCaseType = type.toLowerCase();
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"stonyx-async",
|
|
5
5
|
"stonyx-module"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.3.2-beta.
|
|
7
|
+
"version": "0.3.2-beta.54",
|
|
8
8
|
"description": "",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/abofs/stonyx-orm#readme",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@stonyx/cron": "0.2.1-beta.
|
|
64
|
+
"@stonyx/cron": "0.2.1-beta.60",
|
|
65
65
|
"@stonyx/events": "0.1.1-beta.47",
|
|
66
66
|
"stonyx": "0.2.3-beta.63"
|
|
67
67
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@stonyx/rest-server": "0.2.1-beta.
|
|
85
|
+
"@stonyx/rest-server": "0.2.1-beta.61",
|
|
86
86
|
"@stonyx/utils": "0.2.3-beta.23",
|
|
87
87
|
"@types/node": "^25.6.0",
|
|
88
88
|
"mysql2": "^3.20.0",
|
package/src/main.ts
CHANGED
|
@@ -90,6 +90,11 @@ export default class Orm {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
async init(): Promise<void> {
|
|
93
|
+
// Self-register so log.db works even when @stonyx/orm is in the
|
|
94
|
+
// consumer's `dependencies` (stonyx loader only merges devDependencies).
|
|
95
|
+
const { logColor = 'white', logMethod = 'db' } = config.orm;
|
|
96
|
+
log.defineType(logMethod, logColor);
|
|
97
|
+
|
|
93
98
|
const { paths, restServer } = config.orm;
|
|
94
99
|
|
|
95
100
|
const promises: Promise<unknown>[] = ['Model', 'Serializer', 'Transform'].map(type => {
|
package/src/types/orm-types.ts
CHANGED
package/src/types/stonyx.d.ts
CHANGED
|
@@ -5,7 +5,13 @@ declare module 'stonyx/config' {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
declare module 'stonyx/log' {
|
|
8
|
-
|
|
8
|
+
interface Log {
|
|
9
|
+
db(message: string): void;
|
|
10
|
+
error(message: string, ...args: unknown[]): void;
|
|
11
|
+
defineType(type: string, setting: string, options?: Record<string, unknown> | null): void;
|
|
12
|
+
[key: string]: ((...args: unknown[]) => void) | undefined;
|
|
13
|
+
}
|
|
14
|
+
const log: Log;
|
|
9
15
|
export default log;
|
|
10
16
|
}
|
|
11
17
|
|