From c897e7491a1d6f8d63bbf0c3ff8c16ada9b50598 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Thu, 18 Jan 2024 00:54:09 +0100 Subject: [PATCH] Use message of Keycloak version 23.0.4 #493 --- scripts/generate-i18n-messages.ts | 2 +- src/bin/download-builtin-keycloak-theme.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/generate-i18n-messages.ts b/scripts/generate-i18n-messages.ts index a9596581..660551bc 100644 --- a/scripts/generate-i18n-messages.ts +++ b/scripts/generate-i18n-messages.ts @@ -17,7 +17,7 @@ const isSilent = true; const logger = getLogger({ isSilent }); async function main() { - const keycloakVersion = "21.0.1"; + const keycloakVersion = "23.0.4"; const tmpDirPath = pathJoin(getProjectRoot(), "tmp_xImOef9dOd44"); diff --git a/src/bin/download-builtin-keycloak-theme.ts b/src/bin/download-builtin-keycloak-theme.ts index d9eb0be8..3b831e50 100644 --- a/src/bin/download-builtin-keycloak-theme.ts +++ b/src/bin/download-builtin-keycloak-theme.ts @@ -55,7 +55,9 @@ export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: st break install_and_move_to_common_resources_generated_in_keycloak_v2; } - child_process.execSync("npm install", { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" }); + const packageManager = fs.existsSync(pathJoin(accountV2DirSrcDirPath, "pnpm-lock.yaml")) ? "pnpm" : "npm"; + + child_process.execSync(`${packageManager} install`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" }); const packageJsonFilePath = pathJoin(accountV2DirSrcDirPath, "package.json"); @@ -64,12 +66,12 @@ export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: st const parsedPackageJson = JSON.parse(packageJsonRaw.toString("utf8")); parsedPackageJson.scripts.build = parsedPackageJson.scripts.build - .replace("npm run check-types", "true") - .replace("npm run babel", "true"); + .replace(`${packageManager} run check-types`, "true") + .replace(`${packageManager} run babel`, "true"); fs.writeFileSync(packageJsonFilePath, Buffer.from(JSON.stringify(parsedPackageJson, null, 2), "utf8")); - child_process.execSync("npm run build", { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" }); + child_process.execSync(`${packageManager} run build`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" }); fs.writeFileSync(packageJsonFilePath, packageJsonRaw);