@longzai-intelligence/shared-kernel-mapper 0.1.3 → 0.1.4
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/README.md +7 -7
- package/package.json +49 -19
package/README.md
CHANGED
|
@@ -54,18 +54,18 @@ class UserMapperImpl implements UserMapper {
|
|
|
54
54
|
|
|
55
55
|
ORM Mapper 接口类型,定义领域实体与 ORM 实体之间的双向转换契约。
|
|
56
56
|
|
|
57
|
-
| 方法
|
|
58
|
-
|
|
59
|
-
| `toDomain` | `(orm: TOrm) => TDomain`
|
|
60
|
-
| `toOrm`
|
|
57
|
+
| 方法 | 签名 | 说明 |
|
|
58
|
+
| ---------- | --------------------------- | ------------------------- |
|
|
59
|
+
| `toDomain` | `(orm: TOrm) => TDomain` | 将 ORM 实体转换为领域实体 |
|
|
60
|
+
| `toOrm` | `(entity: TDomain) => TOrm` | 将领域实体转换为 ORM 实体 |
|
|
61
61
|
|
|
62
62
|
### ApplicationMapper<TDomain, TDTO>
|
|
63
63
|
|
|
64
64
|
Application Mapper 接口类型,定义领域实体与 DTO 之间的转换契约。
|
|
65
65
|
|
|
66
|
-
| 方法
|
|
67
|
-
|
|
68
|
-
| `toDTO`
|
|
66
|
+
| 方法 | 签名 | 说明 |
|
|
67
|
+
| ----------- | --------------------------------- | ------------------------ |
|
|
68
|
+
| `toDTO` | `(entity: TDomain) => TDTO` | 将领域实体转换为 DTO |
|
|
69
69
|
| `toDTOList` | `(entities: TDomain[]) => TDTO[]` | 批量将领域实体转换为 DTO |
|
|
70
70
|
|
|
71
71
|
## 相关文档
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence/shared-kernel-mapper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"mapper",
|
|
6
|
+
"shared-kernel"
|
|
7
|
+
],
|
|
8
|
+
"license": "UNLICENSED",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
4
12
|
"type": "module",
|
|
5
13
|
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.mjs",
|
|
6
15
|
"types": "./dist/index.d.mts",
|
|
7
16
|
"exports": {
|
|
8
17
|
".": {
|
|
@@ -14,9 +23,6 @@
|
|
|
14
23
|
"require": "./dist/index.cjs"
|
|
15
24
|
}
|
|
16
25
|
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
26
|
"scripts": {
|
|
21
27
|
"build": "tsdown",
|
|
22
28
|
"build:prod": "NODE_ENV=production tsdown",
|
|
@@ -26,31 +32,55 @@
|
|
|
26
32
|
"test": "vitest run",
|
|
27
33
|
"test:watch": "vitest",
|
|
28
34
|
"test:coverage": "vitest run --coverage",
|
|
29
|
-
"lint": "
|
|
30
|
-
"lint:
|
|
31
|
-
"
|
|
35
|
+
"lint": "bun run lint:oxlint",
|
|
36
|
+
"lint:oxlint": "oxlint",
|
|
37
|
+
"lint:eslint": "eslint .",
|
|
38
|
+
"lint:fix": "bun run oxc:fix",
|
|
39
|
+
"lint:fix:oxlint": "oxlint --fix",
|
|
40
|
+
"lint:fix:eslint": "eslint . --fix",
|
|
41
|
+
"typecheck": "bun run typecheck:ts7",
|
|
32
42
|
"typecheck:app": "tsc --noEmit -p tsconfig/app.json",
|
|
33
43
|
"typecheck:node": "tsc --noEmit -p tsconfig/node.json",
|
|
34
44
|
"typecheck:test": "tsc --noEmit -p tsconfig/test.json",
|
|
35
|
-
"lint:file": "
|
|
45
|
+
"lint:file": "bun run lint:file:oxlint",
|
|
46
|
+
"lint:file:oxlint": "oxlint",
|
|
47
|
+
"lint:file:eslint": "eslint",
|
|
48
|
+
"typecheck:ts6": "bun run typecheck:ts6:app && bun run typecheck:ts6:node && bun run typecheck:ts6:test",
|
|
49
|
+
"typecheck:ts6:app": "tsc --noEmit -p tsconfig/app.json",
|
|
50
|
+
"typecheck:ts6:node": "tsc --noEmit -p tsconfig/node.json",
|
|
51
|
+
"typecheck:ts6:test": "tsc --noEmit -p tsconfig/test.json",
|
|
52
|
+
"typecheck:ts7": "bun run typecheck:ts7:app && bun run typecheck:ts7:node && bun run typecheck:ts7:test",
|
|
53
|
+
"typecheck:ts7:app": "tsgo --noEmit -p tsconfig/app.json",
|
|
54
|
+
"typecheck:ts7:node": "tsgo --noEmit -p tsconfig/node.json",
|
|
55
|
+
"typecheck:ts7:test": "tsgo --noEmit -p tsconfig/test.json",
|
|
56
|
+
"fmt": "oxfmt",
|
|
57
|
+
"fmt:check": "oxfmt --check",
|
|
58
|
+
"oxc": "bun run lint:oxlint && bun run fmt:check",
|
|
59
|
+
"oxc:fix": "bun run lint:fix:oxlint && bun run fmt"
|
|
36
60
|
},
|
|
37
61
|
"devDependencies": {
|
|
38
62
|
"@longzai-intelligence/eslint-preset-library": "0.2.7",
|
|
63
|
+
"@longzai-intelligence/oxlint-config": "0.0.1",
|
|
64
|
+
"@longzai-intelligence/oxlint-plugin-architecture": "0.0.28",
|
|
65
|
+
"@longzai-intelligence/oxlint-plugin-code-style": "0.0.28",
|
|
66
|
+
"@longzai-intelligence/oxlint-plugin-package-json": "0.0.28",
|
|
67
|
+
"@longzai-intelligence/oxlint-plugin-perfectionist": "0.0.28",
|
|
68
|
+
"@longzai-intelligence/oxlint-plugin-schema-type-separation": "0.0.28",
|
|
69
|
+
"@longzai-intelligence/oxlint-plugin-stylistic": "0.0.28",
|
|
70
|
+
"@longzai-intelligence/oxlint-plugin-tsdoc": "0.0.28",
|
|
71
|
+
"@longzai-intelligence/oxlint-plugin-typescript-eslint": "0.0.28",
|
|
72
|
+
"@longzai-intelligence/oxlint-plugin-zod": "0.0.28",
|
|
39
73
|
"@longzai-intelligence/tsdown-config": "0.0.1",
|
|
40
74
|
"@longzai-intelligence/typescript-config": "0.0.3",
|
|
41
|
-
"@longzai-intelligence/vitest-config": "0.0.
|
|
75
|
+
"@longzai-intelligence/vitest-config": "0.0.12",
|
|
42
76
|
"@types/bun": "1.3.12",
|
|
43
|
-
"@types/node": "^25.
|
|
44
|
-
"
|
|
77
|
+
"@types/node": "^25.8.0",
|
|
78
|
+
"@typescript/native-preview": "beta",
|
|
79
|
+
"eslint": "^10.4.0",
|
|
80
|
+
"oxlint": "^1.65.0",
|
|
45
81
|
"rimraf": "^6.1.3",
|
|
46
82
|
"tsdown": "^0.21.10",
|
|
47
83
|
"typescript": "^6.0.3",
|
|
48
|
-
"vitest": "^4.1.
|
|
49
|
-
}
|
|
50
|
-
"keywords": [
|
|
51
|
-
"shared-kernel",
|
|
52
|
-
"mapper"
|
|
53
|
-
],
|
|
54
|
-
"license": "UNLICENSED",
|
|
55
|
-
"module": "./dist/index.mjs"
|
|
84
|
+
"vitest": "^4.1.6"
|
|
85
|
+
}
|
|
56
86
|
}
|