keycloakify 4.7.1 → 4.7.4

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 (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +12 -4
  3. package/bin/build-keycloak-theme/build-keycloak-theme.js +5 -5
  4. package/bin/build-keycloak-theme/build-keycloak-theme.js.map +1 -1
  5. package/bin/build-keycloak-theme/generateKeycloakThemeResources.d.ts +1 -2
  6. package/bin/build-keycloak-theme/generateKeycloakThemeResources.js.map +1 -1
  7. package/bin/build-keycloak-theme/generateStartKeycloakTestingContainer.d.ts +9 -0
  8. package/bin/build-keycloak-theme/generateStartKeycloakTestingContainer.js +50 -0
  9. package/bin/build-keycloak-theme/generateStartKeycloakTestingContainer.js.map +1 -0
  10. package/bin/download-builtin-keycloak-theme.d.ts +1 -2
  11. package/bin/download-builtin-keycloak-theme.js.map +1 -1
  12. package/bin/generate-i18n-messages.js +3 -4
  13. package/bin/generate-i18n-messages.js.map +1 -1
  14. package/package.json +5 -19
  15. package/src/bin/build-keycloak-theme/build-keycloak-theme.ts +5 -5
  16. package/src/bin/build-keycloak-theme/generateKeycloakThemeResources.ts +1 -2
  17. package/src/bin/build-keycloak-theme/generateStartKeycloakTestingContainer.ts +44 -0
  18. package/src/bin/download-builtin-keycloak-theme.ts +2 -3
  19. package/src/bin/generate-i18n-messages.ts +1 -2
  20. package/bin/KeycloakVersion.d.ts +0 -2
  21. package/bin/KeycloakVersion.js +0 -5
  22. package/bin/KeycloakVersion.js.map +0 -1
  23. package/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.d.ts +0 -8
  24. package/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.js +0 -72
  25. package/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.js.map +0 -1
  26. package/bin/build-keycloak-theme/generateDebugFiles/index.d.ts +0 -1
  27. package/bin/build-keycloak-theme/generateDebugFiles/index.js +0 -14
  28. package/bin/build-keycloak-theme/generateDebugFiles/index.js.map +0 -1
  29. package/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_11.0.3.xml +0 -666
  30. package/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_15.0.2.xml +0 -693
  31. package/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_16.1.0.xml +0 -652
  32. package/src/bin/KeycloakVersion.ts +0 -3
  33. package/src/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.ts +0 -85
  34. package/src/bin/build-keycloak-theme/generateDebugFiles/index.ts +0 -1
  35. package/src/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_11.0.3.xml +0 -666
  36. package/src/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_15.0.2.xml +0 -693
  37. package/src/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_16.1.0.xml +0 -652
@@ -1,3 +0,0 @@
1
- export const keycloakVersions = ["11.0.3", "15.0.2", "16.1.0"] as const;
2
-
3
- export type KeycloakVersion = typeof keycloakVersions[number];
@@ -1,85 +0,0 @@
1
- import * as fs from "fs";
2
- import { join as pathJoin, dirname as pathDirname } from "path";
3
- import type { KeycloakVersion } from "../../KeycloakVersion";
4
-
5
- export const containerLaunchScriptBasename = "start_keycloak_testing_container.sh";
6
-
7
- /** Files for being able to run a hot reload keycloak container */
8
- export function generateDebugFiles(params: { keycloakVersion: KeycloakVersion; themeName: string; keycloakThemeBuildingDirPath: string }) {
9
- const { themeName, keycloakThemeBuildingDirPath, keycloakVersion } = params;
10
-
11
- fs.writeFileSync(
12
- pathJoin(keycloakThemeBuildingDirPath, "Dockerfile"),
13
- Buffer.from(
14
- [
15
- `FROM jboss/keycloak:${keycloakVersion}`,
16
- "",
17
- "USER root",
18
- "",
19
- "WORKDIR /",
20
- "",
21
- "ADD configuration /opt/jboss/keycloak/standalone/configuration/",
22
- "",
23
- 'ENTRYPOINT [ "/opt/jboss/tools/docker-entrypoint.sh" ]',
24
- ].join("\n"),
25
- "utf8",
26
- ),
27
- );
28
-
29
- const dockerImage = `${themeName}/keycloak-hot-reload`;
30
- const containerName = "keycloak-testing-container";
31
-
32
- fs.writeFileSync(
33
- pathJoin(keycloakThemeBuildingDirPath, containerLaunchScriptBasename),
34
- Buffer.from(
35
- [
36
- "#!/bin/bash",
37
- "",
38
- `cd ${keycloakThemeBuildingDirPath}`,
39
- "",
40
- `docker rm ${containerName} || true`,
41
- "",
42
- `docker build . -t ${dockerImage}`,
43
- "",
44
- "docker run \\",
45
- " -p 8080:8080 \\",
46
- ` --name ${containerName} \\`,
47
- " -e KEYCLOAK_USER=admin \\",
48
- " -e KEYCLOAK_PASSWORD=admin \\",
49
- " -e JAVA_OPTS=-Dkeycloak.profile=preview \\",
50
- ` -v ${pathJoin(
51
- keycloakThemeBuildingDirPath,
52
- "src",
53
- "main",
54
- "resources",
55
- "theme",
56
- themeName,
57
- )}:/opt/jboss/keycloak/themes/${themeName}:rw \\`,
58
- ` -it ${dockerImage}:latest`,
59
- "",
60
- ].join("\n"),
61
- "utf8",
62
- ),
63
- { "mode": 0o755 },
64
- );
65
-
66
- const standaloneHaFilePath = pathJoin(keycloakThemeBuildingDirPath, "configuration", `standalone-ha.xml`);
67
-
68
- try {
69
- fs.mkdirSync(pathDirname(standaloneHaFilePath));
70
- } catch {}
71
-
72
- fs.writeFileSync(
73
- standaloneHaFilePath,
74
- fs
75
- .readFileSync(pathJoin(__dirname, `standalone-ha_${keycloakVersion}.xml`))
76
- .toString("utf8")
77
- .replace(
78
- new RegExp(
79
- ["<staticMaxAge>2592000</staticMaxAge>", "<cacheThemes>true</cacheThemes>", "<cacheTemplates>true</cacheTemplates>"].join("\\s*"),
80
- "g",
81
- ),
82
- ["<staticMaxAge>-1</staticMaxAge>", "<cacheThemes>false</cacheThemes>", "<cacheTemplates>false</cacheTemplates>"].join("\n"),
83
- ),
84
- );
85
- }
@@ -1 +0,0 @@
1
- export * from "./generateDebugFiles";