context-mapper-mcp 1.0.1 → 1.1.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.
Files changed (55) hide show
  1. package/dist/generators/builtin/plantuml-adapter.d.ts +60 -0
  2. package/dist/generators/builtin/plantuml-adapter.d.ts.map +1 -0
  3. package/dist/generators/builtin/plantuml-adapter.js +119 -0
  4. package/dist/generators/builtin/plantuml-adapter.js.map +1 -0
  5. package/dist/generators/cli/config.d.ts +105 -0
  6. package/dist/generators/cli/config.d.ts.map +1 -0
  7. package/dist/generators/cli/config.js +168 -0
  8. package/dist/generators/cli/config.js.map +1 -0
  9. package/dist/generators/cli/context-map.d.ts +26 -0
  10. package/dist/generators/cli/context-map.d.ts.map +1 -0
  11. package/dist/generators/cli/context-map.js +124 -0
  12. package/dist/generators/cli/context-map.js.map +1 -0
  13. package/dist/generators/cli/executor.d.ts +95 -0
  14. package/dist/generators/cli/executor.d.ts.map +1 -0
  15. package/dist/generators/cli/executor.js +277 -0
  16. package/dist/generators/cli/executor.js.map +1 -0
  17. package/dist/generators/cli/generic.d.ts +54 -0
  18. package/dist/generators/cli/generic.d.ts.map +1 -0
  19. package/dist/generators/cli/generic.js +224 -0
  20. package/dist/generators/cli/generic.js.map +1 -0
  21. package/dist/generators/cli/manager.d.ts +83 -0
  22. package/dist/generators/cli/manager.d.ts.map +1 -0
  23. package/dist/generators/cli/manager.js +281 -0
  24. package/dist/generators/cli/manager.js.map +1 -0
  25. package/dist/generators/cli/mdsl.d.ts +26 -0
  26. package/dist/generators/cli/mdsl.d.ts.map +1 -0
  27. package/dist/generators/cli/mdsl.js +118 -0
  28. package/dist/generators/cli/mdsl.js.map +1 -0
  29. package/dist/generators/interfaces.d.ts +144 -0
  30. package/dist/generators/interfaces.d.ts.map +1 -0
  31. package/dist/generators/interfaces.js +59 -0
  32. package/dist/generators/interfaces.js.map +1 -0
  33. package/dist/generators/registry.d.ts +100 -0
  34. package/dist/generators/registry.d.ts.map +1 -0
  35. package/dist/generators/registry.js +169 -0
  36. package/dist/generators/registry.js.map +1 -0
  37. package/dist/index.js +180 -3
  38. package/dist/index.js.map +1 -1
  39. package/dist/tools/cli-tools.d.ts +103 -0
  40. package/dist/tools/cli-tools.d.ts.map +1 -0
  41. package/dist/tools/cli-tools.js +220 -0
  42. package/dist/tools/cli-tools.js.map +1 -0
  43. package/dist/tools/generation-tools.d.ts +73 -1
  44. package/dist/tools/generation-tools.d.ts.map +1 -1
  45. package/dist/tools/generation-tools.js +160 -1
  46. package/dist/tools/generation-tools.js.map +1 -1
  47. package/dist/utils/temp-files.d.ts +77 -0
  48. package/dist/utils/temp-files.d.ts.map +1 -0
  49. package/dist/utils/temp-files.js +164 -0
  50. package/dist/utils/temp-files.js.map +1 -0
  51. package/package.json +4 -1
  52. package/src/templates/FullReportTemplate.md.ftl +297 -0
  53. package/src/templates/GlossaryTemplate.md.ftl +132 -0
  54. package/src/templates/JHipster-Microservices.jdl.ftl +139 -0
  55. package/src/templates/JHipster-Monolith.jdl.ftl +159 -0
@@ -0,0 +1,159 @@
1
+ <#--
2
+ JHipster Monolith JDL Template
3
+ Generates JHipster JDL for a monolithic application
4
+
5
+ All bounded contexts are combined into a single application.
6
+ Aggregates become entities organized by modules.
7
+ -->
8
+ <#-- Generate application definition -->
9
+ application {
10
+ config {
11
+ baseName ${model.name?replace(" ", "")?uncap_first}App
12
+ applicationType monolith
13
+ packageName com.example.${model.name?replace(" ", "")?lower_case}
14
+ authenticationType jwt
15
+ prodDatabaseType postgresql
16
+ buildTool gradle
17
+ clientFramework angular
18
+ serverPort 8080
19
+ }
20
+ entities *
21
+ }
22
+
23
+ <#-- Generate entities grouped by bounded context -->
24
+ <#list boundedContexts as bc>
25
+ // ==========================================
26
+ // ${bc.name}
27
+ // ==========================================
28
+ <#if bc.domainVisionStatement??>
29
+ // ${bc.domainVisionStatement}
30
+ </#if>
31
+
32
+ <#list bc.aggregates as agg>
33
+ <#list agg.entities as entity>
34
+ /**
35
+ * ${entity.name} entity
36
+ <#if entity.documentation??> * ${entity.documentation}</#if>
37
+ <#if entity.aggregateRoot?? && entity.aggregateRoot> * Aggregate root of ${agg.name}</#if>
38
+ */
39
+ entity ${entity.name} {
40
+ <#list entity.attributes as attr>
41
+ <#if attr.name != "id" && !attr.name?ends_with("Id")>
42
+ ${attr.name} ${mapJHipsterType(attr.type)}<#if attr.nullable?? && !attr.nullable> required</#if>
43
+ </#if>
44
+ </#list>
45
+ }
46
+
47
+ </#list>
48
+ <#-- Generate value objects with more than 2 attributes as entities -->
49
+ <#list agg.valueObjects as vo>
50
+ <#if vo.attributes?size gt 2>
51
+ /**
52
+ * ${vo.name} value object (embedded)
53
+ <#if vo.documentation??> * ${vo.documentation}</#if>
54
+ */
55
+ @readOnly
56
+ entity ${vo.name} {
57
+ <#list vo.attributes as attr>
58
+ ${attr.name} ${mapJHipsterType(attr.type)}
59
+ </#list>
60
+ }
61
+
62
+ </#if>
63
+ </#list>
64
+ </#list>
65
+ </#list>
66
+
67
+ <#-- Generate relationships -->
68
+ <#list boundedContexts as bc>
69
+ <#list bc.aggregates as agg>
70
+ <#if agg.aggregateRoot?? && agg.entities?size gt 1>
71
+ // Relationships in ${agg.name} aggregate
72
+ relationship OneToMany {
73
+ <#list agg.entities as entity>
74
+ <#if !entity.aggregateRoot?? || !entity.aggregateRoot>
75
+ ${agg.aggregateRoot.name}{${entity.name?uncap_first}s} to ${entity.name}{${agg.aggregateRoot.name?uncap_first}}
76
+ </#if>
77
+ </#list>
78
+ }
79
+
80
+ </#if>
81
+ <#-- Value object relationships -->
82
+ <#if agg.aggregateRoot??>
83
+ <#assign voCount = 0>
84
+ <#list agg.valueObjects as vo>
85
+ <#if vo.attributes?size gt 2>
86
+ <#assign voCount = voCount + 1>
87
+ </#if>
88
+ </#list>
89
+ <#if voCount gt 0>
90
+ relationship OneToOne {
91
+ <#list agg.valueObjects as vo>
92
+ <#if vo.attributes?size gt 2>
93
+ ${agg.aggregateRoot.name}{${vo.name?uncap_first}} to ${vo.name}
94
+ </#if>
95
+ </#list>
96
+ }
97
+
98
+ </#if>
99
+ </#if>
100
+ </#list>
101
+ </#list>
102
+
103
+ <#-- Generate enums -->
104
+ <#list boundedContexts as bc>
105
+ <#list bc.aggregates as agg>
106
+ <#-- Check for status-like attributes that could be enums -->
107
+ <#list agg.entities as entity>
108
+ <#list entity.attributes as attr>
109
+ <#if attr.name?lower_case?contains("status") || attr.name?lower_case?contains("state") || attr.name?lower_case?contains("type")>
110
+ // Consider creating enum for ${entity.name}.${attr.name}
111
+ // enum ${entity.name}${attr.name?cap_first} {
112
+ // VALUE1, VALUE2, VALUE3
113
+ // }
114
+ </#if>
115
+ </#list>
116
+ </#list>
117
+ </#list>
118
+ </#list>
119
+
120
+ <#-- DTO configuration -->
121
+ dto * with mapstruct
122
+
123
+ <#-- Service configuration -->
124
+ service * with serviceClass
125
+
126
+ <#-- Pagination -->
127
+ paginate * with pagination
128
+
129
+ <#-- Search configuration (optional) -->
130
+ // search * with elasticsearch
131
+
132
+ <#-- Helper function to map CML types to JHipster types -->
133
+ <#function mapJHipsterType cmlType>
134
+ <#if cmlType?starts_with("-")>
135
+ <#return "String">
136
+ <#elseif cmlType == "String">
137
+ <#return "String">
138
+ <#elseif cmlType == "int" || cmlType == "Integer">
139
+ <#return "Integer">
140
+ <#elseif cmlType == "long" || cmlType == "Long">
141
+ <#return "Long">
142
+ <#elseif cmlType == "float" || cmlType == "Float">
143
+ <#return "Float">
144
+ <#elseif cmlType == "double" || cmlType == "Double">
145
+ <#return "Double">
146
+ <#elseif cmlType == "boolean" || cmlType == "Boolean">
147
+ <#return "Boolean">
148
+ <#elseif cmlType == "DateTime" || cmlType == "Date">
149
+ <#return "Instant">
150
+ <#elseif cmlType == "BigDecimal">
151
+ <#return "BigDecimal">
152
+ <#elseif cmlType == "UUID">
153
+ <#return "UUID">
154
+ <#elseif cmlType?starts_with("List<") || cmlType?starts_with("Set<")>
155
+ <#return "String">
156
+ <#else>
157
+ <#return "String">
158
+ </#if>
159
+ </#function>