Compare commits
3 Commits
v10.0.0-rc
...
v10.0.0
Author | SHA1 | Date | |
---|---|---|---|
48501407fc | |||
01cbdee2ca | |||
b70c0af0a9 |
@ -43,9 +43,6 @@
|
|||||||
|
|
||||||
Keycloakify is fully compatible with Keycloak 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, [~~22~~](https://github.com/keycloakify/keycloakify/issues/389#issuecomment-1822509763), 23, 24, 25...[and beyond](https://github.com/keycloakify/keycloakify/discussions/346#discussioncomment-5889791)
|
Keycloakify is fully compatible with Keycloak 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, [~~22~~](https://github.com/keycloakify/keycloakify/issues/389#issuecomment-1822509763), 23, 24, 25...[and beyond](https://github.com/keycloakify/keycloakify/discussions/346#discussioncomment-5889791)
|
||||||
|
|
||||||
> NOTE: Keycloakify 10, while still being tagged as release candidate is the version you should use if you are starting today.
|
|
||||||
> Use `yarn add keycloakify@next` or pin [the latest version candidate](https://www.npmjs.com/package/keycloakify?activeTab=versions).
|
|
||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
Friends for the project, we trust and recommend their services.
|
Friends for the project, we trust and recommend their services.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "10.0.0-rc.148",
|
"version": "10.0.0",
|
||||||
"description": "Create Keycloak themes using React",
|
"description": "Create Keycloak themes using React",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -10,7 +10,8 @@ import {
|
|||||||
join as pathJoin,
|
join as pathJoin,
|
||||||
relative as pathRelative,
|
relative as pathRelative,
|
||||||
sep as pathSep,
|
sep as pathSep,
|
||||||
basename as pathBasename
|
basename as pathBasename,
|
||||||
|
dirname as pathDirname
|
||||||
} from "path";
|
} from "path";
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
@ -211,6 +212,17 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const getRealmJsonFilePath_defaultForKeycloakMajor = (
|
||||||
|
keycloakMajorVersionNumber: number
|
||||||
|
) =>
|
||||||
|
pathJoin(
|
||||||
|
getThisCodebaseRootDirPath(),
|
||||||
|
"src",
|
||||||
|
"bin",
|
||||||
|
"start-keycloak",
|
||||||
|
`myrealm-realm-${keycloakMajorVersionNumber}.json`
|
||||||
|
);
|
||||||
|
|
||||||
const realmJsonFilePath = await (async () => {
|
const realmJsonFilePath = await (async () => {
|
||||||
if (cliCommandOptions.realmJsonFilePath !== undefined) {
|
if (cliCommandOptions.realmJsonFilePath !== undefined) {
|
||||||
if (cliCommandOptions.realmJsonFilePath === "none") {
|
if (cliCommandOptions.realmJsonFilePath === "none") {
|
||||||
@ -231,20 +243,12 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
}
|
}
|
||||||
|
|
||||||
const internalFilePath = await (async () => {
|
const internalFilePath = await (async () => {
|
||||||
const dirPath = pathJoin(
|
const defaultFilePath = getRealmJsonFilePath_defaultForKeycloakMajor(
|
||||||
getThisCodebaseRootDirPath(),
|
keycloakMajorVersionNumber
|
||||||
"src",
|
|
||||||
"bin",
|
|
||||||
"start-keycloak"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const filePath = pathJoin(
|
if (fs.existsSync(defaultFilePath)) {
|
||||||
dirPath,
|
return defaultFilePath;
|
||||||
`myrealm-realm-${keycloakMajorVersionNumber}.json`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fs.existsSync(filePath)) {
|
|
||||||
return filePath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
@ -255,6 +259,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
|
|
||||||
console.log(chalk.cyan("Select what configuration to use:"));
|
console.log(chalk.cyan("Select what configuration to use:"));
|
||||||
|
|
||||||
|
const dirPath = pathDirname(defaultFilePath);
|
||||||
|
|
||||||
const { value } = await cliSelect<string>({
|
const { value } = await cliSelect<string>({
|
||||||
values: [
|
values: [
|
||||||
...fs
|
...fs
|
||||||
@ -296,6 +302,40 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
return filePath;
|
return filePath;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
add_test_user_if_missing: {
|
||||||
|
if (realmJsonFilePath === undefined) {
|
||||||
|
break add_test_user_if_missing;
|
||||||
|
}
|
||||||
|
|
||||||
|
const realm: Record<string, unknown> = JSON.parse(
|
||||||
|
fs.readFileSync(realmJsonFilePath).toString("utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (realm.users !== undefined) {
|
||||||
|
break add_test_user_if_missing;
|
||||||
|
}
|
||||||
|
|
||||||
|
const realmJsonFilePath_internal = (() => {
|
||||||
|
const filePath = getRealmJsonFilePath_defaultForKeycloakMajor(
|
||||||
|
keycloakMajorVersionNumber
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
return getRealmJsonFilePath_defaultForKeycloakMajor(25);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filePath;
|
||||||
|
})();
|
||||||
|
|
||||||
|
const users = JSON.parse(
|
||||||
|
fs.readFileSync(realmJsonFilePath_internal).toString("utf8")
|
||||||
|
).users;
|
||||||
|
|
||||||
|
realm.users = users;
|
||||||
|
|
||||||
|
fs.writeFileSync(realmJsonFilePath, JSON.stringify(realm, null, 2), "utf8");
|
||||||
|
}
|
||||||
|
|
||||||
async function extractThemeResourcesFromJar() {
|
async function extractThemeResourcesFromJar() {
|
||||||
await extractArchive({
|
await extractArchive({
|
||||||
archiveFilePath: jarFilePath,
|
archiveFilePath: jarFilePath,
|
||||||
|
Reference in New Issue
Block a user