diff --git a/.github/workflows/build-remote.js b/.github/workflows/build-remote.js index 2eaec0c9..c051e2f8 100644 --- a/.github/workflows/build-remote.js +++ b/.github/workflows/build-remote.js @@ -12,7 +12,6 @@ const USER_AGENT = process.env.CI_USER_AGENT; const FRAMEWORK = process.env.FRAMEWORK; const getExampleProjectFromAnswers = (framework, uiFramework) => { - console.log("framework", framework); if (framework === "vite") { const uiFrameworkToExampleMap = { antd: "antd-example", @@ -32,6 +31,19 @@ const getExampleProjectFromAnswers = (framework, uiFramework) => { }; }; +const getI18nProjectFromAnswers = (framework, uiFramework) => { + if (framework === "vite") { + return { + [`i18n-${uiFramework}`]: "no", + }; + } + + return { + [`i18n-${uiFramework}`]: + uiFramework === "no" ? "i18n" : `i18n-${uiFramework}`, + }; +}; + const buildRemote = async () => { const dataProviderMap = { "custom-json-rest": ["keycloak", "custom"], @@ -70,12 +82,7 @@ const buildRemote = async () => { "ui-framework": UI_FRAMEWORK, ...getExampleProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK), "auth-provider": `auth-provider-${AUTH_PROVIDER}`, - [`i18n-${UI_FRAMEWORK}`]: - FRAMEWORK === "vite" - ? "no" - : UI_FRAMEWORK === "no" - ? "i18n" - : `i18n-${UI_FRAMEWORK}`, + ...getI18nProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK), }, }; diff --git a/.github/workflows/build-template.js b/.github/workflows/build-template.js index b35d69ca..a9bc8b6e 100644 --- a/.github/workflows/build-template.js +++ b/.github/workflows/build-template.js @@ -19,7 +19,6 @@ const randomString = (length) => { }; const getExampleProjectFromAnswers = (framework, uiFramework) => { - console.log("framework", framework); if (framework === "vite") { const uiFrameworkToExampleMap = { antd: "antd-example", @@ -39,6 +38,19 @@ const getExampleProjectFromAnswers = (framework, uiFramework) => { }; }; +const getI18nProjectFromAnswers = (framework, uiFramework) => { + if (framework === "vite") { + return { + [`i18n-${uiFramework}`]: "no", + }; + } + + return { + [`i18n-${uiFramework}`]: + uiFramework === "no" ? "i18n" : `i18n-${uiFramework}`, + }; +}; + const buildTemplate = async () => { const dataProviderMap = { "custom-json-rest": ["keycloak", "custom"], @@ -78,12 +90,7 @@ const buildTemplate = async () => { "ui-framework": UI_FRAMEWORK, ...getExampleProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK), "auth-provider": `auth-provider-${AUTH_PROVIDER}`, - [`i18n-${UI_FRAMEWORK}`]: - FRAMEWORK === "vite" - ? "no" - : UI_FRAMEWORK === "no" - ? "i18n" - : `i18n-${UI_FRAMEWORK}`, + ...getI18nProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK), }, };