diff --git a/src/bin/eject-page.ts b/src/bin/eject-page.ts index 580a6bf9..77d054da 100644 --- a/src/bin/eject-page.ts +++ b/src/bin/eject-page.ts @@ -92,12 +92,14 @@ export async function command(params: { buildContext: BuildContext }) { const templateValue = "Template.tsx (Layout common to every page)"; const userProfileFormFieldsValue = "UserProfileFormFields.tsx (Renders the form of the register.ftl, login-update-profile.ftl, update-email.ftl and idp-review-user-profile.ftl)"; + const otherPageValue = "The page you're looking for isn't listed here"; const { value: pageIdOrComponent } = await cliSelect< | LoginThemePageId | AccountThemePageId | typeof templateValue | typeof userProfileFormFieldsValue + | typeof otherPageValue >({ values: (() => { switch (themeType) { @@ -105,10 +107,11 @@ export async function command(params: { buildContext: BuildContext }) { return [ templateValue, userProfileFormFieldsValue, - ...LOGIN_THEME_PAGE_IDS + ...LOGIN_THEME_PAGE_IDS, + otherPageValue ]; case "account": - return [templateValue, ...ACCOUNT_THEME_PAGE_IDS]; + return [templateValue, ...ACCOUNT_THEME_PAGE_IDS, otherPageValue]; } assert>(false); })() @@ -116,6 +119,17 @@ export async function command(params: { buildContext: BuildContext }) { process.exit(-1); }); + if (pageIdOrComponent === otherPageValue) { + console.log( + [ + "To style a page not included in the base Keycloak, such as one added by a third-party Keycloak extension,", + "refer to the documentation: https://docs.keycloakify.dev/features/styling-a-custom-page-not-included-in-base-keycloak" + ].join(" ") + ); + + process.exit(0); + } + console.log(`→ ${pageIdOrComponent}`); const componentBasename = (() => {