@ddd-tool/domain-designer-generator 0.0.0-alpha.0 → 0.0.0-alpha.2
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 +3 -0
- package/domain/define.d.ts +35 -32
- package/domain/generator-agg.d.ts +3740 -35
- package/domain-plugin/generator-java-plugin.d.ts +192 -0
- package/domain-plugin/generator-kotlin-plugin.d.ts +189 -0
- package/index.d.ts +2 -1
- package/index.js +1845 -1693
- package/package.json +7 -5
- package/java-generator.d.ts +0 -22
package/README.md
CHANGED
package/domain/define.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DomainDesignInfo, DomainDesignInfoType, DomainDesignReadModel, type DomainDesignAgg, type DomainDesignCommand, type DomainDesignEvent, type DomainDesignFacadeCommand, type DomainDesignInfoRecord } from '@ddd-tool/domain-designer-core';
|
|
2
2
|
export type DomainNode = DomainDesignCommand<DomainDesignInfoRecord> | DomainDesignFacadeCommand<DomainDesignInfoRecord> | DomainDesignAgg<DomainDesignInfoRecord> | DomainDesignEvent<DomainDesignInfoRecord> | DomainDesignReadModel<DomainDesignInfoRecord>;
|
|
3
3
|
export declare function isStruct(o: object): o is DomainNode;
|
|
4
4
|
export declare enum Language {
|
|
@@ -7,14 +7,25 @@ export declare enum Language {
|
|
|
7
7
|
CSharp = "csharp",
|
|
8
8
|
Go = "go"
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
imports
|
|
12
|
-
|
|
13
|
-
name
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export declare class CodeFile {
|
|
11
|
+
private readonly imports;
|
|
12
|
+
private parentDir;
|
|
13
|
+
private name;
|
|
14
|
+
private content;
|
|
15
|
+
constructor(parentDir: string[], name: string);
|
|
16
|
+
addImport(imp: string): void;
|
|
17
|
+
addImports(imports: string[] | Set<string>): void;
|
|
18
|
+
getImports(): string[];
|
|
19
|
+
appendContent(content: string): void;
|
|
20
|
+
appendContentln(content: string): void;
|
|
21
|
+
getContent(): string;
|
|
22
|
+
getName(): string;
|
|
23
|
+
setName(name: string): void;
|
|
24
|
+
getParentDir(): string[];
|
|
25
|
+
setParentDir(parentDir: string[]): void;
|
|
26
|
+
}
|
|
27
|
+
export interface CodeSnippets<TYPE extends 'Info' | 'Agg' | 'Command' | 'CommandHandler' | 'Event' | 'FacadeCommand' | 'ReadMode'> {
|
|
28
|
+
type: TYPE;
|
|
18
29
|
imports: Set<string>;
|
|
19
30
|
content: string;
|
|
20
31
|
}
|
|
@@ -33,26 +44,18 @@ export declare enum CSharpGeneratorAddition {
|
|
|
33
44
|
export declare enum GoGeneratorAddition {
|
|
34
45
|
}
|
|
35
46
|
export type GeneratorAddition<LANG extends Language> = LANG extends 'java' ? JavaGeneratorAddition : LANG extends 'kotlin' ? KotlinGeneratorAddition : LANG extends 'csharp' ? CSharpGeneratorAddition : LANG extends 'go' ? GoGeneratorAddition : never;
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
abstract getCommandCode(cmd: DomainDesignCommand<DomainDesignInfoRecord>): CodeSnippets;
|
|
52
|
-
abstract getFacadeCommandCode(cmd: DomainDesignFacadeCommand<DomainDesignInfoRecord>): CodeSnippets;
|
|
53
|
-
abstract getAggCode(agg: DomainDesignAgg<DomainDesignInfoRecord>): CodeSnippets;
|
|
54
|
-
abstract getEventCode(event: DomainDesignEvent<DomainDesignInfoRecord>): CodeSnippets;
|
|
55
|
-
abstract getInfoCode(info: DomainDesignInfo<DomainDesignInfoType, string>): CodeSnippets;
|
|
56
|
-
abstract getReadModelCode(readModel: DomainDesignReadModel<DomainDesignInfoRecord>): CodeSnippets;
|
|
57
|
-
abstract generate(): CodeFile[];
|
|
58
|
-
}
|
|
47
|
+
export interface JavaContext extends GeneratorContext<Language.Java> {
|
|
48
|
+
nonNullAnnotation: string;
|
|
49
|
+
nullableAnnotation: string;
|
|
50
|
+
}
|
|
51
|
+
export interface GeneratorContext<LANG extends Language> {
|
|
52
|
+
namespace: string;
|
|
53
|
+
moduleName: string;
|
|
54
|
+
additions: Set<GeneratorAddition<LANG>>;
|
|
55
|
+
}
|
|
56
|
+
export type InfoCodeProvider = (info: DomainDesignInfo<DomainDesignInfoType, string>) => CodeSnippets<'Info'>[];
|
|
57
|
+
export type CommandCodeProvider = (cmd: DomainDesignCommand<DomainDesignInfoRecord>) => CodeSnippets<'Command' | 'CommandHandler'>[];
|
|
58
|
+
export type FacadeCommandCodeProvider = (cmd: DomainDesignFacadeCommand<DomainDesignInfoRecord>) => CodeSnippets<'FacadeCommand'>[];
|
|
59
|
+
export type AggCodeProvider = (agg: DomainDesignAgg<DomainDesignInfoRecord>) => CodeSnippets<'Agg'>[];
|
|
60
|
+
export type EventCodeProvider = (event: DomainDesignEvent<DomainDesignInfoRecord>) => CodeSnippets<'Event'>[];
|
|
61
|
+
export type ReadModelCodeProvider = (readModel: DomainDesignReadModel<DomainDesignInfoRecord>) => CodeSnippets<'ReadMode'>[];
|