keycloakify 11.6.2 → 11.7.1

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 (72) hide show
  1. package/README.md +1 -1
  2. package/bin/{735.index.js → 288.index.js} +226 -360
  3. package/bin/313.index.js +377 -0
  4. package/bin/{174.index.js → 33.index.js} +37 -2
  5. package/bin/{840.index.js → 355.index.js} +348 -97
  6. package/bin/363.index.js +157 -145
  7. package/bin/453.index.js +5 -41
  8. package/bin/{503.index.js → 678.index.js} +577 -53
  9. package/bin/{921.index.js → 780.index.js} +54 -45
  10. package/bin/880.index.js +206 -21
  11. package/bin/9.index.js +850 -0
  12. package/bin/{525.index.js → 911.index.js} +1302 -2
  13. package/bin/930.index.js +3 -4
  14. package/bin/{153.index.js → 947.index.js} +22 -797
  15. package/bin/main.js +11 -10
  16. package/bin/shared/initializeSpa/index.d.ts +1 -0
  17. package/bin/shared/initializeSpa/initializeSpa.d.ts +9 -0
  18. package/bin/tools/getInstalledModuleDirPath.d.ts +0 -1
  19. package/bin/tools/isRootPath.d.ts +1 -0
  20. package/bin/tools/listInstalledModules.d.ts +0 -1
  21. package/package.json +22 -44
  22. package/src/bin/eject-page.ts +7 -81
  23. package/src/bin/initialize-account-theme/initialize-account-theme.ts +15 -14
  24. package/src/bin/initialize-admin-theme.ts +17 -124
  25. package/src/bin/initialize-email-theme.ts +10 -34
  26. package/src/bin/keycloakify/generateResources/generateResources.ts +49 -21
  27. package/src/bin/main.ts +5 -4
  28. package/src/bin/own.ts +1 -2
  29. package/src/bin/shared/{addSyncExtensionsToPostinstallScript.ts → initializeSpa/addSyncExtensionsToPostinstallScript.ts} +2 -2
  30. package/src/bin/shared/initializeSpa/index.ts +1 -0
  31. package/src/bin/shared/initializeSpa/initializeSpa.ts +149 -0
  32. package/src/bin/sync-extensions/extensionModuleMeta.ts +0 -1
  33. package/src/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts +4 -1
  34. package/src/bin/tools/getInstalledModuleDirPath.ts +24 -22
  35. package/src/bin/tools/isRootPath.ts +22 -0
  36. package/src/bin/tools/listInstalledModules.ts +2 -4
  37. package/src/bin/tsconfig.json +1 -1
  38. package/bin/375.index.js +0 -4089
  39. package/bin/490.index.js +0 -1108
  40. package/bin/568.index.js +0 -1867
  41. package/bin/743.index.js +0 -69
  42. package/bin/initialize-account-theme/copyBoilerplate.d.ts +0 -4
  43. package/bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts +0 -3
  44. package/bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts +0 -11
  45. package/bin/shared/getLatestsSemVersionedTag.d.ts +0 -15
  46. package/bin/shared/promptKeycloakVersion.d.ts +0 -10
  47. package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
  48. package/bin/tools/crc32.d.ts +0 -9
  49. package/bin/tools/deflate.d.ts +0 -24
  50. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -15
  51. package/bin/tools/octokit-addons/listTags.d.ts +0 -13
  52. package/bin/tools/tee.d.ts +0 -3
  53. package/bin/tools/trimIndent.d.ts +0 -5
  54. package/src/bin/initialize-account-theme/copyBoilerplate.ts +0 -32
  55. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +0 -21
  56. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +0 -142
  57. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +0 -7
  58. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +0 -11
  59. package/src/bin/shared/getLatestsSemVersionedTag.ts +0 -201
  60. package/src/bin/shared/promptKeycloakVersion.ts +0 -72
  61. package/src/bin/tools/OptionalIfCanBeUndefined.ts +0 -12
  62. package/src/bin/tools/crc32.ts +0 -73
  63. package/src/bin/tools/deflate.ts +0 -61
  64. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +0 -47
  65. package/src/bin/tools/octokit-addons/listTags.ts +0 -60
  66. package/src/bin/tools/tee.ts +0 -39
  67. package/src/bin/tools/trimIndent.ts +0 -49
  68. /package/bin/shared/{addSyncExtensionsToPostinstallScript.d.ts → initializeSpa/addSyncExtensionsToPostinstallScript.d.ts} +0 -0
  69. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcContext.ts +0 -0
  70. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPage.tsx +0 -0
  71. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPageStory.tsx +0 -0
  72. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/i18n.ts +0 -0
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 921;
3
- exports.ids = [921,786];
2
+ exports.id = 780;
3
+ exports.ids = [780,786];
4
4
  exports.modules = {
5
5
 
6
- /***/ 21921:
6
+ /***/ 75780:
7
7
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
8
 
9
9
  // ESM COMPAT FLAG
@@ -85,38 +85,10 @@ function updateAccountThemeImplementationInConfig(params) {
85
85
  var update_kc_gen = __webpack_require__(10786);
86
86
  // EXTERNAL MODULE: ./dist/bin/shared/customHandler_delegate.js + 1 modules
87
87
  var customHandler_delegate = __webpack_require__(72138);
88
- // EXTERNAL MODULE: external "child_process"
89
- var external_child_process_ = __webpack_require__(32081);
90
- var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
91
- ;// CONCATENATED MODULE: ./dist/bin/shared/exitIfUncommittedChanges.js
92
-
93
-
94
- function exitIfUncommittedChanges(params) {
95
- const { projectDirPath } = params;
96
- let hasUncommittedChanges = undefined;
97
- try {
98
- hasUncommittedChanges =
99
- external_child_process_default().execSync(`git status --porcelain`, {
100
- cwd: projectDirPath
101
- })
102
- .toString()
103
- .trim() !== "";
104
- }
105
- catch (_a) {
106
- // Probably not a git repository
107
- return;
108
- }
109
- if (!hasUncommittedChanges) {
110
- return;
111
- }
112
- console.warn([
113
- source_default().red("Please commit or stash your changes before running this command.\n"),
114
- "This command will modify your project's files so it's better to have a clean working directory",
115
- "so that you can easily see what has been changed and revert if needed."
116
- ].join(" "));
117
- process.exit(-1);
118
- }
119
- //# sourceMappingURL=exitIfUncommittedChanges.js.map
88
+ // EXTERNAL MODULE: ./dist/bin/shared/exitIfUncommittedChanges.js
89
+ var exitIfUncommittedChanges = __webpack_require__(22058);
90
+ // EXTERNAL MODULE: ./dist/bin/tools/getThisCodebaseRootDirPath.js
91
+ var getThisCodebaseRootDirPath = __webpack_require__(58822);
120
92
  ;// CONCATENATED MODULE: ./dist/bin/initialize-account-theme/initialize-account-theme.js
121
93
 
122
94
 
@@ -126,6 +98,7 @@ function exitIfUncommittedChanges(params) {
126
98
 
127
99
 
128
100
 
101
+
129
102
  async function command(params) {
130
103
  const { buildContext } = params;
131
104
  const { hasBeenHandled } = (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
@@ -141,7 +114,7 @@ async function command(params) {
141
114
  console.warn(source_default().red(`There is already a ${(0,external_path_.relative)(process.cwd(), accountThemeSrcDirPath)} directory in your project. Aborting.`));
142
115
  process.exit(-1);
143
116
  }
144
- exitIfUncommittedChanges({
117
+ (0,exitIfUncommittedChanges/* exitIfUncommittedChanges */.l)({
145
118
  projectDirPath: buildContext.projectDirPath
146
119
  });
147
120
  const { value: accountThemeType } = await dist_default()({
@@ -151,18 +124,13 @@ async function command(params) {
151
124
  });
152
125
  switch (accountThemeType) {
153
126
  case "Multi-Page":
154
- {
155
- const { initializeAccountTheme_multiPage } = await __webpack_require__.e(/* import() */ 743).then(__webpack_require__.bind(__webpack_require__, 22743));
156
- await initializeAccountTheme_multiPage({
157
- accountThemeSrcDirPath
158
- });
159
- }
127
+ external_fs_.cpSync((0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "src", "bin", "initialize-account-theme", "multi-page-boilerplate"), accountThemeSrcDirPath, { recursive: true });
160
128
  break;
161
129
  case "Single-Page":
162
130
  {
163
- const { initializeAccountTheme_singlePage } = await Promise.all(/* import() */[__webpack_require__.e(174), __webpack_require__.e(525), __webpack_require__.e(375), __webpack_require__.e(735)]).then(__webpack_require__.bind(__webpack_require__, 84735));
164
- await initializeAccountTheme_singlePage({
165
- accountThemeSrcDirPath,
131
+ const { initializeSpa } = await __webpack_require__.e(/* import() */ 288).then(__webpack_require__.bind(__webpack_require__, 27288));
132
+ await initializeSpa({
133
+ themeType: "account",
166
134
  buildContext
167
135
  });
168
136
  }
@@ -256,6 +224,47 @@ function maybeDelegateCommandToCustomHandler(params) {
256
224
 
257
225
  /***/ }),
258
226
 
227
+ /***/ 22058:
228
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
229
+
230
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
231
+ /* harmony export */ "l": () => (/* binding */ exitIfUncommittedChanges)
232
+ /* harmony export */ });
233
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32081);
234
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_0__);
235
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78818);
236
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__);
237
+
238
+
239
+ function exitIfUncommittedChanges(params) {
240
+ const { projectDirPath } = params;
241
+ let hasUncommittedChanges = undefined;
242
+ try {
243
+ hasUncommittedChanges =
244
+ child_process__WEBPACK_IMPORTED_MODULE_0___default().execSync(`git status --porcelain`, {
245
+ cwd: projectDirPath
246
+ })
247
+ .toString()
248
+ .trim() !== "";
249
+ }
250
+ catch (_a) {
251
+ // Probably not a git repository
252
+ return;
253
+ }
254
+ if (!hasUncommittedChanges) {
255
+ return;
256
+ }
257
+ console.warn([
258
+ chalk__WEBPACK_IMPORTED_MODULE_1___default().red("Please commit or stash your changes before running this command.\n"),
259
+ "This command will modify your project's files so it's better to have a clean working directory",
260
+ "so that you can easily see what has been changed and revert if needed."
261
+ ].join(" "));
262
+ process.exit(-1);
263
+ }
264
+ //# sourceMappingURL=exitIfUncommittedChanges.js.map
265
+
266
+ /***/ }),
267
+
259
268
  /***/ 43765:
260
269
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
261
270
 
package/bin/880.index.js CHANGED
@@ -782,9 +782,6 @@ function writeMetaInfKeycloakThemes(params) {
782
782
  var objectEntries = __webpack_require__(91040);
783
783
  // EXTERNAL MODULE: ./dist/bin/tools/escapeStringForPropertiesFile.js
784
784
  var escapeStringForPropertiesFile = __webpack_require__(27190);
785
- // EXTERNAL MODULE: external "child_process"
786
- var external_child_process_ = __webpack_require__(32081);
787
- var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
788
785
  // EXTERNAL MODULE: ./node_modules/properties-parser/index.js
789
786
  var properties_parser = __webpack_require__(44414);
790
787
  var properties_parser_default = /*#__PURE__*/__webpack_require__.n(properties_parser);
@@ -848,6 +845,8 @@ function createObjectWithSomePropertiesThatThrowIfAccessed(obj, debugMessage) {
848
845
  })));
849
846
  }
850
847
  //# sourceMappingURL=createObjectThatThrowsIfAccessed.js.map
848
+ // EXTERNAL MODULE: ./dist/bin/tools/listInstalledModules.js
849
+ var listInstalledModules = __webpack_require__(75564);
851
850
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateResources/generateResources.js
852
851
 
853
852
 
@@ -997,9 +996,9 @@ async function generateResources(params) {
997
996
  external_fs_default().writeFileSync((0,external_path_.join)(themeTypeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
998
997
  });
999
998
  let languageTags = undefined;
1000
- i18n_messages_generation: {
999
+ i18n_multi_page: {
1001
1000
  if (isSpa) {
1002
- break i18n_messages_generation;
1001
+ break i18n_multi_page;
1003
1002
  }
1004
1003
  (0,assert/* assert */.h)(themeType !== "admin");
1005
1004
  const wrap = (0,generateMessageProperties/* generateMessageProperties */.k)({
@@ -1011,22 +1010,37 @@ async function generateResources(params) {
1011
1010
  writeMessagePropertiesFilesByThemeType[themeType] =
1012
1011
  writeMessagePropertiesFiles;
1013
1012
  }
1014
- bring_in_account_spa_messages: {
1013
+ let isLegacyAccountSpa = false;
1014
+ // NOTE: Eventually remove this block.
1015
+ i18n_single_page_account_legacy: {
1015
1016
  if (!isSpa) {
1016
- break bring_in_account_spa_messages;
1017
+ break i18n_single_page_account_legacy;
1017
1018
  }
1018
1019
  if (themeType !== "account") {
1019
- break bring_in_account_spa_messages;
1020
+ break i18n_single_page_account_legacy;
1020
1021
  }
1021
- const accountUiDirPath = external_child_process_.execSync(`npm list @keycloakify/keycloak-account-ui --parseable`, {
1022
- cwd: (0,external_path_.dirname)(buildContext.packageJsonFilePath)
1023
- })
1024
- .toString("utf8")
1025
- .trim();
1026
- const messageDirPath_defaults = (0,external_path_.join)(accountUiDirPath, "messages");
1022
+ const [moduleMeta] = await (0,listInstalledModules/* listInstalledModules */.P)({
1023
+ packageJsonFilePath: buildContext.packageJsonFilePath,
1024
+ filter: ({ moduleName }) => moduleName === "@keycloakify/keycloak-account-ui"
1025
+ });
1026
+ (0,assert/* assert */.h)(moduleMeta !== undefined, `@keycloakify/keycloak-account-ui is supposed to be installed`);
1027
+ {
1028
+ const [majorStr] = moduleMeta.version.split(".");
1029
+ if (majorStr.length === 6) {
1030
+ // NOTE: Now we use the format MMmmpp (Major, minor, patch) for example for
1031
+ // 26.0.7 it would be 260007.
1032
+ break i18n_single_page_account_legacy;
1033
+ }
1034
+ else {
1035
+ // 25.0.4-rc.5 or later
1036
+ isLegacyAccountSpa = true;
1037
+ }
1038
+ }
1039
+ const messageDirPath_defaults = (0,external_path_.join)(moduleMeta.dirPath, "messages");
1027
1040
  if (!external_fs_default().existsSync(messageDirPath_defaults)) {
1028
1041
  throw new Error(`Please update @keycloakify/keycloak-account-ui to 25.0.4-rc.5 or later.`);
1029
1042
  }
1043
+ isLegacyAccountSpa = true;
1030
1044
  const messagesDirPath_dest = (0,external_path_.join)(getThemeTypeDirPath({ themeName, themeType: "account" }), "messages");
1031
1045
  (0,transformCodebase/* transformCodebase */.N)({
1032
1046
  srcDirPath: messageDirPath_defaults,
@@ -1056,11 +1070,15 @@ async function generateResources(params) {
1056
1070
  languageTags = external_fs_default().readdirSync(messagesDirPath_dest)
1057
1071
  .map(basename => basename.replace(/^messages_/, "").replace(/\.properties$/, ""));
1058
1072
  }
1059
- bring_in_admin_messages: {
1060
- if (themeType !== "admin") {
1061
- break bring_in_admin_messages;
1073
+ i18n_single_page: {
1074
+ if (!isSpa) {
1075
+ break i18n_single_page;
1076
+ }
1077
+ if (isLegacyAccountSpa) {
1078
+ break i18n_single_page;
1062
1079
  }
1063
- const messagesDirPath_theme = (0,external_path_.join)(buildContext.themeSrcDirPath, "admin", "i18n");
1080
+ (0,assert/* assert */.h)(themeType === "account" || themeType === "admin");
1081
+ const messagesDirPath_theme = (0,external_path_.join)(buildContext.themeSrcDirPath, themeType, "i18n");
1064
1082
  (0,assert/* assert */.h)(external_fs_default().existsSync(messagesDirPath_theme), `${messagesDirPath_theme} is supposed to exist`);
1065
1083
  const propertiesByLang = {};
1066
1084
  external_fs_default().readdirSync(messagesDirPath_theme).forEach(basename => {
@@ -1100,7 +1118,7 @@ async function generateResources(params) {
1100
1118
  }
1101
1119
  (_a = propertiesByLang[_b = parsedBasename.lang]) !== null && _a !== void 0 ? _a : (propertiesByLang[_b] = {
1102
1120
  base: createObjectThatThrowsIfAccessed({
1103
- debugMessage: `No base ${parsedBasename.lang} translation for admin theme`
1121
+ debugMessage: `No base ${parsedBasename.lang} translation for ${themeType} theme`
1104
1122
  }),
1105
1123
  override: undefined,
1106
1124
  overrideByThemeName: {}
@@ -1116,12 +1134,12 @@ async function generateResources(params) {
1116
1134
  }
1117
1135
  propertiesByLang[parsedBasename.lang].overrideByThemeName[parsedBasename.themeName] = buffer;
1118
1136
  });
1119
- writeMessagePropertiesFilesByThemeType.admin = ({ messageDirPath, themeName }) => {
1137
+ languageTags = Object.keys(propertiesByLang);
1138
+ writeMessagePropertiesFilesByThemeType[themeType] = ({ messageDirPath, themeName }) => {
1120
1139
  if (!external_fs_default().existsSync(messageDirPath)) {
1121
1140
  external_fs_default().mkdirSync(messageDirPath, { recursive: true });
1122
1141
  }
1123
1142
  Object.entries(propertiesByLang).forEach(([lang, { base, override, overrideByThemeName }]) => {
1124
- (languageTags !== null && languageTags !== void 0 ? languageTags : (languageTags = [])).push(lang);
1125
1143
  const messages = properties_parser_default().parse(base.toString("utf8"));
1126
1144
  if (override !== undefined) {
1127
1145
  const overrideMessages = properties_parser_default().parse(override.toString("utf8"));
@@ -1287,6 +1305,9 @@ async function generateResources(params) {
1287
1305
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateResources/index.js
1288
1306
 
1289
1307
  //# sourceMappingURL=index.js.map
1308
+ // EXTERNAL MODULE: external "child_process"
1309
+ var external_child_process_ = __webpack_require__(32081);
1310
+ var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
1290
1311
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/extensionVersions.js
1291
1312
  // NOTE: v0.5 is a dummy version.
1292
1313
  const keycloakAccountV1Versions = [null, "0.3", "0.4", "0.6"];
@@ -1904,6 +1925,82 @@ function rmSync(dirPath, options) {
1904
1925
 
1905
1926
  /***/ }),
1906
1927
 
1928
+ /***/ 93721:
1929
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1930
+
1931
+
1932
+ // EXPORTS
1933
+ __webpack_require__.d(__webpack_exports__, {
1934
+ "p": () => (/* binding */ getInstalledModuleDirPath)
1935
+ });
1936
+
1937
+ // EXTERNAL MODULE: external "path"
1938
+ var external_path_ = __webpack_require__(71017);
1939
+ // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
1940
+ var fs_existsAsync = __webpack_require__(43765);
1941
+ // EXTERNAL MODULE: external "child_process"
1942
+ var external_child_process_ = __webpack_require__(32081);
1943
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
1944
+ var assert = __webpack_require__(29041);
1945
+ ;// CONCATENATED MODULE: ./dist/bin/tools/isRootPath.js
1946
+
1947
+ function getIsRootPath(filePath) {
1948
+ const path_normalized = (0,external_path_.normalize)(filePath);
1949
+ // Unix-like root ("/")
1950
+ if (path_normalized === "/") {
1951
+ return true;
1952
+ }
1953
+ // Check for Windows drive root (e.g., "C:\\")
1954
+ if (/^[a-zA-Z]:\\$/.test(path_normalized)) {
1955
+ return true;
1956
+ }
1957
+ // Check for UNC root (e.g., "\\server\share")
1958
+ if (/^\\\\[^\\]+\\[^\\]+\\?$/.test(path_normalized)) {
1959
+ return true;
1960
+ }
1961
+ return false;
1962
+ }
1963
+ //# sourceMappingURL=isRootPath.js.map
1964
+ ;// CONCATENATED MODULE: ./dist/bin/tools/getInstalledModuleDirPath.js
1965
+
1966
+
1967
+
1968
+
1969
+
1970
+ async function getInstalledModuleDirPath(params) {
1971
+ const { moduleName, packageJsonDirPath } = params;
1972
+ {
1973
+ let dirPath = packageJsonDirPath;
1974
+ while (true) {
1975
+ const dirPath_candidate = (0,external_path_.join)(dirPath, "node_modules", ...moduleName.split("/"));
1976
+ let doesExist;
1977
+ try {
1978
+ doesExist = await (0,fs_existsAsync/* existsAsync */.o)(dirPath_candidate);
1979
+ }
1980
+ catch (_a) {
1981
+ doesExist = false;
1982
+ }
1983
+ if (doesExist) {
1984
+ return dirPath_candidate;
1985
+ }
1986
+ if (getIsRootPath(dirPath)) {
1987
+ break;
1988
+ }
1989
+ dirPath = (0,external_path_.join)(dirPath, "..");
1990
+ }
1991
+ }
1992
+ const dirPath = external_child_process_.execSync(`npm list ${moduleName}`, {
1993
+ cwd: packageJsonDirPath
1994
+ })
1995
+ .toString("utf8")
1996
+ .trim();
1997
+ (0,assert/* assert */.h)(dirPath !== "");
1998
+ return dirPath;
1999
+ }
2000
+ //# sourceMappingURL=getInstalledModuleDirPath.js.map
2001
+
2002
+ /***/ }),
2003
+
1907
2004
  /***/ 90665:
1908
2005
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1909
2006
 
@@ -1921,6 +2018,94 @@ function isInside(params) {
1921
2018
 
1922
2019
  /***/ }),
1923
2020
 
2021
+ /***/ 75564:
2022
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2023
+
2024
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2025
+ /* harmony export */ "P": () => (/* binding */ listInstalledModules)
2026
+ /* harmony export */ });
2027
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29041);
2028
+ /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38469);
2029
+ /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52300);
2030
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
2031
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
2032
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73292);
2033
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_2__);
2034
+ /* harmony import */ var _tools_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93721);
2035
+ /* harmony import */ var tsafe_exclude__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83101);
2036
+
2037
+
2038
+
2039
+
2040
+
2041
+
2042
+
2043
+ async function listInstalledModules(params) {
2044
+ const { packageJsonFilePath, filter } = params;
2045
+ const parsedPackageJson = await readPackageJsonDependencies({
2046
+ packageJsonFilePath
2047
+ });
2048
+ const extensionModuleNames = [parsedPackageJson.dependencies, parsedPackageJson.devDependencies]
2049
+ .filter((0,tsafe_exclude__WEBPACK_IMPORTED_MODULE_4__/* .exclude */ .D)(undefined))
2050
+ .map(obj => Object.keys(obj))
2051
+ .flat()
2052
+ .filter(moduleName => filter({ moduleName }));
2053
+ const result = await Promise.all(extensionModuleNames.map(async (moduleName) => {
2054
+ const dirPath = await (0,_tools_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getInstalledModuleDirPath */ .p)({
2055
+ moduleName,
2056
+ packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(packageJsonFilePath)
2057
+ });
2058
+ const { version, peerDependencies } = await readPackageJsonVersionAndPeerDependencies({
2059
+ packageJsonFilePath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, "package.json")
2060
+ });
2061
+ return { moduleName, version, peerDependencies, dirPath };
2062
+ }));
2063
+ return result;
2064
+ }
2065
+ const { readPackageJsonDependencies } = (() => {
2066
+ const zParsedPackageJson = (() => {
2067
+ const zTargetType = zod__WEBPACK_IMPORTED_MODULE_5__.z.object({
2068
+ dependencies: zod__WEBPACK_IMPORTED_MODULE_5__.z.record(zod__WEBPACK_IMPORTED_MODULE_5__.z.string()).optional(),
2069
+ devDependencies: zod__WEBPACK_IMPORTED_MODULE_5__.z.record(zod__WEBPACK_IMPORTED_MODULE_5__.z.string()).optional()
2070
+ });
2071
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .h)();
2072
+ return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_6__.id)(zTargetType);
2073
+ })();
2074
+ async function readPackageJsonDependencies(params) {
2075
+ const { packageJsonFilePath } = params;
2076
+ const parsedPackageJson = JSON.parse((await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(packageJsonFilePath)).toString("utf8"));
2077
+ zParsedPackageJson.parse(parsedPackageJson);
2078
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__.is)(parsedPackageJson));
2079
+ return parsedPackageJson;
2080
+ }
2081
+ return { readPackageJsonDependencies };
2082
+ })();
2083
+ const { readPackageJsonVersionAndPeerDependencies } = (() => {
2084
+ const zParsedPackageJson = (() => {
2085
+ const zTargetType = zod__WEBPACK_IMPORTED_MODULE_5__.z.object({
2086
+ version: zod__WEBPACK_IMPORTED_MODULE_5__.z.string(),
2087
+ peerDependencies: zod__WEBPACK_IMPORTED_MODULE_5__.z.record(zod__WEBPACK_IMPORTED_MODULE_5__.z.string()).optional()
2088
+ });
2089
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .h)();
2090
+ return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_6__.id)(zTargetType);
2091
+ })();
2092
+ async function readPackageJsonVersionAndPeerDependencies(params) {
2093
+ var _a;
2094
+ const { packageJsonFilePath } = params;
2095
+ const parsedPackageJson = JSON.parse((await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(packageJsonFilePath)).toString("utf8"));
2096
+ zParsedPackageJson.parse(parsedPackageJson);
2097
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__.is)(parsedPackageJson));
2098
+ return {
2099
+ version: parsedPackageJson.version,
2100
+ peerDependencies: (_a = parsedPackageJson.peerDependencies) !== null && _a !== void 0 ? _a : {}
2101
+ };
2102
+ }
2103
+ return { readPackageJsonVersionAndPeerDependencies };
2104
+ })();
2105
+ //# sourceMappingURL=listInstalledModules.js.map
2106
+
2107
+ /***/ }),
2108
+
1924
2109
  /***/ 60332:
1925
2110
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1926
2111