keycloakify 10.1.0-rc.0 → 10.1.0

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 (205) hide show
  1. package/PUBLIC_URL.js +2 -2
  2. package/PUBLIC_URL.js.map +1 -1
  3. package/account/KcContext/kcContextMocks.js +3 -3
  4. package/account/KcContext/kcContextMocks.js.map +1 -1
  5. package/bin/193.index.js +198 -62
  6. package/bin/{365.index.js → 20.index.js} +302 -263
  7. package/bin/31.index.js +15 -23
  8. package/bin/{430.index.js → 33.index.js} +579 -4
  9. package/bin/{678.index.js → 36.index.js} +2 -577
  10. package/bin/{440.index.js → 499.index.js} +259 -181
  11. package/bin/526.index.js +3 -784
  12. package/bin/599.index.js +4 -1
  13. package/bin/780.index.js +1 -1
  14. package/bin/{525.index.js → 903.index.js} +4840 -97
  15. package/bin/932.index.js +115 -886
  16. package/bin/main.js +4 -4
  17. package/bin/shared/buildContext.d.ts +0 -2
  18. package/bin/shared/buildContext.js.map +1 -1
  19. package/bin/shared/constants.d.ts +5 -6
  20. package/bin/shared/constants.js +5 -6
  21. package/bin/shared/constants.js.map +1 -1
  22. package/bin/shared/copyKeycloakResourcesToPublic.d.ts +2 -4
  23. package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -1
  24. package/login/KcContext/KcContext.d.ts +9 -18
  25. package/login/KcContext/KcContext.js.map +1 -1
  26. package/login/KcContext/kcContextMocks.js +6 -10
  27. package/login/KcContext/kcContextMocks.js.map +1 -1
  28. package/login/Template.js +4 -59
  29. package/login/Template.js.map +1 -1
  30. package/login/Template.useStylesAndScripts.d.ts +17 -0
  31. package/login/Template.useStylesAndScripts.js +69 -0
  32. package/login/Template.useStylesAndScripts.js.map +1 -0
  33. package/login/pages/Login.js +1 -1
  34. package/login/pages/Login.js.map +1 -1
  35. package/login/pages/LoginIdpLinkConfirmOverride.js +0 -1
  36. package/login/pages/LoginIdpLinkConfirmOverride.js.map +1 -1
  37. package/login/pages/LoginPasskeysConditionalAuthenticate.js +6 -49
  38. package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -1
  39. package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.d.ts +20 -0
  40. package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +49 -0
  41. package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js.map +1 -0
  42. package/login/pages/LoginRecoveryAuthnCodeConfig.js +4 -126
  43. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  44. package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.d.ts +9 -0
  45. package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +133 -0
  46. package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js.map +1 -0
  47. package/login/pages/LoginUsername.js +1 -1
  48. package/login/pages/LoginUsername.js.map +1 -1
  49. package/login/pages/Register.js +6 -3
  50. package/login/pages/Register.js.map +1 -1
  51. package/login/pages/WebauthnAuthenticate.js +13 -116
  52. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  53. package/login/pages/WebauthnAuthenticate.useScript.d.ts +21 -0
  54. package/login/pages/WebauthnAuthenticate.useScript.js +41 -0
  55. package/login/pages/WebauthnAuthenticate.useScript.js.map +1 -0
  56. package/login/pages/WebauthnRegister.js +8 -178
  57. package/login/pages/WebauthnRegister.js.map +1 -1
  58. package/login/pages/WebauthnRegister.useScript.d.ts +27 -0
  59. package/login/pages/WebauthnRegister.useScript.js +49 -0
  60. package/login/pages/WebauthnRegister.useScript.js.map +1 -0
  61. package/package.json +125 -15
  62. package/res/account-v1/account.ftl +70 -0
  63. package/res/account-v1/applications.ftl +76 -0
  64. package/res/account-v1/federatedIdentity.ftl +42 -0
  65. package/res/account-v1/log.ftl +35 -0
  66. package/res/account-v1/messages/messages_ar.properties +406 -0
  67. package/res/account-v1/messages/messages_ca.properties +147 -0
  68. package/res/account-v1/messages/messages_cs.properties +171 -0
  69. package/res/account-v1/messages/messages_da.properties +339 -0
  70. package/res/account-v1/messages/messages_de.properties +353 -0
  71. package/res/account-v1/messages/messages_en.properties +404 -0
  72. package/res/account-v1/messages/messages_es.properties +147 -0
  73. package/res/account-v1/messages/messages_fi.properties +400 -0
  74. package/res/account-v1/messages/messages_fr.properties +180 -0
  75. package/res/account-v1/messages/messages_hu.properties +334 -0
  76. package/res/account-v1/messages/messages_it.properties +336 -0
  77. package/res/account-v1/messages/messages_ja.properties +335 -0
  78. package/res/account-v1/messages/messages_lt.properties +154 -0
  79. package/res/account-v1/messages/messages_lv.properties +197 -0
  80. package/res/account-v1/messages/messages_nl.properties +371 -0
  81. package/res/account-v1/messages/messages_no.properties +152 -0
  82. package/res/account-v1/messages/messages_pl.properties +248 -0
  83. package/res/account-v1/messages/messages_pt_BR.properties +349 -0
  84. package/res/account-v1/messages/messages_ru.properties +235 -0
  85. package/res/account-v1/messages/messages_sk.properties +196 -0
  86. package/res/account-v1/messages/messages_sv.properties +150 -0
  87. package/res/account-v1/messages/messages_tr.properties +315 -0
  88. package/res/account-v1/messages/messages_zh_CN.properties +153 -0
  89. package/res/account-v1/password.ftl +59 -0
  90. package/res/account-v1/resource-detail.ftl +277 -0
  91. package/res/account-v1/resources/css/account.css +277 -0
  92. package/res/account-v1/resources/img/icon-sidebar-active.png +0 -0
  93. package/res/account-v1/resources/img/keycloak-logo.png +0 -0
  94. package/res/account-v1/resources/img/logo.png +0 -0
  95. package/res/account-v1/resources/resources-common/img/favicon.ico +0 -0
  96. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
  97. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
  98. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
  99. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
  100. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
  101. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
  102. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
  103. package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
  104. package/res/account-v1/resources.ftl +403 -0
  105. package/res/account-v1/sessions.ftl +44 -0
  106. package/res/account-v1/template.ftl +88 -0
  107. package/res/account-v1/theme.properties +14 -0
  108. package/res/account-v1/totp.ftl +141 -0
  109. package/res/public/.keycloakify/account/css/account.css +277 -0
  110. package/res/public/.keycloakify/account/img/icon-sidebar-active.png +0 -0
  111. package/res/public/.keycloakify/account/img/keycloak-logo.png +0 -0
  112. package/res/public/.keycloakify/account/img/logo.png +0 -0
  113. package/res/public/.keycloakify/account/resources-common/img/favicon.ico +0 -0
  114. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
  115. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
  116. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
  117. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
  118. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
  119. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
  120. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
  121. package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
  122. package/res/public/.keycloakify/login/css/login.css +629 -0
  123. package/res/public/.keycloakify/login/img/feedback-error-arrow-down.png +0 -0
  124. package/res/public/.keycloakify/login/img/feedback-error-sign.png +0 -0
  125. package/res/public/.keycloakify/login/img/feedback-success-arrow-down.png +0 -0
  126. package/res/public/.keycloakify/login/img/feedback-success-sign.png +0 -0
  127. package/res/public/.keycloakify/login/img/feedback-warning-arrow-down.png +0 -0
  128. package/res/public/.keycloakify/login/img/feedback-warning-sign.png +0 -0
  129. package/res/public/.keycloakify/login/img/keycloak-bg.png +0 -0
  130. package/res/public/.keycloakify/login/img/keycloak-logo-text.png +0 -0
  131. package/res/public/.keycloakify/login/img/keycloak-logo.png +0 -0
  132. package/res/public/.keycloakify/login/js/authChecker.js +49 -0
  133. package/res/public/.keycloakify/login/js/common.js +48 -0
  134. package/res/public/.keycloakify/login/js/kcMultivalued.js +106 -0
  135. package/res/public/.keycloakify/login/js/kcNumberFormat.js +21 -0
  136. package/res/public/.keycloakify/login/js/kcNumberUnFormat.js +19 -0
  137. package/res/public/.keycloakify/login/js/menu-button-links.js +315 -0
  138. package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/passkeysConditionalAuth.js +1 -1
  139. package/res/public/.keycloakify/login/js/passwordVisibility.js +15 -0
  140. package/res/public/.keycloakify/login/js/userProfile.js +71 -0
  141. package/res/public/.keycloakify/login/js/webauthnRegister.js +140 -0
  142. package/res/public/.keycloakify/login/resources-common/img/favicon.ico +0 -0
  143. package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.css +22 -0
  144. package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.woff2 +0 -0
  145. package/res/public/.keycloakify/login/resources-common/node_modules/@patternfly/patternfly/patternfly.min.css +2 -0
  146. package/res/public/.keycloakify/login/resources-common/node_modules/jquery/dist/jquery.min.js +2 -0
  147. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
  148. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
  149. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.ttf +0 -0
  150. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff +0 -0
  151. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
  152. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
  153. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
  154. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
  155. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
  156. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
  157. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/fontawesome-webfont.woff2 +0 -0
  158. package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/img/bg-login.jpg +0 -0
  159. package/res/public/.keycloakify/login/resources-common/node_modules/rfc4648/lib/rfc4648.js +178 -0
  160. package/src/PUBLIC_URL.ts +5 -3
  161. package/src/account/KcContext/kcContextMocks.ts +3 -3
  162. package/src/bin/copy-keycloak-resources-to-public.ts +1 -1
  163. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +4 -1
  164. package/src/bin/initialize-email-theme.ts +28 -8
  165. package/src/bin/keycloakify/buildJars/buildJar.ts +3 -7
  166. package/src/bin/keycloakify/generateFtl/generateFtl.ts +3 -7
  167. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +65 -90
  168. package/src/bin/keycloakify/keycloakify.ts +38 -21
  169. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +2 -2
  170. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +3 -3
  171. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +3 -3
  172. package/src/bin/shared/buildContext.ts +1 -8
  173. package/src/bin/shared/constants.ts +5 -7
  174. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +30 -40
  175. package/src/bin/start-keycloak/start-keycloak.ts +3 -7
  176. package/src/login/KcContext/KcContext.ts +9 -18
  177. package/src/login/KcContext/kcContextMocks.ts +5 -13
  178. package/src/login/Template.tsx +4 -67
  179. package/src/login/Template.useStylesAndScripts.ts +94 -0
  180. package/src/login/pages/Login.tsx +1 -1
  181. package/src/login/pages/LoginIdpLinkConfirmOverride.tsx +0 -1
  182. package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +6 -81
  183. package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.tsx +72 -0
  184. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +4 -126
  185. package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.tsx +142 -0
  186. package/src/login/pages/LoginUsername.tsx +1 -1
  187. package/src/login/pages/Register.tsx +35 -13
  188. package/src/login/pages/WebauthnAuthenticate.tsx +20 -133
  189. package/src/login/pages/WebauthnAuthenticate.useScript.tsx +64 -0
  190. package/src/login/pages/WebauthnRegister.tsx +8 -195
  191. package/src/login/pages/WebauthnRegister.useScript.tsx +93 -0
  192. package/src/tools/useInsertScriptTags.ts +14 -4
  193. package/src/vite-plugin/vite-plugin.ts +11 -15
  194. package/tools/useInsertScriptTags.d.ts +2 -2
  195. package/tools/useInsertScriptTags.js +8 -2
  196. package/tools/useInsertScriptTags.js.map +1 -1
  197. package/vite-plugin/index.js +3357 -47132
  198. package/bin/697.index.js +0 -4749
  199. package/bin/shared/downloadKeycloakStaticResources.d.ts +0 -9
  200. package/bin/shared/downloadKeycloakStaticResources.js.map +0 -1
  201. package/src/bin/keycloakify/generateResources/bringInAccountV1.ts +0 -89
  202. package/src/bin/shared/downloadKeycloakDefaultTheme/downloadKeycloakDefaultTheme.ts +0 -337
  203. package/src/bin/shared/downloadKeycloakDefaultTheme/index.ts +0 -1
  204. package/src/bin/shared/downloadKeycloakStaticResources.ts +0 -53
  205. /package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/webauthnAuthenticate.js +0 -0
package/bin/932.index.js CHANGED
@@ -10,14 +10,14 @@ __webpack_require__.r(__webpack_exports__);
10
10
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
11
  /* harmony export */ "command": () => (/* binding */ command)
12
12
  /* harmony export */ });
13
- /* harmony import */ var _shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33168);
14
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
15
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
16
- /* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60332);
17
- /* harmony import */ var _shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82635);
18
- /* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56031);
19
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57147);
20
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_5__);
13
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
14
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
15
+ /* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60332);
16
+ /* harmony import */ var _shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82635);
17
+ /* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56031);
18
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57147);
19
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_4__);
20
+ /* harmony import */ var _tools_downloadAndExtractArchive__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38367);
21
21
 
22
22
 
23
23
 
@@ -26,931 +26,160 @@ __webpack_require__.r(__webpack_exports__);
26
26
 
27
27
  async function command(params) {
28
28
  const { cliCommandOptions } = params;
29
- const buildContext = (0,_shared_buildContext__WEBPACK_IMPORTED_MODULE_4__/* .getBuildContext */ .s)({ cliCommandOptions });
30
- const emailThemeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, "email");
31
- if (fs__WEBPACK_IMPORTED_MODULE_5__.existsSync(emailThemeSrcDirPath)) {
32
- console.warn(`There is already a ${(0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(process.cwd(), emailThemeSrcDirPath)} directory in your project. Aborting.`);
29
+ const buildContext = (0,_shared_buildContext__WEBPACK_IMPORTED_MODULE_3__/* .getBuildContext */ .s)({ cliCommandOptions });
30
+ const emailThemeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(buildContext.themeSrcDirPath, "email");
31
+ if (fs__WEBPACK_IMPORTED_MODULE_4__.existsSync(emailThemeSrcDirPath) &&
32
+ fs__WEBPACK_IMPORTED_MODULE_4__.readdirSync(emailThemeSrcDirPath).length > 0) {
33
+ console.warn(`There is already a non empty ${(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(process.cwd(), emailThemeSrcDirPath)} directory in your project. Aborting.`);
33
34
  process.exit(-1);
34
35
  }
35
36
  console.log("Initialize with the base email theme from which version of Keycloak?");
36
- const { keycloakVersion } = await (0,_shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_3__/* .promptKeycloakVersion */ .s)({
37
+ const { keycloakVersion } = await (0,_shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_2__/* .promptKeycloakVersion */ .s)({
37
38
  // NOTE: This is arbitrary
38
39
  startingFromMajor: 17,
39
40
  excludeMajorVersions: [],
40
41
  doOmitPatch: false,
41
42
  buildContext
42
43
  });
43
- const { defaultThemeDirPath } = await (0,_shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_0__/* .downloadKeycloakDefaultTheme */ .x)({
44
- keycloakVersion,
45
- buildContext
44
+ const { extractedDirPath } = await (0,_tools_downloadAndExtractArchive__WEBPACK_IMPORTED_MODULE_5__/* .downloadAndExtractArchive */ .I)({
45
+ url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
46
+ cacheDirPath: buildContext.cacheDirPath,
47
+ fetchOptions: buildContext.fetchOptions,
48
+ uniqueIdOfOnArchiveFile: "extractOnlyEmailTheme",
49
+ onArchiveFile: async ({ fileRelativePath, writeFile }) => {
50
+ const fileRelativePath_target = (0,path__WEBPACK_IMPORTED_MODULE_0__.relative)((0,path__WEBPACK_IMPORTED_MODULE_0__.join)("theme", "base", "email"), fileRelativePath);
51
+ if (fileRelativePath_target.startsWith("..")) {
52
+ return;
53
+ }
54
+ await writeFile({ fileRelativePath: fileRelativePath_target });
55
+ }
46
56
  });
47
- (0,_tools_transformCodebase__WEBPACK_IMPORTED_MODULE_2__/* .transformCodebase */ .N)({
48
- srcDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(defaultThemeDirPath, "base", "email"),
57
+ (0,_tools_transformCodebase__WEBPACK_IMPORTED_MODULE_1__/* .transformCodebase */ .N)({
58
+ srcDirPath: extractedDirPath,
49
59
  destDirPath: emailThemeSrcDirPath
50
60
  });
51
61
  {
52
- const themePropertyFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(emailThemeSrcDirPath, "theme.properties");
53
- fs__WEBPACK_IMPORTED_MODULE_5__.writeFileSync(themePropertyFilePath, Buffer.from(`parent=base\n${fs__WEBPACK_IMPORTED_MODULE_5__.readFileSync(themePropertyFilePath).toString("utf8")}`, "utf8"));
62
+ const themePropertyFilePath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(emailThemeSrcDirPath, "theme.properties");
63
+ fs__WEBPACK_IMPORTED_MODULE_4__.writeFileSync(themePropertyFilePath, Buffer.from([
64
+ `parent=base`,
65
+ fs__WEBPACK_IMPORTED_MODULE_4__.readFileSync(themePropertyFilePath).toString("utf8")
66
+ ].join("\n"), "utf8"));
54
67
  }
55
- console.log(`The \`${(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(".", (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(process.cwd(), emailThemeSrcDirPath))}\` directory have been created.`);
68
+ console.log(`The \`${(0,path__WEBPACK_IMPORTED_MODULE_0__.join)(".", (0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(process.cwd(), emailThemeSrcDirPath))}\` directory have been created.`);
56
69
  console.log("You can delete any file you don't modify.");
57
70
  }
58
71
  //# sourceMappingURL=initialize-email-theme.js.map
59
72
 
60
73
  /***/ }),
61
74
 
62
- /***/ 97189:
75
+ /***/ 89693:
63
76
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
77
 
78
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
79
+ /* harmony export */ "a": () => (/* binding */ rmSync)
80
+ /* harmony export */ });
81
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
82
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
83
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
84
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
85
+ /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
65
86
 
66
- // EXPORTS
67
- __webpack_require__.d(__webpack_exports__, {
68
- "_": () => (/* binding */ getLatestsSemVersionedTag)
69
- });
70
-
71
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/listTags.js
72
- var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
73
- var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {
74
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
75
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
76
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
77
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
78
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
79
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
80
- function fulfill(value) { resume("next", value); }
81
- function reject(value) { resume("throw", value); }
82
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
83
- };
84
- const per_page = 99;
85
- function listTagsFactory(params) {
86
- const { octokit } = params;
87
- const octokit_repo_listTags = async (params) => {
88
- return octokit.repos.listTags(params);
89
- };
90
- function listTags(params) {
91
- return __asyncGenerator(this, arguments, function* listTags_1() {
92
- const { owner, repo } = params;
93
- let page = 1;
94
- while (true) {
95
- const resp = yield __await(octokit_repo_listTags({
96
- owner,
97
- repo,
98
- per_page,
99
- page: page++
100
- }));
101
- for (const branch of resp.data.map(({ name }) => name)) {
102
- yield yield __await(branch);
103
- }
104
- if (resp.data.length < 99) {
105
- break;
106
- }
107
- }
108
- });
109
- }
110
- /** Returns the same "latest" tag as deno.land/x, not actually the latest though */
111
- async function getLatestTag(params) {
112
- const { owner, repo } = params;
113
- const itRes = await listTags({ owner, repo }).next();
114
- if (itRes.done) {
115
- return undefined;
116
- }
117
- return itRes.value;
118
- }
119
- return { listTags, getLatestTag };
120
- }
121
- //# sourceMappingURL=listTags.js.map
122
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
123
- var SemVer = __webpack_require__(12171);
124
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/getLatestsSemVersionedTag.js
125
- var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
126
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
127
- var m = o[Symbol.asyncIterator], i;
128
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
129
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
130
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
131
- };
132
87
 
133
88
 
134
- function getLatestsSemVersionedTagFactory(params) {
135
- const { octokit } = params;
136
- async function getLatestsSemVersionedTag(params) {
137
- var _a, e_1, _b, _c;
138
- const { owner, repo, count, doIgnoreReleaseCandidates } = params;
139
- const semVersionedTags = [];
140
- const { listTags } = listTagsFactory({ octokit });
141
- try {
142
- for (var _d = true, _e = __asyncValues(listTags({ owner, repo })), _f; _f = await _e.next(), _a = _f.done, !_a;) {
143
- _c = _f.value;
144
- _d = false;
145
- try {
146
- const tag = _c;
147
- let version;
148
- try {
149
- version = SemVer/* SemVer.parse */.h.parse(tag.replace(/^[vV]?/, ""));
150
- }
151
- catch (_g) {
152
- continue;
153
- }
154
- if (doIgnoreReleaseCandidates && version.rc !== undefined) {
155
- continue;
156
- }
157
- semVersionedTags.push({ tag, version });
158
- }
159
- finally {
160
- _d = true;
161
- }
162
- }
163
- }
164
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
165
- finally {
166
- try {
167
- if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
168
- }
169
- finally { if (e_1) throw e_1.error; }
170
- }
171
- return semVersionedTags
172
- .sort(({ version: vX }, { version: vY }) => SemVer/* SemVer.compare */.h.compare(vY, vX))
173
- .slice(0, count);
89
+ /**
90
+ * Polyfill of fs.rmSync(dirPath, { "recursive": true })
91
+ * For older version of Node
92
+ */
93
+ function rmSync(dirPath, options) {
94
+ 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) {
95
+ fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
96
+ return;
174
97
  }
175
- return { getLatestsSemVersionedTag };
176
- }
177
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
178
- // EXTERNAL MODULE: ./node_modules/@octokit/rest/dist-node/index.js
179
- var dist_node = __webpack_require__(55375);
180
- // EXTERNAL MODULE: external "path"
181
- var external_path_ = __webpack_require__(71017);
182
- // EXTERNAL MODULE: external "fs"
183
- var external_fs_ = __webpack_require__(57147);
184
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
185
- var lib = __webpack_require__(52300);
186
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
187
- var assert = __webpack_require__(88078);
188
- // EXTERNAL MODULE: ./node_modules/tsafe/id.js
189
- var id = __webpack_require__(43047);
190
- // EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
191
- var same = __webpack_require__(33805);
192
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
193
- var make_fetch_happen_lib = __webpack_require__(9525);
194
- var lib_default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen_lib);
195
- ;// CONCATENATED MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js
196
- var __rest = (undefined && undefined.__rest) || function (s, e) {
197
- var t = {};
198
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
199
- t[p] = s[p];
200
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
201
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
202
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
203
- t[p[i]] = s[p[i]];
204
- }
205
- return t;
206
- };
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- let getLatestsSemVersionedTag_stateless = undefined;
217
- const CACHE_VERSION = 1;
218
- (0,assert.assert)();
219
- async function getLatestsSemVersionedTag(_a) {
220
- var { buildContext } = _a, params = __rest(_a, ["buildContext"]);
221
- const cacheFilePath = (0,external_path_.join)(buildContext.cacheDirPath, "latest-sem-versioned-tags.json");
222
- const cacheLookupResult = (() => {
223
- const getResult_currentCache = (currentCacheEntries) => ({
224
- hasCachedResult: false,
225
- currentCache: {
226
- version: CACHE_VERSION,
227
- entries: currentCacheEntries
228
- }
229
- });
230
- if (!external_fs_.existsSync(cacheFilePath)) {
231
- return getResult_currentCache([]);
232
- }
233
- let cache_json;
234
- try {
235
- cache_json = external_fs_.readFileSync(cacheFilePath).toString("utf8");
236
- }
237
- catch (_a) {
238
- return getResult_currentCache([]);
239
- }
240
- let cache_json_parsed;
241
- try {
242
- cache_json_parsed = JSON.parse(cache_json);
243
- }
244
- catch (_b) {
245
- return getResult_currentCache([]);
246
- }
247
- const zSemVer = (() => {
248
- const zTargetType = lib.z.object({
249
- major: lib.z.number(),
250
- minor: lib.z.number(),
251
- patch: lib.z.number(),
252
- rc: lib.z.number().optional(),
253
- parsedFrom: lib.z.string()
254
- });
255
- (0,assert.assert)();
256
- return (0,id.id)(zTargetType);
257
- })();
258
- const zCache = (() => {
259
- const zTargetType = lib.z.object({
260
- version: lib.z.literal(CACHE_VERSION),
261
- entries: lib.z.array(lib.z.object({
262
- time: lib.z.number(),
263
- params: lib.z.object({
264
- owner: lib.z.string(),
265
- repo: lib.z.string(),
266
- count: lib.z.number(),
267
- doIgnoreReleaseCandidates: lib.z.boolean()
268
- }),
269
- result: lib.z.array(lib.z.object({
270
- tag: lib.z.string(),
271
- version: zSemVer
272
- }))
273
- }))
274
- });
275
- (0,assert.assert)();
276
- return (0,id.id)(zTargetType);
277
- })();
278
- let cache;
279
- try {
280
- cache = zCache.parse(cache_json_parsed);
281
- }
282
- catch (_c) {
283
- return getResult_currentCache([]);
284
- }
285
- const cacheEntry = cache.entries.find(e => (0,same.same)(e.params, params));
286
- if (cacheEntry === undefined) {
287
- return getResult_currentCache(cache.entries);
98
+ const { force = true } = options;
99
+ if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
100
+ return;
101
+ }
102
+ const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
103
+ const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
104
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
105
+ removeDir_rec(fileOrDirPath);
106
+ return;
288
107
  }
289
- if (Date.now() - cacheEntry.time > 3600000) {
290
- return getResult_currentCache(cache.entries.filter(e => e !== cacheEntry));
108
+ else {
109
+ fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
291
110
  }
292
- return {
293
- hasCachedResult: true,
294
- cachedResult: cacheEntry.result
295
- };
296
- })();
297
- if (cacheLookupResult.hasCachedResult) {
298
- return cacheLookupResult.cachedResult;
299
- }
300
- const { currentCache } = cacheLookupResult;
301
- getLatestsSemVersionedTag_stateless !== null && getLatestsSemVersionedTag_stateless !== void 0 ? getLatestsSemVersionedTag_stateless : (getLatestsSemVersionedTag_stateless = (() => {
302
- const octokit = (() => {
303
- const githubToken = process.env.GITHUB_TOKEN;
304
- const octokit = new dist_node.Octokit(Object.assign(Object.assign({}, (githubToken === undefined ? {} : { auth: githubToken })), { request: {
305
- fetch: (url, options) => lib_default()(url, Object.assign(Object.assign({}, options), buildContext.fetchOptions))
306
- } }));
307
- return octokit;
308
- })();
309
- const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({
310
- octokit
311
- });
312
- return getLatestsSemVersionedTag;
313
- })());
314
- const result = await getLatestsSemVersionedTag_stateless(params);
315
- currentCache.entries.push({
316
- time: Date.now(),
317
- params,
318
- result
319
111
  });
320
- {
321
- const dirPath = (0,external_path_.dirname)(cacheFilePath);
322
- if (!external_fs_.existsSync(dirPath)) {
323
- external_fs_.mkdirSync(dirPath, { recursive: true });
324
- }
325
- }
326
- external_fs_.writeFileSync(cacheFilePath, JSON.stringify(currentCache, null, 2));
327
- return result;
112
+ removeDir_rec(dirPath);
328
113
  }
329
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
114
+ //# sourceMappingURL=fs.rmSync.js.map
330
115
 
331
116
  /***/ }),
332
117
 
333
- /***/ 82635:
118
+ /***/ 60332:
334
119
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
335
120
 
336
121
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
337
- /* harmony export */ "s": () => (/* binding */ promptKeycloakVersion)
122
+ /* harmony export */ "N": () => (/* binding */ transformCodebase)
338
123
  /* harmony export */ });
339
- /* harmony import */ var _getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97189);
340
- /* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99398);
341
- /* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cli_select__WEBPACK_IMPORTED_MODULE_1__);
342
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88078);
343
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_2__);
344
- /* harmony import */ var _tools_SemVer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12171);
124
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
125
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
126
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
127
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
128
+ /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
129
+ /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
345
130
 
346
131
 
347
132
 
348
133
 
349
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__.assert)();
350
- async function promptKeycloakVersion(params) {
351
- const { startingFromMajor, excludeMajorVersions, doOmitPatch, buildContext } = params;
352
- const semVersionedTagByMajor = new Map();
353
- const semVersionedTags = await (0,_getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_0__/* .getLatestsSemVersionedTag */ ._)({
354
- count: 50,
355
- owner: "keycloak",
356
- repo: "keycloak",
357
- doIgnoreReleaseCandidates: true,
358
- buildContext
134
+ /**
135
+ * Apply a transformation function to every file of directory
136
+ * If source and destination are the same this function can be used to apply the transformation in place
137
+ * like filtering out some files or modifying them.
138
+ * */
139
+ function transformCodebase(params) {
140
+ const { srcDirPath, transformSourceCode } = params;
141
+ const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
142
+ const destDirPath = isTargetSameAsSource
143
+ ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
144
+ : params.destDirPath;
145
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
146
+ recursive: true
359
147
  });
360
- semVersionedTags.forEach(semVersionedTag => {
361
- if (startingFromMajor !== undefined &&
362
- semVersionedTag.version.major < startingFromMajor) {
363
- return;
364
- }
365
- if (excludeMajorVersions.includes(semVersionedTag.version.major)) {
366
- return;
148
+ for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
149
+ dirPath: srcDirPath,
150
+ returnedPathsType: "relative to dirPath"
151
+ })) {
152
+ const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
153
+ const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
154
+ // NOTE: Optimization, if we don't need to transform the file, just copy
155
+ // it using the lower level implementation.
156
+ if (transformSourceCode === undefined) {
157
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
158
+ recursive: true
159
+ });
160
+ fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
161
+ continue;
367
162
  }
368
- const currentSemVersionedTag = semVersionedTagByMajor.get(semVersionedTag.version.major);
369
- if (currentSemVersionedTag !== undefined &&
370
- _tools_SemVer__WEBPACK_IMPORTED_MODULE_3__/* .SemVer.compare */ .h.compare(semVersionedTag.version, currentSemVersionedTag.version) === -1) {
371
- return;
163
+ const transformSourceCodeResult = transformSourceCode({
164
+ sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
165
+ filePath,
166
+ fileRelativePath
167
+ });
168
+ if (transformSourceCodeResult === undefined) {
169
+ continue;
372
170
  }
373
- semVersionedTagByMajor.set(semVersionedTag.version.major, semVersionedTag);
374
- });
375
- const lastMajorVersions = Array.from(semVersionedTagByMajor.values()).map(({ version }) => `${version.major}.${version.minor}${doOmitPatch ? "" : `.${version.patch}`}`);
376
- const { value } = await cli_select__WEBPACK_IMPORTED_MODULE_1___default()({
377
- values: lastMajorVersions
378
- }).catch(() => {
379
- process.exit(-1);
380
- });
381
- const keycloakVersion = value.split(" ")[0];
382
- return { keycloakVersion };
383
- }
384
- //# sourceMappingURL=promptKeycloakVersion.js.map
385
-
386
- /***/ }),
387
-
388
- /***/ 18512:
389
- /***/ ((module) => {
390
-
391
-
392
- const x = module.exports;
393
- const ESC = '\u001B[';
394
- const OSC = '\u001B]';
395
- const BEL = '\u0007';
396
- const SEP = ';';
397
- const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
398
-
399
- x.cursorTo = (x, y) => {
400
- if (typeof x !== 'number') {
401
- throw new TypeError('The `x` argument is required');
402
- }
403
-
404
- if (typeof y !== 'number') {
405
- return ESC + (x + 1) + 'G';
406
- }
407
-
408
- return ESC + (y + 1) + ';' + (x + 1) + 'H';
409
- };
410
-
411
- x.cursorMove = (x, y) => {
412
- if (typeof x !== 'number') {
413
- throw new TypeError('The `x` argument is required');
414
- }
415
-
416
- let ret = '';
417
-
418
- if (x < 0) {
419
- ret += ESC + (-x) + 'D';
420
- } else if (x > 0) {
421
- ret += ESC + x + 'C';
422
- }
423
-
424
- if (y < 0) {
425
- ret += ESC + (-y) + 'A';
426
- } else if (y > 0) {
427
- ret += ESC + y + 'B';
428
- }
429
-
430
- return ret;
431
- };
432
-
433
- x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A';
434
- x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B';
435
- x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C';
436
- x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D';
437
-
438
- x.cursorLeft = ESC + 'G';
439
- x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's');
440
- x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u');
441
- x.cursorGetPosition = ESC + '6n';
442
- x.cursorNextLine = ESC + 'E';
443
- x.cursorPrevLine = ESC + 'F';
444
- x.cursorHide = ESC + '?25l';
445
- x.cursorShow = ESC + '?25h';
446
-
447
- x.eraseLines = count => {
448
- let clear = '';
449
-
450
- for (let i = 0; i < count; i++) {
451
- clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : '');
452
- }
453
-
454
- if (count) {
455
- clear += x.cursorLeft;
456
- }
457
-
458
- return clear;
459
- };
460
-
461
- x.eraseEndLine = ESC + 'K';
462
- x.eraseStartLine = ESC + '1K';
463
- x.eraseLine = ESC + '2K';
464
- x.eraseDown = ESC + 'J';
465
- x.eraseUp = ESC + '1J';
466
- x.eraseScreen = ESC + '2J';
467
- x.scrollUp = ESC + 'S';
468
- x.scrollDown = ESC + 'T';
469
-
470
- x.clearScreen = '\u001Bc';
471
-
472
- x.clearTerminal = process.platform === 'win32' ?
473
- `${x.eraseScreen}${ESC}0f` :
474
- // 1. Erases the screen (Only done in case `2` is not supported)
475
- // 2. Erases the whole screen including scrollback buffer
476
- // 3. Moves cursor to the top-left position
477
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
478
- `${x.eraseScreen}${ESC}3J${ESC}H`;
479
-
480
- x.beep = BEL;
481
-
482
- x.link = (text, url) => {
483
- return [
484
- OSC,
485
- '8',
486
- SEP,
487
- SEP,
488
- url,
489
- BEL,
490
- text,
491
- OSC,
492
- '8',
493
- SEP,
494
- SEP,
495
- BEL
496
- ].join('');
497
- };
498
-
499
- x.image = (buf, opts) => {
500
- opts = opts || {};
501
-
502
- let ret = OSC + '1337;File=inline=1';
503
-
504
- if (opts.width) {
505
- ret += `;width=${opts.width}`;
506
- }
507
-
508
- if (opts.height) {
509
- ret += `;height=${opts.height}`;
510
- }
511
-
512
- if (opts.preserveAspectRatio === false) {
513
- ret += ';preserveAspectRatio=0';
514
- }
515
-
516
- return ret + ':' + buf.toString('base64') + BEL;
517
- };
518
-
519
- x.iTerm = {};
520
-
521
- x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL;
522
-
523
-
524
- /***/ }),
525
-
526
- /***/ 39340:
527
- /***/ ((__unused_webpack_module, exports) => {
528
-
529
-
530
-
531
- Object.defineProperty(exports, "__esModule", ({
532
- value: true
533
- }));
534
- exports.withPromise = exports.withCallback = void 0;
535
-
536
- /**
537
- * Open the input with a normal callback function
538
- *
539
- * @param {Input} input - input object
540
- * @param {function} valueMapper - function which maps the resulting id and value back to the expected format
541
- * @param {function} callback - callback function
542
- */
543
- const withCallback = (input, valueMapper, callback) => {
544
- input.open();
545
- input.onSelect((id, value) => callback(valueMapper(id, value)));
546
- };
547
- /**
548
- * Open the input with a promise
549
- *
550
- * @param {Input} input - input object
551
- * @param {function} valueMapper - function which maps the resulting id and value back to the expected format
552
- */
553
-
554
-
555
- exports.withCallback = withCallback;
556
-
557
- const withPromise = (input, valueMapper) => {
558
- return new Promise((resolve, reject) => {
559
- input.open();
560
- input.onSelect((id, value) => {
561
- if (id === null) {
562
- reject();
563
- } else {
564
- resolve(valueMapper(id, value));
565
- }
566
- });
567
- });
568
- };
569
-
570
- exports.withPromise = withPromise;
571
-
572
- /***/ }),
573
-
574
- /***/ 99398:
575
- /***/ ((module, exports, __webpack_require__) => {
576
-
577
-
578
-
579
- Object.defineProperty(exports, "__esModule", ({
580
- value: true
581
- }));
582
- exports["default"] = void 0;
583
-
584
- var _input = _interopRequireDefault(__webpack_require__(25730));
585
-
586
- var _renderer = _interopRequireDefault(__webpack_require__(16059));
587
-
588
- var _callbackMappers = __webpack_require__(39340);
589
-
590
- var _valueMappers = __webpack_require__(26730);
591
-
592
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
593
-
594
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
595
-
596
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
597
-
598
- /**
599
- * Default options
600
- */
601
- const defaultOptions = {
602
- outputStream: process.stdout,
603
- inputStream: process.stdin,
604
- values: [],
605
- defaultValue: 0,
606
- selected: '(x)',
607
- unselected: '( )',
608
- indentation: 0,
609
- cleanup: true,
610
- valueRenderer: value => value
611
- };
612
- /**
613
- * Create an instance of cli-select with the given options
614
- *
615
- * @param {object} options - options for cli-select
616
- * @param {function} callback - if specified, a callback will be used, otherwise a promise gets returned (optional)
617
- */
618
-
619
- const creator = (options, callback) => {
620
- // merge options with default options
621
- options = _objectSpread({}, defaultOptions, options); // create renderer and input instances
622
-
623
- const renderer = new _renderer.default(options, options.outputStream);
624
- const input = new _input.default(options.inputStream);
625
- input.setDefaultValue(options.defaultValue);
626
- input.attachRenderer(renderer); // handle array and object values
627
-
628
- let valueMapper;
629
-
630
- if (Array.isArray(options.values)) {
631
- valueMapper = (0, _valueMappers.withArrayValues)(options);
632
- } else {
633
- valueMapper = (0, _valueMappers.withObjectValues)(options);
634
- } // map values
635
-
636
-
637
- options.values = valueMapper.input;
638
- input.setValues(options.values); // handle different callback methods
639
-
640
- if (typeof callback === 'function') {
641
- return (0, _callbackMappers.withCallback)(input, valueMapper.output, callback);
642
- } else {
643
- return (0, _callbackMappers.withPromise)(input, valueMapper.output);
644
- }
645
- };
646
-
647
- exports = module.exports = creator;
648
- Object.defineProperty(exports, "__esModule", ({
649
- value: true
650
- }));
651
- var _default = creator;
652
- exports["default"] = _default;
653
-
654
- /***/ }),
655
-
656
- /***/ 25730:
657
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
658
-
659
-
660
-
661
- Object.defineProperty(exports, "__esModule", ({
662
- value: true
663
- }));
664
- exports["default"] = void 0;
665
-
666
- var _readline = _interopRequireDefault(__webpack_require__(14521));
667
-
668
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
669
-
670
- /**
671
- * Handle cli input
672
- */
673
- class Input {
674
- /**
675
- * Input constructor
676
- *
677
- * @param {any} stream - stream to catch (optional)
678
- */
679
- constructor(stream = process.stdin) {
680
- // set default values
681
- this.stream = stream;
682
- this.values = [];
683
- this.selectedValue = 0;
684
-
685
- this.onSelectListener = () => {};
686
-
687
- this.onKeyPress = this.onKeyPress.bind(this);
688
- }
689
- /**
690
- * Set the available values
691
- *
692
- * @param {array} values - all available values
693
- */
694
-
695
-
696
- setValues(values) {
697
- this.values = values;
698
-
699
- if (this.renderer) {
700
- this.renderer.setValues(values);
701
- }
702
- }
703
- /**
704
- * Set the default value
705
- *
706
- * @param {number} defaultValue - default value id
707
- */
708
-
709
-
710
- setDefaultValue(defaultValue) {
711
- this.selectedValue = defaultValue;
712
- }
713
- /**
714
- * Attach a renderer to the input catcher
715
- *
716
- * @param {Renderer} renderer - renderer to use for rendering responses
717
- */
718
-
719
-
720
- attachRenderer(renderer) {
721
- this.renderer = renderer;
722
- this.renderer.setValues(this.values);
723
- }
724
- /**
725
- * Register an on select listener
726
- *
727
- * @param {function} listener - listener function which receives two parameters: valueId and value
728
- */
729
-
730
-
731
- onSelect(listener) {
732
- this.onSelectListener = listener;
733
- }
734
- /**
735
- * Open the stream and listen for input
736
- */
737
-
738
-
739
- open() {
740
- // register keypress event
741
- _readline.default.emitKeypressEvents(this.stream); // handle keypress
742
-
743
-
744
- this.stream.on('keypress', this.onKeyPress); // initially render the response
745
-
746
- if (this.renderer) {
747
- this.renderer.render(this.selectedValue);
748
- } // hide pressed keys and start listening on input
749
-
750
-
751
- this.stream.setRawMode(true);
752
- this.stream.resume();
753
- }
754
- /**
755
- * Close the stream
756
- *
757
- * @param {boolean} cancelled - true if no value was selected (optional)
758
- */
759
-
760
-
761
- close(cancelled = false) {
762
- // reset stream properties
763
- this.stream.setRawMode(false);
764
- this.stream.pause(); // cleanup the output
765
-
766
- if (this.renderer) {
767
- this.renderer.cleanup();
768
- } // call the on select listener
769
-
770
-
771
- if (cancelled) {
772
- this.onSelectListener(null);
773
- } else {
774
- this.onSelectListener(this.selectedValue, this.values[this.selectedValue]);
775
- }
776
-
777
- this.stream.removeListener('keypress', this.onKeyPress);
778
- }
779
- /**
780
- * Render the response
781
- */
782
-
783
-
784
- render() {
785
- if (!this.renderer) {
786
- return;
171
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
172
+ recursive: true
173
+ });
174
+ const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
175
+ 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);
787
176
  }
788
-
789
- this.renderer.render(this.selectedValue);
790
- }
791
- /**
792
- * Handle key press event
793
- *
794
- * @param {string} string - input string
795
- * @param {object} key - object containing information about the pressed key
796
- */
797
-
798
-
799
- onKeyPress(string, key) {
800
- if (key) {
801
- if (key.name === 'up' && this.selectedValue > 0) {
802
- this.selectedValue--;
803
- this.render();
804
- } else if (key.name === 'down' && this.selectedValue + 1 < this.values.length) {
805
- this.selectedValue++;
806
- this.render();
807
- } else if (key.name === 'return') {
808
- this.close();
809
- } else if (key.name === 'escape' || key.name === 'c' && key.ctrl) {
810
- this.close(true);
811
- }
177
+ if (isTargetSameAsSource) {
178
+ (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
179
+ fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
812
180
  }
813
- }
814
-
815
- }
816
-
817
- exports["default"] = Input;
818
-
819
- /***/ }),
820
-
821
- /***/ 16059:
822
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
823
-
824
-
825
-
826
- Object.defineProperty(exports, "__esModule", ({
827
- value: true
828
- }));
829
- exports["default"] = void 0;
830
-
831
- var _readline = _interopRequireDefault(__webpack_require__(14521));
832
-
833
- var _ansiEscapes = __webpack_require__(18512);
834
-
835
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
836
-
837
- /**
838
- * Response renderer
839
- */
840
- class Renderer {
841
- /**
842
- * Renderer constructor
843
- *
844
- * @param {object} options - renderer options
845
- * @param {any} stream - stream to write to (optional)
846
- */
847
- constructor(options, stream = process.stdout) {
848
- this.options = options;
849
- this.stream = stream;
850
- this.values = [];
851
- this.initialRender = true;
852
- }
853
- /**
854
- * Set the available values
855
- *
856
- * @param {array} values - all available values
857
- */
858
-
859
-
860
- setValues(values) {
861
- this.values = values;
862
- }
863
- /**
864
- * Render the values
865
- *
866
- * @param {number} selectedValue - selected value (optional)
867
- */
868
-
869
-
870
- render(selectedValue = 0) {
871
- if (this.initialRender) {
872
- // hide the cursor initially
873
- this.initialRender = false;
874
- this.stream.write(_ansiEscapes.cursorHide);
875
- } else {
876
- // remove previous lines and values
877
- this.stream.write((0, _ansiEscapes.eraseLines)(this.values.length));
878
- } // output the current values
879
-
880
-
881
- this.values.forEach((value, index) => {
882
- const symbol = selectedValue === index ? this.options.selected : this.options.unselected;
883
- const indentation = ' '.repeat(this.options.indentation);
884
- const renderedValue = this.options.valueRenderer(value, selectedValue === index);
885
- const end = index !== this.values.length - 1 ? '\n' : '';
886
- this.stream.write(indentation + symbol + ' ' + renderedValue + end);
887
- });
888
- }
889
- /**
890
- * Cleanup the console at the end
891
- */
892
-
893
-
894
- cleanup() {
895
- this.stream.write((0, _ansiEscapes.eraseLines)(this.values.length));
896
- this.stream.write(_ansiEscapes.cursorShow);
897
- }
898
-
899
181
  }
900
-
901
- exports["default"] = Renderer;
902
-
903
- /***/ }),
904
-
905
- /***/ 26730:
906
- /***/ ((__unused_webpack_module, exports) => {
907
-
908
-
909
-
910
- Object.defineProperty(exports, "__esModule", ({
911
- value: true
912
- }));
913
- exports.withObjectValues = exports.withArrayValues = void 0;
914
-
915
- /**
916
- * Map incoming and outgoing values if the initial values are an array
917
- *
918
- * @param {object} options - cli-select options
919
- */
920
- const withArrayValues = options => {
921
- return {
922
- input: options.values,
923
- output: (id, value) => {
924
- return {
925
- id,
926
- value
927
- };
928
- }
929
- };
930
- };
931
- /**
932
- * Map incoming and outgoing values if the initial values are an object
933
- *
934
- * @param {object} options - cli-select options
935
- */
936
-
937
-
938
- exports.withArrayValues = withArrayValues;
939
-
940
- const withObjectValues = options => {
941
- const originalValues = options.values;
942
- return {
943
- input: Object.values(originalValues),
944
- output: (id, value) => {
945
- return {
946
- id: Object.keys(originalValues)[id],
947
- value
948
- };
949
- }
950
- };
951
- };
952
-
953
- exports.withObjectValues = withObjectValues;
182
+ //# sourceMappingURL=transformCodebase.js.map
954
183
 
955
184
  /***/ })
956
185