@ddd-tool/domain-designer-cli 0.0.0-alpha.12 → 0.0.0-alpha.13
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
目标是作为 ddd 建模生产力工具
|
|
4
4
|
|
|
5
|
-
## 前置依赖
|
|
5
|
+
## 1 前置依赖
|
|
6
6
|
|
|
7
7
|
[nodejs](https://nodejs.org/en/download/) >= 18
|
|
8
8
|
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
- 确保有全局的`pnpm`指令
|
|
12
12
|
|
|
13
|
-
## 安装
|
|
13
|
+
## 2 安装
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
pnpm i @ddd-tool/domain-designer-cli -g
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## 使用
|
|
19
|
+
## 3 使用
|
|
20
20
|
|
|
21
|
-
### 初始化一个工作空间
|
|
21
|
+
### 3.1 初始化一个工作空间
|
|
22
22
|
|
|
23
23
|
在一个空文件夹中执行命令
|
|
24
24
|
|
|
@@ -34,25 +34,25 @@ domain-designer-cli init
|
|
|
34
34
|
|
|
35
35
|
- RunWeb 脚本。用于实时查看建模效果
|
|
36
36
|
|
|
37
|
-
### 编写 ts 文件
|
|
37
|
+
### 3.2 编写 ts 文件
|
|
38
38
|
|
|
39
39
|
- 可以自行创建多个任意名称的 ts 文件
|
|
40
40
|
|
|
41
41
|
- 多个 ts 文件会被 web 服务识别为多个数据源,可在 web 页面的设置中切换数据源
|
|
42
42
|
|
|
43
|
-
### Web 端运行
|
|
43
|
+
### 3.3 Web 端运行
|
|
44
44
|
|
|
45
45
|
- 运行自动生成的`RunWeb`脚本文件,即可启动 web 服务
|
|
46
46
|
|
|
47
|
-
### 更新版本
|
|
47
|
+
### 3.4 更新版本
|
|
48
48
|
|
|
49
|
-
#### 1
|
|
49
|
+
#### 3.4.1 更新软件
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
pnpm i @ddd-tool/domain-designer-cli@latest -g
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
#### 2
|
|
55
|
+
#### 3.4.2 更新工作空间
|
|
56
56
|
|
|
57
57
|
在已有的工作空间中执行命令
|
|
58
58
|
|
|
@@ -60,7 +60,7 @@ pnpm i @ddd-tool/domain-designer-cli@latest -g
|
|
|
60
60
|
domain-designer-cli init
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
## 其他说明
|
|
63
|
+
## 4 其他说明
|
|
64
64
|
|
|
65
65
|
- 对于每个 ts 文件内的修改,刷新页面即可看到效果
|
|
66
66
|
|
|
@@ -148,7 +148,7 @@ ${i.map(o=>`if (isDomainDesigner(${o.flag})) {
|
|
|
148
148
|
`)}
|
|
149
149
|
|
|
150
150
|
export default data
|
|
151
|
-
`;Wt.default.writeFileSync(On.default.join(t,"src","views","index.ts"),n,{encoding:"utf-8"})}var ze=V(require("node:fs"),1),Pe=V(require("node:path"),1);var mt={name:"@ddd-tool/domain-designer-cli",version:"0.0.0-alpha.
|
|
151
|
+
`;Wt.default.writeFileSync(On.default.join(t,"src","views","index.ts"),n,{encoding:"utf-8"})}var ze=V(require("node:fs"),1),Pe=V(require("node:path"),1);var mt={name:"@ddd-tool/domain-designer-cli",version:"0.0.0-alpha.13",private:!0,type:"module",files:["./src"],repository:{type:"git",url:"git+https://github.com/ddd-tool/domain-designer-cli-node.git"},bugs:{url:"https://github.com/ddd-tool/domain-designer-cli-node/issues"},readme:"ERROR: No README data found!",homepage:"https://github.com/ddd-tool/domain-designer-cli-node#readme",_id:"@ddd-tool/domain-designer-cli@0.0.0-alpha.13"};function Qc(t){let e=Pe.default.join(t.source);if(console.log("================ \u66F4\u65B0\u4F9D\u8D56: Starting... ================"),!ze.default.existsSync(Pe.default.join(e,"node_modules"))||ze.default.existsSync(Pe.default.join(t.source,"package.json"))){console.log("\u8BE5\u76EE\u5F55\u4E0D\u662F\u5DE5\u4F5C\u7A7A\u95F4\uFF0C\u65E0\u6CD5\u66F4\u65B0"),console.log("================ \u66F4\u65B0\u4F9D\u8D56: End ================");return}let i=Pe.default.join(e,"node_modules","version.txt"),s=ze.default.existsSync(i)&&ze.default.statSync(i).isFile()?ze.default.readFileSync(i).toString().trim():"unknown";if(s===mt.version){console.log("\u5DE5\u4F5C\u76EE\u5F55\u5DF2\u662F\u6700\u65B0\u7248\u672C\uFF0C\u65E0\u9700\u66F4\u65B0"),console.log("================ \u66F4\u65B0\u4F9D\u8D56: Succeeded ================");return}console.log("\u5DE5\u4F5C\u76EE\u5F55\u7248\u672C\uFF1A",s),An(Pe.default.join(e,"node_modules"));let r=Ui();r&&ze.default.rmSync(Pe.default.join(e,r.name)),jt(Pe.default.join(t.webRoot,"templates"),e,{ignore:["\u793A\u4F8B.ts"]}),r&&ze.default.writeFileSync(Pe.default.join(e,r.name),r.content,"utf-8"),console.log(`\u76EE\u5F55\u5DF2\u66F4\u65B0\u81F3 ${mt.version}`),console.log("================ \u66F4\u65B0\u4F9D\u8D56: Succeeded ================")}var Cn=V(require("node:path"),1),{t:Ut,setCurrentLang:Yy}=be().commands;function zy(){return Cn.default.resolve(Cn.default.dirname(process.argv[1]),"..").replace(/\\/g,"/")}var Ky=Wi(()=>{let t=(0,Ke.ref)(!1),e=(0,Ke.ref)("none"),i=(0,Ke.ref)(!1),s=zy(),r=process.cwd(),n=(0,Ke.reactive)({webRoot:s,source:r}),o=(0,Ke.reactive)({webRoot:s,source:r}),a=(0,Ke.reactive)({webRoot:s,source:r}),l=new it().name("domain-designer-cli").option("--debug","\u8C03\u8BD5\u6A21\u5F0F",!1).action(c=>{i.value=c.debug}).addCommand(Vc({currentCommand:e,args:n})).addCommand(Fc({currentCommand:e})).addCommand(Uc({currentCommand:e,args:o})).addCommand(zc({currentCommand:e,args:a}));function u(){l.parse(process.argv),"none"!==e.value&&(t.value=!0)}u();async function h(){let{langurage:c}=await(0,Tn.default)([{name:"langurage",type:"select",message:"Choose The language during this creation process",choices:[{title:"\u4E2D\u6587",value:"zh"},{title:"English",value:"en"}]}],{onCancel:Ft});Yy(c);let v=(await(0,Tn.default)([{name:"subcommand",type:"select",message:Ut("question.subcommand"),choices:[{title:Ut("question.subcommand.init"),value:"init"},{title:Ut("question.subcommand.updateWorkspace"),value:"updateWorkspace"},{title:Ut("question.subcommand.runWeb"),value:"runWeb"},{title:Ut("question.subcommand.info"),value:"info"}]}],{onCancel:Ft})).subcommand;if(e.value=v,v==="init")await Wc({currentCommand:e,args:n});else if(v==="updateWorkspace")await Yc({currentCommand:e,args:o});else if(v==="runWeb")await Kc({currentCommand:e,args:a});else if(v==="info")await jc({currentCommand:e});else{if(v==="none")return;isNever(v)}}return{states:{initCommandArgs:n,updateCommandArgs:o},commands:{async init(){t.value||(await h(),t.value=!0)},async exec(){let c=e.value;c==="info"?await Bc():c==="init"?await Xc(n):c==="runWeb"?await Zc(a):c==="updateWorkspace"?await Qc(o):c==="none"||isNever(c)}}}});function eh(){return Ky.api}var Rn=be().commands.t;console.info(Rn("signal.scriptStart"));var th=eh();Gy().then(()=>{console.info(Rn("signal.successComplete"))}).catch(t=>{console.error(t),console.error(Rn("signal.exitWithError"))});process.on("SIGINT",Ft);async function Gy(){console.log(`repository addr: ${mt.repository.url.replace(/git\+/g,"")}`),console.log(`script version: ${mt.version}`),console.log(""),console.log("args",process.argv.join(" ")),await th.commands.init(),th.commands.exec()}
|
|
152
152
|
/*! Bundled license information:
|
|
153
153
|
|
|
154
154
|
@vue/shared/dist/shared.cjs.prod.js:
|