Add context when prompting for the keycloak version number

This commit is contained in:
Joseph Garrone 2024-05-18 04:33:31 +02:00
parent 60fcb5fe10
commit 7fc6f7a7ae
4 changed files with 8 additions and 12 deletions

View File

@ -14,6 +14,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
const { log } = getLogger({ "isSilent": buildOptions.isSilent });
console.log("Select the Keycloak version from which you want to download the builtins theme:");
const { keycloakVersion } = await promptKeycloakVersion({
"startingFromMajor": undefined
});

View File

@ -28,7 +28,10 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
process.exit(-1);
}
console.log("Initialize with the base email theme from which version of Keycloak?");
const { keycloakVersion } = await promptKeycloakVersion({
// NOTE: This is arbitrary
"startingFromMajor": 17
});

View File

@ -1,7 +1,6 @@
import { getLatestsSemVersionedTagFactory } from "../tools/octokit-addons/getLatestsSemVersionedTag";
import { Octokit } from "@octokit/rest";
import cliSelect from "cli-select";
import { lastKeycloakVersionWithAccountV1 } from "./constants";
import { SemVer } from "../tools/SemVer";
export async function promptKeycloakVersion(params: { startingFromMajor: number | undefined }) {
@ -21,8 +20,6 @@ export async function promptKeycloakVersion(params: { startingFromMajor: number
return { getLatestsSemVersionedTag };
})();
console.log("Select Keycloak version");
const semVersionedTagByMajor = new Map<number, { tag: string; version: SemVer }>();
(
@ -45,15 +42,7 @@ export async function promptKeycloakVersion(params: { startingFromMajor: number
semVersionedTagByMajor.set(semVersionedTag.version.major, semVersionedTag);
});
const lastMajorVersions = Array.from(semVersionedTagByMajor.values()).map(({ tag: version }) => {
let out = version;
if (version === lastKeycloakVersionWithAccountV1) {
out += " (last version with account v1 built in)";
}
return out;
});
const lastMajorVersions = Array.from(semVersionedTagByMajor.values()).map(({ tag }) => tag);
const { value } = await cliSelect<string>({
"values": lastMajorVersions

View File

@ -22,6 +22,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
const doesImplementAccountTheme = metaInfKeycloakThemes.themes.some(({ name }) => name === accountV1ThemeName);
console.log("On which version of Keycloak do you want to test your theme?");
const { keycloakVersion, keycloakMajorNumber } = await (async function getKeycloakMajor(): Promise<{
keycloakVersion: string;
keycloakMajorNumber: number;