keycloakify 7.6.0 → 7.6.2

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 (33) hide show
  1. package/bin/download-builtin-keycloak-theme.js +6 -2
  2. package/bin/download-builtin-keycloak-theme.js.map +1 -1
  3. package/bin/eject-keycloak-page.js +5 -5
  4. package/bin/eject-keycloak-page.js.map +1 -1
  5. package/bin/getSrcDirPath.d.ts +12 -0
  6. package/bin/getSrcDirPath.js +60 -0
  7. package/bin/getSrcDirPath.js.map +1 -0
  8. package/bin/initialize-email-theme.js +4 -2
  9. package/bin/initialize-email-theme.js.map +1 -1
  10. package/bin/keycloakify/BuildOptions.d.ts +5 -3
  11. package/bin/keycloakify/BuildOptions.js +62 -5
  12. package/bin/keycloakify/BuildOptions.js.map +1 -1
  13. package/bin/keycloakify/keycloakify.js +13 -19
  14. package/bin/keycloakify/keycloakify.js.map +1 -1
  15. package/bin/keycloakify/parsedPackageJson.d.ts +26 -3
  16. package/bin/keycloakify/parsedPackageJson.js +8 -7
  17. package/bin/keycloakify/parsedPackageJson.js.map +1 -1
  18. package/bin/tools/trimIndent.d.ts +1 -5
  19. package/bin/tools/trimIndent.js +16 -32
  20. package/bin/tools/trimIndent.js.map +1 -1
  21. package/package.json +5 -5
  22. package/src/bin/download-builtin-keycloak-theme.ts +12 -2
  23. package/src/bin/eject-keycloak-page.ts +4 -4
  24. package/src/bin/getSrcDirPath.ts +43 -0
  25. package/src/bin/initialize-email-theme.ts +4 -2
  26. package/src/bin/keycloakify/BuildOptions.ts +53 -10
  27. package/src/bin/keycloakify/keycloakify.ts +14 -21
  28. package/src/bin/keycloakify/parsedPackageJson.ts +12 -10
  29. package/src/bin/tools/trimIndent.ts +19 -24
  30. package/bin/keycloakify/build-paths.d.ts +0 -12
  31. package/bin/keycloakify/build-paths.js +0 -93
  32. package/bin/keycloakify/build-paths.js.map +0 -1
  33. package/src/bin/keycloakify/build-paths.ts +0 -72
@@ -1,72 +0,0 @@
1
- import * as fs from "fs";
2
- import { exclude } from "tsafe";
3
- import { crawl } from "../tools/crawl";
4
- import { pathJoin } from "../tools/pathJoin";
5
- import { getParsedPackageJson } from "./parsedPackageJson";
6
-
7
- const DEFAULT_APP_INPUT_PATH = "build";
8
-
9
- const DEFAULT_KEYCLOAK_BUILD_PATH = "build_keycloak";
10
-
11
- const THEME_SRC_DIR_BASENAME = "keycloak-theme";
12
-
13
- export const getReactProjectDirPath = () => process.cwd();
14
-
15
- export const getCnamePath = () => pathJoin(getReactProjectDirPath(), "public", "CNAME");
16
-
17
- const parseAppInputPath = (path?: string) => {
18
- if (!path) {
19
- return pathJoin(process.cwd(), DEFAULT_APP_INPUT_PATH);
20
- } else if (path.startsWith("./")) {
21
- return pathJoin(process.cwd(), path.replace("./", ""));
22
- }
23
- return path;
24
- };
25
-
26
- const parseKeycloakBuildPath = (path?: string) => {
27
- if (!path) {
28
- return pathJoin(process.cwd(), DEFAULT_KEYCLOAK_BUILD_PATH);
29
- } else if (path.startsWith("./")) {
30
- return pathJoin(process.cwd(), path.replace("./", ""));
31
- }
32
- return path;
33
- };
34
-
35
- export const getAppInputPath = () => {
36
- return parseAppInputPath(getParsedPackageJson().keycloakify?.appInputPath);
37
- };
38
-
39
- export const getKeycloakBuildPath = () => {
40
- return parseKeycloakBuildPath(getParsedPackageJson().keycloakify?.keycloakBuildPath);
41
- };
42
- export const getThemeSrcDirPath = () => {
43
- const srcDirPath = pathJoin(getReactProjectDirPath(), "src");
44
-
45
- const themeSrcDirPath: string | undefined = crawl(srcDirPath)
46
- .map(fileRelativePath => {
47
- const split = fileRelativePath.split(THEME_SRC_DIR_BASENAME);
48
-
49
- if (split.length !== 2) {
50
- return undefined;
51
- }
52
-
53
- return pathJoin(srcDirPath, split[0] + THEME_SRC_DIR_BASENAME);
54
- })
55
- .filter(exclude(undefined))[0];
56
- if (themeSrcDirPath === undefined) {
57
- if (fs.existsSync(pathJoin(srcDirPath, "login")) || fs.existsSync(pathJoin(srcDirPath, "account"))) {
58
- return { "themeSrcDirPath": srcDirPath };
59
- }
60
- return { "themeSrcDirPath": undefined };
61
- }
62
-
63
- return { themeSrcDirPath };
64
- };
65
-
66
- export const getEmailThemeSrcDirPath = () => {
67
- const { themeSrcDirPath } = getThemeSrcDirPath();
68
-
69
- const emailThemeSrcDirPath = themeSrcDirPath === undefined ? undefined : pathJoin(themeSrcDirPath, "email");
70
-
71
- return { emailThemeSrcDirPath };
72
- };