keycloakify 10.0.0-rc.37 → 10.0.0-rc.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/account/Fallback.d.ts +1 -2
  2. package/account/Fallback.js.map +1 -1
  3. package/account/KcContext/KcContext.d.ts +6 -6
  4. package/account/KcContext/getKcContextMock.d.ts +9 -9
  5. package/account/KcContext/getKcContextMock.js +3 -3
  6. package/account/KcContext/getKcContextMock.js.map +1 -1
  7. package/account/Template.d.ts +1 -2
  8. package/account/Template.js +7 -6
  9. package/account/Template.js.map +1 -1
  10. package/account/TemplateProps.d.ts +1 -3
  11. package/account/i18n/i18n.d.ts +9 -4
  12. package/account/i18n/i18n.js +132 -87
  13. package/account/i18n/i18n.js.map +1 -1
  14. package/account/i18n/index.d.ts +9 -2
  15. package/account/i18n/index.js +5 -1
  16. package/account/i18n/index.js.map +1 -1
  17. package/account/lib/kcClsx.d.ts +9 -0
  18. package/account/lib/{useGetClassName.js → kcClsx.js} +3 -3
  19. package/account/lib/kcClsx.js.map +1 -0
  20. package/account/pages/Account.d.ts +1 -2
  21. package/account/pages/Account.js +9 -7
  22. package/account/pages/Account.js.map +1 -1
  23. package/account/pages/Applications.d.ts +1 -2
  24. package/account/pages/Applications.js +7 -7
  25. package/account/pages/Applications.js.map +1 -1
  26. package/account/pages/FederatedIdentity.d.ts +1 -2
  27. package/account/pages/FederatedIdentity.js +4 -3
  28. package/account/pages/FederatedIdentity.js.map +1 -1
  29. package/account/pages/Log.d.ts +1 -2
  30. package/account/pages/Log.js +6 -5
  31. package/account/pages/Log.js.map +1 -1
  32. package/account/pages/PageProps.d.ts +2 -4
  33. package/account/pages/Password.d.ts +1 -2
  34. package/account/pages/Password.js +10 -9
  35. package/account/pages/Password.js.map +1 -1
  36. package/account/pages/Sessions.d.ts +1 -2
  37. package/account/pages/Sessions.js +6 -6
  38. package/account/pages/Sessions.js.map +1 -1
  39. package/account/pages/Totp.d.ts +1 -2
  40. package/account/pages/Totp.js +6 -5
  41. package/account/pages/Totp.js.map +1 -1
  42. package/bin/193.index.js +13 -13
  43. package/bin/{430.index.js → 214.index.js} +161 -2
  44. package/bin/3.index.js +165 -149
  45. package/bin/322.index.js +595 -0
  46. package/bin/453.index.js +3 -3
  47. package/bin/526.index.js +42 -632
  48. package/bin/538.index.js +563 -0
  49. package/bin/932.index.js +7 -7
  50. package/bin/{890.index.js → 941.index.js} +2 -159
  51. package/bin/944.index.js +621 -0
  52. package/bin/961.index.js +5 -5
  53. package/bin/97.index.js +3 -3
  54. package/bin/{314.index.js → 98.index.js} +217 -48
  55. package/bin/main.js +20 -8
  56. package/lib/getKcClsx.d.ts +11 -0
  57. package/lib/getKcClsx.js +55 -0
  58. package/lib/getKcClsx.js.map +1 -0
  59. package/login/Fallback.d.ts +2 -2
  60. package/login/Fallback.js.map +1 -1
  61. package/login/KcContext/KcContext.d.ts +6 -6
  62. package/login/KcContext/getKcContextMock.d.ts +9 -9
  63. package/login/KcContext/getKcContextMock.js +3 -3
  64. package/login/KcContext/getKcContextMock.js.map +1 -1
  65. package/login/Template.d.ts +1 -2
  66. package/login/Template.js +10 -9
  67. package/login/Template.js.map +1 -1
  68. package/login/TemplateProps.d.ts +1 -3
  69. package/login/UserProfileFormFields.d.ts +6 -5
  70. package/login/UserProfileFormFields.js +35 -36
  71. package/login/UserProfileFormFields.js.map +1 -1
  72. package/login/i18n/i18n.d.ts +9 -4
  73. package/login/i18n/i18n.js +136 -91
  74. package/login/i18n/i18n.js.map +1 -1
  75. package/login/i18n/index.d.ts +9 -2
  76. package/login/i18n/index.js +5 -1
  77. package/login/i18n/index.js.map +1 -1
  78. package/login/lib/kcClsx.d.ts +9 -0
  79. package/login/lib/{useGetClassName.js → kcClsx.js} +3 -3
  80. package/login/lib/kcClsx.js.map +1 -0
  81. package/login/lib/useUserProfileForm.d.ts +9 -6
  82. package/login/lib/useUserProfileForm.js +7 -5
  83. package/login/lib/useUserProfileForm.js.map +1 -1
  84. package/login/pages/Code.d.ts +1 -2
  85. package/login/pages/Code.js +6 -5
  86. package/login/pages/Code.js.map +1 -1
  87. package/login/pages/DeleteAccountConfirm.d.ts +1 -2
  88. package/login/pages/DeleteAccountConfirm.js +7 -7
  89. package/login/pages/DeleteAccountConfirm.js.map +1 -1
  90. package/login/pages/DeleteCredential.d.ts +1 -2
  91. package/login/pages/DeleteCredential.js +6 -6
  92. package/login/pages/DeleteCredential.js.map +1 -1
  93. package/login/pages/Error.d.ts +1 -2
  94. package/login/pages/Error.js +4 -3
  95. package/login/pages/Error.js.map +1 -1
  96. package/login/pages/FrontchannelLogout.d.ts +1 -2
  97. package/login/pages/FrontchannelLogout.js +4 -3
  98. package/login/pages/FrontchannelLogout.js.map +1 -1
  99. package/login/pages/IdpReviewUserProfile.d.ts +2 -2
  100. package/login/pages/IdpReviewUserProfile.js +6 -6
  101. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  102. package/login/pages/Info.d.ts +1 -2
  103. package/login/pages/Info.js +4 -3
  104. package/login/pages/Info.js.map +1 -1
  105. package/login/pages/Login.d.ts +1 -2
  106. package/login/pages/Login.js +10 -8
  107. package/login/pages/Login.js.map +1 -1
  108. package/login/pages/LoginConfigTotp.d.ts +1 -2
  109. package/login/pages/LoginConfigTotp.js +8 -7
  110. package/login/pages/LoginConfigTotp.js.map +1 -1
  111. package/login/pages/LoginIdpLinkConfirm.d.ts +1 -2
  112. package/login/pages/LoginIdpLinkConfirm.js +6 -6
  113. package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
  114. package/login/pages/LoginIdpLinkEmail.d.ts +1 -2
  115. package/login/pages/LoginIdpLinkEmail.js +4 -3
  116. package/login/pages/LoginIdpLinkEmail.js.map +1 -1
  117. package/login/pages/LoginOauth2DeviceVerifyUserCode.d.ts +1 -2
  118. package/login/pages/LoginOauth2DeviceVerifyUserCode.js +6 -6
  119. package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
  120. package/login/pages/LoginOauthGrant.d.ts +1 -2
  121. package/login/pages/LoginOauthGrant.js +7 -7
  122. package/login/pages/LoginOauthGrant.js.map +1 -1
  123. package/login/pages/LoginOtp.d.ts +1 -2
  124. package/login/pages/LoginOtp.js +6 -6
  125. package/login/pages/LoginOtp.js.map +1 -1
  126. package/login/pages/LoginPageExpired.d.ts +1 -2
  127. package/login/pages/LoginPageExpired.js +4 -3
  128. package/login/pages/LoginPageExpired.js.map +1 -1
  129. package/login/pages/LoginPassword.d.ts +1 -2
  130. package/login/pages/LoginPassword.js +9 -7
  131. package/login/pages/LoginPassword.js.map +1 -1
  132. package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +1 -2
  133. package/login/pages/LoginRecoveryAuthnCodeConfig.js +9 -7
  134. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  135. package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +1 -2
  136. package/login/pages/LoginRecoveryAuthnCodeInput.js +6 -6
  137. package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
  138. package/login/pages/LoginResetOtp.d.ts +1 -2
  139. package/login/pages/LoginResetOtp.js +6 -6
  140. package/login/pages/LoginResetOtp.js.map +1 -1
  141. package/login/pages/LoginResetPassword.d.ts +1 -2
  142. package/login/pages/LoginResetPassword.js +7 -7
  143. package/login/pages/LoginResetPassword.js.map +1 -1
  144. package/login/pages/LoginUpdatePassword.d.ts +1 -2
  145. package/login/pages/LoginUpdatePassword.js +10 -9
  146. package/login/pages/LoginUpdatePassword.js.map +1 -1
  147. package/login/pages/LoginUpdateProfile.d.ts +2 -2
  148. package/login/pages/LoginUpdateProfile.js +7 -12
  149. package/login/pages/LoginUpdateProfile.js.map +1 -1
  150. package/login/pages/LoginUsername.d.ts +1 -2
  151. package/login/pages/LoginUsername.js +8 -7
  152. package/login/pages/LoginUsername.js.map +1 -1
  153. package/login/pages/LoginVerifyEmail.d.ts +1 -2
  154. package/login/pages/LoginVerifyEmail.js +4 -3
  155. package/login/pages/LoginVerifyEmail.js.map +1 -1
  156. package/login/pages/LoginX509Info.d.ts +1 -2
  157. package/login/pages/LoginX509Info.js +6 -6
  158. package/login/pages/LoginX509Info.js.map +1 -1
  159. package/login/pages/LogoutConfirm.d.ts +1 -2
  160. package/login/pages/LogoutConfirm.js +6 -6
  161. package/login/pages/LogoutConfirm.js.map +1 -1
  162. package/login/pages/PageProps.d.ts +2 -4
  163. package/login/pages/Register.d.ts +2 -2
  164. package/login/pages/Register.js +8 -16
  165. package/login/pages/Register.js.map +1 -1
  166. package/login/pages/SamlPostForm.d.ts +1 -2
  167. package/login/pages/SamlPostForm.js +4 -3
  168. package/login/pages/SamlPostForm.js.map +1 -1
  169. package/login/pages/SelectAuthenticator.d.ts +1 -2
  170. package/login/pages/SelectAuthenticator.js +6 -9
  171. package/login/pages/SelectAuthenticator.js.map +1 -1
  172. package/login/pages/Terms.d.ts +1 -2
  173. package/login/pages/Terms.js +6 -6
  174. package/login/pages/Terms.js.map +1 -1
  175. package/login/pages/UpdateEmail.d.ts +2 -2
  176. package/login/pages/UpdateEmail.js +8 -12
  177. package/login/pages/UpdateEmail.js.map +1 -1
  178. package/login/pages/WebauthnAuthenticate.d.ts +1 -2
  179. package/login/pages/WebauthnAuthenticate.js +13 -12
  180. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  181. package/login/pages/WebauthnError.d.ts +1 -2
  182. package/login/pages/WebauthnError.js +7 -7
  183. package/login/pages/WebauthnError.js.map +1 -1
  184. package/login/pages/WebauthnRegister.d.ts +1 -2
  185. package/login/pages/WebauthnRegister.js +9 -8
  186. package/login/pages/WebauthnRegister.js.map +1 -1
  187. package/package.json +27 -22
  188. package/src/account/Fallback.tsx +1 -2
  189. package/src/account/KcContext/KcContext.ts +7 -7
  190. package/src/account/KcContext/getKcContextMock.ts +13 -24
  191. package/src/account/Template.tsx +8 -8
  192. package/src/account/TemplateProps.ts +1 -6
  193. package/src/account/i18n/i18n.tsx +204 -125
  194. package/src/account/i18n/index.ts +10 -2
  195. package/src/account/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
  196. package/src/account/pages/Account.tsx +15 -21
  197. package/src/account/pages/Applications.tsx +8 -9
  198. package/src/account/pages/FederatedIdentity.tsx +5 -5
  199. package/src/account/pages/Log.tsx +8 -8
  200. package/src/account/pages/PageProps.ts +2 -4
  201. package/src/account/pages/Password.tsx +13 -16
  202. package/src/account/pages/Sessions.tsx +9 -10
  203. package/src/account/pages/Totp.tsx +19 -28
  204. package/src/bin/add-story.ts +3 -3
  205. package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
  206. package/src/bin/download-keycloak-default-theme.ts +5 -5
  207. package/src/bin/eject-page.ts +3 -3
  208. package/src/bin/initialize-email-theme.ts +5 -5
  209. package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
  210. package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
  211. package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
  212. package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
  213. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
  214. package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +2 -66
  215. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
  216. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +30 -24
  217. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
  218. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
  219. package/src/bin/keycloakify/keycloakify.ts +11 -11
  220. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
  221. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
  222. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
  223. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
  224. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
  225. package/src/bin/main.ts +17 -2
  226. package/src/bin/shared/{buildOptions.ts → buildContext.ts} +65 -51
  227. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
  228. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
  229. package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
  230. package/src/bin/shared/generateKcGenTs.ts +61 -0
  231. package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
  232. package/src/bin/start-keycloak/appBuild.ts +11 -11
  233. package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
  234. package/src/bin/start-keycloak/start-keycloak.ts +34 -22
  235. package/src/bin/tools/escapeStringForPropertiesFile.ts +64 -0
  236. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
  237. package/src/bin/update-kc-gen.ts +13 -0
  238. package/src/lib/getKcClsx.ts +89 -0
  239. package/src/login/Fallback.tsx +2 -2
  240. package/src/login/KcContext/KcContext.ts +7 -7
  241. package/src/login/KcContext/getKcContextMock.ts +13 -24
  242. package/src/login/Template.tsx +36 -37
  243. package/src/login/TemplateProps.ts +1 -6
  244. package/src/login/UserProfileFormFields.tsx +67 -84
  245. package/src/login/i18n/i18n.tsx +208 -129
  246. package/src/login/i18n/index.ts +10 -2
  247. package/src/login/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
  248. package/src/login/lib/useUserProfileForm.tsx +29 -21
  249. package/src/login/pages/Code.tsx +10 -8
  250. package/src/login/pages/DeleteAccountConfirm.tsx +9 -10
  251. package/src/login/pages/DeleteCredential.tsx +11 -10
  252. package/src/login/pages/Error.tsx +5 -5
  253. package/src/login/pages/FrontchannelLogout.tsx +7 -5
  254. package/src/login/pages/IdpReviewUserProfile.tsx +18 -21
  255. package/src/login/pages/Info.tsx +7 -5
  256. package/src/login/pages/Login.tsx +34 -53
  257. package/src/login/pages/LoginConfigTotp.tsx +30 -38
  258. package/src/login/pages/LoginIdpLinkConfirm.tsx +10 -21
  259. package/src/login/pages/LoginIdpLinkEmail.tsx +5 -5
  260. package/src/login/pages/LoginOauth2DeviceVerifyUserCode.tsx +19 -24
  261. package/src/login/pages/LoginOauthGrant.tsx +14 -21
  262. package/src/login/pages/LoginOtp.tsx +29 -33
  263. package/src/login/pages/LoginPageExpired.tsx +5 -5
  264. package/src/login/pages/LoginPassword.tsx +23 -33
  265. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +21 -25
  266. package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +21 -25
  267. package/src/login/pages/LoginResetOtp.tsx +21 -25
  268. package/src/login/pages/LoginResetPassword.tsx +21 -25
  269. package/src/login/pages/LoginUpdatePassword.tsx +42 -52
  270. package/src/login/pages/LoginUpdateProfile.tsx +29 -30
  271. package/src/login/pages/LoginUsername.tsx +23 -35
  272. package/src/login/pages/LoginVerifyEmail.tsx +7 -5
  273. package/src/login/pages/LoginX509Info.tsx +27 -36
  274. package/src/login/pages/LogoutConfirm.tsx +11 -17
  275. package/src/login/pages/PageProps.ts +2 -4
  276. package/src/login/pages/Register.tsx +27 -46
  277. package/src/login/pages/SamlPostForm.tsx +5 -5
  278. package/src/login/pages/SelectAuthenticator.tsx +24 -26
  279. package/src/login/pages/Terms.tsx +9 -16
  280. package/src/login/pages/UpdateEmail.tsx +29 -33
  281. package/src/login/pages/WebauthnAuthenticate.tsx +26 -32
  282. package/src/login/pages/WebauthnError.tsx +11 -22
  283. package/src/login/pages/WebauthnRegister.tsx +20 -28
  284. package/src/tools/clsx.ts +6 -48
  285. package/src/tools/clsx_withTransform.ts +55 -0
  286. package/src/vite-plugin/vite-plugin.ts +29 -21
  287. package/tools/clsx.d.ts +3 -2
  288. package/tools/clsx.js +5 -41
  289. package/tools/clsx.js.map +1 -1
  290. package/tools/clsx_withTransform.d.ts +5 -0
  291. package/tools/clsx_withTransform.js +43 -0
  292. package/tools/clsx_withTransform.js.map +1 -0
  293. package/vite-plugin/index.js +243 -102
  294. package/vite-plugin/vite-plugin.d.ts +3 -3
  295. package/account/lib/useGetClassName.d.ts +0 -7
  296. package/account/lib/useGetClassName.js.map +0 -1
  297. package/bin/795.index.js +0 -1197
  298. package/lib/isStorybook.d.ts +0 -1
  299. package/lib/isStorybook.js +0 -3
  300. package/lib/isStorybook.js.map +0 -1
  301. package/lib/useGetClassName.d.ts +0 -10
  302. package/lib/useGetClassName.js +0 -14
  303. package/lib/useGetClassName.js.map +0 -1
  304. package/login/lib/useGetClassName.d.ts +0 -7
  305. package/login/lib/useGetClassName.js.map +0 -1
  306. package/src/lib/isStorybook.ts +0 -3
  307. package/src/lib/useGetClassName.ts +0 -27
package/bin/795.index.js DELETED
@@ -1,1197 +0,0 @@
1
- "use strict";
2
- exports.id = 795;
3
- exports.ids = [795];
4
- exports.modules = {
5
-
6
- /***/ 54659:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "d": () => (/* binding */ readBuildOptions)
13
- });
14
-
15
- // EXTERNAL MODULE: external "url"
16
- var external_url_ = __webpack_require__(57310);
17
- // EXTERNAL MODULE: external "path"
18
- var external_path_ = __webpack_require__(71017);
19
- // EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
20
- var getAbsoluteAndInOsFormatPath = __webpack_require__(86644);
21
- // EXTERNAL MODULE: external "child_process"
22
- var external_child_process_ = __webpack_require__(32081);
23
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
24
- var assert = __webpack_require__(88078);
25
- // EXTERNAL MODULE: external "fs"
26
- var external_fs_ = __webpack_require__(57147);
27
- ;// CONCATENATED MODULE: ./dist/bin/tools/getNpmWorkspaceRootDirPath.js
28
-
29
-
30
-
31
-
32
- function getNpmWorkspaceRootDirPath(params) {
33
- const { reactAppRootDirPath, dependencyExpected } = params;
34
- const npmWorkspaceRootDirPath = (function callee(depth) {
35
- const cwd = (0,external_path_.resolve)((0,external_path_.join)(...[reactAppRootDirPath, ...Array(depth).fill("..")]));
36
- (0,assert.assert)(cwd !== external_path_.sep, "NPM workspace not found");
37
- try {
38
- external_child_process_.execSync("npm config get", {
39
- cwd,
40
- stdio: "ignore"
41
- });
42
- }
43
- catch (error) {
44
- if (String(error).includes("ENOWORKSPACES")) {
45
- return callee(depth + 1);
46
- }
47
- throw error;
48
- }
49
- const packageJsonFilePath = (0,external_path_.join)(cwd, "package.json");
50
- if (!external_fs_.existsSync(packageJsonFilePath)) {
51
- return callee(depth + 1);
52
- }
53
- (0,assert.assert)(external_fs_.existsSync(packageJsonFilePath));
54
- const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
55
- let isExpectedDependencyFound = false;
56
- for (const dependenciesOrDevDependencies of [
57
- "dependencies",
58
- "devDependencies"
59
- ]) {
60
- const dependencies = parsedPackageJson[dependenciesOrDevDependencies];
61
- if (dependencies === undefined) {
62
- continue;
63
- }
64
- (0,assert.assert)(dependencies instanceof Object);
65
- if (dependencies[dependencyExpected] === undefined) {
66
- continue;
67
- }
68
- isExpectedDependencyFound = true;
69
- }
70
- if (!isExpectedDependencyFound && parsedPackageJson.name !== dependencyExpected) {
71
- return callee(depth + 1);
72
- }
73
- return cwd;
74
- })(0);
75
- return { npmWorkspaceRootDirPath };
76
- }
77
- //# sourceMappingURL=getNpmWorkspaceRootDirPath.js.map
78
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
79
- var lib = __webpack_require__(52300);
80
- // EXTERNAL MODULE: ./node_modules/tsafe/index.js
81
- var tsafe = __webpack_require__(1666);
82
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
83
- var constants = __webpack_require__(173);
84
- ;// CONCATENATED MODULE: ./dist/bin/shared/buildOptions.js
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
- function readBuildOptions(params) {
95
- var _a, _b, _c, _d, _e;
96
- const { cliCommandOptions } = params;
97
- const reactAppRootDirPath = (() => {
98
- if (cliCommandOptions.reactAppRootDirPath === undefined) {
99
- return process.cwd();
100
- }
101
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
102
- pathIsh: cliCommandOptions.reactAppRootDirPath,
103
- cwd: process.cwd()
104
- });
105
- })();
106
- const { resolvedViteConfig } = (() => {
107
- if (external_fs_.readdirSync(reactAppRootDirPath)
108
- .find(fileBasename => fileBasename.startsWith("vite.config")) ===
109
- undefined) {
110
- return { resolvedViteConfig: undefined };
111
- }
112
- const output = external_child_process_.execSync("npx vite", {
113
- cwd: reactAppRootDirPath,
114
- env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig]: "true" })
115
- })
116
- .toString("utf8");
117
- (0,tsafe.assert)(output.includes(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
118
- const resolvedViteConfigStr = output
119
- .split(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig)
120
- .reverse()[0];
121
- const resolvedViteConfig = JSON.parse(resolvedViteConfigStr);
122
- return { resolvedViteConfig };
123
- })();
124
- const parsedPackageJson = (() => {
125
- const zParsedPackageJson = lib.z.object({
126
- name: lib.z.string(),
127
- version: lib.z.string().optional(),
128
- homepage: lib.z.string().optional(),
129
- keycloakify: lib.z.object({
130
- extraThemeProperties: lib.z.array(lib.z.string()).optional(),
131
- artifactId: lib.z.string().optional(),
132
- groupId: lib.z.string().optional(),
133
- loginThemeResourcesFromKeycloakVersion: lib.z.string().optional(),
134
- reactAppBuildDirPath: lib.z.string().optional(),
135
- keycloakifyBuildDirPath: lib.z.string().optional(),
136
- themeName: lib.z.union([lib.z.string(), lib.z.array(lib.z.string())]).optional()
137
- })
138
- .optional()
139
- });
140
- {
141
- (0,tsafe.assert)();
142
- (0,tsafe.assert)();
143
- }
144
- return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync((0,external_path_.join)(reactAppRootDirPath, "package.json"))
145
- .toString("utf8")));
146
- })();
147
- const userProvidedBuildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.userProvidedBuildOptions);
148
- const themeNames = (() => {
149
- if (userProvidedBuildOptions.themeName === undefined) {
150
- return [
151
- parsedPackageJson.name
152
- .replace(/^@(.*)/, "$1")
153
- .split("/")
154
- .join("-")
155
- ];
156
- }
157
- if (typeof userProvidedBuildOptions.themeName === "string") {
158
- return [userProvidedBuildOptions.themeName];
159
- }
160
- return userProvidedBuildOptions.themeName;
161
- })();
162
- const reactAppBuildDirPath = (() => {
163
- var _a;
164
- webpack: {
165
- if (resolvedViteConfig !== undefined) {
166
- break webpack;
167
- }
168
- if (((_a = parsedPackageJson.keycloakify) === null || _a === void 0 ? void 0 : _a.reactAppBuildDirPath) !== undefined) {
169
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
170
- pathIsh: parsedPackageJson.keycloakify.reactAppBuildDirPath,
171
- cwd: reactAppRootDirPath
172
- });
173
- }
174
- return (0,external_path_.join)(reactAppRootDirPath, "build");
175
- }
176
- return (0,external_path_.join)(reactAppRootDirPath, resolvedViteConfig.buildDir);
177
- })();
178
- const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
179
- reactAppRootDirPath,
180
- dependencyExpected: "keycloakify"
181
- });
182
- return {
183
- bundler: resolvedViteConfig !== undefined ? "vite" : "webpack",
184
- themeVersion: (_b = (_a = process.env.KEYCLOAKIFY_THEME_VERSION) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
185
- themeNames,
186
- extraThemeProperties: userProvidedBuildOptions.extraThemeProperties,
187
- groupId: (() => {
188
- var _a, _b, _c, _d, _e;
189
- const fallbackGroupId = `${themeNames[0]}.keycloak`;
190
- return ((_b = (_a = process.env.KEYCLOAKIFY_GROUP_ID) !== null && _a !== void 0 ? _a : userProvidedBuildOptions.groupId) !== null && _b !== void 0 ? _b : (parsedPackageJson.homepage === undefined
191
- ? fallbackGroupId
192
- : (_e = (_d = (_c = (0,external_url_.parse)(parsedPackageJson.homepage)
193
- .host) === null || _c === void 0 ? void 0 : _c.replace(/:[0-9]+$/, "")) === null || _d === void 0 ? void 0 : _d.split(".").reverse().join(".")) !== null && _e !== void 0 ? _e : fallbackGroupId) + ".keycloak");
194
- })(),
195
- artifactId: (_d = (_c = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _c !== void 0 ? _c : userProvidedBuildOptions.artifactId) !== null && _d !== void 0 ? _d : `${themeNames[0]}-keycloak-theme`,
196
- loginThemeResourcesFromKeycloakVersion: (_e = userProvidedBuildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : "24.0.4",
197
- reactAppRootDirPath,
198
- reactAppBuildDirPath,
199
- keycloakifyBuildDirPath: (() => {
200
- if (userProvidedBuildOptions.keycloakifyBuildDirPath !== undefined) {
201
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
202
- pathIsh: userProvidedBuildOptions.keycloakifyBuildDirPath,
203
- cwd: reactAppRootDirPath
204
- });
205
- }
206
- return (0,external_path_.join)(reactAppRootDirPath, (resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildDir) === undefined
207
- ? "build_keycloak"
208
- : `${resolvedViteConfig.buildDir}_keycloak`);
209
- })(),
210
- publicDirPath: (() => {
211
- webpack: {
212
- if (resolvedViteConfig !== undefined) {
213
- break webpack;
214
- }
215
- if (process.env.PUBLIC_DIR_PATH !== undefined) {
216
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
217
- pathIsh: process.env.PUBLIC_DIR_PATH,
218
- cwd: reactAppRootDirPath
219
- });
220
- }
221
- return (0,external_path_.join)(reactAppRootDirPath, "public");
222
- }
223
- return (0,external_path_.join)(reactAppRootDirPath, resolvedViteConfig.publicDir);
224
- })(),
225
- cacheDirPath: (() => {
226
- const cacheDirPath = (0,external_path_.join)((() => {
227
- if (process.env.XDG_CACHE_HOME !== undefined) {
228
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
229
- pathIsh: process.env.XDG_CACHE_HOME,
230
- cwd: process.cwd()
231
- });
232
- }
233
- return (0,external_path_.join)(npmWorkspaceRootDirPath, "node_modules", ".cache");
234
- })(), "keycloakify");
235
- return cacheDirPath;
236
- })(),
237
- urlPathname: (() => {
238
- webpack: {
239
- if (resolvedViteConfig !== undefined) {
240
- break webpack;
241
- }
242
- const { homepage } = parsedPackageJson;
243
- let url = undefined;
244
- if (homepage !== undefined) {
245
- url = new URL(homepage);
246
- }
247
- if (url === undefined) {
248
- return undefined;
249
- }
250
- const out = url.pathname.replace(/([^/])$/, "$1/");
251
- return out === "/" ? undefined : out;
252
- }
253
- return resolvedViteConfig.urlPathname;
254
- })(),
255
- assetsDirPath: (() => {
256
- webpack: {
257
- if (resolvedViteConfig !== undefined) {
258
- break webpack;
259
- }
260
- return (0,external_path_.join)(reactAppBuildDirPath, "static");
261
- }
262
- return (0,external_path_.join)(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
263
- })(),
264
- npmWorkspaceRootDirPath,
265
- kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode
266
- };
267
- }
268
- //# sourceMappingURL=buildOptions.js.map
269
-
270
- /***/ }),
271
-
272
- /***/ 173:
273
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
274
-
275
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
276
- /* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
277
- /* harmony export */ "N$": () => (/* binding */ keycloak_resources),
278
- /* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
279
- /* harmony export */ "X4": () => (/* binding */ nameOfTheGlobal),
280
- /* harmony export */ "fe": () => (/* binding */ vitePluginSubScriptEnvNames),
281
- /* harmony export */ "h6": () => (/* binding */ containerName),
282
- /* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
283
- /* harmony export */ "rO": () => (/* binding */ themeTypes),
284
- /* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
285
- /* harmony export */ "uo": () => (/* binding */ skipBuildJarsEnvName),
286
- /* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
287
- /* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
288
- /* harmony export */ "z0": () => (/* binding */ resources_common)
289
- /* harmony export */ });
290
- const nameOfTheGlobal = "kcContext";
291
- const nameOfTheLocalizationRealmOverridesUserProfileProperty = "__localizationRealmOverridesUserProfile";
292
- const keycloak_resources = "keycloak-resources";
293
- const resources_common = "resources-common";
294
- const lastKeycloakVersionWithAccountV1 = "21.1.2";
295
- const basenameOfTheKeycloakifyResourcesDir = "build";
296
- const themeTypes = ["login", "account"];
297
- const accountV1ThemeName = "account-v1";
298
- const vitePluginSubScriptEnvNames = {
299
- runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
300
- resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
301
- };
302
- const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
303
- const loginThemePageIds = [
304
- "login.ftl",
305
- "login-username.ftl",
306
- "login-password.ftl",
307
- "webauthn-authenticate.ftl",
308
- "webauthn-register.ftl",
309
- "register.ftl",
310
- "info.ftl",
311
- "error.ftl",
312
- "login-reset-password.ftl",
313
- "login-verify-email.ftl",
314
- "terms.ftl",
315
- "login-oauth2-device-verify-user-code.ftl",
316
- "login-oauth-grant.ftl",
317
- "login-otp.ftl",
318
- "login-update-profile.ftl",
319
- "login-update-password.ftl",
320
- "login-idp-link-confirm.ftl",
321
- "login-idp-link-email.ftl",
322
- "login-page-expired.ftl",
323
- "login-config-totp.ftl",
324
- "logout-confirm.ftl",
325
- "idp-review-user-profile.ftl",
326
- "update-email.ftl",
327
- "select-authenticator.ftl",
328
- "saml-post-form.ftl",
329
- "delete-credential.ftl",
330
- "code.ftl",
331
- "delete-account-confirm.ftl",
332
- "frontchannel-logout.ftl",
333
- "login-recovery-authn-code-config.ftl",
334
- "login-recovery-authn-code-input.ftl",
335
- "login-reset-otp.ftl",
336
- "login-x509-info.ftl",
337
- "webauthn-error.ftl"
338
- ];
339
- const accountThemePageIds = [
340
- "password.ftl",
341
- "account.ftl",
342
- "sessions.ftl",
343
- "totp.ftl",
344
- "applications.ftl",
345
- "log.ftl",
346
- "federatedIdentity.ftl"
347
- ];
348
- const containerName = "keycloak-keycloakify";
349
- //# sourceMappingURL=constants.js.map
350
-
351
- /***/ }),
352
-
353
- /***/ 61804:
354
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
355
-
356
-
357
- // EXPORTS
358
- __webpack_require__.d(__webpack_exports__, {
359
- "x": () => (/* binding */ downloadKeycloakDefaultTheme)
360
- });
361
-
362
- // EXTERNAL MODULE: external "path"
363
- var external_path_ = __webpack_require__(71017);
364
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
365
- var assert = __webpack_require__(88078);
366
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
367
- var constants = __webpack_require__(173);
368
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
369
- var lib = __webpack_require__(9525);
370
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
371
- // EXTERNAL MODULE: external "fs/promises"
372
- var promises_ = __webpack_require__(73292);
373
- // EXTERNAL MODULE: ./dist/bin/tools/extractArchive.js
374
- var extractArchive = __webpack_require__(29121);
375
- // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
376
- var fs_existsAsync = __webpack_require__(43765);
377
- // EXTERNAL MODULE: external "child_process"
378
- var external_child_process_ = __webpack_require__(32081);
379
- // EXTERNAL MODULE: external "util"
380
- var external_util_ = __webpack_require__(73837);
381
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/fetchProxyOptions.js
382
-
383
-
384
-
385
- function ensureArray(arg0) {
386
- return Array.isArray(arg0) ? arg0 : typeof arg0 === "undefined" ? [] : [arg0];
387
- }
388
- function ensureSingleOrNone(arg0) {
389
- if (!Array.isArray(arg0))
390
- return arg0;
391
- if (arg0.length === 0)
392
- return undefined;
393
- if (arg0.length === 1)
394
- return arg0[0];
395
- throw new Error("Illegal configuration, expected a single value but found multiple: " +
396
- arg0.map(String).join(", "));
397
- }
398
- /**
399
- * Get npm configuration as map
400
- */
401
- async function getNmpConfig(params) {
402
- const { npmWorkspaceRootDirPath } = params;
403
- const exec = (0,external_util_.promisify)(external_child_process_.exec);
404
- const stdout = await exec("npm config get", {
405
- encoding: "utf8",
406
- cwd: npmWorkspaceRootDirPath
407
- }).then(({ stdout }) => stdout);
408
- const npmConfigReducer = (cfg, [key, value]) => key in cfg
409
- ? Object.assign(Object.assign({}, cfg), { [key]: [...ensureArray(cfg[key]), value] }) : Object.assign(Object.assign({}, cfg), { [key]: value });
410
- return stdout
411
- .split("\n")
412
- .filter(line => !line.startsWith(";"))
413
- .map(line => line.trim())
414
- .map(line => line.split("=", 2))
415
- .reduce(npmConfigReducer, {});
416
- }
417
- async function getProxyFetchOptions(params) {
418
- var _a, _b, _c;
419
- const { npmWorkspaceRootDirPath } = params;
420
- const cfg = await getNmpConfig({ npmWorkspaceRootDirPath });
421
- const proxy = ensureSingleOrNone((_a = cfg["https-proxy"]) !== null && _a !== void 0 ? _a : cfg["proxy"]);
422
- const noProxy = (_b = cfg["noproxy"]) !== null && _b !== void 0 ? _b : cfg["no-proxy"];
423
- function maybeBoolean(arg0) {
424
- return typeof arg0 === "undefined" ? undefined : Boolean(arg0);
425
- }
426
- const strictSSL = maybeBoolean(ensureSingleOrNone(cfg["strict-ssl"]));
427
- const cert = cfg["cert"];
428
- const ca = ensureArray((_c = cfg["ca"]) !== null && _c !== void 0 ? _c : cfg["ca[]"]);
429
- const cafile = ensureSingleOrNone(cfg["cafile"]);
430
- if (typeof cafile !== "undefined" && cafile !== "null") {
431
- ca.push(...(await (async () => {
432
- function chunks(arr, size = 2) {
433
- return arr
434
- .map((_, i) => i % size == 0 && arr.slice(i, i + size))
435
- .filter(Boolean);
436
- }
437
- const cafileContent = await (0,promises_.readFile)(cafile, "utf-8");
438
- return chunks(cafileContent.split(/(-----END CERTIFICATE-----)/), 2).map(ca => ca.join("").replace(/^\n/, "").replace(/\n/g, "\\n"));
439
- })()));
440
- }
441
- return {
442
- proxy,
443
- noProxy,
444
- strictSSL,
445
- cert,
446
- ca: ca.length === 0 ? undefined : ca
447
- };
448
- }
449
- //# sourceMappingURL=fetchProxyOptions.js.map
450
- // EXTERNAL MODULE: external "crypto"
451
- var external_crypto_ = __webpack_require__(6113);
452
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
453
- var SemVer = __webpack_require__(12171);
454
- ;// CONCATENATED MODULE: ./dist/bin/tools/fs.rm.js
455
-
456
-
457
-
458
- /**
459
- * Polyfill of fs.rm(dirPath, { "recursive": true })
460
- * For older version of Node
461
- */
462
- async function rm(dirPath, options) {
463
- if (SemVer/* SemVer.compare */.h.compare(SemVer/* SemVer.parse */.h.parse(process.version), SemVer/* SemVer.parse */.h.parse("14.14.0")) > 0) {
464
- return promises_.rm(dirPath, options);
465
- }
466
- const { force = true } = options;
467
- if (force && !(await checkDirExists(dirPath))) {
468
- return;
469
- }
470
- const removeDir_rec = async (dirPath) => Promise.all((await promises_.readdir(dirPath)).map(async (basename) => {
471
- const fileOrDirpath = (0,external_path_.join)(dirPath, basename);
472
- if ((await promises_.lstat(fileOrDirpath)).isDirectory()) {
473
- await removeDir_rec(fileOrDirpath);
474
- }
475
- else {
476
- await promises_.unlink(fileOrDirpath);
477
- }
478
- }));
479
- await removeDir_rec(dirPath);
480
- }
481
- async function checkDirExists(dirPath) {
482
- try {
483
- await promises_.access(dirPath, promises_.constants.F_OK);
484
- return true;
485
- }
486
- catch (_a) {
487
- return false;
488
- }
489
- }
490
- //# sourceMappingURL=fs.rm.js.map
491
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.js
492
-
493
-
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
- async function downloadAndExtractArchive(params) {
502
- var _a;
503
- const { url, uniqueIdOfOnOnArchiveFile, onArchiveFile, cacheDirPath, npmWorkspaceRootDirPath } = params;
504
- const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
505
- const archiveFilePath = (0,external_path_.join)(cacheDirPath, archiveFileBasename);
506
- download: {
507
- if (await (0,fs_existsAsync/* existsAsync */.o)(archiveFilePath)) {
508
- const isDownloaded = await SuccessTracker.getIsDownloaded({
509
- cacheDirPath,
510
- archiveFileBasename
511
- });
512
- if (isDownloaded) {
513
- break download;
514
- }
515
- await (0,promises_.unlink)(archiveFilePath);
516
- await SuccessTracker.removeFromDownloaded({
517
- cacheDirPath,
518
- archiveFileBasename
519
- });
520
- }
521
- await (0,promises_.mkdir)((0,external_path_.dirname)(archiveFilePath), { recursive: true });
522
- const response = await lib_default()(url, await getProxyFetchOptions({ npmWorkspaceRootDirPath }));
523
- (_a = response.body) === null || _a === void 0 ? void 0 : _a.setMaxListeners(Number.MAX_VALUE);
524
- (0,assert.assert)(typeof response.body !== "undefined" && response.body != null);
525
- await (0,promises_.writeFile)(archiveFilePath, response.body);
526
- await SuccessTracker.markAsDownloaded({
527
- cacheDirPath,
528
- archiveFileBasename
529
- });
530
- }
531
- const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnOnArchiveFile}_${external_crypto_.createHash("sha256")
532
- .update(onArchiveFile.toString())
533
- .digest("hex")
534
- .substring(0, 5)}`;
535
- await Promise.all((await (0,promises_.readdir)(cacheDirPath))
536
- .filter((() => {
537
- const prefix = extractDirBasename
538
- .split("_")
539
- .reverse()
540
- .slice(1)
541
- .reverse()
542
- .join("_");
543
- return basename => basename !== extractDirBasename && basename.startsWith(prefix);
544
- })())
545
- .map(async (extractDirBasename) => {
546
- await rm((0,external_path_.join)(cacheDirPath, extractDirBasename), { recursive: true });
547
- await SuccessTracker.removeFromExtracted({
548
- cacheDirPath,
549
- extractDirBasename
550
- });
551
- }));
552
- const extractedDirPath = (0,external_path_.join)(cacheDirPath, extractDirBasename);
553
- extract_and_transform: {
554
- if (await (0,fs_existsAsync/* existsAsync */.o)(extractedDirPath)) {
555
- const isExtracted = await SuccessTracker.getIsExtracted({
556
- cacheDirPath,
557
- extractDirBasename
558
- });
559
- if (isExtracted) {
560
- break extract_and_transform;
561
- }
562
- await rm(extractedDirPath, { recursive: true });
563
- await SuccessTracker.removeFromExtracted({
564
- cacheDirPath,
565
- extractDirBasename
566
- });
567
- }
568
- await (0,extractArchive/* extractArchive */.N)({
569
- archiveFilePath,
570
- onArchiveFile: async ({ relativeFilePathInArchive, readFile, writeFile }) => onArchiveFile({
571
- fileRelativePath: relativeFilePathInArchive,
572
- readFile,
573
- writeFile: ({ fileRelativePath, modifiedData }) => writeFile({
574
- filePath: (0,external_path_.join)(extractedDirPath, fileRelativePath),
575
- modifiedData
576
- })
577
- })
578
- });
579
- await SuccessTracker.markAsExtracted({
580
- cacheDirPath,
581
- extractDirBasename
582
- });
583
- }
584
- return { extractedDirPath };
585
- }
586
- var SuccessTracker;
587
- (function (SuccessTracker) {
588
- async function read(params) {
589
- const { cacheDirPath } = params;
590
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
591
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(filePath))) {
592
- return { archiveFileBasenames: [], extractDirBasenames: [] };
593
- }
594
- return JSON.parse((await (0,promises_.readFile)(filePath)).toString("utf8"));
595
- }
596
- async function write(params) {
597
- const { cacheDirPath, successTracker } = params;
598
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
599
- {
600
- const dirPath = (0,external_path_.dirname)(filePath);
601
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
602
- await (0,promises_.mkdir)(dirPath, { recursive: true });
603
- }
604
- }
605
- await (0,promises_.writeFile)(filePath, JSON.stringify(successTracker));
606
- }
607
- async function markAsDownloaded(params) {
608
- const { cacheDirPath, archiveFileBasename } = params;
609
- const successTracker = await read({ cacheDirPath });
610
- successTracker.archiveFileBasenames.push(archiveFileBasename);
611
- await write({ cacheDirPath, successTracker });
612
- }
613
- SuccessTracker.markAsDownloaded = markAsDownloaded;
614
- async function getIsDownloaded(params) {
615
- const { cacheDirPath, archiveFileBasename } = params;
616
- const successTracker = await read({ cacheDirPath });
617
- return successTracker.archiveFileBasenames.includes(archiveFileBasename);
618
- }
619
- SuccessTracker.getIsDownloaded = getIsDownloaded;
620
- async function removeFromDownloaded(params) {
621
- const { cacheDirPath, archiveFileBasename } = params;
622
- const successTracker = await read({ cacheDirPath });
623
- successTracker.archiveFileBasenames = successTracker.archiveFileBasenames.filter(basename => basename !== archiveFileBasename);
624
- await write({ cacheDirPath, successTracker });
625
- }
626
- SuccessTracker.removeFromDownloaded = removeFromDownloaded;
627
- async function markAsExtracted(params) {
628
- const { cacheDirPath, extractDirBasename } = params;
629
- const successTracker = await read({ cacheDirPath });
630
- successTracker.extractDirBasenames.push(extractDirBasename);
631
- await write({ cacheDirPath, successTracker });
632
- }
633
- SuccessTracker.markAsExtracted = markAsExtracted;
634
- async function getIsExtracted(params) {
635
- const { cacheDirPath, extractDirBasename } = params;
636
- const successTracker = await read({ cacheDirPath });
637
- return successTracker.extractDirBasenames.includes(extractDirBasename);
638
- }
639
- SuccessTracker.getIsExtracted = getIsExtracted;
640
- async function removeFromExtracted(params) {
641
- const { cacheDirPath, extractDirBasename } = params;
642
- const successTracker = await read({ cacheDirPath });
643
- successTracker.extractDirBasenames = successTracker.extractDirBasenames.filter(basename => basename !== extractDirBasename);
644
- await write({ cacheDirPath, successTracker });
645
- }
646
- SuccessTracker.removeFromExtracted = removeFromExtracted;
647
- })(SuccessTracker || (SuccessTracker = {}));
648
- //# sourceMappingURL=downloadAndExtractArchive.js.map
649
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/index.js
650
-
651
- //# sourceMappingURL=index.js.map
652
- // EXTERNAL MODULE: ./dist/bin/tools/isInside.js
653
- var isInside = __webpack_require__(90665);
654
- ;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js
655
-
656
-
657
-
658
-
659
-
660
- (0,assert.assert)();
661
- async function downloadKeycloakDefaultTheme(params) {
662
- const { keycloakVersion, buildOptions } = params;
663
- const { extractedDirPath } = await downloadAndExtractArchive({
664
- url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
665
- cacheDirPath: buildOptions.cacheDirPath,
666
- npmWorkspaceRootDirPath: buildOptions.npmWorkspaceRootDirPath,
667
- uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
668
- onArchiveFile: async (params) => {
669
- if (!(0,isInside/* isInside */.V)({ dirPath: "theme", filePath: params.fileRelativePath })) {
670
- return;
671
- }
672
- const { readFile, writeFile } = params;
673
- const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
674
- skip_keycloak_v2: {
675
- if (!(0,isInside/* isInside */.V)({
676
- dirPath: (0,external_path_.join)("keycloak.v2"),
677
- filePath: fileRelativePath
678
- })) {
679
- break skip_keycloak_v2;
680
- }
681
- return;
682
- }
683
- last_account_v1_transformations: {
684
- if (constants/* lastKeycloakVersionWithAccountV1 */.v$ !== keycloakVersion) {
685
- break last_account_v1_transformations;
686
- }
687
- patch_account_css: {
688
- if (fileRelativePath !==
689
- (0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
690
- break patch_account_css;
691
- }
692
- await writeFile({
693
- fileRelativePath,
694
- modifiedData: Buffer.from((await readFile())
695
- .toString("utf8")
696
- .replace("top: -34px;", "top: -34px !important;"), "utf8")
697
- });
698
- return;
699
- }
700
- skip_web_modules: {
701
- if (!(0,isInside/* isInside */.V)({
702
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "web_modules"),
703
- filePath: fileRelativePath
704
- })) {
705
- break skip_web_modules;
706
- }
707
- return;
708
- }
709
- skip_unused_node_modules: {
710
- const nodeModulesDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
711
- if (!(0,isInside/* isInside */.V)({
712
- dirPath: nodeModulesDirPath,
713
- filePath: fileRelativePath
714
- })) {
715
- break skip_unused_node_modules;
716
- }
717
- const toKeepPrefixes = [
718
- ...[
719
- "patternfly.min.css",
720
- "patternfly-additions.min.css",
721
- "patternfly-additions.min.css"
722
- ].map(fileBasename => (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "css", fileBasename)),
723
- (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "fonts")
724
- ];
725
- if (toKeepPrefixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
726
- break skip_unused_node_modules;
727
- }
728
- return;
729
- }
730
- }
731
- skip_unused_resources: {
732
- if (keycloakVersion !== "24.0.4") {
733
- break skip_unused_resources;
734
- }
735
- for (const dirBasename of [
736
- "@patternfly-v5",
737
- "@rollup",
738
- "rollup",
739
- "react",
740
- "react-dom",
741
- "shx",
742
- ".pnpm"
743
- ]) {
744
- if ((0,isInside/* isInside */.V)({
745
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", dirBasename),
746
- filePath: fileRelativePath
747
- })) {
748
- return;
749
- }
750
- }
751
- for (const dirBasename of ["react", "react-dom"]) {
752
- if ((0,isInside/* isInside */.V)({
753
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "vendor", dirBasename),
754
- filePath: fileRelativePath
755
- })) {
756
- return;
757
- }
758
- }
759
- if ((0,isInside/* isInside */.V)({
760
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", "@patternfly", "react-core"),
761
- filePath: fileRelativePath
762
- })) {
763
- return;
764
- }
765
- }
766
- await writeFile({ fileRelativePath });
767
- }
768
- });
769
- return { defaultThemeDirPath: extractedDirPath };
770
- }
771
- //# sourceMappingURL=downloadKeycloakDefaultTheme.js.map
772
-
773
- /***/ }),
774
-
775
- /***/ 12171:
776
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
777
-
778
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
779
- /* harmony export */ "h": () => (/* binding */ SemVer)
780
- /* harmony export */ });
781
- var SemVer;
782
- (function (SemVer) {
783
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
784
- function parse(versionStr) {
785
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
786
- if (!match) {
787
- throw new Error(`${versionStr} is not a valid semantic version`);
788
- }
789
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
790
- const str = match[3];
791
- return str === undefined ? 0 : parseInt(str);
792
- })() }, (() => {
793
- const str = match[4];
794
- return str === undefined ? {} : { rc: parseInt(str) };
795
- })());
796
- const initialStr = stringify(semVer);
797
- Object.defineProperty(semVer, "parsedFrom", {
798
- enumerable: true,
799
- get: function () {
800
- const currentStr = stringify(this);
801
- if (currentStr !== initialStr) {
802
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
803
- }
804
- return versionStr;
805
- }
806
- });
807
- return semVer;
808
- }
809
- SemVer.parse = parse;
810
- function stringify(v) {
811
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
812
- }
813
- SemVer.stringify = stringify;
814
- /**
815
- *
816
- * v1 < v2 => -1
817
- * v1 === v2 => 0
818
- * v1 > v2 => 1
819
- *
820
- */
821
- function compare(v1, v2) {
822
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
823
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
824
- for (const level of ["major", "minor", "patch", "rc"]) {
825
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
826
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
827
- }
828
- }
829
- return 0;
830
- }
831
- SemVer.compare = compare;
832
- /*
833
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
834
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
835
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
836
- */
837
- function bumpType(params) {
838
- const versionAhead = typeof params.versionAhead === "string"
839
- ? parse(params.versionAhead)
840
- : params.versionAhead;
841
- const versionBehind = typeof params.versionBehind === "string"
842
- ? parse(params.versionBehind)
843
- : params.versionBehind;
844
- if (compare(versionBehind, versionAhead) === 1) {
845
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
846
- }
847
- for (const level of ["major", "minor", "patch", "rc"]) {
848
- if (versionBehind[level] !== versionAhead[level]) {
849
- return level;
850
- }
851
- }
852
- return "no bump";
853
- }
854
- SemVer.bumpType = bumpType;
855
- })(SemVer || (SemVer = {}));
856
- //# sourceMappingURL=SemVer.js.map
857
-
858
- /***/ }),
859
-
860
- /***/ 73036:
861
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
862
-
863
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
864
- /* harmony export */ "J": () => (/* binding */ crawl)
865
- /* harmony export */ });
866
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
867
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
868
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
869
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
870
-
871
-
872
- const crawlRec = (dirPath, filePaths) => {
873
- for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath)) {
874
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
875
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
876
- crawlRec(fileOrDirPath, filePaths);
877
- continue;
878
- }
879
- filePaths.push(fileOrDirPath);
880
- }
881
- };
882
- /** List all files in a given directory return paths relative to the dir_path */
883
- function crawl(params) {
884
- const { dirPath, returnedPathsType } = params;
885
- const filePaths = [];
886
- crawlRec(dirPath, filePaths);
887
- switch (returnedPathsType) {
888
- case "absolute":
889
- return filePaths;
890
- case "relative to dirPath":
891
- return filePaths.map(filePath => (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(dirPath, filePath));
892
- }
893
- }
894
- //# sourceMappingURL=crawl.js.map
895
-
896
- /***/ }),
897
-
898
- /***/ 29121:
899
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
900
-
901
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
902
- /* harmony export */ "N": () => (/* binding */ extractArchive)
903
- /* harmony export */ });
904
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
905
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
906
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
907
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
908
- /* harmony import */ var yauzl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78781);
909
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12781);
910
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
911
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50689);
912
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__);
913
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
914
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
915
- /* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43765);
916
-
917
-
918
-
919
-
920
-
921
-
922
-
923
- async function extractArchive(params) {
924
- const { archiveFilePath, onArchiveFile } = params;
925
- const zipFile = await new Promise((resolve, reject) => {
926
- yauzl__WEBPACK_IMPORTED_MODULE_2__.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
927
- if (error) {
928
- reject(error);
929
- return;
930
- }
931
- resolve(zipFile);
932
- });
933
- });
934
- const dDone = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
935
- zipFile.once("end", () => {
936
- zipFile.close();
937
- dDone.resolve();
938
- });
939
- const writeFile = async (entry, params) => {
940
- const { filePath, modifiedData } = params;
941
- {
942
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(filePath);
943
- if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__/* .existsAsync */ .o)(dirPath))) {
944
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().mkdir(dirPath, { recursive: true });
945
- }
946
- }
947
- if (modifiedData !== undefined) {
948
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().writeFile(filePath, modifiedData);
949
- return;
950
- }
951
- const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
952
- if (error) {
953
- dDone.reject(error);
954
- return;
955
- }
956
- resolve(readStream);
957
- }));
958
- const dDoneWithFile = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
959
- stream__WEBPACK_IMPORTED_MODULE_3___default().pipeline(readStream, fs__WEBPACK_IMPORTED_MODULE_1___default().createWriteStream(filePath), error => {
960
- if (error) {
961
- dDone.reject(error);
962
- return;
963
- }
964
- dDoneWithFile.resolve();
965
- });
966
- await dDoneWithFile.pr;
967
- };
968
- const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
969
- if (error) {
970
- dDone.reject(error);
971
- return;
972
- }
973
- const chunks = [];
974
- readStream.on("data", chunk => {
975
- chunks.push(chunk);
976
- });
977
- readStream.on("end", () => {
978
- resolve(Buffer.concat(chunks));
979
- });
980
- readStream.on("error", error => {
981
- dDone.reject(error);
982
- });
983
- }));
984
- zipFile.on("entry", async (entry) => {
985
- handle_file: {
986
- // NOTE: Skip directories
987
- if (entry.fileName.endsWith(path__WEBPACK_IMPORTED_MODULE_5__.sep)) {
988
- break handle_file;
989
- }
990
- let hasEarlyExitBeenCalled = false;
991
- await onArchiveFile({
992
- relativeFilePathInArchive: entry.fileName.split("/").join(path__WEBPACK_IMPORTED_MODULE_5__.sep),
993
- readFile: () => readFile(entry),
994
- writeFile: params => writeFile(entry, params),
995
- earlyExit: () => {
996
- hasEarlyExitBeenCalled = true;
997
- }
998
- });
999
- if (hasEarlyExitBeenCalled) {
1000
- zipFile.close();
1001
- dDone.resolve();
1002
- return;
1003
- }
1004
- }
1005
- zipFile.readEntry();
1006
- });
1007
- zipFile.readEntry();
1008
- await dDone.pr;
1009
- }
1010
- //# sourceMappingURL=extractArchive.js.map
1011
-
1012
- /***/ }),
1013
-
1014
- /***/ 43765:
1015
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1016
-
1017
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1018
- /* harmony export */ "o": () => (/* binding */ existsAsync)
1019
- /* harmony export */ });
1020
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
1021
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
1022
-
1023
- async function existsAsync(path) {
1024
- try {
1025
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(path);
1026
- return true;
1027
- }
1028
- catch (error) {
1029
- if (error.code === "ENOENT")
1030
- return false;
1031
- throw error;
1032
- }
1033
- }
1034
- //# sourceMappingURL=fs.existsAsync.js.map
1035
-
1036
- /***/ }),
1037
-
1038
- /***/ 89693:
1039
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1040
-
1041
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1042
- /* harmony export */ "a": () => (/* binding */ rmSync)
1043
- /* harmony export */ });
1044
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
1045
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
1046
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
1047
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
1048
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
1049
-
1050
-
1051
-
1052
- /**
1053
- * Polyfill of fs.rmSync(dirPath, { "recursive": true })
1054
- * For older version of Node
1055
- */
1056
- function rmSync(dirPath, options) {
1057
- if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
1058
- fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
1059
- return;
1060
- }
1061
- const { force = true } = options;
1062
- if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
1063
- return;
1064
- }
1065
- const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
1066
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
1067
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
1068
- removeDir_rec(fileOrDirPath);
1069
- return;
1070
- }
1071
- else {
1072
- fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
1073
- }
1074
- });
1075
- removeDir_rec(dirPath);
1076
- }
1077
- //# sourceMappingURL=fs.rmSync.js.map
1078
-
1079
- /***/ }),
1080
-
1081
- /***/ 86644:
1082
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1083
-
1084
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1085
- /* harmony export */ "c": () => (/* binding */ getAbsoluteAndInOsFormatPath)
1086
- /* harmony export */ });
1087
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
1088
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
1089
- /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22037);
1090
- /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
1091
-
1092
-
1093
- function getAbsoluteAndInOsFormatPath(params) {
1094
- const { pathIsh, cwd } = params;
1095
- let pathOut = pathIsh;
1096
- pathOut = pathOut.replace(/\//g, path__WEBPACK_IMPORTED_MODULE_0__.sep);
1097
- if (pathOut.startsWith("~")) {
1098
- pathOut = pathOut.replace("~", os__WEBPACK_IMPORTED_MODULE_1__.homedir());
1099
- }
1100
- pathOut = pathOut.endsWith(path__WEBPACK_IMPORTED_MODULE_0__.sep) ? pathOut.slice(0, -1) : pathOut;
1101
- if (!(0,path__WEBPACK_IMPORTED_MODULE_0__.isAbsolute)(pathOut)) {
1102
- pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(cwd, pathOut);
1103
- }
1104
- pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathOut);
1105
- return pathOut;
1106
- }
1107
- //# sourceMappingURL=getAbsoluteAndInOsFormatPath.js.map
1108
-
1109
- /***/ }),
1110
-
1111
- /***/ 90665:
1112
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1113
-
1114
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1115
- /* harmony export */ "V": () => (/* binding */ isInside)
1116
- /* harmony export */ });
1117
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
1118
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
1119
-
1120
- function isInside(params) {
1121
- const { dirPath, filePath } = params;
1122
- return !(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(dirPath, filePath).startsWith("..");
1123
- }
1124
- //# sourceMappingURL=isInside.js.map
1125
-
1126
- /***/ }),
1127
-
1128
- /***/ 60332:
1129
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1130
-
1131
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1132
- /* harmony export */ "N": () => (/* binding */ transformCodebase)
1133
- /* harmony export */ });
1134
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
1135
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
1136
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
1137
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
1138
- /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
1139
- /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
1140
-
1141
-
1142
-
1143
-
1144
- /**
1145
- * Apply a transformation function to every file of directory
1146
- * If source and destination are the same this function can be used to apply the transformation in place
1147
- * like filtering out some files or modifying them.
1148
- * */
1149
- function transformCodebase(params) {
1150
- const { srcDirPath, transformSourceCode } = params;
1151
- const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
1152
- const destDirPath = isTargetSameAsSource
1153
- ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
1154
- : params.destDirPath;
1155
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
1156
- recursive: true
1157
- });
1158
- for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
1159
- dirPath: srcDirPath,
1160
- returnedPathsType: "relative to dirPath"
1161
- })) {
1162
- const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
1163
- const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
1164
- // NOTE: Optimization, if we don't need to transform the file, just copy
1165
- // it using the lower level implementation.
1166
- if (transformSourceCode === undefined) {
1167
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
1168
- recursive: true
1169
- });
1170
- fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
1171
- continue;
1172
- }
1173
- const transformSourceCodeResult = transformSourceCode({
1174
- sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
1175
- filePath,
1176
- fileRelativePath
1177
- });
1178
- if (transformSourceCodeResult === undefined) {
1179
- continue;
1180
- }
1181
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
1182
- recursive: true
1183
- });
1184
- const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
1185
- fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(path__WEBPACK_IMPORTED_MODULE_1__.join(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), newFileName !== null && newFileName !== void 0 ? newFileName : path__WEBPACK_IMPORTED_MODULE_1__.basename(destFilePath)), modifiedSourceCode);
1186
- }
1187
- if (isTargetSameAsSource) {
1188
- (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
1189
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
1190
- }
1191
- }
1192
- //# sourceMappingURL=transformCodebase.js.map
1193
-
1194
- /***/ })
1195
-
1196
- };
1197
- ;