keycloakify 10.0.0-rc.30 → 10.0.0-rc.32

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.
@@ -18,5 +18,7 @@ export declare function createGetKcContextMock<KcContextExtraProperties extends
18
18
  overrides?: DeepPartial<Extract<ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>, {
19
19
  pageId: PageId;
20
20
  }>> | undefined;
21
- }) => ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>;
21
+ }) => Extract<ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>, {
22
+ pageId: PageId;
23
+ }>;
22
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getKcContextMock.js","sourceRoot":"","sources":["../../src/account/KcContext/getKcContextMock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,sBAAsB,CAMpC,MAiBD;IACG,MAAM,EACF,wBAAwB,EACxB,+BAA+B,EAC/B,SAAS,EAAE,gBAAgB,EAC3B,gBAAgB,EAAE,uBAAuB,EAC5C,GAAG,MAAM,CAAC;IAOX,SAAS,gBAAgB,CAEvB,MAKD;;QACG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAErC,MAAM,aAAa,GAAG,2BAA2B,CAC7C,MAAA,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,mEAC9D,mBAAmB,KACtB,MAAM,GACT,CACJ,CAAC;QAEF;YACI,wBAAwB;YACxB,+BAA+B,CAAC,MAAM,CAAC;YACv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AC;YACjC,SAAS;SACZ;aACI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aAC1B,OAAO,CAAC,SAAS,CAAC,EAAE,CACjB,UAAU,CAAC;YACP,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,SAAS;SACpB,CAAC,CACL,CAAC;QAEN,mBAAmB;QACnB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAChC,CAAC"}
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;
@@ -18,5 +18,7 @@ export declare function createGetKcContextMock<KcContextExtraProperties extends
18
18
  overrides?: DeepPartial<Extract<ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>, {
19
19
  pageId: PageId;
20
20
  }>> | undefined;
21
- }) => ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>;
21
+ }) => Extract<ExtendKcContext<KcContextExtraProperties, KcContextExtraPropertiesPerPage>, {
22
+ pageId: PageId;
23
+ }>;
22
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getKcContextMock.js","sourceRoot":"","sources":["../../src/login/KcContext/getKcContextMock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,sBAAsB,CAMpC,MAiBD;IACG,MAAM,EACF,wBAAwB,EACx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5C,GAAG,MAAM,CAAC;IAOX,SAAS,gBAAgB,CAEvB,MAGD;;QACG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAErC,MAAM,aAAa,GAAG,2BAA2B,CAC7C,MAAA,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,mEAC9D,mBAAmB,KACtB,MAAM,GACT,CACJ,CAAC;QAEF;YACI,wBAAwB;YACxB,+BAA+B,CAAC,MAAM,CAAC;YACvC,gBAAgB;YAChB,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,MAAM,CAAC;YACjC,SAAS;SACZ;aACI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aAC1B,OAAO,CAAC,SAAS,CAAC,EAAE,CACjB,UAAU,CAAC;YACP,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,SAAS;SACpB,CAAC,CACL,CAAC;QAEN,mBAAmB;QACnB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "10.0.0-rc.30",
3
+ "version": "10.0.0-rc.32",
4
4
  "description": "Create Keycloak themes using React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,9 +47,7 @@ export function createGetKcContextMock<
47
47
  >(params: {
48
48
  pageId: PageId;
49
49
  overrides?: DeepPartial<Extract<KcContext, { pageId: PageId }>>;
50
- // NOTE: We choose to have a return type less precise than Extract<KcContext, { pageId: PageId }> {
51
- // because we want to be able to use the mock just as the real KcContext.
52
- }): KcContext {
50
+ }): Extract<KcContext, { pageId: PageId }> {
53
51
  const { pageId, overrides } = params;
54
52
 
55
53
  const kcContextMock = structuredCloneButFunctions(
@@ -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;
@@ -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 { generateFtlFilesCodeFactory } from "../generateFtl";
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 { downloadKeycloakStaticResources } from "../../shared/downloadKeycloakStaticResources";
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 { bringInAccountV1 } from "./bringInAccountV1";
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
- bundler: "vite" | "webpack";
35
- extraThemeProperties: string[] | undefined;
36
- themeVersion: string;
37
- loginThemeResourcesFromKeycloakVersion: string;
38
- reactAppBuildDirPath: string;
39
- cacheDirPath: string;
40
- assetsDirPath: string;
41
- urlPathname: string | undefined;
42
- npmWorkspaceRootDirPath: string;
43
- reactAppRootDirPath: string;
44
- keycloakifyBuildDirPath: string;
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
  }
@@ -47,9 +47,7 @@ export function createGetKcContextMock<
47
47
  >(params: {
48
48
  pageId: PageId;
49
49
  overrides?: DeepPartial<Extract<KcContext, { pageId: PageId }>>;
50
- // NOTE: We choose to have a return type less precise than Extract<KcContext, { pageId: PageId }> {
51
- // because we want to be able to use the mock just as the real KcContext.
52
- }): KcContext {
50
+ }): Extract<KcContext, { pageId: PageId }> {
53
51
  const { pageId, overrides } = params;
54
52
 
55
53
  const kcContextMock = structuredCloneButFunctions(
@@ -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;