@ddd-tool/domain-designer-cli 0.0.0-alpha.9 → 0.1.0-beta.1

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.
Files changed (28) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +125 -13
  3. package/bin/domain-designer-cli.cjs +280 -99
  4. package/package.json +20 -19
  5. package/scripts/build-ts.mjs +52 -0
  6. package/scripts/sync-ver.mjs +0 -0
  7. package/src/views/design-en.ts +18 -31
  8. package/src/views/design-zh.ts +14 -24
  9. package/src/views/index.ts +12 -4
  10. package/templates/example-agg.ts +31 -0
  11. package/templates/example.ts +91 -0
  12. package/templates/node_modules/@ddd-tool/domain-designer-core/actor.d.ts +1 -1
  13. package/templates/node_modules/@ddd-tool/domain-designer-core/common.d.ts +34 -155
  14. package/templates/node_modules/@ddd-tool/domain-designer-core/define.d.ts +259 -124
  15. package/templates/node_modules/@ddd-tool/domain-designer-core/index.d.ts +3 -203
  16. package/templates/node_modules/@ddd-tool/domain-designer-core/info.d.ts +2 -0
  17. package/templates/node_modules/@ddd-tool/domain-designer-core/note.d.ts +2 -0
  18. package/templates/node_modules/@ddd-tool/domain-designer-core/policy.d.ts +1 -1
  19. package/templates/node_modules/@ddd-tool/domain-designer-core/service.d.ts +1 -1
  20. package/templates/node_modules/@ddd-tool/domain-designer-core/system.d.ts +1 -1
  21. package/templates/node_modules/version.txt +1 -1
  22. package/tsconfig.json +6 -19
  23. package/vite.config.ts +11 -5
  24. package/bin/domain-designer-cli.cjs.map +0 -7
  25. package/templates/node_modules/@ddd-tool/domain-designer-core/desc.d.ts +0 -2
  26. package/templates/node_modules/@ddd-tool/domain-designer-core/info/field.d.ts +0 -2
  27. package/templates/node_modules/@ddd-tool/domain-designer-core/info/index.d.ts +0 -3
  28. package/templates//347/244/272/344/276/213.ts +0 -31
@@ -1,10 +1,11 @@
1
- import { NonEmptyArray, DomainDesignAgg, DomainDesignAggProvider, DomainDesignCommand, DomainDesignCommandProvider, DomainDesignDescProvider, DomainDesignEvent, DomainDesignEventProvider, DomainDesignFacadeCommand, DomainDesignFacadeCommandProvider, DomainDesignInfoProvider, DomainDesignActor, DomainDesignActorProvider, DomainDesignPolicy, DomainDesignPolicyProvider, DomainDesignService, DomainDesignServiceProvider, DomainDesignSystem, DomainDesignSystemProvider, DomainDesignReadModel, DomainDesignReadModelProvider, CustomInfoArrayToInfoObject, DomainDesignInfo, DomainDesignInfoType } from '@ddd-tool/domain-designer-core/define';
1
+ import { NonEmptyArray, DomainDesignAgg, DomainDesignAggProvider, DomainDesignCommand, DomainDesignCommandProvider, DomainDesignNoteProvider, DomainDesignEvent, DomainDesignEventProvider, DomainDesignFacadeCommand, DomainDesignFacadeCommandProvider, DomainDesignInfoProvider, DomainDesignActor, DomainDesignActorProvider, DomainDesignPolicy, DomainDesignPolicyProvider, DomainDesignService, DomainDesignServiceProvider, DomainDesignSystem, DomainDesignSystemProvider, DomainDesignReadModel, DomainDesignReadModelProvider, CustomInfoArrayToInfoObject, DomainDesignInfo, DomainDesignInfoType, CustomInfo, DomainDesignOptions, DomainObjectSet, DomainDesignObject } from './define';
2
2
  export type LinkType = 'Association' | 'Dependency' | 'Aggregation' | 'Composition';
3
3
  type Rule = 'Info' | 'Actor' | 'Command' | 'FacadeCommand' | 'Agg' | 'Event' | 'Policy' | 'Service' | 'System' | 'ReadModel';
4
4
  export declare function genId(): string;
5
5
  type ContextInitializer = () => {
6
6
  id: string;
7
- createDesc: DomainDesignDescProvider;
7
+ options: DomainDesignOptions;
8
+ createNote: DomainDesignNoteProvider;
8
9
  createInfo: DomainDesignInfoProvider;
9
10
  createActor: DomainDesignActorProvider;
10
11
  createCommand: DomainDesignCommandProvider;
@@ -16,160 +17,29 @@ type ContextInitializer = () => {
16
17
  createSystem: DomainDesignSystemProvider;
17
18
  createReadModel: DomainDesignReadModelProvider;
18
19
  };
20
+ export declare function defaultOptions(): Required<DomainDesignOptions>;
19
21
  export type DomainDesignInternalContext = ReturnType<typeof createInternalContext>;
20
22
  declare function createInternalContext(initFn: ContextInitializer): {
21
23
  startWorkflow(name: string): string;
22
24
  defineUserStory(name: string, workflowNames: NonEmptyArray<string>): void;
23
- linkTo(srcRule: Rule, srcCode: string, targetRule: Rule, targetCode: string, linkType?: LinkType): void;
24
- getId(): string;
25
+ linkTo(srcRule: Rule, srcId: string, targetRule: Rule, targetId: string, linkType?: LinkType): void;
26
+ getDesignerId(): string;
27
+ getDesignerOptions(): Required<DomainDesignOptions>;
25
28
  getWorkflows(): Record<string, string[]>;
26
29
  getUserStories(): Record<string, string[]>;
27
30
  getLinks(): Record<string, LinkType>;
28
- getIdMap(): Record<string, object>;
29
- getCommands(): Readonly<{
30
- readonly _attributes: {
31
- __code: string;
32
- rule: "Command";
33
- name: string;
34
- infos: any;
35
- description?: Readonly<{
36
- readonly _attributes: {
37
- rule: "Desc";
38
- readonly template: TemplateStringsArray;
39
- readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
40
- };
41
- }> | undefined;
42
- };
43
- inner: any;
44
- agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
45
- agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
46
- }>[];
47
- getFacadeCommands(): Readonly<{
48
- readonly _attributes: {
49
- __code: string;
50
- rule: "FacadeCommand";
51
- name: string;
52
- infos: any;
53
- description?: Readonly<{
54
- readonly _attributes: {
55
- rule: "Desc";
56
- readonly template: TemplateStringsArray;
57
- readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
58
- };
59
- }> | undefined;
60
- };
61
- inner: any;
62
- agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
63
- agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
64
- service(service: DomainDesignService): DomainDesignService;
65
- service(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignService;
66
- }>[];
67
- getActors(): Readonly<{
68
- readonly _attributes: {
69
- __code: string;
70
- rule: "Actor";
71
- name: string;
72
- description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
73
- };
74
- command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
75
- command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
76
- facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(command: FACADECMD): FACADECMD;
77
- facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
78
- readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
79
- readModel<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR | import("@ddd-tool/domain-designer-core/define").NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
80
- }>[];
81
- getEvents(): Readonly<{
82
- readonly _attributes: {
83
- __code: string;
84
- rule: "Event";
85
- name: string;
86
- infos: any;
87
- description?: Readonly<{
88
- readonly _attributes: {
89
- rule: "Desc";
90
- readonly template: TemplateStringsArray;
91
- readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
92
- };
93
- }> | undefined;
94
- };
95
- inner: any;
96
- policy(policy: DomainDesignPolicy): DomainDesignPolicy;
97
- policy(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignPolicy;
98
- system(system: DomainDesignSystem): DomainDesignSystem;
99
- system(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignSystem;
100
- readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
101
- readModel<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR | import("@ddd-tool/domain-designer-core/define").NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
102
- }>[];
103
- getPolicies(): Readonly<{
104
- readonly _attributes: {
105
- __code: string;
106
- rule: "Policy";
107
- name: string;
108
- description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
109
- };
110
- service(service: DomainDesignService): DomainDesignService;
111
- service(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignService;
112
- }>[];
113
- getServices(): Readonly<{
114
- readonly _attributes: {
115
- __code: string;
116
- rule: "Service";
117
- name: string;
118
- description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
119
- };
120
- command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
121
- command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
122
- facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
123
- facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
124
- agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
125
- agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
126
- }>[];
127
- getSystems(): Readonly<{
128
- readonly _attributes: {
129
- __code: string;
130
- rule: "System";
131
- name: string;
132
- description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
133
- };
134
- command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
135
- command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
136
- facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
137
- facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
138
- }>[];
139
- getAggs(): Readonly<{
140
- readonly _attributes: {
141
- __code: string;
142
- rule: "Agg";
143
- name: string;
144
- infos: any;
145
- description?: Readonly<{
146
- readonly _attributes: {
147
- rule: "Desc";
148
- readonly template: TemplateStringsArray;
149
- readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
150
- };
151
- }> | undefined;
152
- };
153
- inner: any;
154
- event<EVENT extends DomainDesignEvent<any>>(event: EVENT): EVENT;
155
- event<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>;
156
- }>[];
157
- getReadModels(): Readonly<{
158
- readonly _attributes: {
159
- __code: string;
160
- rule: "ReadModel";
161
- name: string;
162
- infos: any;
163
- description?: Readonly<{
164
- readonly _attributes: {
165
- rule: "Desc";
166
- readonly template: TemplateStringsArray;
167
- readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
168
- };
169
- }> | undefined;
170
- };
171
- inner: any;
172
- }>[];
31
+ getIdMap(): Record<string, DomainDesignObject>;
32
+ getAssociationMap(): Record<string, DomainObjectSet<DomainDesignObject>>;
33
+ getCommands(): DomainDesignCommand<any>[];
34
+ getFacadeCommands(): DomainDesignFacadeCommand<any>[];
35
+ getActors(): DomainDesignActor[];
36
+ getEvents(): DomainDesignEvent<any>[];
37
+ getPolicies(): DomainDesignPolicy[];
38
+ getServices(): DomainDesignService[];
39
+ getSystems(): DomainDesignSystem[];
40
+ getAggs(): DomainDesignAgg<any>[];
41
+ getReadModels(): DomainDesignReadModel<any>[];
42
+ registerInfo(info: DomainDesignInfo<any, any>): void;
173
43
  registerCommand(command: DomainDesignCommand<any>): void;
174
44
  registerFacadeCommand(command: DomainDesignFacadeCommand<any>): void;
175
45
  registerActor(actor: DomainDesignActor): void;
@@ -179,13 +49,22 @@ declare function createInternalContext(initFn: ContextInitializer): {
179
49
  registerSystem(system: DomainDesignSystem): void;
180
50
  registerAgg(agg: DomainDesignAgg<any>): void;
181
51
  registerReadModel(readModel: DomainDesignReadModel<any>): void;
182
- customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<any, G_NAME> | G_NAME>>(arr: ARR): CustomInfoArrayToInfoObject<ARR>;
183
- createDesc: DomainDesignDescProvider;
52
+ customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): CustomInfoArrayToInfoObject<ARR>;
53
+ customInfoArrToInfoArr<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): DomainDesignInfo<DomainDesignInfoType, string>[];
54
+ toFormat<OBJ extends {
55
+ _attributes: {
56
+ __id: string;
57
+ name: string;
58
+ };
59
+ }>(obj: OBJ): string;
60
+ createNote: DomainDesignNoteProvider;
184
61
  info: {
185
- any: <NAME extends string>(name: NAME, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc) => DomainDesignInfo<"Any", NAME>;
186
- entity: <NAME extends string, ARR extends Array<DomainDesignInfo<DomainDesignInfoType, string> | string>>(name: NAME, infos?: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc) => DomainDesignInfo<"Entity", NAME>;
187
- func: <NAME extends string>(name: NAME, dependsOn: NonEmptyArray<import("@ddd-tool/domain-designer-core/define").DomainDesignInfoFuncDependsOn | string>, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc) => DomainDesignInfo<"Function", NAME>;
188
- field: import("@ddd-tool/domain-designer-core/define").DomainDesignInfoFieldProvider;
62
+ document<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Document", NAME>;
63
+ func<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Function", NAME>;
64
+ func<NAME extends string>(name: NAME, dependsOn: NonEmptyArray<import("./define").DomainDesignInfoFuncDependsOn | string | [string, string | import("./define").DomainDesignNote]>, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Function", NAME>;
65
+ id<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Id", NAME>;
66
+ valueObj<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"ValueObject", NAME>;
67
+ version<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Version", NAME>;
189
68
  };
190
69
  createPersion: DomainDesignActorProvider;
191
70
  createCommand: DomainDesignCommandProvider;