Add initialize-email-theme, initialize-account-theme and copy-keycloak-resources-to-public to commands that can be delegated to a custom handler

This commit is contained in:
Joseph Garrone 2024-10-06 13:18:12 +02:00
parent 9de2ed9eaf
commit 5045c5e8bf
4 changed files with 25 additions and 1 deletions

View File

@ -1,9 +1,15 @@
import { copyKeycloakResourcesToPublic } from "./shared/copyKeycloakResourcesToPublic";
import type { BuildContext } from "./shared/buildContext";
import { maybeDelegateCommandToCustomHandler } from "./shared/customHandler_delegate";
export async function command(params: { buildContext: BuildContext }) {
const { buildContext } = params;
maybeDelegateCommandToCustomHandler({
commandName: "copy-keycloak-resources-to-public",
buildContext
});
copyKeycloakResourcesToPublic({
buildContext
});

View File

@ -6,10 +6,16 @@ import { join as pathJoin, relative as pathRelative } from "path";
import * as fs from "fs";
import { updateAccountThemeImplementationInConfig } from "./updateAccountThemeImplementationInConfig";
import { command as updateKcGenCommand } from "../update-kc-gen";
import { maybeDelegateCommandToCustomHandler } from "../shared/customHandler_delegate";
export async function command(params: { buildContext: BuildContext }) {
const { buildContext } = params;
maybeDelegateCommandToCustomHandler({
commandName: "initialize-account-theme",
buildContext
});
const accountThemeSrcDirPath = pathJoin(buildContext.themeSrcDirPath, "account");
if (

View File

@ -4,10 +4,16 @@ import { promptKeycloakVersion } from "./shared/promptKeycloakVersion";
import type { BuildContext } from "./shared/buildContext";
import * as fs from "fs";
import { downloadAndExtractArchive } from "./tools/downloadAndExtractArchive";
import { maybeDelegateCommandToCustomHandler } from "./shared/customHandler_delegate";
export async function command(params: { buildContext: BuildContext }) {
const { buildContext } = params;
maybeDelegateCommandToCustomHandler({
commandName: "initialize-email-theme",
buildContext
});
const emailThemeSrcDirPath = pathJoin(buildContext.themeSrcDirPath, "email");
if (

View File

@ -6,7 +6,13 @@ export const BIN_NAME = "_keycloakify-custom-handler";
export const NOT_IMPLEMENTED_EXIT_CODE = 78;
export type CommandName = "update-kc-gen" | "eject-page" | "add-story";
export type CommandName =
| "update-kc-gen"
| "eject-page"
| "add-story"
| "initialize-account-theme"
| "initialize-email-theme"
| "copy-keycloak-resources-to-public";
export type ApiVersion = "v1";