keycloakify 10.0.0-rc.38 → 10.0.0-rc.39

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.
Files changed (81) hide show
  1. package/bin/193.index.js +13 -13
  2. package/bin/3.index.js +86 -86
  3. package/bin/322.index.js +595 -0
  4. package/bin/453.index.js +3 -3
  5. package/bin/526.index.js +42 -633
  6. package/bin/538.index.js +68 -57
  7. package/bin/932.index.js +7 -7
  8. package/bin/944.index.js +621 -0
  9. package/bin/961.index.js +5 -5
  10. package/bin/97.index.js +3 -3
  11. package/bin/{21.index.js → 98.index.js} +59 -48
  12. package/bin/main.js +8 -8
  13. package/lib/getKcClsx.js +12 -1
  14. package/lib/getKcClsx.js.map +1 -1
  15. package/login/Fallback.d.ts +1 -0
  16. package/login/Fallback.js.map +1 -1
  17. package/login/UserProfileFormFields.d.ts +1 -0
  18. package/login/UserProfileFormFields.js +1 -3
  19. package/login/UserProfileFormFields.js.map +1 -1
  20. package/login/i18n/i18n.js +1 -1
  21. package/login/pages/IdpReviewUserProfile.d.ts +1 -0
  22. package/login/pages/IdpReviewUserProfile.js +2 -2
  23. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  24. package/login/pages/LoginUpdateProfile.d.ts +1 -0
  25. package/login/pages/LoginUpdateProfile.js +2 -2
  26. package/login/pages/LoginUpdateProfile.js.map +1 -1
  27. package/login/pages/Register.d.ts +1 -0
  28. package/login/pages/Register.js +2 -2
  29. package/login/pages/Register.js.map +1 -1
  30. package/login/pages/UpdateEmail.d.ts +1 -0
  31. package/login/pages/UpdateEmail.js +2 -2
  32. package/login/pages/UpdateEmail.js.map +1 -1
  33. package/package.json +5 -8
  34. package/src/bin/add-story.ts +3 -3
  35. package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
  36. package/src/bin/download-keycloak-default-theme.ts +5 -5
  37. package/src/bin/eject-page.ts +3 -3
  38. package/src/bin/initialize-email-theme.ts +5 -5
  39. package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
  40. package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
  41. package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
  42. package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
  43. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
  44. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
  45. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +25 -25
  46. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
  47. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
  48. package/src/bin/keycloakify/keycloakify.ts +11 -11
  49. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
  50. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
  51. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
  52. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
  53. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
  54. package/src/bin/main.ts +2 -2
  55. package/src/bin/shared/{buildOptions.ts → buildContext.ts} +62 -51
  56. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
  57. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
  58. package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
  59. package/src/bin/shared/generateKcGenTs.ts +12 -12
  60. package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
  61. package/src/bin/start-keycloak/appBuild.ts +11 -11
  62. package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
  63. package/src/bin/start-keycloak/start-keycloak.ts +34 -22
  64. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
  65. package/src/bin/update-kc-gen.ts +3 -3
  66. package/src/lib/getKcClsx.ts +15 -1
  67. package/src/login/Fallback.tsx +1 -0
  68. package/src/login/UserProfileFormFields.tsx +2 -4
  69. package/src/login/i18n/i18n.tsx +1 -1
  70. package/src/login/pages/IdpReviewUserProfile.tsx +8 -2
  71. package/src/login/pages/LoginUpdateProfile.tsx +8 -2
  72. package/src/login/pages/Register.tsx +8 -2
  73. package/src/login/pages/UpdateEmail.tsx +8 -2
  74. package/src/vite-plugin/vite-plugin.ts +19 -19
  75. package/vite-plugin/index.js +91 -80
  76. package/vite-plugin/vite-plugin.d.ts +3 -3
  77. package/bin/795.index.js +0 -1198
  78. package/lib/isStorybook.d.ts +0 -1
  79. package/lib/isStorybook.js +0 -3
  80. package/lib/isStorybook.js.map +0 -1
  81. package/src/lib/isStorybook.ts +0 -3
package/bin/193.index.js CHANGED
@@ -38,16 +38,16 @@ var fs_rmSync = __webpack_require__(89693);
38
38
 
39
39
  (0,assert.assert)();
40
40
  async function copyKeycloakResourcesToPublic(params) {
41
- const { buildOptions } = params;
42
- const destDirPath = (0,external_path_.join)(buildOptions.publicDirPath, constants/* keycloak_resources */.N$);
41
+ const { buildContext } = params;
42
+ const destDirPath = (0,external_path_.join)(buildContext.publicDirPath, constants/* keycloak_resources */.N$);
43
43
  const keycloakifyBuildinfoFilePath = (0,external_path_.join)(destDirPath, "keycloakify.buildinfo");
44
44
  const keycloakifyBuildinfoRaw = JSON.stringify({
45
45
  destDirPath,
46
46
  keycloakifyVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
47
- buildOptions: {
47
+ buildContext: {
48
48
  loginThemeResourcesFromKeycloakVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
49
- cacheDirPath: (0,external_path_.relative)(destDirPath, buildOptions.cacheDirPath),
50
- npmWorkspaceRootDirPath: (0,external_path_.relative)(destDirPath, buildOptions.npmWorkspaceRootDirPath)
49
+ cacheDirPath: (0,external_path_.relative)(destDirPath, buildContext.cacheDirPath),
50
+ npmWorkspaceRootDirPath: (0,external_path_.relative)(destDirPath, buildContext.npmWorkspaceRootDirPath)
51
51
  }
52
52
  }, null, 2);
53
53
  skip_if_already_done: {
@@ -69,14 +69,14 @@ async function copyKeycloakResourcesToPublic(params) {
69
69
  keycloakVersion: (() => {
70
70
  switch (themeType) {
71
71
  case "login":
72
- return buildOptions.loginThemeResourcesFromKeycloakVersion;
72
+ return buildContext.loginThemeResourcesFromKeycloakVersion;
73
73
  case "account":
74
74
  return constants/* lastKeycloakVersionWithAccountV1 */.v$;
75
75
  }
76
76
  })(),
77
77
  themeType,
78
78
  themeDirPath: destDirPath,
79
- buildOptions
79
+ buildContext
80
80
  });
81
81
  }
82
82
  external_fs_.writeFileSync((0,external_path_.join)(destDirPath, "README.txt"), Buffer.from(
@@ -89,16 +89,16 @@ async function copyKeycloakResourcesToPublic(params) {
89
89
  external_fs_.writeFileSync(keycloakifyBuildinfoFilePath, Buffer.from(keycloakifyBuildinfoRaw, "utf8"));
90
90
  }
91
91
  //# sourceMappingURL=copyKeycloakResourcesToPublic.js.map
92
- // EXTERNAL MODULE: ./dist/bin/shared/buildOptions.js + 1 modules
93
- var shared_buildOptions = __webpack_require__(54659);
92
+ // EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
93
+ var shared_buildContext = __webpack_require__(87751);
94
94
  ;// CONCATENATED MODULE: ./dist/bin/copy-keycloak-resources-to-public.js
95
95
 
96
96
 
97
97
  async function command(params) {
98
98
  const { cliCommandOptions } = params;
99
- const buildOptions = (0,shared_buildOptions/* readBuildOptions */.d)({ cliCommandOptions });
99
+ const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
100
100
  await copyKeycloakResourcesToPublic({
101
- buildOptions
101
+ buildContext
102
102
  });
103
103
  }
104
104
  //# sourceMappingURL=copy-keycloak-resources-to-public.js.map
@@ -127,10 +127,10 @@ async function command(params) {
127
127
 
128
128
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.assert)();
129
129
  async function downloadKeycloakStaticResources(params) {
130
- const { themeType, themeDirPath, keycloakVersion, buildOptions } = params;
130
+ const { themeType, themeDirPath, keycloakVersion, buildContext } = params;
131
131
  const { defaultThemeDirPath } = await (0,_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__/* .downloadKeycloakDefaultTheme */ .x)({
132
132
  keycloakVersion,
133
- buildOptions
133
+ buildContext
134
134
  });
135
135
  const resourcesDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(themeDirPath, themeType, "resources");
136
136
  repatriate_base_resources: {
package/bin/3.index.js CHANGED
@@ -209,27 +209,27 @@ function replaceAll(string, searchValue, replaceValue) {
209
209
 
210
210
  (0,assert.assert)();
211
211
  function replaceImportsInJsCode_vite(params) {
212
- const { jsCode, buildOptions, basenameOfAssetsFiles, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
212
+ const { jsCode, buildContext, basenameOfAssetsFiles, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
213
213
  const { relative: pathRelative, sep: pathSep } = external_path_[systemType];
214
214
  let fixedJsCode = jsCode;
215
215
  replace_base_javacript_import: {
216
- if (buildOptions.urlPathname === undefined) {
216
+ if (buildContext.urlPathname === undefined) {
217
217
  break replace_base_javacript_import;
218
218
  }
219
219
  // Optimization
220
- if (!jsCode.includes(buildOptions.urlPathname)) {
220
+ if (!jsCode.includes(buildContext.urlPathname)) {
221
221
  break replace_base_javacript_import;
222
222
  }
223
223
  // Replace `Hv=function(e){return"/abcde12345/"+e}` by `Hv=function(e){return"/"+e}`
224
- fixedJsCode = fixedJsCode.replace(new RegExp(`([\\w\\$][\\w\\d\\$]*)=function\\(([\\w\\$][\\w\\d\\$]*)\\)\\{return"${replaceAll(buildOptions.urlPathname, "/", "\\/")}"\\+\\2\\}`, "g"), (...[, funcName, paramName]) => `${funcName}=function(${paramName}){return"/"+${paramName}}`);
224
+ fixedJsCode = fixedJsCode.replace(new RegExp(`([\\w\\$][\\w\\d\\$]*)=function\\(([\\w\\$][\\w\\d\\$]*)\\)\\{return"${replaceAll(buildContext.urlPathname, "/", "\\/")}"\\+\\2\\}`, "g"), (...[, funcName, paramName]) => `${funcName}=function(${paramName}){return"/"+${paramName}}`);
225
225
  }
226
226
  replace_javascript_relatives_import_paths: {
227
227
  // Example: "assets/ or "foo/bar/"
228
228
  const staticDir = (() => {
229
- let out = pathRelative(buildOptions.reactAppBuildDirPath, buildOptions.assetsDirPath);
229
+ let out = pathRelative(buildContext.projectBuildDirPath, buildContext.assetsDirPath);
230
230
  out = replaceAll(out, pathSep, "/") + "/";
231
231
  if (out === "/") {
232
- throw new Error(`The assetsDirPath must be a subdirectory of reactAppBuildDirPath`);
232
+ throw new Error(`The assetsDirPath must be a subdirectory of projectBuildDirPath`);
233
233
  }
234
234
  return out;
235
235
  })();
@@ -242,7 +242,7 @@ function replaceImportsInJsCode_vite(params) {
242
242
  .forEach(relativePathOfAssetFile => {
243
243
  var _a;
244
244
  fixedJsCode = replaceAll(fixedJsCode, `"${relativePathOfAssetFile}"`, `(window.${constants/* nameOfTheGlobal */.X4}.url.resourcesPath.substring(1) + "/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${relativePathOfAssetFile}")`);
245
- fixedJsCode = replaceAll(fixedJsCode, `"${(_a = buildOptions.urlPathname) !== null && _a !== void 0 ? _a : "/"}${relativePathOfAssetFile}"`, `(window.${constants/* nameOfTheGlobal */.X4}.url.resourcesPath + "/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${relativePathOfAssetFile}")`);
245
+ fixedJsCode = replaceAll(fixedJsCode, `"${(_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/"}${relativePathOfAssetFile}"`, `(window.${constants/* nameOfTheGlobal */.X4}.url.resourcesPath + "/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${relativePathOfAssetFile}")`);
246
246
  });
247
247
  }
248
248
  return { fixedJsCode };
@@ -255,19 +255,19 @@ function replaceImportsInJsCode_vite(params) {
255
255
 
256
256
  (0,assert.assert)();
257
257
  function replaceImportsInJsCode_webpack(params) {
258
- const { jsCode, buildOptions, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
258
+ const { jsCode, buildContext, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
259
259
  const { relative: pathRelative, sep: pathSep } = external_path_[systemType];
260
260
  let fixedJsCode = jsCode;
261
- if (buildOptions.urlPathname !== undefined) {
261
+ if (buildContext.urlPathname !== undefined) {
262
262
  // "__esModule",{value:!0})},n.p="/foo-bar/",function(){if("undefined" -> ... n.p="/" ...
263
- fixedJsCode = fixedJsCode.replace(new RegExp(`,([a-zA-Z]\\.[a-zA-Z])="${replaceAll(buildOptions.urlPathname, "/", "\\/")}",`, "g"), (...[, assignTo]) => `,${assignTo}="/",`);
263
+ fixedJsCode = fixedJsCode.replace(new RegExp(`,([a-zA-Z]\\.[a-zA-Z])="${replaceAll(buildContext.urlPathname, "/", "\\/")}",`, "g"), (...[, assignTo]) => `,${assignTo}="/",`);
264
264
  }
265
265
  // Example: "static/ or "foo/bar/"
266
266
  const staticDir = (() => {
267
- let out = pathRelative(buildOptions.reactAppBuildDirPath, buildOptions.assetsDirPath);
267
+ let out = pathRelative(buildContext.projectBuildDirPath, buildContext.assetsDirPath);
268
268
  out = replaceAll(out, pathSep, "/") + "/";
269
269
  if (out === "/") {
270
- throw new Error(`The assetsDirPath must be a subdirectory of reactAppBuildDirPath`);
270
+ throw new Error(`The assetsDirPath must be a subdirectory of projectBuildDirPath`);
271
271
  }
272
272
  return out;
273
273
  })();
@@ -307,21 +307,21 @@ function replaceImportsInJsCode_webpack(params) {
307
307
 
308
308
  (0,assert.assert)();
309
309
  function replaceImportsInJsCode(params) {
310
- const { jsCode, buildOptions } = params;
310
+ const { jsCode, buildContext } = params;
311
311
  const { fixedJsCode } = (() => {
312
- switch (buildOptions.bundler) {
312
+ switch (buildContext.bundler) {
313
313
  case "vite":
314
314
  return replaceImportsInJsCode_vite({
315
315
  jsCode,
316
- buildOptions,
316
+ buildContext,
317
317
  basenameOfAssetsFiles: readAssetsDirSync({
318
- assetsDirPath: params.buildOptions.assetsDirPath
318
+ assetsDirPath: params.buildContext.assetsDirPath
319
319
  })
320
320
  });
321
321
  case "webpack":
322
322
  return replaceImportsInJsCode_webpack({
323
323
  jsCode,
324
- buildOptions
324
+ buildContext
325
325
  });
326
326
  }
327
327
  })();
@@ -372,7 +372,7 @@ function replaceImportsInCssCode(params) {
372
372
  return { fixedCssCode, cssGlobalsToDefine };
373
373
  }
374
374
  function generateCssCodeToDefineGlobals(params) {
375
- const { cssGlobalsToDefine, buildOptions } = params;
375
+ const { cssGlobalsToDefine, buildContext } = params;
376
376
  return {
377
377
  cssCodeToPrependInHead: [
378
378
  ":root {",
@@ -381,7 +381,7 @@ function generateCssCodeToDefineGlobals(params) {
381
381
  var _a;
382
382
  return [
383
383
  `--${cssVariableName}:`,
384
- cssGlobalsToDefine[cssVariableName].replace(new RegExp(`url\\(${((_a = buildOptions.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`, "g"), `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`)
384
+ cssGlobalsToDefine[cssVariableName].replace(new RegExp(`url\\(${((_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`, "g"), `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`)
385
385
  ].join(" ");
386
386
  })
387
387
  .map(line => ` ${line};`),
@@ -397,10 +397,10 @@ var esm = __webpack_require__(87182);
397
397
 
398
398
  (0,assert.assert)();
399
399
  function replaceImportsInInlineCssCode(params) {
400
- const { cssCode, buildOptions } = params;
401
- const fixedCssCode = cssCode.replace(buildOptions.urlPathname === undefined
400
+ const { cssCode, buildContext } = params;
401
+ const fixedCssCode = cssCode.replace(buildContext.urlPathname === undefined
402
402
  ? /url\(["']?\/([^/][^)"']+)["']?\)/g
403
- : new RegExp(`url\\(["']?${buildOptions.urlPathname}([^)"']+)["']?\\)`, "g"), (...[, group]) => `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${group})`);
403
+ : new RegExp(`url\\(["']?${buildContext.urlPathname}([^)"']+)["']?\\)`, "g"), (...[, group]) => `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${group})`);
404
404
  return { fixedCssCode };
405
405
  }
406
406
  //# sourceMappingURL=replaceImportsInInlineCssCode.js.map
@@ -419,7 +419,7 @@ var getThisCodebaseRootDirPath = __webpack_require__(58822);
419
419
  (0,assert.assert)();
420
420
  function generateFtlFilesCodeFactory(params) {
421
421
  var _a;
422
- const { themeName, cssGlobalsToDefine, indexHtmlCode, buildOptions, keycloakifyVersion, themeType, fieldNames } = params;
422
+ const { themeName, cssGlobalsToDefine, indexHtmlCode, buildContext, keycloakifyVersion, themeType, fieldNames } = params;
423
423
  const $ = esm/* default.load */.ZP.load(indexHtmlCode);
424
424
  fix_imports_statements: {
425
425
  $("script:not([src])").each((...[, element]) => {
@@ -427,7 +427,7 @@ function generateFtlFilesCodeFactory(params) {
427
427
  (0,assert.assert)(jsCode !== null);
428
428
  const { fixedJsCode } = replaceImportsInJsCode({
429
429
  jsCode,
430
- buildOptions
430
+ buildContext
431
431
  });
432
432
  $(element).text(fixedJsCode);
433
433
  });
@@ -436,7 +436,7 @@ function generateFtlFilesCodeFactory(params) {
436
436
  (0,assert.assert)(cssCode !== null);
437
437
  const { fixedCssCode } = replaceImportsInInlineCssCode({
438
438
  cssCode,
439
- buildOptions
439
+ buildContext
440
440
  });
441
441
  $(element).text(fixedCssCode);
442
442
  });
@@ -449,7 +449,7 @@ function generateFtlFilesCodeFactory(params) {
449
449
  if (href === undefined) {
450
450
  return;
451
451
  }
452
- $(element).attr(attrName, href.replace(new RegExp(`^${((_a = buildOptions.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`), `\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`));
452
+ $(element).attr(attrName, href.replace(new RegExp(`^${((_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`), `\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`));
453
453
  }));
454
454
  if (Object.keys(cssGlobalsToDefine).length !== 0) {
455
455
  $("head").prepend([
@@ -457,7 +457,7 @@ function generateFtlFilesCodeFactory(params) {
457
457
  "<style>",
458
458
  generateCssCodeToDefineGlobals({
459
459
  cssGlobalsToDefine,
460
- buildOptions
460
+ buildContext
461
461
  }).cssCodeToPrependInHead,
462
462
  "</style>",
463
463
  ""
@@ -470,12 +470,12 @@ function generateFtlFilesCodeFactory(params) {
470
470
  .match(/^<script>const _=((?:.|\n)+)<\/script>[\n]?$/)[1]
471
471
  .replace("FIELD_NAMES_eKsIY4ZsZ4xeM", fieldNames.map(name => `"${name}"`).join(", "))
472
472
  .replace("KEYCLOAKIFY_VERSION_xEdKd3xEdr", keycloakifyVersion)
473
- .replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx", buildOptions.themeVersion)
473
+ .replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx", buildContext.themeVersion)
474
474
  .replace("KEYCLOAKIFY_THEME_TYPE_dExKd3xEdr", themeType)
475
475
  .replace("KEYCLOAKIFY_THEME_NAME_cXxKd3xEer", themeName)
476
476
  .replace("RESOURCES_COMMON_cLsLsMrtDkpVv", constants/* resources_common */.z0)
477
477
  .replace("lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX", constants/* nameOfTheLocalizationRealmOverridesUserProfileProperty */.lg)
478
- .replace("USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2", (_a = buildOptions.kcContextExclusionsFtlCode) !== null && _a !== void 0 ? _a : "");
478
+ .replace("USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2", (_a = buildContext.kcContextExclusionsFtlCode) !== null && _a !== void 0 ? _a : "");
479
479
  const ftlObjectToJsCodeDeclaringAnObjectPlaceholder = '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
480
480
  $("head").prepend(`<script>\nwindow.${constants/* nameOfTheGlobal */.X4}=${ftlObjectToJsCodeDeclaringAnObjectPlaceholder}</script>`);
481
481
  // Remove part of the document marked as ignored.
@@ -633,12 +633,12 @@ var downloadKeycloakDefaultTheme = __webpack_require__(61804);
633
633
 
634
634
  (0,assert.assert)();
635
635
  async function bringInAccountV1(params) {
636
- const { buildOptions } = params;
636
+ const { buildContext } = params;
637
637
  const { defaultThemeDirPath } = await (0,downloadKeycloakDefaultTheme/* downloadKeycloakDefaultTheme */.x)({
638
638
  keycloakVersion: constants/* lastKeycloakVersionWithAccountV1 */.v$,
639
- buildOptions
639
+ buildContext
640
640
  });
641
- const accountV1DirPath = (0,external_path_.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", constants/* accountV1ThemeName */.y_, "account");
641
+ const accountV1DirPath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", constants/* accountV1ThemeName */.y_, "account");
642
642
  (0,transformCodebase/* transformCodebase */.N)({
643
643
  srcDirPath: (0,external_path_.join)(defaultThemeDirPath, "base", "account"),
644
644
  destDirPath: accountV1DirPath
@@ -716,13 +716,13 @@ var escapeStringForPropertiesFile = __webpack_require__(27190);
716
716
  (0,assert.assert)();
717
717
  async function generateSrcMainResourcesForMainTheme(params) {
718
718
  var _a;
719
- const { themeName, buildOptions } = params;
719
+ const { themeName, buildContext } = params;
720
720
  const { themeSrcDirPath } = (0,getThemeSrcDirPath/* getThemeSrcDirPath */.f)({
721
- reactAppRootDirPath: buildOptions.reactAppRootDirPath
721
+ projectDirPath: buildContext.projectDirPath
722
722
  });
723
723
  const getThemeTypeDirPath = (params) => {
724
724
  const { themeType } = params;
725
- return (0,external_path_.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName, themeType);
725
+ return (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName, themeType);
726
726
  };
727
727
  const cssGlobalsToDefine = {};
728
728
  const implementedThemeTypes = {
@@ -751,13 +751,13 @@ async function generateSrcMainResourcesForMainTheme(params) {
751
751
  break apply_replacers_and_move_to_theme_resources;
752
752
  }
753
753
  (0,transformCodebase/* transformCodebase */.N)({
754
- srcDirPath: buildOptions.reactAppBuildDirPath,
754
+ srcDirPath: buildContext.projectBuildDirPath,
755
755
  destDirPath,
756
756
  transformSourceCode: ({ filePath, sourceCode }) => {
757
757
  //NOTE: Prevent cycles, excludes the folder we generated for debug in public/
758
758
  // This should not happen if users follow the new instruction setup but we keep it for retrocompatibility.
759
759
  if ((0,isInside/* isInside */.V)({
760
- dirPath: (0,external_path_.join)(buildOptions.reactAppBuildDirPath, constants/* keycloak_resources */.N$),
760
+ dirPath: (0,external_path_.join)(buildContext.projectBuildDirPath, constants/* keycloak_resources */.N$),
761
761
  filePath
762
762
  })) {
763
763
  return undefined;
@@ -776,7 +776,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
776
776
  if (/\.js?$/i.test(filePath)) {
777
777
  const { fixedJsCode } = replaceImportsInJsCode({
778
778
  jsCode: sourceCode.toString("utf8"),
779
- buildOptions
779
+ buildContext
780
780
  });
781
781
  return {
782
782
  modifiedSourceCode: Buffer.from(fixedJsCode, "utf8")
@@ -788,10 +788,10 @@ async function generateSrcMainResourcesForMainTheme(params) {
788
788
  }
789
789
  const { generateFtlFilesCode } = generateFtlFilesCodeFactory({
790
790
  themeName,
791
- indexHtmlCode: external_fs_.readFileSync((0,external_path_.join)(buildOptions.reactAppBuildDirPath, "index.html"))
791
+ indexHtmlCode: external_fs_.readFileSync((0,external_path_.join)(buildContext.projectBuildDirPath, "index.html"))
792
792
  .toString("utf8"),
793
793
  cssGlobalsToDefine,
794
- buildOptions,
794
+ buildContext,
795
795
  keycloakifyVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
796
796
  themeType,
797
797
  fieldNames: readFieldNameUsage({
@@ -834,12 +834,12 @@ async function generateSrcMainResourcesForMainTheme(params) {
834
834
  case "account":
835
835
  return constants/* lastKeycloakVersionWithAccountV1 */.v$;
836
836
  case "login":
837
- return buildOptions.loginThemeResourcesFromKeycloakVersion;
837
+ return buildContext.loginThemeResourcesFromKeycloakVersion;
838
838
  }
839
839
  })(),
840
840
  themeDirPath: (0,external_path_.resolve)((0,external_path_.join)(themeTypeDirPath, "..")),
841
841
  themeType,
842
- buildOptions
842
+ buildContext
843
843
  });
844
844
  external_fs_.writeFileSync((0,external_path_.join)(themeTypeDirPath, "theme.properties"), Buffer.from([
845
845
  `parent=${(() => {
@@ -851,8 +851,8 @@ async function generateSrcMainResourcesForMainTheme(params) {
851
851
  }
852
852
  (0,assert.assert)(false);
853
853
  })()}`,
854
- ...((_a = buildOptions.extraThemeProperties) !== null && _a !== void 0 ? _a : []),
855
- buildOptions.environmentVariables.map(({ name, default: defaultValue }) => `${name}=\${env.${name}:${(0,escapeStringForPropertiesFile/* escapeStringForPropertiesFile */.y)(defaultValue)}}`)
854
+ ...((_a = buildContext.extraThemeProperties) !== null && _a !== void 0 ? _a : []),
855
+ buildContext.environmentVariables.map(({ name, default: defaultValue }) => `${name}=\${env.${name}:${(0,escapeStringForPropertiesFile/* escapeStringForPropertiesFile */.y)(defaultValue)}}`)
856
856
  ].join("\n\n"), "utf8"));
857
857
  }
858
858
  email: {
@@ -868,7 +868,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
868
868
  }
869
869
  if (implementedThemeTypes.account) {
870
870
  await bringInAccountV1({
871
- buildOptions
871
+ buildContext
872
872
  });
873
873
  }
874
874
  {
@@ -886,7 +886,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
886
886
  });
887
887
  }
888
888
  (0,shared_metaInfKeycloakThemes/* writeMetaInfKeycloakThemes */.JJ)({
889
- keycloakifyBuildDirPath: buildOptions.keycloakifyBuildDirPath,
889
+ keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
890
890
  metaInfKeycloakThemes
891
891
  });
892
892
  }
@@ -899,8 +899,8 @@ async function generateSrcMainResourcesForMainTheme(params) {
899
899
 
900
900
  (0,assert.assert)();
901
901
  function generateSrcMainResourcesForThemeVariant(params) {
902
- const { themeName, themeVariantName, buildOptions } = params;
903
- const mainThemeDirPath = (0,external_path_.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName);
902
+ const { themeName, themeVariantName, buildContext } = params;
903
+ const mainThemeDirPath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName);
904
904
  (0,transformCodebase/* transformCodebase */.N)({
905
905
  srcDirPath: mainThemeDirPath,
906
906
  destDirPath: (0,external_path_.join)(mainThemeDirPath, "..", themeVariantName),
@@ -918,7 +918,7 @@ function generateSrcMainResourcesForThemeVariant(params) {
918
918
  });
919
919
  {
920
920
  const updatedMetaInfKeycloakThemes = (0,shared_metaInfKeycloakThemes/* readMetaInfKeycloakThemes */.As)({
921
- keycloakifyBuildDirPath: buildOptions.keycloakifyBuildDirPath
921
+ keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
922
922
  });
923
923
  updatedMetaInfKeycloakThemes.themes.push({
924
924
  name: themeVariantName,
@@ -929,7 +929,7 @@ function generateSrcMainResourcesForThemeVariant(params) {
929
929
  })()
930
930
  });
931
931
  (0,shared_metaInfKeycloakThemes/* writeMetaInfKeycloakThemes */.JJ)({
932
- keycloakifyBuildDirPath: buildOptions.keycloakifyBuildDirPath,
932
+ keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
933
933
  metaInfKeycloakThemes: updatedMetaInfKeycloakThemes
934
934
  });
935
935
  }
@@ -941,17 +941,17 @@ function generateSrcMainResourcesForThemeVariant(params) {
941
941
 
942
942
  (0,assert.assert)();
943
943
  async function generateSrcMainResources(params) {
944
- const { buildOptions } = params;
945
- const [themeName, ...themeVariantNames] = buildOptions.themeNames;
944
+ const { buildContext } = params;
945
+ const [themeName, ...themeVariantNames] = buildContext.themeNames;
946
946
  await generateSrcMainResourcesForMainTheme({
947
947
  themeName,
948
- buildOptions
948
+ buildContext
949
949
  });
950
950
  for (const themeVariantName of themeVariantNames) {
951
951
  generateSrcMainResourcesForThemeVariant({
952
952
  themeName,
953
953
  themeVariantName,
954
- buildOptions
954
+ buildContext
955
955
  });
956
956
  }
957
957
  }
@@ -962,8 +962,8 @@ async function generateSrcMainResources(params) {
962
962
  // EXTERNAL MODULE: external "child_process"
963
963
  var external_child_process_ = __webpack_require__(32081);
964
964
  var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
965
- // EXTERNAL MODULE: ./dist/bin/shared/buildOptions.js + 1 modules
966
- var shared_buildOptions = __webpack_require__(54659);
965
+ // EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
966
+ var shared_buildContext = __webpack_require__(87751);
967
967
  // EXTERNAL MODULE: ./node_modules/tsafe/exclude.js
968
968
  var exclude = __webpack_require__(41370);
969
969
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/extensionVersions.js
@@ -1031,7 +1031,7 @@ var promises_ = __webpack_require__(73292);
1031
1031
 
1032
1032
  (0,assert.assert)();
1033
1033
  function generatePom(params) {
1034
- const { keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildOptions } = params;
1034
+ const { keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildContext } = params;
1035
1035
  const { pomFileCode } = (function generatePomFileCode() {
1036
1036
  const pomFileCode = [
1037
1037
  `<?xml version="1.0"?>`,
@@ -1039,10 +1039,10 @@ function generatePom(params) {
1039
1039
  ` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`,
1040
1040
  ` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">`,
1041
1041
  ` <modelVersion>4.0.0</modelVersion>`,
1042
- ` <groupId>${buildOptions.groupId}</groupId>`,
1043
- ` <artifactId>${buildOptions.artifactId}</artifactId>`,
1044
- ` <version>${buildOptions.themeVersion}</version>`,
1045
- ` <name>${buildOptions.artifactId}</name>`,
1042
+ ` <groupId>${buildContext.groupId}</groupId>`,
1043
+ ` <artifactId>${buildContext.artifactId}</artifactId>`,
1044
+ ` <version>${buildContext.themeVersion}</version>`,
1045
+ ` <name>${buildContext.artifactId}</name>`,
1046
1046
  ` <description />`,
1047
1047
  ` <packaging>jar</packaging>`,
1048
1048
  ` <properties>`,
@@ -1111,8 +1111,8 @@ function generatePom(params) {
1111
1111
 
1112
1112
  (0,assert.assert)();
1113
1113
  async function buildJar(params) {
1114
- const { jarFileBasename, keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildOptions } = params;
1115
- const keycloakifyBuildTmpDirPath = (0,external_path_.join)(buildOptions.cacheDirPath, jarFileBasename.replace(".jar", ""));
1114
+ const { jarFileBasename, keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildContext } = params;
1115
+ const keycloakifyBuildTmpDirPath = (0,external_path_.join)(buildContext.cacheDirPath, jarFileBasename.replace(".jar", ""));
1116
1116
  (0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true, force: true });
1117
1117
  {
1118
1118
  const transformCodebase_common = (params) => {
@@ -1121,7 +1121,7 @@ async function buildJar(params) {
1121
1121
  (0,shared_metaInfKeycloakThemes/* getMetaInfKeycloakThemesJsonFilePath */.KQ)({ keycloakifyBuildDirPath: "." })) {
1122
1122
  return { modifiedSourceCode: sourceCode };
1123
1123
  }
1124
- for (const themeName of [...buildOptions.themeNames, constants/* accountV1ThemeName */.y_]) {
1124
+ for (const themeName of [...buildContext.themeNames, constants/* accountV1ThemeName */.y_]) {
1125
1125
  if ((0,isInside/* isInside */.V)({
1126
1126
  dirPath: (0,external_path_.join)("src", "main", "resources", "theme", themeName),
1127
1127
  filePath: fileRelativePath
@@ -1152,7 +1152,7 @@ async function buildJar(params) {
1152
1152
  modifiedSourceCode: Buffer.from(JSON.stringify(keycloakThemesJsonParsed, null, 2), "utf8")
1153
1153
  };
1154
1154
  }
1155
- for (const themeName of buildOptions.themeNames) {
1155
+ for (const themeName of buildContext.themeNames) {
1156
1156
  if (fileRelativePath ===
1157
1157
  (0,external_path_.join)("src", "main", "resources", "theme", themeName, "account", "theme.properties")) {
1158
1158
  const modifiedSourceCode = Buffer.from(sourceCode
@@ -1165,7 +1165,7 @@ async function buildJar(params) {
1165
1165
  return { modifiedSourceCode: sourceCode };
1166
1166
  };
1167
1167
  (0,transformCodebase/* transformCodebase */.N)({
1168
- srcDirPath: buildOptions.keycloakifyBuildDirPath,
1168
+ srcDirPath: buildContext.keycloakifyBuildDirPath,
1169
1169
  destDirPath: keycloakifyBuildTmpDirPath,
1170
1170
  transformSourceCode: params => {
1171
1171
  const resultCommon = transformCodebase_common(params);
@@ -1197,7 +1197,7 @@ async function buildJar(params) {
1197
1197
  if (doBreak) {
1198
1198
  break route_legacy_pages;
1199
1199
  }
1200
- ["register.ftl", "login-update-profile.ftl"].forEach(pageId => buildOptions.themeNames.map(themeName => {
1200
+ ["register.ftl", "login-update-profile.ftl"].forEach(pageId => buildContext.themeNames.map(themeName => {
1201
1201
  const ftlFilePath = (0,external_path_.join)(keycloakifyBuildTmpDirPath, "src", "main", "resources", "theme", themeName, "login", pageId);
1202
1202
  const ftlFileContent = (0,external_fs_.readFileSync)(ftlFilePath).toString("utf8");
1203
1203
  const realPageId = (() => {
@@ -1216,7 +1216,7 @@ async function buildJar(params) {
1216
1216
  }
1217
1217
  {
1218
1218
  const { pomFileCode } = generatePom({
1219
- buildOptions,
1219
+ buildContext,
1220
1220
  keycloakAccountV1Version,
1221
1221
  keycloakThemeAdditionalInfoExtensionVersion
1222
1222
  });
@@ -1234,7 +1234,7 @@ async function buildJar(params) {
1234
1234
  }
1235
1235
  resolve();
1236
1236
  }));
1237
- await promises_.rename((0,external_path_.join)(keycloakifyBuildTmpDirPath, "target", `${buildOptions.artifactId}-${buildOptions.themeVersion}.jar`), (0,external_path_.join)(buildOptions.keycloakifyBuildDirPath, jarFileBasename));
1237
+ await promises_.rename((0,external_path_.join)(keycloakifyBuildTmpDirPath, "target", `${buildContext.artifactId}-${buildContext.themeVersion}.jar`), (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, jarFileBasename));
1238
1238
  (0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true });
1239
1239
  }
1240
1240
  //# sourceMappingURL=buildJar.js.map
@@ -1251,9 +1251,9 @@ var getJarFileBasename = __webpack_require__(2323);
1251
1251
 
1252
1252
  (0,assert.assert)();
1253
1253
  async function buildJars(params) {
1254
- const { buildOptions } = params;
1254
+ const { buildContext } = params;
1255
1255
  const doesImplementAccountTheme = (0,shared_metaInfKeycloakThemes/* readMetaInfKeycloakThemes */.As)({
1256
- keycloakifyBuildDirPath: buildOptions.keycloakifyBuildDirPath
1256
+ keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
1257
1257
  }).themes.some(({ name }) => name === constants/* accountV1ThemeName */.y_);
1258
1258
  await Promise.all(keycloakAccountV1Versions.map(keycloakAccountV1Version => keycloakThemeAdditionalInfoExtensionVersions.map(keycloakThemeAdditionalInfoExtensionVersion => {
1259
1259
  const keycloakVersionRange = getKeycloakVersionRangeForJar({
@@ -1283,7 +1283,7 @@ async function buildJars(params) {
1283
1283
  jarFileBasename,
1284
1284
  keycloakAccountV1Version,
1285
1285
  keycloakThemeAdditionalInfoExtensionVersion,
1286
- buildOptions
1286
+ buildContext
1287
1287
  })))
1288
1288
  .flat());
1289
1289
  }
@@ -1334,35 +1334,35 @@ async function command(params) {
1334
1334
  process.exit(1);
1335
1335
  }
1336
1336
  const { cliCommandOptions } = params;
1337
- const buildOptions = (0,shared_buildOptions/* readBuildOptions */.d)({ cliCommandOptions });
1337
+ const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
1338
1338
  console.log([
1339
1339
  source_default().cyan(`keycloakify v${(0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)()}`),
1340
- source_default().green(`Building the keycloak theme in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), buildOptions.keycloakifyBuildDirPath)} ...`)
1340
+ source_default().green(`Building the keycloak theme in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), buildContext.keycloakifyBuildDirPath)} ...`)
1341
1341
  ].join(" "));
1342
1342
  const startTime = Date.now();
1343
1343
  {
1344
- if (!external_fs_.existsSync(buildOptions.keycloakifyBuildDirPath)) {
1345
- external_fs_.mkdirSync(buildOptions.keycloakifyBuildDirPath, {
1344
+ if (!external_fs_.existsSync(buildContext.keycloakifyBuildDirPath)) {
1345
+ external_fs_.mkdirSync(buildContext.keycloakifyBuildDirPath, {
1346
1346
  recursive: true
1347
1347
  });
1348
1348
  }
1349
- external_fs_.writeFileSync((0,external_path_.join)(buildOptions.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
1349
+ external_fs_.writeFileSync((0,external_path_.join)(buildContext.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
1350
1350
  }
1351
- await generateSrcMainResources({ buildOptions });
1351
+ await generateSrcMainResources({ buildContext });
1352
1352
  run_post_build_script: {
1353
- if (buildOptions.bundler !== "vite") {
1353
+ if (buildContext.bundler !== "vite") {
1354
1354
  break run_post_build_script;
1355
1355
  }
1356
1356
  external_child_process_.execSync("npx vite", {
1357
- cwd: buildOptions.reactAppRootDirPath,
1358
- env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify(buildOptions) })
1357
+ cwd: buildContext.projectDirPath,
1358
+ env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify(buildContext) })
1359
1359
  });
1360
1360
  }
1361
1361
  build_jars: {
1362
1362
  if (process.env[constants/* skipBuildJarsEnvName */.uo]) {
1363
1363
  break build_jars;
1364
1364
  }
1365
- await buildJars({ buildOptions });
1365
+ await buildJars({ buildContext });
1366
1366
  }
1367
1367
  console.log(source_default().green(`✓ built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`));
1368
1368
  }
@@ -1395,10 +1395,10 @@ async function command(params) {
1395
1395
 
1396
1396
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.assert)();
1397
1397
  async function downloadKeycloakStaticResources(params) {
1398
- const { themeType, themeDirPath, keycloakVersion, buildOptions } = params;
1398
+ const { themeType, themeDirPath, keycloakVersion, buildContext } = params;
1399
1399
  const { defaultThemeDirPath } = await (0,_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__/* .downloadKeycloakDefaultTheme */ .x)({
1400
1400
  keycloakVersion,
1401
- buildOptions
1401
+ buildContext
1402
1402
  });
1403
1403
  const resourcesDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(themeDirPath, themeType, "resources");
1404
1404
  repatriate_base_resources: {
@@ -1461,8 +1461,8 @@ function getJarFileBasename(params) {
1461
1461
  const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
1462
1462
  /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
1463
1463
  function getThemeSrcDirPath(params) {
1464
- const { reactAppRootDirPath } = params;
1465
- const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(reactAppRootDirPath, "src");
1464
+ const { projectDirPath } = params;
1465
+ const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
1466
1466
  const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
1467
1467
  dirPath: srcDirPath,
1468
1468
  returnedPathsType: "relative to dirPath"