keycloakify 10.0.0-rc.64 → 10.0.0-rc.66

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 (49) hide show
  1. package/account/KcContext/KcContext.d.ts +1 -0
  2. package/account/KcContext/KcContext.js.map +1 -1
  3. package/account/KcContext/kcContextMocks.js +2 -1
  4. package/account/KcContext/kcContextMocks.js.map +1 -1
  5. package/account/pages/Totp.js +2 -7
  6. package/account/pages/Totp.js.map +1 -1
  7. package/bin/193.index.js +0 -501
  8. package/bin/246.index.js +371 -75118
  9. package/bin/363.index.js +36 -665
  10. package/bin/453.index.js +603 -23
  11. package/bin/{890.index.js → 456.index.js} +1831 -3
  12. package/bin/490.index.js +75195 -0
  13. package/bin/526.index.js +311 -166
  14. package/bin/538.index.js +1 -509
  15. package/bin/{240.index.js → 751.index.js} +306 -322
  16. package/bin/772.index.js +1 -1
  17. package/bin/837.index.js +787 -0
  18. package/bin/932.index.js +1 -574
  19. package/bin/97.index.js +594 -14
  20. package/bin/main.js +8 -8
  21. package/bin/shared/buildContext.d.ts +16 -0
  22. package/bin/shared/constants.d.ts +1 -1
  23. package/bin/shared/constants.js +1 -1
  24. package/bin/shared/constants.js.map +1 -1
  25. package/package.json +5 -9
  26. package/src/account/KcContext/KcContext.ts +1 -0
  27. package/src/account/KcContext/kcContextMocks.ts +2 -1
  28. package/src/account/pages/Totp.tsx +1 -7
  29. package/src/bin/add-story.ts +1 -6
  30. package/src/bin/eject-page.ts +7 -8
  31. package/src/bin/initialize-email-theme.ts +1 -6
  32. package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
  33. package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +8 -6
  34. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
  35. package/src/bin/keycloakify/keycloakify.ts +6 -8
  36. package/src/bin/shared/buildContext.ts +434 -42
  37. package/src/bin/shared/constants.ts +2 -1
  38. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +135 -108
  39. package/src/bin/shared/generateKcGenTs.ts +2 -6
  40. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  41. package/src/bin/start-keycloak/start-keycloak.ts +40 -83
  42. package/src/vite-plugin/vite-plugin.ts +5 -4
  43. package/vite-plugin/index.js +410 -187
  44. package/bin/480.index.js +0 -466
  45. package/bin/818.index.js +0 -1802
  46. package/bin/827.index.js +0 -1094
  47. package/src/bin/shared/getImplementedThemeTypes.ts +0 -23
  48. package/src/bin/shared/getJarFileBasename.ts +0 -11
  49. package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
@@ -1,23 +0,0 @@
1
- import { join as pathJoin } from "path";
2
- import { objectFromEntries } from "tsafe/objectFromEntries";
3
- import * as fs from "fs";
4
- import { type ThemeType } from "./constants";
5
- import { getThemeSrcDirPath } from "./getThemeSrcDirPath";
6
-
7
- export function getImplementedThemeTypes(params: { projectDirPath: string }) {
8
- const { projectDirPath } = params;
9
-
10
- const { themeSrcDirPath } = getThemeSrcDirPath({
11
- projectDirPath
12
- });
13
-
14
- const implementedThemeTypes: Readonly<Record<ThemeType | "email", boolean>> =
15
- objectFromEntries(
16
- (["login", "account", "email"] as const).map(themeType => [
17
- themeType,
18
- fs.existsSync(pathJoin(themeSrcDirPath, themeType))
19
- ])
20
- );
21
-
22
- return { implementedThemeTypes };
23
- }
@@ -1,11 +0,0 @@
1
- import type { KeycloakVersionRange } from "./KeycloakVersionRange";
2
-
3
- export function getJarFileBasename(params: {
4
- keycloakVersionRange: KeycloakVersionRange;
5
- }) {
6
- const { keycloakVersionRange } = params;
7
-
8
- const jarFileBasename = `keycloak-theme-for-kc-${keycloakVersionRange}.jar`;
9
-
10
- return { jarFileBasename };
11
- }
@@ -1,62 +0,0 @@
1
- import * as fs from "fs";
2
- import { exclude } from "tsafe";
3
- import { crawl } from "../tools/crawl";
4
- import { join as pathJoin } from "path";
5
- import { themeTypes } from "./constants";
6
- import chalk from "chalk";
7
-
8
- let cache: { projectDirPath: string; themeSrcDirPath: string } | undefined = undefined;
9
-
10
- /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
11
- export function getThemeSrcDirPath(params: { projectDirPath: string }) {
12
- const { projectDirPath } = params;
13
-
14
- if (cache !== undefined && cache.projectDirPath === projectDirPath) {
15
- const { themeSrcDirPath } = cache;
16
- return { themeSrcDirPath };
17
- }
18
-
19
- cache = undefined;
20
-
21
- const { themeSrcDirPath } = (() => {
22
- const srcDirPath = pathJoin(projectDirPath, "src");
23
-
24
- const themeSrcDirPath: string | undefined = crawl({
25
- dirPath: srcDirPath,
26
- returnedPathsType: "relative to dirPath"
27
- })
28
- .map(fileRelativePath => {
29
- for (const themeSrcDirBasename of themeSrcDirBasenames) {
30
- const split = fileRelativePath.split(themeSrcDirBasename);
31
- if (split.length === 2) {
32
- return pathJoin(srcDirPath, split[0] + themeSrcDirBasename);
33
- }
34
- }
35
- return undefined;
36
- })
37
- .filter(exclude(undefined))[0];
38
-
39
- if (themeSrcDirPath !== undefined) {
40
- return { themeSrcDirPath };
41
- }
42
-
43
- for (const themeType of [...themeTypes, "email"]) {
44
- if (!fs.existsSync(pathJoin(srcDirPath, themeType))) {
45
- continue;
46
- }
47
- return { themeSrcDirPath: srcDirPath };
48
- }
49
-
50
- console.log(
51
- chalk.red("Can't locate your theme source directory. It should be either: ")
52
- );
53
-
54
- process.exit(-1);
55
- })();
56
-
57
- cache = { projectDirPath, themeSrcDirPath };
58
-
59
- return { themeSrcDirPath };
60
- }
61
-
62
- const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];