keycloakify 10.0.0-rc.44 → 10.0.0-rc.46

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 (35) hide show
  1. package/bin/{322.index.js → 190.index.js} +58 -61
  2. package/bin/193.index.js +0 -51
  3. package/bin/3.index.js +93 -96
  4. package/bin/526.index.js +80 -49
  5. package/bin/538.index.js +5 -3
  6. package/bin/932.index.js +535 -1
  7. package/bin/98.index.js +5 -3
  8. package/bin/{944.index.js → 991.index.js} +74 -5
  9. package/bin/main.js +4 -16
  10. package/bin/shared/buildContext.d.ts +1 -1
  11. package/bin/shared/constants.d.ts +1 -1
  12. package/bin/shared/constants.js +1 -1
  13. package/bin/shared/constants.js.map +1 -1
  14. package/package.json +3 -6
  15. package/src/bin/keycloakify/buildJars/buildJar.ts +9 -21
  16. package/src/bin/keycloakify/buildJars/buildJars.ts +15 -4
  17. package/src/bin/keycloakify/buildJars/extensionVersions.ts +1 -1
  18. package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +9 -2
  19. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +6 -7
  20. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +11 -3
  21. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +6 -18
  22. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +9 -15
  23. package/src/bin/keycloakify/keycloakify.ts +20 -9
  24. package/src/bin/main.ts +0 -14
  25. package/src/bin/shared/KeycloakVersionRange.ts +1 -1
  26. package/src/bin/shared/buildContext.ts +7 -3
  27. package/src/bin/shared/constants.ts +1 -1
  28. package/src/bin/shared/metaInfKeycloakThemes.ts +37 -14
  29. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  30. package/src/bin/start-keycloak/start-keycloak.ts +62 -67
  31. package/src/vite-plugin/vite-plugin.ts +4 -0
  32. package/vite-plugin/index.js +6 -3
  33. package/bin/961.index.js +0 -263
  34. package/src/bin/download-keycloak-default-theme.ts +0 -63
  35. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +0 -74
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 944;
3
- exports.ids = [944];
2
+ exports.id = 991;
3
+ exports.ids = [991];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 87751:
@@ -156,7 +156,9 @@ function getBuildContext(params) {
156
156
  if (typeof buildOptions.themeName === "string") {
157
157
  return [buildOptions.themeName];
158
158
  }
159
- return buildOptions.themeName;
159
+ const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
160
+ (0,tsafe.assert)(mainThemeName !== undefined);
161
+ return [mainThemeName, ...themeVariantNames];
160
162
  })();
161
163
  const projectBuildDirPath = (() => {
162
164
  var _a;
@@ -285,6 +287,7 @@ function getBuildContext(params) {
285
287
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
286
288
 
287
289
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
290
+ /* harmony export */ "Dv": () => (/* binding */ onlyBuildJarFileBasenameEnvName),
288
291
  /* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
289
292
  /* harmony export */ "N$": () => (/* binding */ keycloak_resources),
290
293
  /* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
@@ -294,7 +297,6 @@ function getBuildContext(params) {
294
297
  /* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
295
298
  /* harmony export */ "rO": () => (/* binding */ themeTypes),
296
299
  /* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
297
- /* harmony export */ "uo": () => (/* binding */ skipBuildJarsEnvName),
298
300
  /* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
299
301
  /* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
300
302
  /* harmony export */ "z0": () => (/* binding */ resources_common)
@@ -311,7 +313,7 @@ const vitePluginSubScriptEnvNames = {
311
313
  runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
312
314
  resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
313
315
  };
314
- const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
316
+ const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
315
317
  const loginThemePageIds = [
316
318
  "login.ftl",
317
319
  "login-username.ftl",
@@ -587,6 +589,56 @@ async function existsAsync(path) {
587
589
 
588
590
  /***/ }),
589
591
 
592
+ /***/ 8699:
593
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
594
+
595
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
596
+ /* harmony export */ "rm": () => (/* binding */ rm)
597
+ /* harmony export */ });
598
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
599
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
600
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
601
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
602
+ /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
603
+
604
+
605
+
606
+ /**
607
+ * Polyfill of fs.rm(dirPath, { "recursive": true })
608
+ * For older version of Node
609
+ */
610
+ async function rm(dirPath, options) {
611
+ if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
612
+ return fs_promises__WEBPACK_IMPORTED_MODULE_0__.rm(dirPath, options);
613
+ }
614
+ const { force = true } = options;
615
+ if (force && !(await checkDirExists(dirPath))) {
616
+ return;
617
+ }
618
+ const removeDir_rec = async (dirPath) => Promise.all((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readdir(dirPath)).map(async (basename) => {
619
+ const fileOrDirpath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
620
+ if ((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.lstat(fileOrDirpath)).isDirectory()) {
621
+ await removeDir_rec(fileOrDirpath);
622
+ }
623
+ else {
624
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0__.unlink(fileOrDirpath);
625
+ }
626
+ }));
627
+ await removeDir_rec(dirPath);
628
+ }
629
+ async function checkDirExists(dirPath) {
630
+ try {
631
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(dirPath, fs_promises__WEBPACK_IMPORTED_MODULE_0__.constants.F_OK);
632
+ return true;
633
+ }
634
+ catch (_a) {
635
+ return false;
636
+ }
637
+ }
638
+ //# sourceMappingURL=fs.rm.js.map
639
+
640
+ /***/ }),
641
+
590
642
  /***/ 86644:
591
643
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
592
644
 
@@ -615,6 +667,23 @@ function getAbsoluteAndInOsFormatPath(params) {
615
667
  }
616
668
  //# sourceMappingURL=getAbsoluteAndInOsFormatPath.js.map
617
669
 
670
+ /***/ }),
671
+
672
+ /***/ 90665:
673
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
674
+
675
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
676
+ /* harmony export */ "V": () => (/* binding */ isInside)
677
+ /* harmony export */ });
678
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
679
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
680
+
681
+ function isInside(params) {
682
+ const { dirPath, filePath } = params;
683
+ return !(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(dirPath, filePath).startsWith("..");
684
+ }
685
+ //# sourceMappingURL=isInside.js.map
686
+
618
687
  /***/ })
619
688
 
620
689
  };
package/bin/main.js CHANGED
@@ -9213,7 +9213,7 @@ program
9213
9213
  .task({
9214
9214
  skip,
9215
9215
  handler: async (cliCommandOptions) => {
9216
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(818), __nccwpck_require__.e(525), __nccwpck_require__.e(246), __nccwpck_require__.e(944), __nccwpck_require__.e(322), __nccwpck_require__.e(3)]).then(__nccwpck_require__.bind(__nccwpck_require__, 56003));
9216
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(818), __nccwpck_require__.e(525), __nccwpck_require__.e(246), __nccwpck_require__.e(991), __nccwpck_require__.e(190), __nccwpck_require__.e(3)]).then(__nccwpck_require__.bind(__nccwpck_require__, 56003));
9217
9217
  await command({ cliCommandOptions });
9218
9218
  }
9219
9219
  });
@@ -9261,19 +9261,7 @@ program
9261
9261
  .task({
9262
9262
  skip,
9263
9263
  handler: async (cliCommandOptions) => {
9264
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(818), __nccwpck_require__.e(180), __nccwpck_require__.e(36), __nccwpck_require__.e(944), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
9265
- await command({ cliCommandOptions });
9266
- }
9267
- });
9268
- program
9269
- .command({
9270
- name: "download-keycloak-default-theme",
9271
- description: "Download the built-in Keycloak theme."
9272
- })
9273
- .task({
9274
- skip,
9275
- handler: async (cliCommandOptions) => {
9276
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(818), __nccwpck_require__.e(525), __nccwpck_require__.e(180), __nccwpck_require__.e(944), __nccwpck_require__.e(322), __nccwpck_require__.e(961)]).then(__nccwpck_require__.bind(__nccwpck_require__, 27961));
9264
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(818), __nccwpck_require__.e(180), __nccwpck_require__.e(36), __nccwpck_require__.e(991), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
9277
9265
  await command({ cliCommandOptions });
9278
9266
  }
9279
9267
  });
@@ -9309,7 +9297,7 @@ program
9309
9297
  .task({
9310
9298
  skip,
9311
9299
  handler: async (cliCommandOptions) => {
9312
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(525), __nccwpck_require__.e(180), __nccwpck_require__.e(944), __nccwpck_require__.e(322), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
9300
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(525), __nccwpck_require__.e(180), __nccwpck_require__.e(991), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
9313
9301
  await command({ cliCommandOptions });
9314
9302
  }
9315
9303
  });
@@ -9321,7 +9309,7 @@ program
9321
9309
  .task({
9322
9310
  skip,
9323
9311
  handler: async (cliCommandOptions) => {
9324
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(525), __nccwpck_require__.e(944), __nccwpck_require__.e(322), __nccwpck_require__.e(193)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
9312
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(941), __nccwpck_require__.e(214), __nccwpck_require__.e(525), __nccwpck_require__.e(991), __nccwpck_require__.e(190), __nccwpck_require__.e(193)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
9325
9313
  await command({ cliCommandOptions });
9326
9314
  }
9327
9315
  });
@@ -2,7 +2,7 @@ import type { CliCommandOptions } from "../main";
2
2
  export type BuildContext = {
3
3
  bundler: "vite" | "webpack";
4
4
  themeVersion: string;
5
- themeNames: string[];
5
+ themeNames: [string, ...string[]];
6
6
  extraThemeProperties: string[] | undefined;
7
7
  groupId: string;
8
8
  artifactId: string;
@@ -11,7 +11,7 @@ export declare const vitePluginSubScriptEnvNames: {
11
11
  readonly runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT";
12
12
  readonly resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG";
13
13
  };
14
- export declare const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
14
+ export declare const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
15
15
  export declare const loginThemePageIds: readonly ["login.ftl", "login-username.ftl", "login-password.ftl", "webauthn-authenticate.ftl", "webauthn-register.ftl", "register.ftl", "info.ftl", "error.ftl", "login-reset-password.ftl", "login-verify-email.ftl", "terms.ftl", "login-oauth2-device-verify-user-code.ftl", "login-oauth-grant.ftl", "login-otp.ftl", "login-update-profile.ftl", "login-update-password.ftl", "login-idp-link-confirm.ftl", "login-idp-link-email.ftl", "login-page-expired.ftl", "login-config-totp.ftl", "logout-confirm.ftl", "idp-review-user-profile.ftl", "update-email.ftl", "select-authenticator.ftl", "saml-post-form.ftl", "delete-credential.ftl", "code.ftl", "delete-account-confirm.ftl", "frontchannel-logout.ftl", "login-recovery-authn-code-config.ftl", "login-recovery-authn-code-input.ftl", "login-reset-otp.ftl", "login-x509-info.ftl", "webauthn-error.ftl"];
16
16
  export declare const accountThemePageIds: readonly ["password.ftl", "account.ftl", "sessions.ftl", "totp.ftl", "applications.ftl", "log.ftl", "federatedIdentity.ftl"];
17
17
  export type LoginThemePageId = (typeof loginThemePageIds)[number];
@@ -10,7 +10,7 @@ export const vitePluginSubScriptEnvNames = {
10
10
  runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
11
11
  resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
12
12
  };
13
- export const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
13
+ export const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
14
14
  export const loginThemePageIds = [
15
15
  "login.ftl",
16
16
  "login-username.ftl",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/bin/shared/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,MAAM,CAAC,MAAM,sDAAsD,GAC/D,yCAAyC,CAAC;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,gCAAgC,GAAG,QAAQ,CAAC;AACzD,MAAM,CAAC,MAAM,oCAAoC,GAAG,OAAO,CAAC;AAE5D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAI/C,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,kBAAkB,EAAE,mCAAmC;IACvD,iBAAiB,EAAE,iCAAiC;CAC9C,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,WAAW;IACX,oBAAoB;IACpB,oBAAoB;IACpB,2BAA2B;IAC3B,uBAAuB;IACvB,cAAc;IACd,UAAU;IACV,WAAW;IACX,0BAA0B;IAC1B,wBAAwB;IACxB,WAAW;IACX,0CAA0C;IAC1C,uBAAuB;IACvB,eAAe;IACf,0BAA0B;IAC1B,2BAA2B;IAC3B,4BAA4B;IAC5B,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;IACvB,oBAAoB;IACpB,6BAA6B;IAC7B,kBAAkB;IAClB,0BAA0B;IAC1B,oBAAoB;IACpB,uBAAuB;IACvB,UAAU;IACV,4BAA4B;IAC5B,yBAAyB;IACzB,sCAAsC;IACtC,qCAAqC;IACrC,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;CACd,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,cAAc;IACd,aAAa;IACb,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,SAAS;IACT,uBAAuB;CACjB,CAAC;AAKX,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/bin/shared/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,MAAM,CAAC,MAAM,sDAAsD,GAC/D,yCAAyC,CAAC;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,gCAAgC,GAAG,QAAQ,CAAC;AACzD,MAAM,CAAC,MAAM,oCAAoC,GAAG,OAAO,CAAC;AAE5D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAI/C,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,kBAAkB,EAAE,mCAAmC;IACvD,iBAAiB,EAAE,iCAAiC;CAC9C,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG,0CAA0C,CAAC;AAE1F,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,WAAW;IACX,oBAAoB;IACpB,oBAAoB;IACpB,2BAA2B;IAC3B,uBAAuB;IACvB,cAAc;IACd,UAAU;IACV,WAAW;IACX,0BAA0B;IAC1B,wBAAwB;IACxB,WAAW;IACX,0CAA0C;IAC1C,uBAAuB;IACvB,eAAe;IACf,0BAA0B;IAC1B,2BAA2B;IAC3B,4BAA4B;IAC5B,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;IACvB,oBAAoB;IACpB,6BAA6B;IAC7B,kBAAkB;IAClB,0BAA0B;IAC1B,oBAAoB;IACpB,uBAAuB;IACvB,UAAU;IACV,4BAA4B;IAC5B,yBAAyB;IACzB,sCAAsC;IACtC,qCAAqC;IACrC,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;CACd,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,cAAc;IACd,aAAa;IACb,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,SAAS;IACT,uBAAuB;CACjB,CAAC;AAKX,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "10.0.0-rc.44",
3
+ "version": "10.0.0-rc.46",
4
4
  "description": "Create Keycloak themes using React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -453,7 +453,6 @@
453
453
  "src/account/pages/Totp.tsx",
454
454
  "src/bin/add-story.ts",
455
455
  "src/bin/copy-keycloak-resources-to-public.ts",
456
- "src/bin/download-keycloak-default-theme.ts",
457
456
  "src/bin/eject-page.ts",
458
457
  "src/bin/initialize-email-theme.ts",
459
458
  "src/bin/keycloakify/buildJars/buildJar.ts",
@@ -473,7 +472,6 @@
473
472
  "src/bin/keycloakify/generateSrcMainResources/index.ts",
474
473
  "src/bin/keycloakify/generateSrcMainResources/readExtraPageNames.ts",
475
474
  "src/bin/keycloakify/generateSrcMainResources/readFieldNameUsage.ts",
476
- "src/bin/keycloakify/generateStartKeycloakTestingContainer.ts",
477
475
  "src/bin/keycloakify/index.ts",
478
476
  "src/bin/keycloakify/keycloakify.ts",
479
477
  "src/bin/keycloakify/replacers/replaceImportsInCssCode.ts",
@@ -764,11 +762,11 @@
764
762
  "tools/useSetClassName.js.map",
765
763
  "bin/main.js",
766
764
  "bin/180.index.js",
765
+ "bin/190.index.js",
767
766
  "bin/193.index.js",
768
767
  "bin/214.index.js",
769
768
  "bin/246.index.js",
770
769
  "bin/3.index.js",
771
- "bin/322.index.js",
772
770
  "bin/36.index.js",
773
771
  "bin/420.index.js",
774
772
  "bin/453.index.js",
@@ -781,10 +779,9 @@
781
779
  "bin/818.index.js",
782
780
  "bin/932.index.js",
783
781
  "bin/941.index.js",
784
- "bin/944.index.js",
785
- "bin/961.index.js",
786
782
  "bin/97.index.js",
787
783
  "bin/98.index.js",
784
+ "bin/991.index.js",
788
785
  "bin/shared/constants.js",
789
786
  "bin/shared/constants.d.ts",
790
787
  "bin/shared/constants.js.map",
@@ -32,12 +32,14 @@ export async function buildJar(params: {
32
32
  jarFileBasename: string;
33
33
  keycloakAccountV1Version: KeycloakAccountV1Version;
34
34
  keycloakThemeAdditionalInfoExtensionVersion: KeycloakThemeAdditionalInfoExtensionVersion;
35
+ resourcesDirPath: string;
35
36
  buildContext: BuildContextLike;
36
37
  }): Promise<void> {
37
38
  const {
38
39
  jarFileBasename,
39
40
  keycloakAccountV1Version,
40
41
  keycloakThemeAdditionalInfoExtensionVersion,
42
+ resourcesDirPath,
41
43
  buildContext
42
44
  } = params;
43
45
 
@@ -57,7 +59,7 @@ export async function buildJar(params: {
57
59
 
58
60
  if (
59
61
  fileRelativePath ===
60
- getMetaInfKeycloakThemesJsonFilePath({ keycloakifyBuildDirPath: "." })
62
+ getMetaInfKeycloakThemesJsonFilePath({ resourcesDirPath: "." })
61
63
  ) {
62
64
  return { modifiedSourceCode: sourceCode };
63
65
  }
@@ -65,7 +67,7 @@ export async function buildJar(params: {
65
67
  for (const themeName of [...buildContext.themeNames, accountV1ThemeName]) {
66
68
  if (
67
69
  isInside({
68
- dirPath: pathJoin("src", "main", "resources", "theme", themeName),
70
+ dirPath: pathJoin("theme", themeName),
69
71
  filePath: fileRelativePath
70
72
  })
71
73
  ) {
@@ -87,13 +89,7 @@ export async function buildJar(params: {
87
89
 
88
90
  if (
89
91
  isInside({
90
- dirPath: pathJoin(
91
- "src",
92
- "main",
93
- "resources",
94
- "theme",
95
- accountV1ThemeName
96
- ),
92
+ dirPath: pathJoin("theme", accountV1ThemeName),
97
93
  filePath: fileRelativePath
98
94
  })
99
95
  ) {
@@ -103,7 +99,7 @@ export async function buildJar(params: {
103
99
  if (
104
100
  fileRelativePath ===
105
101
  getMetaInfKeycloakThemesJsonFilePath({
106
- keycloakifyBuildDirPath: "."
102
+ resourcesDirPath: "."
107
103
  })
108
104
  ) {
109
105
  const keycloakThemesJsonParsed = JSON.parse(
@@ -128,15 +124,7 @@ export async function buildJar(params: {
128
124
  for (const themeName of buildContext.themeNames) {
129
125
  if (
130
126
  fileRelativePath ===
131
- pathJoin(
132
- "src",
133
- "main",
134
- "resources",
135
- "theme",
136
- themeName,
137
- "account",
138
- "theme.properties"
139
- )
127
+ pathJoin("theme", themeName, "account", "theme.properties")
140
128
  ) {
141
129
  const modifiedSourceCode = Buffer.from(
142
130
  sourceCode
@@ -160,8 +148,8 @@ export async function buildJar(params: {
160
148
  };
161
149
 
162
150
  transformCodebase({
163
- srcDirPath: buildContext.keycloakifyBuildDirPath,
164
- destDirPath: keycloakifyBuildTmpDirPath,
151
+ srcDirPath: resourcesDirPath,
152
+ destDirPath: pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
165
153
  transformSourceCode: params => {
166
154
  const resultCommon = transformCodebase_common(params);
167
155
 
@@ -8,7 +8,7 @@ import { getKeycloakVersionRangeForJar } from "./getKeycloakVersionRangeForJar";
8
8
  import { buildJar, BuildContextLike as BuildContextLike_buildJar } from "./buildJar";
9
9
  import type { BuildContext } from "../../shared/buildContext";
10
10
  import { getJarFileBasename } from "../../shared/getJarFileBasename";
11
- import { readMetaInfKeycloakThemes } from "../../shared/metaInfKeycloakThemes";
11
+ import { readMetaInfKeycloakThemes_fromResourcesDirPath } from "../../shared/metaInfKeycloakThemes";
12
12
  import { accountV1ThemeName } from "../../shared/constants";
13
13
 
14
14
  export type BuildContextLike = BuildContextLike_buildJar & {
@@ -18,12 +18,14 @@ export type BuildContextLike = BuildContextLike_buildJar & {
18
18
  assert<BuildContext extends BuildContextLike ? true : false>();
19
19
 
20
20
  export async function buildJars(params: {
21
+ resourcesDirPath: string;
22
+ onlyBuildJarFileBasename: string | undefined;
21
23
  buildContext: BuildContextLike;
22
24
  }): Promise<void> {
23
- const { buildContext } = params;
25
+ const { onlyBuildJarFileBasename, resourcesDirPath, buildContext } = params;
24
26
 
25
- const doesImplementAccountTheme = readMetaInfKeycloakThemes({
26
- keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
27
+ const doesImplementAccountTheme = readMetaInfKeycloakThemes_fromResourcesDirPath({
28
+ resourcesDirPath
27
29
  }).themes.some(({ name }) => name === accountV1ThemeName);
28
30
 
29
31
  await Promise.all(
@@ -56,12 +58,20 @@ export async function buildJars(params: {
56
58
  keycloakVersionRange
57
59
  });
58
60
 
61
+ if (
62
+ onlyBuildJarFileBasename !== undefined &&
63
+ onlyBuildJarFileBasename !== jarFileBasename
64
+ ) {
65
+ return undefined;
66
+ }
67
+
59
68
  return {
60
69
  keycloakThemeAdditionalInfoExtensionVersion,
61
70
  jarFileBasename
62
71
  };
63
72
  }
64
73
  )
74
+ .filter(exclude(undefined))
65
75
  .map(
66
76
  ({
67
77
  keycloakThemeAdditionalInfoExtensionVersion,
@@ -71,6 +81,7 @@ export async function buildJars(params: {
71
81
  jarFileBasename,
72
82
  keycloakAccountV1Version,
73
83
  keycloakThemeAdditionalInfoExtensionVersion,
84
+ resourcesDirPath,
74
85
  buildContext
75
86
  })
76
87
  )
@@ -1,5 +1,5 @@
1
1
  // NOTE: v0.5 is a dummy version.
2
- export const keycloakAccountV1Versions = [null, "0.3", "0.4"] as const;
2
+ export const keycloakAccountV1Versions = [null, "0.3", "0.4", "0.6"] as const;
3
3
 
4
4
  /**
5
5
  * https://central.sonatype.com/artifact/io.phasetwo.keycloak/keycloak-account-v1
@@ -44,12 +44,20 @@ export function getKeycloakVersionRangeForJar(params: {
44
44
  case null:
45
45
  return undefined;
46
46
  case "1.1.5":
47
- return "24-and-above" as const;
47
+ return "24" as const;
48
48
  }
49
49
  assert<
50
50
  Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>
51
51
  >(false);
52
+ case "0.6":
53
+ switch (keycloakThemeAdditionalInfoExtensionVersion) {
54
+ case null:
55
+ return undefined;
56
+ case "1.1.5":
57
+ return "25-and-above" as const;
58
+ }
52
59
  }
60
+ assert<Equals<typeof keycloakAccountV1Version, never>>(false);
53
61
  })();
54
62
 
55
63
  assert<
@@ -65,7 +73,6 @@ export function getKeycloakVersionRangeForJar(params: {
65
73
  if (keycloakAccountV1Version !== null) {
66
74
  return undefined;
67
75
  }
68
-
69
76
  switch (keycloakThemeAdditionalInfoExtensionVersion) {
70
77
  case null:
71
78
  return "21-and-below";
@@ -13,13 +13,15 @@ import { transformCodebase } from "../../tools/transformCodebase";
13
13
  export type BuildContextLike = {
14
14
  cacheDirPath: string;
15
15
  npmWorkspaceRootDirPath: string;
16
- keycloakifyBuildDirPath: string;
17
16
  };
18
17
 
19
18
  assert<BuildContext extends BuildContextLike ? true : false>();
20
19
 
21
- export async function bringInAccountV1(params: { buildContext: BuildContextLike }) {
22
- const { buildContext } = params;
20
+ export async function bringInAccountV1(params: {
21
+ resourcesDirPath: string;
22
+ buildContext: BuildContextLike;
23
+ }) {
24
+ const { resourcesDirPath, buildContext } = params;
23
25
 
24
26
  const { defaultThemeDirPath } = await downloadKeycloakDefaultTheme({
25
27
  keycloakVersion: lastKeycloakVersionWithAccountV1,
@@ -27,10 +29,7 @@ export async function bringInAccountV1(params: { buildContext: BuildContextLike
27
29
  });
28
30
 
29
31
  const accountV1DirPath = pathJoin(
30
- buildContext.keycloakifyBuildDirPath,
31
- "src",
32
- "main",
33
- "resources",
32
+ resourcesDirPath,
34
33
  "theme",
35
34
  accountV1ThemeName,
36
35
  "account"
@@ -5,6 +5,8 @@ import {
5
5
  type BuildContextLike as BuildContextLike_generateSrcMainResourcesForMainTheme
6
6
  } from "./generateSrcMainResourcesForMainTheme";
7
7
  import { generateSrcMainResourcesForThemeVariant } from "./generateSrcMainResourcesForThemeVariant";
8
+ import fs from "fs";
9
+ import { rmSync } from "../../tools/fs.rmSync";
8
10
 
9
11
  export type BuildContextLike = BuildContextLike_generateSrcMainResourcesForMainTheme & {
10
12
  themeNames: string[];
@@ -14,21 +16,27 @@ assert<BuildContext extends BuildContextLike ? true : false>();
14
16
 
15
17
  export async function generateSrcMainResources(params: {
16
18
  buildContext: BuildContextLike;
19
+ resourcesDirPath: string;
17
20
  }): Promise<void> {
18
- const { buildContext } = params;
21
+ const { resourcesDirPath, buildContext } = params;
19
22
 
20
23
  const [themeName, ...themeVariantNames] = buildContext.themeNames;
21
24
 
25
+ if (fs.existsSync(resourcesDirPath)) {
26
+ rmSync(resourcesDirPath, { recursive: true });
27
+ }
28
+
22
29
  await generateSrcMainResourcesForMainTheme({
30
+ resourcesDirPath,
23
31
  themeName,
24
32
  buildContext
25
33
  });
26
34
 
27
35
  for (const themeVariantName of themeVariantNames) {
28
36
  generateSrcMainResourcesForThemeVariant({
37
+ resourcesDirPath,
29
38
  themeName,
30
- themeVariantName,
31
- buildContext
39
+ themeVariantName
32
40
  });
33
41
  }
34
42
  }
@@ -43,14 +43,10 @@ import { escapeStringForPropertiesFile } from "../../tools/escapeStringForProper
43
43
  export type BuildContextLike = BuildContextLike_kcContextExclusionsFtlCode &
44
44
  BuildContextLike_downloadKeycloakStaticResources &
45
45
  BuildContextLike_bringInAccountV1 & {
46
- bundler: "vite" | "webpack";
47
46
  extraThemeProperties: string[] | undefined;
48
47
  loginThemeResourcesFromKeycloakVersion: string;
49
- projectBuildDirPath: string;
50
- assetsDirPath: string;
51
- urlPathname: string | undefined;
52
48
  projectDirPath: string;
53
- keycloakifyBuildDirPath: string;
49
+ projectBuildDirPath: string;
54
50
  environmentVariables: { name: string; default: string }[];
55
51
  };
56
52
 
@@ -58,9 +54,10 @@ assert<BuildContext extends BuildContextLike ? true : false>();
58
54
 
59
55
  export async function generateSrcMainResourcesForMainTheme(params: {
60
56
  themeName: string;
57
+ resourcesDirPath: string;
61
58
  buildContext: BuildContextLike;
62
59
  }): Promise<void> {
63
- const { themeName, buildContext } = params;
60
+ const { themeName, resourcesDirPath, buildContext } = params;
64
61
 
65
62
  const { themeSrcDirPath } = getThemeSrcDirPath({
66
63
  projectDirPath: buildContext.projectDirPath
@@ -68,15 +65,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
68
65
 
69
66
  const getThemeTypeDirPath = (params: { themeType: ThemeType | "email" }) => {
70
67
  const { themeType } = params;
71
- return pathJoin(
72
- buildContext.keycloakifyBuildDirPath,
73
- "src",
74
- "main",
75
- "resources",
76
- "theme",
77
- themeName,
78
- themeType
79
- );
68
+ return pathJoin(resourcesDirPath, "theme", themeName, themeType);
80
69
  };
81
70
 
82
71
  const cssGlobalsToDefine: Record<string, string> = {};
@@ -207,8 +196,6 @@ export async function generateSrcMainResourcesForMainTheme(params: {
207
196
  ].forEach(pageId => {
208
197
  const { ftlCode } = generateFtlFilesCode({ pageId });
209
198
 
210
- fs.mkdirSync(themeTypeDirPath, { recursive: true });
211
-
212
199
  fs.writeFileSync(
213
200
  pathJoin(themeTypeDirPath, pageId),
214
201
  Buffer.from(ftlCode, "utf8")
@@ -291,6 +278,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
291
278
 
292
279
  if (implementedThemeTypes.account) {
293
280
  await bringInAccountV1({
281
+ resourcesDirPath,
294
282
  buildContext
295
283
  });
296
284
  }
@@ -313,7 +301,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
313
301
  }
314
302
 
315
303
  writeMetaInfKeycloakThemes({
316
- keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
304
+ resourcesDirPath,
317
305
  metaInfKeycloakThemes
318
306
  });
319
307
  }
@@ -2,7 +2,7 @@ import { join as pathJoin, extname as pathExtname, sep as pathSep } from "path";
2
2
  import { transformCodebase } from "../../tools/transformCodebase";
3
3
  import type { BuildContext } from "../../shared/buildContext";
4
4
  import {
5
- readMetaInfKeycloakThemes,
5
+ readMetaInfKeycloakThemes_fromResourcesDirPath,
6
6
  writeMetaInfKeycloakThemes
7
7
  } from "../../shared/metaInfKeycloakThemes";
8
8
  import { assert } from "tsafe/assert";
@@ -14,20 +14,13 @@ export type BuildContextLike = {
14
14
  assert<BuildContext extends BuildContextLike ? true : false>();
15
15
 
16
16
  export function generateSrcMainResourcesForThemeVariant(params: {
17
+ resourcesDirPath: string;
17
18
  themeName: string;
18
19
  themeVariantName: string;
19
- buildContext: BuildContextLike;
20
20
  }) {
21
- const { themeName, themeVariantName, buildContext } = params;
21
+ const { resourcesDirPath, themeName, themeVariantName } = params;
22
22
 
23
- const mainThemeDirPath = pathJoin(
24
- buildContext.keycloakifyBuildDirPath,
25
- "src",
26
- "main",
27
- "resources",
28
- "theme",
29
- themeName
30
- );
23
+ const mainThemeDirPath = pathJoin(resourcesDirPath, "theme", themeName);
31
24
 
32
25
  transformCodebase({
33
26
  srcDirPath: mainThemeDirPath,
@@ -57,9 +50,10 @@ export function generateSrcMainResourcesForThemeVariant(params: {
57
50
  });
58
51
 
59
52
  {
60
- const updatedMetaInfKeycloakThemes = readMetaInfKeycloakThemes({
61
- keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
62
- });
53
+ const updatedMetaInfKeycloakThemes =
54
+ readMetaInfKeycloakThemes_fromResourcesDirPath({
55
+ resourcesDirPath
56
+ });
63
57
 
64
58
  updatedMetaInfKeycloakThemes.themes.push({
65
59
  name: themeVariantName,
@@ -73,7 +67,7 @@ export function generateSrcMainResourcesForThemeVariant(params: {
73
67
  });
74
68
 
75
69
  writeMetaInfKeycloakThemes({
76
- keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
70
+ resourcesDirPath,
77
71
  metaInfKeycloakThemes: updatedMetaInfKeycloakThemes
78
72
  });
79
73
  }