@ddd-tool/domain-designer-cli 0.0.0-alpha.2 → 0.0.0-alpha.21
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 +71 -0
- package/bin/domain-designer-cli.cjs +132 -97
- package/package.json +21 -22
- package/src/views/design-en.ts +18 -31
- package/src/views/design-zh.ts +14 -24
- package/src/views/index.ts +19 -8
- package/templates/node_modules/@ddd-tool/domain-designer-core/actor.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/common.d.ts +60 -40
- package/templates/node_modules/@ddd-tool/domain-designer-core/define.d.ts +81 -46
- package/templates/node_modules/@ddd-tool/domain-designer-core/index.d.ts +119 -95
- package/templates/node_modules/@ddd-tool/domain-designer-core/info.d.ts +2 -0
- package/templates/node_modules/@ddd-tool/domain-designer-core/policy.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/service.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/system.d.ts +1 -1
- package/templates/node_modules/version.txt +1 -0
- package/templates//347/244/272/344/276/213.ts +14 -7
- package/tsconfig.json +0 -1
- package/vite.config.ts +1 -1
- package/bin/domain-designer-cli.cjs.map +0 -7
- package/templates/node_modules/@ddd-tool/domain-designer-core/info/field.d.ts +0 -2
- package/templates/node_modules/@ddd-tool/domain-designer-core/info/index.d.ts +0 -3
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# domain-designer-cli
|
|
2
|
+
|
|
3
|
+
目标是作为 ddd 建模生产力工具
|
|
4
|
+
|
|
5
|
+
## 1 前置依赖
|
|
6
|
+
|
|
7
|
+
[nodejs](https://nodejs.org/en/download/) >= 18
|
|
8
|
+
|
|
9
|
+
[pnpm](https://pnpm.io/) >= 9 OR [bun](https://bun.sh/)
|
|
10
|
+
|
|
11
|
+
- 确保有全局的`pnpm`或者`bun`指令
|
|
12
|
+
|
|
13
|
+
## 2 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm i @ddd-tool/domain-designer-cli -g
|
|
17
|
+
# or
|
|
18
|
+
bun i @ddd-tool/domain-designer-cli -g
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 3 更新版本
|
|
22
|
+
|
|
23
|
+
### 3.1 更新软件
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm i @ddd-tool/domain-designer-cli@latest -g
|
|
27
|
+
# or
|
|
28
|
+
bun i @ddd-tool/domain-designer-cli@latest -g
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3.2 更新工作空间
|
|
32
|
+
|
|
33
|
+
在已有的工作空间中执行命令
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
domain-designer-cli update
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 4 使用
|
|
40
|
+
|
|
41
|
+
### 4.1 初始化一个工作空间
|
|
42
|
+
|
|
43
|
+
在一个空文件夹中执行命令
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
domain-designer-cli init
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- 初始化后的目录包含如下内容:
|
|
50
|
+
|
|
51
|
+
- node_modules。为 ide 提供代码补全的最小.d.ts 包,不包含任何实现
|
|
52
|
+
|
|
53
|
+
- 一个示例 ts 文件。可以快速了解如何使用 ts 代码进行建模
|
|
54
|
+
|
|
55
|
+
- RunWeb 脚本。用于实时查看建模效果
|
|
56
|
+
|
|
57
|
+
### 4.2 编写 ts 文件
|
|
58
|
+
|
|
59
|
+
- 可以自行创建多个任意名称的 ts 文件
|
|
60
|
+
|
|
61
|
+
- 多个 ts 文件会被 web 服务识别为多个数据源,可在 web 页面的设置中切换数据源
|
|
62
|
+
|
|
63
|
+
### 4.3 Web 端运行
|
|
64
|
+
|
|
65
|
+
- 运行自动生成的`RunWeb`脚本文件,即可启动 web 服务
|
|
66
|
+
|
|
67
|
+
## 5 其他说明
|
|
68
|
+
|
|
69
|
+
- 对于每个 ts 文件内的修改,刷新页面即可看到效果
|
|
70
|
+
|
|
71
|
+
- 如果新增或者删除了 ts 文件,需要重新运行`RunWeb`脚本
|