@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
@@ -10,6 +10,7 @@ const routing = parsedJSONConfig.routing;
10
10
  const content = parsedJSONConfig.content;
11
11
  const system = parsedJSONConfig.system;
12
12
  const editor = parsedJSONConfig.editor;
13
+ const analytics = parsedJSONConfig.analytics;
13
14
  const log = parsedJSONConfig.log;
14
15
  const ai = parsedJSONConfig.ai;
15
16
  const build = parsedJSONConfig.build;
@@ -19,6 +20,7 @@ const plugins = parsedJSONConfig.plugins;
19
20
 
20
21
  //#endregion
21
22
  exports.ai = ai;
23
+ exports.analytics = analytics;
22
24
  exports.build = build;
23
25
  exports.compiler = compiler;
24
26
  exports.content = content;
@@ -1 +1 @@
1
- {"version":3,"file":"built.cjs","names":["getConfiguration"],"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,gBAAgCA,sDAAkB;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.cjs","names":["getConfiguration"],"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,gBAAgCA,qDAAiB;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 +1 @@
1
- {"version":3,"file":"index.cjs","names":["exec","packageJSON","getConfiguration","BundleLogger","getAlias","getConfigEnvVars"],"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,qCAAsBA,wBAAK;AAEjC,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,iBAAiBC,qCAAY;;;;;;;;AAgBnC,MAAa,iBAAiB,OAAO,YAAmC;CACtE,MAAM,EACJ,UAAU,sBACV,eACA,iBAAiB,CAAC,GAAG,YAAY,EACjC,UAAU,gBACV,GAAG,mBACD;CAEJ,MAAM,iBAAiBC,qDAAiB,cAAc;CAEtD,MAAM,SAAS,IAAIC,sCAAa,eAAe;CAE/C,MAAM,QAAQC,6BAAS;EACrB,eAAe;EACf,YAAY,iCAA0B,QAAQ,KAAK,EAAE,MAAM;EAC5D,CAAC;CAIF,MAAM,qBAAqBC,yCACzB,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,8BAAe,eAAe,OAAO,SAAS,sBAAsB;AAE1E,QAAO,UAAU,aAAa;AAE9B,KAAI;AAEF,iCAAS,SAAS;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC;AACnD,oCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;EAGzC,MAAM,OAAO,OAAO,YAClB,eAAe,KAAK,QAAQ,CAAC,KAAK,QAAQ,CAAC,CAC5C;AACD,4DACO,SAAS,eAAe,EAC7B,KAAK,UAAU;GAAE,cAAc;GAAM,MAAM;GAAU,CAAC,CACvD;EAGD,IAAI,KAAK;AACT,MAAI;AACF,SAAM,UAAU,gBAAgB;AAChC,QAAK;UACC;AAGR,QAAM,UAAU,IAAI,EAAE,KAAK,SAAS,CAAC;EAMrC,MAAM,eAA6B;GACjC,QAAQ;GACR,mCANiC,QAAQ,GACvC,8BACK,QAAQ,KAAK,EAAE,QAAQ;GAK9B,eAAe;GACf,UAAU;GACV,YAAY;IAAC;IAAW;IAAU;IAAU;IAAU;GACtD,QAAQ;GACR,mBAAmB;GACnB,aAAa;GACb,QAAQ;GACR,mBAAmB;GACnB,OAAO;IACL,UAAU,eACP,KAAK,gBAAgB;KAEpB,MAAM,aAAa,YAChB,MAAM,IAAI,CACV,KAAK,SAAS,GAAG,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,GAAG,CAChE,KAAK,GAAG;AAEX,YAAO,eAAe,WAAW,SAAS,YAAY,mDAAmD,WAAW,OAAO,WAAW;MACtI,CACD,KAAK,KAAK;IACb,YAAY;IACb;GACD,QAAQ;IACN,eAAe;IAEf,GAAG;IACH,GAAG,eAAe;IACnB;GACD,OAAO;IACL,GAAG;IACH,GAAG,eAAe;IACnB;GACD,GAAG;GACH,SAAS,CAAC,sBAAsB,GAAI,eAAe,WAAW,EAAE,CAAE;GACnE;AAED,SAAO,UAAU,WAAW;EAC5B,MAAM,SAAS,yBAAY,aAAa;AACxC,SAAO,UAAU,UAAU;AAC3B,SAAO;UACA,OAAO;AACd,SAAO,SAAS,MAAM;AACtB,QAAM;WACE;AAER,iCAAS,SAAS;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["exec","packageJSON","getConfiguration","BundleLogger","getAlias","getConfigEnvVars"],"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,qCAAsBA,uBAAI;AAEhC,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,iBAAiBC,qCAAY;;;;;;;;AAgBnC,MAAa,iBAAiB,OAAO,YAAmC;CACtE,MAAM,EACJ,UAAU,sBACV,eACA,iBAAiB,CAAC,GAAG,WAAW,GAChC,UAAU,gBACV,GAAG,mBACD;CAEJ,MAAM,iBAAiBC,qDAAiB,aAAa;CAErD,MAAM,SAAS,IAAIC,sCAAa,cAAc;CAE9C,MAAM,QAAQC,6BAAS;EACrB,eAAe;EACf,YAAY,iCAA0B,QAAQ,IAAI,GAAG,KAAK;CAC5D,CAAC;CAID,MAAM,qBAAqBC,yCACzB,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,8BAAe,eAAe,OAAO,SAAS,qBAAqB;CAEzE,OAAO,UAAU,YAAY;CAE7B,IAAI;EAEF,+BAAS,SAAS;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EAClD,kCAAY,SAAS,EAAE,WAAW,KAAK,CAAC;EAGxC,MAAM,OAAO,OAAO,YAClB,eAAe,KAAK,QAAQ,CAAC,KAAK,OAAO,CAAC,CAC5C;EACA,0DACO,SAAS,cAAc,GAC5B,KAAK,UAAU;GAAE,cAAc;GAAM,MAAM;EAAS,CAAC,CACvD;EAGA,IAAI,KAAK;EACT,IAAI;GACF,MAAM,UAAU,eAAe;GAC/B,KAAK;EACP,QAAQ,CAAC;EAGT,MAAM,UAAU,IAAI,EAAE,KAAK,QAAQ,CAAC;EAMpC,MAAM,eAA6B;GACjC,QAAQ;GACR,mCANiC,OAAO,IACtC,8BACK,QAAQ,IAAI,GAAG,OAAO;GAK7B,eAAe;GACf,UAAU;GACV,YAAY;IAAC;IAAW;IAAU;IAAU;GAAS;GACrD,QAAQ;GACR,mBAAmB;GACnB,aAAa;GACb,QAAQ;GACR,mBAAmB;GACnB,OAAO;IACL,UAAU,eACP,KAAK,gBAAgB;KAEpB,MAAM,aAAa,YAChB,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,GAAG,CAAC,CAChE,KAAK,EAAE;KAEV,OAAO,eAAe,WAAW,SAAS,YAAY,mDAAmD,WAAW,OAAO,WAAW;IACxI,CAAC,CAAC,CACD,KAAK,IAAI;IACZ,YAAY;GACd;GACA,QAAQ;IACN,eAAe;IAEf,GAAG;IACH,GAAG,eAAe;GACpB;GACA,OAAO;IACL,GAAG;IACH,GAAG,eAAe;GACpB;GACA,GAAG;GACH,SAAS,CAAC,sBAAsB,GAAI,eAAe,WAAW,CAAC,CAAE;EACnE;EAEA,OAAO,UAAU,UAAU;EAC3B,MAAM,SAAS,yBAAY,YAAY;EACvC,OAAO,UAAU,SAAS;EAC1B,OAAO;CACT,SAAS,OAAO;EACd,OAAO,SAAS,KAAK;EACrB,MAAM;CACR,UAAU;EAER,+BAAS,SAAS;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;CACpD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"logBundle.cjs","names":["getPrefix","extractErrorMessage","spinnerFrames","colorize","v","x"],"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,SAASA,yBAAU,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,QAAQC,sDAAoB,MAAM;AACvC,OAAK,QAAQ;;CAGf,AAAQ,eAAe;AACrB,MAAI,KAAK,gBAAgB,KAAK,WAAY;AAC1C,OAAK,eAAe,kBAAkB;AACpC,QAAK,gBAAgB,KAAK,eAAe,KAAKC,6BAAc;AAC5D,QAAK,QAAQ;KACZ,IAAI;;CAGT,AAAQ,cAAc;AACpB,MAAI,CAAC,KAAK,aAAc;AACxB,gBAAc,KAAK,aAAa;AAChC,OAAK,eAAe;;CAGtB,AAAQ,SAAS;AACf,OAAK,aAAa;AAClB,OAAK,aAAa;AAClB,OAAK,QAAQ;;CAGf,AAAQ,SAAS;EACf,MAAM,QAAQA,6BAAc,KAAK;EACjC,MAAM,QAAQC,wBAAS,2BAAuB;EAC9C,MAAM,QAAkB,EAAE;AAE1B,MAAI,KAAK,WAAW,aAClB,OAAM,KAAK,GAAG,KAAK,OAAO,GAAG,MAAM,qCAAqC;WAC/D,KAAK,WAAW,YAAY;AACrC,SAAM,KAAK,GAAG,KAAK,OAAO,GAAGC,iBAAE,qCAAqC;AACpE,SAAM,KAAK,GAAG,KAAK,OAAO,GAAG,MAAM,0BAA0B;aACpD,KAAK,WAAW,WAAW;AACpC,SAAM,KAAK,GAAG,KAAK,OAAO,GAAGA,iBAAE,qCAAqC;AACpE,SAAM,KAAK,GAAG,KAAK,OAAO,GAAGA,iBAAE,0BAA0B;aAChD,KAAK,WAAW,QACzB,OAAM,KACJ,GAAG,KAAK,OAAO,GAAGC,iBAAE,kBAAkBF,wBAAS,KAAK,SAAS,oCAAgC,GAC9F;EAGH,MAAM,eAAe,MAAM,KAAK,KAAK;AACrC,MAAI,iBAAiB,KAAK,kBAAmB;AAC7C,OAAK,oBAAoB;AAEzB,MAAI,KAAK,gBAAgB,EACvB,SAAQ,OAAO,MAAM,QAAQ,KAAK,cAAc,GAAG;EAGrD,MAAM,oBAAoB,KAAK,IAAI,KAAK,eAAe,MAAM,OAAO;AACpE,OAAK,IAAI,IAAI,GAAG,IAAI,mBAAmB,KAAK;AAC1C,WAAQ,OAAO,MAAM,UAAU;AAC/B,OAAI,MAAM,OAAO,OACf,SAAQ,OAAO,MAAM,MAAM,GAAG;AAEhC,WAAQ,OAAO,MAAM,KAAK;;AAG5B,OAAK,gBAAgB,MAAM"}
1
+ {"version":3,"file":"logBundle.cjs","names":["getPrefix","extractErrorMessage","spinnerFrames","colorize","v","x"],"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,SAASA,yBAAU,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,QAAQC,sDAAoB,KAAK;EACtC,KAAK,OAAO;CACd;CAEA,AAAQ,eAAe;EACrB,IAAI,KAAK,gBAAgB,KAAK,YAAY;EAC1C,KAAK,eAAe,kBAAkB;GACpC,KAAK,gBAAgB,KAAK,eAAe,KAAKC,6BAAc;GAC5D,KAAK,OAAO;EACd,GAAG,GAAG;CACR;CAEA,AAAQ,cAAc;EACpB,IAAI,CAAC,KAAK,cAAc;EACxB,cAAc,KAAK,YAAY;EAC/B,KAAK,eAAe;CACtB;CAEA,AAAQ,SAAS;EACf,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,OAAO;CACd;CAEA,AAAQ,SAAS;EACf,MAAM,QAAQA,6BAAc,KAAK;EACjC,MAAM,QAAQC,wBAAS,0BAAsB;EAC7C,MAAM,QAAkB,CAAC;EAEzB,IAAI,KAAK,WAAW,cAClB,MAAM,KAAK,GAAG,KAAK,OAAO,GAAG,MAAM,oCAAoC;OAClE,IAAI,KAAK,WAAW,YAAY;GACrC,MAAM,KAAK,GAAG,KAAK,OAAO,GAAGC,iBAAE,oCAAoC;GACnE,MAAM,KAAK,GAAG,KAAK,OAAO,GAAG,MAAM,yBAAyB;EAC9D,OAAO,IAAI,KAAK,WAAW,WAAW;GACpC,MAAM,KAAK,GAAG,KAAK,OAAO,GAAGA,iBAAE,oCAAoC;GACnE,MAAM,KAAK,GAAG,KAAK,OAAO,GAAGA,iBAAE,yBAAyB;EAC1D,OAAO,IAAI,KAAK,WAAW,SACzB,MAAM,KACJ,GAAG,KAAK,OAAO,GAAGC,iBAAE,kBAAkBF,wBAAS,KAAK,SAAS,mCAA+B,GAC9F;EAGF,MAAM,eAAe,MAAM,KAAK,IAAI;EACpC,IAAI,iBAAiB,KAAK,mBAAmB;EAC7C,KAAK,oBAAoB;EAEzB,IAAI,KAAK,gBAAgB,GACvB,QAAQ,OAAO,MAAM,QAAQ,KAAK,cAAc,EAAE;EAGpD,MAAM,oBAAoB,KAAK,IAAI,KAAK,eAAe,MAAM,MAAM;EACnE,KAAK,IAAI,IAAI,GAAG,IAAI,mBAAmB,KAAK;GAC1C,QAAQ,OAAO,MAAM,SAAS;GAC9B,IAAI,MAAM,OAAO,QACf,QAAQ,OAAO,MAAM,MAAM,EAAE;GAE/B,QAAQ,OAAO,MAAM,IAAI;EAC3B;EAEA,KAAK,gBAAgB,MAAM;CAC7B;AACF"}
@@ -0,0 +1,42 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/base.ts
4
+ /**
5
+ * Base intlayer getters — always active, independent of any compat library.
6
+ *
7
+ * Their result is the dictionary content object itself: fields are consumed
8
+ * through member access (`content.title`) or destructuring
9
+ * (`const { title } = useIntlayer('home')`).
10
+ */
11
+ const BASE_CALLERS = [{
12
+ callerName: "useIntlayer",
13
+ library: "intlayer",
14
+ importSources: [
15
+ "intlayer",
16
+ "react-intlayer",
17
+ "next-intlayer",
18
+ "vue-intlayer",
19
+ "svelte-intlayer",
20
+ "solid-intlayer",
21
+ "preact-intlayer",
22
+ "angular-intlayer"
23
+ ],
24
+ namespaceSources: [{
25
+ from: "argument",
26
+ index: 0
27
+ }],
28
+ translationFunction: "content"
29
+ }, {
30
+ callerName: "getIntlayer",
31
+ library: "intlayer",
32
+ importSources: ["intlayer", "@intlayer/core"],
33
+ namespaceSources: [{
34
+ from: "argument",
35
+ index: 0
36
+ }],
37
+ translationFunction: "content"
38
+ }];
39
+
40
+ //#endregion
41
+ exports.BASE_CALLERS = BASE_CALLERS;
42
+ //# sourceMappingURL=base.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.cjs","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,27 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/i18next.ts
4
+ /**
5
+ * i18next — `@intlayer/i18next` compat adapter.
6
+ *
7
+ * Mirrors `compat/i18next/src/plugin/index.ts` (`I18NEXT_COMPAT_CALLERS`).
8
+ */
9
+ const I18NEXT_CALLERS = [{
10
+ callerName: "getFixedT",
11
+ library: "i18next",
12
+ importSources: ["i18next", "@intlayer/i18next"],
13
+ matchAsMethod: true,
14
+ namespaceSources: [{
15
+ from: "argument",
16
+ index: 1
17
+ }],
18
+ keyPrefixSources: [{
19
+ from: "argument",
20
+ index: 2
21
+ }],
22
+ translationFunction: "return-value"
23
+ }];
24
+
25
+ //#endregion
26
+ exports.I18NEXT_CALLERS = I18NEXT_CALLERS;
27
+ //# sourceMappingURL=i18next.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18next.cjs","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"}
@@ -0,0 +1,82 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/lingui.ts
4
+ /**
5
+ * Lingui — `@intlayer/lingui` compat adapter.
6
+ *
7
+ * Lingui is a single-catalog library: every message lives in the `messages`
8
+ * dictionary and catalog keys are flat (a dotted id such as
9
+ * `results-table.bundleSize` is one literal key, not a nested path).
10
+ *
11
+ * `t` and `_` are generic names, so all lingui callers require an import from
12
+ * a lingui module to participate in matching — this avoids false positives on
13
+ * unrelated `t()` helpers.
14
+ *
15
+ * Mirrors `compat/lingui/src/plugin/index.ts`.
16
+ */
17
+ const LINGUI_IMPORT_SOURCES = [
18
+ "@lingui/core",
19
+ "@lingui/react",
20
+ "@lingui/macro",
21
+ "@lingui/core/macro",
22
+ "@lingui/react/macro",
23
+ "@intlayer/lingui"
24
+ ];
25
+ const LINGUI_CALLERS = [
26
+ {
27
+ callerName: "useLingui",
28
+ library: "lingui",
29
+ importSources: LINGUI_IMPORT_SOURCES,
30
+ namespaceSources: [{
31
+ from: "fixed",
32
+ value: "messages"
33
+ }],
34
+ translationFunction: "destructured-t",
35
+ staticReplacement: "useDictionary",
36
+ dynamicReplacement: "useDictionaryDynamic"
37
+ },
38
+ {
39
+ callerName: "_",
40
+ library: "lingui",
41
+ importSources: LINGUI_IMPORT_SOURCES,
42
+ requiresImport: true,
43
+ matchAsMethod: true,
44
+ namespaceSources: [{
45
+ from: "fixed",
46
+ value: "messages"
47
+ }],
48
+ translationFunction: "self",
49
+ flatKey: true
50
+ },
51
+ {
52
+ callerName: "t",
53
+ library: "lingui",
54
+ importSources: LINGUI_IMPORT_SOURCES,
55
+ requiresImport: true,
56
+ matchAsMethod: true,
57
+ matchAsTaggedTemplate: true,
58
+ namespaceSources: [{
59
+ from: "fixed",
60
+ value: "messages"
61
+ }],
62
+ translationFunction: "self",
63
+ flatKey: true
64
+ },
65
+ {
66
+ callerName: "Trans",
67
+ library: "lingui",
68
+ importSources: LINGUI_IMPORT_SOURCES,
69
+ requiresImport: true,
70
+ jsxIdAttribute: "id",
71
+ namespaceSources: [{
72
+ from: "fixed",
73
+ value: "messages"
74
+ }],
75
+ translationFunction: "self",
76
+ flatKey: true
77
+ }
78
+ ];
79
+
80
+ //#endregion
81
+ exports.LINGUI_CALLERS = LINGUI_CALLERS;
82
+ //# sourceMappingURL=lingui.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lingui.cjs","names":[],"sources":["../../../../src/callers/compat/lingui.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * Lingui — `@intlayer/lingui` compat adapter.\n *\n * Lingui is a single-catalog library: every message lives in the `messages`\n * dictionary and catalog keys are flat (a dotted id such as\n * `results-table.bundleSize` is one literal key, not a nested path).\n *\n * `t` and `_` are generic names, so all lingui callers require an import from\n * a lingui module to participate in matching — this avoids false positives on\n * unrelated `t()` helpers.\n *\n * Mirrors `compat/lingui/src/plugin/index.ts`.\n */\nconst LINGUI_IMPORT_SOURCES = [\n '@lingui/core',\n '@lingui/react',\n '@lingui/macro',\n '@lingui/core/macro',\n '@lingui/react/macro',\n '@intlayer/lingui',\n];\n\nexport const LINGUI_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useLingui',\n library: 'lingui',\n importSources: LINGUI_IMPORT_SOURCES,\n // `const { i18n, t, _ } = useLingui()` — single-catalog hook, no\n // namespace argument: every call reads the `messages` dictionary.\n namespaceSources: [{ from: 'fixed', value: 'messages' }],\n translationFunction: 'destructured-t',\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n {\n callerName: '_',\n library: 'lingui',\n importSources: LINGUI_IMPORT_SOURCES,\n requiresImport: true,\n // `i18n._('id')` and the destructured `const { _ } = useLingui()` form.\n matchAsMethod: true,\n namespaceSources: [{ from: 'fixed', value: 'messages' }],\n translationFunction: 'self',\n flatKey: true,\n },\n {\n callerName: 't',\n library: 'lingui',\n importSources: LINGUI_IMPORT_SOURCES,\n requiresImport: true,\n // `i18n.t('id')`, `t({ id: 'id' })` and the macro tagged template ``t`…` ``.\n matchAsMethod: true,\n matchAsTaggedTemplate: true,\n namespaceSources: [{ from: 'fixed', value: 'messages' }],\n translationFunction: 'self',\n flatKey: true,\n },\n {\n callerName: 'Trans',\n library: 'lingui',\n importSources: LINGUI_IMPORT_SOURCES,\n requiresImport: true,\n // <Trans id=\"home.title\" message=\"Welcome\" />\n jsxIdAttribute: 'id',\n namespaceSources: [{ from: 'fixed', value: 'messages' }],\n translationFunction: 'self',\n flatKey: true,\n },\n];\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM,wBAAwB;CAC5B;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,iBAAqC;CAChD;EACE,YAAY;EACZ,SAAS;EACT,eAAe;EAGf,kBAAkB,CAAC;GAAE,MAAM;GAAS,OAAO;EAAW,CAAC;EACvD,qBAAqB;EACrB,mBAAmB;EACnB,oBAAoB;CACtB;CACA;EACE,YAAY;EACZ,SAAS;EACT,eAAe;EACf,gBAAgB;EAEhB,eAAe;EACf,kBAAkB,CAAC;GAAE,MAAM;GAAS,OAAO;EAAW,CAAC;EACvD,qBAAqB;EACrB,SAAS;CACX;CACA;EACE,YAAY;EACZ,SAAS;EACT,eAAe;EACf,gBAAgB;EAEhB,eAAe;EACf,uBAAuB;EACvB,kBAAkB,CAAC;GAAE,MAAM;GAAS,OAAO;EAAW,CAAC;EACvD,qBAAqB;EACrB,SAAS;CACX;CACA;EACE,YAAY;EACZ,SAAS;EACT,eAAe;EACf,gBAAgB;EAEhB,gBAAgB;EAChB,kBAAkB,CAAC;GAAE,MAAM;GAAS,OAAO;EAAW,CAAC;EACvD,qBAAqB;EACrB,SAAS;CACX;AACF"}
@@ -0,0 +1,44 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/nextIntl.ts
4
+ /**
5
+ * next-intl — `@intlayer/next-intl` compat adapter.
6
+ *
7
+ * Mirrors `compat/next-intl/src/plugin/index.ts` (`NEXT_INTL_SWC_CALLERS`),
8
+ * adding the `getTranslations({ locale, namespace })` object overload.
9
+ */
10
+ const NEXT_INTL_CALLERS = [{
11
+ callerName: "useTranslations",
12
+ library: "next-intl",
13
+ importSources: ["next-intl", "@intlayer/next-intl"],
14
+ namespaceSources: [{
15
+ from: "argument",
16
+ index: 0
17
+ }],
18
+ translationFunction: "return-value",
19
+ nestedNamespace: true,
20
+ allowRootScope: true,
21
+ staticReplacement: "useDictionary",
22
+ dynamicReplacement: "useDictionaryDynamic"
23
+ }, {
24
+ callerName: "getTranslations",
25
+ library: "next-intl",
26
+ importSources: ["next-intl/server", "@intlayer/next-intl/server"],
27
+ namespaceSources: [{
28
+ from: "argument",
29
+ index: 0
30
+ }, {
31
+ from: "option",
32
+ argumentIndex: 0,
33
+ property: "namespace"
34
+ }],
35
+ translationFunction: "return-value",
36
+ nestedNamespace: true,
37
+ allowRootScope: true,
38
+ staticReplacement: "getDictionary",
39
+ dynamicReplacement: "getDictionaryDynamic"
40
+ }];
41
+
42
+ //#endregion
43
+ exports.NEXT_INTL_CALLERS = NEXT_INTL_CALLERS;
44
+ //# sourceMappingURL=nextIntl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextIntl.cjs","names":[],"sources":["../../../../src/callers/compat/nextIntl.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * next-intl — `@intlayer/next-intl` compat adapter.\n *\n * Mirrors `compat/next-intl/src/plugin/index.ts` (`NEXT_INTL_SWC_CALLERS`),\n * adding the `getTranslations({ locale, namespace })` object overload.\n */\nexport const NEXT_INTL_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useTranslations',\n library: 'next-intl',\n importSources: ['next-intl', '@intlayer/next-intl'],\n namespaceSources: [{ from: 'argument', index: 0 }],\n translationFunction: 'return-value',\n // useTranslations('about.counter') → dictionary `about`, prefix `counter`\n nestedNamespace: true,\n // bare useTranslations() → first id segment is the dictionary\n allowRootScope: true,\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n {\n callerName: 'getTranslations',\n library: 'next-intl',\n importSources: ['next-intl/server', '@intlayer/next-intl/server'],\n // Both overloads: getTranslations('ns') and\n // getTranslations({ locale, namespace: 'ns' }).\n namespaceSources: [\n { from: 'argument', index: 0 },\n { from: 'option', argumentIndex: 0, property: 'namespace' },\n ],\n translationFunction: 'return-value',\n nestedNamespace: true,\n allowRootScope: true,\n staticReplacement: 'getDictionary',\n dynamicReplacement: 'getDictionaryDynamic',\n },\n];\n"],"mappings":";;;;;;;;;AAQA,MAAa,oBAAwC,CACnD;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,aAAa,qBAAqB;CAClD,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,qBAAqB;CAErB,iBAAiB;CAEjB,gBAAgB;CAChB,mBAAmB;CACnB,oBAAoB;AACtB,GACA;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,oBAAoB,4BAA4B;CAGhE,kBAAkB,CAChB;EAAE,MAAM;EAAY,OAAO;CAAE,GAC7B;EAAE,MAAM;EAAU,eAAe;EAAG,UAAU;CAAY,CAC5D;CACA,qBAAqB;CACrB,iBAAiB;CACjB,gBAAgB;CAChB,mBAAmB;CACnB,oBAAoB;AACtB,CACF"}
@@ -0,0 +1,50 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/reactI18next.ts
4
+ /**
5
+ * react-i18next / next-i18next — `@intlayer/react-i18next` and
6
+ * `@intlayer/next-i18next` compat adapters (next-i18next re-exports the
7
+ * react-i18next hook, so both libraries share the same callers).
8
+ *
9
+ * Mirrors `compat/react-i18next/src/plugin/index.ts` and
10
+ * `compat/next-i18next/src/plugin/index.ts`.
11
+ */
12
+ const REACT_I18NEXT_CALLERS = [{
13
+ callerName: "useTranslation",
14
+ library: "react-i18next",
15
+ importSources: [
16
+ "react-i18next",
17
+ "next-i18next",
18
+ "@intlayer/react-i18next",
19
+ "@intlayer/next-i18next"
20
+ ],
21
+ namespaceSources: [{
22
+ from: "argument",
23
+ index: 0
24
+ }],
25
+ keyPrefixSources: [{
26
+ from: "option",
27
+ argumentIndex: 1,
28
+ property: "keyPrefix"
29
+ }],
30
+ translationFunction: "destructured-t",
31
+ staticReplacement: "useDictionary",
32
+ dynamicReplacement: "useDictionaryDynamic"
33
+ }, {
34
+ callerName: "Trans",
35
+ library: "react-i18next",
36
+ importSources: [
37
+ "react-i18next",
38
+ "next-i18next",
39
+ "@intlayer/react-i18next",
40
+ "@intlayer/next-i18next"
41
+ ],
42
+ jsxIdAttribute: "i18nKey",
43
+ jsxNamespaceAttribute: "ns",
44
+ namespaceSources: [],
45
+ translationFunction: "self"
46
+ }];
47
+
48
+ //#endregion
49
+ exports.REACT_I18NEXT_CALLERS = REACT_I18NEXT_CALLERS;
50
+ //# sourceMappingURL=reactI18next.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactI18next.cjs","names":[],"sources":["../../../../src/callers/compat/reactI18next.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * react-i18next / next-i18next — `@intlayer/react-i18next` and\n * `@intlayer/next-i18next` compat adapters (next-i18next re-exports the\n * react-i18next hook, so both libraries share the same callers).\n *\n * Mirrors `compat/react-i18next/src/plugin/index.ts` and\n * `compat/next-i18next/src/plugin/index.ts`.\n */\nexport const REACT_I18NEXT_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useTranslation',\n library: 'react-i18next',\n importSources: [\n 'react-i18next',\n 'next-i18next',\n '@intlayer/react-i18next',\n '@intlayer/next-i18next',\n ],\n namespaceSources: [{ from: 'argument', index: 0 }],\n keyPrefixSources: [\n { from: 'option', argumentIndex: 1, property: 'keyPrefix' },\n ],\n translationFunction: 'destructured-t',\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n {\n callerName: 'Trans',\n library: 'react-i18next',\n importSources: [\n 'react-i18next',\n 'next-i18next',\n '@intlayer/react-i18next',\n '@intlayer/next-i18next',\n ],\n // <Trans ns=\"home\" i18nKey=\"richText\" /> — the namespace attribute is\n // optional; without it the analyser falls back to the single translator\n // namespace declared in the same file.\n jsxIdAttribute: 'i18nKey',\n jsxNamespaceAttribute: 'ns',\n namespaceSources: [],\n translationFunction: 'self',\n },\n];\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,wBAA4C,CACvD;CACE,YAAY;CACZ,SAAS;CACT,eAAe;EACb;EACA;EACA;EACA;CACF;CACA,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,kBAAkB,CAChB;EAAE,MAAM;EAAU,eAAe;EAAG,UAAU;CAAY,CAC5D;CACA,qBAAqB;CACrB,mBAAmB;CACnB,oBAAoB;AACtB,GACA;CACE,YAAY;CACZ,SAAS;CACT,eAAe;EACb;EACA;EACA;EACA;CACF;CAIA,gBAAgB;CAChB,uBAAuB;CACvB,kBAAkB,CAAC;CACnB,qBAAqB;AACvB,CACF"}
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/reactIntl.ts
4
+ /**
5
+ * react-intl (FormatJS) — `@intlayer/react-intl` compat adapter.
6
+ *
7
+ * The full dotted message id encodes both the dictionary key and the field
8
+ * path: `formatMessage({ id: 'home.title' })` → dictionary `home`, field
9
+ * `title`.
10
+ *
11
+ * Mirrors `compat/react-intl/src/plugin/index.ts`.
12
+ */
13
+ const REACT_INTL_CALLERS = [{
14
+ callerName: "formatMessage",
15
+ library: "react-intl",
16
+ importSources: ["react-intl", "@intlayer/react-intl"],
17
+ matchAsMethod: true,
18
+ namespaceSources: [{ from: "path-first-segment" }],
19
+ translationFunction: "self"
20
+ }, {
21
+ callerName: "FormattedMessage",
22
+ library: "react-intl",
23
+ importSources: ["react-intl", "@intlayer/react-intl"],
24
+ jsxIdAttribute: "id",
25
+ namespaceSources: [{ from: "path-first-segment" }],
26
+ translationFunction: "self"
27
+ }];
28
+
29
+ //#endregion
30
+ exports.REACT_INTL_CALLERS = REACT_INTL_CALLERS;
31
+ //# sourceMappingURL=reactIntl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactIntl.cjs","names":[],"sources":["../../../../src/callers/compat/reactIntl.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * react-intl (FormatJS) — `@intlayer/react-intl` compat adapter.\n *\n * The full dotted message id encodes both the dictionary key and the field\n * path: `formatMessage({ id: 'home.title' })` → dictionary `home`, field\n * `title`.\n *\n * Mirrors `compat/react-intl/src/plugin/index.ts`.\n */\nexport const REACT_INTL_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'formatMessage',\n library: 'react-intl',\n importSources: ['react-intl', '@intlayer/react-intl'],\n // Matches both `intl.formatMessage(...)` and the destructured\n // `const { formatMessage } = useIntl()` identifier form.\n matchAsMethod: true,\n namespaceSources: [{ from: 'path-first-segment' }],\n translationFunction: 'self',\n },\n {\n callerName: 'FormattedMessage',\n library: 'react-intl',\n importSources: ['react-intl', '@intlayer/react-intl'],\n jsxIdAttribute: 'id',\n namespaceSources: [{ from: 'path-first-segment' }],\n translationFunction: 'self',\n },\n];\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,qBAAyC,CACpD;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,cAAc,sBAAsB;CAGpD,eAAe;CACf,kBAAkB,CAAC,EAAE,MAAM,qBAAqB,CAAC;CACjD,qBAAqB;AACvB,GACA;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,cAAc,sBAAsB;CACpD,gBAAgB;CAChB,kBAAkB,CAAC,EAAE,MAAM,qBAAqB,CAAC;CACjD,qBAAqB;AACvB,CACF"}
@@ -0,0 +1,46 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/useIntl.ts
4
+ /**
5
+ * use-intl — `@intlayer/use-intl` compat adapter.
6
+ *
7
+ * Mirrors `compat/use-intl/src/plugin/index.ts`.
8
+ */
9
+ const USE_INTL_CALLERS = [{
10
+ callerName: "useTranslations",
11
+ library: "use-intl",
12
+ importSources: [
13
+ "use-intl",
14
+ "use-intl/react",
15
+ "@intlayer/use-intl"
16
+ ],
17
+ namespaceSources: [{
18
+ from: "argument",
19
+ index: 0
20
+ }],
21
+ translationFunction: "return-value",
22
+ nestedNamespace: true,
23
+ allowRootScope: true,
24
+ staticReplacement: "useDictionary",
25
+ dynamicReplacement: "useDictionaryDynamic"
26
+ }, {
27
+ callerName: "createTranslator",
28
+ library: "use-intl",
29
+ importSources: [
30
+ "use-intl",
31
+ "use-intl/core",
32
+ "@intlayer/use-intl"
33
+ ],
34
+ namespaceSources: [{
35
+ from: "option",
36
+ argumentIndex: 0,
37
+ property: "namespace"
38
+ }],
39
+ translationFunction: "return-value",
40
+ nestedNamespace: true,
41
+ allowRootScope: true
42
+ }];
43
+
44
+ //#endregion
45
+ exports.USE_INTL_CALLERS = USE_INTL_CALLERS;
46
+ //# sourceMappingURL=useIntl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntl.cjs","names":[],"sources":["../../../../src/callers/compat/useIntl.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * use-intl — `@intlayer/use-intl` compat adapter.\n *\n * Mirrors `compat/use-intl/src/plugin/index.ts`.\n */\nexport const USE_INTL_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useTranslations',\n library: 'use-intl',\n importSources: ['use-intl', 'use-intl/react', '@intlayer/use-intl'],\n namespaceSources: [{ from: 'argument', index: 0 }],\n translationFunction: 'return-value',\n // Same namespace semantics as next-intl (next-intl re-exports use-intl).\n nestedNamespace: true,\n allowRootScope: true,\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n {\n callerName: 'createTranslator',\n library: 'use-intl',\n importSources: ['use-intl', 'use-intl/core', '@intlayer/use-intl'],\n namespaceSources: [\n { from: 'option', argumentIndex: 0, property: 'namespace' },\n ],\n translationFunction: 'return-value',\n nestedNamespace: true,\n allowRootScope: true,\n },\n];\n"],"mappings":";;;;;;;;AAOA,MAAa,mBAAuC,CAClD;CACE,YAAY;CACZ,SAAS;CACT,eAAe;EAAC;EAAY;EAAkB;CAAoB;CAClE,kBAAkB,CAAC;EAAE,MAAM;EAAY,OAAO;CAAE,CAAC;CACjD,qBAAqB;CAErB,iBAAiB;CACjB,gBAAgB;CAChB,mBAAmB;CACnB,oBAAoB;AACtB,GACA;CACE,YAAY;CACZ,SAAS;CACT,eAAe;EAAC;EAAY;EAAiB;CAAoB;CACjE,kBAAkB,CAChB;EAAE,MAAM;EAAU,eAAe;EAAG,UAAU;CAAY,CAC5D;CACA,qBAAqB;CACrB,iBAAiB;CACjB,gBAAgB;AAClB,CACF"}
@@ -0,0 +1,26 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/callers/compat/vueI18n.ts
4
+ /**
5
+ * vue-i18n — `@intlayer/vue-i18n` compat adapter.
6
+ *
7
+ * Mirrors `compat/vue-i18n/src/plugin/index.ts`.
8
+ */
9
+ const VUE_I18N_CALLERS = [{
10
+ callerName: "useI18n",
11
+ library: "vue-i18n",
12
+ importSources: ["vue-i18n", "@intlayer/vue-i18n"],
13
+ namespaceSources: [{
14
+ from: "option",
15
+ argumentIndex: 0,
16
+ property: "namespace"
17
+ }],
18
+ translationFunction: "destructured-t",
19
+ allowRootScope: true,
20
+ staticReplacement: "useDictionary",
21
+ dynamicReplacement: "useDictionaryDynamic"
22
+ }];
23
+
24
+ //#endregion
25
+ exports.VUE_I18N_CALLERS = VUE_I18N_CALLERS;
26
+ //# sourceMappingURL=vueI18n.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vueI18n.cjs","names":[],"sources":["../../../../src/callers/compat/vueI18n.ts"],"sourcesContent":["import type { CallerDescriptor } from '../types';\n\n/**\n * vue-i18n — `@intlayer/vue-i18n` compat adapter.\n *\n * Mirrors `compat/vue-i18n/src/plugin/index.ts`.\n */\nexport const VUE_I18N_CALLERS: CallerDescriptor[] = [\n {\n callerName: 'useI18n',\n library: 'vue-i18n',\n importSources: ['vue-i18n', '@intlayer/vue-i18n'],\n // `const { t } = useI18n({ namespace: 'ns' })` — the namespace is an\n // intlayer extension of vue-i18n's options object.\n namespaceSources: [\n { from: 'option', argumentIndex: 0, property: 'namespace' },\n ],\n translationFunction: 'destructured-t',\n // Bare `useI18n()` resolves the first key segment as the dictionary:\n // `t('footer.github')` → dictionary `footer`, field `github`.\n allowRootScope: true,\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n];\n"],"mappings":";;;;;;;;AAOA,MAAa,mBAAuC,CAClD;CACE,YAAY;CACZ,SAAS;CACT,eAAe,CAAC,YAAY,oBAAoB;CAGhD,kBAAkB,CAChB;EAAE,MAAM;EAAU,eAAe;EAAG,UAAU;CAAY,CAC5D;CACA,qBAAqB;CAGrB,gBAAgB;CAChB,mBAAmB;CACnB,oBAAoB;AACtB,CACF"}
@@ -0,0 +1,87 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_callers_base = require('./base.cjs');
3
+ const require_callers_transform = require('./transform.cjs');
4
+ const require_callers_compat_i18next = require('./compat/i18next.cjs');
5
+ const require_callers_compat_lingui = require('./compat/lingui.cjs');
6
+ const require_callers_compat_nextIntl = require('./compat/nextIntl.cjs');
7
+ const require_callers_compat_reactI18next = require('./compat/reactI18next.cjs');
8
+ const require_callers_compat_reactIntl = require('./compat/reactIntl.cjs');
9
+ const require_callers_compat_useIntl = require('./compat/useIntl.cjs');
10
+ const require_callers_compat_vueI18n = require('./compat/vueI18n.cjs');
11
+
12
+ //#region src/callers/index.ts
13
+ /**
14
+ * Compat-adapter callers, grouped in one list. Each compat package's bundler
15
+ * plugin injects its own slice (e.g. `REACT_I18NEXT_CALLERS`) into the build
16
+ * pipeline; this aggregate exists for consumers that need every syntax at
17
+ * once, such as the LSP.
18
+ */
19
+ const COMPAT_CALLERS = [
20
+ ...require_callers_compat_i18next.I18NEXT_CALLERS,
21
+ ...require_callers_compat_reactI18next.REACT_I18NEXT_CALLERS,
22
+ ...require_callers_compat_nextIntl.NEXT_INTL_CALLERS,
23
+ ...require_callers_compat_useIntl.USE_INTL_CALLERS,
24
+ ...require_callers_compat_reactIntl.REACT_INTL_CALLERS,
25
+ ...require_callers_compat_lingui.LINGUI_CALLERS,
26
+ ...require_callers_compat_vueI18n.VUE_I18N_CALLERS
27
+ ];
28
+ /** Base + compat callers — the full registry the matchers run against. */
29
+ const ALL_CALLERS = [...require_callers_base.BASE_CALLERS, ...COMPAT_CALLERS];
30
+ /**
31
+ * Descriptors indexed by caller name. A name can map to several descriptors
32
+ * (e.g. `Trans` exists in both react-i18next and lingui with different
33
+ * attributes); matchers try them in registry order.
34
+ */
35
+ const CALLERS_BY_NAME = (() => {
36
+ const byName = /* @__PURE__ */ new Map();
37
+ for (const descriptor of ALL_CALLERS) {
38
+ const existing = byName.get(descriptor.callerName);
39
+ if (existing) existing.push(descriptor);
40
+ else byName.set(descriptor.callerName, [descriptor]);
41
+ }
42
+ return byName;
43
+ })();
44
+ /**
45
+ * Caller names whose dictionary key can appear as a positional string literal
46
+ * argument (`caller('key', …)` / `caller(locale, 'key', …)`). Used to build
47
+ * text-search regexes over project source files (find-references) and the
48
+ * completion trigger pattern. Callers whose key never appears positionally
49
+ * (fixed namespace, options object, JSX-only) are excluded on purpose.
50
+ */
51
+ const getPositionalKeyCallerNames = () => {
52
+ const names = /* @__PURE__ */ new Set();
53
+ for (const descriptor of ALL_CALLERS) if (descriptor.namespaceSources.some((source) => source.from === "argument")) names.add(descriptor.callerName);
54
+ return [...names];
55
+ };
56
+ /**
57
+ * Returns `true` when the descriptor may participate in matching for a file
58
+ * importing from `importSources`. Descriptors flagged `requiresImport` only
59
+ * activate when the file imports from one of their declared modules;
60
+ * everything else is always active (results are still validated against the
61
+ * project's dictionaries downstream).
62
+ *
63
+ * @param descriptor - The caller descriptor to gate.
64
+ * @param fileImportSources - Module specifiers imported by the analysed file.
65
+ */
66
+ const isCallerActive = (descriptor, fileImportSources) => {
67
+ if (!descriptor.requiresImport) return true;
68
+ return descriptor.importSources.some((source) => fileImportSources.has(source));
69
+ };
70
+
71
+ //#endregion
72
+ exports.ALL_CALLERS = ALL_CALLERS;
73
+ exports.BASE_CALLERS = require_callers_base.BASE_CALLERS;
74
+ exports.CALLERS_BY_NAME = CALLERS_BY_NAME;
75
+ exports.COMPAT_CALLERS = COMPAT_CALLERS;
76
+ exports.I18NEXT_CALLERS = require_callers_compat_i18next.I18NEXT_CALLERS;
77
+ exports.LINGUI_CALLERS = require_callers_compat_lingui.LINGUI_CALLERS;
78
+ exports.NEXT_INTL_CALLERS = require_callers_compat_nextIntl.NEXT_INTL_CALLERS;
79
+ exports.REACT_I18NEXT_CALLERS = require_callers_compat_reactI18next.REACT_I18NEXT_CALLERS;
80
+ exports.REACT_INTL_CALLERS = require_callers_compat_reactIntl.REACT_INTL_CALLERS;
81
+ exports.USE_INTL_CALLERS = require_callers_compat_useIntl.USE_INTL_CALLERS;
82
+ exports.VUE_I18N_CALLERS = require_callers_compat_vueI18n.VUE_I18N_CALLERS;
83
+ exports.getPositionalKeyCallerNames = getPositionalKeyCallerNames;
84
+ exports.getRewritableCallers = require_callers_transform.getRewritableCallers;
85
+ exports.isCallerActive = isCallerActive;
86
+ exports.toSwcExtraCallers = require_callers_transform.toSwcExtraCallers;
87
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["I18NEXT_CALLERS","REACT_I18NEXT_CALLERS","NEXT_INTL_CALLERS","USE_INTL_CALLERS","REACT_INTL_CALLERS","LINGUI_CALLERS","VUE_I18N_CALLERS","BASE_CALLERS"],"sources":["../../../src/callers/index.ts"],"sourcesContent":["import { BASE_CALLERS } from './base';\nimport { I18NEXT_CALLERS } from './compat/i18next';\nimport { LINGUI_CALLERS } from './compat/lingui';\nimport { NEXT_INTL_CALLERS } from './compat/nextIntl';\nimport { REACT_I18NEXT_CALLERS } from './compat/reactI18next';\nimport { REACT_INTL_CALLERS } from './compat/reactIntl';\nimport { USE_INTL_CALLERS } from './compat/useIntl';\nimport { VUE_I18N_CALLERS } from './compat/vueI18n';\nimport type { CallerDescriptor } from './types';\n\nexport { BASE_CALLERS } from './base';\nexport { I18NEXT_CALLERS } from './compat/i18next';\nexport { LINGUI_CALLERS } from './compat/lingui';\nexport { NEXT_INTL_CALLERS } from './compat/nextIntl';\nexport { REACT_I18NEXT_CALLERS } from './compat/reactI18next';\nexport { REACT_INTL_CALLERS } from './compat/reactIntl';\nexport { USE_INTL_CALLERS } from './compat/useIntl';\nexport { VUE_I18N_CALLERS } from './compat/vueI18n';\nexport {\n getRewritableCallers,\n type SwcExtraCallerConfig,\n toSwcExtraCallers,\n} from './transform';\nexport type {\n CallerDescriptor,\n CallerResultShape,\n CallerValueSource,\n} from './types';\n\n/**\n * Compat-adapter callers, grouped in one list. Each compat package's bundler\n * plugin injects its own slice (e.g. `REACT_I18NEXT_CALLERS`) into the build\n * pipeline; this aggregate exists for consumers that need every syntax at\n * once, such as the LSP.\n */\nexport const COMPAT_CALLERS: CallerDescriptor[] = [\n ...I18NEXT_CALLERS,\n ...REACT_I18NEXT_CALLERS,\n ...NEXT_INTL_CALLERS,\n ...USE_INTL_CALLERS,\n ...REACT_INTL_CALLERS,\n ...LINGUI_CALLERS,\n ...VUE_I18N_CALLERS,\n];\n\n/** Base + compat callers — the full registry the matchers run against. */\nexport const ALL_CALLERS: CallerDescriptor[] = [\n ...BASE_CALLERS,\n ...COMPAT_CALLERS,\n];\n\n/**\n * Descriptors indexed by caller name. A name can map to several descriptors\n * (e.g. `Trans` exists in both react-i18next and lingui with different\n * attributes); matchers try them in registry order.\n */\nexport const CALLERS_BY_NAME: Map<string, CallerDescriptor[]> = (() => {\n const byName = new Map<string, CallerDescriptor[]>();\n\n for (const descriptor of ALL_CALLERS) {\n const existing = byName.get(descriptor.callerName);\n\n if (existing) {\n existing.push(descriptor);\n } else {\n byName.set(descriptor.callerName, [descriptor]);\n }\n }\n\n return byName;\n})();\n\n/**\n * Caller names whose dictionary key can appear as a positional string literal\n * argument (`caller('key', …)` / `caller(locale, 'key', …)`). Used to build\n * text-search regexes over project source files (find-references) and the\n * completion trigger pattern. Callers whose key never appears positionally\n * (fixed namespace, options object, JSX-only) are excluded on purpose.\n */\nexport const getPositionalKeyCallerNames = (): string[] => {\n const names = new Set<string>();\n\n for (const descriptor of ALL_CALLERS) {\n const hasPositionalNamespace = descriptor.namespaceSources.some(\n (source) => source.from === 'argument'\n );\n\n if (hasPositionalNamespace) names.add(descriptor.callerName);\n }\n\n return [...names];\n};\n\n/**\n * Returns `true` when the descriptor may participate in matching for a file\n * importing from `importSources`. Descriptors flagged `requiresImport` only\n * activate when the file imports from one of their declared modules;\n * everything else is always active (results are still validated against the\n * project's dictionaries downstream).\n *\n * @param descriptor - The caller descriptor to gate.\n * @param fileImportSources - Module specifiers imported by the analysed file.\n */\nexport const isCallerActive = (\n descriptor: CallerDescriptor,\n fileImportSources: ReadonlySet<string>\n): boolean => {\n if (!descriptor.requiresImport) return true;\n\n return descriptor.importSources.some((source) =>\n fileImportSources.has(source)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAa,iBAAqC;CAChD,GAAGA;CACH,GAAGC;CACH,GAAGC;CACH,GAAGC;CACH,GAAGC;CACH,GAAGC;CACH,GAAGC;AACL;;AAGA,MAAa,cAAkC,CAC7C,GAAGC,mCACH,GAAG,cACL;;;;;;AAOA,MAAa,yBAA0D;CACrE,MAAM,yBAAS,IAAI,IAAgC;CAEnD,KAAK,MAAM,cAAc,aAAa;EACpC,MAAM,WAAW,OAAO,IAAI,WAAW,UAAU;EAEjD,IAAI,UACF,SAAS,KAAK,UAAU;OAExB,OAAO,IAAI,WAAW,YAAY,CAAC,UAAU,CAAC;CAElD;CAEA,OAAO;AACT,EAAC,CAAE;;;;;;;;AASH,MAAa,oCAA8C;CACzD,MAAM,wBAAQ,IAAI,IAAY;CAE9B,KAAK,MAAM,cAAc,aAKvB,IAJ+B,WAAW,iBAAiB,MACxD,WAAW,OAAO,SAAS,UAGL,GAAG,MAAM,IAAI,WAAW,UAAU;CAG7D,OAAO,CAAC,GAAG,KAAK;AAClB;;;;;;;;;;;AAYA,MAAa,kBACX,YACA,sBACY;CACZ,IAAI,CAAC,WAAW,gBAAgB,OAAO;CAEvC,OAAO,WAAW,cAAc,MAAM,WACpC,kBAAkB,IAAI,MAAM,CAC9B;AACF"}