diff --git a/TopModel.Generator.Javascript/JavascriptResourceGenerator.cs b/TopModel.Generator.Javascript/JavascriptResourceGenerator.cs index 01bac262..56a9cee0 100644 --- a/TopModel.Generator.Javascript/JavascriptResourceGenerator.cs +++ b/TopModel.Generator.Javascript/JavascriptResourceGenerator.cs @@ -190,7 +190,7 @@ private void WriteSubModule(FileWriter fw, string lang, IEnumerable p } else { - fw.WriteLine(level, $@"""{submodule.Key.Split('.').First().ToCamelCase()}"": {{"); + fw.WriteLine(level, $@"{Quote(submodule.Key.Split('.').First().ToCamelCase())}: {{"); WriteSubModule(fw, lang, submodule.SelectMany(m => m), isComment, level + 1); if (isLast) { diff --git a/TopModel.Generator.Javascript/TypescriptDefinitionGenerator.cs b/TopModel.Generator.Javascript/TypescriptDefinitionGenerator.cs index da1002d0..d3183f3a 100644 --- a/TopModel.Generator.Javascript/TypescriptDefinitionGenerator.cs +++ b/TopModel.Generator.Javascript/TypescriptDefinitionGenerator.cs @@ -82,7 +82,7 @@ protected override void HandleClass(string fileName, Class classe, string tag) if (Config.EntityMode == EntityMode.TYPED) { - fw.WriteLine($"export type {classe.NamePascal} = EntityToType<{classe.NamePascal}EntityType>"); + fw.WriteLine($"export type {classe.NamePascal} = EntityToType<{classe.NamePascal}EntityType>;"); fw.Write($"export interface {classe.NamePascal}EntityType "); @@ -113,10 +113,10 @@ protected override void HandleClass(string fileName, Class classe, string tag) switch (property) { case CompositionProperty { Domain: null } cp: - fw.Write($"ObjectEntry<{cp.Composition.NamePascal}EntityType>"); + fw.Write($"ObjectEntry<{cp.Composition.NamePascal}EntityType>;"); break; case AliasProperty { Property: CompositionProperty { Domain: null } cp }: - fw.Write($"ObjectEntry<{cp.Composition.NamePascal}EntityType>"); + fw.Write($"ObjectEntry<{cp.Composition.NamePascal}EntityType>;"); break; case CompositionProperty cp when Config.IsListComposition(cp): if (cp.Composition.Name == classe.Name) @@ -125,34 +125,29 @@ protected override void HandleClass(string fileName, Class classe, string tag) } else { - fw.Write($"ListEntry<{cp.Composition.NamePascal}EntityType>"); + fw.Write($"ListEntry<{cp.Composition.NamePascal}EntityType>;"); } break; case AliasProperty { Property: CompositionProperty cp } when Config.IsListComposition(cp): if (cp.Composition.Name == classe.Name) { - fw.Write($"RecursiveListEntry"); + fw.Write($"RecursiveListEntry;"); } else { - fw.Write($"ListEntry<{cp.Composition.NamePascal}EntityType>"); + fw.Write($"ListEntry<{cp.Composition.NamePascal}EntityType>;"); } break; default: - fw.Write($"FieldEntry2"); + fw.Write($"FieldEntry2;"); break; } } else { - fw.Write(Config.GetType(property, Classes)); - } - - if (property != classe.Properties.Last()) - { - fw.Write(","); + fw.Write($"{Config.GetType(property, Classes)};"); } fw.Write("\r\n"); @@ -275,7 +270,7 @@ protected override void HandleClass(string fileName, Class classe, string tag) fw.WriteLine(); } - fw.WriteLine($"}}{(Config.EntityMode == EntityMode.TYPED ? string.Empty : " as const")}"); + fw.WriteLine($"}}{(Config.EntityMode == EntityMode.TYPED ? string.Empty : " as const")};"); if (classe.Reference) { diff --git a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-item.ts b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-item.ts index f61ca087..0fcb06b8 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-item.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-item.ts @@ -5,9 +5,9 @@ import {DO_ENTIER, DO_ID, DO_LIBELLE} from "@domains"; export interface ProfilItem { - id?: number, - libelle?: string, - nombreUtilisateurs?: number + id?: number; + libelle?: string; + nombreUtilisateurs?: number; } export const ProfilItemEntity = { @@ -32,4 +32,4 @@ export const ProfilItemEntity = { isRequired: true, label: "securite.profil.profilItem.nombreUtilisateurs" } -} as const +} as const; diff --git a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-read.ts b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-read.ts index 6dc05cbe..7496c1a2 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-read.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-read.ts @@ -8,12 +8,12 @@ import {UtilisateurItemEntity, UtilisateurItem} from "../utilisateur/utilisateur import {DroitCode} from "./references"; export interface ProfilRead { - id?: number, - libelle?: string, - droits?: DroitCode[], - dateCreation?: string, - dateModification?: string, - utilisateurs?: UtilisateurItem[] + id?: number; + libelle?: string; + droits?: DroitCode[]; + dateCreation?: string; + dateModification?: string; + utilisateurs?: UtilisateurItem[]; } export const ProfilReadEntity = { @@ -56,4 +56,4 @@ export const ProfilReadEntity = { type: "list", entity: UtilisateurItemEntity } -} as const +} as const; diff --git a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-write.ts b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-write.ts index 154ca2da..d76ef6c7 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/profil/profil-write.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/profil/profil-write.ts @@ -7,8 +7,8 @@ import {DO_CODE_LISTE, DO_LIBELLE} from "@domains"; import {DroitCode} from "./references"; export interface ProfilWrite { - libelle?: string, - droits?: DroitCode[] + libelle?: string; + droits?: DroitCode[]; } export const ProfilWriteEntity = { @@ -26,4 +26,4 @@ export const ProfilWriteEntity = { isRequired: false, label: "securite.profil.profil.droits" } -} as const +} as const; diff --git a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-item.ts b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-item.ts index 64e6e27c..5316c502 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-item.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-item.ts @@ -7,11 +7,11 @@ import {DO_CODE, DO_EMAIL, DO_ID, DO_LIBELLE} from "@domains"; import {TypeUtilisateurCode} from "./references"; export interface UtilisateurItem { - id?: number, - nom?: string, - prenom?: string, - email?: string, - typeUtilisateurCode?: TypeUtilisateurCode + id?: number; + nom?: string; + prenom?: string; + email?: string; + typeUtilisateurCode?: TypeUtilisateurCode; } export const UtilisateurItemEntity = { @@ -51,4 +51,4 @@ export const UtilisateurItemEntity = { isRequired: true, label: "securite.utilisateur.utilisateur.typeUtilisateurCode" } -} as const +} as const; diff --git a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-read.ts b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-read.ts index db3ee138..801af53b 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-read.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-read.ts @@ -7,17 +7,17 @@ import {DO_BOOLEEN, DO_CODE, DO_DATE, DO_DATE_HEURE, DO_EMAIL, DO_ID, DO_LIBELLE import {TypeUtilisateurCode} from "./references"; export interface UtilisateurRead { - id?: number, - nom?: string, - prenom?: string, - email?: string, - dateNaissance?: string, - adresse?: string, - actif?: boolean, - profilId?: number, - typeUtilisateurCode?: TypeUtilisateurCode, - dateCreation?: string, - dateModification?: string + id?: number; + nom?: string; + prenom?: string; + email?: string; + dateNaissance?: string; + adresse?: string; + actif?: boolean; + profilId?: number; + typeUtilisateurCode?: TypeUtilisateurCode; + dateCreation?: string; + dateModification?: string; } export const UtilisateurReadEntity = { @@ -100,4 +100,4 @@ export const UtilisateurReadEntity = { isRequired: false, label: "common.entityListeners.dateModification" } -} as const +} as const; diff --git a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-write.ts b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-write.ts index cfeff525..3c586501 100644 --- a/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-write.ts +++ b/samples/generators/angular/src/appgenerated/model/securite/utilisateur/utilisateur-write.ts @@ -7,14 +7,14 @@ import {DO_BOOLEEN, DO_CODE, DO_DATE, DO_EMAIL, DO_ID, DO_LIBELLE} from "@domain import {TypeUtilisateurCode} from "./references"; export interface UtilisateurWrite { - nom?: string, - prenom?: string, - email?: string, - dateNaissance?: string, - adresse?: string, - actif?: boolean, - profilId?: number, - typeUtilisateurCode?: TypeUtilisateurCode + nom?: string; + prenom?: string; + email?: string; + dateNaissance?: string; + adresse?: string; + actif?: boolean; + profilId?: number; + typeUtilisateurCode?: TypeUtilisateurCode; } export const UtilisateurWriteEntity = { @@ -76,4 +76,4 @@ export const UtilisateurWriteEntity = { isRequired: true, label: "securite.utilisateur.utilisateur.typeUtilisateurCode" } -} as const +} as const; diff --git a/samples/generators/focus/src/locale/securite.ts b/samples/generators/focus/src/locale/securite.ts index 94489818..e6a2398c 100644 --- a/samples/generators/focus/src/locale/securite.ts +++ b/samples/generators/focus/src/locale/securite.ts @@ -3,7 +3,7 @@ //// export const securite = { - "profil": { + profil: { droit: { code: "Droit", libelle: "Droit", @@ -25,7 +25,7 @@ export const securite = { libelle: "Libelle" } }, - "utilisateur": { + utilisateur: { typeUtilisateur: { code: "Type d'utilisateur", libelle: "Libelle" diff --git a/samples/generators/focus/src/model/securite/profil/profil-item.ts b/samples/generators/focus/src/model/securite/profil/profil-item.ts index 26145088..0e4ae349 100644 --- a/samples/generators/focus/src/model/securite/profil/profil-item.ts +++ b/samples/generators/focus/src/model/securite/profil/profil-item.ts @@ -5,11 +5,11 @@ import {EntityToType, FieldEntry2} from "@focus4/stores"; import {DO_ENTIER, DO_ID, DO_LIBELLE} from "../../../domains"; -export type ProfilItem = EntityToType +export type ProfilItem = EntityToType; export interface ProfilItemEntityType { - id: FieldEntry2, - libelle: FieldEntry2, - nombreUtilisateurs: FieldEntry2 + id: FieldEntry2; + libelle: FieldEntry2; + nombreUtilisateurs: FieldEntry2; } export const ProfilItemEntity: ProfilItemEntityType = { @@ -34,4 +34,4 @@ export const ProfilItemEntity: ProfilItemEntityType = { isRequired: true, label: "securite.profil.profilItem.nombreUtilisateurs" } -} +}; diff --git a/samples/generators/focus/src/model/securite/profil/profil-read.ts b/samples/generators/focus/src/model/securite/profil/profil-read.ts index 08390e51..1f8ab1c9 100644 --- a/samples/generators/focus/src/model/securite/profil/profil-read.ts +++ b/samples/generators/focus/src/model/securite/profil/profil-read.ts @@ -8,14 +8,14 @@ import {DO_CODE_LISTE, DO_DATE_HEURE, DO_ID, DO_LIBELLE} from "../../../domains" import {UtilisateurItemEntity, UtilisateurItemEntityType} from "../utilisateur/utilisateur-item"; import {DroitCode} from "./references"; -export type ProfilRead = EntityToType +export type ProfilRead = EntityToType; export interface ProfilReadEntityType { - id: FieldEntry2, - libelle: FieldEntry2, - droits: FieldEntry2, - dateCreation: FieldEntry2, - dateModification: FieldEntry2, - utilisateurs: ListEntry + id: FieldEntry2; + libelle: FieldEntry2; + droits: FieldEntry2; + dateCreation: FieldEntry2; + dateModification: FieldEntry2; + utilisateurs: ListEntry; } export const ProfilReadEntity: ProfilReadEntityType = { @@ -60,4 +60,4 @@ export const ProfilReadEntity: ProfilReadEntityType = { isRequired: true, label: "securite.profil.profilRead.utilisateurs" } -} +}; diff --git a/samples/generators/focus/src/model/securite/profil/profil-write.ts b/samples/generators/focus/src/model/securite/profil/profil-write.ts index b60295ee..92f4b6f8 100644 --- a/samples/generators/focus/src/model/securite/profil/profil-write.ts +++ b/samples/generators/focus/src/model/securite/profil/profil-write.ts @@ -7,10 +7,10 @@ import {DO_CODE_LISTE, DO_LIBELLE} from "../../../domains"; import {DroitCode} from "./references"; -export type ProfilWrite = EntityToType +export type ProfilWrite = EntityToType; export interface ProfilWriteEntityType { - libelle: FieldEntry2, - droits: FieldEntry2 + libelle: FieldEntry2; + droits: FieldEntry2; } export const ProfilWriteEntity: ProfilWriteEntityType = { @@ -28,4 +28,4 @@ export const ProfilWriteEntity: ProfilWriteEntityType = { isRequired: false, label: "securite.profil.profil.droits" } -} +}; diff --git a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-item.ts b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-item.ts index 0d42e7ac..64f28fa9 100644 --- a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-item.ts +++ b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-item.ts @@ -7,13 +7,13 @@ import {DO_CODE, DO_EMAIL, DO_ID, DO_LIBELLE} from "../../../domains"; import {TypeUtilisateurCode} from "./references"; -export type UtilisateurItem = EntityToType +export type UtilisateurItem = EntityToType; export interface UtilisateurItemEntityType { - id: FieldEntry2, - nom: FieldEntry2, - prenom: FieldEntry2, - email: FieldEntry2, - typeUtilisateurCode: FieldEntry2 + id: FieldEntry2; + nom: FieldEntry2; + prenom: FieldEntry2; + email: FieldEntry2; + typeUtilisateurCode: FieldEntry2; } export const UtilisateurItemEntity: UtilisateurItemEntityType = { @@ -53,4 +53,4 @@ export const UtilisateurItemEntity: UtilisateurItemEntityType = { isRequired: true, label: "securite.utilisateur.utilisateur.typeUtilisateurCode" } -} +}; diff --git a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-read.ts b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-read.ts index 72f0c906..5a396f32 100644 --- a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-read.ts +++ b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-read.ts @@ -7,19 +7,19 @@ import {DO_BOOLEEN, DO_CODE, DO_DATE, DO_DATE_HEURE, DO_EMAIL, DO_ID, DO_LIBELLE import {TypeUtilisateurCode} from "./references"; -export type UtilisateurRead = EntityToType +export type UtilisateurRead = EntityToType; export interface UtilisateurReadEntityType { - id: FieldEntry2, - nom: FieldEntry2, - prenom: FieldEntry2, - email: FieldEntry2, - dateNaissance: FieldEntry2, - adresse: FieldEntry2, - actif: FieldEntry2, - profilId: FieldEntry2, - typeUtilisateurCode: FieldEntry2, - dateCreation: FieldEntry2, - dateModification: FieldEntry2 + id: FieldEntry2; + nom: FieldEntry2; + prenom: FieldEntry2; + email: FieldEntry2; + dateNaissance: FieldEntry2; + adresse: FieldEntry2; + actif: FieldEntry2; + profilId: FieldEntry2; + typeUtilisateurCode: FieldEntry2; + dateCreation: FieldEntry2; + dateModification: FieldEntry2; } export const UtilisateurReadEntity: UtilisateurReadEntityType = { @@ -102,4 +102,4 @@ export const UtilisateurReadEntity: UtilisateurReadEntityType = { isRequired: false, label: "common.entityListeners.dateModification" } -} +}; diff --git a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-write.ts b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-write.ts index d90f98e4..80ed3b0a 100644 --- a/samples/generators/focus/src/model/securite/utilisateur/utilisateur-write.ts +++ b/samples/generators/focus/src/model/securite/utilisateur/utilisateur-write.ts @@ -7,16 +7,16 @@ import {DO_BOOLEEN, DO_CODE, DO_DATE, DO_EMAIL, DO_ID, DO_LIBELLE} from "../../. import {TypeUtilisateurCode} from "./references"; -export type UtilisateurWrite = EntityToType +export type UtilisateurWrite = EntityToType; export interface UtilisateurWriteEntityType { - nom: FieldEntry2, - prenom: FieldEntry2, - email: FieldEntry2, - dateNaissance: FieldEntry2, - adresse: FieldEntry2, - actif: FieldEntry2, - profilId: FieldEntry2, - typeUtilisateurCode: FieldEntry2 + nom: FieldEntry2; + prenom: FieldEntry2; + email: FieldEntry2; + dateNaissance: FieldEntry2; + adresse: FieldEntry2; + actif: FieldEntry2; + profilId: FieldEntry2; + typeUtilisateurCode: FieldEntry2; } export const UtilisateurWriteEntity: UtilisateurWriteEntityType = { @@ -78,4 +78,4 @@ export const UtilisateurWriteEntity: UtilisateurWriteEntityType = { isRequired: true, label: "securite.utilisateur.utilisateur.typeUtilisateurCode" } -} +};