keycloakify 10.0.0-rc.2 → 10.0.0-rc.21
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/PUBLIC_URL.js +1 -1
- package/PUBLIC_URL.js.map +1 -1
- package/account/Fallback.js +3 -0
- package/account/Fallback.js.map +1 -1
- package/account/Template.js +7 -7
- package/account/Template.js.map +1 -1
- package/account/i18n/baseMessages/index.js.map +1 -1
- package/account/i18n/i18n.d.ts +3 -4
- package/account/i18n/i18n.js +38 -31
- package/account/i18n/i18n.js.map +1 -1
- package/account/index.d.ts +1 -1
- package/account/kcContext/KcContext.d.ts +62 -59
- package/account/kcContext/KcContext.js.map +1 -1
- package/account/kcContext/createGetKcContext.d.ts +3 -3
- package/account/kcContext/createGetKcContext.js +20 -15
- package/account/kcContext/createGetKcContext.js.map +1 -1
- package/account/kcContext/getKcContext.js.map +1 -1
- package/account/kcContext/getKcContextFromWindow.d.ts +3 -1
- package/account/kcContext/getKcContextFromWindow.js +1 -1
- package/account/kcContext/getKcContextFromWindow.js.map +1 -1
- package/account/kcContext/kcContextMocks.js +155 -143
- package/account/kcContext/kcContextMocks.js.map +1 -1
- package/account/lib/useGetClassName.js +14 -14
- package/account/lib/useGetClassName.js.map +1 -1
- package/account/pages/Account.js +2 -2
- package/account/pages/Account.js.map +1 -1
- package/account/pages/Applications.js +3 -3
- package/account/pages/Applications.js.map +1 -1
- package/account/pages/FederatedIdentity.d.ts +7 -0
- package/account/pages/FederatedIdentity.js +8 -0
- package/account/pages/FederatedIdentity.js.map +1 -0
- package/account/pages/Log.js +2 -2
- package/account/pages/Log.js.map +1 -1
- package/account/pages/Password.js +9 -11
- package/account/pages/Password.js.map +1 -1
- package/account/pages/Sessions.js +1 -5
- package/account/pages/Sessions.js.map +1 -1
- package/account/pages/Totp.js +5 -5
- package/account/pages/Totp.js.map +1 -1
- package/bin/246.index.js +466 -0
- package/bin/420.index.js +508 -0
- package/bin/509.index.js +438 -0
- package/bin/772.index.js +1524 -0
- package/bin/main.js +155619 -0
- package/bin/{keycloakify/generateFtl/pageId.d.ts → shared/constants.d.ts} +16 -1
- package/bin/shared/constants.js +63 -0
- package/bin/shared/constants.js.map +1 -0
- package/lib/BASE_URL.js.map +1 -1
- package/lib/isStorybook.js +2 -1
- package/lib/isStorybook.js.map +1 -1
- package/lib/useGetClassName.js.map +1 -1
- package/login/Fallback.js.map +1 -1
- package/login/Template.js +17 -17
- package/login/Template.js.map +1 -1
- package/login/UserProfileFormFields.js +59 -59
- package/login/UserProfileFormFields.js.map +1 -1
- package/login/i18n/baseMessages/ca.d.ts +1 -1
- package/login/i18n/baseMessages/ca.js +1 -1
- package/login/i18n/baseMessages/el.d.ts +0 -1
- package/login/i18n/baseMessages/el.js +0 -1
- package/login/i18n/baseMessages/el.js.map +1 -1
- package/login/i18n/baseMessages/en.d.ts +1 -1
- package/login/i18n/baseMessages/en.js +1 -1
- package/login/i18n/baseMessages/es.d.ts +1 -1
- package/login/i18n/baseMessages/es.js +1 -1
- package/login/i18n/baseMessages/fa.d.ts +0 -1
- package/login/i18n/baseMessages/fa.js +0 -1
- package/login/i18n/baseMessages/fa.js.map +1 -1
- package/login/i18n/baseMessages/hu.d.ts +1 -1
- package/login/i18n/baseMessages/hu.js +1 -1
- package/login/i18n/baseMessages/index.d.ts +1 -2
- package/login/i18n/baseMessages/index.js.map +1 -1
- package/login/i18n/baseMessages/zh-CN.d.ts +1 -1
- package/login/i18n/baseMessages/zh-CN.js +1 -1
- package/login/i18n/i18n.d.ts +5 -5
- package/login/i18n/i18n.js +59 -41
- package/login/i18n/i18n.js.map +1 -1
- package/login/index.d.ts +1 -1
- package/login/kcContext/KcContext.d.ts +1 -0
- package/login/kcContext/KcContext.js +1 -0
- package/login/kcContext/KcContext.js.map +1 -1
- package/login/kcContext/createGetKcContext.d.ts +3 -3
- package/login/kcContext/createGetKcContext.js +30 -22
- package/login/kcContext/createGetKcContext.js.map +1 -1
- package/login/kcContext/getKcContext.js.map +1 -1
- package/login/kcContext/getKcContextFromWindow.d.ts +3 -1
- package/login/kcContext/getKcContextFromWindow.js +1 -1
- package/login/kcContext/getKcContextFromWindow.js.map +1 -1
- package/login/kcContext/kcContextMocks.js +235 -232
- package/login/kcContext/kcContextMocks.js.map +1 -1
- package/login/lib/useDownloadTerms.js +5 -6
- package/login/lib/useDownloadTerms.js.map +1 -1
- package/login/lib/useGetClassName.js +112 -112
- package/login/lib/useGetClassName.js.map +1 -1
- package/login/lib/useUserProfileForm.js +188 -188
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/login/pages/Code.js +1 -1
- package/login/pages/Code.js.map +1 -1
- package/login/pages/DeleteAccountConfirm.js +5 -1
- package/login/pages/DeleteAccountConfirm.js.map +1 -1
- package/login/pages/DeleteCredential.js +1 -1
- package/login/pages/DeleteCredential.js.map +1 -1
- package/login/pages/Error.js +1 -1
- package/login/pages/Error.js.map +1 -1
- package/login/pages/FrontchannelLogout.js +1 -1
- package/login/pages/FrontchannelLogout.js.map +1 -1
- package/login/pages/IdpReviewUserProfile.js +1 -1
- package/login/pages/IdpReviewUserProfile.js.map +1 -1
- package/login/pages/Info.js +5 -5
- package/login/pages/Info.js.map +1 -1
- package/login/pages/Login.js +4 -4
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginConfigTotp.js +2 -2
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirm.js +1 -1
- package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
- package/login/pages/LoginIdpLinkEmail.js +1 -1
- package/login/pages/LoginIdpLinkEmail.js.map +1 -1
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js +1 -1
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
- package/login/pages/LoginOauthGrant.js +2 -2
- package/login/pages/LoginOauthGrant.js.map +1 -1
- package/login/pages/LoginOtp.js +1 -1
- package/login/pages/LoginOtp.js.map +1 -1
- package/login/pages/LoginPageExpired.js +1 -1
- package/login/pages/LoginPageExpired.js.map +1 -1
- package/login/pages/LoginPassword.js +3 -3
- package/login/pages/LoginPassword.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +6 -6
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeInput.js +1 -1
- package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
- package/login/pages/LoginResetOtp.js +1 -1
- package/login/pages/LoginResetOtp.js.map +1 -1
- package/login/pages/LoginResetPassword.js +2 -2
- package/login/pages/LoginResetPassword.js.map +1 -1
- package/login/pages/LoginUpdatePassword.js +3 -3
- package/login/pages/LoginUpdatePassword.js.map +1 -1
- package/login/pages/LoginUpdateProfile.js +2 -4
- package/login/pages/LoginUpdateProfile.js.map +1 -1
- package/login/pages/LoginUsername.js +3 -3
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/LoginVerifyEmail.js +1 -1
- package/login/pages/LoginVerifyEmail.js.map +1 -1
- package/login/pages/LoginX509Info.js +1 -1
- package/login/pages/LoginX509Info.js.map +1 -1
- package/login/pages/LogoutConfirm.js +1 -1
- package/login/pages/LogoutConfirm.js.map +1 -1
- package/login/pages/Register.js +4 -8
- package/login/pages/Register.js.map +1 -1
- package/login/pages/SamlPostForm.js +1 -1
- package/login/pages/SamlPostForm.js.map +1 -1
- package/login/pages/SelectAuthenticator.js +2 -2
- package/login/pages/SelectAuthenticator.js.map +1 -1
- package/login/pages/Terms.js +1 -1
- package/login/pages/Terms.js.map +1 -1
- package/login/pages/UpdateEmail.js +3 -5
- package/login/pages/UpdateEmail.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.js +17 -14
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnError.js +2 -2
- package/login/pages/WebauthnError.js.map +1 -1
- package/login/pages/WebauthnRegister.js +10 -10
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/package.json +103 -512
- package/src/PUBLIC_URL.ts +4 -1
- package/src/account/Fallback.tsx +3 -0
- package/src/account/Template.tsx +7 -10
- package/src/account/TemplateProps.ts +4 -1
- package/src/account/i18n/i18n.tsx +44 -37
- package/src/account/index.ts +1 -1
- package/src/account/kcContext/KcContext.ts +76 -63
- package/src/account/kcContext/createGetKcContext.ts +48 -22
- package/src/account/kcContext/getKcContext.ts +3 -1
- package/src/account/kcContext/getKcContextFromWindow.ts +7 -3
- package/src/account/kcContext/kcContextMocks.ts +172 -162
- package/src/account/lib/useGetClassName.ts +15 -14
- package/src/account/pages/Account.tsx +2 -2
- package/src/account/pages/Applications.tsx +2 -2
- package/src/account/pages/FederatedIdentity.tsx +58 -0
- package/src/account/pages/Log.tsx +1 -1
- package/src/account/pages/Password.tsx +8 -8
- package/src/account/pages/Sessions.tsx +0 -3
- package/src/account/pages/Totp.tsx +23 -26
- package/src/bin/copy-keycloak-resources-to-public.ts +10 -106
- package/src/bin/download-keycloak-default-theme.ts +63 -0
- package/src/bin/eject-page.ts +176 -0
- package/src/bin/initialize-email-theme.ts +38 -29
- package/src/bin/keycloakify/buildJars/buildJar.ts +192 -72
- package/src/bin/keycloakify/buildJars/buildJars.ts +41 -23
- package/src/bin/keycloakify/buildJars/extensionVersions.ts +2 -1
- package/src/bin/keycloakify/buildJars/generatePom.ts +12 -4
- package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +73 -21
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +182 -252
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +59 -15
- package/src/bin/keycloakify/generateFtl/index.ts +0 -1
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/bringInAccountV1.ts +34 -22
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/generateMessageProperties.ts +72 -20
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +34 -0
- package/src/bin/keycloakify/{generateTheme/generateSrcMainResources.ts → generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts} +113 -74
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +80 -0
- package/src/bin/keycloakify/generateSrcMainResources/index.ts +1 -0
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/readExtraPageNames.ts +21 -8
- package/src/bin/keycloakify/generateSrcMainResources/readFieldNameUsage.ts +83 -0
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +31 -18
- package/src/bin/keycloakify/index.ts +0 -7
- package/src/bin/keycloakify/keycloakify.ts +77 -69
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +26 -7
- package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +8 -4
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +7 -4
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +25 -7
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +50 -12
- package/src/bin/main.ts +212 -0
- package/src/bin/shared/KeycloakVersionRange.ts +9 -0
- package/src/bin/shared/buildOptions.ts +307 -0
- package/src/bin/{keycloakify/generateFtl/pageId.ts → shared/constants.ts} +31 -1
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +104 -0
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +207 -0
- package/src/bin/shared/downloadKeycloakStaticResources.ts +53 -0
- package/src/bin/shared/getJarFileBasename.ts +11 -0
- package/src/bin/{getThemeSrcDirPath.ts → shared/getThemeSrcDirPath.ts} +6 -3
- package/src/bin/shared/metaInfKeycloakThemes.ts +61 -0
- package/src/bin/shared/promptKeycloakVersion.ts +125 -0
- package/src/bin/start-keycloak/appBuild.ts +129 -0
- package/src/bin/start-keycloak/index.ts +1 -0
- package/src/bin/start-keycloak/keycloakifyBuild.ts +41 -0
- package/src/bin/start-keycloak/myrealm-realm-23.json +2142 -0
- package/src/bin/start-keycloak/myrealm-realm-24.json +2318 -0
- package/src/bin/start-keycloak/start-keycloak.ts +467 -0
- package/src/bin/tools/SemVer.ts +32 -13
- package/src/bin/tools/String.prototype.replaceAll.ts +9 -2
- package/src/bin/tools/crawl.ts +4 -1
- package/src/bin/tools/crc32.ts +42 -24
- package/src/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.ts +262 -0
- package/src/bin/tools/downloadAndExtractArchive/fetchProxyOptions.ts +96 -0
- package/src/bin/tools/downloadAndExtractArchive/index.ts +1 -0
- package/src/bin/tools/extractArchive.ts +140 -0
- package/src/bin/tools/fetchProxyOptions.ts +31 -8
- package/src/bin/tools/fs.rmSync.ts +4 -4
- package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +17 -2
- package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +73 -0
- package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +8 -2
- package/src/bin/tools/octokit-addons/listTags.ts +15 -4
- package/src/bin/tools/partitionPromiseSettledResults.ts +12 -3
- package/src/bin/tools/{readThisNpmProjectVersion.ts → readThisNpmPackageVersion.ts} +6 -2
- package/src/bin/tools/transformCodebase.ts +29 -10
- package/src/bin/tools/trimIndent.ts +4 -1
- package/src/lib/isStorybook.ts +3 -1
- package/src/lib/useGetClassName.ts +12 -3
- package/src/login/Template.tsx +20 -36
- package/src/login/TemplateProps.ts +4 -1
- package/src/login/UserProfileFormFields.tsx +46 -47
- package/src/login/i18n/baseMessages/ca.ts +1 -1
- package/src/login/i18n/baseMessages/el.ts +0 -1
- package/src/login/i18n/baseMessages/en.ts +1 -1
- package/src/login/i18n/baseMessages/es.ts +1 -1
- package/src/login/i18n/baseMessages/fa.ts +0 -1
- package/src/login/i18n/baseMessages/hu.ts +1 -1
- package/src/login/i18n/baseMessages/zh-CN.ts +1 -1
- package/src/login/i18n/i18n.tsx +77 -54
- package/src/login/index.ts +1 -1
- package/src/login/kcContext/KcContext.ts +23 -4
- package/src/login/kcContext/createGetKcContext.ts +84 -37
- package/src/login/kcContext/getKcContext.ts +3 -1
- package/src/login/kcContext/getKcContextFromWindow.ts +7 -3
- package/src/login/kcContext/kcContextMocks.ts +340 -326
- package/src/login/lib/useDownloadTerms.ts +13 -9
- package/src/login/lib/useGetClassName.ts +119 -112
- package/src/login/lib/useUserProfileForm.tsx +227 -213
- package/src/login/pages/Code.tsx +1 -1
- package/src/login/pages/DeleteAccountConfirm.tsx +9 -3
- package/src/login/pages/FrontchannelLogout.tsx +1 -1
- package/src/login/pages/IdpReviewUserProfile.tsx +1 -1
- package/src/login/pages/Login.tsx +3 -3
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +3 -3
- package/src/login/pages/LoginResetPassword.tsx +2 -2
- package/src/login/pages/LoginUpdateProfile.tsx +1 -1
- package/src/login/pages/LoginUsername.tsx +3 -3
- package/src/login/pages/Register.tsx +1 -1
- package/src/login/pages/UpdateEmail.tsx +1 -1
- package/src/login/pages/WebauthnAuthenticate.tsx +11 -8
- package/src/login/pages/WebauthnRegister.tsx +8 -8
- package/src/tools/AndByDiscriminatingKey.ts +12 -6
- package/src/tools/Array.prototype.every.ts +4 -1
- package/src/tools/LazyOrNot.ts +3 -1
- package/src/tools/StatefulObservable/README.md +16 -0
- package/src/tools/StatefulObservable/StatefulObservable.ts +58 -0
- package/src/tools/StatefulObservable/hooks/index.ts +2 -0
- package/src/tools/StatefulObservable/hooks/useObservable.ts +25 -0
- package/src/tools/StatefulObservable/hooks/useRerenderOnChange.ts +19 -0
- package/src/tools/StatefulObservable/index.ts +2 -0
- package/src/tools/clsx.ts +7 -1
- package/src/tools/deepAssign.ts +15 -8
- package/src/tools/deepClone.ts +3 -1
- package/src/tools/formatNumber.ts +4 -1
- package/src/tools/useConstCallback.ts +3 -1
- package/src/tools/useInsertLinkTags.ts +20 -7
- package/src/tools/useInsertScriptTags.ts +7 -2
- package/src/tools/useSetClassName.ts +4 -1
- package/src/vite-plugin/tsconfig.json +2 -1
- package/src/vite-plugin/vite-plugin.ts +64 -52
- package/tools/Array.prototype.every.js +2 -1
- package/tools/Array.prototype.every.js.map +1 -1
- package/tools/HTMLElement.prototype.prepend.js.map +1 -1
- package/tools/StatefulObservable/StatefulObservable.d.ts +8 -0
- package/tools/StatefulObservable/StatefulObservable.js +36 -0
- package/tools/StatefulObservable/StatefulObservable.js.map +1 -0
- package/tools/StatefulObservable/hooks/index.d.ts +2 -0
- package/tools/StatefulObservable/hooks/index.js +3 -0
- package/tools/StatefulObservable/hooks/index.js.map +1 -0
- package/tools/StatefulObservable/hooks/useObservable.d.ts +8 -0
- package/tools/StatefulObservable/hooks/useObservable.js +17 -0
- package/tools/StatefulObservable/hooks/useObservable.js.map +1 -0
- package/tools/StatefulObservable/hooks/useRerenderOnChange.d.ts +5 -0
- package/tools/StatefulObservable/hooks/useRerenderOnChange.js +14 -0
- package/tools/StatefulObservable/hooks/useRerenderOnChange.js.map +1 -0
- package/tools/StatefulObservable/index.d.ts +2 -0
- package/tools/StatefulObservable/index.js +3 -0
- package/tools/StatefulObservable/index.js.map +1 -0
- package/tools/clsx.js.map +1 -1
- package/tools/deepAssign.js +9 -7
- package/tools/deepAssign.js.map +1 -1
- package/tools/deepClone.js.map +1 -1
- package/tools/formatNumber.js.map +1 -1
- package/tools/memoize.js.map +1 -1
- package/tools/useConstCallback.js.map +1 -1
- package/tools/useInsertLinkTags.js +5 -4
- package/tools/useInsertLinkTags.js.map +1 -1
- package/tools/useInsertScriptTags.js +5 -2
- package/tools/useInsertScriptTags.js.map +1 -1
- package/tools/useSetClassName.js.map +1 -1
- package/vite-plugin/index.js +50241 -3
- package/bin/constants.d.ts +0 -10
- package/bin/constants.js +0 -13
- package/bin/constants.js.map +0 -1
- package/bin/copy-keycloak-resources-to-public.d.ts +0 -14
- package/bin/copy-keycloak-resources-to-public.js +0 -216
- package/bin/copy-keycloak-resources-to-public.js.map +0 -1
- package/bin/download-builtin-keycloak-theme.d.ts +0 -10
- package/bin/download-builtin-keycloak-theme.js +0 -352
- package/bin/download-builtin-keycloak-theme.js.map +0 -1
- package/bin/downloadAndUnzip.d.ts +0 -16
- package/bin/downloadAndUnzip.js +0 -255
- package/bin/downloadAndUnzip.js.map +0 -1
- package/bin/eject-keycloak-page.d.ts +0 -2
- package/bin/eject-keycloak-page.js +0 -132
- package/bin/eject-keycloak-page.js.map +0 -1
- package/bin/getThemeSrcDirPath.d.ts +0 -6
- package/bin/getThemeSrcDirPath.js +0 -123
- package/bin/getThemeSrcDirPath.js.map +0 -1
- package/bin/initialize-email-theme.d.ts +0 -2
- package/bin/initialize-email-theme.js +0 -121
- package/bin/initialize-email-theme.js.map +0 -1
- package/bin/keycloakify/buildJars/buildJar.d.ts +0 -14
- package/bin/keycloakify/buildJars/buildJar.js +0 -224
- package/bin/keycloakify/buildJars/buildJar.js.map +0 -1
- package/bin/keycloakify/buildJars/buildJars.d.ts +0 -10
- package/bin/keycloakify/buildJars/buildJars.js +0 -95
- package/bin/keycloakify/buildJars/buildJars.js.map +0 -1
- package/bin/keycloakify/buildJars/extensionVersions.d.ts +0 -12
- package/bin/keycloakify/buildJars/extensionVersions.js +0 -7
- package/bin/keycloakify/buildJars/extensionVersions.js.map +0 -1
- package/bin/keycloakify/buildJars/generatePom.d.ts +0 -13
- package/bin/keycloakify/buildJars/generatePom.js +0 -95
- package/bin/keycloakify/buildJars/generatePom.js.map +0 -1
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.d.ts +0 -6
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js +0 -35
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js.map +0 -1
- package/bin/keycloakify/buildJars/index.d.ts +0 -1
- package/bin/keycloakify/buildJars/index.js +0 -18
- package/bin/keycloakify/buildJars/index.js.map +0 -1
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.d.ts +0 -35
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js +0 -14
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js.map +0 -1
- package/bin/keycloakify/buildOptions/buildOptions.d.ts +0 -25
- package/bin/keycloakify/buildOptions/buildOptions.js +0 -178
- package/bin/keycloakify/buildOptions/buildOptions.js.map +0 -1
- package/bin/keycloakify/buildOptions/getCacheDirPath.d.ts +0 -5
- package/bin/keycloakify/buildOptions/getCacheDirPath.js +0 -22
- package/bin/keycloakify/buildOptions/getCacheDirPath.js.map +0 -1
- package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.d.ts +0 -5
- package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js +0 -86
- package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js.map +0 -1
- package/bin/keycloakify/buildOptions/getReactAppRootDirPath.d.ts +0 -5
- package/bin/keycloakify/buildOptions/getReactAppRootDirPath.js +0 -26
- package/bin/keycloakify/buildOptions/getReactAppRootDirPath.js.map +0 -1
- package/bin/keycloakify/buildOptions/index.d.ts +0 -1
- package/bin/keycloakify/buildOptions/index.js +0 -18
- package/bin/keycloakify/buildOptions/index.js.map +0 -1
- package/bin/keycloakify/buildOptions/parsedPackageJson.d.ts +0 -10
- package/bin/keycloakify/buildOptions/parsedPackageJson.js +0 -49
- package/bin/keycloakify/buildOptions/parsedPackageJson.js.map +0 -1
- package/bin/keycloakify/buildOptions/resolvedViteConfig.d.ts +0 -13
- package/bin/keycloakify/buildOptions/resolvedViteConfig.js +0 -77
- package/bin/keycloakify/buildOptions/resolvedViteConfig.js.map +0 -1
- package/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +0 -604
- package/bin/keycloakify/generateFtl/generateFtl.d.ts +0 -23
- package/bin/keycloakify/generateFtl/generateFtl.js +0 -169
- package/bin/keycloakify/generateFtl/generateFtl.js.map +0 -1
- package/bin/keycloakify/generateFtl/index.d.ts +0 -2
- package/bin/keycloakify/generateFtl/index.js +0 -19
- package/bin/keycloakify/generateFtl/index.js.map +0 -1
- package/bin/keycloakify/generateFtl/pageId.js +0 -41
- package/bin/keycloakify/generateFtl/pageId.js.map +0 -1
- package/bin/keycloakify/generateStartKeycloakTestingContainer.d.ts +0 -11
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js +0 -89
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +0 -1
- package/bin/keycloakify/generateTheme/bringInAccountV1.d.ts +0 -9
- package/bin/keycloakify/generateTheme/bringInAccountV1.js +0 -153
- package/bin/keycloakify/generateTheme/bringInAccountV1.js.map +0 -1
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.d.ts +0 -11
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js +0 -102
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js.map +0 -1
- package/bin/keycloakify/generateTheme/generateMessageProperties.d.ts +0 -8
- package/bin/keycloakify/generateTheme/generateMessageProperties.js +0 -271
- package/bin/keycloakify/generateTheme/generateMessageProperties.js.map +0 -1
- package/bin/keycloakify/generateTheme/generateSrcMainResources.d.ts +0 -21
- package/bin/keycloakify/generateTheme/generateSrcMainResources.js +0 -340
- package/bin/keycloakify/generateTheme/generateSrcMainResources.js.map +0 -1
- package/bin/keycloakify/generateTheme/generateTheme.d.ts +0 -13
- package/bin/keycloakify/generateTheme/generateTheme.js +0 -115
- package/bin/keycloakify/generateTheme/generateTheme.js.map +0 -1
- package/bin/keycloakify/generateTheme/generateThemeVariants.d.ts +0 -5
- package/bin/keycloakify/generateTheme/generateThemeVariants.js +0 -67
- package/bin/keycloakify/generateTheme/generateThemeVariants.js.map +0 -1
- package/bin/keycloakify/generateTheme/index.d.ts +0 -1
- package/bin/keycloakify/generateTheme/index.js +0 -18
- package/bin/keycloakify/generateTheme/index.js.map +0 -1
- package/bin/keycloakify/generateTheme/readExtraPageNames.d.ts +0 -5
- package/bin/keycloakify/generateTheme/readExtraPageNames.js +0 -105
- package/bin/keycloakify/generateTheme/readExtraPageNames.js.map +0 -1
- package/bin/keycloakify/generateTheme/readFieldNameUsage.d.ts +0 -7
- package/bin/keycloakify/generateTheme/readFieldNameUsage.js +0 -141
- package/bin/keycloakify/generateTheme/readFieldNameUsage.js.map +0 -1
- package/bin/keycloakify/index.d.ts +0 -2
- package/bin/keycloakify/index.js +0 -23
- package/bin/keycloakify/index.js.map +0 -1
- package/bin/keycloakify/keycloakify.d.ts +0 -1
- package/bin/keycloakify/keycloakify.js +0 -166
- package/bin/keycloakify/keycloakify.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInCssCode.d.ts +0 -15
- package/bin/keycloakify/replacers/replaceImportsInCssCode.js +0 -88
- package/bin/keycloakify/replacers/replaceImportsInCssCode.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInInlineCssCode.d.ts +0 -9
- package/bin/keycloakify/replacers/replaceImportsInInlineCssCode.js +0 -38
- package/bin/keycloakify/replacers/replaceImportsInInlineCssCode.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInJsCode/index.d.ts +0 -1
- package/bin/keycloakify/replacers/replaceImportsInJsCode/index.js +0 -18
- package/bin/keycloakify/replacers/replaceImportsInJsCode/index.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.d.ts +0 -12
- package/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.js +0 -70
- package/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInJsCode/vite.d.ts +0 -13
- package/bin/keycloakify/replacers/replaceImportsInJsCode/vite.js +0 -95
- package/bin/keycloakify/replacers/replaceImportsInJsCode/vite.js.map +0 -1
- package/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.d.ts +0 -12
- package/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.js +0 -103
- package/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.js.map +0 -1
- package/bin/promptKeycloakVersion.d.ts +0 -3
- package/bin/promptKeycloakVersion.js +0 -121
- package/bin/promptKeycloakVersion.js.map +0 -1
- package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
- package/bin/tools/OptionalIfCanBeUndefined.js +0 -3
- package/bin/tools/OptionalIfCanBeUndefined.js.map +0 -1
- package/bin/tools/SemVer.d.ts +0 -26
- package/bin/tools/SemVer.js +0 -119
- package/bin/tools/SemVer.js.map +0 -1
- package/bin/tools/String.prototype.replaceAll.d.ts +0 -1
- package/bin/tools/String.prototype.replaceAll.js +0 -29
- package/bin/tools/String.prototype.replaceAll.js.map +0 -1
- package/bin/tools/crawl.d.ts +0 -5
- package/bin/tools/crawl.js +0 -74
- package/bin/tools/crawl.js.map +0 -1
- package/bin/tools/crc32.d.ts +0 -9
- package/bin/tools/crc32.js +0 -64
- package/bin/tools/crc32.js.map +0 -1
- package/bin/tools/deflate.d.ts +0 -24
- package/bin/tools/deflate.js +0 -155
- package/bin/tools/deflate.js.map +0 -1
- package/bin/tools/fetchProxyOptions.d.ts +0 -5
- package/bin/tools/fetchProxyOptions.js +0 -172
- package/bin/tools/fetchProxyOptions.js.map +0 -1
- package/bin/tools/fs.existsAsync.d.ts +0 -1
- package/bin/tools/fs.existsAsync.js +0 -86
- package/bin/tools/fs.existsAsync.js.map +0 -1
- package/bin/tools/fs.rm.d.ts +0 -8
- package/bin/tools/fs.rm.js +0 -151
- package/bin/tools/fs.rm.js.map +0 -1
- package/bin/tools/fs.rmSync.d.ts +0 -8
- package/bin/tools/fs.rmSync.js +0 -58
- package/bin/tools/fs.rmSync.js.map +0 -1
- package/bin/tools/getAbsoluteAndInOsFormatPath.d.ts +0 -4
- package/bin/tools/getAbsoluteAndInOsFormatPath.js +0 -16
- package/bin/tools/getAbsoluteAndInOsFormatPath.js.map +0 -1
- package/bin/tools/getThisCodebaseRootDirPath.d.ts +0 -1
- package/bin/tools/getThisCodebaseRootDirPath.js +0 -43
- package/bin/tools/getThisCodebaseRootDirPath.js.map +0 -1
- package/bin/tools/grant-exec-perms.d.ts +0 -1
- package/bin/tools/grant-exec-perms.js +0 -100
- package/bin/tools/grant-exec-perms.js.map +0 -1
- package/bin/tools/isInside.d.ts +0 -4
- package/bin/tools/isInside.js +0 -10
- package/bin/tools/isInside.js.map +0 -1
- package/bin/tools/kebabCaseToSnakeCase.d.ts +0 -1
- package/bin/tools/kebabCaseToSnakeCase.js +0 -35
- package/bin/tools/kebabCaseToSnakeCase.js.map +0 -1
- package/bin/tools/logger.d.ts +0 -12
- package/bin/tools/logger.js +0 -23
- package/bin/tools/logger.js.map +0 -1
- package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -14
- package/bin/tools/octokit-addons/getLatestsSemVersionedTag.js +0 -119
- package/bin/tools/octokit-addons/getLatestsSemVersionedTag.js.map +0 -1
- package/bin/tools/octokit-addons/listTags.d.ts +0 -13
- package/bin/tools/octokit-addons/listTags.js +0 -154
- package/bin/tools/octokit-addons/listTags.js.map +0 -1
- package/bin/tools/partitionPromiseSettledResults.d.ts +0 -2
- package/bin/tools/partitionPromiseSettledResults.js +0 -41
- package/bin/tools/partitionPromiseSettledResults.js.map +0 -1
- package/bin/tools/readThisNpmProjectVersion.d.ts +0 -1
- package/bin/tools/readThisNpmProjectVersion.js +0 -37
- package/bin/tools/readThisNpmProjectVersion.js.map +0 -1
- package/bin/tools/tee.d.ts +0 -3
- package/bin/tools/tee.js +0 -37
- package/bin/tools/tee.js.map +0 -1
- package/bin/tools/transformCodebase.d.ts +0 -20
- package/bin/tools/transformCodebase.js +0 -97
- package/bin/tools/transformCodebase.js.map +0 -1
- package/bin/tools/trimIndent.d.ts +0 -5
- package/bin/tools/trimIndent.js +0 -82
- package/bin/tools/trimIndent.js.map +0 -1
- package/bin/tools/unzip.d.ts +0 -2
- package/bin/tools/unzip.js +0 -274
- package/bin/tools/unzip.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/lib/keycloakJsAdapter.d.ts +0 -51
- package/lib/keycloakJsAdapter.js +0 -74
- package/lib/keycloakJsAdapter.js.map +0 -1
- package/src/bin/constants.ts +0 -13
- package/src/bin/download-builtin-keycloak-theme.ts +0 -290
- package/src/bin/downloadAndUnzip.ts +0 -203
- package/src/bin/eject-keycloak-page.ts +0 -64
- package/src/bin/keycloakify/buildOptions/UserProvidedBuildOptions.ts +0 -21
- package/src/bin/keycloakify/buildOptions/buildOptions.ts +0 -189
- package/src/bin/keycloakify/buildOptions/getCacheDirPath.ts +0 -25
- package/src/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.ts +0 -49
- package/src/bin/keycloakify/buildOptions/getReactAppRootDirPath.ts +0 -23
- package/src/bin/keycloakify/buildOptions/index.ts +0 -1
- package/src/bin/keycloakify/buildOptions/parsedPackageJson.ts +0 -32
- package/src/bin/keycloakify/buildOptions/resolvedViteConfig.ts +0 -74
- package/src/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.ts +0 -49
- package/src/bin/keycloakify/generateTheme/generateTheme.ts +0 -44
- package/src/bin/keycloakify/generateTheme/generateThemeVariants.ts +0 -50
- package/src/bin/keycloakify/generateTheme/index.ts +0 -1
- package/src/bin/keycloakify/generateTheme/readFieldNameUsage.ts +0 -55
- package/src/bin/promptKeycloakVersion.ts +0 -49
- package/src/bin/tools/grant-exec-perms.ts +0 -19
- package/src/bin/tools/logger.ts +0 -27
- package/src/bin/tools/unzip.ts +0 -141
- package/src/index.ts +0 -1
- package/src/lib/keycloakJsAdapter.ts +0 -118
- package/vite-plugin/index.js.map +0 -1
- package/vite-plugin/tsconfig.tsbuildinfo +0 -1
- package/vite-plugin/vite-plugin.d.ts +0 -6
- package/vite-plugin/vite-plugin.js +0 -158
- package/vite-plugin/vite-plugin.js.map +0 -1
@@ -1,189 +0,0 @@
|
|
1
|
-
import { parse as urlParse } from "url";
|
2
|
-
import { readParsedPackageJson } from "./parsedPackageJson";
|
3
|
-
import { join as pathJoin } from "path";
|
4
|
-
import parseArgv from "minimist";
|
5
|
-
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
6
|
-
import { readResolvedViteConfig } from "./resolvedViteConfig";
|
7
|
-
import * as fs from "fs";
|
8
|
-
import { getCacheDirPath } from "./getCacheDirPath";
|
9
|
-
import { getReactAppRootDirPath } from "./getReactAppRootDirPath";
|
10
|
-
import { getNpmWorkspaceRootDirPath } from "./getNpmWorkspaceRootDirPath";
|
11
|
-
|
12
|
-
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
13
|
-
export type BuildOptions = {
|
14
|
-
bundler: "vite" | "webpack";
|
15
|
-
isSilent: boolean;
|
16
|
-
themeVersion: string;
|
17
|
-
themeNames: string[];
|
18
|
-
extraThemeProperties: string[] | undefined;
|
19
|
-
groupId: string;
|
20
|
-
artifactId: string;
|
21
|
-
loginThemeResourcesFromKeycloakVersion: string;
|
22
|
-
reactAppRootDirPath: string;
|
23
|
-
reactAppBuildDirPath: string;
|
24
|
-
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
25
|
-
keycloakifyBuildDirPath: string;
|
26
|
-
publicDirPath: string;
|
27
|
-
cacheDirPath: string;
|
28
|
-
/** If your app is hosted under a subpath, it's the case in CRA if you have "homepage": "https://example.com/my-app" in your package.json
|
29
|
-
* In this case the urlPathname will be "/my-app/" */
|
30
|
-
urlPathname: string | undefined;
|
31
|
-
assetsDirPath: string;
|
32
|
-
npmWorkspaceRootDirPath: string;
|
33
|
-
};
|
34
|
-
|
35
|
-
export function readBuildOptions(params: { processArgv: string[] }): BuildOptions {
|
36
|
-
const { processArgv } = params;
|
37
|
-
|
38
|
-
const { reactAppRootDirPath } = getReactAppRootDirPath({ processArgv });
|
39
|
-
|
40
|
-
const { cacheDirPath } = getCacheDirPath({ reactAppRootDirPath });
|
41
|
-
|
42
|
-
const { resolvedViteConfig } = readResolvedViteConfig({ cacheDirPath });
|
43
|
-
|
44
|
-
if (resolvedViteConfig === undefined && fs.existsSync(pathJoin(reactAppRootDirPath, "vite.config.ts"))) {
|
45
|
-
throw new Error("Keycloakify's Vite plugin output not found");
|
46
|
-
}
|
47
|
-
|
48
|
-
const { keycloakify: userProvidedBuildOptionsFromPackageJson, ...parsedPackageJson } = readParsedPackageJson({ reactAppRootDirPath });
|
49
|
-
|
50
|
-
const userProvidedBuildOptions = {
|
51
|
-
...userProvidedBuildOptionsFromPackageJson,
|
52
|
-
...resolvedViteConfig?.userProvidedBuildOptions
|
53
|
-
};
|
54
|
-
|
55
|
-
const themeNames = (() => {
|
56
|
-
if (userProvidedBuildOptions.themeName === undefined) {
|
57
|
-
return [
|
58
|
-
parsedPackageJson.name
|
59
|
-
.replace(/^@(.*)/, "$1")
|
60
|
-
.split("/")
|
61
|
-
.join("-")
|
62
|
-
];
|
63
|
-
}
|
64
|
-
|
65
|
-
if (typeof userProvidedBuildOptions.themeName === "string") {
|
66
|
-
return [userProvidedBuildOptions.themeName];
|
67
|
-
}
|
68
|
-
|
69
|
-
return userProvidedBuildOptions.themeName;
|
70
|
-
})();
|
71
|
-
|
72
|
-
const reactAppBuildDirPath = (() => {
|
73
|
-
webpack: {
|
74
|
-
if (resolvedViteConfig !== undefined) {
|
75
|
-
break webpack;
|
76
|
-
}
|
77
|
-
|
78
|
-
if (userProvidedBuildOptions.reactAppBuildDirPath !== undefined) {
|
79
|
-
return getAbsoluteAndInOsFormatPath({
|
80
|
-
"pathIsh": userProvidedBuildOptions.reactAppBuildDirPath,
|
81
|
-
"cwd": reactAppRootDirPath
|
82
|
-
});
|
83
|
-
}
|
84
|
-
|
85
|
-
return pathJoin(reactAppRootDirPath, "build");
|
86
|
-
}
|
87
|
-
|
88
|
-
return pathJoin(reactAppRootDirPath, resolvedViteConfig.buildDir);
|
89
|
-
})();
|
90
|
-
|
91
|
-
const argv = parseArgv(processArgv);
|
92
|
-
|
93
|
-
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({ reactAppRootDirPath });
|
94
|
-
|
95
|
-
return {
|
96
|
-
"bundler": resolvedViteConfig !== undefined ? "vite" : "webpack",
|
97
|
-
"isSilent": typeof argv["silent"] === "boolean" ? argv["silent"] : false,
|
98
|
-
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? parsedPackageJson.version ?? "0.0.0",
|
99
|
-
themeNames,
|
100
|
-
"extraThemeProperties": userProvidedBuildOptions.extraThemeProperties,
|
101
|
-
"groupId": (() => {
|
102
|
-
const fallbackGroupId = `${themeNames[0]}.keycloak`;
|
103
|
-
|
104
|
-
return (
|
105
|
-
process.env.KEYCLOAKIFY_GROUP_ID ??
|
106
|
-
userProvidedBuildOptions.groupId ??
|
107
|
-
(parsedPackageJson.homepage === undefined
|
108
|
-
? fallbackGroupId
|
109
|
-
: urlParse(parsedPackageJson.homepage)
|
110
|
-
.host?.replace(/:[0-9]+$/, "")
|
111
|
-
?.split(".")
|
112
|
-
.reverse()
|
113
|
-
.join(".") ?? fallbackGroupId) + ".keycloak"
|
114
|
-
);
|
115
|
-
})(),
|
116
|
-
"artifactId": process.env.KEYCLOAKIFY_ARTIFACT_ID ?? userProvidedBuildOptions.artifactId ?? `${themeNames[0]}-keycloak-theme`,
|
117
|
-
"loginThemeResourcesFromKeycloakVersion": userProvidedBuildOptions.loginThemeResourcesFromKeycloakVersion ?? "24.0.4",
|
118
|
-
reactAppRootDirPath,
|
119
|
-
reactAppBuildDirPath,
|
120
|
-
"keycloakifyBuildDirPath": (() => {
|
121
|
-
if (userProvidedBuildOptions.keycloakifyBuildDirPath !== undefined) {
|
122
|
-
return getAbsoluteAndInOsFormatPath({
|
123
|
-
"pathIsh": userProvidedBuildOptions.keycloakifyBuildDirPath,
|
124
|
-
"cwd": reactAppRootDirPath
|
125
|
-
});
|
126
|
-
}
|
127
|
-
|
128
|
-
return pathJoin(
|
129
|
-
reactAppRootDirPath,
|
130
|
-
resolvedViteConfig?.buildDir === undefined ? "build_keycloak" : `${resolvedViteConfig.buildDir}_keycloak`
|
131
|
-
);
|
132
|
-
})(),
|
133
|
-
"publicDirPath": (() => {
|
134
|
-
webpack: {
|
135
|
-
if (resolvedViteConfig !== undefined) {
|
136
|
-
break webpack;
|
137
|
-
}
|
138
|
-
|
139
|
-
if (process.env.PUBLIC_DIR_PATH !== undefined) {
|
140
|
-
return getAbsoluteAndInOsFormatPath({
|
141
|
-
"pathIsh": process.env.PUBLIC_DIR_PATH,
|
142
|
-
"cwd": reactAppRootDirPath
|
143
|
-
});
|
144
|
-
}
|
145
|
-
|
146
|
-
return pathJoin(reactAppRootDirPath, "public");
|
147
|
-
}
|
148
|
-
|
149
|
-
return pathJoin(reactAppRootDirPath, resolvedViteConfig.publicDir);
|
150
|
-
})(),
|
151
|
-
cacheDirPath,
|
152
|
-
"urlPathname": (() => {
|
153
|
-
webpack: {
|
154
|
-
if (resolvedViteConfig !== undefined) {
|
155
|
-
break webpack;
|
156
|
-
}
|
157
|
-
|
158
|
-
const { homepage } = parsedPackageJson;
|
159
|
-
|
160
|
-
let url: URL | undefined = undefined;
|
161
|
-
|
162
|
-
if (homepage !== undefined) {
|
163
|
-
url = new URL(homepage);
|
164
|
-
}
|
165
|
-
|
166
|
-
if (url === undefined) {
|
167
|
-
return undefined;
|
168
|
-
}
|
169
|
-
|
170
|
-
const out = url.pathname.replace(/([^/])$/, "$1/");
|
171
|
-
return out === "/" ? undefined : out;
|
172
|
-
}
|
173
|
-
|
174
|
-
return resolvedViteConfig.urlPathname;
|
175
|
-
})(),
|
176
|
-
"assetsDirPath": (() => {
|
177
|
-
webpack: {
|
178
|
-
if (resolvedViteConfig !== undefined) {
|
179
|
-
break webpack;
|
180
|
-
}
|
181
|
-
|
182
|
-
return pathJoin(reactAppBuildDirPath, "static");
|
183
|
-
}
|
184
|
-
|
185
|
-
return pathJoin(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
186
|
-
})(),
|
187
|
-
npmWorkspaceRootDirPath
|
188
|
-
};
|
189
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { join as pathJoin } from "path";
|
2
|
-
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
3
|
-
import { getNpmWorkspaceRootDirPath } from "./getNpmWorkspaceRootDirPath";
|
4
|
-
|
5
|
-
export function getCacheDirPath(params: { reactAppRootDirPath: string }) {
|
6
|
-
const { reactAppRootDirPath } = params;
|
7
|
-
|
8
|
-
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({ reactAppRootDirPath });
|
9
|
-
|
10
|
-
const cacheDirPath = pathJoin(
|
11
|
-
(() => {
|
12
|
-
if (process.env.XDG_CACHE_HOME !== undefined) {
|
13
|
-
return getAbsoluteAndInOsFormatPath({
|
14
|
-
"pathIsh": process.env.XDG_CACHE_HOME,
|
15
|
-
"cwd": reactAppRootDirPath
|
16
|
-
});
|
17
|
-
}
|
18
|
-
|
19
|
-
return pathJoin(npmWorkspaceRootDirPath, "node_modules", ".cache");
|
20
|
-
})(),
|
21
|
-
"keycloakify"
|
22
|
-
);
|
23
|
-
|
24
|
-
return { cacheDirPath };
|
25
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import * as child_process from "child_process";
|
2
|
-
import { join as pathJoin, resolve as pathResolve, sep as pathSep } from "path";
|
3
|
-
import { assert } from "tsafe/assert";
|
4
|
-
|
5
|
-
let cache:
|
6
|
-
| {
|
7
|
-
reactAppRootDirPath: string;
|
8
|
-
npmWorkspaceRootDirPath: string;
|
9
|
-
}
|
10
|
-
| undefined = undefined;
|
11
|
-
|
12
|
-
export function getNpmWorkspaceRootDirPath(params: { reactAppRootDirPath: string }) {
|
13
|
-
const { reactAppRootDirPath } = params;
|
14
|
-
|
15
|
-
use_cache: {
|
16
|
-
if (cache === undefined || cache.reactAppRootDirPath !== reactAppRootDirPath) {
|
17
|
-
break use_cache;
|
18
|
-
}
|
19
|
-
|
20
|
-
const { npmWorkspaceRootDirPath } = cache;
|
21
|
-
|
22
|
-
return { npmWorkspaceRootDirPath };
|
23
|
-
}
|
24
|
-
|
25
|
-
const npmWorkspaceRootDirPath = (function callee(depth: number): string {
|
26
|
-
const cwd = pathResolve(pathJoin(...[reactAppRootDirPath, ...Array(depth).fill("..")]));
|
27
|
-
|
28
|
-
try {
|
29
|
-
child_process.execSync("npm config get", { cwd, "stdio": ["pipe", "pipe", "pipe"] });
|
30
|
-
} catch (error) {
|
31
|
-
if (String(error).includes("ENOWORKSPACES")) {
|
32
|
-
assert(cwd !== pathSep, "NPM workspace not found");
|
33
|
-
|
34
|
-
return callee(depth + 1);
|
35
|
-
}
|
36
|
-
|
37
|
-
throw error;
|
38
|
-
}
|
39
|
-
|
40
|
-
return cwd;
|
41
|
-
})(0);
|
42
|
-
|
43
|
-
cache = {
|
44
|
-
reactAppRootDirPath,
|
45
|
-
npmWorkspaceRootDirPath
|
46
|
-
};
|
47
|
-
|
48
|
-
return { npmWorkspaceRootDirPath };
|
49
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import parseArgv from "minimist";
|
2
|
-
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
3
|
-
|
4
|
-
export function getReactAppRootDirPath(params: { processArgv: string[] }) {
|
5
|
-
const { processArgv } = params;
|
6
|
-
|
7
|
-
const argv = parseArgv(processArgv);
|
8
|
-
|
9
|
-
const reactAppRootDirPath = (() => {
|
10
|
-
const arg = argv["project"] ?? argv["p"];
|
11
|
-
|
12
|
-
if (typeof arg !== "string") {
|
13
|
-
return process.cwd();
|
14
|
-
}
|
15
|
-
|
16
|
-
return getAbsoluteAndInOsFormatPath({
|
17
|
-
"pathIsh": arg,
|
18
|
-
"cwd": process.cwd()
|
19
|
-
});
|
20
|
-
})();
|
21
|
-
|
22
|
-
return { reactAppRootDirPath };
|
23
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./buildOptions";
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import * as fs from "fs";
|
2
|
-
import { assert } from "tsafe";
|
3
|
-
import type { Equals } from "tsafe";
|
4
|
-
import { z } from "zod";
|
5
|
-
import { join as pathJoin } from "path";
|
6
|
-
import { type UserProvidedBuildOptions, zUserProvidedBuildOptions } from "./UserProvidedBuildOptions";
|
7
|
-
|
8
|
-
export type ParsedPackageJson = {
|
9
|
-
name: string;
|
10
|
-
version?: string;
|
11
|
-
homepage?: string;
|
12
|
-
keycloakify?: UserProvidedBuildOptions;
|
13
|
-
};
|
14
|
-
|
15
|
-
const zParsedPackageJson = z.object({
|
16
|
-
"name": z.string(),
|
17
|
-
"version": z.string().optional(),
|
18
|
-
"homepage": z.string().optional(),
|
19
|
-
"keycloakify": zUserProvidedBuildOptions.optional()
|
20
|
-
});
|
21
|
-
|
22
|
-
assert<Equals<ReturnType<(typeof zParsedPackageJson)["parse"]>, ParsedPackageJson>>();
|
23
|
-
|
24
|
-
let parsedPackageJson: undefined | ParsedPackageJson;
|
25
|
-
export function readParsedPackageJson(params: { reactAppRootDirPath: string }) {
|
26
|
-
const { reactAppRootDirPath } = params;
|
27
|
-
if (parsedPackageJson) {
|
28
|
-
return parsedPackageJson;
|
29
|
-
}
|
30
|
-
parsedPackageJson = zParsedPackageJson.parse(JSON.parse(fs.readFileSync(pathJoin(reactAppRootDirPath, "package.json")).toString("utf8")));
|
31
|
-
return parsedPackageJson;
|
32
|
-
}
|
@@ -1,74 +0,0 @@
|
|
1
|
-
import * as fs from "fs";
|
2
|
-
import { assert } from "tsafe";
|
3
|
-
import type { Equals } from "tsafe";
|
4
|
-
import { z } from "zod";
|
5
|
-
import { join as pathJoin } from "path";
|
6
|
-
import { resolvedViteConfigJsonBasename } from "../../constants";
|
7
|
-
import type { OptionalIfCanBeUndefined } from "../../tools/OptionalIfCanBeUndefined";
|
8
|
-
import { UserProvidedBuildOptions, zUserProvidedBuildOptions } from "./UserProvidedBuildOptions";
|
9
|
-
|
10
|
-
export type ResolvedViteConfig = {
|
11
|
-
buildDir: string;
|
12
|
-
publicDir: string;
|
13
|
-
assetsDir: string;
|
14
|
-
urlPathname: string | undefined;
|
15
|
-
userProvidedBuildOptions: UserProvidedBuildOptions;
|
16
|
-
};
|
17
|
-
|
18
|
-
const zResolvedViteConfig = z.object({
|
19
|
-
"buildDir": z.string(),
|
20
|
-
"publicDir": z.string(),
|
21
|
-
"assetsDir": z.string(),
|
22
|
-
"urlPathname": z.string().optional(),
|
23
|
-
"userProvidedBuildOptions": zUserProvidedBuildOptions
|
24
|
-
});
|
25
|
-
|
26
|
-
{
|
27
|
-
type Got = ReturnType<(typeof zResolvedViteConfig)["parse"]>;
|
28
|
-
type Expected = OptionalIfCanBeUndefined<ResolvedViteConfig>;
|
29
|
-
|
30
|
-
assert<Equals<Got, Expected>>();
|
31
|
-
}
|
32
|
-
|
33
|
-
export function readResolvedViteConfig(params: { cacheDirPath: string }): {
|
34
|
-
resolvedViteConfig: ResolvedViteConfig | undefined;
|
35
|
-
} {
|
36
|
-
const { cacheDirPath } = params;
|
37
|
-
|
38
|
-
const resolvedViteConfigJsonFilePath = pathJoin(cacheDirPath, resolvedViteConfigJsonBasename);
|
39
|
-
|
40
|
-
if (!fs.existsSync(resolvedViteConfigJsonFilePath)) {
|
41
|
-
return { "resolvedViteConfig": undefined };
|
42
|
-
}
|
43
|
-
|
44
|
-
const resolvedViteConfig = (() => {
|
45
|
-
if (!fs.existsSync(resolvedViteConfigJsonFilePath)) {
|
46
|
-
throw new Error("Missing Keycloakify Vite plugin output.");
|
47
|
-
}
|
48
|
-
|
49
|
-
let out: ResolvedViteConfig;
|
50
|
-
|
51
|
-
try {
|
52
|
-
out = JSON.parse(fs.readFileSync(resolvedViteConfigJsonFilePath).toString("utf8"));
|
53
|
-
} catch {
|
54
|
-
throw new Error("The output of the Keycloakify Vite plugin is not a valid JSON.");
|
55
|
-
}
|
56
|
-
|
57
|
-
try {
|
58
|
-
const zodParseReturn = zResolvedViteConfig.parse(out);
|
59
|
-
|
60
|
-
// So that objectKeys from tsafe return the expected result no matter what.
|
61
|
-
Object.keys(zodParseReturn)
|
62
|
-
.filter(key => !(key in out))
|
63
|
-
.forEach(key => {
|
64
|
-
delete (out as any)[key];
|
65
|
-
});
|
66
|
-
} catch {
|
67
|
-
throw new Error("The output of the Keycloakify Vite plugin do not match the expected schema.");
|
68
|
-
}
|
69
|
-
|
70
|
-
return out;
|
71
|
-
})();
|
72
|
-
|
73
|
-
return { resolvedViteConfig };
|
74
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { transformCodebase } from "../../tools/transformCodebase";
|
2
|
-
import { join as pathJoin } from "path";
|
3
|
-
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
4
|
-
import { resources_common, type ThemeType } from "../../constants";
|
5
|
-
import { BuildOptions } from "../buildOptions";
|
6
|
-
import { assert } from "tsafe/assert";
|
7
|
-
import * as crypto from "crypto";
|
8
|
-
import { rmSync } from "../../tools/fs.rmSync";
|
9
|
-
|
10
|
-
export type BuildOptionsLike = {
|
11
|
-
cacheDirPath: string;
|
12
|
-
npmWorkspaceRootDirPath: string;
|
13
|
-
};
|
14
|
-
|
15
|
-
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
16
|
-
|
17
|
-
export async function downloadKeycloakStaticResources(params: {
|
18
|
-
themeType: ThemeType;
|
19
|
-
themeDirPath: string;
|
20
|
-
keycloakVersion: string;
|
21
|
-
buildOptions: BuildOptionsLike;
|
22
|
-
}) {
|
23
|
-
const { themeType, themeDirPath, keycloakVersion, buildOptions } = params;
|
24
|
-
|
25
|
-
const tmpDirPath = pathJoin(
|
26
|
-
themeDirPath,
|
27
|
-
`tmp_suLeKsxId_${crypto.createHash("sha256").update(`${themeType}-${keycloakVersion}`).digest("hex").slice(0, 8)}`
|
28
|
-
);
|
29
|
-
|
30
|
-
await downloadBuiltinKeycloakTheme({
|
31
|
-
keycloakVersion,
|
32
|
-
"destDirPath": tmpDirPath,
|
33
|
-
buildOptions
|
34
|
-
});
|
35
|
-
|
36
|
-
const resourcesPath = pathJoin(themeDirPath, themeType, "resources");
|
37
|
-
|
38
|
-
transformCodebase({
|
39
|
-
"srcDirPath": pathJoin(tmpDirPath, "keycloak", themeType, "resources"),
|
40
|
-
"destDirPath": resourcesPath
|
41
|
-
});
|
42
|
-
|
43
|
-
transformCodebase({
|
44
|
-
"srcDirPath": pathJoin(tmpDirPath, "keycloak", "common", "resources"),
|
45
|
-
"destDirPath": pathJoin(resourcesPath, resources_common)
|
46
|
-
});
|
47
|
-
|
48
|
-
rmSync(tmpDirPath, { "recursive": true, "force": true });
|
49
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { join as pathJoin } from "path";
|
2
|
-
import type { BuildOptions } from "../buildOptions";
|
3
|
-
import { assert } from "tsafe/assert";
|
4
|
-
import { generateSrcMainResources, type BuildOptionsLike as BuildOptionsLike_generateSrcMainResources } from "./generateSrcMainResources";
|
5
|
-
import { generateThemeVariations } from "./generateThemeVariants";
|
6
|
-
|
7
|
-
export type BuildOptionsLike = BuildOptionsLike_generateSrcMainResources & {
|
8
|
-
keycloakifyBuildDirPath: string;
|
9
|
-
themeNames: string[];
|
10
|
-
};
|
11
|
-
|
12
|
-
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
13
|
-
|
14
|
-
export async function generateTheme(params: {
|
15
|
-
themeSrcDirPath: string;
|
16
|
-
keycloakifySrcDirPath: string;
|
17
|
-
buildOptions: BuildOptionsLike;
|
18
|
-
keycloakifyVersion: string;
|
19
|
-
}): Promise<{ doesImplementAccountTheme: boolean }> {
|
20
|
-
const { themeSrcDirPath, keycloakifySrcDirPath, buildOptions, keycloakifyVersion } = params;
|
21
|
-
|
22
|
-
const [themeName, ...themeVariantNames] = buildOptions.themeNames;
|
23
|
-
|
24
|
-
const srcMainResourcesDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources");
|
25
|
-
|
26
|
-
const { doesImplementAccountTheme } = await generateSrcMainResources({
|
27
|
-
themeName,
|
28
|
-
srcMainResourcesDirPath,
|
29
|
-
themeSrcDirPath,
|
30
|
-
keycloakifySrcDirPath,
|
31
|
-
keycloakifyVersion,
|
32
|
-
buildOptions
|
33
|
-
});
|
34
|
-
|
35
|
-
for (const themeVariantName of themeVariantNames) {
|
36
|
-
generateThemeVariations({
|
37
|
-
themeName,
|
38
|
-
themeVariantName,
|
39
|
-
srcMainResourcesDirPath
|
40
|
-
});
|
41
|
-
}
|
42
|
-
|
43
|
-
return { doesImplementAccountTheme };
|
44
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { join as pathJoin, extname as pathExtname, sep as pathSep } from "path";
|
2
|
-
import { transformCodebase } from "../../tools/transformCodebase";
|
3
|
-
import { assert } from "tsafe/assert";
|
4
|
-
import * as fs from "fs";
|
5
|
-
|
6
|
-
export function generateThemeVariations(params: { themeName: string; themeVariantName: string; srcMainResourcesDirPath: string }) {
|
7
|
-
const { themeName, themeVariantName, srcMainResourcesDirPath } = params;
|
8
|
-
|
9
|
-
const mainThemeDirPath = pathJoin(srcMainResourcesDirPath, "theme", themeName);
|
10
|
-
|
11
|
-
transformCodebase({
|
12
|
-
"srcDirPath": mainThemeDirPath,
|
13
|
-
"destDirPath": pathJoin(mainThemeDirPath, "..", themeVariantName),
|
14
|
-
"transformSourceCode": ({ fileRelativePath, sourceCode }) => {
|
15
|
-
if (pathExtname(fileRelativePath) === ".ftl" && fileRelativePath.split(pathSep).length === 2) {
|
16
|
-
const modifiedSourceCode = Buffer.from(
|
17
|
-
Buffer.from(sourceCode)
|
18
|
-
.toString("utf-8")
|
19
|
-
.replace(`out["themeName"] = "${themeName}";`, `out["themeName"] = "${themeVariantName}";`),
|
20
|
-
"utf8"
|
21
|
-
);
|
22
|
-
|
23
|
-
assert(Buffer.compare(modifiedSourceCode, sourceCode) !== 0);
|
24
|
-
|
25
|
-
return { modifiedSourceCode };
|
26
|
-
}
|
27
|
-
|
28
|
-
return { "modifiedSourceCode": sourceCode };
|
29
|
-
}
|
30
|
-
});
|
31
|
-
|
32
|
-
{
|
33
|
-
const keycloakThemeJsonFilePath = pathJoin(srcMainResourcesDirPath, "META-INF", "keycloak-themes.json");
|
34
|
-
|
35
|
-
const modifiedParsedJson = JSON.parse(fs.readFileSync(keycloakThemeJsonFilePath).toString("utf8")) as {
|
36
|
-
themes: { name: string; types: string[] }[];
|
37
|
-
};
|
38
|
-
|
39
|
-
modifiedParsedJson.themes.push({
|
40
|
-
"name": themeVariantName,
|
41
|
-
"types": (() => {
|
42
|
-
const theme = modifiedParsedJson.themes.find(({ name }) => name === themeName);
|
43
|
-
assert(theme !== undefined);
|
44
|
-
return theme.types;
|
45
|
-
})()
|
46
|
-
});
|
47
|
-
|
48
|
-
fs.writeFileSync(keycloakThemeJsonFilePath, Buffer.from(JSON.stringify(modifiedParsedJson, null, 2), "utf8"));
|
49
|
-
}
|
50
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./generateTheme";
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { crawl } from "../../tools/crawl";
|
2
|
-
import { join as pathJoin } from "path";
|
3
|
-
import * as fs from "fs";
|
4
|
-
import type { ThemeType } from "../../constants";
|
5
|
-
|
6
|
-
/** Assumes the theme type exists */
|
7
|
-
export function readFieldNameUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
8
|
-
const { keycloakifySrcDirPath, themeSrcDirPath, themeType } = params;
|
9
|
-
|
10
|
-
const fieldNames = new Set<string>();
|
11
|
-
|
12
|
-
for (const srcDirPath of [pathJoin(keycloakifySrcDirPath, themeType), pathJoin(themeSrcDirPath, themeType)]) {
|
13
|
-
const filePaths = crawl({ "dirPath": srcDirPath, "returnedPathsType": "absolute" }).filter(filePath => /\.(ts|tsx|js|jsx)$/.test(filePath));
|
14
|
-
|
15
|
-
for (const filePath of filePaths) {
|
16
|
-
const rawSourceFile = fs.readFileSync(filePath).toString("utf8");
|
17
|
-
|
18
|
-
if (!rawSourceFile.includes("messagesPerField")) {
|
19
|
-
continue;
|
20
|
-
}
|
21
|
-
|
22
|
-
for (const functionName of ["printIfExists", "existsError", "get", "exists", "getFirstError"] as const) {
|
23
|
-
if (!rawSourceFile.includes(functionName)) {
|
24
|
-
continue;
|
25
|
-
}
|
26
|
-
|
27
|
-
try {
|
28
|
-
rawSourceFile
|
29
|
-
.split(functionName)
|
30
|
-
.filter(part => part.startsWith("("))
|
31
|
-
.map(part => {
|
32
|
-
let [p1] = part.split(")");
|
33
|
-
|
34
|
-
p1 = p1.slice(1);
|
35
|
-
|
36
|
-
return p1;
|
37
|
-
})
|
38
|
-
.map(part => {
|
39
|
-
return part
|
40
|
-
.split(",")
|
41
|
-
.map(a => a.trim())
|
42
|
-
.filter((...[, i]) => (functionName !== "printIfExists" ? true : i === 0))
|
43
|
-
.filter(a => a.startsWith('"') || a.startsWith("'") || a.startsWith("`"))
|
44
|
-
.filter(a => a.endsWith('"') || a.endsWith("'") || a.endsWith("`"))
|
45
|
-
.map(a => a.slice(1).slice(0, -1));
|
46
|
-
})
|
47
|
-
.flat()
|
48
|
-
.forEach(fieldName => fieldNames.add(fieldName));
|
49
|
-
} catch {}
|
50
|
-
}
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
return Array.from(fieldNames);
|
55
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { getLatestsSemVersionedTagFactory } from "./tools/octokit-addons/getLatestsSemVersionedTag";
|
2
|
-
import { Octokit } from "@octokit/rest";
|
3
|
-
import cliSelect from "cli-select";
|
4
|
-
import { lastKeycloakVersionWithAccountV1 } from "./constants";
|
5
|
-
|
6
|
-
export async function promptKeycloakVersion() {
|
7
|
-
const { getLatestsSemVersionedTag } = (() => {
|
8
|
-
const { octokit } = (() => {
|
9
|
-
const githubToken = process.env.GITHUB_TOKEN;
|
10
|
-
|
11
|
-
const octokit = new Octokit(githubToken === undefined ? undefined : { "auth": githubToken });
|
12
|
-
|
13
|
-
return { octokit };
|
14
|
-
})();
|
15
|
-
|
16
|
-
const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({ octokit });
|
17
|
-
|
18
|
-
return { getLatestsSemVersionedTag };
|
19
|
-
})();
|
20
|
-
|
21
|
-
console.log("Select Keycloak version?");
|
22
|
-
|
23
|
-
const tags = [
|
24
|
-
...(await getLatestsSemVersionedTag({
|
25
|
-
"count": 15,
|
26
|
-
"owner": "keycloak",
|
27
|
-
"repo": "keycloak"
|
28
|
-
}).then(arr => arr.map(({ tag }) => tag))),
|
29
|
-
lastKeycloakVersionWithAccountV1,
|
30
|
-
"19.0.1",
|
31
|
-
"11.0.3"
|
32
|
-
];
|
33
|
-
|
34
|
-
if (process.env["GITHUB_ACTIONS"] === "true") {
|
35
|
-
return { "keycloakVersion": tags[0] };
|
36
|
-
}
|
37
|
-
|
38
|
-
const { value: keycloakVersion } = await cliSelect<string>({
|
39
|
-
"values": tags
|
40
|
-
}).catch(() => {
|
41
|
-
console.log("Aborting");
|
42
|
-
|
43
|
-
process.exit(-1);
|
44
|
-
});
|
45
|
-
|
46
|
-
console.log(keycloakVersion);
|
47
|
-
|
48
|
-
return { keycloakVersion };
|
49
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { getThisCodebaseRootDirPath } from "./getThisCodebaseRootDirPath";
|
2
|
-
import { join as pathJoin } from "path";
|
3
|
-
import { constants } from "fs";
|
4
|
-
import { chmod, stat } from "fs/promises";
|
5
|
-
|
6
|
-
(async () => {
|
7
|
-
const thisCodebaseRootDirPath = getThisCodebaseRootDirPath();
|
8
|
-
|
9
|
-
const { bin } = await import(pathJoin(thisCodebaseRootDirPath, "package.json"));
|
10
|
-
|
11
|
-
const promises = Object.values<string>(bin).map(async scriptPath => {
|
12
|
-
const fullPath = pathJoin(thisCodebaseRootDirPath, scriptPath);
|
13
|
-
const oldMode = (await stat(fullPath)).mode;
|
14
|
-
const newMode = oldMode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH;
|
15
|
-
await chmod(fullPath, newMode);
|
16
|
-
});
|
17
|
-
|
18
|
-
await Promise.all(promises);
|
19
|
-
})();
|