keycloakify 11.3.0-rc.4 → 11.3.0-rc.7

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 CHANGED
@@ -15389,66 +15389,16 @@ function assertNoPnpmDlx() {
15389
15389
  }
15390
15390
  }
15391
15391
  //# sourceMappingURL=assertNoPnpmDlx.js.map
15392
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
15393
- var esm_assert = __nccwpck_require__(29041);
15394
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
15395
- var constants = __nccwpck_require__(173);
15396
- ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler.js
15397
-
15398
-
15399
- const BIN_NAME = "_keycloakify-custom-handler";
15400
- const NOT_IMPLEMENTED_EXIT_CODE = 78;
15401
- function readParams(params) {
15402
- const { apiVersion } = params;
15403
- assert(apiVersion === "v1");
15404
- const commandName = (() => {
15405
- const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME];
15406
- assert(envValue !== undefined);
15407
- return envValue;
15408
- })();
15409
- const buildContext = (() => {
15410
- const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT];
15411
- assert(envValue !== undefined);
15412
- return JSON.parse(envValue);
15413
- })();
15414
- return { commandName, buildContext };
15415
- }
15416
- //# sourceMappingURL=customHandler.js.map
15417
- ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler_caller.js
15418
-
15419
-
15420
-
15421
-
15422
-
15423
-
15424
- (0,esm_assert/* assert */.h)();
15425
- function callHandlerIfAny(params) {
15426
- const { commandName, buildContext } = params;
15427
- if (!external_fs_.readdirSync((0,external_path_.dirname)(process.argv[1])).includes(BIN_NAME)) {
15428
- return;
15429
- }
15430
- try {
15431
- external_child_process_.execSync(`npx ${BIN_NAME}`, {
15432
- stdio: "inherit",
15433
- env: Object.assign(Object.assign({}, process.env), { [constants/* CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME */._S.COMMAND_NAME]: commandName, [constants/* CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT */._S.BUILD_CONTEXT]: JSON.stringify(buildContext) })
15434
- });
15435
- }
15436
- catch (error) {
15437
- const status = error.status;
15438
- if (status === NOT_IMPLEMENTED_EXIT_CODE) {
15439
- return;
15440
- }
15441
- process.exit(status);
15442
- }
15443
- process.exit(0);
15444
- }
15445
- //# sourceMappingURL=customHandler_caller.js.map
15446
15392
  // EXTERNAL MODULE: external "url"
15447
15393
  var external_url_ = __nccwpck_require__(57310);
15448
15394
  // EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
15449
15395
  var getAbsoluteAndInOsFormatPath = __nccwpck_require__(84794);
15450
15396
  // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
15451
15397
  var lib = __nccwpck_require__(52300);
15398
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
15399
+ var assert = __nccwpck_require__(29041);
15400
+ // EXTERNAL MODULE: ./dist/bin/shared/constants.js
15401
+ var constants = __nccwpck_require__(173);
15452
15402
  // EXTERNAL MODULE: ./node_modules/tsafe/esm/exclude.mjs
15453
15403
  var exclude = __nccwpck_require__(83101);
15454
15404
  // EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
@@ -15577,7 +15527,7 @@ function ensureSingleOrNone(arg0) {
15577
15527
 
15578
15528
 
15579
15529
 
15580
- (0,esm_assert/* assert */.h)();
15530
+ (0,assert/* assert */.h)();
15581
15531
  function getBuildContext(params) {
15582
15532
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15583
15533
  const projectDirPath = params.projectDirPath !== undefined
@@ -15629,7 +15579,7 @@ function getBuildContext(params) {
15629
15579
  env: Object.assign(Object.assign({}, process.env), { [constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG]: "true" })
15630
15580
  })
15631
15581
  .toString("utf8");
15632
- (0,esm_assert/* assert */.h)(output.includes(constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG), "Seems like the Keycloakify's Vite plugin is not installed.");
15582
+ (0,assert/* assert */.h)(output.includes(constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG), "Seems like the Keycloakify's Vite plugin is not installed.");
15633
15583
  const resolvedViteConfigStr = output
15634
15584
  .split(constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG)
15635
15585
  .reverse()[0];
@@ -15639,7 +15589,7 @@ function getBuildContext(params) {
15639
15589
  const packageJsonFilePath = (function getPackageJSonDirPath(upCount) {
15640
15590
  var _a, _b;
15641
15591
  const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
15642
- (0,esm_assert/* assert */.h)(dirPath !== external_path_.sep, "Root package.json not found");
15592
+ (0,assert/* assert */.h)(dirPath !== external_path_.sep, "Root package.json not found");
15643
15593
  success: {
15644
15594
  const packageJsonFilePath = (0,external_path_.join)(dirPath, "package.json");
15645
15595
  if (!external_fs_.existsSync(packageJsonFilePath)) {
@@ -15672,7 +15622,7 @@ function getBuildContext(params) {
15672
15622
  })
15673
15623
  .optional()
15674
15624
  });
15675
- (0,esm_assert/* assert */.h)();
15625
+ (0,assert/* assert */.h)();
15676
15626
  return (0,id.id)(zTargetType);
15677
15627
  })();
15678
15628
  const zSinglePageApp = (() => {
@@ -15687,12 +15637,12 @@ function getBuildContext(params) {
15687
15637
  })
15688
15638
  .optional()
15689
15639
  });
15690
- (0,esm_assert/* assert */.h)();
15640
+ (0,assert/* assert */.h)();
15691
15641
  return (0,id.id)(zTargetType);
15692
15642
  })();
15693
15643
  const zAccountThemeImplAndKeycloakVersionTargets = (() => {
15694
15644
  const zTargetType = lib.z.union([zMultiPageApp, zSinglePageApp]);
15695
- (0,esm_assert/* assert */.h)();
15645
+ (0,assert/* assert */.h)();
15696
15646
  return (0,id.id)(zTargetType);
15697
15647
  })();
15698
15648
  const zStartKeycloakOptions = (() => {
@@ -15704,7 +15654,7 @@ function getBuildContext(params) {
15704
15654
  keycloakExtraArgs: lib.z.array(lib.z.string()).optional(),
15705
15655
  port: lib.z.number().optional()
15706
15656
  });
15707
- (0,esm_assert/* assert */.h)();
15657
+ (0,assert/* assert */.h)();
15708
15658
  return (0,id.id)(zTargetType);
15709
15659
  })();
15710
15660
  const zBuildOptions = (() => {
@@ -15723,7 +15673,7 @@ function getBuildContext(params) {
15723
15673
  kcContextExclusionsFtl: lib.z.string().optional(),
15724
15674
  startKeycloakOptions: zStartKeycloakOptions.optional()
15725
15675
  }), zAccountThemeImplAndKeycloakVersionTargets);
15726
- (0,esm_assert/* assert */.h)();
15676
+ (0,assert/* assert */.h)();
15727
15677
  return (0,id.id)(zTargetType);
15728
15678
  })();
15729
15679
  const zBuildOptions_packageJson = (() => {
@@ -15732,7 +15682,7 @@ function getBuildContext(params) {
15732
15682
  staticDirPathInProjectBuildDirPath: lib.z.string().optional(),
15733
15683
  publicDirPath: lib.z.string().optional()
15734
15684
  }));
15735
- (0,esm_assert/* assert */.h)();
15685
+ (0,assert/* assert */.h)();
15736
15686
  return (0,id.id)(zTargetType);
15737
15687
  })();
15738
15688
  const zParsedPackageJson = (() => {
@@ -15742,7 +15692,7 @@ function getBuildContext(params) {
15742
15692
  homepage: lib.z.string().optional(),
15743
15693
  keycloakify: zBuildOptions_packageJson.optional()
15744
15694
  });
15745
- (0,esm_assert/* assert */.h)();
15695
+ (0,assert/* assert */.h)();
15746
15696
  return (0,id.id)(zTargetType);
15747
15697
  })();
15748
15698
  const configurationPackageJsonFilePath = (() => {
@@ -15761,13 +15711,13 @@ function getBuildContext(params) {
15761
15711
  const buildOptions = (() => {
15762
15712
  switch (bundler) {
15763
15713
  case "vite":
15764
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15714
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15765
15715
  return resolvedViteConfig.buildOptions;
15766
15716
  case "webpack":
15767
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15717
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15768
15718
  return parsedPackageJson.keycloakify;
15769
15719
  }
15770
- (0,esm_assert/* assert */.h)(false);
15720
+ (0,assert/* assert */.h)(false);
15771
15721
  })();
15772
15722
  const implementedThemeTypes = {
15773
15723
  login: {
@@ -15811,7 +15761,7 @@ function getBuildContext(params) {
15811
15761
  return [buildOptions.themeName];
15812
15762
  }
15813
15763
  const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
15814
- (0,esm_assert/* assert */.h)(mainThemeName !== undefined);
15764
+ (0,assert/* assert */.h)(mainThemeName !== undefined);
15815
15765
  return [mainThemeName, ...themeVariantNames];
15816
15766
  })();
15817
15767
  for (const themeName of themeNames) {
@@ -15830,7 +15780,7 @@ function getBuildContext(params) {
15830
15780
  if (bundler !== "webpack") {
15831
15781
  break webpack;
15832
15782
  }
15833
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15783
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15834
15784
  if (parsedPackageJson.keycloakify.projectBuildDirPath !== undefined) {
15835
15785
  return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
15836
15786
  pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
@@ -15839,8 +15789,8 @@ function getBuildContext(params) {
15839
15789
  }
15840
15790
  return (0,external_path_.join)(projectDirPath, "build");
15841
15791
  }
15842
- (0,esm_assert/* assert */.h)(bundler === "vite");
15843
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15792
+ (0,assert/* assert */.h)(bundler === "vite");
15793
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15844
15794
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
15845
15795
  })();
15846
15796
  return {
@@ -15882,7 +15832,7 @@ function getBuildContext(params) {
15882
15832
  if (bundler !== "webpack") {
15883
15833
  break webpack;
15884
15834
  }
15885
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15835
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15886
15836
  if (parsedPackageJson.keycloakify.publicDirPath !== undefined) {
15887
15837
  return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
15888
15838
  pathIsh: parsedPackageJson.keycloakify.publicDirPath,
@@ -15891,8 +15841,8 @@ function getBuildContext(params) {
15891
15841
  }
15892
15842
  return (0,external_path_.join)(projectDirPath, "public");
15893
15843
  }
15894
- (0,esm_assert/* assert */.h)(bundler === "vite");
15895
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15844
+ (0,assert/* assert */.h)(bundler === "vite");
15845
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15896
15846
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.publicDir);
15897
15847
  })(),
15898
15848
  cacheDirPath: (0,external_path_.join)((() => {
@@ -15920,8 +15870,8 @@ function getBuildContext(params) {
15920
15870
  const out = url.pathname.replace(/([^/])$/, "$1/");
15921
15871
  return out === "/" ? undefined : out;
15922
15872
  }
15923
- (0,esm_assert/* assert */.h)(bundler === "vite");
15924
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15873
+ (0,assert/* assert */.h)(bundler === "vite");
15874
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15925
15875
  return resolvedViteConfig.urlPathname;
15926
15876
  })(),
15927
15877
  assetsDirPath: (() => {
@@ -15929,7 +15879,7 @@ function getBuildContext(params) {
15929
15879
  if (bundler !== "webpack") {
15930
15880
  break webpack;
15931
15881
  }
15932
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15882
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15933
15883
  if (parsedPackageJson.keycloakify.staticDirPathInProjectBuildDirPath !==
15934
15884
  undefined) {
15935
15885
  (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
@@ -15940,8 +15890,8 @@ function getBuildContext(params) {
15940
15890
  }
15941
15891
  return (0,external_path_.join)(projectBuildDirPath, "static");
15942
15892
  }
15943
- (0,esm_assert/* assert */.h)(bundler === "vite");
15944
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15893
+ (0,assert/* assert */.h)(bundler === "vite");
15894
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15945
15895
  return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
15946
15896
  })(),
15947
15897
  kcContextExclusionsFtlCode: (() => {
@@ -15963,7 +15913,7 @@ function getBuildContext(params) {
15963
15913
  fetchOptions: getProxyFetchOptions({
15964
15914
  npmConfigGetCwd: (function callee(upCount) {
15965
15915
  const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
15966
- (0,esm_assert/* assert */.h)(dirPath !== external_path_.sep, "Couldn't find a place to run 'npm config get'");
15916
+ (0,assert/* assert */.h)(dirPath !== external_path_.sep, "Couldn't find a place to run 'npm config get'");
15967
15917
  try {
15968
15918
  external_child_process_.execSync("npm config get", {
15969
15919
  cwd: dirPath,
@@ -15988,7 +15938,7 @@ function getBuildContext(params) {
15988
15938
  return undefined;
15989
15939
  }
15990
15940
  const major = parseInt(envValue);
15991
- (0,esm_assert/* assert */.h)(!isNaN(major));
15941
+ (0,assert/* assert */.h)(!isNaN(major));
15992
15942
  return major;
15993
15943
  })();
15994
15944
  if (buildForKeycloakMajorVersionNumber === undefined) {
@@ -16001,7 +15951,7 @@ function getBuildContext(params) {
16001
15951
  if (buildForKeycloakMajorVersionNumber <= 21) {
16002
15952
  return "21-and-below";
16003
15953
  }
16004
- (0,esm_assert/* assert */.h)(buildForKeycloakMajorVersionNumber !== 22);
15954
+ (0,assert/* assert */.h)(buildForKeycloakMajorVersionNumber !== 22);
16005
15955
  if (buildForKeycloakMajorVersionNumber === 23) {
16006
15956
  return "23";
16007
15957
  }
@@ -16013,7 +15963,7 @@ function getBuildContext(params) {
16013
15963
  }
16014
15964
  return "26-and-above";
16015
15965
  })();
16016
- (0,esm_assert/* assert */.h)();
15966
+ (0,assert/* assert */.h)();
16017
15967
  return keycloakVersionRange;
16018
15968
  }
16019
15969
  else {
@@ -16024,14 +15974,14 @@ function getBuildContext(params) {
16024
15974
  }
16025
15975
  return "22-to-25";
16026
15976
  })();
16027
- (0,esm_assert/* assert */.h)();
15977
+ (0,assert/* assert */.h)();
16028
15978
  return keycloakVersionRange;
16029
15979
  }
16030
15980
  })();
16031
15981
  const jarFileBasename = (() => {
16032
15982
  use_custom_jar_basename: {
16033
15983
  const { keycloakVersionTargets } = buildOptions;
16034
- (0,esm_assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
15984
+ (0,assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16035
15985
  if (keycloakVersionTargets === undefined) {
16036
15986
  break use_custom_jar_basename;
16037
15987
  }
@@ -16065,7 +16015,7 @@ function getBuildContext(params) {
16065
16015
  "25",
16066
16016
  "26-and-above"
16067
16017
  ]) {
16068
- (0,esm_assert/* assert */.h)(true);
16018
+ (0,assert/* assert */.h)(true);
16069
16019
  jarTargets.push({
16070
16020
  keycloakVersionRange,
16071
16021
  jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
@@ -16077,7 +16027,7 @@ function getBuildContext(params) {
16077
16027
  "22-to-25",
16078
16028
  "all-other-versions"
16079
16029
  ]) {
16080
- (0,esm_assert/* assert */.h)(true);
16030
+ (0,assert/* assert */.h)(true);
16081
16031
  jarTargets.push({
16082
16032
  keycloakVersionRange,
16083
16033
  jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
@@ -16092,7 +16042,7 @@ function getBuildContext(params) {
16092
16042
  const jarTargets = [];
16093
16043
  for (const [keycloakVersionRange, jarNameOrBoolean] of (0,objectEntries/* objectEntries */.q)((() => {
16094
16044
  const { keycloakVersionTargets } = buildOptions;
16095
- (0,esm_assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16045
+ (0,assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16096
16046
  return keycloakVersionTargets;
16097
16047
  })())) {
16098
16048
  if (jarNameOrBoolean === false) {
@@ -16136,7 +16086,7 @@ function getBuildContext(params) {
16136
16086
  return undefined;
16137
16087
  }
16138
16088
  const [reference, tag, ...rest] = buildOptions.startKeycloakOptions.dockerImage.split(":");
16139
- (0,esm_assert/* assert */.h)(reference !== undefined && tag !== undefined && rest.length === 0, `Invalid docker image: ${buildOptions.startKeycloakOptions.dockerImage}`);
16089
+ (0,assert/* assert */.h)(reference !== undefined && tag !== undefined && rest.length === 0, `Invalid docker image: ${buildOptions.startKeycloakOptions.dockerImage}`);
16140
16090
  return { reference, tag };
16141
16091
  })(),
16142
16092
  dockerExtraArgs: (_g = (_f = buildOptions.startKeycloakOptions) === null || _f === void 0 ? void 0 : _f.dockerExtraArgs) !== null && _g !== void 0 ? _g : [],
@@ -16170,7 +16120,6 @@ function getBuildContext(params) {
16170
16120
 
16171
16121
 
16172
16122
 
16173
-
16174
16123
  assertNoPnpmDlx();
16175
16124
  const program = Z({
16176
16125
  name: "keycloakify",
@@ -16214,116 +16163,97 @@ program
16214
16163
  .task({
16215
16164
  skip,
16216
16165
  handler: async ({ projectDirPath }) => {
16217
- const buildContext = getBuildContext({ projectDirPath });
16218
16166
  const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(783), __nccwpck_require__.e(573)]).then(__nccwpck_require__.bind(__nccwpck_require__, 82573));
16219
- await command({ buildContext });
16167
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16168
+ }
16169
+ });
16170
+ program
16171
+ .command({
16172
+ name: "start-keycloak",
16173
+ description: "Spin up a pre configured Docker image of Keycloak to test your theme."
16174
+ })
16175
+ .option({
16176
+ key: "port",
16177
+ name: (() => {
16178
+ const name = "port";
16179
+ optionsKeys.push(name);
16180
+ return name;
16181
+ })(),
16182
+ description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
16183
+ defaultValue: undefined
16184
+ })
16185
+ .option({
16186
+ key: "keycloakVersion",
16187
+ name: (() => {
16188
+ const name = "keycloak-version";
16189
+ optionsKeys.push(name);
16190
+ return name;
16191
+ })(),
16192
+ description: [
16193
+ "Use a specific version of Keycloak.",
16194
+ "Example `--keycloak-version 21.1.1`"
16195
+ ].join(" "),
16196
+ defaultValue: undefined
16197
+ })
16198
+ .option({
16199
+ key: "realmJsonFilePath",
16200
+ name: (() => {
16201
+ const name = "import";
16202
+ optionsKeys.push(name);
16203
+ return name;
16204
+ })(),
16205
+ defaultValue: undefined,
16206
+ description: [
16207
+ "Import your own realm configuration file",
16208
+ "Example `--import path/to/myrealm-realm.json`"
16209
+ ].join(" ")
16210
+ })
16211
+ .task({
16212
+ skip,
16213
+ handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16214
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(903), __nccwpck_require__.e(33), __nccwpck_require__.e(36), __nccwpck_require__.e(20), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
16215
+ await command({
16216
+ buildContext: getBuildContext({ projectDirPath }),
16217
+ cliCommandOptions: { keycloakVersion, port, realmJsonFilePath }
16218
+ });
16219
+ }
16220
+ });
16221
+ program
16222
+ .command({
16223
+ name: "eject-page",
16224
+ description: "Eject a Keycloak page."
16225
+ })
16226
+ .task({
16227
+ skip,
16228
+ handler: async ({ projectDirPath }) => {
16229
+ const { command } = await __nccwpck_require__.e(/* import() */ 453).then(__nccwpck_require__.bind(__nccwpck_require__, 93453));
16230
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16231
+ }
16232
+ });
16233
+ program
16234
+ .command({
16235
+ name: "add-story",
16236
+ description: "Add *.stories.tsx file for a specific page to in your Storybook."
16237
+ })
16238
+ .task({
16239
+ skip,
16240
+ handler: async ({ projectDirPath }) => {
16241
+ const { command } = await __nccwpck_require__.e(/* import() */ 97).then(__nccwpck_require__.bind(__nccwpck_require__, 98097));
16242
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16243
+ }
16244
+ });
16245
+ program
16246
+ .command({
16247
+ name: "initialize-login-theme",
16248
+ description: "Initialize an email theme."
16249
+ })
16250
+ .task({
16251
+ skip,
16252
+ handler: async ({ projectDirPath }) => {
16253
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(903), __nccwpck_require__.e(33), __nccwpck_require__.e(20), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
16254
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16220
16255
  }
16221
16256
  });
16222
- {
16223
- const commandName = "start-keycloak";
16224
- program
16225
- .command({
16226
- name: commandName,
16227
- description: "Spin up a pre configured Docker image of Keycloak to test your theme."
16228
- })
16229
- .option({
16230
- key: "port",
16231
- name: (() => {
16232
- const name = "port";
16233
- optionsKeys.push(name);
16234
- return name;
16235
- })(),
16236
- description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
16237
- defaultValue: undefined
16238
- })
16239
- .option({
16240
- key: "keycloakVersion",
16241
- name: (() => {
16242
- const name = "keycloak-version";
16243
- optionsKeys.push(name);
16244
- return name;
16245
- })(),
16246
- description: [
16247
- "Use a specific version of Keycloak.",
16248
- "Example `--keycloak-version 21.1.1`"
16249
- ].join(" "),
16250
- defaultValue: undefined
16251
- })
16252
- .option({
16253
- key: "realmJsonFilePath",
16254
- name: (() => {
16255
- const name = "import";
16256
- optionsKeys.push(name);
16257
- return name;
16258
- })(),
16259
- defaultValue: undefined,
16260
- description: [
16261
- "Import your own realm configuration file",
16262
- "Example `--import path/to/myrealm-realm.json`"
16263
- ].join(" ")
16264
- })
16265
- .task({
16266
- skip,
16267
- handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16268
- const buildContext = getBuildContext({ projectDirPath });
16269
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(903), __nccwpck_require__.e(33), __nccwpck_require__.e(36), __nccwpck_require__.e(20), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
16270
- await command({
16271
- buildContext,
16272
- cliCommandOptions: { keycloakVersion, port, realmJsonFilePath }
16273
- });
16274
- }
16275
- });
16276
- }
16277
- {
16278
- const commandName = "eject-page";
16279
- program
16280
- .command({
16281
- name: commandName,
16282
- description: "Eject a Keycloak page."
16283
- })
16284
- .task({
16285
- skip,
16286
- handler: async ({ projectDirPath }) => {
16287
- const buildContext = getBuildContext({ projectDirPath });
16288
- callHandlerIfAny({ buildContext, commandName });
16289
- const { command } = await __nccwpck_require__.e(/* import() */ 453).then(__nccwpck_require__.bind(__nccwpck_require__, 93453));
16290
- await command({ buildContext });
16291
- }
16292
- });
16293
- }
16294
- {
16295
- const commandName = "add-story";
16296
- program
16297
- .command({
16298
- name: commandName,
16299
- description: "Add *.stories.tsx file for a specific page to in your Storybook."
16300
- })
16301
- .task({
16302
- skip,
16303
- handler: async ({ projectDirPath }) => {
16304
- const buildContext = getBuildContext({ projectDirPath });
16305
- callHandlerIfAny({ buildContext, commandName });
16306
- const { command } = await __nccwpck_require__.e(/* import() */ 97).then(__nccwpck_require__.bind(__nccwpck_require__, 98097));
16307
- await command({ buildContext });
16308
- }
16309
- });
16310
- }
16311
- {
16312
- const comandName = "initialize-login-theme";
16313
- program
16314
- .command({
16315
- name: comandName,
16316
- description: "Initialize an email theme."
16317
- })
16318
- .task({
16319
- skip,
16320
- handler: async ({ projectDirPath }) => {
16321
- const buildContext = getBuildContext({ projectDirPath });
16322
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(903), __nccwpck_require__.e(33), __nccwpck_require__.e(20), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
16323
- await command({ buildContext });
16324
- }
16325
- });
16326
- }
16327
16257
  program
16328
16258
  .command({
16329
16259
  name: "initialize-account-theme",
@@ -16332,44 +16262,34 @@ program
16332
16262
  .task({
16333
16263
  skip,
16334
16264
  handler: async ({ projectDirPath }) => {
16335
- const buildContext = getBuildContext({ projectDirPath });
16336
16265
  const { command } = await __nccwpck_require__.e(/* import() */ 780).then(__nccwpck_require__.bind(__nccwpck_require__, 75780));
16337
- await command({ buildContext });
16266
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16267
+ }
16268
+ });
16269
+ program
16270
+ .command({
16271
+ name: "copy-keycloak-resources-to-public",
16272
+ description: "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
16273
+ })
16274
+ .task({
16275
+ skip,
16276
+ handler: async ({ projectDirPath }) => {
16277
+ const { command } = await __nccwpck_require__.e(/* import() */ 193).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
16278
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16279
+ }
16280
+ });
16281
+ program
16282
+ .command({
16283
+ name: "update-kc-gen",
16284
+ description: "(Webpack/Create-React-App only) Create/update the kc.gen.ts file in your project."
16285
+ })
16286
+ .task({
16287
+ skip,
16288
+ handler: async ({ projectDirPath }) => {
16289
+ const { command } = await __nccwpck_require__.e(/* import() */ 786).then(__nccwpck_require__.bind(__nccwpck_require__, 10786));
16290
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16338
16291
  }
16339
16292
  });
16340
- {
16341
- const commandName = "copy-keycloak-resources-to-public";
16342
- program
16343
- .command({
16344
- name: commandName,
16345
- description: "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
16346
- })
16347
- .task({
16348
- skip,
16349
- handler: async ({ projectDirPath }) => {
16350
- const buildContext = getBuildContext({ projectDirPath });
16351
- const { command } = await __nccwpck_require__.e(/* import() */ 193).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
16352
- await command({ buildContext });
16353
- }
16354
- });
16355
- }
16356
- {
16357
- const commandName = "update-kc-gen";
16358
- program
16359
- .command({
16360
- name: commandName,
16361
- description: "(Webpack/Create-React-App only) Create/update the kc.gen.ts file in your project."
16362
- })
16363
- .task({
16364
- skip,
16365
- handler: async ({ projectDirPath }) => {
16366
- const buildContext = getBuildContext({ projectDirPath });
16367
- callHandlerIfAny({ buildContext, commandName });
16368
- const { command } = await __nccwpck_require__.e(/* import() */ 786).then(__nccwpck_require__.bind(__nccwpck_require__, 10786));
16369
- await command({ buildContext });
16370
- }
16371
- });
16372
- }
16373
16293
  // Fallback to build command if no command is provided
16374
16294
  {
16375
16295
  const [, , ...rest] = process.argv;
@@ -1,7 +1,7 @@
1
1
  import type { BuildContext } from "./buildContext";
2
2
  export declare const BIN_NAME = "_keycloakify-custom-handler";
3
3
  export declare const NOT_IMPLEMENTED_EXIT_CODE = 78;
4
- export type CommandName = "update-kc-gen" | "eject-page" | "add-story";
4
+ export type CommandName = "update-kc-gen" | "eject-page" | "add-story" | "initialize-account-theme" | "initialize-email-theme" | "copy-keycloak-resources-to-public";
5
5
  export type ApiVersion = "v1";
6
6
  export declare function readParams(params: {
7
7
  apiVersion: ApiVersion;
@@ -1 +1 @@
1
- {"version":3,"file":"customHandler.js","sourceRoot":"","sources":["../../src/bin/shared/customHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAM5C,MAAM,UAAU,UAAU,CAAC,MAAkC;IACzD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,QAAuB,CAAC;IACnC,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAErE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAiB,CAAC;IAChD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"customHandler.js","sourceRoot":"","sources":["../../src/bin/shared/customHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAY5C,MAAM,UAAU,UAAU,CAAC,MAAkC;IACzD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,QAAuB,CAAC;IACnC,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAErE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAiB,CAAC;IAChD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { BuildContext } from "./buildContext";
2
2
  import { type CommandName } from "./customHandler";
3
- export declare function callHandlerIfAny(params: {
3
+ export declare function maybeDelegateCommandToCustomHandler(params: {
4
4
  commandName: CommandName;
5
5
  buildContext: BuildContext;
6
6
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.3.0-rc.4",
3
+ "version": "11.3.0-rc.7",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -679,8 +679,7 @@
679
679
  "src/bin/shared/constants.ts",
680
680
  "src/bin/shared/copyKeycloakResourcesToPublic.ts",
681
681
  "src/bin/shared/customHandler.ts",
682
- "src/bin/shared/customHandler_caller.ts",
683
- "src/bin/shared/generateKcGenTs.ts",
682
+ "src/bin/shared/customHandler_delegate.ts",
684
683
  "src/bin/shared/getLatestsSemVersionedTag.ts",
685
684
  "src/bin/shared/metaInfKeycloakThemes.ts",
686
685
  "src/bin/shared/promptKeycloakVersion.ts",
@@ -1013,9 +1012,8 @@
1013
1012
  "bin/shared/buildContext.d.ts",
1014
1013
  "bin/shared/constants.d.ts",
1015
1014
  "bin/shared/copyKeycloakResourcesToPublic.d.ts",
1016
- "bin/shared/customHandler_caller.d.ts",
1015
+ "bin/shared/customHandler_delegate.d.ts",
1017
1016
  "bin/shared/customHandler.d.ts",
1018
- "bin/shared/generateKcGenTs.d.ts",
1019
1017
  "bin/shared/getLatestsSemVersionedTag.d.ts",
1020
1018
  "bin/shared/KeycloakVersionRange.d.ts",
1021
1019
  "bin/shared/metaInfKeycloakThemes.d.ts",