Improve intentionality

This commit is contained in:
Joseph Garrone 2024-09-22 22:48:31 +02:00
parent c07af8491c
commit 26b8dd9cda
2 changed files with 12 additions and 8 deletions

View File

@ -26,18 +26,19 @@ export async function generateResources(params: {
rmSync(resourcesDirPath, { recursive: true }); rmSync(resourcesDirPath, { recursive: true });
} }
const { writeMessagePropertiesFiles } = await generateResourcesForMainTheme({ const { writeMessagePropertiesFilesForThemeVariant } =
resourcesDirPath, await generateResourcesForMainTheme({
themeName, resourcesDirPath,
buildContext themeName,
}); buildContext
});
for (const themeVariantName of themeVariantNames) { for (const themeVariantName of themeVariantNames) {
generateResourcesForThemeVariant({ generateResourcesForThemeVariant({
resourcesDirPath, resourcesDirPath,
themeName, themeName,
themeVariantName, themeVariantName,
writeMessagePropertiesFiles writeMessagePropertiesFiles: writeMessagePropertiesFilesForThemeVariant
}); });
} }
} }

View File

@ -51,7 +51,7 @@ export async function generateResourcesForMainTheme(params: {
themeName: string; themeName: string;
resourcesDirPath: string; resourcesDirPath: string;
}): Promise<{ }): Promise<{
writeMessagePropertiesFiles: (params: { writeMessagePropertiesFilesForThemeVariant: (params: {
getMessageDirPath: (params: { themeType: ThemeType }) => string; getMessageDirPath: (params: { themeType: ThemeType }) => string;
themeName: string; themeName: string;
}) => void; }) => void;
@ -353,7 +353,10 @@ export async function generateResourcesForMainTheme(params: {
} }
return { return {
writeMessagePropertiesFiles: ({ getMessageDirPath, themeName }) => { writeMessagePropertiesFilesForThemeVariant: ({
getMessageDirPath,
themeName
}) => {
objectEntries(writeMessagePropertiesFilesByThemeType).forEach( objectEntries(writeMessagePropertiesFilesByThemeType).forEach(
([themeType, writeMessagePropertiesFiles]) => { ([themeType, writeMessagePropertiesFiles]) => {
if (writeMessagePropertiesFiles === undefined) { if (writeMessagePropertiesFiles === undefined) {