diff --git a/README.md b/README.md index 22d2bc32..d989cce7 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d # Changelog highlights +## v9.0 + +Restore support for Keycloak 22.1 and up! Huge thanks to @xgp without whom this wouldn't have been possible. +Big thanks also to @ssilvert from the Keycloak team for being so open to discussion and merging [@xgp's PR](https://github.com/keycloak/keycloak/pull/22317). + +### Breaking changes + +Very few. Check them out [here](https://docs.keycloakify.dev/migration-guides/v8-greater-than-v9). + ## 8.0 - Much smaller .jar size. 70.2 MB -> 7.8 MB. @@ -135,58 +144,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d ### Breaking changes -There are very few breaking changes in this major version. - -- The [`--external-assets` build option has been removed](https://docs.keycloakify.dev/v/v7/build-options#external-assets-deprecated) it was a performance optimization that is no longer relevant now that - we have lazy loading. - -- `kcContext.usernameEditDisabled` is now `kcContext.usernameHidden`, the type was lying, it has been updated to reflect what's actually on the `kcContext` at runtime. - If you want to see in detail what should be updated [see issue](https://github.com/keycloakify/keycloakify/pull/399), or you can search and replace `usernameEditDisabled` -> `usernameHidden` it'll do the trick. - -- The `usePrepareTemplate` prototype has been changed, you can search and replace: - -`src/keycloak-theme/login/Template.tsx` - -```ts -url, -"stylesCommon": [ - "node_modules/patternfly/dist/css/patternfly.min.css", - "node_modules/patternfly/dist/css/patternfly-additions.min.css", - "lib/zocial/zocial.css" -], -"styles": ["css/login.css"], -``` - -by - -```ts -"styles": [ - `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`, - `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`, - `${url.resourcesCommonPath}/lib/zocial/zocial.css`, - `${url.resourcesPath}/css/login.css` -], -``` - -and - -`src/keycloak-theme/account/Template.css` - -```ts -url, -"stylesCommon": ["node_modules/patternfly/dist/css/patternfly.min.css", "node_modules/patternfly/dist/css/patternfly-additions.min.css"], -"styles": ["css/account.css"], -``` - -by - -```ts -"styles": [ - `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`, - `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`, - `${url.resourcesPath}/css/account.css` -], -``` +There are very few breaking changes in this major version. [Check them out](https://docs.keycloakify.dev/migration-guides/v7-greater-than-v8). ## 7.15 diff --git a/src/bin/copy-keycloak-resources-to-public.ts b/src/bin/copy-keycloak-resources-to-public.ts index f8da391b..36c1fbbd 100644 --- a/src/bin/copy-keycloak-resources-to-public.ts +++ b/src/bin/copy-keycloak-resources-to-public.ts @@ -38,7 +38,7 @@ import * as fs from "fs"; "keycloakVersion": (() => { switch (themeType) { case "login": - return buildOptions.loginThemeDefaultResourcesFromKeycloakVersion; + return buildOptions.loginThemeResourcesFromKeycloakVersion; case "account": return lastKeycloakVersionWithAccountV1; } diff --git a/src/bin/keycloakify/BuildOptions.ts b/src/bin/keycloakify/BuildOptions.ts index 4ab16e10..9531727f 100644 --- a/src/bin/keycloakify/BuildOptions.ts +++ b/src/bin/keycloakify/BuildOptions.ts @@ -17,7 +17,7 @@ export type BuildOptions = { groupId: string; artifactId: string; bundler: Bundler; - loginThemeDefaultResourcesFromKeycloakVersion: string; + loginThemeResourcesFromKeycloakVersion: string; /** Directory of your built react project. Defaults to {cwd}/build */ reactAppBuildDirPath: string; /** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */ @@ -42,15 +42,7 @@ export function readBuildOptions(params: { projectDirPath: string; processArgv: const { name, keycloakify = {}, version, homepage } = parsedPackageJson; - const { - extraThemeProperties, - groupId, - artifactId, - bundler, - keycloakVersionDefaultAssets, - loginThemeDefaultResourcesFromKeycloakVersion, - extraThemeNames = [] - } = keycloakify ?? {}; + const { extraThemeProperties, groupId, artifactId, bundler, loginThemeResourcesFromKeycloakVersion, extraThemeNames = [] } = keycloakify ?? {}; const themeName = keycloakify.themeName ?? @@ -91,7 +83,7 @@ export function readBuildOptions(params: { projectDirPath: string; processArgv: "themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? process.env.KEYCLOAKIFY_VERSION ?? version ?? "0.0.0", extraThemeProperties, "isSilent": isSilentCliParamProvided, - "loginThemeDefaultResourcesFromKeycloakVersion": loginThemeDefaultResourcesFromKeycloakVersion ?? keycloakVersionDefaultAssets ?? "11.0.3", + "loginThemeResourcesFromKeycloakVersion": loginThemeResourcesFromKeycloakVersion ?? "11.0.3", "reactAppBuildDirPath": (() => { let { reactAppBuildDirPath = undefined } = parsedPackageJson.keycloakify ?? {}; diff --git a/src/bin/keycloakify/generateTheme/generateTheme.ts b/src/bin/keycloakify/generateTheme/generateTheme.ts index 5a4d30fb..9784d392 100644 --- a/src/bin/keycloakify/generateTheme/generateTheme.ts +++ b/src/bin/keycloakify/generateTheme/generateTheme.ts @@ -18,7 +18,7 @@ export type BuildOptionsLike = { themeName: string; extraThemeProperties: string[] | undefined; themeVersion: string; - loginThemeDefaultResourcesFromKeycloakVersion: string; + loginThemeResourcesFromKeycloakVersion: string; urlPathname: string | undefined; }; @@ -167,7 +167,7 @@ export async function generateTheme(params: { case "account": return lastKeycloakVersionWithAccountV1; case "login": - return buildOptions.loginThemeDefaultResourcesFromKeycloakVersion; + return buildOptions.loginThemeResourcesFromKeycloakVersion; } })(), themeDirPath, diff --git a/src/bin/keycloakify/parsedPackageJson.ts b/src/bin/keycloakify/parsedPackageJson.ts index 8bb7df1e..a1dd1393 100644 --- a/src/bin/keycloakify/parsedPackageJson.ts +++ b/src/bin/keycloakify/parsedPackageJson.ts @@ -16,9 +16,7 @@ export type ParsedPackageJson = { artifactId?: string; groupId?: string; bundler?: Bundler; - /** @deprecated: Use loginThemeDefaultResourcesFromKeycloakVersion instead */ - keycloakVersionDefaultAssets?: string; - loginThemeDefaultResourcesFromKeycloakVersion?: string; + loginThemeResourcesFromKeycloakVersion?: string; reactAppBuildDirPath?: string; keycloakifyBuildDirPath?: string; themeName?: string; @@ -37,8 +35,7 @@ export const zParsedPackageJson = z.object({ "artifactId": z.string().optional(), "groupId": z.string().optional(), "bundler": z.enum(bundlers).optional(), - "keycloakVersionDefaultAssets": z.string().optional(), - "loginThemeDefaultResourcesFromKeycloakVersion": z.string().optional(), + "loginThemeResourcesFromKeycloakVersion": z.string().optional(), "reactAppBuildDirPath": z.string().optional(), "keycloakifyBuildDirPath": z.string().optional(), "themeName": z.string().optional(),