keycloakify 10.0.0-rc.0 → 10.0.0-rc.10
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 +2 -2
- 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 +3 -4
- 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.map +1 -1
- package/account/kcContext/getKcContextFromWindow.js +1 -1
- package/account/kcContext/getKcContextFromWindow.js.map +1 -1
- package/account/kcContext/kcContextMocks.js +22 -14
- package/account/kcContext/kcContextMocks.js.map +1 -1
- package/account/pages/Account.js +1 -1
- 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 +4 -6
- 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 +2 -2
- package/account/pages/Totp.js.map +1 -1
- package/bin/main.js +143109 -0
- package/lib/BASE_URL.js.map +1 -1
- package/login/Fallback.js.map +1 -1
- package/login/Template.js +4 -4
- package/login/Template.js.map +1 -1
- package/login/UserProfileFormFields.js +17 -19
- package/login/UserProfileFormFields.js.map +1 -1
- package/login/i18n/baseMessages/index.js.map +1 -1
- package/login/i18n/i18n.d.ts +3 -4
- package/login/i18n/i18n.js +3 -4
- 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.map +1 -1
- package/login/kcContext/createGetKcContext.d.ts +3 -3
- package/login/kcContext/createGetKcContext.js.map +1 -1
- package/login/kcContext/getKcContextFromWindow.js +1 -1
- package/login/kcContext/getKcContextFromWindow.js.map +1 -1
- package/login/kcContext/kcContextMocks.js +3 -2
- package/login/kcContext/kcContextMocks.js.map +1 -1
- package/login/lib/useDownloadTerms.js.map +1 -1
- package/login/lib/useUserProfileForm.js +9 -9
- 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 +1 -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 -10
- 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 +3 -3
- 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 +6 -6
- 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 +3 -3
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/package.json +62 -509
- package/src/PUBLIC_URL.ts +1 -1
- package/src/account/Fallback.tsx +3 -0
- package/src/account/Template.tsx +2 -5
- package/src/account/i18n/i18n.tsx +5 -8
- package/src/account/index.ts +1 -1
- package/src/account/kcContext/KcContext.ts +72 -62
- package/src/account/kcContext/getKcContextFromWindow.ts +1 -1
- package/src/account/kcContext/kcContextMocks.ts +21 -15
- 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/Sessions.tsx +0 -3
- package/src/account/pages/Totp.tsx +20 -21
- package/src/bin/copy-keycloak-resources-to-public.ts +10 -106
- package/src/bin/download-builtin-keycloak-theme.ts +14 -274
- package/src/bin/eject-keycloak-page.ts +81 -19
- package/src/bin/initialize-email-theme.ts +22 -21
- package/src/bin/keycloakify/buildJars/buildJar.ts +27 -20
- package/src/bin/keycloakify/buildJars/buildJars.ts +14 -15
- package/src/bin/keycloakify/buildJars/generatePom.ts +4 -4
- package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +45 -18
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +162 -234
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +7 -4
- package/src/bin/keycloakify/generateFtl/index.ts +0 -1
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/bringInAccountV1.ts +8 -7
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/generateMessageProperties.ts +1 -1
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +32 -0
- package/src/bin/keycloakify/{generateTheme/generateSrcMainResources.ts → generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts} +40 -46
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +56 -0
- package/src/bin/keycloakify/generateSrcMainResources/index.ts +1 -0
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/readExtraPageNames.ts +1 -2
- package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/readFieldNameUsage.ts +5 -6
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +14 -15
- package/src/bin/keycloakify/index.ts +0 -7
- package/src/bin/keycloakify/keycloakify.ts +50 -67
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +2 -2
- package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +2 -2
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +1 -1
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +2 -2
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +2 -2
- package/src/bin/main.ts +175 -0
- package/src/bin/shared/KeycloakVersionRange.ts +7 -0
- package/src/bin/{keycloakify/buildOptions → shared}/buildOptions.ts +113 -25
- package/src/bin/{keycloakify/generateFtl/pageId.ts → shared/constants.ts} +25 -1
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +90 -0
- package/src/bin/{downloadAndUnzip.ts → shared/downloadAndUnzip.ts} +6 -6
- package/src/bin/shared/downloadBuiltinKeycloakTheme.ts +264 -0
- package/src/bin/{keycloakify/generateTheme → shared}/downloadKeycloakStaticResources.ts +8 -8
- package/src/bin/shared/getJarFileBasename.ts +9 -0
- package/src/bin/{getThemeSrcDirPath.ts → shared/getThemeSrcDirPath.ts} +1 -1
- package/src/bin/shared/metaInfKeycloakThemes.ts +34 -0
- package/src/bin/shared/promptKeycloakVersion.ts +106 -0
- package/src/bin/start-keycloak.ts +236 -0
- package/src/bin/tools/fs.rmSync.ts +4 -4
- package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +8 -1
- package/src/bin/{keycloakify/buildOptions → tools}/getNpmWorkspaceRootDirPath.ts +1 -23
- package/src/bin/tools/{readThisNpmProjectVersion.ts → readThisNpmPackageVersion.ts} +1 -1
- package/src/login/Template.tsx +6 -22
- package/src/login/UserProfileFormFields.tsx +2 -5
- package/src/login/i18n/i18n.tsx +5 -8
- package/src/login/index.ts +1 -1
- package/src/login/kcContext/KcContext.ts +2 -2
- package/src/login/kcContext/getKcContextFromWindow.ts +1 -1
- package/src/login/kcContext/kcContextMocks.ts +3 -3
- package/src/login/lib/useUserProfileForm.tsx +10 -10
- package/src/login/pages/Code.tsx +1 -1
- package/src/login/pages/IdpReviewUserProfile.tsx +1 -1
- package/src/login/pages/Login.tsx +1 -1
- package/src/login/pages/LoginConfigTotp.tsx +1 -9
- package/src/login/pages/LoginUpdateProfile.tsx +1 -1
- package/src/login/pages/LoginUsername.tsx +1 -1
- package/src/login/pages/Register.tsx +2 -2
- package/src/login/pages/UpdateEmail.tsx +1 -1
- package/src/login/pages/WebauthnRegister.tsx +1 -1
- package/src/vite-plugin/tsconfig.json +2 -1
- package/src/vite-plugin/vite-plugin.ts +29 -41
- package/tools/Array.prototype.every.js.map +1 -1
- package/tools/HTMLElement.prototype.prepend.js.map +1 -1
- package/tools/clsx.js.map +1 -1
- 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/useInsertLinkTags.js.map +1 -1
- package/tools/useInsertScriptTags.js.map +1 -1
- package/tools/useSetClassName.js.map +1 -1
- 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 -216
- 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 -94
- 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 -593
- 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.d.ts +0 -4
- 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 -142
- 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/keycloakify/buildOptions/UserProvidedBuildOptions.ts +0 -21
- package/src/bin/keycloakify/buildOptions/getCacheDirPath.ts +0 -25
- 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/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/promptKeycloakVersion.ts +0 -49
- package/src/bin/tools/grant-exec-perms.ts +0 -19
- package/src/bin/tools/logger.ts +0 -27
- package/src/index.ts +0 -1
- package/src/lib/keycloakJsAdapter.ts +0 -118
- package/vite-plugin/index.d.ts +0 -1
- package/vite-plugin/index.js +0 -18
- 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
package/src/bin/main.ts
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
import { termost } from "termost";
|
4
|
+
import { readThisNpmPackageVersion } from "./tools/readThisNpmPackageVersion";
|
5
|
+
import * as child_process from "child_process";
|
6
|
+
|
7
|
+
export type CliCommandOptions = {
|
8
|
+
reactAppRootDirPath: string | undefined;
|
9
|
+
};
|
10
|
+
|
11
|
+
const program = termost<CliCommandOptions>(
|
12
|
+
{
|
13
|
+
"name": "keycloakify",
|
14
|
+
"description": "Keycloakify CLI",
|
15
|
+
"version": readThisNpmPackageVersion()
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"onException": error => {
|
19
|
+
console.error(error);
|
20
|
+
process.exit(1);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
);
|
24
|
+
|
25
|
+
const optionsKeys: string[] = [];
|
26
|
+
|
27
|
+
program.option({
|
28
|
+
"key": "reactAppRootDirPath",
|
29
|
+
"name": (() => {
|
30
|
+
const long = "project";
|
31
|
+
const short = "p";
|
32
|
+
|
33
|
+
optionsKeys.push(long, short);
|
34
|
+
|
35
|
+
return { long, short };
|
36
|
+
})(),
|
37
|
+
"description": [
|
38
|
+
`For monorepos, path to the keycloakify project.`,
|
39
|
+
"Example: `npx keycloakify build --project packages/keycloak-theme`",
|
40
|
+
"https://docs.keycloakify.dev/build-options#project-or-p-cli-option"
|
41
|
+
].join(" "),
|
42
|
+
"defaultValue": undefined
|
43
|
+
});
|
44
|
+
|
45
|
+
function skip(_context: any, argv: { options: Record<string, unknown> }) {
|
46
|
+
const unrecognizedOptionKey = Object.keys(argv.options).find(key => !optionsKeys.includes(key));
|
47
|
+
|
48
|
+
if (unrecognizedOptionKey !== undefined) {
|
49
|
+
console.error(`keycloakify: Unrecognized option: ${unrecognizedOptionKey.length === 1 ? "-" : "--"}${unrecognizedOptionKey}`);
|
50
|
+
process.exit(1);
|
51
|
+
}
|
52
|
+
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
|
56
|
+
program
|
57
|
+
.command({
|
58
|
+
"name": "build",
|
59
|
+
"description": "Build the theme (default subcommand)."
|
60
|
+
})
|
61
|
+
.task({
|
62
|
+
skip,
|
63
|
+
"handler": async cliCommandOptions => {
|
64
|
+
const { command } = await import("./keycloakify");
|
65
|
+
|
66
|
+
await command({ cliCommandOptions });
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
program
|
71
|
+
.command<{ port: number; keycloakVersion: string | undefined }>({
|
72
|
+
"name": "start-keycloak",
|
73
|
+
"description": "Spin up a pre configured Docker image of Keycloak to test your theme."
|
74
|
+
})
|
75
|
+
.option({
|
76
|
+
"key": "port",
|
77
|
+
"name": (() => {
|
78
|
+
const name = "port";
|
79
|
+
|
80
|
+
optionsKeys.push(name);
|
81
|
+
|
82
|
+
return name;
|
83
|
+
})(),
|
84
|
+
"description": "Keycloak server port.",
|
85
|
+
"defaultValue": 8080
|
86
|
+
})
|
87
|
+
.option({
|
88
|
+
"key": "keycloakVersion",
|
89
|
+
"name": (() => {
|
90
|
+
const name = "keycloak-version";
|
91
|
+
|
92
|
+
optionsKeys.push(name);
|
93
|
+
|
94
|
+
return name;
|
95
|
+
})(),
|
96
|
+
"description": "Use a specific version of Keycloak.",
|
97
|
+
"defaultValue": undefined
|
98
|
+
})
|
99
|
+
.task({
|
100
|
+
skip,
|
101
|
+
"handler": async cliCommandOptions => {
|
102
|
+
const { command } = await import("./start-keycloak");
|
103
|
+
|
104
|
+
await command({ cliCommandOptions });
|
105
|
+
}
|
106
|
+
});
|
107
|
+
|
108
|
+
program
|
109
|
+
.command({
|
110
|
+
"name": "download-builtin-keycloak-theme",
|
111
|
+
"description": "Download the built-in Keycloak theme."
|
112
|
+
})
|
113
|
+
.task({
|
114
|
+
skip,
|
115
|
+
"handler": async cliCommandOptions => {
|
116
|
+
const { command } = await import("./download-builtin-keycloak-theme");
|
117
|
+
|
118
|
+
await command({ cliCommandOptions });
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
program
|
123
|
+
.command({
|
124
|
+
"name": "eject-keycloak-page",
|
125
|
+
"description": "Eject a Keycloak page."
|
126
|
+
})
|
127
|
+
.task({
|
128
|
+
skip,
|
129
|
+
"handler": async cliCommandOptions => {
|
130
|
+
const { command } = await import("./eject-keycloak-page");
|
131
|
+
|
132
|
+
await command({ cliCommandOptions });
|
133
|
+
}
|
134
|
+
});
|
135
|
+
|
136
|
+
program
|
137
|
+
.command({
|
138
|
+
"name": "initialize-email-theme",
|
139
|
+
"description": "Initialize an email theme."
|
140
|
+
})
|
141
|
+
.task({
|
142
|
+
skip,
|
143
|
+
"handler": async cliCommandOptions => {
|
144
|
+
const { command } = await import("./initialize-email-theme");
|
145
|
+
|
146
|
+
await command({ cliCommandOptions });
|
147
|
+
}
|
148
|
+
});
|
149
|
+
|
150
|
+
program
|
151
|
+
.command({
|
152
|
+
"name": "copy-keycloak-resources-to-public",
|
153
|
+
"description": "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
|
154
|
+
})
|
155
|
+
.task({
|
156
|
+
skip,
|
157
|
+
"handler": async cliCommandOptions => {
|
158
|
+
const { command } = await import("./copy-keycloak-resources-to-public");
|
159
|
+
|
160
|
+
await command({ cliCommandOptions });
|
161
|
+
}
|
162
|
+
});
|
163
|
+
|
164
|
+
// Fallback to build command if no command is provided
|
165
|
+
{
|
166
|
+
const [, , ...rest] = process.argv;
|
167
|
+
|
168
|
+
if (rest.length === 0 || (rest[0].startsWith("-") && rest[0] !== "--help" && rest[0] !== "-h")) {
|
169
|
+
const { status } = child_process.spawnSync("npx", ["keycloakify", "build", ...rest], {
|
170
|
+
"stdio": "inherit"
|
171
|
+
});
|
172
|
+
|
173
|
+
process.exit(status ?? 1);
|
174
|
+
}
|
175
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export type KeycloakVersionRange = KeycloakVersionRange.WithAccountTheme | KeycloakVersionRange.WithoutAccountTheme;
|
2
|
+
|
3
|
+
export namespace KeycloakVersionRange {
|
4
|
+
export type WithoutAccountTheme = "21-and-below" | "22-and-above";
|
5
|
+
|
6
|
+
export type WithAccountTheme = "21-and-below" | "23" | "24-and-above";
|
7
|
+
}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import { parse as urlParse } from "url";
|
2
|
-
import { readParsedPackageJson } from "./parsedPackageJson";
|
3
2
|
import { join as pathJoin } from "path";
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import {
|
3
|
+
import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath";
|
4
|
+
import { getNpmWorkspaceRootDirPath } from "../tools/getNpmWorkspaceRootDirPath";
|
5
|
+
import type { CliCommandOptions } from "../main";
|
6
|
+
import { z } from "zod";
|
7
7
|
import * as fs from "fs";
|
8
|
-
import {
|
9
|
-
import
|
10
|
-
import {
|
8
|
+
import { assert } from "tsafe";
|
9
|
+
import * as child_process from "child_process";
|
10
|
+
import { vitePluginSubScriptEnvNames } from "./constants";
|
11
11
|
|
12
12
|
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
13
13
|
export type BuildOptions = {
|
14
14
|
bundler: "vite" | "webpack";
|
15
|
-
isSilent: boolean;
|
16
15
|
themeVersion: string;
|
17
16
|
themeNames: string[];
|
18
17
|
extraThemeProperties: string[] | undefined;
|
@@ -20,6 +19,7 @@ export type BuildOptions = {
|
|
20
19
|
artifactId: string;
|
21
20
|
loginThemeResourcesFromKeycloakVersion: string;
|
22
21
|
reactAppRootDirPath: string;
|
22
|
+
// TODO: Remove from vite type
|
23
23
|
reactAppBuildDirPath: string;
|
24
24
|
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
25
25
|
keycloakifyBuildDirPath: string;
|
@@ -32,23 +32,98 @@ export type BuildOptions = {
|
|
32
32
|
npmWorkspaceRootDirPath: string;
|
33
33
|
};
|
34
34
|
|
35
|
-
export
|
36
|
-
|
35
|
+
export type UserProvidedBuildOptions = {
|
36
|
+
extraThemeProperties?: string[];
|
37
|
+
artifactId?: string;
|
38
|
+
groupId?: string;
|
39
|
+
loginThemeResourcesFromKeycloakVersion?: string;
|
40
|
+
keycloakifyBuildDirPath?: string;
|
41
|
+
themeName?: string | string[];
|
42
|
+
};
|
43
|
+
|
44
|
+
export type ResolvedViteConfig = {
|
45
|
+
buildDir: string;
|
46
|
+
publicDir: string;
|
47
|
+
assetsDir: string;
|
48
|
+
urlPathname: string | undefined;
|
49
|
+
userProvidedBuildOptions: UserProvidedBuildOptions;
|
50
|
+
};
|
51
|
+
|
52
|
+
export function readBuildOptions(params: { cliCommandOptions: CliCommandOptions }): BuildOptions {
|
53
|
+
const { cliCommandOptions } = params;
|
54
|
+
|
55
|
+
const reactAppRootDirPath = (() => {
|
56
|
+
if (cliCommandOptions.reactAppRootDirPath === undefined) {
|
57
|
+
return process.cwd();
|
58
|
+
}
|
59
|
+
|
60
|
+
return getAbsoluteAndInOsFormatPath({
|
61
|
+
"pathIsh": cliCommandOptions.reactAppRootDirPath,
|
62
|
+
"cwd": process.cwd()
|
63
|
+
});
|
64
|
+
})();
|
65
|
+
|
66
|
+
const { resolvedViteConfig } = (() => {
|
67
|
+
if (fs.readdirSync(reactAppRootDirPath).find(fileBasename => fileBasename.startsWith("vite.config")) === undefined) {
|
68
|
+
return { "resolvedViteConfig": undefined };
|
69
|
+
}
|
70
|
+
|
71
|
+
const output = child_process
|
72
|
+
.execSync("npx vite", {
|
73
|
+
"cwd": reactAppRootDirPath,
|
74
|
+
"env": {
|
75
|
+
...process.env,
|
76
|
+
[vitePluginSubScriptEnvNames.resolveViteConfig]: "true"
|
77
|
+
}
|
78
|
+
})
|
79
|
+
.toString("utf8");
|
80
|
+
|
81
|
+
assert(output.includes(vitePluginSubScriptEnvNames.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
|
82
|
+
|
83
|
+
const resolvedViteConfigStr = output.split(vitePluginSubScriptEnvNames.resolveViteConfig).reverse()[0];
|
37
84
|
|
38
|
-
|
85
|
+
const resolvedViteConfig: ResolvedViteConfig = JSON.parse(resolvedViteConfigStr);
|
39
86
|
|
40
|
-
|
87
|
+
return { resolvedViteConfig };
|
88
|
+
})();
|
89
|
+
|
90
|
+
const parsedPackageJson = (() => {
|
91
|
+
type ParsedPackageJson = {
|
92
|
+
name: string;
|
93
|
+
version?: string;
|
94
|
+
homepage?: string;
|
95
|
+
keycloakify?: UserProvidedBuildOptions & { reactAppBuildDirPath?: string };
|
96
|
+
};
|
41
97
|
|
42
|
-
|
98
|
+
const zParsedPackageJson = z.object({
|
99
|
+
"name": z.string(),
|
100
|
+
"version": z.string().optional(),
|
101
|
+
"homepage": z.string().optional(),
|
102
|
+
"keycloakify": z
|
103
|
+
.object({
|
104
|
+
"extraThemeProperties": z.array(z.string()).optional(),
|
105
|
+
"artifactId": z.string().optional(),
|
106
|
+
"groupId": z.string().optional(),
|
107
|
+
"loginThemeResourcesFromKeycloakVersion": z.string().optional(),
|
108
|
+
"reactAppBuildDirPath": z.string().optional(),
|
109
|
+
"keycloakifyBuildDirPath": z.string().optional(),
|
110
|
+
"themeName": z.union([z.string(), z.array(z.string())]).optional()
|
111
|
+
})
|
112
|
+
.optional()
|
113
|
+
});
|
43
114
|
|
44
|
-
|
45
|
-
|
46
|
-
|
115
|
+
{
|
116
|
+
type Got = ReturnType<(typeof zParsedPackageJson)["parse"]>;
|
117
|
+
type Expected = ParsedPackageJson;
|
118
|
+
assert<Got extends Expected ? true : false>();
|
119
|
+
assert<Expected extends Got ? true : false>();
|
120
|
+
}
|
47
121
|
|
48
|
-
|
122
|
+
return zParsedPackageJson.parse(JSON.parse(fs.readFileSync(pathJoin(reactAppRootDirPath, "package.json")).toString("utf8")));
|
123
|
+
})();
|
49
124
|
|
50
|
-
const userProvidedBuildOptions = {
|
51
|
-
...
|
125
|
+
const userProvidedBuildOptions: UserProvidedBuildOptions = {
|
126
|
+
...parsedPackageJson.keycloakify,
|
52
127
|
...resolvedViteConfig?.userProvidedBuildOptions
|
53
128
|
};
|
54
129
|
|
@@ -75,9 +150,9 @@ export function readBuildOptions(params: { processArgv: string[] }): BuildOption
|
|
75
150
|
break webpack;
|
76
151
|
}
|
77
152
|
|
78
|
-
if (
|
153
|
+
if (parsedPackageJson.keycloakify?.reactAppBuildDirPath !== undefined) {
|
79
154
|
return getAbsoluteAndInOsFormatPath({
|
80
|
-
"pathIsh":
|
155
|
+
"pathIsh": parsedPackageJson.keycloakify.reactAppBuildDirPath,
|
81
156
|
"cwd": reactAppRootDirPath
|
82
157
|
});
|
83
158
|
}
|
@@ -88,13 +163,10 @@ export function readBuildOptions(params: { processArgv: string[] }): BuildOption
|
|
88
163
|
return pathJoin(reactAppRootDirPath, resolvedViteConfig.buildDir);
|
89
164
|
})();
|
90
165
|
|
91
|
-
const argv = parseArgv(processArgv);
|
92
|
-
|
93
166
|
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({ reactAppRootDirPath });
|
94
167
|
|
95
168
|
return {
|
96
169
|
"bundler": resolvedViteConfig !== undefined ? "vite" : "webpack",
|
97
|
-
"isSilent": typeof argv["silent"] === "boolean" ? argv["silent"] : false,
|
98
170
|
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? parsedPackageJson.version ?? "0.0.0",
|
99
171
|
themeNames,
|
100
172
|
"extraThemeProperties": userProvidedBuildOptions.extraThemeProperties,
|
@@ -148,7 +220,23 @@ export function readBuildOptions(params: { processArgv: string[] }): BuildOption
|
|
148
220
|
|
149
221
|
return pathJoin(reactAppRootDirPath, resolvedViteConfig.publicDir);
|
150
222
|
})(),
|
151
|
-
cacheDirPath
|
223
|
+
"cacheDirPath": (() => {
|
224
|
+
const cacheDirPath = pathJoin(
|
225
|
+
(() => {
|
226
|
+
if (process.env.XDG_CACHE_HOME !== undefined) {
|
227
|
+
return getAbsoluteAndInOsFormatPath({
|
228
|
+
"pathIsh": process.env.XDG_CACHE_HOME,
|
229
|
+
"cwd": process.cwd()
|
230
|
+
});
|
231
|
+
}
|
232
|
+
|
233
|
+
return pathJoin(npmWorkspaceRootDirPath, "node_modules", ".cache");
|
234
|
+
})(),
|
235
|
+
"keycloakify"
|
236
|
+
);
|
237
|
+
|
238
|
+
return cacheDirPath;
|
239
|
+
})(),
|
152
240
|
"urlPathname": (() => {
|
153
241
|
webpack: {
|
154
242
|
if (resolvedViteConfig !== undefined) {
|
@@ -1,3 +1,19 @@
|
|
1
|
+
export const nameOfTheGlobal = "kcContext";
|
2
|
+
export const keycloak_resources = "keycloak-resources";
|
3
|
+
export const resources_common = "resources-common";
|
4
|
+
export const lastKeycloakVersionWithAccountV1 = "21.1.2";
|
5
|
+
export const basenameOfTheKeycloakifyResourcesDir = "build";
|
6
|
+
|
7
|
+
export const themeTypes = ["login", "account"] as const;
|
8
|
+
export const accountV1ThemeName = "account-v1";
|
9
|
+
|
10
|
+
export type ThemeType = (typeof themeTypes)[number];
|
11
|
+
|
12
|
+
export const vitePluginSubScriptEnvNames = {
|
13
|
+
"runPostBuildScript": "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
|
14
|
+
"resolveViteConfig": "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
|
15
|
+
} as const;
|
16
|
+
|
1
17
|
export const loginThemePageIds = [
|
2
18
|
"login.ftl",
|
3
19
|
"login-username.ftl",
|
@@ -35,7 +51,15 @@ export const loginThemePageIds = [
|
|
35
51
|
"webauthn-error.ftl"
|
36
52
|
] as const;
|
37
53
|
|
38
|
-
export const accountThemePageIds = [
|
54
|
+
export const accountThemePageIds = [
|
55
|
+
"password.ftl",
|
56
|
+
"account.ftl",
|
57
|
+
"sessions.ftl",
|
58
|
+
"totp.ftl",
|
59
|
+
"applications.ftl",
|
60
|
+
"log.ftl",
|
61
|
+
"federatedIdentity.ftl"
|
62
|
+
] as const;
|
39
63
|
|
40
64
|
export type LoginThemePageId = (typeof loginThemePageIds)[number];
|
41
65
|
export type AccountThemePageId = (typeof accountThemePageIds)[number];
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import {
|
2
|
+
downloadKeycloakStaticResources,
|
3
|
+
type BuildOptionsLike as BuildOptionsLike_downloadKeycloakStaticResources
|
4
|
+
} from "./downloadKeycloakStaticResources";
|
5
|
+
import { join as pathJoin, relative as pathRelative } from "path";
|
6
|
+
import { themeTypes, keycloak_resources, lastKeycloakVersionWithAccountV1 } from "../shared/constants";
|
7
|
+
import { readThisNpmPackageVersion } from "../tools/readThisNpmPackageVersion";
|
8
|
+
import { assert } from "tsafe/assert";
|
9
|
+
import * as fs from "fs";
|
10
|
+
import { rmSync } from "../tools/fs.rmSync";
|
11
|
+
import type { BuildOptions } from "./buildOptions";
|
12
|
+
|
13
|
+
export type BuildOptionsLike = BuildOptionsLike_downloadKeycloakStaticResources & {
|
14
|
+
loginThemeResourcesFromKeycloakVersion: string;
|
15
|
+
publicDirPath: string;
|
16
|
+
};
|
17
|
+
|
18
|
+
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
19
|
+
|
20
|
+
export async function copyKeycloakResourcesToPublic(params: { buildOptions: BuildOptionsLike }) {
|
21
|
+
const { buildOptions } = params;
|
22
|
+
|
23
|
+
const destDirPath = pathJoin(buildOptions.publicDirPath, keycloak_resources);
|
24
|
+
|
25
|
+
const keycloakifyBuildinfoFilePath = pathJoin(destDirPath, "keycloakify.buildinfo");
|
26
|
+
|
27
|
+
const keycloakifyBuildinfoRaw = JSON.stringify(
|
28
|
+
{
|
29
|
+
destDirPath,
|
30
|
+
"keycloakifyVersion": readThisNpmPackageVersion(),
|
31
|
+
"buildOptions": {
|
32
|
+
"loginThemeResourcesFromKeycloakVersion": readThisNpmPackageVersion(),
|
33
|
+
"cacheDirPath": pathRelative(destDirPath, buildOptions.cacheDirPath),
|
34
|
+
"npmWorkspaceRootDirPath": pathRelative(destDirPath, buildOptions.npmWorkspaceRootDirPath)
|
35
|
+
}
|
36
|
+
},
|
37
|
+
null,
|
38
|
+
2
|
39
|
+
);
|
40
|
+
|
41
|
+
skip_if_already_done: {
|
42
|
+
if (!fs.existsSync(keycloakifyBuildinfoFilePath)) {
|
43
|
+
break skip_if_already_done;
|
44
|
+
}
|
45
|
+
|
46
|
+
const keycloakifyBuildinfoRaw_previousRun = fs.readFileSync(keycloakifyBuildinfoFilePath).toString("utf8");
|
47
|
+
|
48
|
+
if (keycloakifyBuildinfoRaw_previousRun !== keycloakifyBuildinfoRaw) {
|
49
|
+
break skip_if_already_done;
|
50
|
+
}
|
51
|
+
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
|
55
|
+
rmSync(destDirPath, { "force": true, "recursive": true });
|
56
|
+
|
57
|
+
fs.mkdirSync(destDirPath, { "recursive": true });
|
58
|
+
|
59
|
+
fs.writeFileSync(pathJoin(destDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
60
|
+
|
61
|
+
for (const themeType of themeTypes) {
|
62
|
+
await downloadKeycloakStaticResources({
|
63
|
+
"keycloakVersion": (() => {
|
64
|
+
switch (themeType) {
|
65
|
+
case "login":
|
66
|
+
return buildOptions.loginThemeResourcesFromKeycloakVersion;
|
67
|
+
case "account":
|
68
|
+
return lastKeycloakVersionWithAccountV1;
|
69
|
+
}
|
70
|
+
})(),
|
71
|
+
themeType,
|
72
|
+
"themeDirPath": destDirPath,
|
73
|
+
buildOptions
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
fs.writeFileSync(
|
78
|
+
pathJoin(destDirPath, "README.txt"),
|
79
|
+
Buffer.from(
|
80
|
+
// prettier-ignore
|
81
|
+
[
|
82
|
+
"This is just a test folder that helps develop",
|
83
|
+
"the login and register page without having to run a Keycloak container\n",
|
84
|
+
"This directory will be automatically excluded from the final build."
|
85
|
+
].join(" ")
|
86
|
+
)
|
87
|
+
);
|
88
|
+
|
89
|
+
fs.writeFileSync(keycloakifyBuildinfoFilePath, Buffer.from(keycloakifyBuildinfoRaw, "utf8"));
|
90
|
+
}
|
@@ -3,13 +3,13 @@ import { mkdir, writeFile, unlink } from "fs/promises";
|
|
3
3
|
import fetch from "make-fetch-happen";
|
4
4
|
import { dirname as pathDirname, join as pathJoin, basename as pathBasename } from "path";
|
5
5
|
import { assert } from "tsafe/assert";
|
6
|
-
import { transformCodebase } from "
|
7
|
-
import { unzip, zip } from "
|
8
|
-
import { rm } from "
|
6
|
+
import { transformCodebase } from "../tools/transformCodebase";
|
7
|
+
import { unzip, zip } from "../tools/unzip";
|
8
|
+
import { rm } from "../tools/fs.rm";
|
9
9
|
import * as child_process from "child_process";
|
10
|
-
import { existsAsync } from "
|
11
|
-
import type { BuildOptions } from "./
|
12
|
-
import { getProxyFetchOptions } from "
|
10
|
+
import { existsAsync } from "../tools/fs.existsAsync";
|
11
|
+
import type { BuildOptions } from "./buildOptions";
|
12
|
+
import { getProxyFetchOptions } from "../tools/fetchProxyOptions";
|
13
13
|
|
14
14
|
export type BuildOptionsLike = {
|
15
15
|
cacheDirPath: string;
|