keycloakify 10.0.0-rc.47 → 10.0.0-rc.49
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.
- package/bin/3.index.js +5 -34
- package/bin/526.index.js +15 -3
- package/bin/932.index.js +5 -1
- package/login/lib/useUserProfileForm.js +175 -149
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/package.json +6 -2
- package/src/bin/initialize-email-theme.ts +1 -0
- package/src/bin/keycloakify/buildJars/buildJar.ts +6 -54
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +11 -1
- package/src/bin/shared/promptKeycloakVersion.ts +6 -1
- package/src/bin/start-keycloak/myrealm-realm-18.json +2155 -0
- package/src/bin/start-keycloak/myrealm-realm-19.json +2186 -0
- package/src/bin/start-keycloak/myrealm-realm-20.json +2197 -0
- package/src/bin/start-keycloak/myrealm-realm-21.json +2201 -0
- package/src/bin/start-keycloak/myrealm-realm-23.json +20 -12
- package/src/bin/start-keycloak/myrealm-realm-24.json +10 -10
- package/src/bin/start-keycloak/myrealm-realm-25.json +2400 -0
- package/src/bin/start-keycloak/start-keycloak.ts +14 -2
- package/src/login/lib/useUserProfileForm.tsx +182 -180
- package/src/tools/formatNumber.ts +3 -2
- package/tools/formatNumber.js +2 -1
- package/tools/formatNumber.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "keycloakify",
|
3
|
-
"version": "10.0.0-rc.
|
3
|
+
"version": "10.0.0-rc.49",
|
4
4
|
"description": "Create Keycloak themes using React",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -495,8 +495,13 @@
|
|
495
495
|
"src/bin/start-keycloak/appBuild.ts",
|
496
496
|
"src/bin/start-keycloak/index.ts",
|
497
497
|
"src/bin/start-keycloak/keycloakifyBuild.ts",
|
498
|
+
"src/bin/start-keycloak/myrealm-realm-18.json",
|
499
|
+
"src/bin/start-keycloak/myrealm-realm-19.json",
|
500
|
+
"src/bin/start-keycloak/myrealm-realm-20.json",
|
501
|
+
"src/bin/start-keycloak/myrealm-realm-21.json",
|
498
502
|
"src/bin/start-keycloak/myrealm-realm-23.json",
|
499
503
|
"src/bin/start-keycloak/myrealm-realm-24.json",
|
504
|
+
"src/bin/start-keycloak/myrealm-realm-25.json",
|
500
505
|
"src/bin/start-keycloak/start-keycloak.ts",
|
501
506
|
"src/bin/tools/OptionalIfCanBeUndefined.ts",
|
502
507
|
"src/bin/tools/SemVer.ts",
|
@@ -850,7 +855,6 @@
|
|
850
855
|
"react-dom": "^18.2.0",
|
851
856
|
"recast": "^0.23.3",
|
852
857
|
"run-exclusive": "^2.2.19",
|
853
|
-
"scripting-tools": "^0.19.13",
|
854
858
|
"storybook-dark-mode": "^1.1.2",
|
855
859
|
"termost": "^0.12.0",
|
856
860
|
"ts-node": "^10.9.2",
|
@@ -34,6 +34,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
34
34
|
const { keycloakVersion } = await promptKeycloakVersion({
|
35
35
|
// NOTE: This is arbitrary
|
36
36
|
startingFromMajor: 17,
|
37
|
+
excludeMajorVersions: [],
|
37
38
|
cacheDirPath: buildContext.cacheDirPath
|
38
39
|
});
|
39
40
|
|
@@ -50,35 +50,10 @@ export async function buildJar(params: {
|
|
50
50
|
|
51
51
|
rmSync(keycloakifyBuildTmpDirPath, { recursive: true, force: true });
|
52
52
|
|
53
|
-
{
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}): { modifiedSourceCode: Buffer } | undefined => {
|
58
|
-
const { fileRelativePath, sourceCode } = params;
|
59
|
-
|
60
|
-
if (
|
61
|
-
fileRelativePath ===
|
62
|
-
getMetaInfKeycloakThemesJsonFilePath({ resourcesDirPath: "." })
|
63
|
-
) {
|
64
|
-
return { modifiedSourceCode: sourceCode };
|
65
|
-
}
|
66
|
-
|
67
|
-
for (const themeName of [...buildContext.themeNames, accountV1ThemeName]) {
|
68
|
-
if (
|
69
|
-
isInside({
|
70
|
-
dirPath: pathJoin("theme", themeName),
|
71
|
-
filePath: fileRelativePath
|
72
|
-
})
|
73
|
-
) {
|
74
|
-
return { modifiedSourceCode: sourceCode };
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
return undefined;
|
79
|
-
};
|
80
|
-
|
81
|
-
const transformCodebase_patchForUsingBuiltinAccountV1 =
|
53
|
+
transformCodebase({
|
54
|
+
srcDirPath: resourcesDirPath,
|
55
|
+
destDirPath: pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
|
56
|
+
transformSourceCode:
|
82
57
|
keycloakAccountV1Version !== null
|
83
58
|
? undefined
|
84
59
|
: (params: {
|
@@ -145,31 +120,8 @@ export async function buildJar(params: {
|
|
145
120
|
}
|
146
121
|
|
147
122
|
return { modifiedSourceCode: sourceCode };
|
148
|
-
}
|
149
|
-
|
150
|
-
transformCodebase({
|
151
|
-
srcDirPath: resourcesDirPath,
|
152
|
-
destDirPath: pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
|
153
|
-
transformSourceCode: params => {
|
154
|
-
const resultCommon = transformCodebase_common(params);
|
155
|
-
|
156
|
-
if (transformCodebase_patchForUsingBuiltinAccountV1 === undefined) {
|
157
|
-
return resultCommon;
|
158
|
-
}
|
159
|
-
|
160
|
-
if (resultCommon === undefined) {
|
161
|
-
return undefined;
|
162
|
-
}
|
163
|
-
|
164
|
-
const { modifiedSourceCode } = resultCommon;
|
165
|
-
|
166
|
-
return transformCodebase_patchForUsingBuiltinAccountV1({
|
167
|
-
...params,
|
168
|
-
sourceCode: modifiedSourceCode
|
169
|
-
});
|
170
|
-
}
|
171
|
-
});
|
172
|
-
}
|
123
|
+
}
|
124
|
+
});
|
173
125
|
|
174
126
|
route_legacy_pages: {
|
175
127
|
// NOTE: If there's no account theme there is no special target for keycloak 24 and up so we create
|
@@ -180,6 +180,16 @@ try {
|
|
180
180
|
<#if attribute.annotations.inputTypePlaceholder??>
|
181
181
|
"${attribute.annotations.inputTypePlaceholder}": decodeHtmlEntities("${advancedMsg(attribute.annotations.inputTypePlaceholder)?js_string}"),
|
182
182
|
</#if>
|
183
|
+
<!-- Loop through the options that are in attribute.validators.options.options -->
|
184
|
+
<#if (
|
185
|
+
attribute.annotations.inputOptionLabelsI18nPrefix?? &&
|
186
|
+
attribute.validators?? &&
|
187
|
+
attribute.validators.options??
|
188
|
+
)>
|
189
|
+
<#list attribute.validators.options.options as option>
|
190
|
+
"${attribute.annotations.inputOptionLabelsI18nPrefix}.${option}": decodeHtmlEntities("${msg(attribute.annotations.inputOptionLabelsI18nPrefix + "." + option)?js_string}"),
|
191
|
+
</#list>
|
192
|
+
</#if>
|
183
193
|
</#list>
|
184
194
|
};
|
185
195
|
</#if>
|
@@ -326,7 +336,7 @@ function decodeHtmlEntities(htmlStr){
|
|
326
336
|
|
327
337
|
<#-- https://github.com/keycloakify/keycloakify/discussions/406 -->
|
328
338
|
<#if (
|
329
|
-
["register.ftl", "register-user-profile.ftl", "info.ftl", "login.ftl", "login-update-password.ftl", "login-oauth2-device-verify-user-code.ftl"]?seq_contains(pageId) &&
|
339
|
+
["register.ftl", "register-user-profile.ftl", "terms.ftl", "info.ftl", "login.ftl", "login-update-password.ftl", "login-oauth2-device-verify-user-code.ftl"]?seq_contains(pageId) &&
|
330
340
|
key == "attemptedUsername" && are_same_path(path, ["auth"])
|
331
341
|
)>
|
332
342
|
<#attempt>
|
@@ -9,9 +9,10 @@ import { id } from "tsafe/id";
|
|
9
9
|
|
10
10
|
export async function promptKeycloakVersion(params: {
|
11
11
|
startingFromMajor: number | undefined;
|
12
|
+
excludeMajorVersions: number[];
|
12
13
|
cacheDirPath: string;
|
13
14
|
}) {
|
14
|
-
const { startingFromMajor, cacheDirPath } = params;
|
15
|
+
const { startingFromMajor, excludeMajorVersions, cacheDirPath } = params;
|
15
16
|
|
16
17
|
const { getLatestsSemVersionedTag } = (() => {
|
17
18
|
const { octokit } = (() => {
|
@@ -95,6 +96,10 @@ export async function promptKeycloakVersion(params: {
|
|
95
96
|
return;
|
96
97
|
}
|
97
98
|
|
99
|
+
if (excludeMajorVersions.includes(semVersionedTag.version.major)) {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
|
98
103
|
const currentSemVersionedTag = semVersionedTagByMajor.get(
|
99
104
|
semVersionedTag.version.major
|
100
105
|
);
|