@ddd-tool/domain-designer-generator 0.0.0-alpha.1 → 0.0.0-alpha.3
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 +56 -45
- 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 +3 -1
- package/index.js +1923 -1716
- package/package.json +3 -4
- 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,52 +7,63 @@ export declare enum Language {
|
|
|
7
7
|
CSharp = "csharp",
|
|
8
8
|
Go = "go"
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
imports
|
|
12
|
-
|
|
13
|
-
name
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
16
26
|
}
|
|
17
|
-
export interface CodeSnippets {
|
|
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
|
}
|
|
21
|
-
export declare
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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[];
|
|
32
|
+
export declare namespace java {
|
|
33
|
+
enum JavaGeneratorAddition {
|
|
34
|
+
Lombok = "Lombok",
|
|
35
|
+
LombokBuilder = "LombokBuilder",
|
|
36
|
+
RecordVakueObject = "RecordVakueObject",
|
|
37
|
+
CommandHandler = "CommandHandler",
|
|
38
|
+
Jpa = "Jpa",
|
|
39
|
+
Timezone = "Timezone"
|
|
40
|
+
}
|
|
41
|
+
interface JavaContext extends GeneratorContext<Language.Java> {
|
|
42
|
+
nonNullAnnotation: string;
|
|
43
|
+
nullableAnnotation: string;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export declare namespace kotlin {
|
|
47
|
+
enum KotlinGeneratorAddition {
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export declare namespace csharp {
|
|
51
|
+
enum CSharpGeneratorAddition {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export declare namespace go {
|
|
55
|
+
enum GoGeneratorAddition {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export type GeneratorAddition<LANG extends Language> = LANG extends 'java' ? java.JavaGeneratorAddition : LANG extends 'kotlin' ? kotlin.KotlinGeneratorAddition : LANG extends 'csharp' ? csharp.CSharpGeneratorAddition : LANG extends 'go' ? go.GoGeneratorAddition : never;
|
|
59
|
+
export interface GeneratorContext<LANG extends Language> {
|
|
60
|
+
namespace: string;
|
|
61
|
+
moduleName: string;
|
|
62
|
+
additions: Set<GeneratorAddition<LANG>>;
|
|
58
63
|
}
|
|
64
|
+
export type InfoCodeProvider = (info: DomainDesignInfo<DomainDesignInfoType, string>) => CodeSnippets<'Info'>[];
|
|
65
|
+
export type CommandCodeProvider = (cmd: DomainDesignCommand<DomainDesignInfoRecord>) => CodeSnippets<'Command' | 'CommandHandler'>[];
|
|
66
|
+
export type FacadeCommandCodeProvider = (cmd: DomainDesignFacadeCommand<DomainDesignInfoRecord>) => CodeSnippets<'FacadeCommand'>[];
|
|
67
|
+
export type AggCodeProvider = (agg: DomainDesignAgg<DomainDesignInfoRecord>) => CodeSnippets<'Agg'>[];
|
|
68
|
+
export type EventCodeProvider = (event: DomainDesignEvent<DomainDesignInfoRecord>) => CodeSnippets<'Event'>[];
|
|
69
|
+
export type ReadModelCodeProvider = (readModel: DomainDesignReadModel<DomainDesignInfoRecord>) => CodeSnippets<'ReadMode'>[];
|