keycloakify 10.0.0-rc.30 → 10.0.0-rc.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/main.js +5 -2
- package/package.json +1 -1
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +2 -0
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +5 -0
- package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +1 -1
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +24 -16
- package/src/bin/shared/buildOptions.ts +4 -1
- package/vite-plugin/index.js +2 -1
package/bin/main.js
CHANGED
@@ -1193,6 +1193,7 @@ var constants_1 = __nccwpck_require__(173);
|
|
1193
1193
|
var getThisCodebaseRootDirPath_1 = __nccwpck_require__(58822);
|
1194
1194
|
(0, assert_1.assert)();
|
1195
1195
|
function generateFtlFilesCodeFactory(params) {
|
1196
|
+
var _a;
|
1196
1197
|
var themeName = params.themeName, cssGlobalsToDefine = params.cssGlobalsToDefine, indexHtmlCode = params.indexHtmlCode, buildOptions = params.buildOptions, keycloakifyVersion = params.keycloakifyVersion, themeType = params.themeType, fieldNames = params.fieldNames;
|
1197
1198
|
var $ = cheerio_1.default.load(indexHtmlCode);
|
1198
1199
|
fix_imports_statements: {
|
@@ -1267,7 +1268,8 @@ function generateFtlFilesCodeFactory(params) {
|
|
1267
1268
|
.replace("KEYCLOAKIFY_THEME_TYPE_dExKd3xEdr", themeType)
|
1268
1269
|
.replace("KEYCLOAKIFY_THEME_NAME_cXxKd3xEer", themeName)
|
1269
1270
|
.replace("RESOURCES_COMMON_cLsLsMrtDkpVv", constants_1.resources_common)
|
1270
|
-
.replace("lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX", constants_1.nameOfTheLocalizationRealmOverridesUserProfileProperty)
|
1271
|
+
.replace("lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX", constants_1.nameOfTheLocalizationRealmOverridesUserProfileProperty)
|
1272
|
+
.replace("USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2", (_a = buildOptions.kcContextExclusionsFtlCode) !== null && _a !== void 0 ? _a : "");
|
1271
1273
|
var ftlObjectToJsCodeDeclaringAnObjectPlaceholder = '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
1272
1274
|
$("head").prepend("<script>\nwindow.".concat(constants_1.nameOfTheGlobal, "=").concat(ftlObjectToJsCodeDeclaringAnObjectPlaceholder, "</script>"));
|
1273
1275
|
// Remove part of the document marked as ignored.
|
@@ -3858,7 +3860,8 @@ function readBuildOptions(params) {
|
|
3858
3860
|
}
|
3859
3861
|
return (0, path_1.join)(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
3860
3862
|
})(),
|
3861
|
-
npmWorkspaceRootDirPath: npmWorkspaceRootDirPath
|
3863
|
+
npmWorkspaceRootDirPath: npmWorkspaceRootDirPath,
|
3864
|
+
kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode
|
3862
3865
|
};
|
3863
3866
|
}
|
3864
3867
|
exports.readBuildOptions = readBuildOptions;
|
package/package.json
CHANGED
@@ -299,6 +299,8 @@ function decodeHtmlEntities(htmlStr){
|
|
299
299
|
<#local out_seq += ["/*" + path?join(".") + "." + key + " excluded*/"]>
|
300
300
|
<#continue>
|
301
301
|
</#if>
|
302
|
+
|
303
|
+
USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2
|
302
304
|
|
303
305
|
<#-- https://github.com/keycloakify/keycloakify/discussions/406 -->
|
304
306
|
<#if (
|
@@ -21,6 +21,7 @@ export type BuildOptionsLike = {
|
|
21
21
|
urlPathname: string | undefined;
|
22
22
|
reactAppBuildDirPath: string;
|
23
23
|
assetsDirPath: string;
|
24
|
+
kcContextExclusionsFtlCode: string | undefined;
|
24
25
|
};
|
25
26
|
|
26
27
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
@@ -140,6 +141,10 @@ export function generateFtlFilesCodeFactory(params: {
|
|
140
141
|
.replace(
|
141
142
|
"lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX",
|
142
143
|
nameOfTheLocalizationRealmOverridesUserProfileProperty
|
144
|
+
)
|
145
|
+
.replace(
|
146
|
+
"USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2",
|
147
|
+
buildOptions.kcContextExclusionsFtlCode ?? ""
|
143
148
|
);
|
144
149
|
const ftlObjectToJsCodeDeclaringAnObjectPlaceholder =
|
145
150
|
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
@@ -10,7 +10,7 @@ import {
|
|
10
10
|
import { downloadKeycloakDefaultTheme } from "../../shared/downloadKeycloakDefaultTheme";
|
11
11
|
import { transformCodebase } from "../../tools/transformCodebase";
|
12
12
|
|
13
|
-
type BuildOptionsLike = {
|
13
|
+
export type BuildOptionsLike = {
|
14
14
|
cacheDirPath: string;
|
15
15
|
npmWorkspaceRootDirPath: string;
|
16
16
|
keycloakifyBuildDirPath: string;
|
package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts
CHANGED
@@ -3,7 +3,10 @@ import * as fs from "fs";
|
|
3
3
|
import { join as pathJoin, resolve as pathResolve } from "path";
|
4
4
|
import { replaceImportsInJsCode } from "../replacers/replaceImportsInJsCode";
|
5
5
|
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
generateFtlFilesCodeFactory,
|
8
|
+
type BuildOptionsLike as BuildOptionsLike_kcContextExclusionsFtlCode
|
9
|
+
} from "../generateFtl";
|
7
10
|
import {
|
8
11
|
type ThemeType,
|
9
12
|
lastKeycloakVersionWithAccountV1,
|
@@ -16,11 +19,17 @@ import {
|
|
16
19
|
import { isInside } from "../../tools/isInside";
|
17
20
|
import type { BuildOptions } from "../../shared/buildOptions";
|
18
21
|
import { assert, type Equals } from "tsafe/assert";
|
19
|
-
import {
|
22
|
+
import {
|
23
|
+
downloadKeycloakStaticResources,
|
24
|
+
type BuildOptionsLike as BuildOptionsLike_downloadKeycloakStaticResources
|
25
|
+
} from "../../shared/downloadKeycloakStaticResources";
|
20
26
|
import { readFieldNameUsage } from "./readFieldNameUsage";
|
21
27
|
import { readExtraPagesNames } from "./readExtraPageNames";
|
22
28
|
import { generateMessageProperties } from "./generateMessageProperties";
|
23
|
-
import {
|
29
|
+
import {
|
30
|
+
bringInAccountV1,
|
31
|
+
type BuildOptionsLike as BuildOptionsLike_bringInAccountV1
|
32
|
+
} from "./bringInAccountV1";
|
24
33
|
import { getThemeSrcDirPath } from "../../shared/getThemeSrcDirPath";
|
25
34
|
import { rmSync } from "../../tools/fs.rmSync";
|
26
35
|
import { readThisNpmPackageVersion } from "../../tools/readThisNpmPackageVersion";
|
@@ -30,19 +39,18 @@ import {
|
|
30
39
|
} from "../../shared/metaInfKeycloakThemes";
|
31
40
|
import { objectEntries } from "tsafe/objectEntries";
|
32
41
|
|
33
|
-
export type BuildOptionsLike =
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
};
|
42
|
+
export type BuildOptionsLike = BuildOptionsLike_kcContextExclusionsFtlCode &
|
43
|
+
BuildOptionsLike_downloadKeycloakStaticResources &
|
44
|
+
BuildOptionsLike_bringInAccountV1 & {
|
45
|
+
bundler: "vite" | "webpack";
|
46
|
+
extraThemeProperties: string[] | undefined;
|
47
|
+
loginThemeResourcesFromKeycloakVersion: string;
|
48
|
+
reactAppBuildDirPath: string;
|
49
|
+
assetsDirPath: string;
|
50
|
+
urlPathname: string | undefined;
|
51
|
+
reactAppRootDirPath: string;
|
52
|
+
keycloakifyBuildDirPath: string;
|
53
|
+
};
|
46
54
|
|
47
55
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
48
56
|
|
@@ -30,6 +30,7 @@ export type BuildOptions = {
|
|
30
30
|
urlPathname: string | undefined;
|
31
31
|
assetsDirPath: string;
|
32
32
|
npmWorkspaceRootDirPath: string;
|
33
|
+
kcContextExclusionsFtlCode: string | undefined;
|
33
34
|
};
|
34
35
|
|
35
36
|
export type UserProvidedBuildOptions = {
|
@@ -39,6 +40,7 @@ export type UserProvidedBuildOptions = {
|
|
39
40
|
loginThemeResourcesFromKeycloakVersion?: string;
|
40
41
|
keycloakifyBuildDirPath?: string;
|
41
42
|
themeName?: string | string[];
|
43
|
+
kcContextExclusionsFtlCode?: string;
|
42
44
|
};
|
43
45
|
|
44
46
|
export type ResolvedViteConfig = {
|
@@ -302,6 +304,7 @@ export function readBuildOptions(params: {
|
|
302
304
|
|
303
305
|
return pathJoin(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
304
306
|
})(),
|
305
|
-
npmWorkspaceRootDirPath
|
307
|
+
npmWorkspaceRootDirPath,
|
308
|
+
kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode
|
306
309
|
};
|
307
310
|
}
|
package/vite-plugin/index.js
CHANGED
@@ -226,7 +226,8 @@ function readBuildOptions(params) {
|
|
226
226
|
}
|
227
227
|
return (0, path_1.join)(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
228
228
|
})(),
|
229
|
-
npmWorkspaceRootDirPath: npmWorkspaceRootDirPath
|
229
|
+
npmWorkspaceRootDirPath: npmWorkspaceRootDirPath,
|
230
|
+
kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode
|
230
231
|
};
|
231
232
|
}
|
232
233
|
exports.readBuildOptions = readBuildOptions;
|