keycloakify 10.0.0-rc.118 → 10.0.0-rc.119

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 (48) hide show
  1. package/bin/{490.index.js → 246.index.js} +20 -2
  2. package/bin/31.index.js +151 -159
  3. package/bin/440.index.js +27 -22
  4. package/bin/526.index.js +168 -56
  5. package/bin/599.index.js +560 -0
  6. package/bin/622.index.js +4 -2
  7. package/bin/{36.index.js → 678.index.js} +577 -71
  8. package/bin/{180.index.js → 697.index.js} +611 -526
  9. package/bin/743.index.js +70 -0
  10. package/bin/780.index.js +729 -0
  11. package/bin/932.index.js +725 -48
  12. package/bin/{966.index.js → 941.index.js} +2 -19
  13. package/bin/main.js +19 -7
  14. package/bin/shared/buildContext.d.ts +28 -19
  15. package/bin/shared/buildContext.js.map +1 -1
  16. package/bin/shared/getLatestsSemVersionedTag.d.ts +10 -0
  17. package/bin/shared/getLatestsSemVersionedTag.js.map +1 -0
  18. package/bin/shared/promptKeycloakVersion.js.map +1 -1
  19. package/package.json +24 -5
  20. package/src/bin/initialize-account-theme/copyBoilerplate.ts +32 -0
  21. package/src/bin/initialize-account-theme/index.ts +1 -0
  22. package/src/bin/initialize-account-theme/initialize-account-theme.ts +95 -0
  23. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +21 -0
  24. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +150 -0
  25. package/src/bin/initialize-account-theme/src/multi-page/KcContext.ts +12 -0
  26. package/src/bin/initialize-account-theme/src/multi-page/KcPage.tsx +25 -0
  27. package/src/bin/initialize-account-theme/src/multi-page/KcPageStory.tsx +38 -0
  28. package/src/bin/initialize-account-theme/src/multi-page/i18n.ts +5 -0
  29. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +7 -0
  30. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +11 -0
  31. package/src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts +92 -0
  32. package/src/bin/keycloakify/buildJars/buildJar.ts +2 -2
  33. package/src/bin/keycloakify/buildJars/buildJars.ts +3 -4
  34. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +26 -20
  35. package/src/bin/keycloakify/keycloakify.ts +1 -1
  36. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +2 -2
  37. package/src/bin/main.ts +14 -0
  38. package/src/bin/shared/buildContext.ts +246 -225
  39. package/src/bin/shared/getLatestsSemVersionedTag.ts +180 -0
  40. package/src/bin/shared/promptKeycloakVersion.ts +8 -77
  41. package/src/bin/start-keycloak/appBuild.ts +13 -9
  42. package/src/bin/tools/downloadAndExtractArchive.ts +4 -2
  43. package/src/bin/tools/npmInstall.ts +63 -0
  44. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +3 -2
  45. package/src/bin/tsconfig.json +3 -1
  46. package/src/vite-plugin/vite-plugin.ts +7 -5
  47. package/vite-plugin/index.js +156 -180
  48. package/vite-plugin/vite-plugin.d.ts +6 -4
@@ -4004,14 +4004,10 @@ var constants = __nccwpck_require__(173);
4004
4004
  var tsafe = __nccwpck_require__(1666);
4005
4005
  // EXTERNAL MODULE: ./dist/bin/tools/crawl.js
4006
4006
  var crawl = __nccwpck_require__(3036);
4007
- // EXTERNAL MODULE: ./node_modules/tsafe/objectFromEntries.js
4008
- var objectFromEntries = __nccwpck_require__(8634);
4009
4007
  // EXTERNAL MODULE: ./node_modules/tsafe/objectEntries.js
4010
4008
  var objectEntries = __nccwpck_require__(9612);
4011
4009
  // EXTERNAL MODULE: ./node_modules/tsafe/id.js
4012
4010
  var id = __nccwpck_require__(3047);
4013
- // EXTERNAL MODULE: ./node_modules/tsafe/symToStr.js
4014
- var symToStr = __nccwpck_require__(6564);
4015
4011
  // EXTERNAL MODULE: ./node_modules/chalk/source/index.js
4016
4012
  var source = __nccwpck_require__(8818);
4017
4013
  var source_default = /*#__PURE__*/__nccwpck_require__.n(source);
@@ -4080,19 +4076,6 @@ function ensureSingleOrNone(arg0) {
4080
4076
  }
4081
4077
  //# sourceMappingURL=fetchProxyOptions.js.map
4082
4078
  ;// CONCATENATED MODULE: ./dist/bin/shared/buildContext.js
4083
- var __rest = (undefined && undefined.__rest) || function (s, e) {
4084
- var t = {};
4085
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4086
- t[p] = s[p];
4087
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
4088
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4089
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4090
- t[p[i]] = s[p[i]];
4091
- }
4092
- return t;
4093
- };
4094
-
4095
-
4096
4079
 
4097
4080
 
4098
4081
 
@@ -4108,8 +4091,9 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
4108
4091
 
4109
4092
 
4110
4093
 
4094
+ (0,assert.assert)();
4111
4095
  function getBuildContext(params) {
4112
- var _a, _b, _c, _d, _e, _f, _g;
4096
+ var _a, _b, _c, _d, _e, _f;
4113
4097
  const { cliCommandOptions } = params;
4114
4098
  const projectDirPath = cliCommandOptions.projectDirPath !== undefined
4115
4099
  ? getAbsoluteAndInOsFormatPath({
@@ -4193,65 +4177,78 @@ function getBuildContext(params) {
4193
4177
  return getPackageJSonDirPath(upCount + 1);
4194
4178
  })(0);
4195
4179
  const parsedPackageJson = (() => {
4196
- const zParsedPackageJson = z.object({
4197
- name: z.string().optional(),
4198
- version: z.string().optional(),
4199
- homepage: z.string().optional(),
4200
- keycloakify: (0,id.id)((() => {
4201
- const zBuildOptions_packageJson = z.object({
4202
- extraThemeProperties: z.array(z.string()).optional(),
4203
- artifactId: z.string().optional(),
4204
- groupId: z.string().optional(),
4205
- loginThemeResourcesFromKeycloakVersion: z.string().optional(),
4206
- projectBuildDirPath: z.string().optional(),
4207
- keycloakifyBuildDirPath: z.string().optional(),
4208
- kcContextExclusionsFtl: z.string().optional(),
4209
- environmentVariables: z.array(z.object({
4210
- name: z.string(),
4211
- default: z.string()
4212
- }))
4213
- .optional(),
4214
- themeName: z.union([z.string(), z.array(z.string())]).optional(),
4215
- themeVersion: z.string().optional(),
4216
- staticDirPathInProjectBuildDirPath: z.string().optional(),
4217
- publicDirPath: z.string().optional(),
4218
- keycloakVersionTargets: (0,id.id)((() => {
4219
- const zKeycloakVersionTargets = z.union([
4220
- z.object({
4221
- hasAccountTheme: z.literal(true),
4222
- "21-and-below": z.union([
4223
- z.boolean(),
4224
- z.string()
4225
- ]),
4226
- "23": z.union([z.boolean(), z.string()]),
4227
- "24": z.union([z.boolean(), z.string()]),
4228
- "25-and-above": z.union([z.boolean(), z.string()])
4229
- }),
4230
- z.object({
4231
- hasAccountTheme: z.literal(false),
4232
- "21-and-below": z.union([
4233
- z.boolean(),
4234
- z.string()
4235
- ]),
4236
- "22-and-above": z.union([z.boolean(), z.string()])
4237
- })
4238
- ]);
4239
- {
4240
- (0,assert.assert)();
4241
- }
4242
- return zKeycloakVersionTargets;
4243
- })()).optional(),
4244
- doUseAccountV3: z.boolean().optional()
4245
- });
4246
- {
4247
- (0,assert.assert)();
4248
- }
4249
- return zBuildOptions_packageJson;
4250
- })()).optional()
4251
- });
4252
- {
4180
+ const zMultiPageApp = (() => {
4181
+ const zTargetType = z.object({
4182
+ accountThemeImplementation: z.literal("Multi-Page"),
4183
+ keycloakVersionTargets: z.object({
4184
+ "21-and-below": z.union([z.boolean(), z.string()]),
4185
+ "23": z.union([z.boolean(), z.string()]),
4186
+ "24": z.union([z.boolean(), z.string()]),
4187
+ "25-and-above": z.union([z.boolean(), z.string()])
4188
+ })
4189
+ .optional()
4190
+ });
4253
4191
  (0,assert.assert)();
4254
- }
4192
+ return (0,id.id)(zTargetType);
4193
+ })();
4194
+ const zSinglePageApp = (() => {
4195
+ const zTargetType = z.object({
4196
+ accountThemeImplementation: z.union([
4197
+ z.literal("Single-Page"),
4198
+ z.literal("none")
4199
+ ]),
4200
+ keycloakVersionTargets: z.object({
4201
+ "21-and-below": z.union([z.boolean(), z.string()]),
4202
+ "22-and-above": z.union([z.boolean(), z.string()])
4203
+ })
4204
+ .optional()
4205
+ });
4206
+ (0,assert.assert)();
4207
+ return (0,id.id)(zTargetType);
4208
+ })();
4209
+ const zAccountThemeImplAndKeycloakVersionTargets = (() => {
4210
+ const zTargetType = z.union([zMultiPageApp, zSinglePageApp]);
4211
+ (0,assert.assert)();
4212
+ return (0,id.id)(zTargetType);
4213
+ })();
4214
+ const zBuildOptions = (() => {
4215
+ const zTargetType = z.intersection(z.object({
4216
+ themeName: z.union([z.string(), z.array(z.string())]).optional(),
4217
+ themeVersion: z.string().optional(),
4218
+ environmentVariables: z.array(z.object({
4219
+ name: z.string(),
4220
+ default: z.string()
4221
+ }))
4222
+ .optional(),
4223
+ extraThemeProperties: z.array(z.string()).optional(),
4224
+ artifactId: z.string().optional(),
4225
+ groupId: z.string().optional(),
4226
+ loginThemeResourcesFromKeycloakVersion: z.string().optional(),
4227
+ keycloakifyBuildDirPath: z.string().optional(),
4228
+ kcContextExclusionsFtl: z.string().optional()
4229
+ }), zAccountThemeImplAndKeycloakVersionTargets);
4230
+ (0,assert.assert)();
4231
+ return (0,id.id)(zTargetType);
4232
+ })();
4233
+ const zBuildOptions_packageJson = (() => {
4234
+ const zTargetType = z.intersection(zBuildOptions, z.object({
4235
+ projectBuildDirPath: z.string().optional(),
4236
+ staticDirPathInProjectBuildDirPath: z.string().optional(),
4237
+ publicDirPath: z.string().optional()
4238
+ }));
4239
+ (0,assert.assert)();
4240
+ return (0,id.id)(zTargetType);
4241
+ })();
4242
+ const zParsedPackageJson = (() => {
4243
+ const zTargetType = z.object({
4244
+ name: z.string().optional(),
4245
+ version: z.string().optional(),
4246
+ homepage: z.string().optional(),
4247
+ keycloakify: zBuildOptions_packageJson.optional()
4248
+ });
4249
+ (0,assert.assert)();
4250
+ return (0,id.id)(zTargetType);
4251
+ })();
4255
4252
  const configurationPackageJsonFilePath = (() => {
4256
4253
  const rootPackageJsonFilePath = (0,external_path_.join)(projectDirPath, "package.json");
4257
4254
  return external_fs_.existsSync(rootPackageJsonFilePath)
@@ -4260,11 +4257,48 @@ function getBuildContext(params) {
4260
4257
  })();
4261
4258
  return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync(configurationPackageJsonFilePath).toString("utf8")));
4262
4259
  })();
4263
- const buildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildOptions);
4264
- const recordIsImplementedByThemeType = (0,objectFromEntries.objectFromEntries)(["login", "account", "email"].map(themeType => [
4265
- themeType,
4266
- external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, themeType))
4267
- ]));
4260
+ const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
4261
+ if (bundler === "vite" && parsedPackageJson.keycloakify !== undefined) {
4262
+ console.error(source_default().red(`In vite projects, provide your Keycloakify options in vite.config.ts, not in package.json`));
4263
+ process.exit(-1);
4264
+ }
4265
+ const buildOptions = (() => {
4266
+ switch (bundler) {
4267
+ case "vite":
4268
+ (0,assert.assert)(resolvedViteConfig !== undefined);
4269
+ return resolvedViteConfig.buildOptions;
4270
+ case "webpack":
4271
+ (0,assert.assert)(parsedPackageJson.keycloakify !== undefined);
4272
+ return parsedPackageJson.keycloakify;
4273
+ }
4274
+ (0,assert.assert)(false);
4275
+ })();
4276
+ const implementedThemeTypes = {
4277
+ login: {
4278
+ isImplemented: external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, "login"))
4279
+ },
4280
+ email: {
4281
+ isImplemented: external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, "email"))
4282
+ },
4283
+ account: (() => {
4284
+ if (buildOptions.accountThemeImplementation === "none") {
4285
+ return { isImplemented: false };
4286
+ }
4287
+ return {
4288
+ isImplemented: true,
4289
+ type: buildOptions.accountThemeImplementation
4290
+ };
4291
+ })()
4292
+ };
4293
+ if (implementedThemeTypes.account.isImplemented &&
4294
+ !external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, "account"))) {
4295
+ console.error(source_default().red([
4296
+ `You have set 'accountThemeImplementation' to '${implementedThemeTypes.account.type}'`,
4297
+ `but the 'account' directory is missing in your theme source directory`,
4298
+ "Use the `npx keycloakify initialize-account-theme` command to create it"
4299
+ ].join(" ")));
4300
+ process.exit(-1);
4301
+ }
4268
4302
  const themeNames = (() => {
4269
4303
  if (buildOptions.themeName === undefined) {
4270
4304
  return parsedPackageJson.name === undefined
@@ -4285,36 +4319,26 @@ function getBuildContext(params) {
4285
4319
  })();
4286
4320
  const projectBuildDirPath = (() => {
4287
4321
  webpack: {
4288
- if (resolvedViteConfig !== undefined) {
4322
+ if (bundler !== "webpack") {
4289
4323
  break webpack;
4290
4324
  }
4291
- if (buildOptions.projectBuildDirPath !== undefined) {
4325
+ (0,assert.assert)(parsedPackageJson.keycloakify !== undefined);
4326
+ if (parsedPackageJson.keycloakify.projectBuildDirPath !== undefined) {
4292
4327
  return getAbsoluteAndInOsFormatPath({
4293
- pathIsh: buildOptions.projectBuildDirPath,
4328
+ pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
4294
4329
  cwd: projectDirPath
4295
4330
  });
4296
4331
  }
4297
4332
  return (0,external_path_.join)(projectDirPath, "build");
4298
4333
  }
4334
+ (0,assert.assert)(bundler === "vite");
4335
+ (0,assert.assert)(resolvedViteConfig !== undefined);
4299
4336
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
4300
4337
  })();
4301
- const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
4302
- const doUseAccountV3 = (_a = buildOptions.doUseAccountV3) !== null && _a !== void 0 ? _a : false;
4303
4338
  return {
4304
- bundler: resolvedViteConfig !== undefined
4305
- ? { type: "vite" }
4306
- : (() => {
4307
- const { scripts } = z.object({
4308
- scripts: z.record(z.string()).optional()
4309
- })
4310
- .parse(JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8")));
4311
- return {
4312
- type: "webpack",
4313
- packageJsonDirPath: (0,external_path_.dirname)(packageJsonFilePath),
4314
- packageJsonScripts: scripts !== null && scripts !== void 0 ? scripts : {}
4315
- };
4316
- })(),
4317
- themeVersion: (_c = (_b = buildOptions.themeVersion) !== null && _b !== void 0 ? _b : parsedPackageJson.version) !== null && _c !== void 0 ? _c : "0.0.0",
4339
+ bundler,
4340
+ packageJsonFilePath,
4341
+ themeVersion: (_b = (_a = buildOptions.themeVersion) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
4318
4342
  themeNames,
4319
4343
  extraThemeProperties: buildOptions.extraThemeProperties,
4320
4344
  groupId: (() => {
@@ -4325,8 +4349,8 @@ function getBuildContext(params) {
4325
4349
  : (_e = (_d = (_c = (0,external_url_.parse)(parsedPackageJson.homepage)
4326
4350
  .host) === null || _c === void 0 ? void 0 : _c.replace(/:[0-9]+$/, "")) === null || _d === void 0 ? void 0 : _d.split(".").reverse().join(".")) !== null && _e !== void 0 ? _e : fallbackGroupId) + ".keycloak");
4327
4351
  })(),
4328
- artifactId: (_e = (_d = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _d !== void 0 ? _d : buildOptions.artifactId) !== null && _e !== void 0 ? _e : `${themeNames[0]}-keycloak-theme`,
4329
- loginThemeResourcesFromKeycloakVersion: (_f = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _f !== void 0 ? _f : "24.0.4",
4352
+ artifactId: (_d = (_c = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _c !== void 0 ? _c : buildOptions.artifactId) !== null && _d !== void 0 ? _d : `${themeNames[0]}-keycloak-theme`,
4353
+ loginThemeResourcesFromKeycloakVersion: (_e = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : "24.0.4",
4330
4354
  projectDirPath,
4331
4355
  projectBuildDirPath,
4332
4356
  keycloakifyBuildDirPath: (() => {
@@ -4348,17 +4372,20 @@ function getBuildContext(params) {
4348
4372
  });
4349
4373
  }
4350
4374
  webpack: {
4351
- if (resolvedViteConfig !== undefined) {
4375
+ if (bundler !== "webpack") {
4352
4376
  break webpack;
4353
4377
  }
4354
- if (buildOptions.publicDirPath !== undefined) {
4378
+ (0,assert.assert)(parsedPackageJson.keycloakify !== undefined);
4379
+ if (parsedPackageJson.keycloakify.publicDirPath !== undefined) {
4355
4380
  return getAbsoluteAndInOsFormatPath({
4356
- pathIsh: buildOptions.publicDirPath,
4381
+ pathIsh: parsedPackageJson.keycloakify.publicDirPath,
4357
4382
  cwd: projectDirPath
4358
4383
  });
4359
4384
  }
4360
4385
  return (0,external_path_.join)(projectDirPath, "public");
4361
4386
  }
4387
+ (0,assert.assert)(bundler === "vite");
4388
+ (0,assert.assert)(resolvedViteConfig !== undefined);
4362
4389
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.publicDir);
4363
4390
  })(),
4364
4391
  cacheDirPath: (() => {
@@ -4375,7 +4402,7 @@ function getBuildContext(params) {
4375
4402
  })(),
4376
4403
  urlPathname: (() => {
4377
4404
  webpack: {
4378
- if (resolvedViteConfig !== undefined) {
4405
+ if (bundler !== "webpack") {
4379
4406
  break webpack;
4380
4407
  }
4381
4408
  const { homepage } = parsedPackageJson;
@@ -4389,21 +4416,28 @@ function getBuildContext(params) {
4389
4416
  const out = url.pathname.replace(/([^/])$/, "$1/");
4390
4417
  return out === "/" ? undefined : out;
4391
4418
  }
4419
+ (0,assert.assert)(bundler === "vite");
4420
+ (0,assert.assert)(resolvedViteConfig !== undefined);
4392
4421
  return resolvedViteConfig.urlPathname;
4393
4422
  })(),
4394
4423
  assetsDirPath: (() => {
4395
4424
  webpack: {
4396
- if (resolvedViteConfig !== undefined) {
4425
+ if (bundler !== "webpack") {
4397
4426
  break webpack;
4398
4427
  }
4399
- if (buildOptions.staticDirPathInProjectBuildDirPath !== undefined) {
4428
+ (0,assert.assert)(parsedPackageJson.keycloakify !== undefined);
4429
+ if (parsedPackageJson.keycloakify.staticDirPathInProjectBuildDirPath !==
4430
+ undefined) {
4400
4431
  getAbsoluteAndInOsFormatPath({
4401
- pathIsh: buildOptions.staticDirPathInProjectBuildDirPath,
4432
+ pathIsh: parsedPackageJson.keycloakify
4433
+ .staticDirPathInProjectBuildDirPath,
4402
4434
  cwd: projectBuildDirPath
4403
4435
  });
4404
4436
  }
4405
4437
  return (0,external_path_.join)(projectBuildDirPath, "static");
4406
4438
  }
4439
+ (0,assert.assert)(bundler === "vite");
4440
+ (0,assert.assert)(resolvedViteConfig !== undefined);
4407
4441
  return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
4408
4442
  })(),
4409
4443
  kcContextExclusionsFtlCode: (() => {
@@ -4419,8 +4453,8 @@ function getBuildContext(params) {
4419
4453
  }
4420
4454
  return buildOptions.kcContextExclusionsFtl;
4421
4455
  })(),
4422
- environmentVariables: (_g = buildOptions.environmentVariables) !== null && _g !== void 0 ? _g : [],
4423
- recordIsImplementedByThemeType,
4456
+ environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : [],
4457
+ implementedThemeTypes,
4424
4458
  themeSrcDirPath,
4425
4459
  fetchOptions: getProxyFetchOptions({
4426
4460
  npmConfigGetCwd: (function callee(upCount) {
@@ -4457,8 +4491,8 @@ function getBuildContext(params) {
4457
4491
  break build_for_specific_keycloak_major_version;
4458
4492
  }
4459
4493
  const keycloakVersionRange = (() => {
4460
- const doesImplementAccountV1Theme = !doUseAccountV3 && recordIsImplementedByThemeType.account;
4461
- if (doesImplementAccountV1Theme) {
4494
+ if (implementedThemeTypes.account.isImplemented &&
4495
+ implementedThemeTypes.account.type === "Multi-Page") {
4462
4496
  const keycloakVersionRange = (() => {
4463
4497
  if (buildForKeycloakMajorVersionNumber <= 21) {
4464
4498
  return "21-and-below";
@@ -4513,7 +4547,8 @@ function getBuildContext(params) {
4513
4547
  }
4514
4548
  const jarTargets_default = (() => {
4515
4549
  const jarTargets = [];
4516
- if (!doUseAccountV3 && recordIsImplementedByThemeType.account) {
4550
+ if (implementedThemeTypes.account.isImplemented &&
4551
+ implementedThemeTypes.account.type === "Multi-Page") {
4517
4552
  for (const keycloakVersionRange of [
4518
4553
  "21-and-below",
4519
4554
  "23",
@@ -4544,50 +4579,8 @@ function getBuildContext(params) {
4544
4579
  if (buildOptions.keycloakVersionTargets === undefined) {
4545
4580
  return jarTargets_default;
4546
4581
  }
4547
- if (buildOptions.keycloakVersionTargets.hasAccountTheme !== doUseAccountV3
4548
- ? false
4549
- : recordIsImplementedByThemeType.account) {
4550
- console.log(source_default().red((() => {
4551
- const { keycloakVersionTargets } = buildOptions;
4552
- let message = `Bad ${(0,symToStr/* symToStr */.r)({ keycloakVersionTargets })} configuration.\n`;
4553
- if (keycloakVersionTargets.hasAccountTheme) {
4554
- message +=
4555
- "Your codebase does not seem to implement an account theme ";
4556
- }
4557
- else {
4558
- message += "Your codebase implements an account theme ";
4559
- }
4560
- const { hasAccountTheme } = keycloakVersionTargets;
4561
- message += `but you have set ${(0,symToStr/* symToStr */.r)({ keycloakVersionTargets })}.${(0,symToStr/* symToStr */.r)({ hasAccountTheme })}`;
4562
- message += ` to ${hasAccountTheme} in your `;
4563
- message += (() => {
4564
- switch (bundler) {
4565
- case "vite":
4566
- return "vite.config.ts";
4567
- case "webpack":
4568
- return "package.json";
4569
- }
4570
- (0,assert.assert)(false);
4571
- })();
4572
- message += `. Please set it to ${!hasAccountTheme} `;
4573
- message +=
4574
- "and fill up the relevant keycloak version ranges.\n";
4575
- message += "Example:\n";
4576
- message += JSON.stringify((0,id.id)({
4577
- keycloakVersionTargets: Object.assign({ hasAccountTheme: recordIsImplementedByThemeType.account }, (0,objectFromEntries.objectFromEntries)(jarTargets_default.map(({ keycloakVersionRange, jarFileBasename }) => [
4578
- keycloakVersionRange,
4579
- jarFileBasename
4580
- ])))
4581
- }), null, 2);
4582
- message +=
4583
- "\nSee: https://docs.keycloakify.dev/v/v10/targetting-specific-keycloak-versions";
4584
- return message;
4585
- })()));
4586
- process.exit(1);
4587
- }
4588
4582
  const jarTargets = [];
4589
- const _a = buildOptions.keycloakVersionTargets, { hasAccountTheme } = _a, rest = __rest(_a, ["hasAccountTheme"]);
4590
- for (const [keycloakVersionRange, jarNameOrBoolean] of (0,objectEntries.objectEntries)(rest)) {
4583
+ for (const [keycloakVersionRange, jarNameOrBoolean] of (0,objectEntries.objectEntries)(buildOptions.keycloakVersionTargets)) {
4591
4584
  if (jarNameOrBoolean === false) {
4592
4585
  continue;
4593
4586
  }
@@ -4621,8 +4614,7 @@ function getBuildContext(params) {
4621
4614
  process.exit(1);
4622
4615
  }
4623
4616
  return jarTargets;
4624
- })(),
4625
- doUseAccountV3
4617
+ })()
4626
4618
  };
4627
4619
  }
4628
4620
  //# sourceMappingURL=buildContext.js.map
@@ -4973,7 +4965,7 @@ async function downloadAndExtractArchive(params) {
4973
4965
  archiveFileBasename
4974
4966
  });
4975
4967
  }
4976
- const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnArchiveFile}_${external_crypto_.createHash("sha256")
4968
+ const extractDirBasename = `${archiveFileBasename.replace(/\.([^.]+)$/, (...[, ext]) => `_${ext}`)}_${uniqueIdOfOnArchiveFile}_${external_crypto_.createHash("sha256")
4977
4969
  .update(onArchiveFile.toString())
4978
4970
  .digest("hex")
4979
4971
  .substring(0, 5)}`;
@@ -4988,7 +4980,9 @@ async function downloadAndExtractArchive(params) {
4988
4980
  return basename => basename !== extractDirBasename && basename.startsWith(prefix);
4989
4981
  })())
4990
4982
  .map(async (extractDirBasename) => {
4991
- await (0,fs_rm.rm)((0,external_path_.join)(cacheDirPath, extractDirBasename), { recursive: true });
4983
+ await (0,fs_rm.rm)((0,external_path_.join)(cacheDirPath, extractDirBasename), {
4984
+ recursive: true
4985
+ });
4992
4986
  await SuccessTracker.removeFromExtracted({
4993
4987
  cacheDirPath,
4994
4988
  extractDirBasename
@@ -5658,7 +5652,7 @@ const buildContext_1 = __nccwpck_require__(1273);
5658
5652
  const magic_string_1 = __importDefault(__nccwpck_require__(5734));
5659
5653
  const generateKcGenTs_1 = __nccwpck_require__(8585);
5660
5654
  function keycloakify(params) {
5661
- const { postBuild, ...buildOptions } = params !== null && params !== void 0 ? params : {};
5655
+ const { postBuild, ...buildOptions } = params;
5662
5656
  let projectDirPath = undefined;
5663
5657
  let urlPathname = undefined;
5664
5658
  let buildDirPath = undefined;
@@ -42658,24 +42652,6 @@ exports.objectKeys = objectKeys;
42658
42652
 
42659
42653
  /***/ }),
42660
42654
 
42661
- /***/ 6564:
42662
- /***/ ((__unused_webpack_module, exports) => {
42663
-
42664
- "use strict";
42665
- var __webpack_unused_export__;
42666
-
42667
- __webpack_unused_export__ = ({ value: true });
42668
- exports.r = void 0;
42669
- /** @see <https://docs.tsafe.dev/main/symtostr> */
42670
- function symToStr(wrap) {
42671
- // @ts-expect-error: We know better
42672
- return Object.keys(wrap)[0];
42673
- }
42674
- exports.r = symToStr;
42675
- //# sourceMappingURL=symToStr.js.map
42676
-
42677
- /***/ }),
42678
-
42679
42655
  /***/ 7393:
42680
42656
  /***/ ((__unused_webpack_module, exports) => {
42681
42657
 
@@ -1,5 +1,7 @@
1
1
  import { type BuildContext, type BuildOptions } from "../bin/shared/buildContext";
2
- export type Params = BuildOptions & {
3
- postBuild?: (buildContext: Omit<BuildContext, "bundler">) => Promise<void>;
4
- };
5
- export declare function keycloakify(params?: Params): any;
2
+ export declare namespace keycloakify {
3
+ type Params = BuildOptions & {
4
+ postBuild?: (buildContext: Omit<BuildContext, "bundler">) => Promise<void>;
5
+ };
6
+ }
7
+ export declare function keycloakify(params: keycloakify.Params): any;