Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz committed Jan 17, 2024
1 parent 61de759 commit f1b63b8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/build-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"],
Expand Down Expand Up @@ -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),
},
};

Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/build-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const randomString = (length) => {
};

const getExampleProjectFromAnswers = (framework, uiFramework) => {
console.log("framework", framework);
if (framework === "vite") {
const uiFrameworkToExampleMap = {
antd: "antd-example",
Expand All @@ -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"],
Expand Down Expand Up @@ -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),
},
};

Expand Down

0 comments on commit f1b63b8

Please sign in to comment.