Compare commits

...

7 Commits

4 changed files with 29 additions and 10 deletions

View File

@ -1,3 +1,11 @@
### **0.3.14** (2021-03-28)
- Fix standalone mode: imports from js
### **0.3.13** (2021-03-26)
### **0.3.12** (2021-03-26)
- Fix mocksContext

View File

@ -1,6 +1,6 @@
{
"name": "keycloakify",
"version": "0.3.12",
"version": "0.3.14",
"description": "Keycloak theme generator for Reacts app",
"repository": {
"type": "git",

View File

@ -67,17 +67,28 @@ export function generateKeycloakThemeResources(
}
if (/\.js?$/i.test(filePath)) {
}
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
"jsCode": sourceCode.toString("utf8"),
ftlValuesGlobalName,
"mode": params.mode
});
if (/\.js?$/i.test(filePath)) {
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
"jsCode": sourceCode.toString("utf8"),
ftlValuesGlobalName,
...(() => {
switch (params.mode) {
case "external assets": return {
"mode": params.mode,
"urlOrigin": params.urlOrigin,
"urlPathname": params.urlPathname
};
case "standalone": return {
"mode": params.mode
};
}
})()
});
}
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
}

View File

@ -9,7 +9,7 @@ import { resourcesCommonPath, resourcesPath } from "./urlResourcesPath";
export const kcTemplateContext: KcContext.Template = {
"url": {
"loginAction": "#",
"resourcesPath": `/${resourcesPath}`,
"resourcesPath": `${process.env["PUBLIC_URL"]}/${resourcesPath}`,
"resourcesCommonPath": `${process.env["PUBLIC_URL"]}/${resourcesCommonPath}`,
"loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
"loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg",