keycloakify 10.0.0-rc.4 → 10.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/PUBLIC_URL.js +1 -1
  2. package/PUBLIC_URL.js.map +1 -1
  3. package/account/Fallback.js +3 -0
  4. package/account/Fallback.js.map +1 -1
  5. package/account/Template.js +1 -1
  6. package/account/Template.js.map +1 -1
  7. package/account/i18n/baseMessages/index.js.map +1 -1
  8. package/account/i18n/i18n.js +1 -1
  9. package/account/i18n/i18n.js.map +1 -1
  10. package/account/index.d.ts +1 -1
  11. package/account/kcContext/KcContext.d.ts +62 -44
  12. package/account/kcContext/KcContext.js.map +1 -1
  13. package/account/kcContext/createGetKcContext.d.ts +3 -3
  14. package/account/kcContext/createGetKcContext.js.map +1 -1
  15. package/account/kcContext/getKcContextFromWindow.js +1 -1
  16. package/account/kcContext/getKcContextFromWindow.js.map +1 -1
  17. package/account/kcContext/kcContextMocks.js +22 -14
  18. package/account/kcContext/kcContextMocks.js.map +1 -1
  19. package/account/pages/Account.js +1 -1
  20. package/account/pages/Account.js.map +1 -1
  21. package/account/pages/Applications.js +3 -3
  22. package/account/pages/Applications.js.map +1 -1
  23. package/account/pages/FederatedIdentity.d.ts +7 -0
  24. package/account/pages/FederatedIdentity.js +8 -0
  25. package/account/pages/FederatedIdentity.js.map +1 -0
  26. package/account/pages/Log.js +2 -2
  27. package/account/pages/Log.js.map +1 -1
  28. package/account/pages/Password.js +4 -6
  29. package/account/pages/Password.js.map +1 -1
  30. package/account/pages/Sessions.js +1 -5
  31. package/account/pages/Sessions.js.map +1 -1
  32. package/account/pages/Totp.js +2 -2
  33. package/account/pages/Totp.js.map +1 -1
  34. package/bin/copy-keycloak-resources-to-public.d.ts +3 -13
  35. package/bin/copy-keycloak-resources-to-public.js +22 -166
  36. package/bin/copy-keycloak-resources-to-public.js.map +1 -1
  37. package/bin/download-builtin-keycloak-theme.d.ts +3 -9
  38. package/bin/download-builtin-keycloak-theme.js +15 -291
  39. package/bin/download-builtin-keycloak-theme.js.map +1 -1
  40. package/bin/eject-keycloak-page.d.ts +4 -1
  41. package/bin/eject-keycloak-page.js +59 -54
  42. package/bin/eject-keycloak-page.js.map +1 -1
  43. package/bin/initialize-email-theme.d.ts +4 -2
  44. package/bin/initialize-email-theme.js +17 -19
  45. package/bin/initialize-email-theme.js.map +1 -1
  46. package/bin/keycloakify/buildJars/buildJar.d.ts +1 -0
  47. package/bin/keycloakify/buildJars/buildJar.js +14 -25
  48. package/bin/keycloakify/buildJars/buildJar.js.map +1 -1
  49. package/bin/keycloakify/buildJars/buildJars.d.ts +1 -4
  50. package/bin/keycloakify/buildJars/buildJars.js +17 -8
  51. package/bin/keycloakify/buildJars/buildJars.js.map +1 -1
  52. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.d.ts +2 -1
  53. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js +39 -17
  54. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js.map +1 -1
  55. package/bin/keycloakify/generateFtl/generateFtl.d.ts +1 -1
  56. package/bin/keycloakify/generateFtl/generateFtl.js +1 -1
  57. package/bin/keycloakify/generateFtl/generateFtl.js.map +1 -1
  58. package/bin/keycloakify/generateFtl/index.d.ts +0 -1
  59. package/bin/keycloakify/generateFtl/index.js +0 -1
  60. package/bin/keycloakify/generateFtl/index.js.map +1 -1
  61. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/bringInAccountV1.d.ts +1 -1
  62. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/bringInAccountV1.js +7 -7
  63. package/bin/keycloakify/generateSrcMainResources/bringInAccountV1.js.map +1 -0
  64. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/generateMessageProperties.d.ts +1 -1
  65. package/bin/keycloakify/generateSrcMainResources/generateMessageProperties.js.map +1 -0
  66. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.d.ts +7 -0
  67. package/bin/keycloakify/{generateTheme/generateTheme.js → generateSrcMainResources/generateSrcMainResources.js} +13 -19
  68. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.js.map +1 -0
  69. package/bin/keycloakify/{generateTheme/generateSrcMainResources.d.ts → generateSrcMainResources/generateSrcMainResourcesForMainTheme.d.ts} +4 -8
  70. package/bin/keycloakify/{generateTheme/generateSrcMainResources.js → generateSrcMainResources/generateSrcMainResourcesForMainTheme.js} +54 -52
  71. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.js.map +1 -0
  72. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.d.ts +8 -0
  73. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.js +47 -0
  74. package/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.js.map +1 -0
  75. package/bin/keycloakify/generateSrcMainResources/index.d.ts +1 -0
  76. package/bin/keycloakify/{buildOptions → generateSrcMainResources}/index.js +1 -1
  77. package/bin/keycloakify/generateSrcMainResources/index.js.map +1 -0
  78. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/readExtraPageNames.d.ts +1 -1
  79. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/readExtraPageNames.js +3 -3
  80. package/bin/keycloakify/generateSrcMainResources/readExtraPageNames.js.map +1 -0
  81. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/readFieldNameUsage.d.ts +1 -2
  82. package/bin/keycloakify/{generateTheme → generateSrcMainResources}/readFieldNameUsage.js +3 -2
  83. package/bin/keycloakify/generateSrcMainResources/readFieldNameUsage.js.map +1 -0
  84. package/bin/keycloakify/generateStartKeycloakTestingContainer.js +1 -1
  85. package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +1 -1
  86. package/bin/keycloakify/index.d.ts +0 -1
  87. package/bin/keycloakify/index.js +0 -5
  88. package/bin/keycloakify/index.js.map +1 -1
  89. package/bin/keycloakify/keycloakify.d.ts +4 -1
  90. package/bin/keycloakify/keycloakify.js +15 -61
  91. package/bin/keycloakify/keycloakify.js.map +1 -1
  92. package/bin/keycloakify/replacers/replaceImportsInCssCode.js +1 -1
  93. package/bin/keycloakify/replacers/replaceImportsInCssCode.js.map +1 -1
  94. package/bin/keycloakify/replacers/replaceImportsInInlineCssCode.js +1 -1
  95. package/bin/keycloakify/replacers/replaceImportsInInlineCssCode.js.map +1 -1
  96. package/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.js.map +1 -1
  97. package/bin/keycloakify/replacers/replaceImportsInJsCode/vite.js +1 -1
  98. package/bin/keycloakify/replacers/replaceImportsInJsCode/vite.js.map +1 -1
  99. package/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.js +1 -1
  100. package/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.js.map +1 -1
  101. package/bin/main.d.ts +5 -0
  102. package/bin/main.js +224 -0
  103. package/bin/main.js.map +1 -0
  104. package/bin/shared/KeycloakVersionRange.d.ts +5 -0
  105. package/bin/shared/KeycloakVersionRange.js +3 -0
  106. package/bin/shared/KeycloakVersionRange.js.map +1 -0
  107. package/bin/{keycloakify/buildOptions → shared}/buildOptions.d.ts +17 -1
  108. package/bin/{keycloakify/buildOptions → shared}/buildOptions.js +72 -35
  109. package/bin/shared/buildOptions.js.map +1 -0
  110. package/bin/{constants.d.ts → shared/constants.d.ts} +4 -2
  111. package/bin/shared/constants.js +15 -0
  112. package/bin/shared/constants.js.map +1 -0
  113. package/bin/shared/copyKeycloakResourcesToPublic.d.ts +8 -0
  114. package/bin/shared/copyKeycloakResourcesToPublic.js +175 -0
  115. package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -0
  116. package/bin/{downloadAndUnzip.js → shared/downloadAndUnzip.js} +11 -11
  117. package/bin/shared/downloadAndUnzip.js.map +1 -0
  118. package/bin/shared/downloadBuiltinKeycloakTheme.d.ts +9 -0
  119. package/bin/shared/downloadBuiltinKeycloakTheme.js +316 -0
  120. package/bin/shared/downloadBuiltinKeycloakTheme.js.map +1 -0
  121. package/bin/{keycloakify/generateTheme → shared}/downloadKeycloakStaticResources.d.ts +1 -1
  122. package/bin/{keycloakify/generateTheme → shared}/downloadKeycloakStaticResources.js +7 -7
  123. package/bin/shared/downloadKeycloakStaticResources.js.map +1 -0
  124. package/bin/shared/getJarFileBasename.d.ts +6 -0
  125. package/bin/shared/getJarFileBasename.js +10 -0
  126. package/bin/shared/getJarFileBasename.js.map +1 -0
  127. package/bin/{getThemeSrcDirPath.js → shared/getThemeSrcDirPath.js} +1 -1
  128. package/bin/shared/getThemeSrcDirPath.js.map +1 -0
  129. package/bin/shared/metaInfKeycloakThemes.d.ts +17 -0
  130. package/bin/shared/metaInfKeycloakThemes.js +51 -0
  131. package/bin/shared/metaInfKeycloakThemes.js.map +1 -0
  132. package/bin/{keycloakify/generateFtl/pageId.d.ts → shared/pageIds.d.ts} +1 -1
  133. package/bin/{keycloakify/generateFtl/pageId.js → shared/pageIds.js} +10 -2
  134. package/bin/shared/pageIds.js.map +1 -0
  135. package/bin/shared/promptKeycloakVersion.d.ts +5 -0
  136. package/bin/{promptKeycloakVersion.js → shared/promptKeycloakVersion.js} +32 -48
  137. package/bin/shared/promptKeycloakVersion.js.map +1 -0
  138. package/bin/start-keycloak-container.d.ts +4 -0
  139. package/bin/start-keycloak-container.js +209 -0
  140. package/bin/start-keycloak-container.js.map +1 -0
  141. package/bin/tools/SemVer.js +1 -1
  142. package/bin/tools/SemVer.js.map +1 -1
  143. package/bin/tools/String.prototype.replaceAll.js.map +1 -1
  144. package/bin/tools/crawl.js.map +1 -1
  145. package/bin/tools/crc32.js.map +1 -1
  146. package/bin/tools/deflate.js +10 -1
  147. package/bin/tools/deflate.js.map +1 -1
  148. package/bin/tools/fetchProxyOptions.js +9 -9
  149. package/bin/tools/fetchProxyOptions.js.map +1 -1
  150. package/bin/tools/fs.rm.js.map +1 -1
  151. package/bin/tools/fs.rmSync.js +4 -4
  152. package/bin/tools/fs.rmSync.js.map +1 -1
  153. package/bin/tools/getAbsoluteAndInOsFormatPath.js.map +1 -1
  154. package/bin/{keycloakify/buildOptions → tools}/getNpmWorkspaceRootDirPath.js +1 -13
  155. package/bin/tools/getNpmWorkspaceRootDirPath.js.map +1 -0
  156. package/bin/tools/getThisCodebaseRootDirPath.js.map +1 -1
  157. package/bin/tools/logger.d.ts +1 -1
  158. package/bin/tools/logger.js.map +1 -1
  159. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.js +21 -24
  160. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.js.map +1 -1
  161. package/bin/tools/octokit-addons/listTags.js +3 -2
  162. package/bin/tools/octokit-addons/listTags.js.map +1 -1
  163. package/bin/tools/transformCodebase.js.map +1 -1
  164. package/bin/tools/trimIndent.js.map +1 -1
  165. package/bin/tools/unzip.js.map +1 -1
  166. package/lib/BASE_URL.js.map +1 -1
  167. package/lib/keycloakJsAdapter.js.map +1 -1
  168. package/login/Fallback.js.map +1 -1
  169. package/login/Template.js +3 -3
  170. package/login/Template.js.map +1 -1
  171. package/login/UserProfileFormFields.js +17 -17
  172. package/login/UserProfileFormFields.js.map +1 -1
  173. package/login/i18n/baseMessages/index.js.map +1 -1
  174. package/login/i18n/i18n.js +1 -1
  175. package/login/i18n/i18n.js.map +1 -1
  176. package/login/index.d.ts +1 -1
  177. package/login/kcContext/KcContext.js.map +1 -1
  178. package/login/kcContext/createGetKcContext.d.ts +3 -3
  179. package/login/kcContext/createGetKcContext.js.map +1 -1
  180. package/login/kcContext/getKcContextFromWindow.js +1 -1
  181. package/login/kcContext/getKcContextFromWindow.js.map +1 -1
  182. package/login/kcContext/kcContextMocks.js +1 -1
  183. package/login/kcContext/kcContextMocks.js.map +1 -1
  184. package/login/lib/useDownloadTerms.js.map +1 -1
  185. package/login/lib/useUserProfileForm.js.map +1 -1
  186. package/login/pages/Code.js +1 -1
  187. package/login/pages/Code.js.map +1 -1
  188. package/login/pages/DeleteAccountConfirm.js +1 -1
  189. package/login/pages/DeleteAccountConfirm.js.map +1 -1
  190. package/login/pages/DeleteCredential.js +1 -1
  191. package/login/pages/DeleteCredential.js.map +1 -1
  192. package/login/pages/Error.js +1 -1
  193. package/login/pages/Error.js.map +1 -1
  194. package/login/pages/FrontchannelLogout.js +1 -1
  195. package/login/pages/FrontchannelLogout.js.map +1 -1
  196. package/login/pages/IdpReviewUserProfile.js +1 -1
  197. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  198. package/login/pages/Info.js +5 -5
  199. package/login/pages/Info.js.map +1 -1
  200. package/login/pages/Login.js +4 -4
  201. package/login/pages/Login.js.map +1 -1
  202. package/login/pages/LoginConfigTotp.js +2 -2
  203. package/login/pages/LoginConfigTotp.js.map +1 -1
  204. package/login/pages/LoginIdpLinkConfirm.js +1 -1
  205. package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
  206. package/login/pages/LoginIdpLinkEmail.js +1 -1
  207. package/login/pages/LoginIdpLinkEmail.js.map +1 -1
  208. package/login/pages/LoginOauth2DeviceVerifyUserCode.js +1 -1
  209. package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
  210. package/login/pages/LoginOauthGrant.js +2 -2
  211. package/login/pages/LoginOauthGrant.js.map +1 -1
  212. package/login/pages/LoginOtp.js +1 -1
  213. package/login/pages/LoginOtp.js.map +1 -1
  214. package/login/pages/LoginPageExpired.js +1 -1
  215. package/login/pages/LoginPageExpired.js.map +1 -1
  216. package/login/pages/LoginPassword.js +3 -3
  217. package/login/pages/LoginPassword.js.map +1 -1
  218. package/login/pages/LoginRecoveryAuthnCodeConfig.js +3 -3
  219. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  220. package/login/pages/LoginRecoveryAuthnCodeInput.js +1 -1
  221. package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
  222. package/login/pages/LoginResetOtp.js +1 -1
  223. package/login/pages/LoginResetOtp.js.map +1 -1
  224. package/login/pages/LoginResetPassword.js +2 -2
  225. package/login/pages/LoginResetPassword.js.map +1 -1
  226. package/login/pages/LoginUpdatePassword.js +3 -3
  227. package/login/pages/LoginUpdatePassword.js.map +1 -1
  228. package/login/pages/LoginUpdateProfile.js +2 -4
  229. package/login/pages/LoginUpdateProfile.js.map +1 -1
  230. package/login/pages/LoginUsername.js +3 -3
  231. package/login/pages/LoginUsername.js.map +1 -1
  232. package/login/pages/LoginVerifyEmail.js +1 -1
  233. package/login/pages/LoginVerifyEmail.js.map +1 -1
  234. package/login/pages/LoginX509Info.js +1 -1
  235. package/login/pages/LoginX509Info.js.map +1 -1
  236. package/login/pages/LogoutConfirm.js +1 -1
  237. package/login/pages/LogoutConfirm.js.map +1 -1
  238. package/login/pages/Register.js +4 -8
  239. package/login/pages/Register.js.map +1 -1
  240. package/login/pages/SamlPostForm.js +1 -1
  241. package/login/pages/SamlPostForm.js.map +1 -1
  242. package/login/pages/SelectAuthenticator.js +2 -2
  243. package/login/pages/SelectAuthenticator.js.map +1 -1
  244. package/login/pages/Terms.js +1 -1
  245. package/login/pages/Terms.js.map +1 -1
  246. package/login/pages/UpdateEmail.js +3 -5
  247. package/login/pages/UpdateEmail.js.map +1 -1
  248. package/login/pages/WebauthnAuthenticate.js +6 -6
  249. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  250. package/login/pages/WebauthnError.js +2 -2
  251. package/login/pages/WebauthnError.js.map +1 -1
  252. package/login/pages/WebauthnRegister.js +3 -3
  253. package/login/pages/WebauthnRegister.js.map +1 -1
  254. package/package.json +125 -118
  255. package/src/PUBLIC_URL.ts +1 -1
  256. package/src/account/Fallback.tsx +3 -0
  257. package/src/account/index.ts +1 -1
  258. package/src/account/kcContext/KcContext.ts +73 -47
  259. package/src/account/kcContext/getKcContextFromWindow.ts +1 -1
  260. package/src/account/kcContext/kcContextMocks.ts +21 -15
  261. package/src/account/pages/Applications.tsx +2 -2
  262. package/src/account/pages/FederatedIdentity.tsx +58 -0
  263. package/src/account/pages/Log.tsx +1 -1
  264. package/src/account/pages/Sessions.tsx +0 -3
  265. package/src/account/pages/Totp.tsx +20 -21
  266. package/src/bin/copy-keycloak-resources-to-public.ts +10 -106
  267. package/src/bin/download-builtin-keycloak-theme.ts +13 -273
  268. package/src/bin/eject-keycloak-page.ts +13 -10
  269. package/src/bin/initialize-email-theme.ts +16 -17
  270. package/src/bin/keycloakify/buildJars/buildJar.ts +13 -17
  271. package/src/bin/keycloakify/buildJars/buildJars.ts +14 -15
  272. package/src/bin/keycloakify/buildJars/generatePom.ts +1 -1
  273. package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +45 -18
  274. package/src/bin/keycloakify/generateFtl/generateFtl.ts +2 -2
  275. package/src/bin/keycloakify/generateFtl/index.ts +0 -1
  276. package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/bringInAccountV1.ts +8 -7
  277. package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/generateMessageProperties.ts +1 -1
  278. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +32 -0
  279. package/src/bin/keycloakify/{generateTheme/generateSrcMainResources.ts → generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts} +38 -45
  280. package/src/bin/keycloakify/{generateTheme/generateThemeVariants.ts → generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts} +18 -12
  281. package/src/bin/keycloakify/generateSrcMainResources/index.ts +1 -0
  282. package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/readExtraPageNames.ts +2 -2
  283. package/src/bin/keycloakify/{generateTheme → generateSrcMainResources}/readFieldNameUsage.ts +5 -4
  284. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +2 -2
  285. package/src/bin/keycloakify/index.ts +0 -7
  286. package/src/bin/keycloakify/keycloakify.ts +16 -64
  287. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +2 -2
  288. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +2 -2
  289. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +1 -1
  290. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +2 -2
  291. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +2 -2
  292. package/src/bin/main.ts +111 -0
  293. package/src/bin/shared/KeycloakVersionRange.ts +7 -0
  294. package/src/bin/{keycloakify/buildOptions → shared}/buildOptions.ts +114 -24
  295. package/src/bin/{constants.ts → shared/constants.ts} +4 -2
  296. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +87 -0
  297. package/src/bin/{downloadAndUnzip.ts → shared/downloadAndUnzip.ts} +6 -6
  298. package/src/bin/shared/downloadBuiltinKeycloakTheme.ts +264 -0
  299. package/src/bin/{keycloakify/generateTheme → shared}/downloadKeycloakStaticResources.ts +8 -8
  300. package/src/bin/shared/getJarFileBasename.ts +9 -0
  301. package/src/bin/{getThemeSrcDirPath.ts → shared/getThemeSrcDirPath.ts} +1 -1
  302. package/src/bin/shared/metaInfKeycloakThemes.ts +34 -0
  303. package/src/bin/{keycloakify/generateFtl/pageId.ts → shared/pageIds.ts} +9 -1
  304. package/src/bin/shared/promptKeycloakVersion.ts +69 -0
  305. package/src/bin/start-keycloak-container.ts +141 -0
  306. package/src/bin/tools/fs.rmSync.ts +4 -4
  307. package/src/bin/{keycloakify/buildOptions → tools}/getNpmWorkspaceRootDirPath.ts +1 -23
  308. package/src/login/index.ts +1 -1
  309. package/src/login/kcContext/KcContext.ts +2 -2
  310. package/src/login/kcContext/getKcContextFromWindow.ts +1 -1
  311. package/src/login/kcContext/kcContextMocks.ts +2 -2
  312. package/src/vite-plugin/vite-plugin.ts +30 -41
  313. package/tools/Array.prototype.every.js.map +1 -1
  314. package/tools/HTMLElement.prototype.prepend.js.map +1 -1
  315. package/tools/clsx.js.map +1 -1
  316. package/tools/deepAssign.js.map +1 -1
  317. package/tools/deepClone.js.map +1 -1
  318. package/tools/formatNumber.js.map +1 -1
  319. package/tools/memoize.js.map +1 -1
  320. package/tools/useInsertLinkTags.js.map +1 -1
  321. package/tools/useInsertScriptTags.js.map +1 -1
  322. package/tools/useSetClassName.js.map +1 -1
  323. package/vite-plugin/tsconfig.tsbuildinfo +1 -1
  324. package/vite-plugin/vite-plugin.d.ts +1 -2
  325. package/vite-plugin/vite-plugin.js +31 -51
  326. package/vite-plugin/vite-plugin.js.map +1 -1
  327. package/bin/constants.js +0 -13
  328. package/bin/constants.js.map +0 -1
  329. package/bin/downloadAndUnzip.js.map +0 -1
  330. package/bin/getThemeSrcDirPath.js.map +0 -1
  331. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.d.ts +0 -35
  332. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js +0 -14
  333. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js.map +0 -1
  334. package/bin/keycloakify/buildOptions/buildOptions.js.map +0 -1
  335. package/bin/keycloakify/buildOptions/getCacheDirPath.d.ts +0 -5
  336. package/bin/keycloakify/buildOptions/getCacheDirPath.js +0 -22
  337. package/bin/keycloakify/buildOptions/getCacheDirPath.js.map +0 -1
  338. package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js.map +0 -1
  339. package/bin/keycloakify/buildOptions/getReactAppRootDirPath.d.ts +0 -5
  340. package/bin/keycloakify/buildOptions/getReactAppRootDirPath.js +0 -26
  341. package/bin/keycloakify/buildOptions/getReactAppRootDirPath.js.map +0 -1
  342. package/bin/keycloakify/buildOptions/index.d.ts +0 -1
  343. package/bin/keycloakify/buildOptions/index.js.map +0 -1
  344. package/bin/keycloakify/buildOptions/parsedPackageJson.d.ts +0 -10
  345. package/bin/keycloakify/buildOptions/parsedPackageJson.js +0 -49
  346. package/bin/keycloakify/buildOptions/parsedPackageJson.js.map +0 -1
  347. package/bin/keycloakify/buildOptions/resolvedViteConfig.d.ts +0 -13
  348. package/bin/keycloakify/buildOptions/resolvedViteConfig.js +0 -77
  349. package/bin/keycloakify/buildOptions/resolvedViteConfig.js.map +0 -1
  350. package/bin/keycloakify/generateFtl/pageId.js.map +0 -1
  351. package/bin/keycloakify/generateTheme/bringInAccountV1.js.map +0 -1
  352. package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js.map +0 -1
  353. package/bin/keycloakify/generateTheme/generateMessageProperties.js.map +0 -1
  354. package/bin/keycloakify/generateTheme/generateSrcMainResources.js.map +0 -1
  355. package/bin/keycloakify/generateTheme/generateTheme.d.ts +0 -13
  356. package/bin/keycloakify/generateTheme/generateTheme.js.map +0 -1
  357. package/bin/keycloakify/generateTheme/generateThemeVariants.d.ts +0 -5
  358. package/bin/keycloakify/generateTheme/generateThemeVariants.js +0 -67
  359. package/bin/keycloakify/generateTheme/generateThemeVariants.js.map +0 -1
  360. package/bin/keycloakify/generateTheme/index.d.ts +0 -1
  361. package/bin/keycloakify/generateTheme/index.js +0 -18
  362. package/bin/keycloakify/generateTheme/index.js.map +0 -1
  363. package/bin/keycloakify/generateTheme/readExtraPageNames.js.map +0 -1
  364. package/bin/keycloakify/generateTheme/readFieldNameUsage.js.map +0 -1
  365. package/bin/promptKeycloakVersion.d.ts +0 -3
  366. package/bin/promptKeycloakVersion.js.map +0 -1
  367. package/src/bin/keycloakify/buildOptions/UserProvidedBuildOptions.ts +0 -21
  368. package/src/bin/keycloakify/buildOptions/getCacheDirPath.ts +0 -25
  369. package/src/bin/keycloakify/buildOptions/getReactAppRootDirPath.ts +0 -23
  370. package/src/bin/keycloakify/buildOptions/index.ts +0 -1
  371. package/src/bin/keycloakify/buildOptions/parsedPackageJson.ts +0 -32
  372. package/src/bin/keycloakify/buildOptions/resolvedViteConfig.ts +0 -74
  373. package/src/bin/keycloakify/generateTheme/generateTheme.ts +0 -44
  374. package/src/bin/keycloakify/generateTheme/index.ts +0 -1
  375. package/src/bin/promptKeycloakVersion.ts +0 -49
  376. /package/bin/keycloakify/{generateTheme → generateSrcMainResources}/generateMessageProperties.js +0 -0
  377. /package/bin/{downloadAndUnzip.d.ts → shared/downloadAndUnzip.d.ts} +0 -0
  378. /package/bin/{getThemeSrcDirPath.d.ts → shared/getThemeSrcDirPath.d.ts} +0 -0
  379. /package/bin/{keycloakify/buildOptions → tools}/getNpmWorkspaceRootDirPath.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import "minimal-polyfills/Object.fromEntries";
2
- import { resources_common, keycloak_resources } from "keycloakify/bin/constants";
2
+ import { resources_common, keycloak_resources } from "keycloakify/bin/shared/constants";
3
3
  import { id } from "tsafe/id";
4
4
  import type { KcContext } from "./KcContext";
5
5
  import { BASE_URL } from "keycloakify/lib/BASE_URL";
@@ -17,6 +17,7 @@ export const kcContextCommonMock: KcContext.Common = {
17
17
  "resourceUrl": "#",
18
18
  "accountUrl": "#",
19
19
  "applicationsUrl": "#",
20
+ "logoutUrl": "#",
20
21
  "getLogoutUrl": () => "#",
21
22
  "logUrl": "#",
22
23
  "passwordUrl": "#",
@@ -156,17 +157,6 @@ export const kcContextCommonMock: KcContext.Common = {
156
157
  "css/account.css img/icon-sidebar-active.png img/logo.png resources-common/node_modules/patternfly/dist/css/patternfly.min.css resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css",
157
158
  "kcButtonClass": "btn",
158
159
  "kcButtonDefaultClass": "btn-default"
159
- },
160
- "sessions": {
161
- "sessions": [
162
- {
163
- "ipAddress": "127.0.0.1",
164
- "started": new Date().toString(),
165
- "lastAccess": new Date().toString(),
166
- "expires": new Date().toString(),
167
- "clients": ["Chrome", "Firefox"]
168
- }
169
- ]
170
160
  }
171
161
  };
172
162
 
@@ -200,12 +190,12 @@ export const kcContextMocks: KcContext[] = [
200
190
  "sessions": {
201
191
  "sessions": [
202
192
  {
203
- ...kcContextCommonMock.sessions,
204
193
  "ipAddress": "127.0.0.1",
205
194
  "started": new Date().toString(),
206
195
  "lastAccess": new Date().toString(),
207
196
  "expires": new Date().toString(),
208
- "clients": ["Chrome", "Firefox"]
197
+ "clients": ["Chrome", "Firefox"],
198
+ "id": "f8951177-817d-4a70-9c02-86d3c170fe51"
209
199
  }
210
200
  ]
211
201
  },
@@ -246,9 +236,25 @@ export const kcContextMocks: KcContext[] = [
246
236
  "event": "login",
247
237
  "ipAddress": "172.17.0.1",
248
238
  "client": "security-admin-console",
249
- "details": ["auth_method = openid-connect, username = admin"]
239
+ "details": [{ key: "openid-connect", value: "admin" }]
250
240
  }
251
241
  ]
252
242
  }
243
+ }),
244
+ id<KcContext.FederatedIdentity>({
245
+ ...kcContextCommonMock,
246
+ "stateChecker": "",
247
+ "pageId": "federatedIdentity.ftl",
248
+ "federatedIdentity": {
249
+ "identities": [
250
+ {
251
+ "providerId": "keycloak-oidc",
252
+ "displayName": "keycloak-oidc",
253
+ "userName": "John",
254
+ "connected": true
255
+ }
256
+ ],
257
+ "removeLinkPossible": true
258
+ }
253
259
  })
254
260
  ];
@@ -61,10 +61,10 @@ export default function Applications(props: PageProps<Extract<KcContext, { pageI
61
61
 
62
62
  <td>
63
63
  {!isArrayWithEmptyObject(application.realmRolesAvailable) &&
64
- application.realmRolesAvailable.map(role => (
64
+ application.realmRolesAvailable.map((role, index) => (
65
65
  <span key={role.name}>
66
66
  {role.description ? advancedMsg(role.description) : advancedMsg(role.name)}
67
- {role !== application.realmRolesAvailable[application.realmRolesAvailable.length - 1] && ", "}
67
+ {index < application.realmRolesAvailable.length - 1 && ", "}
68
68
  </span>
69
69
  ))}
70
70
  {!isArrayWithEmptyObject(application.realmRolesAvailable) && application.resourceRolesAvailable && ", "}
@@ -0,0 +1,58 @@
1
+ import { PageProps } from "keycloakify/account";
2
+ import { I18n } from "keycloakify/account/i18n";
3
+ import { KcContext } from "keycloakify/account/kcContext";
4
+
5
+ export default function FederatedIdentity(props: PageProps<Extract<KcContext, { pageId: "federatedIdentity.ftl" }>, I18n>) {
6
+ const { kcContext, i18n, doUseDefaultCss, classes, Template } = props;
7
+
8
+ const { url, federatedIdentity, stateChecker } = kcContext;
9
+ const { msg } = i18n;
10
+ return (
11
+ <Template {...{ kcContext, i18n, doUseDefaultCss, classes }} active="federatedIdentity">
12
+ <div className="main-layout social">
13
+ <div className="row">
14
+ <div className="col-md-10">
15
+ <h2>{msg("federatedIdentitiesHtmlTitle")}</h2>
16
+ </div>
17
+ </div>
18
+ <div id="federated-identities">
19
+ {federatedIdentity.identities.map(identity => (
20
+ <div key={identity.providerId} className="row margin-bottom">
21
+ <div className="col-sm-2 col-md-2">
22
+ <label htmlFor={identity.providerId} className="control-label">
23
+ {identity.displayName}
24
+ </label>
25
+ </div>
26
+ <div className="col-sm-5 col-md-5">
27
+ <input disabled className="form-control" value={identity.userName} />
28
+ </div>
29
+ <div className="col-sm-5 col-md-5">
30
+ {identity.connected ? (
31
+ federatedIdentity.removeLinkPossible && (
32
+ <form action={url.socialUrl} method="post" className="form-inline">
33
+ <input type="hidden" name="stateChecker" value={stateChecker} />
34
+ <input type="hidden" name="action" value="remove" />
35
+ <input type="hidden" name="providerId" value={identity.providerId} />
36
+ <button id={`remove-link-${identity.providerId}`} className="btn btn-default">
37
+ {msg("doRemove")}
38
+ </button>
39
+ </form>
40
+ )
41
+ ) : (
42
+ <form action={url.socialUrl} method="post" className="form-inline">
43
+ <input type="hidden" name="stateChecker" value={stateChecker} />
44
+ <input type="hidden" name="action" value="add" />
45
+ <input type="hidden" name="providerId" value={identity.providerId} />
46
+ <button id={`add-link-${identity.providerId}`} className="btn btn-default">
47
+ {msg("doAdd")}
48
+ </button>
49
+ </form>
50
+ )}
51
+ </div>
52
+ </div>
53
+ ))}
54
+ </div>
55
+ </div>
56
+ </Template>
57
+ );
58
+ }
@@ -2,7 +2,7 @@ import type { PageProps } from "keycloakify/account/pages/PageProps";
2
2
  import type { KcContext } from "../kcContext";
3
3
  import type { I18n } from "../i18n";
4
4
  import { Key } from "react";
5
- import { useGetClassName } from "../lib/useGetClassName";
5
+ import { useGetClassName } from "keycloakify/account/lib/useGetClassName";
6
6
 
7
7
  export default function Log(props: PageProps<Extract<KcContext, { pageId: "log.ftl" }>, I18n>) {
8
8
  const { kcContext, i18n, doUseDefaultCss, classes, Template } = props;
@@ -12,12 +12,9 @@ export default function Sessions(props: PageProps<Extract<KcContext, { pageId: "
12
12
  classes
13
13
  });
14
14
 
15
- console.log({ kcContext });
16
15
  const { url, stateChecker, sessions } = kcContext;
17
16
 
18
17
  const { msg } = i18n;
19
- console.log({ sdf: kcContext.locale?.supported });
20
- console.log({ asdf: "asdf" });
21
18
  return (
22
19
  <Template {...{ kcContext, i18n, doUseDefaultCss, classes }} active="sessions">
23
20
  <div className={getClassName("kcContentWrapperClass")}>
@@ -7,6 +7,7 @@ import { MessageKey } from "keycloakify/account/i18n/i18n";
7
7
 
8
8
  export default function Totp(props: PageProps<Extract<KcContext, { pageId: "totp.ftl" }>, I18n>) {
9
9
  const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
10
+
10
11
  const { getClassName } = useGetClassName({
11
12
  doUseDefaultCss,
12
13
  classes
@@ -78,7 +79,7 @@ export default function Totp(props: PageProps<Extract<KcContext, { pageId: "totp
78
79
  <p>{msg("totpStep1")}</p>
79
80
 
80
81
  <ul id="kc-totp-supported-apps">
81
- {totp.supportedApplications.map(app => (
82
+ {totp.supportedApplications?.map(app => (
82
83
  <li key={app}>{msg(app as MessageKey)}</li>
83
84
  ))}
84
85
  </ul>
@@ -99,28 +100,26 @@ export default function Totp(props: PageProps<Extract<KcContext, { pageId: "totp
99
100
  </li>
100
101
  <li>
101
102
  <p>{msg("totpManualStep3")}</p>
102
- <p>
103
- <ul>
104
- <li id="kc-totp-type">
105
- {msg("totpType")}: {msg(`totp.${totp.policy.type}`)}
103
+ <ul>
104
+ <li id="kc-totp-type">
105
+ {msg("totpType")}: {msg(`totp.${totp.policy.type}`)}
106
+ </li>
107
+ <li id="kc-totp-algorithm">
108
+ {msg("totpAlgorithm")}: {algToKeyUriAlg?.[totp.policy.algorithm] ?? totp.policy.algorithm}
109
+ </li>
110
+ <li id="kc-totp-digits">
111
+ {msg("totpDigits")}: {totp.policy.digits}
112
+ </li>
113
+ {totp.policy.type === "totp" ? (
114
+ <li id="kc-totp-period">
115
+ {msg("totpInterval")}: {totp.policy.period}
106
116
  </li>
107
- <li id="kc-totp-algorithm">
108
- {msg("totpAlgorithm")}: {algToKeyUriAlg?.[totp.policy.algorithm] ?? totp.policy.algorithm}
117
+ ) : (
118
+ <li id="kc-totp-counter">
119
+ {msg("totpCounter")}: {totp.policy.initialCounter}
109
120
  </li>
110
- <li id="kc-totp-digits">
111
- {msg("totpDigits")}: {totp.policy.digits}
112
- </li>
113
- {totp.policy.type === "totp" ? (
114
- <li id="kc-totp-period">
115
- {msg("totpInterval")}: {totp.policy.period}
116
- </li>
117
- ) : (
118
- <li id="kc-totp-counter">
119
- {msg("totpCounter")}: {totp.policy.initialCounter}
120
- </li>
121
- )}
122
- </ul>
123
- </p>
121
+ )}
122
+ </ul>
124
123
  </li>
125
124
  </>
126
125
  ) : (
@@ -1,112 +1,16 @@
1
- #!/usr/bin/env node
1
+ import { copyKeycloakResourcesToPublic } from "./shared/copyKeycloakResourcesToPublic";
2
+ import { readBuildOptions } from "./shared/buildOptions";
3
+ import type { CliCommandOptions } from "./main";
2
4
 
3
- import { downloadKeycloakStaticResources, type BuildOptionsLike } from "./keycloakify/generateTheme/downloadKeycloakStaticResources";
4
- import { join as pathJoin, relative as pathRelative } from "path";
5
- import { readBuildOptions } from "./keycloakify/buildOptions";
6
- import { themeTypes, keycloak_resources, lastKeycloakVersionWithAccountV1 } from "./constants";
7
- import { readThisNpmProjectVersion } from "./tools/readThisNpmProjectVersion";
8
- import { assert, type Equals } from "tsafe/assert";
9
- import * as fs from "fs";
10
- import { rmSync } from "./tools/fs.rmSync";
5
+ export async function command(params: { cliCommandOptions: CliCommandOptions }) {
6
+ const { cliCommandOptions } = params;
11
7
 
12
- export async function copyKeycloakResourcesToPublic(params: { processArgv: string[] }) {
13
- const { processArgv } = params;
8
+ const buildOptions = readBuildOptions({ cliCommandOptions });
14
9
 
15
- const buildOptions = readBuildOptions({ processArgv });
16
-
17
- const destDirPath = pathJoin(buildOptions.publicDirPath, keycloak_resources);
18
-
19
- const keycloakifyBuildinfoFilePath = pathJoin(destDirPath, "keycloakify.buildinfo");
20
-
21
- const { keycloakifyBuildinfoRaw } = generateKeycloakifyBuildinfoRaw({
22
- destDirPath,
23
- "keycloakifyVersion": readThisNpmProjectVersion(),
24
- buildOptions
25
- });
26
-
27
- skip_if_already_done: {
28
- if (!fs.existsSync(keycloakifyBuildinfoFilePath)) {
29
- break skip_if_already_done;
30
- }
31
-
32
- const keycloakifyBuildinfoRaw_previousRun = fs.readFileSync(keycloakifyBuildinfoFilePath).toString("utf8");
33
-
34
- if (keycloakifyBuildinfoRaw_previousRun !== keycloakifyBuildinfoRaw) {
35
- break skip_if_already_done;
36
- }
37
-
38
- return;
39
- }
40
-
41
- rmSync(destDirPath, { "force": true, "recursive": true });
42
-
43
- for (const themeType of themeTypes) {
44
- await downloadKeycloakStaticResources({
45
- "keycloakVersion": (() => {
46
- switch (themeType) {
47
- case "login":
48
- return buildOptions.loginThemeResourcesFromKeycloakVersion;
49
- case "account":
50
- return lastKeycloakVersionWithAccountV1;
51
- }
52
- })(),
53
- themeType,
54
- "themeDirPath": destDirPath,
55
- buildOptions
56
- });
57
- }
58
-
59
- fs.writeFileSync(
60
- pathJoin(destDirPath, "README.txt"),
61
- Buffer.from(
62
- // prettier-ignore
63
- [
64
- "This is just a test folder that helps develop",
65
- "the login and register page without having to run a Keycloak container"
66
- ].join(" ")
67
- )
68
- );
69
-
70
- fs.writeFileSync(pathJoin(buildOptions.publicDirPath, keycloak_resources, ".gitignore"), Buffer.from("*", "utf8"));
71
-
72
- fs.writeFileSync(keycloakifyBuildinfoFilePath, Buffer.from(keycloakifyBuildinfoRaw, "utf8"));
73
- }
74
-
75
- export function generateKeycloakifyBuildinfoRaw(params: {
76
- destDirPath: string;
77
- keycloakifyVersion: string;
78
- buildOptions: BuildOptionsLike & {
79
- loginThemeResourcesFromKeycloakVersion: string;
80
- };
81
- }) {
82
- const { destDirPath, keycloakifyVersion, buildOptions } = params;
83
-
84
- const { cacheDirPath, npmWorkspaceRootDirPath, loginThemeResourcesFromKeycloakVersion, ...rest } = buildOptions;
85
-
86
- assert<Equals<typeof rest, {}>>(true);
87
-
88
- const keycloakifyBuildinfoRaw = JSON.stringify(
89
- {
90
- keycloakifyVersion,
91
- "buildOptions": {
92
- loginThemeResourcesFromKeycloakVersion,
93
- "cacheDirPath": pathRelative(destDirPath, cacheDirPath),
94
- "npmWorkspaceRootDirPath": pathRelative(destDirPath, npmWorkspaceRootDirPath)
95
- }
96
- },
97
- null,
98
- 2
99
- );
100
-
101
- return { keycloakifyBuildinfoRaw };
102
- }
103
-
104
- async function main() {
105
10
  await copyKeycloakResourcesToPublic({
106
- "processArgv": process.argv.slice(2)
11
+ "buildOptions": {
12
+ ...buildOptions,
13
+ "publicDirPath": buildOptions.reactAppRootDirPath
14
+ }
107
15
  });
108
16
  }
109
-
110
- if (require.main === module) {
111
- main();
112
- }
@@ -1,282 +1,26 @@
1
- #!/usr/bin/env node
2
1
  import { join as pathJoin } from "path";
3
- import { downloadAndUnzip } from "./downloadAndUnzip";
4
- import { promptKeycloakVersion } from "./promptKeycloakVersion";
2
+ import { promptKeycloakVersion } from "./shared/promptKeycloakVersion";
3
+ import { readBuildOptions } from "./shared/buildOptions";
4
+ import { downloadBuiltinKeycloakTheme } from "./shared/downloadBuiltinKeycloakTheme";
5
+ import type { CliCommandOptions } from "./main";
5
6
  import { getLogger } from "./tools/logger";
6
- import { readBuildOptions, type BuildOptions } from "./keycloakify/buildOptions";
7
- import { assert } from "tsafe/assert";
8
- import * as child_process from "child_process";
9
- import * as fs from "fs";
10
- import { rmSync } from "./tools/fs.rmSync";
11
- import { lastKeycloakVersionWithAccountV1 } from "./constants";
12
- import { transformCodebase } from "./tools/transformCodebase";
13
7
 
14
- export type BuildOptionsLike = {
15
- cacheDirPath: string;
16
- npmWorkspaceRootDirPath: string;
17
- };
8
+ export async function command(params: { cliCommandOptions: CliCommandOptions }) {
9
+ const { cliCommandOptions } = params;
18
10
 
19
- assert<BuildOptions extends BuildOptionsLike ? true : false>();
20
-
21
- export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: string; destDirPath: string; buildOptions: BuildOptionsLike }) {
22
- const { keycloakVersion, destDirPath, buildOptions } = params;
23
-
24
- await downloadAndUnzip({
25
- destDirPath,
26
- "url": `https://github.com/keycloak/keycloak/archive/refs/tags/${keycloakVersion}.zip`,
27
- "specificDirsToExtract": ["", "-community"].map(ext => `keycloak-${keycloakVersion}/themes/src/main/resources${ext}/theme`),
28
- buildOptions,
29
- "preCacheTransform": {
30
- "actionCacheId": "npm install and build",
31
- "action": async ({ destDirPath }) => {
32
- install_common_node_modules: {
33
- const commonResourcesDirPath = pathJoin(destDirPath, "keycloak", "common", "resources");
34
-
35
- if (!fs.existsSync(commonResourcesDirPath)) {
36
- break install_common_node_modules;
37
- }
38
-
39
- if (!fs.existsSync(pathJoin(commonResourcesDirPath, "package.json"))) {
40
- break install_common_node_modules;
41
- }
42
-
43
- if (fs.existsSync(pathJoin(commonResourcesDirPath, "node_modules"))) {
44
- break install_common_node_modules;
45
- }
46
-
47
- child_process.execSync("npm install --omit=dev", {
48
- "cwd": commonResourcesDirPath,
49
- "stdio": "ignore"
50
- });
51
- }
52
-
53
- repatriate_common_resources_from_base_login_theme: {
54
- const baseLoginThemeResourceDir = pathJoin(destDirPath, "base", "login", "resources");
55
-
56
- if (!fs.existsSync(baseLoginThemeResourceDir)) {
57
- break repatriate_common_resources_from_base_login_theme;
58
- }
59
-
60
- transformCodebase({
61
- "srcDirPath": baseLoginThemeResourceDir,
62
- "destDirPath": pathJoin(destDirPath, "keycloak", "login", "resources")
63
- });
64
- }
65
-
66
- install_and_move_to_common_resources_generated_in_keycloak_v2: {
67
- if (!fs.readFileSync(pathJoin(destDirPath, "keycloak", "login", "theme.properties")).toString("utf8").includes("web_modules")) {
68
- break install_and_move_to_common_resources_generated_in_keycloak_v2;
69
- }
70
-
71
- const accountV2DirSrcDirPath = pathJoin(destDirPath, "keycloak.v2", "account", "src");
72
-
73
- if (!fs.existsSync(accountV2DirSrcDirPath)) {
74
- break install_and_move_to_common_resources_generated_in_keycloak_v2;
75
- }
76
-
77
- const packageManager = fs.existsSync(pathJoin(accountV2DirSrcDirPath, "pnpm-lock.yaml")) ? "pnpm" : "npm";
78
-
79
- if (packageManager === "pnpm") {
80
- try {
81
- child_process.execSync(`which pnpm`);
82
- } catch {
83
- console.log(`Installing pnpm globally`);
84
- child_process.execSync(`npm install -g pnpm`);
85
- }
86
- }
87
-
88
- child_process.execSync(`${packageManager} install`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
89
-
90
- const packageJsonFilePath = pathJoin(accountV2DirSrcDirPath, "package.json");
91
-
92
- const packageJsonRaw = fs.readFileSync(packageJsonFilePath);
93
-
94
- const parsedPackageJson = JSON.parse(packageJsonRaw.toString("utf8"));
95
-
96
- parsedPackageJson.scripts.build = parsedPackageJson.scripts.build
97
- .replace(`${packageManager} run check-types`, "true")
98
- .replace(`${packageManager} run babel`, "true");
99
-
100
- fs.writeFileSync(packageJsonFilePath, Buffer.from(JSON.stringify(parsedPackageJson, null, 2), "utf8"));
101
-
102
- child_process.execSync(`${packageManager} run build`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
103
-
104
- fs.writeFileSync(packageJsonFilePath, packageJsonRaw);
105
-
106
- fs.rmSync(pathJoin(accountV2DirSrcDirPath, "node_modules"), { "recursive": true });
107
- }
108
-
109
- remove_keycloak_v2: {
110
- const keycloakV2DirPath = pathJoin(destDirPath, "keycloak.v2");
111
-
112
- if (!fs.existsSync(keycloakV2DirPath)) {
113
- break remove_keycloak_v2;
114
- }
115
-
116
- rmSync(keycloakV2DirPath, { "recursive": true });
117
- }
118
-
119
- // Note, this is an optimization for reducing the size of the jar
120
- remove_unused_node_modules: {
121
- const nodeModuleDirPath = pathJoin(destDirPath, "keycloak", "common", "resources", "node_modules");
122
-
123
- if (!fs.existsSync(nodeModuleDirPath)) {
124
- break remove_unused_node_modules;
125
- }
126
-
127
- const toDeletePerfixes = [
128
- "angular",
129
- "bootstrap",
130
- "rcue",
131
- "font-awesome",
132
- "ng-file-upload",
133
- pathJoin("patternfly", "dist", "sass"),
134
- pathJoin("patternfly", "dist", "less"),
135
- pathJoin("patternfly", "dist", "js"),
136
- "d3",
137
- pathJoin("jquery", "src"),
138
- "c3",
139
- "core-js",
140
- "eonasdan-bootstrap-datetimepicker",
141
- "moment",
142
- "react",
143
- "patternfly-bootstrap-treeview",
144
- "popper.js",
145
- "tippy.js",
146
- "jquery-match-height",
147
- "google-code-prettify",
148
- "patternfly-bootstrap-combobox",
149
- "focus-trap",
150
- "tabbable",
151
- "scheduler",
152
- "@types",
153
- "datatables.net",
154
- "datatables.net-colreorder",
155
- "tslib",
156
- "prop-types",
157
- "file-selector",
158
- "datatables.net-colreorder-bs",
159
- "object-assign",
160
- "warning",
161
- "js-tokens",
162
- "loose-envify",
163
- "prop-types-extra",
164
- "attr-accept",
165
- "datatables.net-select",
166
- "drmonty-datatables-colvis",
167
- "datatables.net-bs",
168
- pathJoin("@patternfly", "react"),
169
- pathJoin("@patternfly", "patternfly", "docs")
170
- ];
171
-
172
- transformCodebase({
173
- "srcDirPath": nodeModuleDirPath,
174
- "destDirPath": nodeModuleDirPath,
175
- "transformSourceCode": ({ sourceCode, fileRelativePath }) => {
176
- if (fileRelativePath.endsWith(".map")) {
177
- return undefined;
178
- }
179
-
180
- if (toDeletePerfixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
181
- return undefined;
182
- }
183
-
184
- if (fileRelativePath.startsWith(pathJoin("patternfly", "dist", "fonts"))) {
185
- if (
186
- !fileRelativePath.endsWith(".woff2") &&
187
- !fileRelativePath.endsWith(".woff") &&
188
- !fileRelativePath.endsWith(".ttf")
189
- ) {
190
- return undefined;
191
- }
192
- }
193
-
194
- return { "modifiedSourceCode": sourceCode };
195
- }
196
- });
197
- }
198
-
199
- // Just like node_modules
200
- remove_unused_lib: {
201
- const libDirPath = pathJoin(destDirPath, "keycloak", "common", "resources", "lib");
202
-
203
- if (!fs.existsSync(libDirPath)) {
204
- break remove_unused_lib;
205
- }
206
-
207
- const toDeletePerfixes = ["ui-ace", "filesaver", "fileupload", "angular", "ui-ace"];
208
-
209
- transformCodebase({
210
- "srcDirPath": libDirPath,
211
- "destDirPath": libDirPath,
212
- "transformSourceCode": ({ sourceCode, fileRelativePath }) => {
213
- if (fileRelativePath.endsWith(".map")) {
214
- return undefined;
215
- }
216
-
217
- if (toDeletePerfixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
218
- return undefined;
219
- }
220
-
221
- return { "modifiedSourceCode": sourceCode };
222
- }
223
- });
224
- }
225
-
226
- last_account_v1_transformations: {
227
- if (lastKeycloakVersionWithAccountV1 !== keycloakVersion) {
228
- break last_account_v1_transformations;
229
- }
230
-
231
- {
232
- const accountCssFilePath = pathJoin(destDirPath, "keycloak", "account", "resources", "css", "account.css");
233
-
234
- fs.writeFileSync(
235
- accountCssFilePath,
236
- Buffer.from(fs.readFileSync(accountCssFilePath).toString("utf8").replace("top: -34px;", "top: -34px !important;"), "utf8")
237
- );
238
- }
239
-
240
- // Note, this is an optimization for reducing the size of the jar,
241
- // For this version we know exactly which resources are used.
242
- {
243
- const nodeModulesDirPath = pathJoin(destDirPath, "keycloak", "common", "resources", "node_modules");
244
-
245
- const toKeepPrefixes = [
246
- ...["patternfly.min.css", "patternfly-additions.min.css", "patternfly-additions.min.css"].map(fileBasename =>
247
- pathJoin("patternfly", "dist", "css", fileBasename)
248
- ),
249
- pathJoin("patternfly", "dist", "fonts")
250
- ];
251
-
252
- transformCodebase({
253
- "srcDirPath": nodeModulesDirPath,
254
- "destDirPath": nodeModulesDirPath,
255
- "transformSourceCode": ({ sourceCode, fileRelativePath }) => {
256
- if (toKeepPrefixes.find(prefix => fileRelativePath.startsWith(prefix)) === undefined) {
257
- return undefined;
258
- }
259
- return { "modifiedSourceCode": sourceCode };
260
- }
261
- });
262
- }
263
- }
264
- }
265
- }
266
- });
267
- }
268
-
269
- async function main() {
270
11
  const buildOptions = readBuildOptions({
271
- "processArgv": process.argv.slice(2)
12
+ cliCommandOptions
272
13
  });
273
14
 
274
- const logger = getLogger({ "isSilent": buildOptions.isSilent });
275
- const { keycloakVersion } = await promptKeycloakVersion();
15
+ const { log } = getLogger({ "isSilent": buildOptions.isSilent });
16
+
17
+ const { keycloakVersion } = await promptKeycloakVersion({
18
+ "startingFromMajor": undefined
19
+ });
276
20
 
277
21
  const destDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme");
278
22
 
279
- logger.log(`Downloading builtins theme of Keycloak ${keycloakVersion} here ${destDirPath}`);
23
+ log(`Downloading builtins theme of Keycloak ${keycloakVersion} here ${destDirPath}`);
280
24
 
281
25
  await downloadBuiltinKeycloakTheme({
282
26
  keycloakVersion,
@@ -284,7 +28,3 @@ async function main() {
284
28
  buildOptions
285
29
  });
286
30
  }
287
-
288
- if (require.main === module) {
289
- main();
290
- }