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 fa34c45 commit 61de759
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ const UI_FRAMEWORK = process.env.UI_FRAMEWORK;
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",
mui: "mui-example",
no: "headless-example",
};

return {
[uiFrameworkToExampleMap[uiFramework]]:
uiFrameworkToExampleMap[uiFramework],
};
}

return {
[uiFramework === "no" ? "inferencer-headless" : "inferencer"]:
uiFramework === "no" ? "inferencer-headless" : "inferencer",
};
};

const buildRemote = async () => {
const dataProviderMap = {
"custom-json-rest": ["keycloak", "custom"],
Expand All @@ -22,12 +43,6 @@ const buildRemote = async () => {
hasura: ["keycloak", "custom"],
};

const uiFrameworkToExampleMap = {
antd: "antd-example",
mui: "mui-example",
no: "headless-example",
};

let AUTH_PROVIDER = dataProviderMap[DATA_PROVIDER];

if (Array.isArray(AUTH_PROVIDER)) {
Expand All @@ -53,8 +68,7 @@ const buildRemote = async () => {
icon: "refine.svg",
"data-provider": `data-provider-${DATA_PROVIDER}`,
"ui-framework": UI_FRAMEWORK,
[uiFrameworkToExampleMap[UI_FRAMEWORK]]:
uiFrameworkToExampleMap[UI_FRAMEWORK],
...getExampleProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK),
"auth-provider": `auth-provider-${AUTH_PROVIDER}`,
[`i18n-${UI_FRAMEWORK}`]:
FRAMEWORK === "vite"
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/build-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ const randomString = (length) => {
return result;
};

const getExampleProjectFromAnswers = (framework, uiFramework) => {
console.log("framework", framework);
if (framework === "vite") {
const uiFrameworkToExampleMap = {
antd: "antd-example",
mui: "mui-example",
no: "headless-example",
};

return {
[uiFrameworkToExampleMap[uiFramework]]:
uiFrameworkToExampleMap[uiFramework],
};
}

return {
[uiFramework === "no" ? "inferencer-headless" : "inferencer"]:
uiFramework === "no" ? "inferencer-headless" : "inferencer",
};
};

const buildTemplate = async () => {
const dataProviderMap = {
"custom-json-rest": ["keycloak", "custom"],
Expand All @@ -29,12 +50,6 @@ const buildTemplate = async () => {
hasura: ["keycloak", "custom"],
};

const uiFrameworkToExampleMap = {
antd: "antd-example",
mui: "mui-example",
no: "headless-example",
};

let AUTH_PROVIDER = dataProviderMap[DATA_PROVIDER];

if (Array.isArray(AUTH_PROVIDER)) {
Expand All @@ -61,8 +76,7 @@ const buildTemplate = async () => {
icon: "refine.svg",
"data-provider": `data-provider-${DATA_PROVIDER}`,
"ui-framework": UI_FRAMEWORK,
[uiFrameworkToExampleMap[UI_FRAMEWORK]]:
uiFrameworkToExampleMap[UI_FRAMEWORK],
...getExampleProjectFromAnswers(FRAMEWORK, UI_FRAMEWORK),
"auth-provider": `auth-provider-${AUTH_PROVIDER}`,
[`i18n-${UI_FRAMEWORK}`]:
FRAMEWORK === "vite"
Expand Down

0 comments on commit 61de759

Please sign in to comment.