This commit is contained in:
parent
9218e97315
commit
593b929254
@ -300,6 +300,8 @@ function decodeHtmlEntities(htmlStr){
|
|||||||
<#continue>
|
<#continue>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2
|
||||||
|
|
||||||
<#-- https://github.com/keycloakify/keycloakify/discussions/406 -->
|
<#-- https://github.com/keycloakify/keycloakify/discussions/406 -->
|
||||||
<#if (
|
<#if (
|
||||||
["register.ftl", "register-user-profile.ftl", "info.ftl", "login.ftl", "login-update-password.ftl", "login-oauth2-device-verify-user-code.ftl"]?seq_contains(pageId) &&
|
["register.ftl", "register-user-profile.ftl", "info.ftl", "login.ftl", "login-update-password.ftl", "login-oauth2-device-verify-user-code.ftl"]?seq_contains(pageId) &&
|
||||||
|
@ -21,6 +21,7 @@ export type BuildOptionsLike = {
|
|||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
reactAppBuildDirPath: string;
|
reactAppBuildDirPath: string;
|
||||||
assetsDirPath: string;
|
assetsDirPath: string;
|
||||||
|
kcContextExclusionsFtlCode: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
@ -140,6 +141,10 @@ export function generateFtlFilesCodeFactory(params: {
|
|||||||
.replace(
|
.replace(
|
||||||
"lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX",
|
"lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX",
|
||||||
nameOfTheLocalizationRealmOverridesUserProfileProperty
|
nameOfTheLocalizationRealmOverridesUserProfileProperty
|
||||||
|
)
|
||||||
|
.replace(
|
||||||
|
"USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2",
|
||||||
|
buildOptions.kcContextExclusionsFtlCode ?? ""
|
||||||
);
|
);
|
||||||
const ftlObjectToJsCodeDeclaringAnObjectPlaceholder =
|
const ftlObjectToJsCodeDeclaringAnObjectPlaceholder =
|
||||||
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
import { downloadKeycloakDefaultTheme } from "../../shared/downloadKeycloakDefaultTheme";
|
import { downloadKeycloakDefaultTheme } from "../../shared/downloadKeycloakDefaultTheme";
|
||||||
import { transformCodebase } from "../../tools/transformCodebase";
|
import { transformCodebase } from "../../tools/transformCodebase";
|
||||||
|
|
||||||
type BuildOptionsLike = {
|
export type BuildOptionsLike = {
|
||||||
cacheDirPath: string;
|
cacheDirPath: string;
|
||||||
npmWorkspaceRootDirPath: string;
|
npmWorkspaceRootDirPath: string;
|
||||||
keycloakifyBuildDirPath: string;
|
keycloakifyBuildDirPath: string;
|
||||||
|
@ -3,7 +3,10 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, resolve as pathResolve } from "path";
|
import { join as pathJoin, resolve as pathResolve } from "path";
|
||||||
import { replaceImportsInJsCode } from "../replacers/replaceImportsInJsCode";
|
import { replaceImportsInJsCode } from "../replacers/replaceImportsInJsCode";
|
||||||
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
||||||
import { generateFtlFilesCodeFactory } from "../generateFtl";
|
import {
|
||||||
|
generateFtlFilesCodeFactory,
|
||||||
|
type BuildOptionsLike as BuildOptionsLike_kcContextExclusionsFtlCode
|
||||||
|
} from "../generateFtl";
|
||||||
import {
|
import {
|
||||||
type ThemeType,
|
type ThemeType,
|
||||||
lastKeycloakVersionWithAccountV1,
|
lastKeycloakVersionWithAccountV1,
|
||||||
@ -16,11 +19,17 @@ import {
|
|||||||
import { isInside } from "../../tools/isInside";
|
import { isInside } from "../../tools/isInside";
|
||||||
import type { BuildOptions } from "../../shared/buildOptions";
|
import type { BuildOptions } from "../../shared/buildOptions";
|
||||||
import { assert, type Equals } from "tsafe/assert";
|
import { assert, type Equals } from "tsafe/assert";
|
||||||
import { downloadKeycloakStaticResources } from "../../shared/downloadKeycloakStaticResources";
|
import {
|
||||||
|
downloadKeycloakStaticResources,
|
||||||
|
type BuildOptionsLike as BuildOptionsLike_downloadKeycloakStaticResources
|
||||||
|
} from "../../shared/downloadKeycloakStaticResources";
|
||||||
import { readFieldNameUsage } from "./readFieldNameUsage";
|
import { readFieldNameUsage } from "./readFieldNameUsage";
|
||||||
import { readExtraPagesNames } from "./readExtraPageNames";
|
import { readExtraPagesNames } from "./readExtraPageNames";
|
||||||
import { generateMessageProperties } from "./generateMessageProperties";
|
import { generateMessageProperties } from "./generateMessageProperties";
|
||||||
import { bringInAccountV1 } from "./bringInAccountV1";
|
import {
|
||||||
|
bringInAccountV1,
|
||||||
|
type BuildOptionsLike as BuildOptionsLike_bringInAccountV1
|
||||||
|
} from "./bringInAccountV1";
|
||||||
import { getThemeSrcDirPath } from "../../shared/getThemeSrcDirPath";
|
import { getThemeSrcDirPath } from "../../shared/getThemeSrcDirPath";
|
||||||
import { rmSync } from "../../tools/fs.rmSync";
|
import { rmSync } from "../../tools/fs.rmSync";
|
||||||
import { readThisNpmPackageVersion } from "../../tools/readThisNpmPackageVersion";
|
import { readThisNpmPackageVersion } from "../../tools/readThisNpmPackageVersion";
|
||||||
@ -30,19 +39,18 @@ import {
|
|||||||
} from "../../shared/metaInfKeycloakThemes";
|
} from "../../shared/metaInfKeycloakThemes";
|
||||||
import { objectEntries } from "tsafe/objectEntries";
|
import { objectEntries } from "tsafe/objectEntries";
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
export type BuildOptionsLike = BuildOptionsLike_kcContextExclusionsFtlCode &
|
||||||
|
BuildOptionsLike_downloadKeycloakStaticResources &
|
||||||
|
BuildOptionsLike_bringInAccountV1 & {
|
||||||
bundler: "vite" | "webpack";
|
bundler: "vite" | "webpack";
|
||||||
extraThemeProperties: string[] | undefined;
|
extraThemeProperties: string[] | undefined;
|
||||||
themeVersion: string;
|
|
||||||
loginThemeResourcesFromKeycloakVersion: string;
|
loginThemeResourcesFromKeycloakVersion: string;
|
||||||
reactAppBuildDirPath: string;
|
reactAppBuildDirPath: string;
|
||||||
cacheDirPath: string;
|
|
||||||
assetsDirPath: string;
|
assetsDirPath: string;
|
||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
npmWorkspaceRootDirPath: string;
|
|
||||||
reactAppRootDirPath: string;
|
reactAppRootDirPath: string;
|
||||||
keycloakifyBuildDirPath: string;
|
keycloakifyBuildDirPath: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ export type BuildOptions = {
|
|||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
assetsDirPath: string;
|
assetsDirPath: string;
|
||||||
npmWorkspaceRootDirPath: string;
|
npmWorkspaceRootDirPath: string;
|
||||||
|
kcContextExclusionsFtlCode: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UserProvidedBuildOptions = {
|
export type UserProvidedBuildOptions = {
|
||||||
@ -39,6 +40,7 @@ export type UserProvidedBuildOptions = {
|
|||||||
loginThemeResourcesFromKeycloakVersion?: string;
|
loginThemeResourcesFromKeycloakVersion?: string;
|
||||||
keycloakifyBuildDirPath?: string;
|
keycloakifyBuildDirPath?: string;
|
||||||
themeName?: string | string[];
|
themeName?: string | string[];
|
||||||
|
kcContextExclusionsFtlCode?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ResolvedViteConfig = {
|
export type ResolvedViteConfig = {
|
||||||
@ -302,6 +304,7 @@ export function readBuildOptions(params: {
|
|||||||
|
|
||||||
return pathJoin(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
return pathJoin(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
||||||
})(),
|
})(),
|
||||||
npmWorkspaceRootDirPath
|
npmWorkspaceRootDirPath,
|
||||||
|
kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user