Fix build

This commit is contained in:
garronej
2023-04-19 05:32:19 +02:00
parent ffa65e871e
commit 1112da33e3
4 changed files with 9 additions and 21 deletions

View File

@ -30,13 +30,7 @@ export function createGetKcContext<KcContextExtension extends { pageId: string }
if (mockPageId !== undefined && realKcContext === undefined) { if (mockPageId !== undefined && realKcContext === undefined) {
//TODO maybe trow if no mock fo custom page //TODO maybe trow if no mock fo custom page
console.log( console.log(`%cKeycloakify: ${symToStr({ mockPageId })} set to ${mockPageId}.`, "background: red; color: yellow; font-size: medium");
[
`%cKeycloakify: ${symToStr({ mockPageId })} set to ${mockPageId}.`,
`If assets are missing make sure you have built your Keycloak theme at least once.`
].join(" "),
"background: red; color: yellow; font-size: medium"
);
const kcContextDefaultMock = kcContextMocks.find(({ pageId }) => pageId === mockPageId); const kcContextDefaultMock = kcContextMocks.find(({ pageId }) => pageId === mockPageId);

View File

@ -18,7 +18,7 @@ import * as fs from "fs";
const keycloakDirInPublicDir = pathJoin(process.env["PUBLIC_DIR_PATH"] || pathJoin(projectDirPath, "public"), basenameOfKeycloakDirInPublicDir); const keycloakDirInPublicDir = pathJoin(process.env["PUBLIC_DIR_PATH"] || pathJoin(projectDirPath, "public"), basenameOfKeycloakDirInPublicDir);
if (fs.existsSync(keycloakDirInPublicDir)) { if (fs.existsSync(keycloakDirInPublicDir)) {
console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} already exists. Aborting.`); console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} already exists.`);
return; return;
} }
@ -43,4 +43,6 @@ import * as fs from "fs";
); );
fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8")); fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8"));
console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} directory created.`);
})(); })();

View File

@ -33,13 +33,7 @@ export function createGetKcContext<KcContextExtension extends { pageId: string }
if (mockPageId !== undefined && realKcContext === undefined) { if (mockPageId !== undefined && realKcContext === undefined) {
//TODO maybe trow if no mock fo custom page //TODO maybe trow if no mock fo custom page
console.log( console.log(`%cKeycloakify: ${symToStr({ mockPageId })} set to ${mockPageId}.`, "background: red; color: yellow; font-size: medium");
[
`%cKeycloakify: ${symToStr({ mockPageId })} set to ${mockPageId}.`,
`If assets are missing make sure you have built your Keycloak theme at least once.`
].join(" "),
"background: red; color: yellow; font-size: medium"
);
const kcContextDefaultMock = kcContextMocks.find(({ pageId }) => pageId === mockPageId); const kcContextDefaultMock = kcContextMocks.find(({ pageId }) => pageId === mockPageId);

View File

@ -53,8 +53,7 @@ describe("Sample Project", () => {
const destDirPath = pathJoin( const destDirPath = pathJoin(
readBuildOptions({ readBuildOptions({
"isExternalAssetsCliParamProvided": false, "processArgv": ["--silent"],
"isSilent": true,
"projectDirPath": process.cwd() "projectDirPath": process.cwd()
}).keycloakifyBuildDirPath, }).keycloakifyBuildDirPath,
"src", "src",
@ -62,7 +61,7 @@ describe("Sample Project", () => {
"resources", "resources",
"theme" "theme"
); );
await downloadBuiltinKeycloakTheme({ destDirPath, keycloakVersion: "11.0.3", isSilent: false }); await downloadBuiltinKeycloakTheme({ destDirPath, keycloakVersion: "11.0.3", "isSilent": false });
}, },
{ timeout: 90000 } { timeout: 90000 }
); );
@ -80,8 +79,7 @@ describe("Sample Project", () => {
const destDirPath = pathJoin( const destDirPath = pathJoin(
readBuildOptions({ readBuildOptions({
"isExternalAssetsCliParamProvided": false, "processArgv": ["--silent"],
"isSilent": true,
"projectDirPath": process.cwd() "projectDirPath": process.cwd()
}).keycloakifyBuildDirPath, }).keycloakifyBuildDirPath,
"src", "src",
@ -89,7 +87,7 @@ describe("Sample Project", () => {
"resources", "resources",
"theme" "theme"
); );
await downloadBuiltinKeycloakTheme({ destDirPath, keycloakVersion: "11.0.3", isSilent: false }); await downloadBuiltinKeycloakTheme({ destDirPath, "keycloakVersion": "11.0.3", "isSilent": false });
}, },
{ timeout: 90000 } { timeout: 90000 }
); );