keycloakify 10.0.0-rc.65 → 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 (38) hide show
  1. package/bin/193.index.js +51 -0
  2. package/bin/246.index.js +371 -75118
  3. package/bin/363.index.js +64 -165
  4. package/bin/453.index.js +603 -23
  5. package/bin/{890.index.js → 456.index.js} +1831 -3
  6. package/bin/490.index.js +75195 -0
  7. package/bin/526.index.js +294 -173
  8. package/bin/538.index.js +1 -509
  9. package/bin/{203.index.js → 751.index.js} +306 -305
  10. package/bin/772.index.js +1 -1
  11. package/bin/{190.index.js → 837.index.js} +259 -35
  12. package/bin/932.index.js +1 -578
  13. package/bin/97.index.js +594 -14
  14. package/bin/main.js +8 -8
  15. package/bin/shared/buildContext.d.ts +16 -0
  16. package/bin/shared/constants.d.ts +1 -1
  17. package/bin/shared/constants.js +1 -1
  18. package/bin/shared/constants.js.map +1 -1
  19. package/package.json +5 -10
  20. package/src/bin/add-story.ts +1 -6
  21. package/src/bin/eject-page.ts +7 -8
  22. package/src/bin/initialize-email-theme.ts +1 -6
  23. package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
  24. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
  25. package/src/bin/keycloakify/keycloakify.ts +6 -8
  26. package/src/bin/shared/buildContext.ts +434 -42
  27. package/src/bin/shared/constants.ts +2 -1
  28. package/src/bin/shared/generateKcGenTs.ts +2 -6
  29. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  30. package/src/bin/start-keycloak/start-keycloak.ts +40 -83
  31. package/src/vite-plugin/vite-plugin.ts +5 -4
  32. package/vite-plugin/index.js +341 -117
  33. package/bin/480.index.js +0 -466
  34. package/bin/818.index.js +0 -1802
  35. package/bin/827.index.js +0 -1094
  36. package/src/bin/shared/getImplementedThemeTypes.ts +0 -38
  37. package/src/bin/shared/getJarFileBasename.ts +0 -11
  38. package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
@@ -1,38 +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
- type ImplementedThemeTypes = Readonly<Record<ThemeType | "email", boolean>>;
8
-
9
- let cache:
10
- | { projectDirPath: string; implementedThemeTypes: ImplementedThemeTypes }
11
- | undefined;
12
-
13
- export function getImplementedThemeTypes(params: { projectDirPath: string }) {
14
- const { projectDirPath } = params;
15
-
16
- if (cache !== undefined && cache.projectDirPath === projectDirPath) {
17
- const { implementedThemeTypes } = cache;
18
- return { implementedThemeTypes };
19
- }
20
-
21
- cache = undefined;
22
-
23
- const { themeSrcDirPath } = getThemeSrcDirPath({
24
- projectDirPath
25
- });
26
-
27
- const implementedThemeTypes: Readonly<Record<ThemeType | "email", boolean>> =
28
- objectFromEntries(
29
- (["login", "account", "email"] as const).map(themeType => [
30
- themeType,
31
- fs.existsSync(pathJoin(themeSrcDirPath, themeType))
32
- ])
33
- );
34
-
35
- cache = { projectDirPath, implementedThemeTypes };
36
-
37
- return { implementedThemeTypes };
38
- }
@@ -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"];