keycloakify 10.0.0-rc.37 → 10.0.0-rc.39
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/account/Fallback.d.ts +1 -2
- package/account/Fallback.js.map +1 -1
- package/account/KcContext/KcContext.d.ts +6 -6
- package/account/KcContext/getKcContextMock.d.ts +9 -9
- package/account/KcContext/getKcContextMock.js +3 -3
- package/account/KcContext/getKcContextMock.js.map +1 -1
- package/account/Template.d.ts +1 -2
- package/account/Template.js +7 -6
- package/account/Template.js.map +1 -1
- package/account/TemplateProps.d.ts +1 -3
- package/account/i18n/i18n.d.ts +9 -4
- package/account/i18n/i18n.js +132 -87
- package/account/i18n/i18n.js.map +1 -1
- package/account/i18n/index.d.ts +9 -2
- package/account/i18n/index.js +5 -1
- package/account/i18n/index.js.map +1 -1
- package/account/lib/kcClsx.d.ts +9 -0
- package/account/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/account/lib/kcClsx.js.map +1 -0
- package/account/pages/Account.d.ts +1 -2
- package/account/pages/Account.js +9 -7
- package/account/pages/Account.js.map +1 -1
- package/account/pages/Applications.d.ts +1 -2
- package/account/pages/Applications.js +7 -7
- package/account/pages/Applications.js.map +1 -1
- package/account/pages/FederatedIdentity.d.ts +1 -2
- package/account/pages/FederatedIdentity.js +4 -3
- package/account/pages/FederatedIdentity.js.map +1 -1
- package/account/pages/Log.d.ts +1 -2
- package/account/pages/Log.js +6 -5
- package/account/pages/Log.js.map +1 -1
- package/account/pages/PageProps.d.ts +2 -4
- package/account/pages/Password.d.ts +1 -2
- package/account/pages/Password.js +10 -9
- package/account/pages/Password.js.map +1 -1
- package/account/pages/Sessions.d.ts +1 -2
- package/account/pages/Sessions.js +6 -6
- package/account/pages/Sessions.js.map +1 -1
- package/account/pages/Totp.d.ts +1 -2
- package/account/pages/Totp.js +6 -5
- package/account/pages/Totp.js.map +1 -1
- package/bin/193.index.js +13 -13
- package/bin/{430.index.js → 214.index.js} +161 -2
- package/bin/3.index.js +165 -149
- package/bin/322.index.js +595 -0
- package/bin/453.index.js +3 -3
- package/bin/526.index.js +42 -632
- package/bin/538.index.js +563 -0
- package/bin/932.index.js +7 -7
- package/bin/{890.index.js → 941.index.js} +2 -159
- package/bin/944.index.js +621 -0
- package/bin/961.index.js +5 -5
- package/bin/97.index.js +3 -3
- package/bin/{314.index.js → 98.index.js} +217 -48
- package/bin/main.js +20 -8
- package/lib/getKcClsx.d.ts +11 -0
- package/lib/getKcClsx.js +55 -0
- package/lib/getKcClsx.js.map +1 -0
- package/login/Fallback.d.ts +2 -2
- package/login/Fallback.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +6 -6
- package/login/KcContext/getKcContextMock.d.ts +9 -9
- package/login/KcContext/getKcContextMock.js +3 -3
- package/login/KcContext/getKcContextMock.js.map +1 -1
- package/login/Template.d.ts +1 -2
- package/login/Template.js +10 -9
- package/login/Template.js.map +1 -1
- package/login/TemplateProps.d.ts +1 -3
- package/login/UserProfileFormFields.d.ts +6 -5
- package/login/UserProfileFormFields.js +35 -36
- package/login/UserProfileFormFields.js.map +1 -1
- package/login/i18n/i18n.d.ts +9 -4
- package/login/i18n/i18n.js +136 -91
- package/login/i18n/i18n.js.map +1 -1
- package/login/i18n/index.d.ts +9 -2
- package/login/i18n/index.js +5 -1
- package/login/i18n/index.js.map +1 -1
- package/login/lib/kcClsx.d.ts +9 -0
- package/login/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/login/lib/kcClsx.js.map +1 -0
- package/login/lib/useUserProfileForm.d.ts +9 -6
- package/login/lib/useUserProfileForm.js +7 -5
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/login/pages/Code.d.ts +1 -2
- package/login/pages/Code.js +6 -5
- package/login/pages/Code.js.map +1 -1
- package/login/pages/DeleteAccountConfirm.d.ts +1 -2
- package/login/pages/DeleteAccountConfirm.js +7 -7
- package/login/pages/DeleteAccountConfirm.js.map +1 -1
- package/login/pages/DeleteCredential.d.ts +1 -2
- package/login/pages/DeleteCredential.js +6 -6
- package/login/pages/DeleteCredential.js.map +1 -1
- package/login/pages/Error.d.ts +1 -2
- package/login/pages/Error.js +4 -3
- package/login/pages/Error.js.map +1 -1
- package/login/pages/FrontchannelLogout.d.ts +1 -2
- package/login/pages/FrontchannelLogout.js +4 -3
- package/login/pages/FrontchannelLogout.js.map +1 -1
- package/login/pages/IdpReviewUserProfile.d.ts +2 -2
- package/login/pages/IdpReviewUserProfile.js +6 -6
- package/login/pages/IdpReviewUserProfile.js.map +1 -1
- package/login/pages/Info.d.ts +1 -2
- package/login/pages/Info.js +4 -3
- package/login/pages/Info.js.map +1 -1
- package/login/pages/Login.d.ts +1 -2
- package/login/pages/Login.js +10 -8
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginConfigTotp.d.ts +1 -2
- package/login/pages/LoginConfigTotp.js +8 -7
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirm.d.ts +1 -2
- package/login/pages/LoginIdpLinkConfirm.js +6 -6
- package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
- package/login/pages/LoginIdpLinkEmail.d.ts +1 -2
- package/login/pages/LoginIdpLinkEmail.js +4 -3
- package/login/pages/LoginIdpLinkEmail.js.map +1 -1
- package/login/pages/LoginOauth2DeviceVerifyUserCode.d.ts +1 -2
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js +6 -6
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
- package/login/pages/LoginOauthGrant.d.ts +1 -2
- package/login/pages/LoginOauthGrant.js +7 -7
- package/login/pages/LoginOauthGrant.js.map +1 -1
- package/login/pages/LoginOtp.d.ts +1 -2
- package/login/pages/LoginOtp.js +6 -6
- package/login/pages/LoginOtp.js.map +1 -1
- package/login/pages/LoginPageExpired.d.ts +1 -2
- package/login/pages/LoginPageExpired.js +4 -3
- package/login/pages/LoginPageExpired.js.map +1 -1
- package/login/pages/LoginPassword.d.ts +1 -2
- package/login/pages/LoginPassword.js +9 -7
- package/login/pages/LoginPassword.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +9 -7
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeInput.js +6 -6
- package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
- package/login/pages/LoginResetOtp.d.ts +1 -2
- package/login/pages/LoginResetOtp.js +6 -6
- package/login/pages/LoginResetOtp.js.map +1 -1
- package/login/pages/LoginResetPassword.d.ts +1 -2
- package/login/pages/LoginResetPassword.js +7 -7
- package/login/pages/LoginResetPassword.js.map +1 -1
- package/login/pages/LoginUpdatePassword.d.ts +1 -2
- package/login/pages/LoginUpdatePassword.js +10 -9
- package/login/pages/LoginUpdatePassword.js.map +1 -1
- package/login/pages/LoginUpdateProfile.d.ts +2 -2
- package/login/pages/LoginUpdateProfile.js +7 -12
- package/login/pages/LoginUpdateProfile.js.map +1 -1
- package/login/pages/LoginUsername.d.ts +1 -2
- package/login/pages/LoginUsername.js +8 -7
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/LoginVerifyEmail.d.ts +1 -2
- package/login/pages/LoginVerifyEmail.js +4 -3
- package/login/pages/LoginVerifyEmail.js.map +1 -1
- package/login/pages/LoginX509Info.d.ts +1 -2
- package/login/pages/LoginX509Info.js +6 -6
- package/login/pages/LoginX509Info.js.map +1 -1
- package/login/pages/LogoutConfirm.d.ts +1 -2
- package/login/pages/LogoutConfirm.js +6 -6
- package/login/pages/LogoutConfirm.js.map +1 -1
- package/login/pages/PageProps.d.ts +2 -4
- package/login/pages/Register.d.ts +2 -2
- package/login/pages/Register.js +8 -16
- package/login/pages/Register.js.map +1 -1
- package/login/pages/SamlPostForm.d.ts +1 -2
- package/login/pages/SamlPostForm.js +4 -3
- package/login/pages/SamlPostForm.js.map +1 -1
- package/login/pages/SelectAuthenticator.d.ts +1 -2
- package/login/pages/SelectAuthenticator.js +6 -9
- package/login/pages/SelectAuthenticator.js.map +1 -1
- package/login/pages/Terms.d.ts +1 -2
- package/login/pages/Terms.js +6 -6
- package/login/pages/Terms.js.map +1 -1
- package/login/pages/UpdateEmail.d.ts +2 -2
- package/login/pages/UpdateEmail.js +8 -12
- package/login/pages/UpdateEmail.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.d.ts +1 -2
- package/login/pages/WebauthnAuthenticate.js +13 -12
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnError.d.ts +1 -2
- package/login/pages/WebauthnError.js +7 -7
- package/login/pages/WebauthnError.js.map +1 -1
- package/login/pages/WebauthnRegister.d.ts +1 -2
- package/login/pages/WebauthnRegister.js +9 -8
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/package.json +27 -22
- package/src/account/Fallback.tsx +1 -2
- package/src/account/KcContext/KcContext.ts +7 -7
- package/src/account/KcContext/getKcContextMock.ts +13 -24
- package/src/account/Template.tsx +8 -8
- package/src/account/TemplateProps.ts +1 -6
- package/src/account/i18n/i18n.tsx +204 -125
- package/src/account/i18n/index.ts +10 -2
- package/src/account/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/account/pages/Account.tsx +15 -21
- package/src/account/pages/Applications.tsx +8 -9
- package/src/account/pages/FederatedIdentity.tsx +5 -5
- package/src/account/pages/Log.tsx +8 -8
- package/src/account/pages/PageProps.ts +2 -4
- package/src/account/pages/Password.tsx +13 -16
- package/src/account/pages/Sessions.tsx +9 -10
- package/src/account/pages/Totp.tsx +19 -28
- package/src/bin/add-story.ts +3 -3
- package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
- package/src/bin/download-keycloak-default-theme.ts +5 -5
- package/src/bin/eject-page.ts +3 -3
- package/src/bin/initialize-email-theme.ts +5 -5
- package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
- package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
- package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
- package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
- package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +2 -66
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +30 -24
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
- package/src/bin/keycloakify/keycloakify.ts +11 -11
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
- package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
- package/src/bin/main.ts +17 -2
- package/src/bin/shared/{buildOptions.ts → buildContext.ts} +65 -51
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
- package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
- package/src/bin/shared/generateKcGenTs.ts +61 -0
- package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
- package/src/bin/start-keycloak/appBuild.ts +11 -11
- package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
- package/src/bin/start-keycloak/start-keycloak.ts +34 -22
- package/src/bin/tools/escapeStringForPropertiesFile.ts +64 -0
- package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
- package/src/bin/update-kc-gen.ts +13 -0
- package/src/lib/getKcClsx.ts +89 -0
- package/src/login/Fallback.tsx +2 -2
- package/src/login/KcContext/KcContext.ts +7 -7
- package/src/login/KcContext/getKcContextMock.ts +13 -24
- package/src/login/Template.tsx +36 -37
- package/src/login/TemplateProps.ts +1 -6
- package/src/login/UserProfileFormFields.tsx +67 -84
- package/src/login/i18n/i18n.tsx +208 -129
- package/src/login/i18n/index.ts +10 -2
- package/src/login/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/login/lib/useUserProfileForm.tsx +29 -21
- package/src/login/pages/Code.tsx +10 -8
- package/src/login/pages/DeleteAccountConfirm.tsx +9 -10
- package/src/login/pages/DeleteCredential.tsx +11 -10
- package/src/login/pages/Error.tsx +5 -5
- package/src/login/pages/FrontchannelLogout.tsx +7 -5
- package/src/login/pages/IdpReviewUserProfile.tsx +18 -21
- package/src/login/pages/Info.tsx +7 -5
- package/src/login/pages/Login.tsx +34 -53
- package/src/login/pages/LoginConfigTotp.tsx +30 -38
- package/src/login/pages/LoginIdpLinkConfirm.tsx +10 -21
- package/src/login/pages/LoginIdpLinkEmail.tsx +5 -5
- package/src/login/pages/LoginOauth2DeviceVerifyUserCode.tsx +19 -24
- package/src/login/pages/LoginOauthGrant.tsx +14 -21
- package/src/login/pages/LoginOtp.tsx +29 -33
- package/src/login/pages/LoginPageExpired.tsx +5 -5
- package/src/login/pages/LoginPassword.tsx +23 -33
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +21 -25
- package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +21 -25
- package/src/login/pages/LoginResetOtp.tsx +21 -25
- package/src/login/pages/LoginResetPassword.tsx +21 -25
- package/src/login/pages/LoginUpdatePassword.tsx +42 -52
- package/src/login/pages/LoginUpdateProfile.tsx +29 -30
- package/src/login/pages/LoginUsername.tsx +23 -35
- package/src/login/pages/LoginVerifyEmail.tsx +7 -5
- package/src/login/pages/LoginX509Info.tsx +27 -36
- package/src/login/pages/LogoutConfirm.tsx +11 -17
- package/src/login/pages/PageProps.ts +2 -4
- package/src/login/pages/Register.tsx +27 -46
- package/src/login/pages/SamlPostForm.tsx +5 -5
- package/src/login/pages/SelectAuthenticator.tsx +24 -26
- package/src/login/pages/Terms.tsx +9 -16
- package/src/login/pages/UpdateEmail.tsx +29 -33
- package/src/login/pages/WebauthnAuthenticate.tsx +26 -32
- package/src/login/pages/WebauthnError.tsx +11 -22
- package/src/login/pages/WebauthnRegister.tsx +20 -28
- package/src/tools/clsx.ts +6 -48
- package/src/tools/clsx_withTransform.ts +55 -0
- package/src/vite-plugin/vite-plugin.ts +29 -21
- package/tools/clsx.d.ts +3 -2
- package/tools/clsx.js +5 -41
- package/tools/clsx.js.map +1 -1
- package/tools/clsx_withTransform.d.ts +5 -0
- package/tools/clsx_withTransform.js +43 -0
- package/tools/clsx_withTransform.js.map +1 -0
- package/vite-plugin/index.js +243 -102
- package/vite-plugin/vite-plugin.d.ts +3 -3
- package/account/lib/useGetClassName.d.ts +0 -7
- package/account/lib/useGetClassName.js.map +0 -1
- package/bin/795.index.js +0 -1197
- package/lib/isStorybook.d.ts +0 -1
- package/lib/isStorybook.js +0 -3
- package/lib/isStorybook.js.map +0 -1
- package/lib/useGetClassName.d.ts +0 -10
- package/lib/useGetClassName.js +0 -14
- package/lib/useGetClassName.js.map +0 -1
- package/login/lib/useGetClassName.d.ts +0 -7
- package/login/lib/useGetClassName.js.map +0 -1
- package/src/lib/isStorybook.ts +0 -3
- package/src/lib/useGetClassName.ts +0 -27
package/bin/3.index.js
CHANGED
@@ -22,6 +22,8 @@ exports.modules = {
|
|
22
22
|
/* harmony import */ var _babel_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(92332);
|
23
23
|
/* harmony import */ var _babel_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7912);
|
24
24
|
/* harmony import */ var _babel_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_types__WEBPACK_IMPORTED_MODULE_8__);
|
25
|
+
/* harmony import */ var _tools_escapeStringForPropertiesFile__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(27190);
|
26
|
+
|
25
27
|
|
26
28
|
|
27
29
|
|
@@ -133,7 +135,7 @@ function generateMessageProperties(params) {
|
|
133
135
|
const out = [];
|
134
136
|
for (const [languageTag, keyValueMap] of Object.entries(keyValueMapByLanguageTag)) {
|
135
137
|
const propertiesFileSource = Object.entries(keyValueMap)
|
136
|
-
.map(([key, value]) => `${key}=${
|
138
|
+
.map(([key, value]) => `${key}=${(0,_tools_escapeStringForPropertiesFile__WEBPACK_IMPORTED_MODULE_9__/* .escapeStringForPropertiesFile */ .y)(value)}`)
|
137
139
|
.join("\n");
|
138
140
|
out.push({
|
139
141
|
languageTag,
|
@@ -149,69 +151,6 @@ function generateMessageProperties(params) {
|
|
149
151
|
}
|
150
152
|
return out;
|
151
153
|
}
|
152
|
-
// Convert a JavaScript string to UTF-16 encoding
|
153
|
-
function toUTF16(codePoint) {
|
154
|
-
if (codePoint <= 0xffff) {
|
155
|
-
// BMP character
|
156
|
-
return "\\u" + codePoint.toString(16).padStart(4, "0");
|
157
|
-
}
|
158
|
-
else {
|
159
|
-
// Non-BMP character
|
160
|
-
codePoint -= 0x10000;
|
161
|
-
let highSurrogate = (codePoint >> 10) + 0xd800;
|
162
|
-
let lowSurrogate = (codePoint % 0x400) + 0xdc00;
|
163
|
-
return ("\\u" +
|
164
|
-
highSurrogate.toString(16).padStart(4, "0") +
|
165
|
-
"\\u" +
|
166
|
-
lowSurrogate.toString(16).padStart(4, "0"));
|
167
|
-
}
|
168
|
-
}
|
169
|
-
// Escapes special characters for use in a .properties file
|
170
|
-
function escapeString(str) {
|
171
|
-
let escapedStr = "";
|
172
|
-
for (const char of [...str]) {
|
173
|
-
const codePoint = char.codePointAt(0);
|
174
|
-
if (!codePoint)
|
175
|
-
continue;
|
176
|
-
switch (char) {
|
177
|
-
case "\n":
|
178
|
-
escapedStr += "\\n";
|
179
|
-
break;
|
180
|
-
case "\r":
|
181
|
-
escapedStr += "\\r";
|
182
|
-
break;
|
183
|
-
case "\t":
|
184
|
-
escapedStr += "\\t";
|
185
|
-
break;
|
186
|
-
case "\\":
|
187
|
-
escapedStr += "\\\\";
|
188
|
-
break;
|
189
|
-
case ":":
|
190
|
-
escapedStr += "\\:";
|
191
|
-
break;
|
192
|
-
case "=":
|
193
|
-
escapedStr += "\\=";
|
194
|
-
break;
|
195
|
-
case "#":
|
196
|
-
escapedStr += "\\#";
|
197
|
-
break;
|
198
|
-
case "!":
|
199
|
-
escapedStr += "\\!";
|
200
|
-
break;
|
201
|
-
case "'":
|
202
|
-
escapedStr += "''";
|
203
|
-
break;
|
204
|
-
default:
|
205
|
-
if (codePoint > 0x7f) {
|
206
|
-
escapedStr += toUTF16(codePoint); // Non-ASCII characters
|
207
|
-
}
|
208
|
-
else {
|
209
|
-
escapedStr += char; // ASCII character needs no escape
|
210
|
-
}
|
211
|
-
}
|
212
|
-
}
|
213
|
-
return escapedStr;
|
214
|
-
}
|
215
154
|
//# sourceMappingURL=generateMessageProperties.js.map
|
216
155
|
|
217
156
|
/***/ }),
|
@@ -270,27 +209,27 @@ function replaceAll(string, searchValue, replaceValue) {
|
|
270
209
|
|
271
210
|
(0,assert.assert)();
|
272
211
|
function replaceImportsInJsCode_vite(params) {
|
273
|
-
const { jsCode,
|
212
|
+
const { jsCode, buildContext, basenameOfAssetsFiles, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
|
274
213
|
const { relative: pathRelative, sep: pathSep } = external_path_[systemType];
|
275
214
|
let fixedJsCode = jsCode;
|
276
215
|
replace_base_javacript_import: {
|
277
|
-
if (
|
216
|
+
if (buildContext.urlPathname === undefined) {
|
278
217
|
break replace_base_javacript_import;
|
279
218
|
}
|
280
219
|
// Optimization
|
281
|
-
if (!jsCode.includes(
|
220
|
+
if (!jsCode.includes(buildContext.urlPathname)) {
|
282
221
|
break replace_base_javacript_import;
|
283
222
|
}
|
284
223
|
// Replace `Hv=function(e){return"/abcde12345/"+e}` by `Hv=function(e){return"/"+e}`
|
285
|
-
fixedJsCode = fixedJsCode.replace(new RegExp(`([\\w\\$][\\w\\d\\$]*)=function\\(([\\w\\$][\\w\\d\\$]*)\\)\\{return"${replaceAll(
|
224
|
+
fixedJsCode = fixedJsCode.replace(new RegExp(`([\\w\\$][\\w\\d\\$]*)=function\\(([\\w\\$][\\w\\d\\$]*)\\)\\{return"${replaceAll(buildContext.urlPathname, "/", "\\/")}"\\+\\2\\}`, "g"), (...[, funcName, paramName]) => `${funcName}=function(${paramName}){return"/"+${paramName}}`);
|
286
225
|
}
|
287
226
|
replace_javascript_relatives_import_paths: {
|
288
227
|
// Example: "assets/ or "foo/bar/"
|
289
228
|
const staticDir = (() => {
|
290
|
-
let out = pathRelative(
|
229
|
+
let out = pathRelative(buildContext.projectBuildDirPath, buildContext.assetsDirPath);
|
291
230
|
out = replaceAll(out, pathSep, "/") + "/";
|
292
231
|
if (out === "/") {
|
293
|
-
throw new Error(`The assetsDirPath must be a subdirectory of
|
232
|
+
throw new Error(`The assetsDirPath must be a subdirectory of projectBuildDirPath`);
|
294
233
|
}
|
295
234
|
return out;
|
296
235
|
})();
|
@@ -303,7 +242,7 @@ function replaceImportsInJsCode_vite(params) {
|
|
303
242
|
.forEach(relativePathOfAssetFile => {
|
304
243
|
var _a;
|
305
244
|
fixedJsCode = replaceAll(fixedJsCode, `"${relativePathOfAssetFile}"`, `(window.${constants/* nameOfTheGlobal */.X4}.url.resourcesPath.substring(1) + "/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${relativePathOfAssetFile}")`);
|
306
|
-
fixedJsCode = replaceAll(fixedJsCode, `"${(_a =
|
245
|
+
fixedJsCode = replaceAll(fixedJsCode, `"${(_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/"}${relativePathOfAssetFile}"`, `(window.${constants/* nameOfTheGlobal */.X4}.url.resourcesPath + "/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${relativePathOfAssetFile}")`);
|
307
246
|
});
|
308
247
|
}
|
309
248
|
return { fixedJsCode };
|
@@ -316,19 +255,19 @@ function replaceImportsInJsCode_vite(params) {
|
|
316
255
|
|
317
256
|
(0,assert.assert)();
|
318
257
|
function replaceImportsInJsCode_webpack(params) {
|
319
|
-
const { jsCode,
|
258
|
+
const { jsCode, buildContext, systemType = external_path_.sep === "/" ? "posix" : "win32" } = params;
|
320
259
|
const { relative: pathRelative, sep: pathSep } = external_path_[systemType];
|
321
260
|
let fixedJsCode = jsCode;
|
322
|
-
if (
|
261
|
+
if (buildContext.urlPathname !== undefined) {
|
323
262
|
// "__esModule",{value:!0})},n.p="/foo-bar/",function(){if("undefined" -> ... n.p="/" ...
|
324
|
-
fixedJsCode = fixedJsCode.replace(new RegExp(`,([a-zA-Z]\\.[a-zA-Z])="${replaceAll(
|
263
|
+
fixedJsCode = fixedJsCode.replace(new RegExp(`,([a-zA-Z]\\.[a-zA-Z])="${replaceAll(buildContext.urlPathname, "/", "\\/")}",`, "g"), (...[, assignTo]) => `,${assignTo}="/",`);
|
325
264
|
}
|
326
265
|
// Example: "static/ or "foo/bar/"
|
327
266
|
const staticDir = (() => {
|
328
|
-
let out = pathRelative(
|
267
|
+
let out = pathRelative(buildContext.projectBuildDirPath, buildContext.assetsDirPath);
|
329
268
|
out = replaceAll(out, pathSep, "/") + "/";
|
330
269
|
if (out === "/") {
|
331
|
-
throw new Error(`The assetsDirPath must be a subdirectory of
|
270
|
+
throw new Error(`The assetsDirPath must be a subdirectory of projectBuildDirPath`);
|
332
271
|
}
|
333
272
|
return out;
|
334
273
|
})();
|
@@ -368,21 +307,21 @@ function replaceImportsInJsCode_webpack(params) {
|
|
368
307
|
|
369
308
|
(0,assert.assert)();
|
370
309
|
function replaceImportsInJsCode(params) {
|
371
|
-
const { jsCode,
|
310
|
+
const { jsCode, buildContext } = params;
|
372
311
|
const { fixedJsCode } = (() => {
|
373
|
-
switch (
|
312
|
+
switch (buildContext.bundler) {
|
374
313
|
case "vite":
|
375
314
|
return replaceImportsInJsCode_vite({
|
376
315
|
jsCode,
|
377
|
-
|
316
|
+
buildContext,
|
378
317
|
basenameOfAssetsFiles: readAssetsDirSync({
|
379
|
-
assetsDirPath: params.
|
318
|
+
assetsDirPath: params.buildContext.assetsDirPath
|
380
319
|
})
|
381
320
|
});
|
382
321
|
case "webpack":
|
383
322
|
return replaceImportsInJsCode_webpack({
|
384
323
|
jsCode,
|
385
|
-
|
324
|
+
buildContext
|
386
325
|
});
|
387
326
|
}
|
388
327
|
})();
|
@@ -433,7 +372,7 @@ function replaceImportsInCssCode(params) {
|
|
433
372
|
return { fixedCssCode, cssGlobalsToDefine };
|
434
373
|
}
|
435
374
|
function generateCssCodeToDefineGlobals(params) {
|
436
|
-
const { cssGlobalsToDefine,
|
375
|
+
const { cssGlobalsToDefine, buildContext } = params;
|
437
376
|
return {
|
438
377
|
cssCodeToPrependInHead: [
|
439
378
|
":root {",
|
@@ -442,7 +381,7 @@ function generateCssCodeToDefineGlobals(params) {
|
|
442
381
|
var _a;
|
443
382
|
return [
|
444
383
|
`--${cssVariableName}:`,
|
445
|
-
cssGlobalsToDefine[cssVariableName].replace(new RegExp(`url\\(${((_a =
|
384
|
+
cssGlobalsToDefine[cssVariableName].replace(new RegExp(`url\\(${((_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`, "g"), `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`)
|
446
385
|
].join(" ");
|
447
386
|
})
|
448
387
|
.map(line => ` ${line};`),
|
@@ -458,10 +397,10 @@ var esm = __webpack_require__(87182);
|
|
458
397
|
|
459
398
|
(0,assert.assert)();
|
460
399
|
function replaceImportsInInlineCssCode(params) {
|
461
|
-
const { cssCode,
|
462
|
-
const fixedCssCode = cssCode.replace(
|
400
|
+
const { cssCode, buildContext } = params;
|
401
|
+
const fixedCssCode = cssCode.replace(buildContext.urlPathname === undefined
|
463
402
|
? /url\(["']?\/([^/][^)"']+)["']?\)/g
|
464
|
-
: new RegExp(`url\\(["']?${
|
403
|
+
: new RegExp(`url\\(["']?${buildContext.urlPathname}([^)"']+)["']?\\)`, "g"), (...[, group]) => `url(\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/${group})`);
|
465
404
|
return { fixedCssCode };
|
466
405
|
}
|
467
406
|
//# sourceMappingURL=replaceImportsInInlineCssCode.js.map
|
@@ -480,7 +419,7 @@ var getThisCodebaseRootDirPath = __webpack_require__(58822);
|
|
480
419
|
(0,assert.assert)();
|
481
420
|
function generateFtlFilesCodeFactory(params) {
|
482
421
|
var _a;
|
483
|
-
const { themeName, cssGlobalsToDefine, indexHtmlCode,
|
422
|
+
const { themeName, cssGlobalsToDefine, indexHtmlCode, buildContext, keycloakifyVersion, themeType, fieldNames } = params;
|
484
423
|
const $ = esm/* default.load */.ZP.load(indexHtmlCode);
|
485
424
|
fix_imports_statements: {
|
486
425
|
$("script:not([src])").each((...[, element]) => {
|
@@ -488,7 +427,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
488
427
|
(0,assert.assert)(jsCode !== null);
|
489
428
|
const { fixedJsCode } = replaceImportsInJsCode({
|
490
429
|
jsCode,
|
491
|
-
|
430
|
+
buildContext
|
492
431
|
});
|
493
432
|
$(element).text(fixedJsCode);
|
494
433
|
});
|
@@ -497,7 +436,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
497
436
|
(0,assert.assert)(cssCode !== null);
|
498
437
|
const { fixedCssCode } = replaceImportsInInlineCssCode({
|
499
438
|
cssCode,
|
500
|
-
|
439
|
+
buildContext
|
501
440
|
});
|
502
441
|
$(element).text(fixedCssCode);
|
503
442
|
});
|
@@ -510,7 +449,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
510
449
|
if (href === undefined) {
|
511
450
|
return;
|
512
451
|
}
|
513
|
-
$(element).attr(attrName, href.replace(new RegExp(`^${((_a =
|
452
|
+
$(element).attr(attrName, href.replace(new RegExp(`^${((_a = buildContext.urlPathname) !== null && _a !== void 0 ? _a : "/").replace(/\//g, "\\/")}`), `\${url.resourcesPath}/${constants/* basenameOfTheKeycloakifyResourcesDir */.M}/`));
|
514
453
|
}));
|
515
454
|
if (Object.keys(cssGlobalsToDefine).length !== 0) {
|
516
455
|
$("head").prepend([
|
@@ -518,7 +457,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
518
457
|
"<style>",
|
519
458
|
generateCssCodeToDefineGlobals({
|
520
459
|
cssGlobalsToDefine,
|
521
|
-
|
460
|
+
buildContext
|
522
461
|
}).cssCodeToPrependInHead,
|
523
462
|
"</style>",
|
524
463
|
""
|
@@ -531,12 +470,12 @@ function generateFtlFilesCodeFactory(params) {
|
|
531
470
|
.match(/^<script>const _=((?:.|\n)+)<\/script>[\n]?$/)[1]
|
532
471
|
.replace("FIELD_NAMES_eKsIY4ZsZ4xeM", fieldNames.map(name => `"${name}"`).join(", "))
|
533
472
|
.replace("KEYCLOAKIFY_VERSION_xEdKd3xEdr", keycloakifyVersion)
|
534
|
-
.replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx",
|
473
|
+
.replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx", buildContext.themeVersion)
|
535
474
|
.replace("KEYCLOAKIFY_THEME_TYPE_dExKd3xEdr", themeType)
|
536
475
|
.replace("KEYCLOAKIFY_THEME_NAME_cXxKd3xEer", themeName)
|
537
476
|
.replace("RESOURCES_COMMON_cLsLsMrtDkpVv", constants/* resources_common */.z0)
|
538
477
|
.replace("lOCALIZATION_REALM_OVERRIDES_USER_PROFILE_PROPERTY_KEY_aaGLsPgGIdeeX", constants/* nameOfTheLocalizationRealmOverridesUserProfileProperty */.lg)
|
539
|
-
.replace("USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2", (_a =
|
478
|
+
.replace("USER_DEFINED_EXCLUSIONS_eKsaY4ZsZ4eMr2", (_a = buildContext.kcContextExclusionsFtlCode) !== null && _a !== void 0 ? _a : "");
|
540
479
|
const ftlObjectToJsCodeDeclaringAnObjectPlaceholder = '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
541
480
|
$("head").prepend(`<script>\nwindow.${constants/* nameOfTheGlobal */.X4}=${ftlObjectToJsCodeDeclaringAnObjectPlaceholder}</script>`);
|
542
481
|
// Remove part of the document marked as ignored.
|
@@ -694,12 +633,12 @@ var downloadKeycloakDefaultTheme = __webpack_require__(61804);
|
|
694
633
|
|
695
634
|
(0,assert.assert)();
|
696
635
|
async function bringInAccountV1(params) {
|
697
|
-
const {
|
636
|
+
const { buildContext } = params;
|
698
637
|
const { defaultThemeDirPath } = await (0,downloadKeycloakDefaultTheme/* downloadKeycloakDefaultTheme */.x)({
|
699
638
|
keycloakVersion: constants/* lastKeycloakVersionWithAccountV1 */.v$,
|
700
|
-
|
639
|
+
buildContext
|
701
640
|
});
|
702
|
-
const accountV1DirPath = (0,external_path_.join)(
|
641
|
+
const accountV1DirPath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", constants/* accountV1ThemeName */.y_, "account");
|
703
642
|
(0,transformCodebase/* transformCodebase */.N)({
|
704
643
|
srcDirPath: (0,external_path_.join)(defaultThemeDirPath, "base", "account"),
|
705
644
|
destDirPath: accountV1DirPath
|
@@ -751,6 +690,8 @@ var readThisNpmPackageVersion = __webpack_require__(64795);
|
|
751
690
|
var shared_metaInfKeycloakThemes = __webpack_require__(26914);
|
752
691
|
// EXTERNAL MODULE: ./node_modules/tsafe/objectEntries.js
|
753
692
|
var objectEntries = __webpack_require__(39612);
|
693
|
+
// EXTERNAL MODULE: ./dist/bin/tools/escapeStringForPropertiesFile.js
|
694
|
+
var escapeStringForPropertiesFile = __webpack_require__(27190);
|
754
695
|
;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.js
|
755
696
|
|
756
697
|
|
@@ -771,16 +712,17 @@ var objectEntries = __webpack_require__(39612);
|
|
771
712
|
|
772
713
|
|
773
714
|
|
715
|
+
|
774
716
|
(0,assert.assert)();
|
775
717
|
async function generateSrcMainResourcesForMainTheme(params) {
|
776
718
|
var _a;
|
777
|
-
const { themeName,
|
719
|
+
const { themeName, buildContext } = params;
|
778
720
|
const { themeSrcDirPath } = (0,getThemeSrcDirPath/* getThemeSrcDirPath */.f)({
|
779
|
-
|
721
|
+
projectDirPath: buildContext.projectDirPath
|
780
722
|
});
|
781
723
|
const getThemeTypeDirPath = (params) => {
|
782
724
|
const { themeType } = params;
|
783
|
-
return (0,external_path_.join)(
|
725
|
+
return (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName, themeType);
|
784
726
|
};
|
785
727
|
const cssGlobalsToDefine = {};
|
786
728
|
const implementedThemeTypes = {
|
@@ -809,13 +751,13 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
809
751
|
break apply_replacers_and_move_to_theme_resources;
|
810
752
|
}
|
811
753
|
(0,transformCodebase/* transformCodebase */.N)({
|
812
|
-
srcDirPath:
|
754
|
+
srcDirPath: buildContext.projectBuildDirPath,
|
813
755
|
destDirPath,
|
814
756
|
transformSourceCode: ({ filePath, sourceCode }) => {
|
815
757
|
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
816
758
|
// This should not happen if users follow the new instruction setup but we keep it for retrocompatibility.
|
817
759
|
if ((0,isInside/* isInside */.V)({
|
818
|
-
dirPath: (0,external_path_.join)(
|
760
|
+
dirPath: (0,external_path_.join)(buildContext.projectBuildDirPath, constants/* keycloak_resources */.N$),
|
819
761
|
filePath
|
820
762
|
})) {
|
821
763
|
return undefined;
|
@@ -834,7 +776,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
834
776
|
if (/\.js?$/i.test(filePath)) {
|
835
777
|
const { fixedJsCode } = replaceImportsInJsCode({
|
836
778
|
jsCode: sourceCode.toString("utf8"),
|
837
|
-
|
779
|
+
buildContext
|
838
780
|
});
|
839
781
|
return {
|
840
782
|
modifiedSourceCode: Buffer.from(fixedJsCode, "utf8")
|
@@ -846,10 +788,10 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
846
788
|
}
|
847
789
|
const { generateFtlFilesCode } = generateFtlFilesCodeFactory({
|
848
790
|
themeName,
|
849
|
-
indexHtmlCode: external_fs_.readFileSync((0,external_path_.join)(
|
791
|
+
indexHtmlCode: external_fs_.readFileSync((0,external_path_.join)(buildContext.projectBuildDirPath, "index.html"))
|
850
792
|
.toString("utf8"),
|
851
793
|
cssGlobalsToDefine,
|
852
|
-
|
794
|
+
buildContext,
|
853
795
|
keycloakifyVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
|
854
796
|
themeType,
|
855
797
|
fieldNames: readFieldNameUsage({
|
@@ -892,12 +834,12 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
892
834
|
case "account":
|
893
835
|
return constants/* lastKeycloakVersionWithAccountV1 */.v$;
|
894
836
|
case "login":
|
895
|
-
return
|
837
|
+
return buildContext.loginThemeResourcesFromKeycloakVersion;
|
896
838
|
}
|
897
839
|
})(),
|
898
840
|
themeDirPath: (0,external_path_.resolve)((0,external_path_.join)(themeTypeDirPath, "..")),
|
899
841
|
themeType,
|
900
|
-
|
842
|
+
buildContext
|
901
843
|
});
|
902
844
|
external_fs_.writeFileSync((0,external_path_.join)(themeTypeDirPath, "theme.properties"), Buffer.from([
|
903
845
|
`parent=${(() => {
|
@@ -909,7 +851,8 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
909
851
|
}
|
910
852
|
(0,assert.assert)(false);
|
911
853
|
})()}`,
|
912
|
-
...((_a =
|
854
|
+
...((_a = buildContext.extraThemeProperties) !== null && _a !== void 0 ? _a : []),
|
855
|
+
buildContext.environmentVariables.map(({ name, default: defaultValue }) => `${name}=\${env.${name}:${(0,escapeStringForPropertiesFile/* escapeStringForPropertiesFile */.y)(defaultValue)}}`)
|
913
856
|
].join("\n\n"), "utf8"));
|
914
857
|
}
|
915
858
|
email: {
|
@@ -925,7 +868,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
925
868
|
}
|
926
869
|
if (implementedThemeTypes.account) {
|
927
870
|
await bringInAccountV1({
|
928
|
-
|
871
|
+
buildContext
|
929
872
|
});
|
930
873
|
}
|
931
874
|
{
|
@@ -943,7 +886,7 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
943
886
|
});
|
944
887
|
}
|
945
888
|
(0,shared_metaInfKeycloakThemes/* writeMetaInfKeycloakThemes */.JJ)({
|
946
|
-
keycloakifyBuildDirPath:
|
889
|
+
keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
|
947
890
|
metaInfKeycloakThemes
|
948
891
|
});
|
949
892
|
}
|
@@ -956,8 +899,8 @@ async function generateSrcMainResourcesForMainTheme(params) {
|
|
956
899
|
|
957
900
|
(0,assert.assert)();
|
958
901
|
function generateSrcMainResourcesForThemeVariant(params) {
|
959
|
-
const { themeName, themeVariantName,
|
960
|
-
const mainThemeDirPath = (0,external_path_.join)(
|
902
|
+
const { themeName, themeVariantName, buildContext } = params;
|
903
|
+
const mainThemeDirPath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName);
|
961
904
|
(0,transformCodebase/* transformCodebase */.N)({
|
962
905
|
srcDirPath: mainThemeDirPath,
|
963
906
|
destDirPath: (0,external_path_.join)(mainThemeDirPath, "..", themeVariantName),
|
@@ -975,7 +918,7 @@ function generateSrcMainResourcesForThemeVariant(params) {
|
|
975
918
|
});
|
976
919
|
{
|
977
920
|
const updatedMetaInfKeycloakThemes = (0,shared_metaInfKeycloakThemes/* readMetaInfKeycloakThemes */.As)({
|
978
|
-
keycloakifyBuildDirPath:
|
921
|
+
keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
|
979
922
|
});
|
980
923
|
updatedMetaInfKeycloakThemes.themes.push({
|
981
924
|
name: themeVariantName,
|
@@ -986,7 +929,7 @@ function generateSrcMainResourcesForThemeVariant(params) {
|
|
986
929
|
})()
|
987
930
|
});
|
988
931
|
(0,shared_metaInfKeycloakThemes/* writeMetaInfKeycloakThemes */.JJ)({
|
989
|
-
keycloakifyBuildDirPath:
|
932
|
+
keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath,
|
990
933
|
metaInfKeycloakThemes: updatedMetaInfKeycloakThemes
|
991
934
|
});
|
992
935
|
}
|
@@ -998,17 +941,17 @@ function generateSrcMainResourcesForThemeVariant(params) {
|
|
998
941
|
|
999
942
|
(0,assert.assert)();
|
1000
943
|
async function generateSrcMainResources(params) {
|
1001
|
-
const {
|
1002
|
-
const [themeName, ...themeVariantNames] =
|
944
|
+
const { buildContext } = params;
|
945
|
+
const [themeName, ...themeVariantNames] = buildContext.themeNames;
|
1003
946
|
await generateSrcMainResourcesForMainTheme({
|
1004
947
|
themeName,
|
1005
|
-
|
948
|
+
buildContext
|
1006
949
|
});
|
1007
950
|
for (const themeVariantName of themeVariantNames) {
|
1008
951
|
generateSrcMainResourcesForThemeVariant({
|
1009
952
|
themeName,
|
1010
953
|
themeVariantName,
|
1011
|
-
|
954
|
+
buildContext
|
1012
955
|
});
|
1013
956
|
}
|
1014
957
|
}
|
@@ -1019,8 +962,8 @@ async function generateSrcMainResources(params) {
|
|
1019
962
|
// EXTERNAL MODULE: external "child_process"
|
1020
963
|
var external_child_process_ = __webpack_require__(32081);
|
1021
964
|
var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
|
1022
|
-
// EXTERNAL MODULE: ./dist/bin/shared/
|
1023
|
-
var
|
965
|
+
// EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
|
966
|
+
var shared_buildContext = __webpack_require__(87751);
|
1024
967
|
// EXTERNAL MODULE: ./node_modules/tsafe/exclude.js
|
1025
968
|
var exclude = __webpack_require__(41370);
|
1026
969
|
;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/extensionVersions.js
|
@@ -1088,7 +1031,7 @@ var promises_ = __webpack_require__(73292);
|
|
1088
1031
|
|
1089
1032
|
(0,assert.assert)();
|
1090
1033
|
function generatePom(params) {
|
1091
|
-
const { keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion,
|
1034
|
+
const { keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildContext } = params;
|
1092
1035
|
const { pomFileCode } = (function generatePomFileCode() {
|
1093
1036
|
const pomFileCode = [
|
1094
1037
|
`<?xml version="1.0"?>`,
|
@@ -1096,10 +1039,10 @@ function generatePom(params) {
|
|
1096
1039
|
` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`,
|
1097
1040
|
` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">`,
|
1098
1041
|
` <modelVersion>4.0.0</modelVersion>`,
|
1099
|
-
` <groupId>${
|
1100
|
-
` <artifactId>${
|
1101
|
-
` <version>${
|
1102
|
-
` <name>${
|
1042
|
+
` <groupId>${buildContext.groupId}</groupId>`,
|
1043
|
+
` <artifactId>${buildContext.artifactId}</artifactId>`,
|
1044
|
+
` <version>${buildContext.themeVersion}</version>`,
|
1045
|
+
` <name>${buildContext.artifactId}</name>`,
|
1103
1046
|
` <description />`,
|
1104
1047
|
` <packaging>jar</packaging>`,
|
1105
1048
|
` <properties>`,
|
@@ -1168,8 +1111,8 @@ function generatePom(params) {
|
|
1168
1111
|
|
1169
1112
|
(0,assert.assert)();
|
1170
1113
|
async function buildJar(params) {
|
1171
|
-
const { jarFileBasename, keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion,
|
1172
|
-
const keycloakifyBuildTmpDirPath = (0,external_path_.join)(
|
1114
|
+
const { jarFileBasename, keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, buildContext } = params;
|
1115
|
+
const keycloakifyBuildTmpDirPath = (0,external_path_.join)(buildContext.cacheDirPath, jarFileBasename.replace(".jar", ""));
|
1173
1116
|
(0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true, force: true });
|
1174
1117
|
{
|
1175
1118
|
const transformCodebase_common = (params) => {
|
@@ -1178,7 +1121,7 @@ async function buildJar(params) {
|
|
1178
1121
|
(0,shared_metaInfKeycloakThemes/* getMetaInfKeycloakThemesJsonFilePath */.KQ)({ keycloakifyBuildDirPath: "." })) {
|
1179
1122
|
return { modifiedSourceCode: sourceCode };
|
1180
1123
|
}
|
1181
|
-
for (const themeName of [...
|
1124
|
+
for (const themeName of [...buildContext.themeNames, constants/* accountV1ThemeName */.y_]) {
|
1182
1125
|
if ((0,isInside/* isInside */.V)({
|
1183
1126
|
dirPath: (0,external_path_.join)("src", "main", "resources", "theme", themeName),
|
1184
1127
|
filePath: fileRelativePath
|
@@ -1209,7 +1152,7 @@ async function buildJar(params) {
|
|
1209
1152
|
modifiedSourceCode: Buffer.from(JSON.stringify(keycloakThemesJsonParsed, null, 2), "utf8")
|
1210
1153
|
};
|
1211
1154
|
}
|
1212
|
-
for (const themeName of
|
1155
|
+
for (const themeName of buildContext.themeNames) {
|
1213
1156
|
if (fileRelativePath ===
|
1214
1157
|
(0,external_path_.join)("src", "main", "resources", "theme", themeName, "account", "theme.properties")) {
|
1215
1158
|
const modifiedSourceCode = Buffer.from(sourceCode
|
@@ -1222,7 +1165,7 @@ async function buildJar(params) {
|
|
1222
1165
|
return { modifiedSourceCode: sourceCode };
|
1223
1166
|
};
|
1224
1167
|
(0,transformCodebase/* transformCodebase */.N)({
|
1225
|
-
srcDirPath:
|
1168
|
+
srcDirPath: buildContext.keycloakifyBuildDirPath,
|
1226
1169
|
destDirPath: keycloakifyBuildTmpDirPath,
|
1227
1170
|
transformSourceCode: params => {
|
1228
1171
|
const resultCommon = transformCodebase_common(params);
|
@@ -1254,7 +1197,7 @@ async function buildJar(params) {
|
|
1254
1197
|
if (doBreak) {
|
1255
1198
|
break route_legacy_pages;
|
1256
1199
|
}
|
1257
|
-
["register.ftl", "login-update-profile.ftl"].forEach(pageId =>
|
1200
|
+
["register.ftl", "login-update-profile.ftl"].forEach(pageId => buildContext.themeNames.map(themeName => {
|
1258
1201
|
const ftlFilePath = (0,external_path_.join)(keycloakifyBuildTmpDirPath, "src", "main", "resources", "theme", themeName, "login", pageId);
|
1259
1202
|
const ftlFileContent = (0,external_fs_.readFileSync)(ftlFilePath).toString("utf8");
|
1260
1203
|
const realPageId = (() => {
|
@@ -1273,7 +1216,7 @@ async function buildJar(params) {
|
|
1273
1216
|
}
|
1274
1217
|
{
|
1275
1218
|
const { pomFileCode } = generatePom({
|
1276
|
-
|
1219
|
+
buildContext,
|
1277
1220
|
keycloakAccountV1Version,
|
1278
1221
|
keycloakThemeAdditionalInfoExtensionVersion
|
1279
1222
|
});
|
@@ -1291,7 +1234,7 @@ async function buildJar(params) {
|
|
1291
1234
|
}
|
1292
1235
|
resolve();
|
1293
1236
|
}));
|
1294
|
-
await promises_.rename((0,external_path_.join)(keycloakifyBuildTmpDirPath, "target", `${
|
1237
|
+
await promises_.rename((0,external_path_.join)(keycloakifyBuildTmpDirPath, "target", `${buildContext.artifactId}-${buildContext.themeVersion}.jar`), (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, jarFileBasename));
|
1295
1238
|
(0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true });
|
1296
1239
|
}
|
1297
1240
|
//# sourceMappingURL=buildJar.js.map
|
@@ -1308,9 +1251,9 @@ var getJarFileBasename = __webpack_require__(2323);
|
|
1308
1251
|
|
1309
1252
|
(0,assert.assert)();
|
1310
1253
|
async function buildJars(params) {
|
1311
|
-
const {
|
1254
|
+
const { buildContext } = params;
|
1312
1255
|
const doesImplementAccountTheme = (0,shared_metaInfKeycloakThemes/* readMetaInfKeycloakThemes */.As)({
|
1313
|
-
keycloakifyBuildDirPath:
|
1256
|
+
keycloakifyBuildDirPath: buildContext.keycloakifyBuildDirPath
|
1314
1257
|
}).themes.some(({ name }) => name === constants/* accountV1ThemeName */.y_);
|
1315
1258
|
await Promise.all(keycloakAccountV1Versions.map(keycloakAccountV1Version => keycloakThemeAdditionalInfoExtensionVersions.map(keycloakThemeAdditionalInfoExtensionVersion => {
|
1316
1259
|
const keycloakVersionRange = getKeycloakVersionRangeForJar({
|
@@ -1340,7 +1283,7 @@ async function buildJars(params) {
|
|
1340
1283
|
jarFileBasename,
|
1341
1284
|
keycloakAccountV1Version,
|
1342
1285
|
keycloakThemeAdditionalInfoExtensionVersion,
|
1343
|
-
|
1286
|
+
buildContext
|
1344
1287
|
})))
|
1345
1288
|
.flat());
|
1346
1289
|
}
|
@@ -1391,35 +1334,35 @@ async function command(params) {
|
|
1391
1334
|
process.exit(1);
|
1392
1335
|
}
|
1393
1336
|
const { cliCommandOptions } = params;
|
1394
|
-
const
|
1337
|
+
const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
|
1395
1338
|
console.log([
|
1396
1339
|
source_default().cyan(`keycloakify v${(0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)()}`),
|
1397
|
-
source_default().green(`Building the keycloak theme in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(),
|
1340
|
+
source_default().green(`Building the keycloak theme in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), buildContext.keycloakifyBuildDirPath)} ...`)
|
1398
1341
|
].join(" "));
|
1399
1342
|
const startTime = Date.now();
|
1400
1343
|
{
|
1401
|
-
if (!external_fs_.existsSync(
|
1402
|
-
external_fs_.mkdirSync(
|
1344
|
+
if (!external_fs_.existsSync(buildContext.keycloakifyBuildDirPath)) {
|
1345
|
+
external_fs_.mkdirSync(buildContext.keycloakifyBuildDirPath, {
|
1403
1346
|
recursive: true
|
1404
1347
|
});
|
1405
1348
|
}
|
1406
|
-
external_fs_.writeFileSync((0,external_path_.join)(
|
1349
|
+
external_fs_.writeFileSync((0,external_path_.join)(buildContext.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
1407
1350
|
}
|
1408
|
-
await generateSrcMainResources({
|
1351
|
+
await generateSrcMainResources({ buildContext });
|
1409
1352
|
run_post_build_script: {
|
1410
|
-
if (
|
1353
|
+
if (buildContext.bundler !== "vite") {
|
1411
1354
|
break run_post_build_script;
|
1412
1355
|
}
|
1413
1356
|
external_child_process_.execSync("npx vite", {
|
1414
|
-
cwd:
|
1415
|
-
env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify(
|
1357
|
+
cwd: buildContext.projectDirPath,
|
1358
|
+
env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify(buildContext) })
|
1416
1359
|
});
|
1417
1360
|
}
|
1418
1361
|
build_jars: {
|
1419
1362
|
if (process.env[constants/* skipBuildJarsEnvName */.uo]) {
|
1420
1363
|
break build_jars;
|
1421
1364
|
}
|
1422
|
-
await buildJars({
|
1365
|
+
await buildJars({ buildContext });
|
1423
1366
|
}
|
1424
1367
|
console.log(source_default().green(`✓ built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`));
|
1425
1368
|
}
|
@@ -1452,10 +1395,10 @@ async function command(params) {
|
|
1452
1395
|
|
1453
1396
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.assert)();
|
1454
1397
|
async function downloadKeycloakStaticResources(params) {
|
1455
|
-
const { themeType, themeDirPath, keycloakVersion,
|
1398
|
+
const { themeType, themeDirPath, keycloakVersion, buildContext } = params;
|
1456
1399
|
const { defaultThemeDirPath } = await (0,_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__/* .downloadKeycloakDefaultTheme */ .x)({
|
1457
1400
|
keycloakVersion,
|
1458
|
-
|
1401
|
+
buildContext
|
1459
1402
|
});
|
1460
1403
|
const resourcesDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(themeDirPath, themeType, "resources");
|
1461
1404
|
repatriate_base_resources: {
|
@@ -1518,8 +1461,8 @@ function getJarFileBasename(params) {
|
|
1518
1461
|
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
1519
1462
|
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
1520
1463
|
function getThemeSrcDirPath(params) {
|
1521
|
-
const {
|
1522
|
-
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(
|
1464
|
+
const { projectDirPath } = params;
|
1465
|
+
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
|
1523
1466
|
const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
1524
1467
|
dirPath: srcDirPath,
|
1525
1468
|
returnedPathsType: "relative to dirPath"
|
@@ -1594,6 +1537,79 @@ function writeMetaInfKeycloakThemes(params) {
|
|
1594
1537
|
}
|
1595
1538
|
//# sourceMappingURL=metaInfKeycloakThemes.js.map
|
1596
1539
|
|
1540
|
+
/***/ }),
|
1541
|
+
|
1542
|
+
/***/ 27190:
|
1543
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1544
|
+
|
1545
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1546
|
+
/* harmony export */ "y": () => (/* binding */ escapeStringForPropertiesFile)
|
1547
|
+
/* harmony export */ });
|
1548
|
+
// Convert a JavaScript string to UTF-16 encoding
|
1549
|
+
function toUTF16(codePoint) {
|
1550
|
+
if (codePoint <= 0xffff) {
|
1551
|
+
// BMP character
|
1552
|
+
return "\\u" + codePoint.toString(16).padStart(4, "0");
|
1553
|
+
}
|
1554
|
+
else {
|
1555
|
+
// Non-BMP character
|
1556
|
+
codePoint -= 0x10000;
|
1557
|
+
let highSurrogate = (codePoint >> 10) + 0xd800;
|
1558
|
+
let lowSurrogate = (codePoint % 0x400) + 0xdc00;
|
1559
|
+
return ("\\u" +
|
1560
|
+
highSurrogate.toString(16).padStart(4, "0") +
|
1561
|
+
"\\u" +
|
1562
|
+
lowSurrogate.toString(16).padStart(4, "0"));
|
1563
|
+
}
|
1564
|
+
}
|
1565
|
+
// Escapes special characters for use in a .properties file
|
1566
|
+
function escapeStringForPropertiesFile(str) {
|
1567
|
+
let escapedStr = "";
|
1568
|
+
for (const char of [...str]) {
|
1569
|
+
const codePoint = char.codePointAt(0);
|
1570
|
+
if (!codePoint)
|
1571
|
+
continue;
|
1572
|
+
switch (char) {
|
1573
|
+
case "\n":
|
1574
|
+
escapedStr += "\\n";
|
1575
|
+
break;
|
1576
|
+
case "\r":
|
1577
|
+
escapedStr += "\\r";
|
1578
|
+
break;
|
1579
|
+
case "\t":
|
1580
|
+
escapedStr += "\\t";
|
1581
|
+
break;
|
1582
|
+
case "\\":
|
1583
|
+
escapedStr += "\\\\";
|
1584
|
+
break;
|
1585
|
+
case ":":
|
1586
|
+
escapedStr += "\\:";
|
1587
|
+
break;
|
1588
|
+
case "=":
|
1589
|
+
escapedStr += "\\=";
|
1590
|
+
break;
|
1591
|
+
case "#":
|
1592
|
+
escapedStr += "\\#";
|
1593
|
+
break;
|
1594
|
+
case "!":
|
1595
|
+
escapedStr += "\\!";
|
1596
|
+
break;
|
1597
|
+
case "'":
|
1598
|
+
escapedStr += "''";
|
1599
|
+
break;
|
1600
|
+
default:
|
1601
|
+
if (codePoint > 0x7f) {
|
1602
|
+
escapedStr += toUTF16(codePoint); // Non-ASCII characters
|
1603
|
+
}
|
1604
|
+
else {
|
1605
|
+
escapedStr += char; // ASCII character needs no escape
|
1606
|
+
}
|
1607
|
+
}
|
1608
|
+
}
|
1609
|
+
return escapedStr;
|
1610
|
+
}
|
1611
|
+
//# sourceMappingURL=escapeStringForPropertiesFile.js.map
|
1612
|
+
|
1597
1613
|
/***/ })
|
1598
1614
|
|
1599
1615
|
};
|