keycloakify 11.3.0-rc.3 → 11.3.0-rc.6

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,73 +15389,20 @@ 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
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
15418
- var is = __nccwpck_require__(16453);
15419
- ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler_caller.js
15420
-
15421
-
15422
-
15423
-
15424
-
15425
-
15426
-
15427
- (0,esm_assert/* assert */.h)();
15428
- function callHandlerIfAny(params) {
15429
- const { commandName, buildContext } = params;
15430
- if (!external_fs_.readdirSync((0,external_path_.dirname)(process.argv[1])).includes(BIN_NAME)) {
15431
- return;
15432
- }
15433
- try {
15434
- external_child_process_.execSync(`npx ${BIN_NAME}`, {
15435
- stdio: "inherit",
15436
- 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) })
15437
- });
15438
- }
15439
- catch (error) {
15440
- console.log(error.message);
15441
- console.log(error.status);
15442
- (0,esm_assert/* assert */.h)((0,is.is)(error));
15443
- if (error.code === NOT_IMPLEMENTED_EXIT_CODE) {
15444
- return;
15445
- }
15446
- process.exit(error.code);
15447
- }
15448
- process.exit(0);
15449
- }
15450
- //# sourceMappingURL=customHandler_caller.js.map
15451
15392
  // EXTERNAL MODULE: external "url"
15452
15393
  var external_url_ = __nccwpck_require__(57310);
15453
15394
  // EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
15454
15395
  var getAbsoluteAndInOsFormatPath = __nccwpck_require__(84794);
15455
15396
  // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
15456
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);
15457
15402
  // EXTERNAL MODULE: ./node_modules/tsafe/esm/exclude.mjs
15458
15403
  var exclude = __nccwpck_require__(83101);
15404
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
15405
+ var is = __nccwpck_require__(16453);
15459
15406
  ;// CONCATENATED MODULE: ./node_modules/tsafe/esm/index.mjs
15460
15407
 
15461
15408
 
@@ -15580,7 +15527,7 @@ function ensureSingleOrNone(arg0) {
15580
15527
 
15581
15528
 
15582
15529
 
15583
- (0,esm_assert/* assert */.h)();
15530
+ (0,assert/* assert */.h)();
15584
15531
  function getBuildContext(params) {
15585
15532
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15586
15533
  const projectDirPath = params.projectDirPath !== undefined
@@ -15632,7 +15579,7 @@ function getBuildContext(params) {
15632
15579
  env: Object.assign(Object.assign({}, process.env), { [constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG]: "true" })
15633
15580
  })
15634
15581
  .toString("utf8");
15635
- (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.");
15636
15583
  const resolvedViteConfigStr = output
15637
15584
  .split(constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.RESOLVE_VITE_CONFIG */.TE.RESOLVE_VITE_CONFIG)
15638
15585
  .reverse()[0];
@@ -15642,7 +15589,7 @@ function getBuildContext(params) {
15642
15589
  const packageJsonFilePath = (function getPackageJSonDirPath(upCount) {
15643
15590
  var _a, _b;
15644
15591
  const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
15645
- (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");
15646
15593
  success: {
15647
15594
  const packageJsonFilePath = (0,external_path_.join)(dirPath, "package.json");
15648
15595
  if (!external_fs_.existsSync(packageJsonFilePath)) {
@@ -15675,7 +15622,7 @@ function getBuildContext(params) {
15675
15622
  })
15676
15623
  .optional()
15677
15624
  });
15678
- (0,esm_assert/* assert */.h)();
15625
+ (0,assert/* assert */.h)();
15679
15626
  return (0,id.id)(zTargetType);
15680
15627
  })();
15681
15628
  const zSinglePageApp = (() => {
@@ -15690,12 +15637,12 @@ function getBuildContext(params) {
15690
15637
  })
15691
15638
  .optional()
15692
15639
  });
15693
- (0,esm_assert/* assert */.h)();
15640
+ (0,assert/* assert */.h)();
15694
15641
  return (0,id.id)(zTargetType);
15695
15642
  })();
15696
15643
  const zAccountThemeImplAndKeycloakVersionTargets = (() => {
15697
15644
  const zTargetType = lib.z.union([zMultiPageApp, zSinglePageApp]);
15698
- (0,esm_assert/* assert */.h)();
15645
+ (0,assert/* assert */.h)();
15699
15646
  return (0,id.id)(zTargetType);
15700
15647
  })();
15701
15648
  const zStartKeycloakOptions = (() => {
@@ -15707,7 +15654,7 @@ function getBuildContext(params) {
15707
15654
  keycloakExtraArgs: lib.z.array(lib.z.string()).optional(),
15708
15655
  port: lib.z.number().optional()
15709
15656
  });
15710
- (0,esm_assert/* assert */.h)();
15657
+ (0,assert/* assert */.h)();
15711
15658
  return (0,id.id)(zTargetType);
15712
15659
  })();
15713
15660
  const zBuildOptions = (() => {
@@ -15726,7 +15673,7 @@ function getBuildContext(params) {
15726
15673
  kcContextExclusionsFtl: lib.z.string().optional(),
15727
15674
  startKeycloakOptions: zStartKeycloakOptions.optional()
15728
15675
  }), zAccountThemeImplAndKeycloakVersionTargets);
15729
- (0,esm_assert/* assert */.h)();
15676
+ (0,assert/* assert */.h)();
15730
15677
  return (0,id.id)(zTargetType);
15731
15678
  })();
15732
15679
  const zBuildOptions_packageJson = (() => {
@@ -15735,7 +15682,7 @@ function getBuildContext(params) {
15735
15682
  staticDirPathInProjectBuildDirPath: lib.z.string().optional(),
15736
15683
  publicDirPath: lib.z.string().optional()
15737
15684
  }));
15738
- (0,esm_assert/* assert */.h)();
15685
+ (0,assert/* assert */.h)();
15739
15686
  return (0,id.id)(zTargetType);
15740
15687
  })();
15741
15688
  const zParsedPackageJson = (() => {
@@ -15745,7 +15692,7 @@ function getBuildContext(params) {
15745
15692
  homepage: lib.z.string().optional(),
15746
15693
  keycloakify: zBuildOptions_packageJson.optional()
15747
15694
  });
15748
- (0,esm_assert/* assert */.h)();
15695
+ (0,assert/* assert */.h)();
15749
15696
  return (0,id.id)(zTargetType);
15750
15697
  })();
15751
15698
  const configurationPackageJsonFilePath = (() => {
@@ -15764,13 +15711,13 @@ function getBuildContext(params) {
15764
15711
  const buildOptions = (() => {
15765
15712
  switch (bundler) {
15766
15713
  case "vite":
15767
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15714
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15768
15715
  return resolvedViteConfig.buildOptions;
15769
15716
  case "webpack":
15770
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15717
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15771
15718
  return parsedPackageJson.keycloakify;
15772
15719
  }
15773
- (0,esm_assert/* assert */.h)(false);
15720
+ (0,assert/* assert */.h)(false);
15774
15721
  })();
15775
15722
  const implementedThemeTypes = {
15776
15723
  login: {
@@ -15814,7 +15761,7 @@ function getBuildContext(params) {
15814
15761
  return [buildOptions.themeName];
15815
15762
  }
15816
15763
  const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
15817
- (0,esm_assert/* assert */.h)(mainThemeName !== undefined);
15764
+ (0,assert/* assert */.h)(mainThemeName !== undefined);
15818
15765
  return [mainThemeName, ...themeVariantNames];
15819
15766
  })();
15820
15767
  for (const themeName of themeNames) {
@@ -15833,7 +15780,7 @@ function getBuildContext(params) {
15833
15780
  if (bundler !== "webpack") {
15834
15781
  break webpack;
15835
15782
  }
15836
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15783
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15837
15784
  if (parsedPackageJson.keycloakify.projectBuildDirPath !== undefined) {
15838
15785
  return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
15839
15786
  pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
@@ -15842,8 +15789,8 @@ function getBuildContext(params) {
15842
15789
  }
15843
15790
  return (0,external_path_.join)(projectDirPath, "build");
15844
15791
  }
15845
- (0,esm_assert/* assert */.h)(bundler === "vite");
15846
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15792
+ (0,assert/* assert */.h)(bundler === "vite");
15793
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15847
15794
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
15848
15795
  })();
15849
15796
  return {
@@ -15885,7 +15832,7 @@ function getBuildContext(params) {
15885
15832
  if (bundler !== "webpack") {
15886
15833
  break webpack;
15887
15834
  }
15888
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15835
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15889
15836
  if (parsedPackageJson.keycloakify.publicDirPath !== undefined) {
15890
15837
  return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
15891
15838
  pathIsh: parsedPackageJson.keycloakify.publicDirPath,
@@ -15894,8 +15841,8 @@ function getBuildContext(params) {
15894
15841
  }
15895
15842
  return (0,external_path_.join)(projectDirPath, "public");
15896
15843
  }
15897
- (0,esm_assert/* assert */.h)(bundler === "vite");
15898
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15844
+ (0,assert/* assert */.h)(bundler === "vite");
15845
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15899
15846
  return (0,external_path_.join)(projectDirPath, resolvedViteConfig.publicDir);
15900
15847
  })(),
15901
15848
  cacheDirPath: (0,external_path_.join)((() => {
@@ -15923,8 +15870,8 @@ function getBuildContext(params) {
15923
15870
  const out = url.pathname.replace(/([^/])$/, "$1/");
15924
15871
  return out === "/" ? undefined : out;
15925
15872
  }
15926
- (0,esm_assert/* assert */.h)(bundler === "vite");
15927
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15873
+ (0,assert/* assert */.h)(bundler === "vite");
15874
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15928
15875
  return resolvedViteConfig.urlPathname;
15929
15876
  })(),
15930
15877
  assetsDirPath: (() => {
@@ -15932,7 +15879,7 @@ function getBuildContext(params) {
15932
15879
  if (bundler !== "webpack") {
15933
15880
  break webpack;
15934
15881
  }
15935
- (0,esm_assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15882
+ (0,assert/* assert */.h)(parsedPackageJson.keycloakify !== undefined);
15936
15883
  if (parsedPackageJson.keycloakify.staticDirPathInProjectBuildDirPath !==
15937
15884
  undefined) {
15938
15885
  (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
@@ -15943,8 +15890,8 @@ function getBuildContext(params) {
15943
15890
  }
15944
15891
  return (0,external_path_.join)(projectBuildDirPath, "static");
15945
15892
  }
15946
- (0,esm_assert/* assert */.h)(bundler === "vite");
15947
- (0,esm_assert/* assert */.h)(resolvedViteConfig !== undefined);
15893
+ (0,assert/* assert */.h)(bundler === "vite");
15894
+ (0,assert/* assert */.h)(resolvedViteConfig !== undefined);
15948
15895
  return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
15949
15896
  })(),
15950
15897
  kcContextExclusionsFtlCode: (() => {
@@ -15966,7 +15913,7 @@ function getBuildContext(params) {
15966
15913
  fetchOptions: getProxyFetchOptions({
15967
15914
  npmConfigGetCwd: (function callee(upCount) {
15968
15915
  const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
15969
- (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'");
15970
15917
  try {
15971
15918
  external_child_process_.execSync("npm config get", {
15972
15919
  cwd: dirPath,
@@ -15991,7 +15938,7 @@ function getBuildContext(params) {
15991
15938
  return undefined;
15992
15939
  }
15993
15940
  const major = parseInt(envValue);
15994
- (0,esm_assert/* assert */.h)(!isNaN(major));
15941
+ (0,assert/* assert */.h)(!isNaN(major));
15995
15942
  return major;
15996
15943
  })();
15997
15944
  if (buildForKeycloakMajorVersionNumber === undefined) {
@@ -16004,7 +15951,7 @@ function getBuildContext(params) {
16004
15951
  if (buildForKeycloakMajorVersionNumber <= 21) {
16005
15952
  return "21-and-below";
16006
15953
  }
16007
- (0,esm_assert/* assert */.h)(buildForKeycloakMajorVersionNumber !== 22);
15954
+ (0,assert/* assert */.h)(buildForKeycloakMajorVersionNumber !== 22);
16008
15955
  if (buildForKeycloakMajorVersionNumber === 23) {
16009
15956
  return "23";
16010
15957
  }
@@ -16016,7 +15963,7 @@ function getBuildContext(params) {
16016
15963
  }
16017
15964
  return "26-and-above";
16018
15965
  })();
16019
- (0,esm_assert/* assert */.h)();
15966
+ (0,assert/* assert */.h)();
16020
15967
  return keycloakVersionRange;
16021
15968
  }
16022
15969
  else {
@@ -16027,14 +15974,14 @@ function getBuildContext(params) {
16027
15974
  }
16028
15975
  return "22-to-25";
16029
15976
  })();
16030
- (0,esm_assert/* assert */.h)();
15977
+ (0,assert/* assert */.h)();
16031
15978
  return keycloakVersionRange;
16032
15979
  }
16033
15980
  })();
16034
15981
  const jarFileBasename = (() => {
16035
15982
  use_custom_jar_basename: {
16036
15983
  const { keycloakVersionTargets } = buildOptions;
16037
- (0,esm_assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
15984
+ (0,assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16038
15985
  if (keycloakVersionTargets === undefined) {
16039
15986
  break use_custom_jar_basename;
16040
15987
  }
@@ -16068,7 +16015,7 @@ function getBuildContext(params) {
16068
16015
  "25",
16069
16016
  "26-and-above"
16070
16017
  ]) {
16071
- (0,esm_assert/* assert */.h)(true);
16018
+ (0,assert/* assert */.h)(true);
16072
16019
  jarTargets.push({
16073
16020
  keycloakVersionRange,
16074
16021
  jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
@@ -16080,7 +16027,7 @@ function getBuildContext(params) {
16080
16027
  "22-to-25",
16081
16028
  "all-other-versions"
16082
16029
  ]) {
16083
- (0,esm_assert/* assert */.h)(true);
16030
+ (0,assert/* assert */.h)(true);
16084
16031
  jarTargets.push({
16085
16032
  keycloakVersionRange,
16086
16033
  jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
@@ -16095,7 +16042,7 @@ function getBuildContext(params) {
16095
16042
  const jarTargets = [];
16096
16043
  for (const [keycloakVersionRange, jarNameOrBoolean] of (0,objectEntries/* objectEntries */.q)((() => {
16097
16044
  const { keycloakVersionTargets } = buildOptions;
16098
- (0,esm_assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16045
+ (0,assert/* assert */.h)((0,is.is)(keycloakVersionTargets));
16099
16046
  return keycloakVersionTargets;
16100
16047
  })())) {
16101
16048
  if (jarNameOrBoolean === false) {
@@ -16139,7 +16086,7 @@ function getBuildContext(params) {
16139
16086
  return undefined;
16140
16087
  }
16141
16088
  const [reference, tag, ...rest] = buildOptions.startKeycloakOptions.dockerImage.split(":");
16142
- (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}`);
16143
16090
  return { reference, tag };
16144
16091
  })(),
16145
16092
  dockerExtraArgs: (_g = (_f = buildOptions.startKeycloakOptions) === null || _f === void 0 ? void 0 : _f.dockerExtraArgs) !== null && _g !== void 0 ? _g : [],
@@ -16173,7 +16120,6 @@ function getBuildContext(params) {
16173
16120
 
16174
16121
 
16175
16122
 
16176
-
16177
16123
  assertNoPnpmDlx();
16178
16124
  const program = Z({
16179
16125
  name: "keycloakify",
@@ -16217,118 +16163,97 @@ program
16217
16163
  .task({
16218
16164
  skip,
16219
16165
  handler: async ({ projectDirPath }) => {
16220
- const buildContext = getBuildContext({ projectDirPath });
16221
16166
  const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(783), __nccwpck_require__.e(573)]).then(__nccwpck_require__.bind(__nccwpck_require__, 82573));
16222
- 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 }) });
16223
16255
  }
16224
16256
  });
16225
- {
16226
- const commandName = "start-keycloak";
16227
- program
16228
- .command({
16229
- name: commandName,
16230
- description: "Spin up a pre configured Docker image of Keycloak to test your theme."
16231
- })
16232
- .option({
16233
- key: "port",
16234
- name: (() => {
16235
- const name = "port";
16236
- optionsKeys.push(name);
16237
- return name;
16238
- })(),
16239
- description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
16240
- defaultValue: undefined
16241
- })
16242
- .option({
16243
- key: "keycloakVersion",
16244
- name: (() => {
16245
- const name = "keycloak-version";
16246
- optionsKeys.push(name);
16247
- return name;
16248
- })(),
16249
- description: [
16250
- "Use a specific version of Keycloak.",
16251
- "Example `--keycloak-version 21.1.1`"
16252
- ].join(" "),
16253
- defaultValue: undefined
16254
- })
16255
- .option({
16256
- key: "realmJsonFilePath",
16257
- name: (() => {
16258
- const name = "import";
16259
- optionsKeys.push(name);
16260
- return name;
16261
- })(),
16262
- defaultValue: undefined,
16263
- description: [
16264
- "Import your own realm configuration file",
16265
- "Example `--import path/to/myrealm-realm.json`"
16266
- ].join(" ")
16267
- })
16268
- .task({
16269
- skip,
16270
- handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16271
- const buildContext = getBuildContext({ projectDirPath });
16272
- 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));
16273
- await command({
16274
- buildContext,
16275
- cliCommandOptions: { keycloakVersion, port, realmJsonFilePath }
16276
- });
16277
- }
16278
- });
16279
- }
16280
- {
16281
- const commandName = "eject-page";
16282
- program
16283
- .command({
16284
- name: commandName,
16285
- description: "Eject a Keycloak page."
16286
- })
16287
- .task({
16288
- skip,
16289
- handler: async ({ projectDirPath }) => {
16290
- const buildContext = getBuildContext({ projectDirPath });
16291
- console.log("before callHandlerIfAny");
16292
- callHandlerIfAny({ buildContext, commandName });
16293
- console.log("after callHandlerIfAny");
16294
- const { command } = await __nccwpck_require__.e(/* import() */ 453).then(__nccwpck_require__.bind(__nccwpck_require__, 93453));
16295
- await command({ buildContext });
16296
- }
16297
- });
16298
- }
16299
- {
16300
- const commandName = "add-story";
16301
- program
16302
- .command({
16303
- name: commandName,
16304
- description: "Add *.stories.tsx file for a specific page to in your Storybook."
16305
- })
16306
- .task({
16307
- skip,
16308
- handler: async ({ projectDirPath }) => {
16309
- const buildContext = getBuildContext({ projectDirPath });
16310
- callHandlerIfAny({ buildContext, commandName });
16311
- const { command } = await __nccwpck_require__.e(/* import() */ 97).then(__nccwpck_require__.bind(__nccwpck_require__, 98097));
16312
- await command({ buildContext });
16313
- }
16314
- });
16315
- }
16316
- {
16317
- const comandName = "initialize-login-theme";
16318
- program
16319
- .command({
16320
- name: comandName,
16321
- description: "Initialize an email theme."
16322
- })
16323
- .task({
16324
- skip,
16325
- handler: async ({ projectDirPath }) => {
16326
- const buildContext = getBuildContext({ projectDirPath });
16327
- 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));
16328
- await command({ buildContext });
16329
- }
16330
- });
16331
- }
16332
16257
  program
16333
16258
  .command({
16334
16259
  name: "initialize-account-theme",
@@ -16337,44 +16262,34 @@ program
16337
16262
  .task({
16338
16263
  skip,
16339
16264
  handler: async ({ projectDirPath }) => {
16340
- const buildContext = getBuildContext({ projectDirPath });
16341
16265
  const { command } = await __nccwpck_require__.e(/* import() */ 780).then(__nccwpck_require__.bind(__nccwpck_require__, 75780));
16342
- 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() */ 61).then(__nccwpck_require__.bind(__nccwpck_require__, 13061));
16290
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16343
16291
  }
16344
16292
  });
16345
- {
16346
- const commandName = "copy-keycloak-resources-to-public";
16347
- program
16348
- .command({
16349
- name: commandName,
16350
- description: "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
16351
- })
16352
- .task({
16353
- skip,
16354
- handler: async ({ projectDirPath }) => {
16355
- const buildContext = getBuildContext({ projectDirPath });
16356
- const { command } = await __nccwpck_require__.e(/* import() */ 193).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
16357
- await command({ buildContext });
16358
- }
16359
- });
16360
- }
16361
- {
16362
- const commandName = "update-kc-gen";
16363
- program
16364
- .command({
16365
- name: commandName,
16366
- description: "(Webpack/Create-React-App only) Create/update the kc.gen.ts file in your project."
16367
- })
16368
- .task({
16369
- skip,
16370
- handler: async ({ projectDirPath }) => {
16371
- const buildContext = getBuildContext({ projectDirPath });
16372
- callHandlerIfAny({ buildContext, commandName });
16373
- const { command } = await __nccwpck_require__.e(/* import() */ 786).then(__nccwpck_require__.bind(__nccwpck_require__, 10786));
16374
- await command({ buildContext });
16375
- }
16376
- });
16377
- }
16378
16293
  // Fallback to build command if no command is provided
16379
16294
  {
16380
16295
  const [, , ...rest] = process.argv;
@@ -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.3",
3
+ "version": "11.3.0-rc.6",
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",
@@ -1062,11 +1060,11 @@
1062
1060
  "bin/526.index.js",
1063
1061
  "bin/573.index.js",
1064
1062
  "bin/599.index.js",
1063
+ "bin/61.index.js",
1065
1064
  "bin/720.index.js",
1066
1065
  "bin/743.index.js",
1067
1066
  "bin/780.index.js",
1068
1067
  "bin/783.index.js",
1069
- "bin/786.index.js",
1070
1068
  "bin/877.index.js",
1071
1069
  "bin/903.index.js",
1072
1070
  "bin/932.index.js",