@ddd-tool/domain-designer-cli 0.0.0-alpha.8 → 0.1.0-beta.0
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/LICENSE +1 -1
- package/README.md +105 -10
- package/bin/domain-designer-cli.cjs +278 -98
- package/package.json +19 -18
- package/scripts/build-ts.mjs +52 -0
- package/scripts/sync-ver.mjs +0 -0
- package/src/views/design-en.ts +18 -31
- package/src/views/design-zh.ts +14 -24
- package/src/views/index.ts +12 -4
- package/templates/example-agg.ts +31 -0
- package/templates/example.ts +91 -0
- 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 +33 -155
- package/templates/node_modules/@ddd-tool/domain-designer-core/define.d.ts +258 -124
- package/templates/node_modules/@ddd-tool/domain-designer-core/index.d.ts +3 -203
- package/templates/node_modules/@ddd-tool/domain-designer-core/info.d.ts +2 -0
- package/templates/node_modules/@ddd-tool/domain-designer-core/note.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/tsconfig.json +6 -19
- package/vite.config.ts +11 -5
- package/bin/domain-designer-cli.cjs.map +0 -7
- package/templates/node_modules/@ddd-tool/domain-designer-core/desc.d.ts +0 -2
- 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/templates//347/244/272/344/276/213.ts +0 -31
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DomainDesignInfo, DomainDesignInfoProvider, DomainDesignInfoType } from '../define';
|
|
2
|
-
export declare function createInfoProvider(designId: string): DomainDesignInfoProvider;
|
|
3
|
-
export declare function isDomainDesignInfoFunc<NAME extends string>(info: DomainDesignInfo<DomainDesignInfoType, NAME>): info is DomainDesignInfo<'Function', NAME>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createDomainDesigner } from '@ddd-tool/domain-designer-core'
|
|
2
|
-
|
|
3
|
-
const d = createDomainDesigner()
|
|
4
|
-
|
|
5
|
-
const 参与者 = d.actor('参与者')
|
|
6
|
-
const 命令 = d.command('命令', ['不关心类型的信息', d.info.field.id('主键字段')])
|
|
7
|
-
const 事件 = d.event('事件', () => {
|
|
8
|
-
const 防止作用域泄露的参数1 = d.info.field.str('防止作用域泄露的参数1')
|
|
9
|
-
const 防止作用域泄露的参数2 = d.info.field.enum('防止作用域泄露的参数2', '枚举类型 1有效 2无效')
|
|
10
|
-
const 防止作用域泄露的实体主键 = d.info.field.id('主键')
|
|
11
|
-
const 防止作用域泄露的实体属性 = '实体属性'
|
|
12
|
-
return [
|
|
13
|
-
d.info.func('方法', [防止作用域泄露的参数1, 防止作用域泄露的参数2]),
|
|
14
|
-
d.info.entity('实体', [防止作用域泄露的实体主键, 防止作用域泄露的实体属性]),
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
const 外部系统 = d.system('外部系统')
|
|
18
|
-
|
|
19
|
-
const 聚合 = d.agg(
|
|
20
|
-
'聚合',
|
|
21
|
-
[事件.inner.方法, 事件.inner.实体, 命令.inner.不关心类型的信息, 命令.inner.主键字段],
|
|
22
|
-
d.desc`如果你愿意,可以在注释中使用类型安全的强引用来描述与其他元素的关系。
|
|
23
|
-
如: ${参与者}可以在执行${命令}时,可选地指定${命令.inner.不关心类型的信息}字段`
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
const 工作流 = d.startWorkflow('开始一个工作流')
|
|
27
|
-
参与者.command(命令).agg(聚合).event(事件).system(外部系统)
|
|
28
|
-
|
|
29
|
-
d.defineUserStory('定义一个用户故事', [工作流])
|
|
30
|
-
|
|
31
|
-
export default d
|