@intlayer/config 8.4.4 → 8.4.6

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 (227) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/built.cjs +7 -1
  3. package/dist/cjs/built.cjs.map +1 -1
  4. package/dist/cjs/client.cjs +16 -1
  5. package/dist/cjs/colors.cjs +33 -1
  6. package/dist/cjs/colors.cjs.map +1 -1
  7. package/dist/cjs/configFile/buildConfigurationFields.cjs +199 -1
  8. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  9. package/dist/cjs/configFile/configurationSchema.cjs +210 -1
  10. package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
  11. package/dist/cjs/configFile/getConfiguration.cjs +69 -1
  12. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  13. package/dist/cjs/configFile/index.cjs +28 -1
  14. package/dist/cjs/configFile/loadConfigurationFile.cjs +30 -1
  15. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  16. package/dist/cjs/configFile/searchConfigurationFile.cjs +53 -1
  17. package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
  18. package/dist/cjs/defaultValues/build.cjs +35 -1
  19. package/dist/cjs/defaultValues/build.cjs.map +1 -1
  20. package/dist/cjs/defaultValues/compiler.cjs +13 -1
  21. package/dist/cjs/defaultValues/compiler.cjs.map +1 -1
  22. package/dist/cjs/defaultValues/content.cjs +40 -1
  23. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  24. package/dist/cjs/defaultValues/dictionary.cjs +13 -1
  25. package/dist/cjs/defaultValues/dictionary.cjs.map +1 -1
  26. package/dist/cjs/defaultValues/editor.cjs +23 -1
  27. package/dist/cjs/defaultValues/editor.cjs.map +1 -1
  28. package/dist/cjs/defaultValues/index.cjs +66 -1
  29. package/dist/cjs/defaultValues/internationalization.cjs +15 -1
  30. package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
  31. package/dist/cjs/defaultValues/log.cjs +10 -1
  32. package/dist/cjs/defaultValues/log.cjs.map +1 -1
  33. package/dist/cjs/defaultValues/routing.cjs +19 -1
  34. package/dist/cjs/defaultValues/routing.cjs.map +1 -1
  35. package/dist/cjs/defaultValues/system.cjs +29 -1
  36. package/dist/cjs/defaultValues/system.cjs.map +1 -1
  37. package/dist/cjs/loadEnvFile.cjs +31 -1
  38. package/dist/cjs/loadEnvFile.cjs.map +1 -1
  39. package/dist/cjs/loadExternalFile/bundleFile.cjs +71 -1
  40. package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -1
  41. package/dist/cjs/loadExternalFile/bundleJSFile.cjs +33 -1
  42. package/dist/cjs/loadExternalFile/bundleJSFile.cjs.map +1 -1
  43. package/dist/cjs/loadExternalFile/index.cjs +17 -1
  44. package/dist/cjs/loadExternalFile/loadExternalFile.cjs +77 -1
  45. package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
  46. package/dist/cjs/loadExternalFile/parseFileContent.cjs +77 -1
  47. package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
  48. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +67 -1
  49. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
  50. package/dist/cjs/logger.cjs +133 -1
  51. package/dist/cjs/logger.cjs.map +1 -1
  52. package/dist/cjs/node.cjs +28 -1
  53. package/dist/cjs/utils/ESMxCJSHelpers.cjs +27 -1
  54. package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
  55. package/dist/cjs/utils/alias.cjs +29 -1
  56. package/dist/cjs/utils/alias.cjs.map +1 -1
  57. package/dist/cjs/utils/cacheDisk.cjs +173 -1
  58. package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
  59. package/dist/cjs/utils/cacheMemory.cjs +269 -1
  60. package/dist/cjs/utils/cacheMemory.cjs.map +1 -1
  61. package/dist/cjs/utils/clearModuleCache.cjs +26 -1
  62. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
  63. package/dist/cjs/utils/compareVersions.cjs +38 -1
  64. package/dist/cjs/utils/compareVersions.cjs.map +1 -1
  65. package/dist/cjs/utils/extractErrorMessage.cjs +95 -1
  66. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
  67. package/dist/cjs/utils/getExtension.cjs +14 -1
  68. package/dist/cjs/utils/getExtension.cjs.map +1 -1
  69. package/dist/cjs/utils/getPackageJsonPath.cjs +33 -1
  70. package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
  71. package/dist/cjs/utils/index.cjs +45 -1
  72. package/dist/cjs/utils/logStack.cjs +17 -1
  73. package/dist/cjs/utils/logStack.cjs.map +1 -1
  74. package/dist/cjs/utils/normalizePath.cjs +17 -1
  75. package/dist/cjs/utils/normalizePath.cjs.map +1 -1
  76. package/dist/cjs/utils/parseFilePathPattern.cjs +24 -1
  77. package/dist/cjs/utils/parseFilePathPattern.cjs.map +1 -1
  78. package/dist/cjs/utils/retryManager.cjs +45 -1
  79. package/dist/cjs/utils/retryManager.cjs.map +1 -1
  80. package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs +13 -1
  81. package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs.map +1 -1
  82. package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs +16 -1
  83. package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs.map +1 -1
  84. package/dist/cjs/utils/stringFormatter/index.cjs +10 -1
  85. package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs +14 -1
  86. package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs.map +1 -1
  87. package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs +19 -1
  88. package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs.map +1 -1
  89. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  90. package/dist/esm/built.mjs +7 -1
  91. package/dist/esm/built.mjs.map +1 -1
  92. package/dist/esm/client.mjs +9 -1
  93. package/dist/esm/colors.mjs +18 -1
  94. package/dist/esm/colors.mjs.map +1 -1
  95. package/dist/esm/configFile/buildConfigurationFields.mjs +197 -1
  96. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  97. package/dist/esm/configFile/configurationSchema.mjs +191 -1
  98. package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
  99. package/dist/esm/configFile/getConfiguration.mjs +66 -1
  100. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  101. package/dist/esm/configFile/index.mjs +6 -1
  102. package/dist/esm/configFile/loadConfigurationFile.mjs +29 -1
  103. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  104. package/dist/esm/configFile/searchConfigurationFile.mjs +50 -1
  105. package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
  106. package/dist/esm/defaultValues/build.mjs +28 -1
  107. package/dist/esm/defaultValues/build.mjs.map +1 -1
  108. package/dist/esm/defaultValues/compiler.mjs +8 -1
  109. package/dist/esm/defaultValues/compiler.mjs.map +1 -1
  110. package/dist/esm/defaultValues/content.mjs +32 -1
  111. package/dist/esm/defaultValues/content.mjs.map +1 -1
  112. package/dist/esm/defaultValues/dictionary.mjs +8 -1
  113. package/dist/esm/defaultValues/dictionary.mjs.map +1 -1
  114. package/dist/esm/defaultValues/editor.mjs +13 -1
  115. package/dist/esm/defaultValues/editor.mjs.map +1 -1
  116. package/dist/esm/defaultValues/index.mjs +11 -1
  117. package/dist/esm/defaultValues/internationalization.mjs +10 -1
  118. package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
  119. package/dist/esm/defaultValues/log.mjs +8 -1
  120. package/dist/esm/defaultValues/log.mjs.map +1 -1
  121. package/dist/esm/defaultValues/routing.mjs +11 -1
  122. package/dist/esm/defaultValues/routing.mjs.map +1 -1
  123. package/dist/esm/defaultValues/system.mjs +16 -1
  124. package/dist/esm/defaultValues/system.mjs.map +1 -1
  125. package/dist/esm/loadEnvFile.mjs +27 -1
  126. package/dist/esm/loadEnvFile.mjs.map +1 -1
  127. package/dist/esm/loadExternalFile/bundleFile.mjs +67 -1
  128. package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -1
  129. package/dist/esm/loadExternalFile/bundleJSFile.mjs +31 -1
  130. package/dist/esm/loadExternalFile/bundleJSFile.mjs.map +1 -1
  131. package/dist/esm/loadExternalFile/index.mjs +7 -1
  132. package/dist/esm/loadExternalFile/loadExternalFile.mjs +73 -1
  133. package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
  134. package/dist/esm/loadExternalFile/parseFileContent.mjs +73 -1
  135. package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
  136. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +64 -1
  137. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
  138. package/dist/esm/logger.mjs +118 -1
  139. package/dist/esm/logger.mjs.map +1 -1
  140. package/dist/esm/node.mjs +6 -1
  141. package/dist/esm/utils/ESMxCJSHelpers.mjs +25 -1
  142. package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -0
  143. package/dist/esm/utils/alias.mjs +27 -1
  144. package/dist/esm/utils/alias.mjs.map +1 -1
  145. package/dist/esm/utils/cacheDisk.mjs +170 -1
  146. package/dist/esm/utils/cacheDisk.mjs.map +1 -1
  147. package/dist/esm/utils/cacheMemory.mjs +261 -1
  148. package/dist/esm/utils/cacheMemory.mjs.map +1 -1
  149. package/dist/esm/utils/clearModuleCache.mjs +25 -1
  150. package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
  151. package/dist/esm/utils/compareVersions.mjs +36 -1
  152. package/dist/esm/utils/compareVersions.mjs.map +1 -1
  153. package/dist/esm/utils/extractErrorMessage.mjs +93 -1
  154. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
  155. package/dist/esm/utils/getExtension.mjs +12 -1
  156. package/dist/esm/utils/getExtension.mjs.map +1 -1
  157. package/dist/esm/utils/getPackageJsonPath.mjs +31 -1
  158. package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -1
  159. package/dist/esm/utils/index.mjs +19 -1
  160. package/dist/esm/utils/logStack.mjs +16 -1
  161. package/dist/esm/utils/logStack.mjs.map +1 -1
  162. package/dist/esm/utils/normalizePath.mjs +15 -1
  163. package/dist/esm/utils/normalizePath.mjs.map +1 -1
  164. package/dist/esm/utils/parseFilePathPattern.mjs +21 -1
  165. package/dist/esm/utils/parseFilePathPattern.mjs.map +1 -1
  166. package/dist/esm/utils/retryManager.mjs +44 -1
  167. package/dist/esm/utils/retryManager.mjs.map +1 -1
  168. package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs +11 -1
  169. package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs.map +1 -1
  170. package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs +14 -1
  171. package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs.map +1 -1
  172. package/dist/esm/utils/stringFormatter/index.mjs +6 -1
  173. package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs +12 -1
  174. package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs.map +1 -1
  175. package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs +17 -1
  176. package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs.map +1 -1
  177. package/dist/types/client.d.ts +4 -4
  178. package/dist/types/colors.d.ts +20 -2
  179. package/dist/types/colors.d.ts.map +1 -0
  180. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  181. package/dist/types/configFile/configurationSchema.d.ts +10 -10
  182. package/dist/types/configFile/getConfiguration.d.ts +2 -2
  183. package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
  184. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
  185. package/dist/types/loadEnvFile.d.ts +10 -2
  186. package/dist/types/loadEnvFile.d.ts.map +1 -0
  187. package/dist/types/loadExternalFile/index.d.ts +3 -3
  188. package/dist/types/loadExternalFile/loadExternalFile.d.ts +25 -2
  189. package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -0
  190. package/dist/types/loadExternalFile/parseFileContent.d.ts +29 -2
  191. package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -0
  192. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +19 -2
  193. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -0
  194. package/dist/types/logger.d.ts +4 -4
  195. package/dist/types/logger.d.ts.map +1 -1
  196. package/dist/types/utils/index.d.ts +4 -4
  197. package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts +9 -2
  198. package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +1 -0
  199. package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts +9 -2
  200. package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +1 -0
  201. package/dist/types/utils/stringFormatter/index.d.ts +4 -4
  202. package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts +5 -2
  203. package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +1 -0
  204. package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts +10 -2
  205. package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +1 -0
  206. package/package.json +2 -2
  207. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  208. package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs +0 -2
  209. package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs.map +0 -1
  210. package/dist/types/camelCaseToKebabCase-BV_lLJHR.d.ts +0 -9
  211. package/dist/types/camelCaseToKebabCase-BV_lLJHR.d.ts.map +0 -1
  212. package/dist/types/camelCaseToSentence-DAbbkwe6.d.ts +0 -9
  213. package/dist/types/camelCaseToSentence-DAbbkwe6.d.ts.map +0 -1
  214. package/dist/types/colors-BbZeGWYU.d.ts +0 -20
  215. package/dist/types/colors-BbZeGWYU.d.ts.map +0 -1
  216. package/dist/types/kebabCaseToCamelCase-h9PkNVuO.d.ts +0 -5
  217. package/dist/types/kebabCaseToCamelCase-h9PkNVuO.d.ts.map +0 -1
  218. package/dist/types/loadEnvFile-BiTBX4fe.d.ts +0 -10
  219. package/dist/types/loadEnvFile-BiTBX4fe.d.ts.map +0 -1
  220. package/dist/types/loadExternalFile-DmM_TGcA.d.ts +0 -25
  221. package/dist/types/loadExternalFile-DmM_TGcA.d.ts.map +0 -1
  222. package/dist/types/parseFileContent--o_QlW5j.d.ts +0 -29
  223. package/dist/types/parseFileContent--o_QlW5j.d.ts.map +0 -1
  224. package/dist/types/toLowerCamelCase-DUdT00I1.d.ts +0 -10
  225. package/dist/types/toLowerCamelCase-DUdT00I1.d.ts.map +0 -1
  226. package/dist/types/transpileTSToCJS-OifpV3zk.d.ts +0 -19
  227. package/dist/types/transpileTSToCJS-OifpV3zk.d.ts.map +0 -1
@@ -1,2 +1,39 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=(e,t,n)=>{let r=e.split(`.`).map(Number),i=n.split(`.`).map(Number),a=Math.max(r.length,i.length),o=0;for(let e=0;e<a;e++){let t=r[e]||0,n=i[e]||0;if(t>n){o=1;break}else if(t<n){o=-1;break}}switch(t){case`>`:return o===1;case`<`:return o===-1;case`=`:return o===0;case`≥`:return o===0||o===1;case`≤`:return o===0||o===-1}};exports.compareVersions=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/compareVersions.ts
4
+ /**
5
+ * Compare two semver-like version strings (e.g. "15.10.4" vs "15.3.5").
6
+ *
7
+ * @param version1 - first version string
8
+ * @param version2 - second version string
9
+ * @param comparison - type of comparison: 'gt', 'lt', 'eq', 'gte', 'lte'
10
+ * @returns boolean indicating if version1 meets the specified comparison condition vs version2
11
+ */
12
+ const compareVersions = (version1, comparison, version2) => {
13
+ const v1Parts = version1.split(".").map(Number);
14
+ const v2Parts = version2.split(".").map(Number);
15
+ const maxLen = Math.max(v1Parts.length, v2Parts.length);
16
+ let result = 0;
17
+ for (let i = 0; i < maxLen; i++) {
18
+ const part1 = v1Parts[i] || 0;
19
+ const part2 = v2Parts[i] || 0;
20
+ if (part1 > part2) {
21
+ result = 1;
22
+ break;
23
+ } else if (part1 < part2) {
24
+ result = -1;
25
+ break;
26
+ }
27
+ }
28
+ switch (comparison) {
29
+ case ">": return result === 1;
30
+ case "<": return result === -1;
31
+ case "=": return result === 0;
32
+ case "≥": return result === 0 || result === 1;
33
+ case "≤": return result === 0 || result === -1;
34
+ }
35
+ };
36
+
37
+ //#endregion
38
+ exports.compareVersions = compareVersions;
2
39
  //# sourceMappingURL=compareVersions.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compareVersions.cjs","names":[],"sources":["../../../src/utils/compareVersions.ts"],"sourcesContent":["/**\n * Compare two semver-like version strings (e.g. \"15.10.4\" vs \"15.3.5\").\n *\n * @param version1 - first version string\n * @param version2 - second version string\n * @param comparison - type of comparison: 'gt', 'lt', 'eq', 'gte', 'lte'\n * @returns boolean indicating if version1 meets the specified comparison condition vs version2\n */\nexport const compareVersions = (\n version1: string,\n comparison: '>' | '<' | '=' | '≥' | '≤',\n version2: string\n): boolean => {\n const v1Parts = version1.split('.').map(Number);\n const v2Parts = version2.split('.').map(Number);\n const maxLen = Math.max(v1Parts.length, v2Parts.length);\n\n // Compute a basic -1, 0, or 1 comparison\n let result = 0;\n for (let i = 0; i < maxLen; i++) {\n const part1 = v1Parts[i] || 0;\n const part2 = v2Parts[i] || 0;\n if (part1 > part2) {\n result = 1;\n break;\n } else if (part1 < part2) {\n result = -1;\n break;\n }\n }\n\n switch (comparison) {\n case '>':\n return result === 1;\n case '<':\n return result === -1;\n case '=':\n return result === 0;\n case '≥':\n return result === 0 || result === 1;\n case '≤':\n return result === 0 || result === -1;\n }\n};\n"],"mappings":"mEAQA,MAAa,GACX,EACA,EACA,IACY,CACZ,IAAM,EAAU,EAAS,MAAM,IAAI,CAAC,IAAI,OAAO,CACzC,EAAU,EAAS,MAAM,IAAI,CAAC,IAAI,OAAO,CACzC,EAAS,KAAK,IAAI,EAAQ,OAAQ,EAAQ,OAAO,CAGnD,EAAS,EACb,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,IAAK,CAC/B,IAAM,EAAQ,EAAQ,IAAM,EACtB,EAAQ,EAAQ,IAAM,EAC5B,GAAI,EAAQ,EAAO,CACjB,EAAS,EACT,cACS,EAAQ,EAAO,CACxB,EAAS,GACT,OAIJ,OAAQ,EAAR,CACE,IAAK,IACH,OAAO,IAAW,EACpB,IAAK,IACH,OAAO,IAAW,GACpB,IAAK,IACH,OAAO,IAAW,EACpB,IAAK,IACH,OAAO,IAAW,GAAK,IAAW,EACpC,IAAK,IACH,OAAO,IAAW,GAAK,IAAW"}
1
+ {"version":3,"file":"compareVersions.cjs","names":[],"sources":["../../../src/utils/compareVersions.ts"],"sourcesContent":["/**\n * Compare two semver-like version strings (e.g. \"15.10.4\" vs \"15.3.5\").\n *\n * @param version1 - first version string\n * @param version2 - second version string\n * @param comparison - type of comparison: 'gt', 'lt', 'eq', 'gte', 'lte'\n * @returns boolean indicating if version1 meets the specified comparison condition vs version2\n */\nexport const compareVersions = (\n version1: string,\n comparison: '>' | '<' | '=' | '≥' | '≤',\n version2: string\n): boolean => {\n const v1Parts = version1.split('.').map(Number);\n const v2Parts = version2.split('.').map(Number);\n const maxLen = Math.max(v1Parts.length, v2Parts.length);\n\n // Compute a basic -1, 0, or 1 comparison\n let result = 0;\n for (let i = 0; i < maxLen; i++) {\n const part1 = v1Parts[i] || 0;\n const part2 = v2Parts[i] || 0;\n if (part1 > part2) {\n result = 1;\n break;\n } else if (part1 < part2) {\n result = -1;\n break;\n }\n }\n\n switch (comparison) {\n case '>':\n return result === 1;\n case '<':\n return result === -1;\n case '=':\n return result === 0;\n case '≥':\n return result === 0 || result === 1;\n case '≤':\n return result === 0 || result === -1;\n }\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,mBACX,UACA,YACA,aACY;CACZ,MAAM,UAAU,SAAS,MAAM,IAAI,CAAC,IAAI,OAAO;CAC/C,MAAM,UAAU,SAAS,MAAM,IAAI,CAAC,IAAI,OAAO;CAC/C,MAAM,SAAS,KAAK,IAAI,QAAQ,QAAQ,QAAQ,OAAO;CAGvD,IAAI,SAAS;AACb,MAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK;EAC/B,MAAM,QAAQ,QAAQ,MAAM;EAC5B,MAAM,QAAQ,QAAQ,MAAM;AAC5B,MAAI,QAAQ,OAAO;AACjB,YAAS;AACT;aACS,QAAQ,OAAO;AACxB,YAAS;AACT;;;AAIJ,SAAQ,YAAR;EACE,KAAK,IACH,QAAO,WAAW;EACpB,KAAK,IACH,QAAO,WAAW;EACpB,KAAK,IACH,QAAO,WAAW;EACpB,KAAK,IACH,QAAO,WAAW,KAAK,WAAW;EACpC,KAAK,IACH,QAAO,WAAW,KAAK,WAAW"}
@@ -1,2 +1,96 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=t=>{let n=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)[0]??e.trim(),r=e=>{let t=e.trim();if(!t)return!1;let n=t[0];return n===`{`||n===`[`||n===`"`},i=e=>{let t=e.trim();if(/Unexpected token/i.test(t)&&/not valid JSON/i.test(t)){let e=t.match(/"([^"]+)"/);if(e?.[1])return e[1];let n=t.split(`:`).slice(1).join(`:`).trim();if(n)return n}return t},a=(e,t)=>{if(!e||typeof e!=`object`||t.has(e))return;t.add(e);let n=e;if(typeof n.message==`string`&&n.message.trim())return n.message;if(typeof n.error_description==`string`&&n.error_description.trim())return n.error_description;if(typeof n.error==`string`&&n.error.trim())return n.error;let r=typeof n.title==`string`?n.title.trim():``,i=typeof n.code==`string`?n.code.trim():``;if(r&&i)return`${r} (${i})`;if(r)return r;if(i)return i;if(typeof n.statusText==`string`&&n.statusText.trim())return n.statusText;let o=n.response;if(o&&typeof o==`object`){let e=o.data,n=a(e,t);if(n)return n}let s=n.data,c=a(s,t);if(c)return c;let l=n.cause,u=a(l,t)??(typeof l?.message==`string`?l.message:void 0);if(u)return u;let d=n.errors;if(Array.isArray(d))for(let e of d){let n=a(e,t);if(n)return n;if(typeof e?.message==`string`)return e.message}},o=e=>{if(r(e))try{let t=JSON.parse(e);return a(t,new Set)||(typeof t==`string`?t:void 0)}catch{return}};if(typeof t==`string`){let e=i(t);return o(e)??n(e)}if(t&&typeof t==`object`){if(t instanceof Error){let r=i(t.message),a=o(r);if(a)return n(a);let s=e(t.cause);return n(s&&s!==`An unknown error occurred`?s:r)}let r=a(t,new Set);if(r){let e=i(r);return o(e)??n(e)}try{return n(JSON.stringify(t))}catch{return n(String(t))}}return`An unknown error occurred`};exports.extractErrorMessage=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/extractErrorMessage.ts
4
+ const extractErrorMessage = (error) => {
5
+ const trimToSingleLine = (text) => text.split(/\r?\n/).map((s) => s.trim()).filter(Boolean)[0] ?? text.trim();
6
+ const looksLikeJson = (value) => {
7
+ const s = value.trim();
8
+ if (!s) return false;
9
+ const first = s[0];
10
+ return first === "{" || first === "[" || first === "\"";
11
+ };
12
+ const sanitizeUnexpectedTokenMessage = (text) => {
13
+ const t = text.trim();
14
+ if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {
15
+ const quoted = t.match(/"([^"]+)"/);
16
+ if (quoted?.[1]) return quoted[1];
17
+ const afterColon = t.split(":").slice(1).join(":").trim();
18
+ if (afterColon) return afterColon;
19
+ }
20
+ return t;
21
+ };
22
+ const pickFieldsFromObject = (value, seen) => {
23
+ if (!value || typeof value !== "object") return void 0;
24
+ if (seen.has(value)) return void 0;
25
+ seen.add(value);
26
+ const obj = value;
27
+ if (typeof obj.message === "string" && obj.message.trim()) return obj.message;
28
+ if (typeof obj.error_description === "string" && obj.error_description.trim()) return obj.error_description;
29
+ if (typeof obj.error === "string" && obj.error.trim()) return obj.error;
30
+ const title = typeof obj.title === "string" ? obj.title.trim() : "";
31
+ const code = typeof obj.code === "string" ? obj.code.trim() : "";
32
+ if (title && code) return `${title} (${code})`;
33
+ if (title) return title;
34
+ if (code) return code;
35
+ if (typeof obj.statusText === "string" && obj.statusText.trim()) return obj.statusText;
36
+ const response = obj.response;
37
+ if (response && typeof response === "object") {
38
+ const data = response.data;
39
+ const fromData = pickFieldsFromObject(data, seen);
40
+ if (fromData) return fromData;
41
+ }
42
+ const data = obj.data;
43
+ const fromData = pickFieldsFromObject(data, seen);
44
+ if (fromData) return fromData;
45
+ const cause = obj.cause;
46
+ const fromCause = pickFieldsFromObject(cause, seen) ?? (typeof cause?.message === "string" ? cause.message : void 0);
47
+ if (fromCause) return fromCause;
48
+ const errors = obj.errors;
49
+ if (Array.isArray(errors)) for (const item of errors) {
50
+ const fromItem = pickFieldsFromObject(item, seen);
51
+ if (fromItem) return fromItem;
52
+ if (typeof item?.message === "string") return item.message;
53
+ }
54
+ };
55
+ const tryParseJsonString = (maybeJson) => {
56
+ if (!looksLikeJson(maybeJson)) return void 0;
57
+ try {
58
+ const parsed = JSON.parse(maybeJson);
59
+ const picked = pickFieldsFromObject(parsed, /* @__PURE__ */ new Set());
60
+ if (picked) return picked;
61
+ if (typeof parsed === "string") return parsed;
62
+ return;
63
+ } catch {
64
+ return;
65
+ }
66
+ };
67
+ if (typeof error === "string") {
68
+ const cleaned = sanitizeUnexpectedTokenMessage(error);
69
+ return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);
70
+ }
71
+ if (error && typeof error === "object") {
72
+ if (error instanceof Error) {
73
+ const cleaned = sanitizeUnexpectedTokenMessage(error.message);
74
+ const fromMessage = tryParseJsonString(cleaned);
75
+ if (fromMessage) return trimToSingleLine(fromMessage);
76
+ const fromCause = extractErrorMessage(error.cause);
77
+ if (fromCause && fromCause !== "An unknown error occurred") return trimToSingleLine(fromCause);
78
+ return trimToSingleLine(cleaned);
79
+ }
80
+ const fromObject = pickFieldsFromObject(error, /* @__PURE__ */ new Set());
81
+ if (fromObject) {
82
+ const cleaned = sanitizeUnexpectedTokenMessage(fromObject);
83
+ return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);
84
+ }
85
+ try {
86
+ return trimToSingleLine(JSON.stringify(error));
87
+ } catch {
88
+ return trimToSingleLine(String(error));
89
+ }
90
+ }
91
+ return "An unknown error occurred";
92
+ };
93
+
94
+ //#endregion
95
+ exports.extractErrorMessage = extractErrorMessage;
2
96
  //# sourceMappingURL=extractErrorMessage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractErrorMessage.cjs","names":[],"sources":["../../../src/utils/extractErrorMessage.ts"],"sourcesContent":["export const extractErrorMessage = (error: unknown): string => {\n const trimToSingleLine = (text: string): string =>\n text\n .split(/\\r?\\n/)\n .map((s) => s.trim())\n .filter(Boolean)[0] ?? text.trim();\n\n const looksLikeJson = (value: string): boolean => {\n const s = value.trim();\n if (!s) return false;\n const first = s[0];\n return first === '{' || first === '[' || first === '\"';\n };\n\n const sanitizeUnexpectedTokenMessage = (text: string): string => {\n // If the text mentions an invalid JSON parse, try to extract the meaningful part\n const t = text.trim();\n if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {\n const quoted = t.match(/\"([^\"]+)\"/);\n if (quoted?.[1]) return quoted[1];\n // Fallback: drop the leading parser error description\n const afterColon = t.split(':').slice(1).join(':').trim();\n if (afterColon) return afterColon;\n }\n return t;\n };\n\n const pickFieldsFromObject = (\n value: unknown,\n seen: Set<unknown>\n ): string | undefined => {\n if (!value || typeof value !== 'object') return undefined;\n if (seen.has(value)) return undefined;\n seen.add(value);\n\n const obj = value as Record<string, unknown>;\n\n // Check for message first (highest priority)\n if (typeof obj.message === 'string' && obj.message.trim()) {\n return obj.message;\n }\n\n // Check for error_description\n if (\n typeof obj.error_description === 'string' &&\n obj.error_description.trim()\n ) {\n return obj.error_description;\n }\n\n // Check for error\n if (typeof obj.error === 'string' && obj.error.trim()) {\n return obj.error;\n }\n\n // Handle title and code combination\n const title = typeof obj.title === 'string' ? obj.title.trim() : '';\n const code = typeof obj.code === 'string' ? obj.code.trim() : '';\n\n if (title && code) {\n return `${title} (${code})`;\n }\n\n if (title) {\n return title;\n }\n\n if (code) {\n return code;\n }\n\n // Check for statusText\n if (typeof obj.statusText === 'string' && obj.statusText.trim()) {\n return obj.statusText;\n }\n\n // Common nested structures (Axios/Fetch-like)\n const response = obj.response as Record<string, unknown> | undefined;\n if (response && typeof response === 'object') {\n const data = response.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n }\n\n const data = obj.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n\n // Nested cause chain\n const cause = (obj as { cause?: unknown }).cause;\n const fromCause =\n pickFieldsFromObject(cause, seen) ??\n (typeof (cause as any)?.message === 'string'\n ? (cause as any).message\n : undefined);\n if (fromCause) return fromCause;\n\n // Arrays of errors\n const errors = obj.errors as unknown;\n if (Array.isArray(errors)) {\n for (const item of errors) {\n const fromItem = pickFieldsFromObject(item, seen);\n if (fromItem) return fromItem;\n if (typeof (item as any)?.message === 'string')\n return (item as any).message;\n }\n }\n\n return undefined;\n };\n\n const tryParseJsonString = (maybeJson: string): string | undefined => {\n if (!looksLikeJson(maybeJson)) return undefined;\n try {\n const parsed = JSON.parse(maybeJson);\n const picked = pickFieldsFromObject(parsed, new Set());\n if (picked) return picked;\n if (typeof parsed === 'string') return parsed;\n return undefined;\n } catch {\n return undefined;\n }\n };\n\n if (typeof error === 'string') {\n const cleaned = sanitizeUnexpectedTokenMessage(error);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n if (error && typeof error === 'object') {\n // Native Error instance\n if (error instanceof Error) {\n const cleaned = sanitizeUnexpectedTokenMessage(error.message);\n const fromMessage = tryParseJsonString(cleaned);\n if (fromMessage) return trimToSingleLine(fromMessage);\n // Dive into cause when present\n const fromCause = extractErrorMessage(error.cause as unknown);\n if (fromCause && fromCause !== 'An unknown error occurred')\n return trimToSingleLine(fromCause);\n return trimToSingleLine(cleaned);\n }\n\n // Generic object\n const seen = new Set<unknown>();\n const fromObject = pickFieldsFromObject(error, seen);\n if (fromObject) {\n const cleaned = sanitizeUnexpectedTokenMessage(fromObject);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n try {\n const serialized = JSON.stringify(error);\n return trimToSingleLine(serialized);\n } catch {\n return trimToSingleLine(String(error));\n }\n }\n\n return 'An unknown error occurred';\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"extractErrorMessage.cjs","names":[],"sources":["../../../src/utils/extractErrorMessage.ts"],"sourcesContent":["export const extractErrorMessage = (error: unknown): string => {\n const trimToSingleLine = (text: string): string =>\n text\n .split(/\\r?\\n/)\n .map((s) => s.trim())\n .filter(Boolean)[0] ?? text.trim();\n\n const looksLikeJson = (value: string): boolean => {\n const s = value.trim();\n if (!s) return false;\n const first = s[0];\n return first === '{' || first === '[' || first === '\"';\n };\n\n const sanitizeUnexpectedTokenMessage = (text: string): string => {\n // If the text mentions an invalid JSON parse, try to extract the meaningful part\n const t = text.trim();\n if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {\n const quoted = t.match(/\"([^\"]+)\"/);\n if (quoted?.[1]) return quoted[1];\n // Fallback: drop the leading parser error description\n const afterColon = t.split(':').slice(1).join(':').trim();\n if (afterColon) return afterColon;\n }\n return t;\n };\n\n const pickFieldsFromObject = (\n value: unknown,\n seen: Set<unknown>\n ): string | undefined => {\n if (!value || typeof value !== 'object') return undefined;\n if (seen.has(value)) return undefined;\n seen.add(value);\n\n const obj = value as Record<string, unknown>;\n\n // Check for message first (highest priority)\n if (typeof obj.message === 'string' && obj.message.trim()) {\n return obj.message;\n }\n\n // Check for error_description\n if (\n typeof obj.error_description === 'string' &&\n obj.error_description.trim()\n ) {\n return obj.error_description;\n }\n\n // Check for error\n if (typeof obj.error === 'string' && obj.error.trim()) {\n return obj.error;\n }\n\n // Handle title and code combination\n const title = typeof obj.title === 'string' ? obj.title.trim() : '';\n const code = typeof obj.code === 'string' ? obj.code.trim() : '';\n\n if (title && code) {\n return `${title} (${code})`;\n }\n\n if (title) {\n return title;\n }\n\n if (code) {\n return code;\n }\n\n // Check for statusText\n if (typeof obj.statusText === 'string' && obj.statusText.trim()) {\n return obj.statusText;\n }\n\n // Common nested structures (Axios/Fetch-like)\n const response = obj.response as Record<string, unknown> | undefined;\n if (response && typeof response === 'object') {\n const data = response.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n }\n\n const data = obj.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n\n // Nested cause chain\n const cause = (obj as { cause?: unknown }).cause;\n const fromCause =\n pickFieldsFromObject(cause, seen) ??\n (typeof (cause as any)?.message === 'string'\n ? (cause as any).message\n : undefined);\n if (fromCause) return fromCause;\n\n // Arrays of errors\n const errors = obj.errors as unknown;\n if (Array.isArray(errors)) {\n for (const item of errors) {\n const fromItem = pickFieldsFromObject(item, seen);\n if (fromItem) return fromItem;\n if (typeof (item as any)?.message === 'string')\n return (item as any).message;\n }\n }\n\n return undefined;\n };\n\n const tryParseJsonString = (maybeJson: string): string | undefined => {\n if (!looksLikeJson(maybeJson)) return undefined;\n try {\n const parsed = JSON.parse(maybeJson);\n const picked = pickFieldsFromObject(parsed, new Set());\n if (picked) return picked;\n if (typeof parsed === 'string') return parsed;\n return undefined;\n } catch {\n return undefined;\n }\n };\n\n if (typeof error === 'string') {\n const cleaned = sanitizeUnexpectedTokenMessage(error);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n if (error && typeof error === 'object') {\n // Native Error instance\n if (error instanceof Error) {\n const cleaned = sanitizeUnexpectedTokenMessage(error.message);\n const fromMessage = tryParseJsonString(cleaned);\n if (fromMessage) return trimToSingleLine(fromMessage);\n // Dive into cause when present\n const fromCause = extractErrorMessage(error.cause as unknown);\n if (fromCause && fromCause !== 'An unknown error occurred')\n return trimToSingleLine(fromCause);\n return trimToSingleLine(cleaned);\n }\n\n // Generic object\n const seen = new Set<unknown>();\n const fromObject = pickFieldsFromObject(error, seen);\n if (fromObject) {\n const cleaned = sanitizeUnexpectedTokenMessage(fromObject);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n try {\n const serialized = JSON.stringify(error);\n return trimToSingleLine(serialized);\n } catch {\n return trimToSingleLine(String(error));\n }\n }\n\n return 'An unknown error occurred';\n};\n"],"mappings":"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"}
@@ -1,2 +1,15 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=(e,t)=>{let n=e.build.outputFormat;return t===`cjs`?`cjs`:t===`esm`?`mjs`:n.includes(`cjs`)?`cjs`:n.includes(`esm`)?`mjs`:`cjs`};exports.getExtension=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/getExtension.ts
4
+ const getExtension = (configuration, format) => {
5
+ const outputFormats = configuration.build.outputFormat;
6
+ if (format === "cjs") return "cjs";
7
+ if (format === "esm") return "mjs";
8
+ if (outputFormats.includes("cjs")) return "cjs";
9
+ if (outputFormats.includes("esm")) return "mjs";
10
+ return "cjs";
11
+ };
12
+
13
+ //#endregion
14
+ exports.getExtension = getExtension;
2
15
  //# sourceMappingURL=getExtension.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExtension.cjs","names":[],"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const getExtension = (\n configuration: IntlayerConfig,\n format?: 'esm' | 'cjs' | undefined\n) => {\n const outputFormats = configuration.build.outputFormat;\n\n if (format === 'cjs') return 'cjs';\n if (format === 'esm') return 'mjs';\n\n if (outputFormats.includes('cjs')) return 'cjs';\n if (outputFormats.includes('esm')) return 'mjs';\n\n return 'cjs';\n};\n"],"mappings":"mEAEA,MAAa,GACX,EACA,IACG,CACH,IAAM,EAAgB,EAAc,MAAM,aAQ1C,OANI,IAAW,MAAc,MACzB,IAAW,MAAc,MAEzB,EAAc,SAAS,MAAM,CAAS,MACtC,EAAc,SAAS,MAAM,CAAS,MAEnC"}
1
+ {"version":3,"file":"getExtension.cjs","names":[],"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const getExtension = (\n configuration: IntlayerConfig,\n format?: 'esm' | 'cjs' | undefined\n) => {\n const outputFormats = configuration.build.outputFormat;\n\n if (format === 'cjs') return 'cjs';\n if (format === 'esm') return 'mjs';\n\n if (outputFormats.includes('cjs')) return 'cjs';\n if (outputFormats.includes('esm')) return 'mjs';\n\n return 'cjs';\n};\n"],"mappings":";;;AAEA,MAAa,gBACX,eACA,WACG;CACH,MAAM,gBAAgB,cAAc,MAAM;AAE1C,KAAI,WAAW,MAAO,QAAO;AAC7B,KAAI,WAAW,MAAO,QAAO;AAE7B,KAAI,cAAc,SAAS,MAAM,CAAE,QAAO;AAC1C,KAAI,cAAc,SAAS,MAAM,CAAE,QAAO;AAE1C,QAAO"}
@@ -1,2 +1,34 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`./cacheMemory.cjs`);let t=require(`node:fs`),n=require(`node:path`);const r=(r=process.cwd())=>{let i=e.cacheMemory.get(`packageJsonPath`,r);if(i)return i;let a=r;for(let i=0;i<15;i++){let i=(0,n.join)(a,`package.json`);if((0,t.existsSync)(i))return e.cacheMemory.set(`packageJsonPath`,r,{packageJsonPath:i,baseDir:a}),{packageJsonPath:i,baseDir:a};let o=(0,n.dirname)(a);if(o===a)break;a=o}throw Error(`Could not find package.json in current directory or any of the 15 parent directories. Searched from: ${r}`)};exports.getPackageJsonPath=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_utils_cacheMemory = require('./cacheMemory.cjs');
4
+ let node_fs = require("node:fs");
5
+ let node_path = require("node:path");
6
+
7
+ //#region src/utils/getPackageJsonPath.ts
8
+ const MAX_LEVELS = 15;
9
+ const getPackageJsonPath = (startDir = process.cwd()) => {
10
+ const checkedCache = require_utils_cacheMemory.cacheMemory.get("packageJsonPath", startDir);
11
+ if (checkedCache) return checkedCache;
12
+ let currentDir = startDir;
13
+ for (let level = 0; level < MAX_LEVELS; level++) {
14
+ const packageJsonPath = (0, node_path.join)(currentDir, "package.json");
15
+ if ((0, node_fs.existsSync)(packageJsonPath)) {
16
+ require_utils_cacheMemory.cacheMemory.set("packageJsonPath", startDir, {
17
+ packageJsonPath,
18
+ baseDir: currentDir
19
+ });
20
+ return {
21
+ packageJsonPath,
22
+ baseDir: currentDir
23
+ };
24
+ }
25
+ const parentDir = (0, node_path.dirname)(currentDir);
26
+ if (parentDir === currentDir) break;
27
+ currentDir = parentDir;
28
+ }
29
+ throw new Error(`Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`);
30
+ };
31
+
32
+ //#endregion
33
+ exports.getPackageJsonPath = getPackageJsonPath;
2
34
  //# sourceMappingURL=getPackageJsonPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPackageJsonPath.cjs","names":["cacheMemory"],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cacheMemory } from './cacheMemory';\n\nconst MAX_LEVELS = 15;\n\ntype PackageJsonPathCache = {\n packageJsonPath: string;\n baseDir: string;\n};\n\nexport const getPackageJsonPath = (\n startDir: string = process.cwd()\n): PackageJsonPathCache => {\n const checkedCache = cacheMemory.get<PackageJsonPathCache>(\n 'packageJsonPath',\n startDir\n );\n\n if (checkedCache) return checkedCache;\n\n let currentDir = startDir;\n\n for (let level = 0; level < MAX_LEVELS; level++) {\n const packageJsonPath = join(currentDir, 'package.json');\n\n if (existsSync(packageJsonPath)) {\n cacheMemory.set('packageJsonPath', startDir, {\n packageJsonPath,\n baseDir: currentDir,\n });\n\n return { packageJsonPath, baseDir: currentDir };\n }\n\n const parentDir = dirname(currentDir);\n\n // If we've reached the root directory, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n throw new Error(\n `Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`\n );\n};\n"],"mappings":"yLAIA,MAOa,GACX,EAAmB,QAAQ,KAAK,GACP,CACzB,IAAM,EAAeA,EAAAA,YAAY,IAC/B,kBACA,EACD,CAED,GAAI,EAAc,OAAO,EAEzB,IAAI,EAAa,EAEjB,IAAK,IAAI,EAAQ,EAAG,EAAQ,GAAY,IAAS,CAC/C,IAAM,GAAA,EAAA,EAAA,MAAuB,EAAY,eAAe,CAExD,IAAA,EAAA,EAAA,YAAe,EAAgB,CAM7B,OALA,EAAA,YAAY,IAAI,kBAAmB,EAAU,CAC3C,kBACA,QAAS,EACV,CAAC,CAEK,CAAE,kBAAiB,QAAS,EAAY,CAGjD,IAAM,GAAA,EAAA,EAAA,SAAoB,EAAW,CAGrC,GAAI,IAAc,EAChB,MAGF,EAAa,EAGf,MAAU,MACR,wGAAmH,IACpH"}
1
+ {"version":3,"file":"getPackageJsonPath.cjs","names":["cacheMemory"],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cacheMemory } from './cacheMemory';\n\nconst MAX_LEVELS = 15;\n\ntype PackageJsonPathCache = {\n packageJsonPath: string;\n baseDir: string;\n};\n\nexport const getPackageJsonPath = (\n startDir: string = process.cwd()\n): PackageJsonPathCache => {\n const checkedCache = cacheMemory.get<PackageJsonPathCache>(\n 'packageJsonPath',\n startDir\n );\n\n if (checkedCache) return checkedCache;\n\n let currentDir = startDir;\n\n for (let level = 0; level < MAX_LEVELS; level++) {\n const packageJsonPath = join(currentDir, 'package.json');\n\n if (existsSync(packageJsonPath)) {\n cacheMemory.set('packageJsonPath', startDir, {\n packageJsonPath,\n baseDir: currentDir,\n });\n\n return { packageJsonPath, baseDir: currentDir };\n }\n\n const parentDir = dirname(currentDir);\n\n // If we've reached the root directory, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n throw new Error(\n `Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`\n );\n};\n"],"mappings":";;;;;;;AAIA,MAAM,aAAa;AAOnB,MAAa,sBACX,WAAmB,QAAQ,KAAK,KACP;CACzB,MAAM,eAAeA,sCAAY,IAC/B,mBACA,SACD;AAED,KAAI,aAAc,QAAO;CAEzB,IAAI,aAAa;AAEjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS;EAC/C,MAAM,sCAAuB,YAAY,eAAe;AAExD,8BAAe,gBAAgB,EAAE;AAC/B,yCAAY,IAAI,mBAAmB,UAAU;IAC3C;IACA,SAAS;IACV,CAAC;AAEF,UAAO;IAAE;IAAiB,SAAS;IAAY;;EAGjD,MAAM,mCAAoB,WAAW;AAGrC,MAAI,cAAc,WAChB;AAGF,eAAa;;AAGf,OAAM,IAAI,MACR,kEAAkE,WAAW,sCAAsC,WACpH"}
@@ -1 +1,45 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getExtension.cjs`),t=require(`./normalizePath.cjs`),n=require(`./alias.cjs`),r=require(`./cacheMemory.cjs`),i=require(`./cacheDisk.cjs`),a=require(`./getPackageJsonPath.cjs`),o=require(`./ESMxCJSHelpers.cjs`),s=require(`./clearModuleCache.cjs`),c=require(`./compareVersions.cjs`),l=require(`./extractErrorMessage.cjs`),u=require(`./logStack.cjs`),d=require(`./parseFilePathPattern.cjs`),f=require(`./retryManager.cjs`),p=require(`./stringFormatter/camelCaseToKebabCase.cjs`),m=require(`./stringFormatter/camelCaseToSentence.cjs`),h=require(`./stringFormatter/kebabCaseToCamelCase.cjs`),g=require(`./stringFormatter/toLowerCamelCase.cjs`);exports.cacheDisk=i.cacheDisk,exports.cacheMemory=r.cacheMemory,exports.camelCaseToKebabCase=p.camelCaseToKebabCase,exports.camelCaseToSentence=m.camelCaseToSentence,exports.clearAllCache=r.clearAllCache,exports.clearCache=r.clearCache,exports.clearModuleCache=s.clearModuleCache,exports.compareVersions=c.compareVersions,exports.computeKeyId=r.computeKeyId,exports.configESMxCJSRequire=o.configESMxCJSRequire,exports.extractErrorMessage=l.extractErrorMessage,exports.getAlias=n.getAlias,exports.getCache=r.getCache,exports.getExtension=e.getExtension,exports.getPackageJsonPath=a.getPackageJsonPath,exports.getProjectRequire=o.getProjectRequire,exports.isESModule=o.isESModule,exports.kebabCaseToCamelCase=h.kebabCaseToCamelCase,exports.logStack=u.logStack,exports.normalizePath=t.normalizePath,exports.parseFilePathPattern=d.parseFilePathPattern,exports.parseStringPattern=d.parseStringPattern,exports.retryManager=f.retryManager,exports.setCache=r.setCache,exports.stableStringify=r.stableStringify,exports.toLowerCamelCase=g.toLowerCamelCase;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_getExtension = require('./getExtension.cjs');
3
+ const require_utils_normalizePath = require('./normalizePath.cjs');
4
+ const require_utils_alias = require('./alias.cjs');
5
+ const require_utils_cacheMemory = require('./cacheMemory.cjs');
6
+ const require_utils_cacheDisk = require('./cacheDisk.cjs');
7
+ const require_utils_getPackageJsonPath = require('./getPackageJsonPath.cjs');
8
+ const require_utils_ESMxCJSHelpers = require('./ESMxCJSHelpers.cjs');
9
+ const require_utils_clearModuleCache = require('./clearModuleCache.cjs');
10
+ const require_utils_compareVersions = require('./compareVersions.cjs');
11
+ const require_utils_extractErrorMessage = require('./extractErrorMessage.cjs');
12
+ const require_utils_logStack = require('./logStack.cjs');
13
+ const require_utils_parseFilePathPattern = require('./parseFilePathPattern.cjs');
14
+ const require_utils_retryManager = require('./retryManager.cjs');
15
+ const require_utils_stringFormatter_camelCaseToKebabCase = require('./stringFormatter/camelCaseToKebabCase.cjs');
16
+ const require_utils_stringFormatter_camelCaseToSentence = require('./stringFormatter/camelCaseToSentence.cjs');
17
+ const require_utils_stringFormatter_kebabCaseToCamelCase = require('./stringFormatter/kebabCaseToCamelCase.cjs');
18
+ const require_utils_stringFormatter_toLowerCamelCase = require('./stringFormatter/toLowerCamelCase.cjs');
19
+
20
+ exports.cacheDisk = require_utils_cacheDisk.cacheDisk;
21
+ exports.cacheMemory = require_utils_cacheMemory.cacheMemory;
22
+ exports.camelCaseToKebabCase = require_utils_stringFormatter_camelCaseToKebabCase.camelCaseToKebabCase;
23
+ exports.camelCaseToSentence = require_utils_stringFormatter_camelCaseToSentence.camelCaseToSentence;
24
+ exports.clearAllCache = require_utils_cacheMemory.clearAllCache;
25
+ exports.clearCache = require_utils_cacheMemory.clearCache;
26
+ exports.clearModuleCache = require_utils_clearModuleCache.clearModuleCache;
27
+ exports.compareVersions = require_utils_compareVersions.compareVersions;
28
+ exports.computeKeyId = require_utils_cacheMemory.computeKeyId;
29
+ exports.configESMxCJSRequire = require_utils_ESMxCJSHelpers.configESMxCJSRequire;
30
+ exports.extractErrorMessage = require_utils_extractErrorMessage.extractErrorMessage;
31
+ exports.getAlias = require_utils_alias.getAlias;
32
+ exports.getCache = require_utils_cacheMemory.getCache;
33
+ exports.getExtension = require_utils_getExtension.getExtension;
34
+ exports.getPackageJsonPath = require_utils_getPackageJsonPath.getPackageJsonPath;
35
+ exports.getProjectRequire = require_utils_ESMxCJSHelpers.getProjectRequire;
36
+ exports.isESModule = require_utils_ESMxCJSHelpers.isESModule;
37
+ exports.kebabCaseToCamelCase = require_utils_stringFormatter_kebabCaseToCamelCase.kebabCaseToCamelCase;
38
+ exports.logStack = require_utils_logStack.logStack;
39
+ exports.normalizePath = require_utils_normalizePath.normalizePath;
40
+ exports.parseFilePathPattern = require_utils_parseFilePathPattern.parseFilePathPattern;
41
+ exports.parseStringPattern = require_utils_parseFilePathPattern.parseStringPattern;
42
+ exports.retryManager = require_utils_retryManager.retryManager;
43
+ exports.setCache = require_utils_cacheMemory.setCache;
44
+ exports.stableStringify = require_utils_cacheMemory.stableStringify;
45
+ exports.toLowerCamelCase = require_utils_stringFormatter_toLowerCamelCase.toLowerCamelCase;
@@ -1,2 +1,18 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../colors.cjs`),t=require(`../logger.cjs`),n=(n,r={limit:50})=>{Error.stackTraceLimit=r.limit;try{throw Error(`test`)}catch(r){console.log(t.colorize(n,e.YELLOW)),console.log(t.colorize(r.stack??``,e.BLUE))}};exports.logStack=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_colors = require('../colors.cjs');
3
+ const require_logger = require('../logger.cjs');
4
+
5
+ //#region src/utils/logStack.ts
6
+ const logStack = (message, options = { limit: 50 }) => {
7
+ Error.stackTraceLimit = options.limit;
8
+ try {
9
+ throw new Error("test");
10
+ } catch (error) {
11
+ console.log(require_logger.colorize(message, require_colors.YELLOW));
12
+ console.log(require_logger.colorize(error.stack ?? "", require_colors.BLUE));
13
+ }
14
+ };
15
+
16
+ //#endregion
17
+ exports.logStack = logStack;
2
18
  //# sourceMappingURL=logStack.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logStack.cjs","names":["colorize"],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import * as ANSIColors from '../colors';\nimport { colorize } from '../logger';\n\nexport const logStack = (\n message: string,\n options: { limit: number } = { limit: 50 }\n) => {\n Error.stackTraceLimit = options.limit;\n\n try {\n throw new Error('test');\n } catch (error) {\n console.log(colorize(message, ANSIColors.YELLOW));\n console.log(colorize((error as Error).stack ?? '', ANSIColors.BLUE));\n }\n};\n"],"mappings":"+HAGa,GACX,EACA,EAA6B,CAAE,MAAO,GAAI,GACvC,CACH,MAAM,gBAAkB,EAAQ,MAEhC,GAAI,CACF,MAAU,MAAM,OAAO,OAChB,EAAO,CACd,QAAQ,IAAIA,EAAAA,SAAS,EAAA,EAAA,OAA2B,CAAC,CACjD,QAAQ,IAAIA,EAAAA,SAAU,EAAgB,OAAS,GAAA,EAAA,KAAoB,CAAC"}
1
+ {"version":3,"file":"logStack.cjs","names":["colorize"],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import * as ANSIColors from '../colors';\nimport { colorize } from '../logger';\n\nexport const logStack = (\n message: string,\n options: { limit: number } = { limit: 50 }\n) => {\n Error.stackTraceLimit = options.limit;\n\n try {\n throw new Error('test');\n } catch (error) {\n console.log(colorize(message, ANSIColors.YELLOW));\n console.log(colorize((error as Error).stack ?? '', ANSIColors.BLUE));\n }\n};\n"],"mappings":";;;;;AAGA,MAAa,YACX,SACA,UAA6B,EAAE,OAAO,IAAI,KACvC;AACH,OAAM,kBAAkB,QAAQ;AAEhC,KAAI;AACF,QAAM,IAAI,MAAM,OAAO;UAChB,OAAO;AACd,UAAQ,IAAIA,wBAAS,+BAA2B,CAAC;AACjD,UAAQ,IAAIA,wBAAU,MAAgB,SAAS,wBAAoB,CAAC"}
@@ -1,2 +1,18 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>e.replace(/\\/g,`/`);exports.normalizePath=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/normalizePath.ts
4
+ /**
5
+ * Normalize a path for glob by replacing backslashes with forward slashes
6
+ *
7
+ * Utils for Windows compatibility, as Glob pattern as `**\\*.js` is not supported
8
+ *
9
+ * C:\\Users\\John\\Desktop\\test.txt -> C:/Users/John/Desktop/test.txt
10
+ *
11
+ * @param path - The path to normalize
12
+ * @returns The normalized path
13
+ */
14
+ const normalizePath = (path) => path.replace(/\\/g, "/");
15
+
16
+ //#endregion
17
+ exports.normalizePath = normalizePath;
2
18
  //# sourceMappingURL=normalizePath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePath.cjs","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":"mEAUA,MAAa,EAAiB,GAAyB,EAAK,QAAQ,MAAO,IAAI"}
1
+ {"version":3,"file":"normalizePath.cjs","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAa,iBAAiB,SAAyB,KAAK,QAAQ,OAAO,IAAI"}
@@ -1,2 +1,25 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=async(e,n)=>{if(typeof e==`function`)return await e(n);if(typeof e==`object`&&e&&n.locale){let r=e[n.locale];if(r)return typeof r==`function`?await r(n):t(r,n)}return typeof e==`string`?t(e,n):``},t=(e,t)=>e.replaceAll(/\{\{\s*locale\s*\}\}/g,t.locale??``).replaceAll(/\{\{\s*key\s*\}\}/g,t.key??``).replaceAll(/\{\{\s*fileName\s*\}\}/g,t.fileName??``).replaceAll(/\{\{\s*extension\s*\}\}/g,t.extension??``).replaceAll(/\{\{\s*componentFileName\s*\}\}/g,t.componentFileName??``).replaceAll(/\{\{\s*componentExtension\s*\}\}/g,t.componentExtension??``).replaceAll(/\{\{\s*format\s*\}\}/g,t.format??``).replaceAll(/\{\{\s*componentFormat\s*\}\}/g,t.componentFormat??``).replaceAll(/\{\{\s*componentDirPath\s*\}\}/g,t.componentDirPath??``);exports.parseFilePathPattern=e,exports.parseStringPattern=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/parseFilePathPattern.ts
4
+ /**
5
+ * Parses a FilePathPattern configuration string or function to a final string path.
6
+ * Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.
7
+ */
8
+ const parseFilePathPattern = async (pattern, context) => {
9
+ if (typeof pattern === "function") return await pattern(context);
10
+ if (typeof pattern === "object" && pattern !== null && context.locale) {
11
+ const localePattern = pattern[context.locale];
12
+ if (localePattern) {
13
+ if (typeof localePattern === "function") return await localePattern(context);
14
+ return parseStringPattern(localePattern, context);
15
+ }
16
+ }
17
+ if (typeof pattern === "string") return parseStringPattern(pattern, context);
18
+ return "";
19
+ };
20
+ const parseStringPattern = (pattern, context) => pattern.replaceAll(/\{\{\s*locale\s*\}\}/g, context.locale ?? "").replaceAll(/\{\{\s*key\s*\}\}/g, context.key ?? "").replaceAll(/\{\{\s*fileName\s*\}\}/g, context.fileName ?? "").replaceAll(/\{\{\s*extension\s*\}\}/g, context.extension ?? "").replaceAll(/\{\{\s*componentFileName\s*\}\}/g, context.componentFileName ?? "").replaceAll(/\{\{\s*componentExtension\s*\}\}/g, context.componentExtension ?? "").replaceAll(/\{\{\s*format\s*\}\}/g, context.format ?? "").replaceAll(/\{\{\s*componentFormat\s*\}\}/g, context.componentFormat ?? "").replaceAll(/\{\{\s*componentDirPath\s*\}\}/g, context.componentDirPath ?? "");
21
+
22
+ //#endregion
23
+ exports.parseFilePathPattern = parseFilePathPattern;
24
+ exports.parseStringPattern = parseStringPattern;
2
25
  //# sourceMappingURL=parseFilePathPattern.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseFilePathPattern.cjs","names":[],"sources":["../../../src/utils/parseFilePathPattern.ts"],"sourcesContent":["import type {\n FilePathPattern,\n FilePathPatternContext,\n} from '@intlayer/types/filePathPattern';\n\n/**\n * Parses a FilePathPattern configuration string or function to a final string path.\n * Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.\n */\nexport const parseFilePathPattern = async (\n pattern: FilePathPattern,\n context: FilePathPatternContext\n): Promise<string> => {\n if (typeof pattern === 'function') {\n return await (pattern as any)(context);\n }\n\n if (typeof pattern === 'object' && pattern !== null && context.locale) {\n const localePattern = (pattern as any)[context.locale];\n\n if (localePattern) {\n if (typeof localePattern === 'function') {\n return await localePattern(context);\n }\n return parseStringPattern(localePattern, context);\n }\n }\n\n if (typeof pattern === 'string') {\n return parseStringPattern(pattern, context);\n }\n\n return '';\n};\n\nexport const parseStringPattern = (\n pattern: string,\n context: FilePathPatternContext\n): string =>\n pattern\n .replaceAll(/\\{\\{\\s*locale\\s*\\}\\}/g, context.locale ?? '')\n .replaceAll(/\\{\\{\\s*key\\s*\\}\\}/g, context.key ?? '')\n .replaceAll(/\\{\\{\\s*fileName\\s*\\}\\}/g, context.fileName ?? '')\n .replaceAll(/\\{\\{\\s*extension\\s*\\}\\}/g, context.extension ?? '')\n .replaceAll(\n /\\{\\{\\s*componentFileName\\s*\\}\\}/g,\n context.componentFileName ?? ''\n )\n .replaceAll(\n /\\{\\{\\s*componentExtension\\s*\\}\\}/g,\n context.componentExtension ?? ''\n )\n .replaceAll(/\\{\\{\\s*format\\s*\\}\\}/g, context.format ?? '')\n .replaceAll(/\\{\\{\\s*componentFormat\\s*\\}\\}/g, context.componentFormat ?? '')\n .replaceAll(\n /\\{\\{\\s*componentDirPath\\s*\\}\\}/g,\n context.componentDirPath ?? ''\n );\n"],"mappings":"mEASA,MAAa,EAAuB,MAClC,EACA,IACoB,CACpB,GAAI,OAAO,GAAY,WACrB,OAAO,MAAO,EAAgB,EAAQ,CAGxC,GAAI,OAAO,GAAY,UAAY,GAAoB,EAAQ,OAAQ,CACrE,IAAM,EAAiB,EAAgB,EAAQ,QAE/C,GAAI,EAIF,OAHI,OAAO,GAAkB,WACpB,MAAM,EAAc,EAAQ,CAE9B,EAAmB,EAAe,EAAQ,CAQrD,OAJI,OAAO,GAAY,SACd,EAAmB,EAAS,EAAQ,CAGtC,IAGI,GACX,EACA,IAEA,EACG,WAAW,wBAAyB,EAAQ,QAAU,GAAG,CACzD,WAAW,qBAAsB,EAAQ,KAAO,GAAG,CACnD,WAAW,0BAA2B,EAAQ,UAAY,GAAG,CAC7D,WAAW,2BAA4B,EAAQ,WAAa,GAAG,CAC/D,WACC,mCACA,EAAQ,mBAAqB,GAC9B,CACA,WACC,oCACA,EAAQ,oBAAsB,GAC/B,CACA,WAAW,wBAAyB,EAAQ,QAAU,GAAG,CACzD,WAAW,iCAAkC,EAAQ,iBAAmB,GAAG,CAC3E,WACC,kCACA,EAAQ,kBAAoB,GAC7B"}
1
+ {"version":3,"file":"parseFilePathPattern.cjs","names":[],"sources":["../../../src/utils/parseFilePathPattern.ts"],"sourcesContent":["import type {\n FilePathPattern,\n FilePathPatternContext,\n} from '@intlayer/types/filePathPattern';\n\n/**\n * Parses a FilePathPattern configuration string or function to a final string path.\n * Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.\n */\nexport const parseFilePathPattern = async (\n pattern: FilePathPattern,\n context: FilePathPatternContext\n): Promise<string> => {\n if (typeof pattern === 'function') {\n return await (pattern as any)(context);\n }\n\n if (typeof pattern === 'object' && pattern !== null && context.locale) {\n const localePattern = (pattern as any)[context.locale];\n\n if (localePattern) {\n if (typeof localePattern === 'function') {\n return await localePattern(context);\n }\n return parseStringPattern(localePattern, context);\n }\n }\n\n if (typeof pattern === 'string') {\n return parseStringPattern(pattern, context);\n }\n\n return '';\n};\n\nexport const parseStringPattern = (\n pattern: string,\n context: FilePathPatternContext\n): string =>\n pattern\n .replaceAll(/\\{\\{\\s*locale\\s*\\}\\}/g, context.locale ?? '')\n .replaceAll(/\\{\\{\\s*key\\s*\\}\\}/g, context.key ?? '')\n .replaceAll(/\\{\\{\\s*fileName\\s*\\}\\}/g, context.fileName ?? '')\n .replaceAll(/\\{\\{\\s*extension\\s*\\}\\}/g, context.extension ?? '')\n .replaceAll(\n /\\{\\{\\s*componentFileName\\s*\\}\\}/g,\n context.componentFileName ?? ''\n )\n .replaceAll(\n /\\{\\{\\s*componentExtension\\s*\\}\\}/g,\n context.componentExtension ?? ''\n )\n .replaceAll(/\\{\\{\\s*format\\s*\\}\\}/g, context.format ?? '')\n .replaceAll(/\\{\\{\\s*componentFormat\\s*\\}\\}/g, context.componentFormat ?? '')\n .replaceAll(\n /\\{\\{\\s*componentDirPath\\s*\\}\\}/g,\n context.componentDirPath ?? ''\n );\n"],"mappings":";;;;;;;AASA,MAAa,uBAAuB,OAClC,SACA,YACoB;AACpB,KAAI,OAAO,YAAY,WACrB,QAAO,MAAO,QAAgB,QAAQ;AAGxC,KAAI,OAAO,YAAY,YAAY,YAAY,QAAQ,QAAQ,QAAQ;EACrE,MAAM,gBAAiB,QAAgB,QAAQ;AAE/C,MAAI,eAAe;AACjB,OAAI,OAAO,kBAAkB,WAC3B,QAAO,MAAM,cAAc,QAAQ;AAErC,UAAO,mBAAmB,eAAe,QAAQ;;;AAIrD,KAAI,OAAO,YAAY,SACrB,QAAO,mBAAmB,SAAS,QAAQ;AAG7C,QAAO;;AAGT,MAAa,sBACX,SACA,YAEA,QACG,WAAW,yBAAyB,QAAQ,UAAU,GAAG,CACzD,WAAW,sBAAsB,QAAQ,OAAO,GAAG,CACnD,WAAW,2BAA2B,QAAQ,YAAY,GAAG,CAC7D,WAAW,4BAA4B,QAAQ,aAAa,GAAG,CAC/D,WACC,oCACA,QAAQ,qBAAqB,GAC9B,CACA,WACC,qCACA,QAAQ,sBAAsB,GAC/B,CACA,WAAW,yBAAyB,QAAQ,UAAU,GAAG,CACzD,WAAW,kCAAkC,QAAQ,mBAAmB,GAAG,CAC3E,WACC,mCACA,QAAQ,oBAAoB,GAC7B"}
@@ -1,2 +1,46 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./extractErrorMessage.cjs`),t=require(`../logger.cjs`),n=(n,{maxRetry:r=3,delay:i=0,onError:a,onMaxTryReached:o}={})=>async(...s)=>{let c;for(let l=0;l<=r;l++)try{return await n(...s)}catch(n){c=n;let s=e.extractErrorMessage(n);if(l>=r){if(o)return o?.({error:s,attempt:l,maxRetry:r}),null;throw n}a?a?.({error:s,attempt:l,maxRetry:r}):t.logger(s,{level:`error`}),i>0&&await new Promise(e=>setTimeout(e,i))}throw c??Error(`Unexpected: retry loop completed without result`)};exports.retryManager=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_extractErrorMessage = require('./extractErrorMessage.cjs');
3
+ const require_logger = require('../logger.cjs');
4
+
5
+ //#region src/utils/retryManager.ts
6
+ const DEFAULT_MAX_RETRY = 3;
7
+ const DEFAULT_DELAY = 0;
8
+ /**
9
+ * Wrap an async function `fn` so it’s retried on failure.
10
+ *
11
+ * @param fn The async function to wrap
12
+ * @param options { maxRetry, delay }
13
+ * @returns A new function with the same signature as `fn`
14
+ */
15
+ const retryManager = (fn, { maxRetry = DEFAULT_MAX_RETRY, delay = DEFAULT_DELAY, onError, onMaxTryReached } = {}) => async (...args) => {
16
+ let lastError;
17
+ for (let attempt = 0; attempt <= maxRetry; attempt++) try {
18
+ return await fn(...args);
19
+ } catch (err) {
20
+ lastError = err;
21
+ const error = require_utils_extractErrorMessage.extractErrorMessage(err);
22
+ if (attempt >= maxRetry) {
23
+ if (onMaxTryReached) {
24
+ onMaxTryReached?.({
25
+ error,
26
+ attempt,
27
+ maxRetry
28
+ });
29
+ return null;
30
+ }
31
+ throw err;
32
+ }
33
+ if (onError) onError?.({
34
+ error,
35
+ attempt,
36
+ maxRetry
37
+ });
38
+ else require_logger.logger(error, { level: "error" });
39
+ if (delay > 0) await new Promise((res) => setTimeout(res, delay));
40
+ }
41
+ throw lastError ?? /* @__PURE__ */ new Error("Unexpected: retry loop completed without result");
42
+ };
43
+
44
+ //#endregion
45
+ exports.retryManager = retryManager;
2
46
  //# sourceMappingURL=retryManager.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"retryManager.cjs","names":["extractErrorMessage"],"sources":["../../../src/utils/retryManager.ts"],"sourcesContent":["import { logger } from '../logger';\nimport { extractErrorMessage } from './extractErrorMessage';\n\nexport type RetryManagerOptions = {\n /** maximum number of retries before giving up */\n maxRetry?: number;\n /** delay between attempts, in milliseconds */\n delay?: number;\n /** function to call when an error occurs */\n onError?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n /** function to call when the maximum number of retries is reached */\n onMaxTryReached?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n};\n\nconst DEFAULT_MAX_RETRY = 3;\nconst DEFAULT_DELAY = 0;\n\n/**\n * Wrap an async function `fn` so it’s retried on failure.\n *\n * @param fn The async function to wrap\n * @param options { maxRetry, delay }\n * @returns A new function with the same signature as `fn`\n */\nexport const retryManager =\n <Args extends any[], R>(\n fn: (...args: Args) => Promise<R>,\n {\n maxRetry = DEFAULT_MAX_RETRY,\n delay = DEFAULT_DELAY,\n onError,\n onMaxTryReached,\n }: RetryManagerOptions = {}\n ): ((...args: Args) => Promise<R>) =>\n // ───────────────────────────────^ returned wrapper function\n async (...args: Args): Promise<R> => {\n let lastError: unknown;\n\n for (let attempt = 0; attempt <= maxRetry; attempt++) {\n try {\n return await fn(...args);\n } catch (err) {\n lastError = err;\n const error = extractErrorMessage(err);\n\n // If this was the last attempt, handle max retry reached\n if (attempt >= maxRetry) {\n if (onMaxTryReached) {\n onMaxTryReached?.({ error, attempt, maxRetry });\n return null as R;\n }\n\n // Otherwise, throw the error\n throw err;\n }\n\n if (onError) {\n onError?.({ error, attempt, maxRetry });\n } else {\n logger(error, {\n level: 'error',\n });\n }\n\n // Wait before retrying\n if (delay > 0) {\n await new Promise((res) => setTimeout(res, delay));\n }\n }\n }\n\n // This should never be reached, but TypeScript needs it\n throw (\n lastError ?? new Error('Unexpected: retry loop completed without result')\n );\n };\n"],"mappings":"2IAgCa,GAET,EACA,CACE,WAAW,EACX,QAAQ,EACR,UACA,mBACuB,EAAE,GAG7B,MAAO,GAAG,IAA2B,CACnC,IAAI,EAEJ,IAAK,IAAI,EAAU,EAAG,GAAW,EAAU,IACzC,GAAI,CACF,OAAO,MAAM,EAAG,GAAG,EAAK,OACjB,EAAK,CACZ,EAAY,EACZ,IAAM,EAAQA,EAAAA,oBAAoB,EAAI,CAGtC,GAAI,GAAW,EAAU,CACvB,GAAI,EAEF,OADA,IAAkB,CAAE,QAAO,UAAS,WAAU,CAAC,CACxC,KAIT,MAAM,EAGJ,EACF,IAAU,CAAE,QAAO,UAAS,WAAU,CAAC,CAEvC,EAAA,OAAO,EAAO,CACZ,MAAO,QACR,CAAC,CAIA,EAAQ,GACV,MAAM,IAAI,QAAS,GAAQ,WAAW,EAAK,EAAM,CAAC,CAMxD,MACE,GAAiB,MAAM,kDAAkD"}
1
+ {"version":3,"file":"retryManager.cjs","names":["extractErrorMessage"],"sources":["../../../src/utils/retryManager.ts"],"sourcesContent":["import { logger } from '../logger';\nimport { extractErrorMessage } from './extractErrorMessage';\n\nexport type RetryManagerOptions = {\n /** maximum number of retries before giving up */\n maxRetry?: number;\n /** delay between attempts, in milliseconds */\n delay?: number;\n /** function to call when an error occurs */\n onError?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n /** function to call when the maximum number of retries is reached */\n onMaxTryReached?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n};\n\nconst DEFAULT_MAX_RETRY = 3;\nconst DEFAULT_DELAY = 0;\n\n/**\n * Wrap an async function `fn` so it’s retried on failure.\n *\n * @param fn The async function to wrap\n * @param options { maxRetry, delay }\n * @returns A new function with the same signature as `fn`\n */\nexport const retryManager =\n <Args extends any[], R>(\n fn: (...args: Args) => Promise<R>,\n {\n maxRetry = DEFAULT_MAX_RETRY,\n delay = DEFAULT_DELAY,\n onError,\n onMaxTryReached,\n }: RetryManagerOptions = {}\n ): ((...args: Args) => Promise<R>) =>\n // ───────────────────────────────^ returned wrapper function\n async (...args: Args): Promise<R> => {\n let lastError: unknown;\n\n for (let attempt = 0; attempt <= maxRetry; attempt++) {\n try {\n return await fn(...args);\n } catch (err) {\n lastError = err;\n const error = extractErrorMessage(err);\n\n // If this was the last attempt, handle max retry reached\n if (attempt >= maxRetry) {\n if (onMaxTryReached) {\n onMaxTryReached?.({ error, attempt, maxRetry });\n return null as R;\n }\n\n // Otherwise, throw the error\n throw err;\n }\n\n if (onError) {\n onError?.({ error, attempt, maxRetry });\n } else {\n logger(error, {\n level: 'error',\n });\n }\n\n // Wait before retrying\n if (delay > 0) {\n await new Promise((res) => setTimeout(res, delay));\n }\n }\n }\n\n // This should never be reached, but TypeScript needs it\n throw (\n lastError ?? new Error('Unexpected: retry loop completed without result')\n );\n };\n"],"mappings":";;;;;AAsBA,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;;;;;;;;AAStB,MAAa,gBAET,IACA,EACE,WAAW,mBACX,QAAQ,eACR,SACA,oBACuB,EAAE,KAG7B,OAAO,GAAG,SAA2B;CACnC,IAAI;AAEJ,MAAK,IAAI,UAAU,GAAG,WAAW,UAAU,UACzC,KAAI;AACF,SAAO,MAAM,GAAG,GAAG,KAAK;UACjB,KAAK;AACZ,cAAY;EACZ,MAAM,QAAQA,sDAAoB,IAAI;AAGtC,MAAI,WAAW,UAAU;AACvB,OAAI,iBAAiB;AACnB,sBAAkB;KAAE;KAAO;KAAS;KAAU,CAAC;AAC/C,WAAO;;AAIT,SAAM;;AAGR,MAAI,QACF,WAAU;GAAE;GAAO;GAAS;GAAU,CAAC;MAEvC,uBAAO,OAAO,EACZ,OAAO,SACR,CAAC;AAIJ,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,QAAQ,WAAW,KAAK,MAAM,CAAC;;AAMxD,OACE,6BAAa,IAAI,MAAM,kDAAkD"}
@@ -1,2 +1,14 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/([A-Z])([A-Z][a-z])/g,`$1-$2`).toLowerCase();exports.camelCaseToKebabCase=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/stringFormatter/camelCaseToKebabCase.ts
4
+ /**
5
+ * Convert a string to kebab-case
6
+ * e.g. "MyNewComponent" => "my-new-component"
7
+ */
8
+ const camelCaseToKebabCase = (str) => {
9
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
10
+ };
11
+
12
+ //#endregion
13
+ exports.camelCaseToKebabCase = camelCaseToKebabCase;
2
14
  //# sourceMappingURL=camelCaseToKebabCase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"camelCaseToKebabCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToKebabCase.ts"],"sourcesContent":["/**\n * Convert a string to kebab-case\n * e.g. \"MyNewComponent\" => \"my-new-component\"\n */\nexport const camelCaseToKebabCase = (str: string): string => {\n // Split on transition from lower->upper: \"MyNewComponent\" => [\"My\", \"New\", \"Component\"]\n // Then lowercase each chunk and join by \"-\"\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n};\n"],"mappings":"mEAIA,MAAa,EAAwB,GAG5B,EACJ,QAAQ,kBAAmB,QAAQ,CACnC,QAAQ,uBAAwB,QAAQ,CACxC,aAAa"}
1
+ {"version":3,"file":"camelCaseToKebabCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToKebabCase.ts"],"sourcesContent":["/**\n * Convert a string to kebab-case\n * e.g. \"MyNewComponent\" => \"my-new-component\"\n */\nexport const camelCaseToKebabCase = (str: string): string => {\n // Split on transition from lower->upper: \"MyNewComponent\" => [\"My\", \"New\", \"Component\"]\n // Then lowercase each chunk and join by \"-\"\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB,QAAwB;AAG3D,QAAO,IACJ,QAAQ,mBAAmB,QAAQ,CACnC,QAAQ,wBAAwB,QAAQ,CACxC,aAAa"}
@@ -1,2 +1,17 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{if(!e||typeof e!=`string`)return``;let t=e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()};exports.camelCaseToSentence=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/stringFormatter/camelCaseToSentence.ts
4
+ /**
5
+ * Convert a string to sentence case
6
+ * e.g. 'my-new-component' → 'My new component'
7
+ */
8
+ const camelCaseToSentence = (value) => {
9
+ if (!value) return "";
10
+ if (typeof value !== "string") return "";
11
+ const withSpaces = value.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
12
+ return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();
13
+ };
14
+
15
+ //#endregion
16
+ exports.camelCaseToSentence = camelCaseToSentence;
2
17
  //# sourceMappingURL=camelCaseToSentence.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"camelCaseToSentence.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToSentence.ts"],"sourcesContent":["/**\n * Convert a string to sentence case\n * e.g. 'my-new-component' → 'My new component'\n */\nexport const camelCaseToSentence = (value: string): string => {\n if (!value) return '';\n if (typeof value !== 'string') return '';\n\n // Insert space before all caps that follow lowercase letters\n const withSpaces = value\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n // Insert space between sequences like \"XMLParser\" → \"XML Parser\"\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');\n\n // Lowercase everything except the first character\n return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();\n};\n"],"mappings":"mEAIA,MAAa,EAAuB,GAA0B,CAE5D,GADI,CAAC,GACD,OAAO,GAAU,SAAU,MAAO,GAGtC,IAAM,EAAa,EAChB,QAAQ,kBAAmB,QAAQ,CAEnC,QAAQ,wBAAyB,QAAQ,CAG5C,OAAO,EAAW,OAAO,EAAE,CAAC,aAAa,CAAG,EAAW,MAAM,EAAE,CAAC,aAAa"}
1
+ {"version":3,"file":"camelCaseToSentence.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToSentence.ts"],"sourcesContent":["/**\n * Convert a string to sentence case\n * e.g. 'my-new-component' → 'My new component'\n */\nexport const camelCaseToSentence = (value: string): string => {\n if (!value) return '';\n if (typeof value !== 'string') return '';\n\n // Insert space before all caps that follow lowercase letters\n const withSpaces = value\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n // Insert space between sequences like \"XMLParser\" → \"XML Parser\"\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');\n\n // Lowercase everything except the first character\n return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();\n};\n"],"mappings":";;;;;;;AAIA,MAAa,uBAAuB,UAA0B;AAC5D,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,OAAO,UAAU,SAAU,QAAO;CAGtC,MAAM,aAAa,MAChB,QAAQ,mBAAmB,QAAQ,CAEnC,QAAQ,yBAAyB,QAAQ;AAG5C,QAAO,WAAW,OAAO,EAAE,CAAC,aAAa,GAAG,WAAW,MAAM,EAAE,CAAC,aAAa"}
@@ -1 +1,10 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./camelCaseToKebabCase.cjs`),t=require(`./camelCaseToSentence.cjs`),n=require(`./kebabCaseToCamelCase.cjs`),r=require(`./toLowerCamelCase.cjs`);exports.camelCaseToKebabCase=e.camelCaseToKebabCase,exports.camelCaseToSentence=t.camelCaseToSentence,exports.kebabCaseToCamelCase=n.kebabCaseToCamelCase,exports.toLowerCamelCase=r.toLowerCamelCase;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_stringFormatter_camelCaseToKebabCase = require('./camelCaseToKebabCase.cjs');
3
+ const require_utils_stringFormatter_camelCaseToSentence = require('./camelCaseToSentence.cjs');
4
+ const require_utils_stringFormatter_kebabCaseToCamelCase = require('./kebabCaseToCamelCase.cjs');
5
+ const require_utils_stringFormatter_toLowerCamelCase = require('./toLowerCamelCase.cjs');
6
+
7
+ exports.camelCaseToKebabCase = require_utils_stringFormatter_camelCaseToKebabCase.camelCaseToKebabCase;
8
+ exports.camelCaseToSentence = require_utils_stringFormatter_camelCaseToSentence.camelCaseToSentence;
9
+ exports.kebabCaseToCamelCase = require_utils_stringFormatter_kebabCaseToCamelCase.kebabCaseToCamelCase;
10
+ exports.toLowerCamelCase = require_utils_stringFormatter_toLowerCamelCase.toLowerCamelCase;
@@ -1,2 +1,15 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>{let t=e.toLowerCase(),n=t.charAt(0).toUpperCase()+t.slice(1);return n=n.replace(/(\d)([a-z])/g,(e,t,n)=>t+n.toUpperCase()),n}).join(``);exports.kebabCaseToCamelCase=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/stringFormatter/kebabCaseToCamelCase.ts
4
+ const kebabCaseToCamelCase = (name) => {
5
+ return name.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((word) => {
6
+ const lowerWord = word.toLowerCase();
7
+ let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);
8
+ capitalized = capitalized.replace(/(\d)([a-z])/g, (_, number, char) => number + char.toUpperCase());
9
+ return capitalized;
10
+ }).join("");
11
+ };
12
+
13
+ //#endregion
14
+ exports.kebabCaseToCamelCase = kebabCaseToCamelCase;
2
15
  //# sourceMappingURL=kebabCaseToCamelCase.cjs.map