@intlayer/config 9.0.0-canary.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/cjs/built.cjs +2 -0
  2. package/dist/cjs/built.cjs.map +1 -1
  3. package/dist/cjs/bundle/index.cjs.map +1 -1
  4. package/dist/cjs/bundle/logBundle.cjs.map +1 -1
  5. package/dist/cjs/callers/base.cjs +42 -0
  6. package/dist/cjs/callers/base.cjs.map +1 -0
  7. package/dist/cjs/callers/compat/i18next.cjs +27 -0
  8. package/dist/cjs/callers/compat/i18next.cjs.map +1 -0
  9. package/dist/cjs/callers/compat/lingui.cjs +82 -0
  10. package/dist/cjs/callers/compat/lingui.cjs.map +1 -0
  11. package/dist/cjs/callers/compat/nextIntl.cjs +44 -0
  12. package/dist/cjs/callers/compat/nextIntl.cjs.map +1 -0
  13. package/dist/cjs/callers/compat/reactI18next.cjs +50 -0
  14. package/dist/cjs/callers/compat/reactI18next.cjs.map +1 -0
  15. package/dist/cjs/callers/compat/reactIntl.cjs +31 -0
  16. package/dist/cjs/callers/compat/reactIntl.cjs.map +1 -0
  17. package/dist/cjs/callers/compat/useIntl.cjs +46 -0
  18. package/dist/cjs/callers/compat/useIntl.cjs.map +1 -0
  19. package/dist/cjs/callers/compat/vueI18n.cjs +26 -0
  20. package/dist/cjs/callers/compat/vueI18n.cjs.map +1 -0
  21. package/dist/cjs/callers/index.cjs +87 -0
  22. package/dist/cjs/callers/index.cjs.map +1 -0
  23. package/dist/cjs/callers/transform.cjs +46 -0
  24. package/dist/cjs/callers/transform.cjs.map +1 -0
  25. package/dist/cjs/callers/types.cjs +0 -0
  26. package/dist/cjs/client.cjs +1 -0
  27. package/dist/cjs/configFile/buildBrowserConfiguration.cjs +47 -3
  28. package/dist/cjs/configFile/buildBrowserConfiguration.cjs.map +1 -1
  29. package/dist/cjs/configFile/buildConfigurationFields.cjs +9 -3
  30. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  31. package/dist/cjs/configFile/configurationSchema.cjs +7 -0
  32. package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
  33. package/dist/cjs/configFile/getConfiguration.cjs +10 -3
  34. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  35. package/dist/cjs/configFile/index.cjs +2 -0
  36. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  37. package/dist/cjs/configFile/searchConfigurationFile.cjs +0 -1
  38. package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
  39. package/dist/cjs/defaultValues/analytics.cjs +16 -0
  40. package/dist/cjs/defaultValues/analytics.cjs.map +1 -0
  41. package/dist/cjs/defaultValues/build.cjs.map +1 -1
  42. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  43. package/dist/cjs/defaultValues/index.cjs +4 -0
  44. package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
  45. package/dist/cjs/defaultValues/routing.cjs.map +1 -1
  46. package/dist/cjs/envVars/envVars.cjs +2 -1
  47. package/dist/cjs/envVars/envVars.cjs.map +1 -1
  48. package/dist/cjs/loadEnvFile.cjs +44 -7
  49. package/dist/cjs/loadEnvFile.cjs.map +1 -1
  50. package/dist/cjs/loadExternalFile/bundleFile.cjs +4 -3
  51. package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -1
  52. package/dist/cjs/loadExternalFile/bundleJSFile.cjs +0 -1
  53. package/dist/cjs/loadExternalFile/bundleJSFile.cjs.map +1 -1
  54. package/dist/cjs/loadExternalFile/index.cjs +1 -0
  55. package/dist/cjs/loadExternalFile/loadExternalFile.cjs +11 -6
  56. package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
  57. package/dist/cjs/loadExternalFile/parseFileContent.cjs +52 -17
  58. package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
  59. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +99 -10
  60. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
  61. package/dist/cjs/logger.cjs +2 -1
  62. package/dist/cjs/logger.cjs.map +1 -1
  63. package/dist/cjs/node.cjs +2 -0
  64. package/dist/cjs/utils/ESMxCJSHelpers.cjs +0 -1
  65. package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
  66. package/dist/cjs/utils/alias.cjs +0 -1
  67. package/dist/cjs/utils/alias.cjs.map +1 -1
  68. package/dist/cjs/utils/builtConfigKeys.cjs +38 -0
  69. package/dist/cjs/utils/builtConfigKeys.cjs.map +1 -0
  70. package/dist/cjs/utils/cacheDisk.cjs +2 -1
  71. package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
  72. package/dist/cjs/utils/cacheMemory.cjs +0 -1
  73. package/dist/cjs/utils/cacheMemory.cjs.map +1 -1
  74. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
  75. package/dist/cjs/utils/compareVersions.cjs.map +1 -1
  76. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
  77. package/dist/cjs/utils/getDictionarySelectorUsage.cjs.map +1 -1
  78. package/dist/cjs/utils/getExtension.cjs.map +1 -1
  79. package/dist/cjs/utils/getPackageJsonPath.cjs +0 -1
  80. package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
  81. package/dist/cjs/utils/getStorageAttributes.cjs +2 -1
  82. package/dist/cjs/utils/getStorageAttributes.cjs.map +1 -1
  83. package/dist/cjs/utils/getUsedNodeTypes.cjs +0 -1
  84. package/dist/cjs/utils/getUsedNodeTypes.cjs.map +1 -1
  85. package/dist/cjs/utils/index.cjs +2 -0
  86. package/dist/cjs/utils/logStack.cjs.map +1 -1
  87. package/dist/cjs/utils/normalizePath.cjs.map +1 -1
  88. package/dist/cjs/utils/parseFilePathPattern.cjs.map +1 -1
  89. package/dist/cjs/utils/pathSecurity.cjs +0 -1
  90. package/dist/cjs/utils/pathSecurity.cjs.map +1 -1
  91. package/dist/cjs/utils/retryManager.cjs.map +1 -1
  92. package/dist/cjs/utils/setIntlayerIdentifier.cjs.map +1 -1
  93. package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs.map +1 -1
  94. package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs.map +1 -1
  95. package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs.map +1 -1
  96. package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs.map +1 -1
  97. package/dist/esm/built.mjs +2 -1
  98. package/dist/esm/built.mjs.map +1 -1
  99. package/dist/esm/bundle/index.mjs +3 -3
  100. package/dist/esm/bundle/index.mjs.map +1 -1
  101. package/dist/esm/bundle/logBundle.mjs.map +1 -1
  102. package/dist/esm/callers/base.mjs +40 -0
  103. package/dist/esm/callers/base.mjs.map +1 -0
  104. package/dist/esm/callers/compat/i18next.mjs +25 -0
  105. package/dist/esm/callers/compat/i18next.mjs.map +1 -0
  106. package/dist/esm/callers/compat/lingui.mjs +80 -0
  107. package/dist/esm/callers/compat/lingui.mjs.map +1 -0
  108. package/dist/esm/callers/compat/nextIntl.mjs +42 -0
  109. package/dist/esm/callers/compat/nextIntl.mjs.map +1 -0
  110. package/dist/esm/callers/compat/reactI18next.mjs +48 -0
  111. package/dist/esm/callers/compat/reactI18next.mjs.map +1 -0
  112. package/dist/esm/callers/compat/reactIntl.mjs +29 -0
  113. package/dist/esm/callers/compat/reactIntl.mjs.map +1 -0
  114. package/dist/esm/callers/compat/useIntl.mjs +44 -0
  115. package/dist/esm/callers/compat/useIntl.mjs.map +1 -0
  116. package/dist/esm/callers/compat/vueI18n.mjs +24 -0
  117. package/dist/esm/callers/compat/vueI18n.mjs.map +1 -0
  118. package/dist/esm/callers/index.mjs +72 -0
  119. package/dist/esm/callers/index.mjs.map +1 -0
  120. package/dist/esm/callers/transform.mjs +43 -0
  121. package/dist/esm/callers/transform.mjs.map +1 -0
  122. package/dist/esm/callers/types.mjs +0 -0
  123. package/dist/esm/client.mjs +2 -2
  124. package/dist/esm/configFile/buildBrowserConfiguration.mjs +47 -4
  125. package/dist/esm/configFile/buildBrowserConfiguration.mjs.map +1 -1
  126. package/dist/esm/configFile/buildConfigurationFields.mjs +10 -4
  127. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  128. package/dist/esm/configFile/configurationSchema.mjs +7 -1
  129. package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
  130. package/dist/esm/configFile/getConfiguration.mjs +10 -2
  131. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  132. package/dist/esm/configFile/index.mjs +3 -3
  133. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  134. package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
  135. package/dist/esm/defaultValues/analytics.mjs +12 -0
  136. package/dist/esm/defaultValues/analytics.mjs.map +1 -0
  137. package/dist/esm/defaultValues/build.mjs.map +1 -1
  138. package/dist/esm/defaultValues/content.mjs.map +1 -1
  139. package/dist/esm/defaultValues/index.mjs +2 -1
  140. package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
  141. package/dist/esm/defaultValues/routing.mjs.map +1 -1
  142. package/dist/esm/envVars/envVars.mjs +2 -1
  143. package/dist/esm/envVars/envVars.mjs.map +1 -1
  144. package/dist/esm/loadEnvFile.mjs +45 -8
  145. package/dist/esm/loadEnvFile.mjs.map +1 -1
  146. package/dist/esm/loadExternalFile/bundleFile.mjs +4 -2
  147. package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -1
  148. package/dist/esm/loadExternalFile/bundleJSFile.mjs.map +1 -1
  149. package/dist/esm/loadExternalFile/index.mjs +2 -2
  150. package/dist/esm/loadExternalFile/loadExternalFile.mjs +11 -6
  151. package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
  152. package/dist/esm/loadExternalFile/parseFileContent.mjs +52 -17
  153. package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
  154. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +102 -13
  155. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
  156. package/dist/esm/logger.mjs +2 -1
  157. package/dist/esm/logger.mjs.map +1 -1
  158. package/dist/esm/node.mjs +3 -3
  159. package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
  160. package/dist/esm/utils/alias.mjs.map +1 -1
  161. package/dist/esm/utils/builtConfigKeys.mjs +36 -0
  162. package/dist/esm/utils/builtConfigKeys.mjs.map +1 -0
  163. package/dist/esm/utils/cacheDisk.mjs +6 -5
  164. package/dist/esm/utils/cacheDisk.mjs.map +1 -1
  165. package/dist/esm/utils/cacheMemory.mjs.map +1 -1
  166. package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
  167. package/dist/esm/utils/compareVersions.mjs.map +1 -1
  168. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
  169. package/dist/esm/utils/getDictionarySelectorUsage.mjs.map +1 -1
  170. package/dist/esm/utils/getExtension.mjs.map +1 -1
  171. package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -1
  172. package/dist/esm/utils/getStorageAttributes.mjs +2 -1
  173. package/dist/esm/utils/getStorageAttributes.mjs.map +1 -1
  174. package/dist/esm/utils/getUsedNodeTypes.mjs.map +1 -1
  175. package/dist/esm/utils/index.mjs +2 -1
  176. package/dist/esm/utils/logStack.mjs.map +1 -1
  177. package/dist/esm/utils/normalizePath.mjs.map +1 -1
  178. package/dist/esm/utils/parseFilePathPattern.mjs.map +1 -1
  179. package/dist/esm/utils/pathSecurity.mjs.map +1 -1
  180. package/dist/esm/utils/retryManager.mjs.map +1 -1
  181. package/dist/esm/utils/setIntlayerIdentifier.mjs.map +1 -1
  182. package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs.map +1 -1
  183. package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs.map +1 -1
  184. package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs.map +1 -1
  185. package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs.map +1 -1
  186. package/dist/types/built.d.ts +2 -1
  187. package/dist/types/built.d.ts.map +1 -1
  188. package/dist/types/bundle/index.d.ts +2 -4
  189. package/dist/types/bundle/index.d.ts.map +1 -1
  190. package/dist/types/bundle/logBundle.d.ts +0 -1
  191. package/dist/types/bundle/logBundle.d.ts.map +1 -1
  192. package/dist/types/callers/base.d.ts +13 -0
  193. package/dist/types/callers/base.d.ts.map +1 -0
  194. package/dist/types/callers/compat/i18next.d.ts +11 -0
  195. package/dist/types/callers/compat/i18next.d.ts.map +1 -0
  196. package/dist/types/callers/compat/lingui.d.ts +6 -0
  197. package/dist/types/callers/compat/lingui.d.ts.map +1 -0
  198. package/dist/types/callers/compat/nextIntl.d.ts +12 -0
  199. package/dist/types/callers/compat/nextIntl.d.ts.map +1 -0
  200. package/dist/types/callers/compat/reactI18next.d.ts +14 -0
  201. package/dist/types/callers/compat/reactI18next.d.ts.map +1 -0
  202. package/dist/types/callers/compat/reactIntl.d.ts +15 -0
  203. package/dist/types/callers/compat/reactIntl.d.ts.map +1 -0
  204. package/dist/types/callers/compat/useIntl.d.ts +11 -0
  205. package/dist/types/callers/compat/useIntl.d.ts.map +1 -0
  206. package/dist/types/callers/compat/vueI18n.d.ts +11 -0
  207. package/dist/types/callers/compat/vueI18n.d.ts.map +1 -0
  208. package/dist/types/callers/index.d.ts +48 -0
  209. package/dist/types/callers/index.d.ts.map +1 -0
  210. package/dist/types/callers/transform.d.ts +60 -0
  211. package/dist/types/callers/transform.d.ts.map +1 -0
  212. package/dist/types/callers/types.d.ts +160 -0
  213. package/dist/types/callers/types.d.ts.map +1 -0
  214. package/dist/types/client.d.ts +2 -2
  215. package/dist/types/colors.d.ts +14 -14
  216. package/dist/types/colors.d.ts.map +1 -1
  217. package/dist/types/configFile/buildBrowserConfiguration.d.ts +24 -4
  218. package/dist/types/configFile/buildBrowserConfiguration.d.ts.map +1 -1
  219. package/dist/types/configFile/buildConfigurationFields.d.ts +8 -4
  220. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  221. package/dist/types/configFile/configurationSchema.d.ts +43 -34
  222. package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
  223. package/dist/types/configFile/getConfiguration.d.ts +0 -1
  224. package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
  225. package/dist/types/configFile/index.d.ts +3 -3
  226. package/dist/types/configFile/loadConfigurationFile.d.ts +1 -2
  227. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
  228. package/dist/types/configFile/searchConfigurationFile.d.ts +1 -1
  229. package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
  230. package/dist/types/defaultValues/analytics.d.ts +11 -0
  231. package/dist/types/defaultValues/analytics.d.ts.map +1 -0
  232. package/dist/types/defaultValues/build.d.ts.map +1 -1
  233. package/dist/types/defaultValues/compiler.d.ts.map +1 -1
  234. package/dist/types/defaultValues/content.d.ts.map +1 -1
  235. package/dist/types/defaultValues/dictionary.d.ts +0 -1
  236. package/dist/types/defaultValues/dictionary.d.ts.map +1 -1
  237. package/dist/types/defaultValues/editor.d.ts.map +1 -1
  238. package/dist/types/defaultValues/index.d.ts +2 -1
  239. package/dist/types/defaultValues/internationalization.d.ts +0 -1
  240. package/dist/types/defaultValues/internationalization.d.ts.map +1 -1
  241. package/dist/types/defaultValues/log.d.ts.map +1 -1
  242. package/dist/types/defaultValues/routing.d.ts +0 -1
  243. package/dist/types/defaultValues/routing.d.ts.map +1 -1
  244. package/dist/types/defaultValues/system.d.ts.map +1 -1
  245. package/dist/types/envVars/envVars.d.ts +0 -1
  246. package/dist/types/envVars/envVars.d.ts.map +1 -1
  247. package/dist/types/loadEnvFile.d.ts +1 -1
  248. package/dist/types/loadEnvFile.d.ts.map +1 -1
  249. package/dist/types/loadExternalFile/bundleFile.d.ts +0 -1
  250. package/dist/types/loadExternalFile/bundleFile.d.ts.map +1 -1
  251. package/dist/types/loadExternalFile/bundleJSFile.d.ts +57 -59
  252. package/dist/types/loadExternalFile/bundleJSFile.d.ts.map +1 -1
  253. package/dist/types/loadExternalFile/index.d.ts +2 -2
  254. package/dist/types/loadExternalFile/loadExternalFile.d.ts +0 -1
  255. package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -1
  256. package/dist/types/loadExternalFile/parseFileContent.d.ts +9 -1
  257. package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -1
  258. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +4 -4
  259. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -1
  260. package/dist/types/logger.d.ts +2 -3
  261. package/dist/types/logger.d.ts.map +1 -1
  262. package/dist/types/node.d.ts +3 -3
  263. package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
  264. package/dist/types/utils/alias.d.ts +1 -6
  265. package/dist/types/utils/alias.d.ts.map +1 -1
  266. package/dist/types/utils/builtConfigKeys.d.ts +25 -0
  267. package/dist/types/utils/builtConfigKeys.d.ts.map +1 -0
  268. package/dist/types/utils/cacheDisk.d.ts +22 -11
  269. package/dist/types/utils/cacheDisk.d.ts.map +1 -1
  270. package/dist/types/utils/cacheMemory.d.ts +3 -3
  271. package/dist/types/utils/cacheMemory.d.ts.map +1 -1
  272. package/dist/types/utils/clearModuleCache.d.ts.map +1 -1
  273. package/dist/types/utils/compareVersions.d.ts +1 -1
  274. package/dist/types/utils/compareVersions.d.ts.map +1 -1
  275. package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
  276. package/dist/types/utils/getDictionarySelectorUsage.d.ts +0 -1
  277. package/dist/types/utils/getDictionarySelectorUsage.d.ts.map +1 -1
  278. package/dist/types/utils/getExtension.d.ts +1 -2
  279. package/dist/types/utils/getExtension.d.ts.map +1 -1
  280. package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -1
  281. package/dist/types/utils/getStorageAttributes.d.ts +0 -1
  282. package/dist/types/utils/getStorageAttributes.d.ts.map +1 -1
  283. package/dist/types/utils/getUsedNodeTypes.d.ts +0 -1
  284. package/dist/types/utils/getUsedNodeTypes.d.ts.map +1 -1
  285. package/dist/types/utils/index.d.ts +2 -1
  286. package/dist/types/utils/logStack.d.ts.map +1 -1
  287. package/dist/types/utils/normalizePath.d.ts.map +1 -1
  288. package/dist/types/utils/parseFilePathPattern.d.ts +0 -1
  289. package/dist/types/utils/parseFilePathPattern.d.ts.map +1 -1
  290. package/dist/types/utils/pathSecurity.d.ts.map +1 -1
  291. package/dist/types/utils/retryManager.d.ts +8 -9
  292. package/dist/types/utils/retryManager.d.ts.map +1 -1
  293. package/dist/types/utils/setIntlayerIdentifier.d.ts.map +1 -1
  294. package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +1 -1
  295. package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +1 -1
  296. package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +1 -1
  297. package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +1 -1
  298. package/package.json +11 -7
  299. package/dist/cjs/built.browser.cjs +0 -46
  300. package/dist/cjs/built.browser.cjs.map +0 -1
  301. package/dist/esm/built.browser.mjs +0 -32
  302. package/dist/esm/built.browser.mjs.map +0 -1
  303. package/dist/types/built.browser.d.ts +0 -27
  304. package/dist/types/built.browser.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"clearModuleCache.cjs","names":["configESMxCJSRequire"],"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":["import { configESMxCJSRequire } from './ESMxCJSHelpers';\n\n/**\n * Recursively clears the require cache for a module and all its dependencies\n */\nexport const clearModuleCache = (\n modulePath: string,\n visited = new Set<string>()\n) => {\n // Avoid infinite loops\n if (visited.has(modulePath)) {\n return;\n }\n visited.add(modulePath);\n\n try {\n const resolvedPath = configESMxCJSRequire.resolve(modulePath);\n\n // Get the cached module\n const cachedModule = configESMxCJSRequire.cache[resolvedPath];\n\n if (cachedModule) {\n // Clear cache for all children (dependencies) first\n if (cachedModule.children) {\n cachedModule.children.forEach((child) => {\n clearModuleCache(child.filename, visited);\n });\n }\n\n // Clear the cache for this module\n delete configESMxCJSRequire.cache[resolvedPath];\n }\n } catch (error) {\n // Module might not exist or be resolvable, skip it\n console.warn(`Could not clear cache for module: ${modulePath}`, error);\n }\n};\n"],"mappings":";;;;;;;AAKA,MAAa,oBACX,YACA,0BAAU,IAAI,KAAa,KACxB;AAEH,KAAI,QAAQ,IAAI,WAAW,CACzB;AAEF,SAAQ,IAAI,WAAW;AAEvB,KAAI;EACF,MAAM,eAAeA,kDAAqB,QAAQ,WAAW;EAG7D,MAAM,eAAeA,kDAAqB,MAAM;AAEhD,MAAI,cAAc;AAEhB,OAAI,aAAa,SACf,cAAa,SAAS,SAAS,UAAU;AACvC,qBAAiB,MAAM,UAAU,QAAQ;KACzC;AAIJ,UAAOA,kDAAqB,MAAM;;UAE7B,OAAO;AAEd,UAAQ,KAAK,qCAAqC,cAAc,MAAM"}
1
+ {"version":3,"file":"clearModuleCache.cjs","names":["configESMxCJSRequire"],"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":["import { configESMxCJSRequire } from './ESMxCJSHelpers';\n\n/**\n * Recursively clears the require cache for a module and all its dependencies\n */\nexport const clearModuleCache = (\n modulePath: string,\n visited = new Set<string>()\n) => {\n // Avoid infinite loops\n if (visited.has(modulePath)) {\n return;\n }\n visited.add(modulePath);\n\n try {\n const resolvedPath = configESMxCJSRequire.resolve(modulePath);\n\n // Get the cached module\n const cachedModule = configESMxCJSRequire.cache[resolvedPath];\n\n if (cachedModule) {\n // Clear cache for all children (dependencies) first\n if (cachedModule.children) {\n cachedModule.children.forEach((child) => {\n clearModuleCache(child.filename, visited);\n });\n }\n\n // Clear the cache for this module\n delete configESMxCJSRequire.cache[resolvedPath];\n }\n } catch (error) {\n // Module might not exist or be resolvable, skip it\n console.warn(`Could not clear cache for module: ${modulePath}`, error);\n }\n};\n"],"mappings":";;;;;;;AAKA,MAAa,oBACX,YACA,0BAAU,IAAI,IAAY,MACvB;CAEH,IAAI,QAAQ,IAAI,UAAU,GACxB;CAEF,QAAQ,IAAI,UAAU;CAEtB,IAAI;EACF,MAAM,eAAeA,kDAAqB,QAAQ,UAAU;EAG5D,MAAM,eAAeA,kDAAqB,MAAM;EAEhD,IAAI,cAAc;GAEhB,IAAI,aAAa,UACf,aAAa,SAAS,SAAS,UAAU;IACvC,iBAAiB,MAAM,UAAU,OAAO;GAC1C,CAAC;GAIH,OAAOA,kDAAqB,MAAM;EACpC;CACF,SAAS,OAAO;EAEd,QAAQ,KAAK,qCAAqC,cAAc,KAAK;CACvE;AACF"}
@@ -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":";;;;;;;;;;;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
+ {"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,GAAG,CAAC,CAAC,IAAI,MAAM;CAC9C,MAAM,UAAU,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAC9C,MAAM,SAAS,KAAK,IAAI,QAAQ,QAAQ,QAAQ,MAAM;CAGtD,IAAI,SAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK;EAC/B,MAAM,QAAQ,QAAQ,MAAM;EAC5B,MAAM,QAAQ,QAAQ,MAAM;EAC5B,IAAI,QAAQ,OAAO;GACjB,SAAS;GACT;EACF,OAAO,IAAI,QAAQ,OAAO;GACxB,SAAS;GACT;EACF;CACF;CAEA,QAAQ,YAAR;EACE,KAAK,KACH,OAAO,WAAW;EACpB,KAAK,KACH,OAAO,WAAW;EACpB,KAAK,KACH,OAAO,WAAW;EACpB,KAAK,KACH,OAAO,WAAW,KAAK,WAAW;EACpC,KAAK,KACH,OAAO,WAAW,KAAK,WAAW;CACtC;AACF"}
@@ -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((stringValue) => stringValue.trim())\n .filter(Boolean)[0] ?? text.trim();\n\n const looksLikeJson = (value: string): boolean => {\n const stringValue = value.trim();\n\n if (!stringValue) return false;\n const first = stringValue[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\n if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {\n const quoted = t.match(/\"([^\"]+)\"/);\n\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\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\n if (seen.has(value)) return undefined;\n\n seen.add(value);\n\n // If the value itself is an array (e.g. ZodError.issues), iterate its items\n\n if (Array.isArray(value)) {\n for (const item of value) {\n const fromItem = pickFieldsFromObject(item, seen);\n\n if (fromItem) return fromItem;\n\n if (typeof (item as any)?.message === 'string')\n return (item as any).message;\n }\n return undefined;\n }\n\n const obj = value as Record<string, unknown>;\n\n // Check for message first (highest priority)\n\n if (typeof obj.message === 'string' && obj.message.trim()) {\n return obj.message;\n }\n\n // Check for error_description\n\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\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\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\n if (response && typeof response === 'object') {\n const data = response.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n\n if (fromData) return fromData;\n }\n\n const data = obj.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n\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\n if (fromCause) return fromCause;\n\n // Arrays of errors\n const errors = obj.errors as unknown;\n\n if (Array.isArray(errors)) {\n for (const item of errors) {\n const fromItem = pickFieldsFromObject(item, seen);\n\n if (fromItem) return fromItem;\n\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\n if (picked) return picked;\n\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\n if (error instanceof Error) {\n const cleaned = sanitizeUnexpectedTokenMessage(error.message);\n const fromMessage = tryParseJsonString(cleaned);\n\n if (fromMessage) return trimToSingleLine(fromMessage);\n // Dive into cause when present\n const fromCause = extractErrorMessage(error.cause as unknown);\n\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\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":";;;AAAA,MAAa,uBAAuB,UAA2B;CAC7D,MAAM,oBAAoB,SACxB,KACG,MAAM,QAAQ,CACd,KAAK,gBAAgB,YAAY,MAAM,CAAC,CACxC,OAAO,QAAQ,CAAC,MAAM,KAAK,MAAM;CAEtC,MAAM,iBAAiB,UAA2B;EAChD,MAAM,cAAc,MAAM,MAAM;AAEhC,MAAI,CAAC,YAAa,QAAO;EACzB,MAAM,QAAQ,YAAY;AAC1B,SAAO,UAAU,OAAO,UAAU,OAAO,UAAU;;CAGrD,MAAM,kCAAkC,SAAyB;EAE/D,MAAM,IAAI,KAAK,MAAM;AAErB,MAAI,oBAAoB,KAAK,EAAE,IAAI,kBAAkB,KAAK,EAAE,EAAE;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mB,QAAQ,IAAI,iBAAiB,QAAQ;;AAGjE,MAAI;AAEF,UAAO,iBADY,KAAK,UAAU,MACA,CAAC;UAC7B;AACN,UAAO,iBAAiB,OAAO,MAAM,CAAC;;;AAI1C,QAAO"}
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((stringValue) => stringValue.trim())\n .filter(Boolean)[0] ?? text.trim();\n\n const looksLikeJson = (value: string): boolean => {\n const stringValue = value.trim();\n\n if (!stringValue) return false;\n const first = stringValue[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\n if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {\n const quoted = t.match(/\"([^\"]+)\"/);\n\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\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\n if (seen.has(value)) return undefined;\n\n seen.add(value);\n\n // If the value itself is an array (e.g. ZodError.issues), iterate its items\n\n if (Array.isArray(value)) {\n for (const item of value) {\n const fromItem = pickFieldsFromObject(item, seen);\n\n if (fromItem) return fromItem;\n\n if (typeof (item as any)?.message === 'string')\n return (item as any).message;\n }\n return undefined;\n }\n\n const obj = value as Record<string, unknown>;\n\n // Check for message first (highest priority)\n\n if (typeof obj.message === 'string' && obj.message.trim()) {\n return obj.message;\n }\n\n // Check for error_description\n\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\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\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\n if (response && typeof response === 'object') {\n const data = response.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n\n if (fromData) return fromData;\n }\n\n const data = obj.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n\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\n if (fromCause) return fromCause;\n\n // Arrays of errors\n const errors = obj.errors as unknown;\n\n if (Array.isArray(errors)) {\n for (const item of errors) {\n const fromItem = pickFieldsFromObject(item, seen);\n\n if (fromItem) return fromItem;\n\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\n if (picked) return picked;\n\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\n if (error instanceof Error) {\n const cleaned = sanitizeUnexpectedTokenMessage(error.message);\n const fromMessage = tryParseJsonString(cleaned);\n\n if (fromMessage) return trimToSingleLine(fromMessage);\n // Dive into cause when present\n const fromCause = extractErrorMessage(error.cause as unknown);\n\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\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":";;;AAAA,MAAa,uBAAuB,UAA2B;CAC7D,MAAM,oBAAoB,SACxB,KACG,MAAM,OAAO,CAAC,CACd,KAAK,gBAAgB,YAAY,KAAK,CAAC,CAAC,CACxC,OAAO,OAAO,CAAC,CAAC,MAAM,KAAK,KAAK;CAErC,MAAM,iBAAiB,UAA2B;EAChD,MAAM,cAAc,MAAM,KAAK;EAE/B,IAAI,CAAC,aAAa,OAAO;EACzB,MAAM,QAAQ,YAAY;EAC1B,OAAO,UAAU,OAAO,UAAU,OAAO,UAAU;CACrD;CAEA,MAAM,kCAAkC,SAAyB;EAE/D,MAAM,IAAI,KAAK,KAAK;EAEpB,IAAI,oBAAoB,KAAK,CAAC,KAAK,kBAAkB,KAAK,CAAC,GAAG;GAC5D,MAAM,SAAS,EAAE,MAAM,WAAW;GAElC,IAAI,SAAS,IAAI,OAAO,OAAO;GAE/B,MAAM,aAAa,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK;GAExD,IAAI,YAAY,OAAO;EACzB;EACA,OAAO;CACT;CAEA,MAAM,wBACJ,OACA,SACuB;EACvB,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;EAEhD,IAAI,KAAK,IAAI,KAAK,GAAG,OAAO;EAE5B,KAAK,IAAI,KAAK;EAId,IAAI,MAAM,QAAQ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AEhD,IAAI,UAAU,OAAO;GAErB,IAAI,OAAQ,MAAc,YAAY,UACpC,OAAQ,KAAa;EACzB;CAIJ;CAEA,MAAM,sBAAsB,cAA0C;EACpE,IAAI,CAAC,cAAc,SAAS,GAAG,OAAO;EACtC,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,SAAS;GACnC,MAAM,SAAS,qBAAqB,wBAAQ,IAAI,IAAI,CAAC;GAErD,IAAI,QAAQ,OAAO;GAEnB,IAAI,OAAO,WAAW,UAAU,OAAO;GACvC;EACF,QAAQ;GACN;EACF;CACF;CAEA,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,UAAU,+BAA+B,KAAK;EACpD,OAAO,mBAAmB,OAAO,KAAK,iBAAiB,OAAO;CAChE;CAEA,IAAI,SAAS,OAAO,UAAU,UAAU;EAGtC,IAAI,iBAAiB,OAAO;GAC1B,MAAM,UAAU,+BAA+B,MAAM,OAAO;GAC5D,MAAM,cAAc,mBAAmB,OAAO;GAE9C,IAAI,aAAa,OAAO,iBAAiB,WAAW;GAEpD,MAAM,YAAY,oBAAoB,MAAM,KAAgB;GAE5D,IAAI,aAAa,cAAc,6BAC7B,OAAO,iBAAiB,SAAS;GACnC,OAAO,iBAAiB,OAAO;EACjC;EAIA,MAAM,aAAa,qBAAqB,uBAAO,IAD9B,IACiC,CAAC;EAEnD,IAAI,YAAY;GACd,MAAM,UAAU,+BAA+B,UAAU;GACzD,OAAO,mBAAmB,OAAO,KAAK,iBAAiB,OAAO;EAChE;EAEA,IAAI;GAEF,OAAO,iBADY,KAAK,UAAU,KACD,CAAC;EACpC,QAAQ;GACN,OAAO,iBAAiB,OAAO,KAAK,CAAC;EACvC;CACF;CAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionarySelectorUsage.cjs","names":[],"sources":["../../../src/utils/getDictionarySelectorUsage.ts"],"sourcesContent":["import type {\n Dictionary,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\n\ntype DictionaryOrGroup = Dictionary | QualifiedDictionaryGroup;\n\n/**\n * Detects whether any built dictionary declares qualifier dimensions\n * (collections or variants).\n *\n * The merge step emits a {@link QualifiedDictionaryGroup} — carrying a\n * non-empty `qualifierTypes` array — for every key whose declarations use a\n * selector. When no group is present, the selector-object resolution path in\n * `getIntlayer` / `useIntlayer` is dead code, and bundlers can eliminate it via\n * the `INTLAYER_DICTIONARY_SELECTOR` env var.\n *\n * @example\n * getHasDictionarySelector(getDictionaries(config));\n * // true → at least one collection / variant / meta dictionary\n * // false → only plain dictionaries (selector logic can be stripped)\n */\nexport const getHasDictionarySelector = (\n dictionaries: Record<string, DictionaryOrGroup> | DictionaryOrGroup[]\n): boolean => {\n const dictionariesArray = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n return dictionariesArray.some((dictionary) => {\n const { qualifierTypes } = dictionary as QualifiedDictionaryGroup;\n\n return Array.isArray(qualifierTypes) && qualifierTypes.length > 0;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAa,4BACX,iBACY;AAKZ,SAJ0B,MAAM,QAAQ,aAAa,GACjD,eACA,OAAO,OAAO,aAAa,EAEN,MAAM,eAAe;EAC5C,MAAM,EAAE,mBAAmB;AAE3B,SAAO,MAAM,QAAQ,eAAe,IAAI,eAAe,SAAS;GAChE"}
1
+ {"version":3,"file":"getDictionarySelectorUsage.cjs","names":[],"sources":["../../../src/utils/getDictionarySelectorUsage.ts"],"sourcesContent":["import type {\n Dictionary,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\n\ntype DictionaryOrGroup = Dictionary | QualifiedDictionaryGroup;\n\n/**\n * Detects whether any built dictionary declares qualifier dimensions\n * (collections or variants).\n *\n * The merge step emits a {@link QualifiedDictionaryGroup} — carrying a\n * non-empty `qualifierTypes` array — for every key whose declarations use a\n * selector. When no group is present, the selector-object resolution path in\n * `getIntlayer` / `useIntlayer` is dead code, and bundlers can eliminate it via\n * the `INTLAYER_DICTIONARY_SELECTOR` env var.\n *\n * @example\n * getHasDictionarySelector(getDictionaries(config));\n * // true → at least one collection / variant / meta dictionary\n * // false → only plain dictionaries (selector logic can be stripped)\n */\nexport const getHasDictionarySelector = (\n dictionaries: Record<string, DictionaryOrGroup> | DictionaryOrGroup[]\n): boolean => {\n const dictionariesArray = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n return dictionariesArray.some((dictionary) => {\n const { qualifierTypes } = dictionary as QualifiedDictionaryGroup;\n\n return Array.isArray(qualifierTypes) && qualifierTypes.length > 0;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAa,4BACX,iBACY;CAKZ,QAJ0B,MAAM,QAAQ,YAAY,IAChD,eACA,OAAO,OAAO,YAAY,EAEN,CAAC,MAAM,eAAe;EAC5C,MAAM,EAAE,mBAAmB;EAE3B,OAAO,MAAM,QAAQ,cAAc,KAAK,eAAe,SAAS;CAClE,CAAC;AACH"}
@@ -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":";;;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
+ {"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;CAE1C,IAAI,WAAW,OAAO,OAAO;CAC7B,IAAI,WAAW,OAAO,OAAO;CAE7B,IAAI,cAAc,SAAS,KAAK,GAAG,OAAO;CAC1C,IAAI,cAAc,SAAS,KAAK,GAAG,OAAO;CAE1C,OAAO;AACT"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_utils_cacheMemory = require('./cacheMemory.cjs');
4
3
  let node_fs = require("node:fs");
5
4
  let node_path = require("node:path");
@@ -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":";;;;;;;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
+ {"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,IAAI,MACN;CACzB,MAAM,eAAeA,sCAAY,IAC/B,mBACA,QACF;CAEA,IAAI,cAAc,OAAO;CAEzB,IAAI,aAAa;CAEjB,KAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS;EAC/C,MAAM,sCAAuB,YAAY,cAAc;EAEvD,4BAAe,eAAe,GAAG;GAC/B,sCAAY,IAAI,mBAAmB,UAAU;IAC3C;IACA,SAAS;GACX,CAAC;GAED,OAAO;IAAE;IAAiB,SAAS;GAAW;EAChD;EAEA,MAAM,mCAAoB,UAAU;EAGpC,IAAI,cAAc,YAChB;EAGF,aAAa;CACf;CAEA,MAAM,IAAI,MACR,kEAAkE,WAAW,sCAAsC,UACrH;AACF"}
@@ -98,7 +98,8 @@ const getStorageAttributes = (options) => {
98
98
  };
99
99
  if (options === false || options === void 0) return {};
100
100
  const result = Array.isArray(options) ? options.reduce((acc, entry) => {
101
- return mergeStorageAttributes(acc, processStorageEntry(entry));
101
+ const partial = processStorageEntry(entry);
102
+ return mergeStorageAttributes(acc, partial);
102
103
  }, emptyResult) : mergeStorageAttributes(emptyResult, processStorageEntry(options));
103
104
  const cleanedResult = {};
104
105
  if (result.cookies && result.cookies.length > 0) cleanedResult.cookies = result.cookies;
@@ -1 +1 @@
1
- {"version":3,"file":"getStorageAttributes.cjs","names":[],"sources":["../../../src/utils/getStorageAttributes.ts"],"sourcesContent":["import type {\n CookiesAttributes,\n ProcessedCookieAttributes,\n ProcessedStorageAttributes,\n RoutingStorageInput,\n StorageAttributes,\n} from '@intlayer/types/config';\nimport {\n COOKIE_NAME,\n HEADER_NAME,\n LOCALE_STORAGE_NAME,\n} from '../defaultValues/routing';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: ProcessedCookieAttributes;\n};\n\n/** Number of seconds in a day, used to convert a `number` of days. */\nconst SECONDS_PER_DAY = 60 * 60 * 24;\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Merges the user-facing `expires` and `maxAge` into a single, normalized and\n * serialization-safe expiry consumed by the client runtime.\n *\n * Precedence and normalization:\n * - `maxAge` (seconds) wins when set and is the internal unit (relative);\n * - `expires` as a `number` is interpreted as **days** and converted to\n * seconds (relative);\n * - `expires` as a `Date` (possibly a cross-realm instance, since config files\n * run in a `node:vm` sandbox) or an ISO string becomes an ISO **string**\n * (absolute). Strings survive `JSON.stringify`, unlike a `Date`.\n *\n * The result is therefore: a `number` = seconds from creation, a `string` =\n * absolute ISO date, or `undefined` for a session cookie.\n */\nconst normalizeCookieExpiry = (\n expires: CookiesAttributes['expires'],\n maxAge: CookiesAttributes['maxAge']\n): number | string | undefined => {\n if (typeof maxAge === 'number') return maxAge;\n if (expires === undefined) return undefined;\n if (\n expires instanceof Date ||\n Object.prototype.toString.call(expires) === '[object Date]'\n ) {\n return (expires as Date).toISOString();\n }\n if (typeof expires === 'string') return expires;\n return expires * SECONDS_PER_DAY;\n};\n\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const {\n name,\n path = '/',\n expires,\n maxAge,\n domain,\n secure,\n sameSite,\n httpOnly,\n } = options ?? {};\n return {\n name: name ?? COOKIE_NAME,\n attributes: {\n path,\n expires: normalizeCookieExpiry(expires, maxAge),\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => ({\n name: options?.name ?? LOCALE_STORAGE_NAME,\n});\n\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => ({\n name: options?.name ?? HEADER_NAME,\n});\n\nconst isCookieEntry = (entry: unknown): boolean => {\n if (typeof entry !== 'object' || entry === null) return false;\n const e = entry as Record<string, unknown>;\n return (\n e['type'] === 'cookie' ||\n 'sameSite' in e ||\n 'httpOnly' in e ||\n 'secure' in e\n );\n};\n\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' =>\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header';\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n if (entry === 'cookie') return { cookies: [createCookieEntry()] };\n if (entry === 'localStorage')\n return { localStorage: [createWebStorageEntry()] };\n if (entry === 'sessionStorage')\n return { sessionStorage: [createWebStorageEntry()] };\n if (entry === 'header') return { headers: [createHeaderEntry()] };\n }\n\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n return {\n localStorage: [createWebStorageEntry(typedEntry as StorageAttributes)],\n };\n }\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n return {\n sessionStorage: [\n createWebStorageEntry(typedEntry as StorageAttributes),\n ],\n };\n }\n if ('type' in typedEntry && typedEntry.type === 'header') {\n return { headers: [createHeaderEntry(typedEntry as StorageAttributes)] };\n }\n // Default to localStorage for ambiguous objects\n return {\n localStorage: [\n createWebStorageEntry(typedEntry as Omit<StorageAttributes, 'type'>),\n ],\n };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => ({\n cookies: [...(accumulated.cookies ?? []), ...(partial.cookies ?? [])],\n localStorage: [\n ...(accumulated.localStorage ?? []),\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...(accumulated.sessionStorage ?? []),\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...(accumulated.headers ?? []), ...(partial.headers ?? [])],\n});\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type.\n * Called at config-build time so the result is pre-computed and stored in the config.\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, sessionStorage and headers\n */\nexport const getStorageAttributes = (\n options: RoutingStorageInput\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n if (options === false || options === undefined) return {};\n\n const result = Array.isArray(options)\n ? options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult)\n : mergeStorageAttributes(emptyResult, processStorageEntry(options));\n\n // Remove empty arrays\n const cleanedResult: ProcessedStorageAttributes = {};\n\n if (result.cookies && result.cookies.length > 0) {\n cleanedResult.cookies = result.cookies;\n }\n\n if (result.localStorage && result.localStorage.length > 0) {\n cleanedResult.localStorage = result.localStorage;\n }\n\n if (result.sessionStorage && result.sessionStorage.length > 0) {\n cleanedResult.sessionStorage = result.sessionStorage;\n }\n\n if (result.headers && result.headers.length > 0) {\n cleanedResult.headers = result.headers;\n }\n\n return cleanedResult;\n};\n"],"mappings":";;;;;AAuBA,MAAM,kBAAkB,OAAU;;;;;;;;;;;;;;;;AAqClC,MAAM,yBACJ,SACA,WAC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AuB,aAAa,oBAAoB,QAAQ,CAAC;CAGrE,MAAM,gBAA4C,EAAE;AAEpD,KAAI,OAAO,WAAW,OAAO,QAAQ,SAAS,EAC5C,eAAc,UAAU,OAAO;AAGjC,KAAI,OAAO,gBAAgB,OAAO,aAAa,SAAS,EACtD,eAAc,eAAe,OAAO;AAGtC,KAAI,OAAO,kBAAkB,OAAO,eAAe,SAAS,EAC1D,eAAc,iBAAiB,OAAO;AAGxC,KAAI,OAAO,WAAW,OAAO,QAAQ,SAAS,EAC5C,eAAc,UAAU,OAAO;AAGjC,QAAO"}
1
+ {"version":3,"file":"getStorageAttributes.cjs","names":[],"sources":["../../../src/utils/getStorageAttributes.ts"],"sourcesContent":["import type {\n CookiesAttributes,\n ProcessedCookieAttributes,\n ProcessedStorageAttributes,\n RoutingStorageInput,\n StorageAttributes,\n} from '@intlayer/types/config';\nimport {\n COOKIE_NAME,\n HEADER_NAME,\n LOCALE_STORAGE_NAME,\n} from '../defaultValues/routing';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: ProcessedCookieAttributes;\n};\n\n/** Number of seconds in a day, used to convert a `number` of days. */\nconst SECONDS_PER_DAY = 60 * 60 * 24;\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Merges the user-facing `expires` and `maxAge` into a single, normalized and\n * serialization-safe expiry consumed by the client runtime.\n *\n * Precedence and normalization:\n * - `maxAge` (seconds) wins when set and is the internal unit (relative);\n * - `expires` as a `number` is interpreted as **days** and converted to\n * seconds (relative);\n * - `expires` as a `Date` (possibly a cross-realm instance, since config files\n * run in a `node:vm` sandbox) or an ISO string becomes an ISO **string**\n * (absolute). Strings survive `JSON.stringify`, unlike a `Date`.\n *\n * The result is therefore: a `number` = seconds from creation, a `string` =\n * absolute ISO date, or `undefined` for a session cookie.\n */\nconst normalizeCookieExpiry = (\n expires: CookiesAttributes['expires'],\n maxAge: CookiesAttributes['maxAge']\n): number | string | undefined => {\n if (typeof maxAge === 'number') return maxAge;\n if (expires === undefined) return undefined;\n if (\n expires instanceof Date ||\n Object.prototype.toString.call(expires) === '[object Date]'\n ) {\n return (expires as Date).toISOString();\n }\n if (typeof expires === 'string') return expires;\n return expires * SECONDS_PER_DAY;\n};\n\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const {\n name,\n path = '/',\n expires,\n maxAge,\n domain,\n secure,\n sameSite,\n httpOnly,\n } = options ?? {};\n return {\n name: name ?? COOKIE_NAME,\n attributes: {\n path,\n expires: normalizeCookieExpiry(expires, maxAge),\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => ({\n name: options?.name ?? LOCALE_STORAGE_NAME,\n});\n\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => ({\n name: options?.name ?? HEADER_NAME,\n});\n\nconst isCookieEntry = (entry: unknown): boolean => {\n if (typeof entry !== 'object' || entry === null) return false;\n const e = entry as Record<string, unknown>;\n return (\n e['type'] === 'cookie' ||\n 'sameSite' in e ||\n 'httpOnly' in e ||\n 'secure' in e\n );\n};\n\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' =>\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header';\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n if (entry === 'cookie') return { cookies: [createCookieEntry()] };\n if (entry === 'localStorage')\n return { localStorage: [createWebStorageEntry()] };\n if (entry === 'sessionStorage')\n return { sessionStorage: [createWebStorageEntry()] };\n if (entry === 'header') return { headers: [createHeaderEntry()] };\n }\n\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n return {\n localStorage: [createWebStorageEntry(typedEntry as StorageAttributes)],\n };\n }\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n return {\n sessionStorage: [\n createWebStorageEntry(typedEntry as StorageAttributes),\n ],\n };\n }\n if ('type' in typedEntry && typedEntry.type === 'header') {\n return { headers: [createHeaderEntry(typedEntry as StorageAttributes)] };\n }\n // Default to localStorage for ambiguous objects\n return {\n localStorage: [\n createWebStorageEntry(typedEntry as Omit<StorageAttributes, 'type'>),\n ],\n };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => ({\n cookies: [...(accumulated.cookies ?? []), ...(partial.cookies ?? [])],\n localStorage: [\n ...(accumulated.localStorage ?? []),\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...(accumulated.sessionStorage ?? []),\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...(accumulated.headers ?? []), ...(partial.headers ?? [])],\n});\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type.\n * Called at config-build time so the result is pre-computed and stored in the config.\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, sessionStorage and headers\n */\nexport const getStorageAttributes = (\n options: RoutingStorageInput\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n if (options === false || options === undefined) return {};\n\n const result = Array.isArray(options)\n ? options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult)\n : mergeStorageAttributes(emptyResult, processStorageEntry(options));\n\n // Remove empty arrays\n const cleanedResult: ProcessedStorageAttributes = {};\n\n if (result.cookies && result.cookies.length > 0) {\n cleanedResult.cookies = result.cookies;\n }\n\n if (result.localStorage && result.localStorage.length > 0) {\n cleanedResult.localStorage = result.localStorage;\n }\n\n if (result.sessionStorage && result.sessionStorage.length > 0) {\n cleanedResult.sessionStorage = result.sessionStorage;\n }\n\n if (result.headers && result.headers.length > 0) {\n cleanedResult.headers = result.headers;\n }\n\n return cleanedResult;\n};\n"],"mappings":";;;;;AAuBA,MAAM,kBAAkB,OAAU;;;;;;;;;;;;;;;;AAqClC,MAAM,yBACJ,SACA,WACgC;CAChC,IAAI,OAAO,WAAW,UAAU,OAAO;CACvC,IAAI,YAAY,QAAW,OAAO;CAClC,IACE,mBAAmB,QACnB,OAAO,UAAU,SAAS,KAAK,OAAO,MAAM,iBAE5C,OAAQ,QAAiB,YAAY;CAEvC,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,OAAO,UAAU;AACnB;AAEA,MAAM,qBACJ,YACgB;CAChB,MAAM,EACJ,MACA,OAAO,KACP,SACA,QACA,QACA,QACA,UACA,aACE,WAAW,CAAC;CAChB,OAAO;EACL,MAAM;EACN,YAAY;GACV;GACA,SAAS,sBAAsB,SAAS,MAAM;GAC9C;GACA;GACA;GACA;EACF;CACF;AACF;AAEA,MAAM,yBACJ,aACqB,EACrB,MAAM,SAAS,0BACjB;AAEA,MAAM,qBACJ,aACiB,EACjB,MAAM,SAAS,4BACjB;AAEA,MAAM,iBAAiB,UAA4B;CACjD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,IAAI;CACV,OACE,EAAE,YAAY,YACd,cAAc,KACd,cAAc,KACd,YAAY;AAEhB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AAE;CACpE,cAAc,CACZ,GAAI,YAAY,gBAAgB,CAAC,GACjC,GAAI,QAAQ,gBAAgB,CAAC,CAC/B;CACA,gBAAgB,CACd,GAAI,YAAY,kBAAkB,CAAC,GACnC,GAAI,QAAQ,kBAAkB,CAAC,CACjC;CACA,SAAS,CAAC,GAAI,YAAY,WAAW,CAAC,GAAI,GAAI,QAAQ,WAAW,CAAC,CAAE;AACtE;;;;;;;;AASA,MAAa,wBACX,YAC+B;CAC/B,MAAM,cAA0C;EAC9C,SAAS,CAAC;EACV,cAAc,CAAC;EACf,gBAAgB,CAAC;EACjB,SAAS,CAAC;CACZ;CAEA,IAAI,YAAY,SAAS,YAAY,QAAW,OAAO,CAAC;CAExD,MAAM,SAAS,MAAM,QAAQ,OAAO,IAChC,QAAQ,QAAoC,KAAK,UAAU;EACzD,MAAM,UAAU,oBAAoB,KAAK;EACzC,OAAO,uBAAuB,KAAK,OAAO;CAC5C,GAAG,WAAW,IACd,uBAAuB,aAAa,oBAAoB,OAAO,CAAC;CAGpE,MAAM,gBAA4C,CAAC;CAEnD,IAAI,OAAO,WAAW,OAAO,QAAQ,SAAS,GAC5C,cAAc,UAAU,OAAO;CAGjC,IAAI,OAAO,gBAAgB,OAAO,aAAa,SAAS,GACtD,cAAc,eAAe,OAAO;CAGtC,IAAI,OAAO,kBAAkB,OAAO,eAAe,SAAS,GAC1D,cAAc,iBAAiB,OAAO;CAGxC,IAAI,OAAO,WAAW,OAAO,QAAQ,SAAS,GAC5C,cAAc,UAAU,OAAO;CAGjC,OAAO;AACT"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
3
 
5
4
  //#region src/utils/getUsedNodeTypes.ts
@@ -1 +1 @@
1
- {"version":3,"file":"getUsedNodeTypes.cjs","names":["REACT_NODE","PREACT_NODE","SOLID_NODE","PLUGIN_NODE_TYPES"],"sources":["../../../src/utils/getUsedNodeTypes.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n PLUGIN_NODE_TYPES,\n PREACT_NODE,\n REACT_NODE,\n SOLID_NODE,\n} from '@intlayer/types/nodeType';\n\nexport type PluginNodeType = (typeof PLUGIN_NODE_TYPES)[number];\n\n/**\n * Detect whether a plain object looks like a serialized React element.\n * React serializes JSX as: { key, props, _owner, _store }.\n * Preact serializes VNodes similarly with a `_store` field.\n */\nconst isReactLikeElement = (obj: Record<string, unknown>): boolean =>\n typeof obj.props !== 'undefined' &&\n 'key' in obj &&\n typeof obj._store !== 'undefined';\n\n/**\n * Detect whether a plain object looks like a serialized Solid element.\n * Solid JSX is serialized as: { type, props } without the React-specific\n * `_store` / `_owner` internal fields.\n */\nconst isSolidLikeElement = (obj: Record<string, unknown>): boolean =>\n typeof obj.props !== 'undefined' &&\n typeof obj._store === 'undefined' &&\n typeof obj.nodeType === 'undefined' &&\n 'type' in obj;\n\n/** Recursively collect every `nodeType` string found in a value. */\nconst collectNodeTypes = (value: unknown, result: Set<string>): void => {\n if (!value || typeof value !== 'object') return;\n\n if (Array.isArray(value)) {\n for (const item of value) collectNodeTypes(item, result);\n return;\n }\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.nodeType === 'string') {\n result.add(obj.nodeType);\n } else if (isReactLikeElement(obj)) {\n // Serialized React / Preact JSX element — both use { key, props, _store }\n result.add(REACT_NODE);\n result.add(PREACT_NODE);\n } else if (isSolidLikeElement(obj)) {\n result.add(SOLID_NODE);\n }\n\n for (const key of Object.keys(obj)) {\n collectNodeTypes(obj[key], result);\n }\n};\n\n/**\n * Returns the set of NodeType strings actually used across the given\n * built dictionaries.\n *\n * @example\n * const used = getUsedNodeTypes(getDictionaries(config));\n * // Set { 'translation', 'enumeration' }\n */\nexport const getUsedNodeTypes = (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): PluginNodeType[] => {\n const result = new Set<PluginNodeType>();\n const dicts = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n for (const dict of dicts) {\n collectNodeTypes(dict.content, result);\n }\n\n return [...result];\n};\n\nexport const getUnusedNodeTypes = (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): PluginNodeType[] => {\n const usedNodeTypes = getUsedNodeTypes(dictionaries);\n\n return PLUGIN_NODE_TYPES.filter(\n (nodeType) => !usedNodeTypes.includes(nodeType)\n );\n};\n\nexport const getUsedNodeTypesAsync = async (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): Promise<PluginNodeType[]> => {\n const dictionariesArray = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n const results = await Promise.all(\n dictionariesArray.map(async (dictionary) => {\n const result = new Set<PluginNodeType>();\n\n collectNodeTypes(dictionary.content, result as Set<string>);\n\n return result;\n })\n );\n\n const finalResult = new Set<PluginNodeType>();\n\n for (const res of results) {\n for (const val of res) {\n finalResult.add(val);\n }\n }\n\n return [...finalResult];\n};\n\nexport const getUnusedNodeTypesAsync = async (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): Promise<PluginNodeType[]> => {\n const usedNodeTypes = await getUsedNodeTypesAsync(dictionaries);\n\n return PLUGIN_NODE_TYPES.filter(\n (nodeType) => !usedNodeTypes.includes(nodeType)\n );\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAM,sBAAsB,QAC1B,OAAO,IAAI,UAAU,eACrB,SAAS,OACT,OAAO,IAAI,WAAW;;;;;;AAOxB,MAAM,sBAAsB,QAC1B,OAAO,IAAI,UAAU,eACrB,OAAO,IAAI,WAAW,eACtB,OAAO,IAAI,aAAa,eACxB,UAAU;;AAGZ,MAAM,oBAAoB,OAAgB,WAA8B;AACtE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU;AAEzC,KAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,OAAK,MAAM,QAAQ,MAAO,kBAAiB,MAAM,OAAO;AACxD;;CA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NODE","SOLID_NODE","PLUGIN_NODE_TYPES"],"sources":["../../../src/utils/getUsedNodeTypes.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n PLUGIN_NODE_TYPES,\n PREACT_NODE,\n REACT_NODE,\n SOLID_NODE,\n} from '@intlayer/types/nodeType';\n\nexport type PluginNodeType = (typeof PLUGIN_NODE_TYPES)[number];\n\n/**\n * Detect whether a plain object looks like a serialized React element.\n * React serializes JSX as: { key, props, _owner, _store }.\n * Preact serializes VNodes similarly with a `_store` field.\n */\nconst isReactLikeElement = (obj: Record<string, unknown>): boolean =>\n typeof obj.props !== 'undefined' &&\n 'key' in obj &&\n typeof obj._store !== 'undefined';\n\n/**\n * Detect whether a plain object looks like a serialized Solid element.\n * Solid JSX is serialized as: { type, props } without the React-specific\n * `_store` / `_owner` internal fields.\n */\nconst isSolidLikeElement = (obj: Record<string, unknown>): boolean =>\n typeof obj.props !== 'undefined' &&\n typeof obj._store === 'undefined' &&\n typeof obj.nodeType === 'undefined' &&\n 'type' in obj;\n\n/** Recursively collect every `nodeType` string found in a value. */\nconst collectNodeTypes = (value: unknown, result: Set<string>): void => {\n if (!value || typeof value !== 'object') return;\n\n if (Array.isArray(value)) {\n for (const item of value) collectNodeTypes(item, result);\n return;\n }\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.nodeType === 'string') {\n result.add(obj.nodeType);\n } else if (isReactLikeElement(obj)) {\n // Serialized React / Preact JSX element — both use { key, props, _store }\n result.add(REACT_NODE);\n result.add(PREACT_NODE);\n } else if (isSolidLikeElement(obj)) {\n result.add(SOLID_NODE);\n }\n\n for (const key of Object.keys(obj)) {\n collectNodeTypes(obj[key], result);\n }\n};\n\n/**\n * Returns the set of NodeType strings actually used across the given\n * built dictionaries.\n *\n * @example\n * const used = getUsedNodeTypes(getDictionaries(config));\n * // Set { 'translation', 'enumeration' }\n */\nexport const getUsedNodeTypes = (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): PluginNodeType[] => {\n const result = new Set<PluginNodeType>();\n const dicts = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n for (const dict of dicts) {\n collectNodeTypes(dict.content, result);\n }\n\n return [...result];\n};\n\nexport const getUnusedNodeTypes = (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): PluginNodeType[] => {\n const usedNodeTypes = getUsedNodeTypes(dictionaries);\n\n return PLUGIN_NODE_TYPES.filter(\n (nodeType) => !usedNodeTypes.includes(nodeType)\n );\n};\n\nexport const getUsedNodeTypesAsync = async (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): Promise<PluginNodeType[]> => {\n const dictionariesArray = Array.isArray(dictionaries)\n ? dictionaries\n : Object.values(dictionaries);\n\n const results = await Promise.all(\n dictionariesArray.map(async (dictionary) => {\n const result = new Set<PluginNodeType>();\n\n collectNodeTypes(dictionary.content, result as Set<string>);\n\n return result;\n })\n );\n\n const finalResult = new Set<PluginNodeType>();\n\n for (const res of results) {\n for (const val of res) {\n finalResult.add(val);\n }\n }\n\n return [...finalResult];\n};\n\nexport const getUnusedNodeTypesAsync = async (\n dictionaries: Record<string, Dictionary> | Dictionary[]\n): Promise<PluginNodeType[]> => {\n const usedNodeTypes = await getUsedNodeTypesAsync(dictionaries);\n\n return PLUGIN_NODE_TYPES.filter(\n (nodeType) => !usedNodeTypes.includes(nodeType)\n );\n};\n"],"mappings":";;;;;;;;;AAeA,MAAM,sBAAsB,QAC1B,OAAO,IAAI,UAAU,eACrB,SAAS,OACT,OAAO,IAAI,WAAW;;;;;;AAOxB,MAAM,sBAAsB,QAC1B,OAAO,IAAI,UAAU,eACrB,OAAO,IAAI,WAAW,eACtB,OAAO,IAAI,aAAa,eACxB,UAAU;;AAGZ,MAAM,oBAAoB,OAAgB,WAA8B;CACtE,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU;CAEzC,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,KAAK,MAAM,QAAQ,OAAO,iBAAiB,MAAM,MA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Q,CAChD;AACF"}
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_utils_getExtension = require('./getExtension.cjs');
3
3
  const require_utils_normalizePath = require('./normalizePath.cjs');
4
4
  const require_utils_alias = require('./alias.cjs');
5
+ const require_utils_builtConfigKeys = require('./builtConfigKeys.cjs');
5
6
  const require_utils_cacheMemory = require('./cacheMemory.cjs');
6
7
  const require_utils_cacheDisk = require('./cacheDisk.cjs');
7
8
  const require_utils_getPackageJsonPath = require('./getPackageJsonPath.cjs');
@@ -22,6 +23,7 @@ const require_utils_stringFormatter_camelCaseToSentence = require('./stringForma
22
23
  const require_utils_stringFormatter_kebabCaseToCamelCase = require('./stringFormatter/kebabCaseToCamelCase.cjs');
23
24
  const require_utils_stringFormatter_toLowerCamelCase = require('./stringFormatter/toLowerCamelCase.cjs');
24
25
 
26
+ exports.BUILT_CONFIG_KEYS = require_utils_builtConfigKeys.BUILT_CONFIG_KEYS;
25
27
  exports.assertPathWithin = require_utils_pathSecurity.assertPathWithin;
26
28
  exports.cacheDisk = require_utils_cacheDisk.cacheDisk;
27
29
  exports.cacheMemory = require_utils_cacheMemory.cacheMemory;
@@ -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":";;;;;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
+ {"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,GAAG,MACtC;CACH,MAAM,kBAAkB,QAAQ;CAEhC,IAAI;EACF,MAAM,IAAI,MAAM,MAAM;CACxB,SAAS,OAAO;EACd,QAAQ,IAAIA,wBAAS,8BAA0B,CAAC;EAChD,QAAQ,IAAIA,wBAAU,MAAgB,SAAS,uBAAmB,CAAC;CACrE;AACF"}
@@ -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":";;;;;;;;;;;;;AAUA,MAAa,iBAAiB,SAAyB,KAAK,QAAQ,OAAO,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,GAAG"}
@@ -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":";;;;;;;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
+ {"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;CACpB,IAAI,OAAO,YAAY,YACrB,OAAO,MAAO,QAAgB,OAAO;CAGvC,IAAI,OAAO,YAAY,YAAY,YAAY,QAAQ,QAAQ,QAAQ;EACrE,MAAM,gBAAiB,QAAgB,QAAQ;EAE/C,IAAI,eAAe;GACjB,IAAI,OAAO,kBAAkB,YAC3B,OAAO,MAAM,cAAc,OAAO;GAEpC,OAAO,mBAAmB,eAAe,OAAO;EAClD;CACF;CAEA,IAAI,OAAO,YAAY,UACrB,OAAO,mBAAmB,SAAS,OAAO;CAG5C,OAAO;AACT;AAEA,MAAa,sBACX,SACA,YAEA,QACG,WAAW,yBAAyB,QAAQ,UAAU,EAAE,CAAC,CACzD,WAAW,sBAAsB,QAAQ,OAAO,EAAE,CAAC,CACnD,WAAW,2BAA2B,QAAQ,YAAY,EAAE,CAAC,CAC7D,WAAW,4BAA4B,QAAQ,aAAa,EAAE,CAAC,CAC/D,WACC,oCACA,QAAQ,qBAAqB,EAC/B,CAAC,CACA,WACC,qCACA,QAAQ,sBAAsB,EAChC,CAAC,CACA,WAAW,yBAAyB,QAAQ,UAAU,EAAE,CAAC,CACzD,WAAW,kCAAkC,QAAQ,mBAAmB,EAAE,CAAC,CAC3E,WACC,mCACA,QAAQ,oBAAoB,EAC9B"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let node_path = require("node:path");
4
3
 
5
4
  //#region src/utils/pathSecurity.ts
@@ -1 +1 @@
1
- {"version":3,"file":"pathSecurity.cjs","names":["sep"],"sources":["../../../src/utils/pathSecurity.ts"],"sourcesContent":["import { resolve, sep } from 'node:path';\n\n/**\n * Throws if `resolvedPath` escapes `baseDir`.\n * Use this before any file operation whose path is derived from user-controlled\n * input (e.g. dictionary keys, filePath fields from dictionary data) to prevent\n * path-traversal attacks.\n */\nexport const assertPathWithin = (\n resolvedPath: string,\n baseDir: string\n): void => {\n const normalizedBase = resolve(baseDir);\n const normalizedPath = resolve(resolvedPath);\n if (\n normalizedPath !== normalizedBase &&\n !normalizedPath.startsWith(normalizedBase + sep)\n ) {\n throw new Error(\n `Path traversal detected: \"${resolvedPath}\" escapes the base directory \"${baseDir}\"`\n );\n }\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,oBACX,cACA,YACS;CACT,MAAM,wCAAyB,QAAQ;CACvC,MAAM,wCAAyB,aAAa;AAC5C,KACE,mBAAmB,kBACnB,CAAC,eAAe,WAAW,iBAAiBA,cAAI,CAEhD,OAAM,IAAI,MACR,6BAA6B,aAAa,gCAAgC,QAAQ,GACnF"}
1
+ {"version":3,"file":"pathSecurity.cjs","names":["sep"],"sources":["../../../src/utils/pathSecurity.ts"],"sourcesContent":["import { resolve, sep } from 'node:path';\n\n/**\n * Throws if `resolvedPath` escapes `baseDir`.\n * Use this before any file operation whose path is derived from user-controlled\n * input (e.g. dictionary keys, filePath fields from dictionary data) to prevent\n * path-traversal attacks.\n */\nexport const assertPathWithin = (\n resolvedPath: string,\n baseDir: string\n): void => {\n const normalizedBase = resolve(baseDir);\n const normalizedPath = resolve(resolvedPath);\n if (\n normalizedPath !== normalizedBase &&\n !normalizedPath.startsWith(normalizedBase + sep)\n ) {\n throw new Error(\n `Path traversal detected: \"${resolvedPath}\" escapes the base directory \"${baseDir}\"`\n );\n }\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,oBACX,cACA,YACS;CACT,MAAM,wCAAyB,OAAO;CACtC,MAAM,wCAAyB,YAAY;CAC3C,IACE,mBAAmB,kBACnB,CAAC,eAAe,WAAW,iBAAiBA,aAAG,GAE/C,MAAM,IAAI,MACR,6BAA6B,aAAa,gCAAgC,QAAQ,EACpF;AAEJ"}
@@ -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":";;;;;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
+ {"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,CAAC,MAG5B,OAAO,GAAG,SAA2B;CACnC,IAAI;CAEJ,KAAK,IAAI,UAAU,GAAG,WAAW,UAAU,WACzC,IAAI;EACF,OAAO,MAAM,GAAG,GAAG,IAAI;CACzB,SAAS,KAAK;EACZ,YAAY;EACZ,MAAM,QAAQA,sDAAoB,GAAG;EAGrC,IAAI,WAAW,UAAU;GACvB,IAAI,iBAAiB;IACnB,kBAAkB;KAAE;KAAO;KAAS;IAAS,CAAC;IAC9C,OAAO;GACT;GAGA,MAAM;EACR;EAEA,IAAI,SACF,UAAU;GAAE;GAAO;GAAS;EAAS,CAAC;OAEtC,sBAAO,OAAO,EACZ,OAAO,QACT,CAAC;EAIH,IAAI,QAAQ,GACV,MAAM,IAAI,SAAS,QAAQ,WAAW,KAAK,KAAK,CAAC;CAErD;CAIF,MACE,6BAAa,IAAI,MAAM,iDAAiD;AAE5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"setIntlayerIdentifier.cjs","names":[],"sources":["../../../src/utils/setIntlayerIdentifier.ts"],"sourcesContent":["type Meta = {\n enabled: true;\n};\n\nexport type WindowsWithIntlayer = typeof window & {\n intlayer?: Meta;\n};\n\n/**\n * Sets the version of Intlayer in the window object.\n * This is used for Intlayer detection in the browser.\n */\nexport const setIntlayerIdentifier = (): void => {\n if (typeof window !== 'undefined') {\n (window as WindowsWithIntlayer).intlayer = {\n enabled: true,\n };\n }\n};\n"],"mappings":";;;;;;;AAYA,MAAa,8BAAoC;AAC/C,KAAI,OAAO,WAAW,YACpB,CAAC,OAA+B,WAAW,EACzC,SAAS,MACV"}
1
+ {"version":3,"file":"setIntlayerIdentifier.cjs","names":[],"sources":["../../../src/utils/setIntlayerIdentifier.ts"],"sourcesContent":["type Meta = {\n enabled: true;\n};\n\nexport type WindowsWithIntlayer = typeof window & {\n intlayer?: Meta;\n};\n\n/**\n * Sets the version of Intlayer in the window object.\n * This is used for Intlayer detection in the browser.\n */\nexport const setIntlayerIdentifier = (): void => {\n if (typeof window !== 'undefined') {\n (window as WindowsWithIntlayer).intlayer = {\n enabled: true,\n };\n }\n};\n"],"mappings":";;;;;;;AAYA,MAAa,8BAAoC;CAC/C,IAAI,OAAO,WAAW,aACpB,AAAC,OAA+B,WAAW,EACzC,SAAS,KACX;AAEJ"}
@@ -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 .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB,QAAwB;AAG3D,QAAO,IACJ,QAAQ,mBAAmB,QAAQ,CACnC,QAAQ,wBAAwB,QAAQ,CACxC,QAAQ,WAAW,IAAI,CACvB,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 .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB,QAAwB;CAG3D,OAAO,IACJ,QAAQ,mBAAmB,OAAO,CAAC,CACnC,QAAQ,wBAAwB,OAAO,CAAC,CACxC,QAAQ,WAAW,GAAG,CAAC,CACvB,YAAY;AACjB"}
@@ -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":";;;;;;;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
+ {"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;CAC5D,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI,OAAO,UAAU,UAAU,OAAO;CAGtC,MAAM,aAAa,MAChB,QAAQ,mBAAmB,OAAO,CAAC,CAEnC,QAAQ,yBAAyB,OAAO;CAG3C,OAAO,WAAW,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,WAAW,MAAM,CAAC,CAAC,CAAC,YAAY;AAC9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"kebabCaseToCamelCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/kebabCaseToCamelCase.ts"],"sourcesContent":["export const kebabCaseToCamelCase = (name: string): string => {\n return name\n .split(/[^a-zA-Z0-9]+/) // Split on any non-alphanumeric character\n .filter(Boolean) // Remove any empty strings\n .map((word) => {\n // Convert the entire word to lowercase first\n const lowerWord = word.toLowerCase();\n\n // Capitalize the first character\n let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);\n\n // Capitalize any letter that follows a number\n capitalized = capitalized.replace(\n /(\\d)([a-z])/g,\n (_, number, char) => number + char.toUpperCase()\n );\n\n return capitalized;\n })\n .join(''); // Concatenate all parts into a single string\n};\n"],"mappings":";;;AAAA,MAAa,wBAAwB,SAAyB;AAC5D,QAAO,KACJ,MAAM,gBAAgB,CACtB,OAAO,QAAQ,CACf,KAAK,SAAS;EAEb,MAAM,YAAY,KAAK,aAAa;EAGpC,IAAI,cAAc,UAAU,OAAO,EAAE,CAAC,aAAa,GAAG,UAAU,MAAM,EAAE;AAGxE,gBAAc,YAAY,QACxB,iBACC,GAAG,QAAQ,SAAS,SAAS,KAAK,aAAa,CACjD;AAED,SAAO;GACP,CACD,KAAK,GAAG"}
1
+ {"version":3,"file":"kebabCaseToCamelCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/kebabCaseToCamelCase.ts"],"sourcesContent":["export const kebabCaseToCamelCase = (name: string): string => {\n return name\n .split(/[^a-zA-Z0-9]+/) // Split on any non-alphanumeric character\n .filter(Boolean) // Remove any empty strings\n .map((word) => {\n // Convert the entire word to lowercase first\n const lowerWord = word.toLowerCase();\n\n // Capitalize the first character\n let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);\n\n // Capitalize any letter that follows a number\n capitalized = capitalized.replace(\n /(\\d)([a-z])/g,\n (_, number, char) => number + char.toUpperCase()\n );\n\n return capitalized;\n })\n .join(''); // Concatenate all parts into a single string\n};\n"],"mappings":";;;AAAA,MAAa,wBAAwB,SAAyB;CAC5D,OAAO,KACJ,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,SAAS;EAEb,MAAM,YAAY,KAAK,YAAY;EAGnC,IAAI,cAAc,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC;EAGvE,cAAc,YAAY,QACxB,iBACC,GAAG,QAAQ,SAAS,SAAS,KAAK,YAAY,CACjD;EAEA,OAAO;CACT,CAAC,CAAC,CACD,KAAK,EAAE;AACZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"toLowerCamelCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/toLowerCamelCase.ts"],"sourcesContent":["/**\n * Convert a string to lowerCamelCase\n * e.g. \"MyComponent\" => \"myComponent\"\n * e.g. \"auth-middleware\" => \"authMiddleware\"\n */\nexport const toLowerCamelCase = (str: string): string => {\n if (!str) {\n return '';\n }\n\n // Handle kebab-case: \"auth-middleware\" => \"authMiddleware\"\n if (str.includes('-')) {\n return str\n .split('-')\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n }\n\n // Handle PascalCase: \"MyComponent\" => \"myComponent\"\n return str.charAt(0).toLowerCase() + str.slice(1);\n};\n"],"mappings":";;;;;;;;AAKA,MAAa,oBAAoB,QAAwB;AACvD,KAAI,CAAC,IACH,QAAO;AAIT,KAAI,IAAI,SAAS,IAAI,CACnB,QAAO,IACJ,MAAM,IAAI,CACV,KAAK,MAAM,UAAU;AACpB,MAAI,UAAU,EACZ,QAAO,KAAK,aAAa;AAE3B,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,aAAa;GACjE,CACD,KAAK,GAAG;AAIb,QAAO,IAAI,OAAO,EAAE,CAAC,aAAa,GAAG,IAAI,MAAM,EAAE"}
1
+ {"version":3,"file":"toLowerCamelCase.cjs","names":[],"sources":["../../../../src/utils/stringFormatter/toLowerCamelCase.ts"],"sourcesContent":["/**\n * Convert a string to lowerCamelCase\n * e.g. \"MyComponent\" => \"myComponent\"\n * e.g. \"auth-middleware\" => \"authMiddleware\"\n */\nexport const toLowerCamelCase = (str: string): string => {\n if (!str) {\n return '';\n }\n\n // Handle kebab-case: \"auth-middleware\" => \"authMiddleware\"\n if (str.includes('-')) {\n return str\n .split('-')\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n }\n\n // Handle PascalCase: \"MyComponent\" => \"myComponent\"\n return str.charAt(0).toLowerCase() + str.slice(1);\n};\n"],"mappings":";;;;;;;;AAKA,MAAa,oBAAoB,QAAwB;CACvD,IAAI,CAAC,KACH,OAAO;CAIT,IAAI,IAAI,SAAS,GAAG,GAClB,OAAO,IACJ,MAAM,GAAG,CAAC,CACV,KAAK,MAAM,UAAU;EACpB,IAAI,UAAU,GACZ,OAAO,KAAK,YAAY;EAE1B,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY;CAClE,CAAC,CAAC,CACD,KAAK,EAAE;CAIZ,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,MAAM,CAAC;AAClD"}
@@ -9,6 +9,7 @@ const routing = parsedJSONConfig.routing;
9
9
  const content = parsedJSONConfig.content;
10
10
  const system = parsedJSONConfig.system;
11
11
  const editor = parsedJSONConfig.editor;
12
+ const analytics = parsedJSONConfig.analytics;
12
13
  const log = parsedJSONConfig.log;
13
14
  const ai = parsedJSONConfig.ai;
14
15
  const build = parsedJSONConfig.build;
@@ -17,5 +18,5 @@ const schemas = parsedJSONConfig.schemas;
17
18
  const plugins = parsedJSONConfig.plugins;
18
19
 
19
20
  //#endregion
20
- export { ai, build, compiler, content, dictionary, editor, internationalization, log, plugins, routing, schemas, system };
21
+ export { ai, analytics, build, compiler, content, dictionary, editor, internationalization, log, plugins, routing, schemas, system };
21
22
  //# sourceMappingURL=built.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"built.mjs","names":[],"sources":["../../src/built.ts"],"sourcesContent":["/**\n * @intlayer/config/built is a package that only returns the configuration file as a JSON object.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n */\n\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { getConfiguration } from './configFile/getConfiguration';\n\nconst configuration: IntlayerConfig = getConfiguration();\n\nconst parsedJSONConfig = JSON.parse(JSON.stringify(configuration));\n\nexport const internationalization = parsedJSONConfig.internationalization;\nexport const dictionary = parsedJSONConfig.dictionary;\nexport const routing = parsedJSONConfig.routing;\nexport const content = parsedJSONConfig.content;\nexport const system = parsedJSONConfig.system;\nexport const editor = parsedJSONConfig.editor;\nexport const log = parsedJSONConfig.log;\nexport const ai = parsedJSONConfig.ai;\nexport const build = parsedJSONConfig.build;\nexport const compiler = parsedJSONConfig.compiler;\nexport const schemas = parsedJSONConfig.schemas;\nexport const plugins = parsedJSONConfig.plugins;\n"],"mappings":";;;AAQA,MAAM,gBAAgC,kBAAkB;AAExD,MAAM,mBAAmB,KAAK,MAAM,KAAK,UAAU,cAAc,CAAC;AAElE,MAAa,uBAAuB,iBAAiB;AACrD,MAAa,aAAa,iBAAiB;AAC3C,MAAa,UAAU,iBAAiB;AACxC,MAAa,UAAU,iBAAiB;AACxC,MAAa,SAAS,iBAAiB;AACvC,MAAa,SAAS,iBAAiB;AACvC,MAAa,MAAM,iBAAiB;AACpC,MAAa,KAAK,iBAAiB;AACnC,MAAa,QAAQ,iBAAiB;AACtC,MAAa,WAAW,iBAAiB;AACzC,MAAa,UAAU,iBAAiB;AACxC,MAAa,UAAU,iBAAiB"}
1
+ {"version":3,"file":"built.mjs","names":[],"sources":["../../src/built.ts"],"sourcesContent":["/**\n * @intlayer/config/built is a package that only returns the configuration file as a JSON object.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n */\n\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { getConfiguration } from './configFile/getConfiguration';\nimport type { BuiltConfigKey } from './utils/builtConfigKeys';\n\nconst configuration: IntlayerConfig = getConfiguration();\n\nconst parsedJSONConfig = JSON.parse(JSON.stringify(configuration));\n\nexport const internationalization = parsedJSONConfig.internationalization;\nexport const dictionary = parsedJSONConfig.dictionary;\nexport const routing = parsedJSONConfig.routing;\nexport const content = parsedJSONConfig.content;\nexport const system = parsedJSONConfig.system;\nexport const editor = parsedJSONConfig.editor;\nexport const analytics = parsedJSONConfig.analytics;\nexport const log = parsedJSONConfig.log;\nexport const ai = parsedJSONConfig.ai;\nexport const build = parsedJSONConfig.build;\nexport const compiler = parsedJSONConfig.compiler;\nexport const schemas = parsedJSONConfig.schemas;\nexport const plugins = parsedJSONConfig.plugins;\n\n/**\n * Compile-time guard: the named exports above must cover exactly the canonical\n * {@link BuiltConfigKey} list that `generateConfigurationContent` emits into the\n * aliased `configuration.mjs`. Adding a key to `BUILT_CONFIG_KEYS` without\n * exporting it here (or vice versa) is a type error, keeping the runtime and\n * aliased build targets in lockstep.\n */\n({\n internationalization,\n dictionary,\n routing,\n content,\n system,\n editor,\n analytics,\n log,\n ai,\n build,\n compiler,\n schemas,\n plugins,\n}) satisfies Record<BuiltConfigKey, unknown>;\n"],"mappings":";;;AASA,MAAM,gBAAgC,iBAAiB;AAEvD,MAAM,mBAAmB,KAAK,MAAM,KAAK,UAAU,aAAa,CAAC;AAEjE,MAAa,uBAAuB,iBAAiB;AACrD,MAAa,aAAa,iBAAiB;AAC3C,MAAa,UAAU,iBAAiB;AACxC,MAAa,UAAU,iBAAiB;AACxC,MAAa,SAAS,iBAAiB;AACvC,MAAa,SAAS,iBAAiB;AACvC,MAAa,YAAY,iBAAiB;AAC1C,MAAa,MAAM,iBAAiB;AACpC,MAAa,KAAK,iBAAiB;AACnC,MAAa,QAAQ,iBAAiB;AACtC,MAAa,WAAW,iBAAiB;AACzC,MAAa,UAAU,iBAAiB;AACxC,MAAa,UAAU,iBAAiB"}
@@ -1,10 +1,10 @@
1
1
  import { getAlias } from "../utils/alias.mjs";
2
2
  import { getConfiguration } from "../configFile/getConfiguration.mjs";
3
- import { BundleLogger } from "./logBundle.mjs";
4
3
  import { getConfigEnvVars } from "../envVars/envVars.mjs";
4
+ import { BundleLogger } from "./logBundle.mjs";
5
5
  import { isAbsolute, join, resolve } from "node:path";
6
6
  import { mkdir, rm, writeFile } from "node:fs/promises";
7
- import packageJSON from "@intlayer/types/package.json" with { type: "json" };
7
+ import configPackageJson from "@intlayer/types/package.json" with { type: "json" };
8
8
  import { build } from "esbuild";
9
9
  import { exec } from "node:child_process";
10
10
  import { promisify } from "node:util";
@@ -27,7 +27,7 @@ const packageList = [
27
27
  "vanilla-intlayer",
28
28
  "intlayer"
29
29
  ];
30
- const defaultVersion = packageJSON.version;
30
+ const defaultVersion = configPackageJson.version;
31
31
  /**
32
32
  * Bundle the application content using esbuild.
33
33
  * It uses the Intlayer configuration to set up aliases and other esbuild options.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/bundle/index.ts"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { mkdir, rm, writeFile } from 'node:fs/promises';\nimport { isAbsolute, join, resolve } from 'node:path';\nimport { promisify } from 'node:util';\nimport packageJSON from '@intlayer/types/package.json' with { type: 'json' };\nimport { type BuildOptions, build, type Plugin } from 'esbuild';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '../configFile/getConfiguration';\nimport { getConfigEnvVars } from '../envVars/envVars';\nimport { getAlias } from '../utils/alias';\nimport { BundleLogger } from './logBundle';\n\nconst execAsync = promisify(exec);\n\nexport const packageList = [\n 'next-intlayer',\n 'react-intlayer',\n 'vue-intlayer',\n 'svelte-intlayer',\n 'preact-intlayer',\n 'solid-intlayer',\n 'angular-intlayer',\n 'lit-intlayer',\n 'express-intlayer',\n 'hono-intlayer',\n 'fastify-intlayer',\n 'adonis-intlayer',\n 'vanilla-intlayer',\n 'intlayer',\n] as const;\n\nconst defaultVersion = packageJSON.version;\n\nexport type BundleIntlayerOptions = {\n outfile?: string;\n configOptions?: GetConfigurationOptions;\n bundlePackages?: string[];\n version?: string;\n} & BuildOptions;\n\n/**\n * Bundle the application content using esbuild.\n * It uses the Intlayer configuration to set up aliases and other esbuild options.\n *\n * @param options - Bundle options including entryPoint, outfile, and esbuild options.\n * @returns The build result.\n */\nexport const bundleIntlayer = async (options: BundleIntlayerOptions) => {\n const {\n outfile = 'intlayer-bundle.js',\n configOptions,\n bundlePackages = [...packageList],\n version = defaultVersion,\n ...esbuildOptions\n } = options;\n\n const intlayerConfig = getConfiguration(configOptions);\n\n const logger = new BundleLogger(intlayerConfig);\n\n const alias = getAlias({\n configuration: intlayerConfig,\n formatter: (value: string) => resolve(process.cwd(), value),\n });\n\n // Fetch dictionaries and calculate tree-shaking variables\n\n const treeShakingDefines = getConfigEnvVars(\n intlayerConfig,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"` // Properly wraps the string in quotes\n );\n\n const intlayerBundlePlugin: Plugin = {\n name: 'intlayer-bundle-plugin',\n setup(build) {\n // Create a regex that matches the provided packages\n // It matches both the package name and any sub-exports\n const packagesRegex = new RegExp(\n `^(${bundlePackages\n .map((packages) => packages.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('|')})(\\\\/.*)?$`\n );\n\n build.onResolve({ filter: packagesRegex }, () => ({\n external: false,\n }));\n\n // Also ensure @intlayer/ packages are bundled if not explicitly excluded\n build.onResolve({ filter: /^@intlayer\\// }, () => ({\n external: false,\n }));\n },\n };\n\n const tempDir = join(intlayerConfig.system.tempDir, 'intlayer-bundle-tmp');\n\n logger.setStatus('installing');\n\n try {\n // Clean and prepare temp directory\n await rm(tempDir, { recursive: true, force: true });\n await mkdir(tempDir, { recursive: true });\n\n // Write package.json to fetch packages via npm/bun\n const deps = Object.fromEntries(\n bundlePackages.map((pkg) => [pkg, version])\n );\n await writeFile(\n join(tempDir, 'package.json'),\n JSON.stringify({ dependencies: deps, type: 'module' })\n );\n\n // Determine package manager (prefer bun if available)\n let pm = 'npm install';\n try {\n await execAsync('bun --version');\n pm = 'bun install';\n } catch {}\n\n // Install the packages in the temp directory\n await execAsync(pm, { cwd: tempDir });\n\n const absoluteOutfile = isAbsolute(outfile)\n ? outfile\n : join(process.cwd(), outfile);\n\n const buildOptions: BuildOptions = {\n bundle: true,\n outfile: absoluteOutfile,\n absWorkingDir: tempDir,\n platform: 'browser',\n conditions: ['browser', 'module', 'import', 'default'],\n minify: true,\n minifyIdentifiers: true,\n treeShaking: true,\n format: 'iife',\n ignoreAnnotations: true,\n stdin: {\n contents: bundlePackages\n .map((packageName) => {\n // Convert package name to global name (e.g. vanilla-intlayer -> VanillaIntlayer)\n const globalName = packageName\n .split('-')\n .map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)\n .join('');\n // Create a global variable for each package\n return `import * as ${globalName} from '${packageName}';\\nif (typeof window !== 'undefined') { window['${globalName}'] = ${globalName}; }`;\n })\n .join('\\n'),\n resolveDir: tempDir,\n },\n define: {\n 'process.env': '{}', // Fix ReferenceError: process is not defined\n // Inject generated environment variables\n ...treeShakingDefines,\n ...esbuildOptions.define,\n },\n alias: {\n ...alias,\n ...esbuildOptions.alias,\n },\n ...esbuildOptions,\n plugins: [intlayerBundlePlugin, ...(esbuildOptions.plugins || [])],\n };\n\n logger.setStatus('bundling');\n const result = await build(buildOptions);\n logger.setStatus('success');\n return result;\n } catch (error) {\n logger.setError(error);\n throw error;\n } finally {\n // Clean up temp directory\n await rm(tempDir, { recursive: true, force: true });\n }\n};\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,YAAY,UAAU,KAAK;AAEjC,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,iBAAiB,YAAY;;;;;;;;AAgBnC,MAAa,iBAAiB,OAAO,YAAmC;CACtE,MAAM,EACJ,UAAU,sBACV,eACA,iBAAiB,CAAC,GAAG,YAAY,EACjC,UAAU,gBACV,GAAG,mBACD;CAEJ,MAAM,iBAAiB,iBAAiB,cAAc;CAEtD,MAAM,SAAS,IAAI,aAAa,eAAe;CAE/C,MAAM,QAAQ,SAAS;EACrB,eAAe;EACf,YAAY,UAAkB,QAAQ,QAAQ,KAAK,EAAE,MAAM;EAC5D,CAAC;CAIF,MAAM,qBAAqB,iBACzB,iBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,GACtB;CAED,MAAM,uBAA+B;EACnC,MAAM;EACN,MAAM,OAAO;GAGX,MAAM,gBAAgB,IAAI,OACxB,KAAK,eACF,KAAK,aAAa,SAAS,QAAQ,uBAAuB,OAAO,CAAC,CAClE,KAAK,IAAI,CAAC,YACd;AAED,SAAM,UAAU,EAAE,QAAQ,eAAe,SAAS,EAChD,UAAU,OACX,EAAE;AAGH,SAAM,UAAU,EAAE,QAAQ,gBAAgB,SAAS,EACjD,UAAU,OACX,EAAE;;EAEN;CAED,MAAM,UAAU,KAAK,eAAe,OAAO,SAAS,sBAAsB;AAE1E,QAAO,UAAU,aAAa;AAE9B,KAAI;AAEF,QAAM,GAAG,SAAS;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC;AACnD,QAAM,MAAM,SAAS,EAAE,WAAW,MAAM,CAAC;EAG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../../../src/bundle/index.ts"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { mkdir, rm, writeFile } from 'node:fs/promises';\nimport { isAbsolute, join, resolve } from 'node:path';\nimport { promisify } from 'node:util';\nimport packageJSON from '@intlayer/types/package.json' with { type: 'json' };\nimport { type BuildOptions, build, type Plugin } from 'esbuild';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '../configFile/getConfiguration';\nimport { getConfigEnvVars } from '../envVars/envVars';\nimport { getAlias } from '../utils/alias';\nimport { BundleLogger } from './logBundle';\n\nconst execAsync = promisify(exec);\n\nexport const packageList = [\n 'next-intlayer',\n 'react-intlayer',\n 'vue-intlayer',\n 'svelte-intlayer',\n 'preact-intlayer',\n 'solid-intlayer',\n 'angular-intlayer',\n 'lit-intlayer',\n 'express-intlayer',\n 'hono-intlayer',\n 'fastify-intlayer',\n 'adonis-intlayer',\n 'vanilla-intlayer',\n 'intlayer',\n] as const;\n\nconst defaultVersion = packageJSON.version;\n\nexport type BundleIntlayerOptions = {\n outfile?: string;\n configOptions?: GetConfigurationOptions;\n bundlePackages?: string[];\n version?: string;\n} & BuildOptions;\n\n/**\n * Bundle the application content using esbuild.\n * It uses the Intlayer configuration to set up aliases and other esbuild options.\n *\n * @param options - Bundle options including entryPoint, outfile, and esbuild options.\n * @returns The build result.\n */\nexport const bundleIntlayer = async (options: BundleIntlayerOptions) => {\n const {\n outfile = 'intlayer-bundle.js',\n configOptions,\n bundlePackages = [...packageList],\n version = defaultVersion,\n ...esbuildOptions\n } = options;\n\n const intlayerConfig = getConfiguration(configOptions);\n\n const logger = new BundleLogger(intlayerConfig);\n\n const alias = getAlias({\n configuration: intlayerConfig,\n formatter: (value: string) => resolve(process.cwd(), value),\n });\n\n // Fetch dictionaries and calculate tree-shaking variables\n\n const treeShakingDefines = getConfigEnvVars(\n intlayerConfig,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"` // Properly wraps the string in quotes\n );\n\n const intlayerBundlePlugin: Plugin = {\n name: 'intlayer-bundle-plugin',\n setup(build) {\n // Create a regex that matches the provided packages\n // It matches both the package name and any sub-exports\n const packagesRegex = new RegExp(\n `^(${bundlePackages\n .map((packages) => packages.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('|')})(\\\\/.*)?$`\n );\n\n build.onResolve({ filter: packagesRegex }, () => ({\n external: false,\n }));\n\n // Also ensure @intlayer/ packages are bundled if not explicitly excluded\n build.onResolve({ filter: /^@intlayer\\// }, () => ({\n external: false,\n }));\n },\n };\n\n const tempDir = join(intlayerConfig.system.tempDir, 'intlayer-bundle-tmp');\n\n logger.setStatus('installing');\n\n try {\n // Clean and prepare temp directory\n await rm(tempDir, { recursive: true, force: true });\n await mkdir(tempDir, { recursive: true });\n\n // Write package.json to fetch packages via npm/bun\n const deps = Object.fromEntries(\n bundlePackages.map((pkg) => [pkg, version])\n );\n await writeFile(\n join(tempDir, 'package.json'),\n JSON.stringify({ dependencies: deps, type: 'module' })\n );\n\n // Determine package manager (prefer bun if available)\n let pm = 'npm install';\n try {\n await execAsync('bun --version');\n pm = 'bun install';\n } catch {}\n\n // Install the packages in the temp directory\n await execAsync(pm, { cwd: tempDir });\n\n const absoluteOutfile = isAbsolute(outfile)\n ? outfile\n : join(process.cwd(), outfile);\n\n const buildOptions: BuildOptions = {\n bundle: true,\n outfile: absoluteOutfile,\n absWorkingDir: tempDir,\n platform: 'browser',\n conditions: ['browser', 'module', 'import', 'default'],\n minify: true,\n minifyIdentifiers: true,\n treeShaking: true,\n format: 'iife',\n ignoreAnnotations: true,\n stdin: {\n contents: bundlePackages\n .map((packageName) => {\n // Convert package name to global name (e.g. vanilla-intlayer -> VanillaIntlayer)\n const globalName = packageName\n .split('-')\n .map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)\n .join('');\n // Create a global variable for each package\n return `import * as ${globalName} from '${packageName}';\\nif (typeof window !== 'undefined') { window['${globalName}'] = ${globalName}; }`;\n })\n .join('\\n'),\n resolveDir: tempDir,\n },\n define: {\n 'process.env': '{}', // Fix ReferenceError: process is not defined\n // Inject generated environment variables\n ...treeShakingDefines,\n ...esbuildOptions.define,\n },\n alias: {\n ...alias,\n ...esbuildOptions.alias,\n },\n ...esbuildOptions,\n plugins: [intlayerBundlePlugin, ...(esbuildOptions.plugins || [])],\n };\n\n logger.setStatus('bundling');\n const result = await build(buildOptions);\n logger.setStatus('success');\n return result;\n } catch (error) {\n logger.setError(error);\n throw error;\n } finally {\n // Clean up temp directory\n await rm(tempDir, { recursive: true, force: true });\n }\n};\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,YAAY,UAAU,IAAI;AAEhC,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,iBAAiBA,kBAAY;;;;;;;;AAgBnC,MAAa,iBAAiB,OAAO,YAAmC;CACtE,MAAM,EACJ,UAAU,sBACV,eACA,iBAAiB,CAAC,GAAG,WAAW,GAChC,UAAU,gBACV,GAAG,mBACD;CAEJ,MAAM,iBAAiB,iBAAiB,aAAa;CAErD,MAAM,SAAS,IAAI,aAAa,cAAc;CAE9C,MAAM,QAAQ,SAAS;EACrB,eAAe;EACf,YAAY,UAAkB,QAAQ,QAAQ,IAAI,GAAG,KAAK;CAC5D,CAAC;CAID,MAAM,qBAAqB,iBACzB,iBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;CAEA,MAAM,uBAA+B;EACnC,MAAM;EACN,MAAM,OAAO;GAGX,MAAM,gBAAgB,IAAI,OACxB,KAAK,eACF,KAAK,aAAa,SAAS,QAAQ,uBAAuB,MAAM,CAAC,CAAC,CAClE,KAAK,GAAG,EAAE,WACf;GAEA,MAAM,UAAU,EAAE,QAAQ,cAAc,UAAU,EAChD,UAAU,MACZ,EAAE;GAGF,MAAM,UAAU,EAAE,QAAQ,eAAe,UAAU,EACjD,UAAU,MACZ,EAAE;EACJ;CACF;CAEA,MAAM,UAAU,KA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,MAAM,SAAS,MAAM,MAAM,YAAY;EACvC,OAAO,UAAU,SAAS;EAC1B,OAAO;CACT,SAAS,OAAO;EACd,OAAO,SAAS,KAAK;EACrB,MAAM;CACR,UAAU;EAER,MAAM,GAAG,SAAS;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;CACpD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"logBundle.mjs","names":["ANSIColors.BLUE","ANSIColors.RED"],"sources":["../../../src/bundle/logBundle.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\nimport * as ANSIColors from '../colors';\nimport { colorize, getPrefix, spinnerFrames, v, x } from '../logger';\nimport { extractErrorMessage } from '../utils/extractErrorMessage';\n\nexport class BundleLogger {\n private status: 'pending' | 'installing' | 'bundling' | 'success' | 'error' =\n 'pending';\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState = '';\n private error: string | undefined;\n\n constructor(configuration?: IntlayerConfig) {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setStatus(status: 'installing' | 'bundling' | 'success') {\n if (this.isFinished) return;\n this.status = status;\n if (status === 'success') {\n this.finish();\n } else {\n this.startSpinner();\n this.render();\n }\n }\n\n setError(error?: unknown) {\n if (this.isFinished) return;\n this.status = 'error';\n this.error = extractErrorMessage(error);\n this.finish();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n private finish() {\n this.isFinished = true;\n this.stopSpinner();\n this.render();\n }\n\n private render() {\n const frame = spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n if (this.status === 'installing') {\n lines.push(`${this.prefix} ${clock} Fetching and resolving packages...`);\n } else if (this.status === 'bundling') {\n lines.push(`${this.prefix} ${v} Fetching and resolving packages...`);\n lines.push(`${this.prefix} ${clock} Bundling application...`);\n } else if (this.status === 'success') {\n lines.push(`${this.prefix} ${v} Fetching and resolving packages...`);\n lines.push(`${this.prefix} ${v} Bundling application...`);\n } else if (this.status === 'error') {\n lines.push(\n `${this.prefix} ${x} Bundle failed: ${colorize(this.error ?? 'Unknown error', ANSIColors.RED)}`\n );\n }\n\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) return;\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n if (lines[i] !== undefined) {\n process.stdout.write(lines[i]);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,eAAb,MAA0B;CACxB,AAAQ,SACN;CACF,AAAQ,eAAsC;CAC9C,AAAQ,eAAe;CACvB,AAAQ,gBAAgB;CACxB,AAAQ,aAAa;CACrB,AAAiB;CACjB,AAAQ,oBAAoB;CAC5B,AAAQ;CAER,YAAY,eAAgC;AAC1C,OAAK,SAAS,UAAU,eAAe,KAAK,OAAO,IAAI;;CAGzD,UAAU,QAA+C;AACvD,MAAI,KAAK,WAAY;AACrB,OAAK,SAAS;AACd,MAAI,WAAW,UACb,MAAK,QAAQ;OACR;AACL,QAAK,cAAc;AACnB,QAAK,QAAQ;;;CAIjB,SAAS,OAAiB;AACxB,MAAI,KAAK,WAAY;AACrB,OAAK,SAAS;AACd,OAAK,QAAQ,oBAAoB,MAAM;AACvC,OAAK,QAAQ;;CAGf,AAAQ,eAAe;AACrB,MAAI,KAAK,gBAAgB,KAAK,WAAY;AAC1C,OAAK,eAAe,kBA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O,MAAM,KAAK;;AAG5B,OAAK,gBAAgB,MAAM"}
1
+ {"version":3,"file":"logBundle.mjs","names":["ANSIColors.BLUE","ANSIColors.RED"],"sources":["../../../src/bundle/logBundle.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\nimport * as ANSIColors from '../colors';\nimport { colorize, getPrefix, spinnerFrames, v, x } from '../logger';\nimport { extractErrorMessage } from '../utils/extractErrorMessage';\n\nexport class BundleLogger {\n private status: 'pending' | 'installing' | 'bundling' | 'success' | 'error' =\n 'pending';\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState = '';\n private error: string | undefined;\n\n constructor(configuration?: IntlayerConfig) {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setStatus(status: 'installing' | 'bundling' | 'success') {\n if (this.isFinished) return;\n this.status = status;\n if (status === 'success') {\n this.finish();\n } else {\n this.startSpinner();\n this.render();\n }\n }\n\n setError(error?: unknown) {\n if (this.isFinished) return;\n this.status = 'error';\n this.error = extractErrorMessage(error);\n this.finish();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n private finish() {\n this.isFinished = true;\n this.stopSpinner();\n this.render();\n }\n\n private render() {\n const frame = spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n if (this.status === 'installing') {\n lines.push(`${this.prefix} ${clock} Fetching and resolving packages...`);\n } else if (this.status === 'bundling') {\n lines.push(`${this.prefix} ${v} Fetching and resolving packages...`);\n lines.push(`${this.prefix} ${clock} Bundling application...`);\n } else if (this.status === 'success') {\n lines.push(`${this.prefix} ${v} Fetching and resolving packages...`);\n lines.push(`${this.prefix} ${v} Bundling application...`);\n } else if (this.status === 'error') {\n lines.push(\n `${this.prefix} ${x} Bundle failed: ${colorize(this.error ?? 'Unknown error', ANSIColors.RED)}`\n );\n }\n\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) return;\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n if (lines[i] !== undefined) {\n process.stdout.write(lines[i]);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,eAAb,MAA0B;CACxB,AAAQ,SACN;CACF,AAAQ,eAAsC;CAC9C,AAAQ,eAAe;CACvB,AAAQ,gBAAgB;CACxB,AAAQ,aAAa;CACrB,AAAiB;CACjB,AAAQ,oBAAoB;CAC5B,AAAQ;CAER,YAAY,eAAgC;EAC1C,KAAK,SAAS,UAAU,eAAe,KAAK,MAAM,KAAK;CACzD;CAEA,UAAU,QAA+C;EACvD,IAAI,KAAK,YAAY;EACrB,KAAK,SAAS;EACd,IAAI,WAAW,WACb,KAAK,OAAO;OACP;GACL,KAAK,aAAa;GAClB,KAAK,OAAO;EACd;CACF;CAEA,SAAS,OAAiB;EACxB,IAAI,KAAK,YAAY;EACrB,KAAK,SAAS;EACd,KAAK,QAAQ,oBAAoB,KAAK;EACtC,KAAK,OAAO;CACd;CAEA,AAAQ,eAAe;EACrB,IAAI,KAAK,gBAAgB,KAAK,YAAY;EAC1C,KAAK,eAAe,kBAAkB;GACpC,KAAK,gBAAgB,KAAK,eAAe,KAAK,cAAc;GAC5D,KAAK,OAAO;EACd,GAAG,GAAG;CACR;CAEA,AAAQ,cAAc;EACpB,IAAI,CAAC,KAAK,cAAc;EACxB,cAAc,KAAK,YAA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base intlayer getters — always active, independent of any compat library.
4
+ *
5
+ * Their result is the dictionary content object itself: fields are consumed
6
+ * through member access (`content.title`) or destructuring
7
+ * (`const { title } = useIntlayer('home')`).
8
+ */
9
+ const BASE_CALLERS = [{
10
+ callerName: "useIntlayer",
11
+ library: "intlayer",
12
+ importSources: [
13
+ "intlayer",
14
+ "react-intlayer",
15
+ "next-intlayer",
16
+ "vue-intlayer",
17
+ "svelte-intlayer",
18
+ "solid-intlayer",
19
+ "preact-intlayer",
20
+ "angular-intlayer"
21
+ ],
22
+ namespaceSources: [{
23
+ from: "argument",
24
+ index: 0
25
+ }],
26
+ translationFunction: "content"
27
+ }, {
28
+ callerName: "getIntlayer",
29
+ library: "intlayer",
30
+ importSources: ["intlayer", "@intlayer/core"],
31
+ namespaceSources: [{
32
+ from: "argument",
33
+ index: 0
34
+ }],
35
+ translationFunction: "content"
36
+ }];
37
+
38
+ //#endregion
39
+ export { BASE_CALLERS };
40
+ //# sourceMappingURL=base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.mjs","names":[],"sources":["../../../src/callers/base.ts"],"sourcesContent":["import type { CallerDescriptor } from './types';\n\n/**\n * Base intlayer getters — always active, independent of any compat library.\n *\n * Their result is the dictionary content object itself: fields are consumed\n * through member access (`content.title`) or destructuring\n * (`const { title } = useIntlayer('home')`).\n */\nexport const BASE_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useIntlayer',\n library: 'intlayer',\n importSources: [\n 'intlayer',\n 'react-intlayer',\n 'next-intlayer',\n 'vue-intlayer',\n 'svelte-intlayer',\n 'solid-intlayer',\n 'preact-intlayer',\n 'angular-intlayer',\n ],\n namespaceSources: [{ from: 'argument', index: 0 }],\n translationFunction: 'content',\n },\n {\n callerName: 'getIntlayer',\n library: 'intlayer',\n importSources: ['intlayer', '@intlayer/core'],\n namespaceSources: [{ from: 'argument', index: 0 }],\n translationFunction: 'content',\n },\n];\n"],"mappings":";;;;;;;;AASA,MAAa,eAAmC,CAC9C;CACE,YAAY;CACZ,SAAS;CACT,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,qBAAqB;AACvB,GACA;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,YAAY,gBAAgB;CAC5C,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,qBAAqB;AACvB,CACF"}
@@ -0,0 +1,25 @@
1
+ //#region src/callers/compat/i18next.ts
2
+ /**
3
+ * i18next — `@intlayer/i18next` compat adapter.
4
+ *
5
+ * Mirrors `compat/i18next/src/plugin/index.ts` (`I18NEXT_COMPAT_CALLERS`).
6
+ */
7
+ const I18NEXT_CALLERS = [{
8
+ callerName: "getFixedT",
9
+ library: "i18next",
10
+ importSources: ["i18next", "@intlayer/i18next"],
11
+ matchAsMethod: true,
12
+ namespaceSources: [{
13
+ from: "argument",
14
+ index: 1
15
+ }],
16
+ keyPrefixSources: [{
17
+ from: "argument",
18
+ index: 2
19
+ }],
20
+ translationFunction: "return-value"
21
+ }];
22
+
23
+ //#endregion
24
+ export { I18NEXT_CALLERS };
25
+ //# sourceMappingURL=i18next.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18next.mjs","names":[],"sources":["../../../../src/callers/compat/i18next.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * i18next — `@intlayer/i18next` compat adapter.\n *\n * Mirrors `compat/i18next/src/plugin/index.ts` (`I18NEXT_COMPAT_CALLERS`).\n */\nexport const I18NEXT_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'getFixedT',\n library: 'i18next',\n importSources: ['i18next', '@intlayer/i18next'],\n // `i18n.getFixedT(...)` — instance method, never imported as a specifier.\n matchAsMethod: true,\n // Signature: getFixedT(locale, namespace, keyPrefix?)\n namespaceSources: [{ from: 'argument', index: 1 }],\n keyPrefixSources: [{ from: 'argument', index: 2 }],\n translationFunction: 'return-value',\n },\n];\n"],"mappings":";;;;;;AAOA,MAAa,kBAAsC,CACjD;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,WAAW,mBAAmB;CAE9C,eAAe;CAEf,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,qBAAqB;AACvB,CACF"}