From 290ad8b5929a2a54681961fd24ae09d890b24aff Mon Sep 17 00:00:00 2001
From: Joseph Garrone <joseph.garrone.gj@gmail.com>
Date: Fri, 4 Oct 2024 12:58:31 +0200
Subject: [PATCH] Update version ranges for Multi-Page account theme

---
 .../buildJars/getKeycloakVersionRangeForJar.ts       |  4 ++--
 src/bin/shared/KeycloakVersionRange.ts               |  2 +-
 src/bin/shared/buildContext.ts                       | 12 +++++++++---
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts b/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts
index 6c301223..89c42ef7 100644
--- a/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts
+++ b/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts
@@ -52,9 +52,9 @@ export function getKeycloakVersionRangeForJar(params: {
                 case "0.6":
                     switch (keycloakThemeAdditionalInfoExtensionVersion) {
                         case null:
-                            return undefined;
+                            return "26-and-above" as const;
                         case "1.1.5":
-                            return "25-and-above" as const;
+                            return "25" as const;
                     }
             }
             assert<Equals<typeof keycloakAccountV1Version, never>>(false);
diff --git a/src/bin/shared/KeycloakVersionRange.ts b/src/bin/shared/KeycloakVersionRange.ts
index 1e118ea1..860f42f0 100644
--- a/src/bin/shared/KeycloakVersionRange.ts
+++ b/src/bin/shared/KeycloakVersionRange.ts
@@ -5,5 +5,5 @@ export type KeycloakVersionRange =
 export namespace KeycloakVersionRange {
     export type WithoutAccountV1Theme = "22-to-25" | "all-other-versions";
 
-    export type WithAccountV1Theme = "21-and-below" | "23" | "24" | "25-and-above";
+    export type WithAccountV1Theme = "21-and-below" | "23" | "24" | "25" | "26-and-above";
 }
diff --git a/src/bin/shared/buildContext.ts b/src/bin/shared/buildContext.ts
index 852bd1fd..5fc09c3a 100644
--- a/src/bin/shared/buildContext.ts
+++ b/src/bin/shared/buildContext.ts
@@ -277,7 +277,8 @@ export function getBuildContext(params: {
                         "21-and-below": z.union([z.boolean(), z.string()]),
                         "23": z.union([z.boolean(), z.string()]),
                         "24": z.union([z.boolean(), z.string()]),
-                        "25-and-above": z.union([z.boolean(), z.string()])
+                        "25": z.union([z.boolean(), z.string()]),
+                        "26-and-above": z.union([z.boolean(), z.string()])
                     })
                     .optional()
             });
@@ -767,7 +768,11 @@ export function getBuildContext(params: {
                                 return "24" as const;
                             }
 
-                            return "25-and-above" as const;
+                            if (buildForKeycloakMajorVersionNumber === 25) {
+                                return "25" as const;
+                            }
+
+                            return "26-and-above" as const;
                         })();
 
                         assert<
@@ -855,7 +860,8 @@ export function getBuildContext(params: {
                         "21-and-below",
                         "23",
                         "24",
-                        "25-and-above"
+                        "25",
+                        "26-and-above"
                     ] as const) {
                         assert<
                             Equals<