@intlayer/config 9.0.0-canary.8 → 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 (305) 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 +1 -1
  4. package/dist/cjs/bundle/index.cjs.map +1 -1
  5. package/dist/cjs/bundle/logBundle.cjs.map +1 -1
  6. package/dist/cjs/callers/base.cjs +42 -0
  7. package/dist/cjs/callers/base.cjs.map +1 -0
  8. package/dist/cjs/callers/compat/i18next.cjs +27 -0
  9. package/dist/cjs/callers/compat/i18next.cjs.map +1 -0
  10. package/dist/cjs/callers/compat/lingui.cjs +82 -0
  11. package/dist/cjs/callers/compat/lingui.cjs.map +1 -0
  12. package/dist/cjs/callers/compat/nextIntl.cjs +44 -0
  13. package/dist/cjs/callers/compat/nextIntl.cjs.map +1 -0
  14. package/dist/cjs/callers/compat/reactI18next.cjs +50 -0
  15. package/dist/cjs/callers/compat/reactI18next.cjs.map +1 -0
  16. package/dist/cjs/callers/compat/reactIntl.cjs +31 -0
  17. package/dist/cjs/callers/compat/reactIntl.cjs.map +1 -0
  18. package/dist/cjs/callers/compat/useIntl.cjs +46 -0
  19. package/dist/cjs/callers/compat/useIntl.cjs.map +1 -0
  20. package/dist/cjs/callers/compat/vueI18n.cjs +26 -0
  21. package/dist/cjs/callers/compat/vueI18n.cjs.map +1 -0
  22. package/dist/cjs/callers/index.cjs +87 -0
  23. package/dist/cjs/callers/index.cjs.map +1 -0
  24. package/dist/cjs/callers/transform.cjs +46 -0
  25. package/dist/cjs/callers/transform.cjs.map +1 -0
  26. package/dist/cjs/callers/types.cjs +0 -0
  27. package/dist/cjs/client.cjs +1 -0
  28. package/dist/cjs/configFile/buildBrowserConfiguration.cjs +47 -3
  29. package/dist/cjs/configFile/buildBrowserConfiguration.cjs.map +1 -1
  30. package/dist/cjs/configFile/buildConfigurationFields.cjs +9 -3
  31. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  32. package/dist/cjs/configFile/configurationSchema.cjs +7 -0
  33. package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
  34. package/dist/cjs/configFile/getConfiguration.cjs +10 -3
  35. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  36. package/dist/cjs/configFile/index.cjs +2 -0
  37. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  38. package/dist/cjs/configFile/searchConfigurationFile.cjs +0 -1
  39. package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
  40. package/dist/cjs/defaultValues/analytics.cjs +16 -0
  41. package/dist/cjs/defaultValues/analytics.cjs.map +1 -0
  42. package/dist/cjs/defaultValues/build.cjs.map +1 -1
  43. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  44. package/dist/cjs/defaultValues/index.cjs +4 -0
  45. package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
  46. package/dist/cjs/defaultValues/routing.cjs.map +1 -1
  47. package/dist/cjs/envVars/envVars.cjs +2 -1
  48. package/dist/cjs/envVars/envVars.cjs.map +1 -1
  49. package/dist/cjs/loadEnvFile.cjs +44 -7
  50. package/dist/cjs/loadEnvFile.cjs.map +1 -1
  51. package/dist/cjs/loadExternalFile/bundleFile.cjs +4 -3
  52. package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -1
  53. package/dist/cjs/loadExternalFile/bundleJSFile.cjs +0 -1
  54. package/dist/cjs/loadExternalFile/bundleJSFile.cjs.map +1 -1
  55. package/dist/cjs/loadExternalFile/index.cjs +1 -0
  56. package/dist/cjs/loadExternalFile/loadExternalFile.cjs +11 -6
  57. package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
  58. package/dist/cjs/loadExternalFile/parseFileContent.cjs +52 -17
  59. package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
  60. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +99 -10
  61. package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
  62. package/dist/cjs/logger.cjs +2 -1
  63. package/dist/cjs/logger.cjs.map +1 -1
  64. package/dist/cjs/node.cjs +2 -0
  65. package/dist/cjs/utils/ESMxCJSHelpers.cjs +0 -1
  66. package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
  67. package/dist/cjs/utils/alias.cjs +0 -1
  68. package/dist/cjs/utils/alias.cjs.map +1 -1
  69. package/dist/cjs/utils/builtConfigKeys.cjs +38 -0
  70. package/dist/cjs/utils/builtConfigKeys.cjs.map +1 -0
  71. package/dist/cjs/utils/cacheDisk.cjs +2 -1
  72. package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
  73. package/dist/cjs/utils/cacheMemory.cjs +0 -1
  74. package/dist/cjs/utils/cacheMemory.cjs.map +1 -1
  75. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
  76. package/dist/cjs/utils/compareVersions.cjs.map +1 -1
  77. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
  78. package/dist/cjs/utils/getDictionarySelectorUsage.cjs.map +1 -1
  79. package/dist/cjs/utils/getExtension.cjs.map +1 -1
  80. package/dist/cjs/utils/getPackageJsonPath.cjs +0 -1
  81. package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
  82. package/dist/cjs/utils/getStorageAttributes.cjs +2 -1
  83. package/dist/cjs/utils/getStorageAttributes.cjs.map +1 -1
  84. package/dist/cjs/utils/getUsedNodeTypes.cjs +0 -1
  85. package/dist/cjs/utils/getUsedNodeTypes.cjs.map +1 -1
  86. package/dist/cjs/utils/index.cjs +2 -0
  87. package/dist/cjs/utils/logStack.cjs.map +1 -1
  88. package/dist/cjs/utils/normalizePath.cjs.map +1 -1
  89. package/dist/cjs/utils/parseFilePathPattern.cjs.map +1 -1
  90. package/dist/cjs/utils/pathSecurity.cjs +0 -1
  91. package/dist/cjs/utils/pathSecurity.cjs.map +1 -1
  92. package/dist/cjs/utils/retryManager.cjs.map +1 -1
  93. package/dist/cjs/utils/setIntlayerIdentifier.cjs.map +1 -1
  94. package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs.map +1 -1
  95. package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs.map +1 -1
  96. package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs.map +1 -1
  97. package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs.map +1 -1
  98. package/dist/esm/built.mjs +2 -1
  99. package/dist/esm/built.mjs.map +1 -1
  100. package/dist/esm/bundle/index.mjs +2 -2
  101. package/dist/esm/bundle/index.mjs.map +1 -1
  102. package/dist/esm/bundle/logBundle.mjs.map +1 -1
  103. package/dist/esm/callers/base.mjs +40 -0
  104. package/dist/esm/callers/base.mjs.map +1 -0
  105. package/dist/esm/callers/compat/i18next.mjs +25 -0
  106. package/dist/esm/callers/compat/i18next.mjs.map +1 -0
  107. package/dist/esm/callers/compat/lingui.mjs +80 -0
  108. package/dist/esm/callers/compat/lingui.mjs.map +1 -0
  109. package/dist/esm/callers/compat/nextIntl.mjs +42 -0
  110. package/dist/esm/callers/compat/nextIntl.mjs.map +1 -0
  111. package/dist/esm/callers/compat/reactI18next.mjs +48 -0
  112. package/dist/esm/callers/compat/reactI18next.mjs.map +1 -0
  113. package/dist/esm/callers/compat/reactIntl.mjs +29 -0
  114. package/dist/esm/callers/compat/reactIntl.mjs.map +1 -0
  115. package/dist/esm/callers/compat/useIntl.mjs +44 -0
  116. package/dist/esm/callers/compat/useIntl.mjs.map +1 -0
  117. package/dist/esm/callers/compat/vueI18n.mjs +24 -0
  118. package/dist/esm/callers/compat/vueI18n.mjs.map +1 -0
  119. package/dist/esm/callers/index.mjs +72 -0
  120. package/dist/esm/callers/index.mjs.map +1 -0
  121. package/dist/esm/callers/transform.mjs +43 -0
  122. package/dist/esm/callers/transform.mjs.map +1 -0
  123. package/dist/esm/callers/types.mjs +0 -0
  124. package/dist/esm/client.mjs +2 -2
  125. package/dist/esm/configFile/buildBrowserConfiguration.mjs +47 -4
  126. package/dist/esm/configFile/buildBrowserConfiguration.mjs.map +1 -1
  127. package/dist/esm/configFile/buildConfigurationFields.mjs +10 -4
  128. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  129. package/dist/esm/configFile/configurationSchema.mjs +7 -1
  130. package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
  131. package/dist/esm/configFile/getConfiguration.mjs +10 -2
  132. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  133. package/dist/esm/configFile/index.mjs +3 -3
  134. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  135. package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
  136. package/dist/esm/defaultValues/analytics.mjs +12 -0
  137. package/dist/esm/defaultValues/analytics.mjs.map +1 -0
  138. package/dist/esm/defaultValues/build.mjs.map +1 -1
  139. package/dist/esm/defaultValues/content.mjs.map +1 -1
  140. package/dist/esm/defaultValues/index.mjs +2 -1
  141. package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
  142. package/dist/esm/defaultValues/routing.mjs.map +1 -1
  143. package/dist/esm/envVars/envVars.mjs +2 -1
  144. package/dist/esm/envVars/envVars.mjs.map +1 -1
  145. package/dist/esm/loadEnvFile.mjs +45 -8
  146. package/dist/esm/loadEnvFile.mjs.map +1 -1
  147. package/dist/esm/loadExternalFile/bundleFile.mjs +4 -2
  148. package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -1
  149. package/dist/esm/loadExternalFile/bundleJSFile.mjs.map +1 -1
  150. package/dist/esm/loadExternalFile/index.mjs +2 -2
  151. package/dist/esm/loadExternalFile/loadExternalFile.mjs +11 -6
  152. package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
  153. package/dist/esm/loadExternalFile/parseFileContent.mjs +52 -17
  154. package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
  155. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +102 -13
  156. package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
  157. package/dist/esm/logger.mjs +2 -1
  158. package/dist/esm/logger.mjs.map +1 -1
  159. package/dist/esm/node.mjs +3 -3
  160. package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
  161. package/dist/esm/utils/alias.mjs.map +1 -1
  162. package/dist/esm/utils/builtConfigKeys.mjs +36 -0
  163. package/dist/esm/utils/builtConfigKeys.mjs.map +1 -0
  164. package/dist/esm/utils/cacheDisk.mjs +6 -5
  165. package/dist/esm/utils/cacheDisk.mjs.map +1 -1
  166. package/dist/esm/utils/cacheMemory.mjs.map +1 -1
  167. package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
  168. package/dist/esm/utils/compareVersions.mjs.map +1 -1
  169. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
  170. package/dist/esm/utils/getDictionarySelectorUsage.mjs.map +1 -1
  171. package/dist/esm/utils/getExtension.mjs.map +1 -1
  172. package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -1
  173. package/dist/esm/utils/getStorageAttributes.mjs +2 -1
  174. package/dist/esm/utils/getStorageAttributes.mjs.map +1 -1
  175. package/dist/esm/utils/getUsedNodeTypes.mjs.map +1 -1
  176. package/dist/esm/utils/index.mjs +2 -1
  177. package/dist/esm/utils/logStack.mjs.map +1 -1
  178. package/dist/esm/utils/normalizePath.mjs.map +1 -1
  179. package/dist/esm/utils/parseFilePathPattern.mjs.map +1 -1
  180. package/dist/esm/utils/pathSecurity.mjs.map +1 -1
  181. package/dist/esm/utils/retryManager.mjs.map +1 -1
  182. package/dist/esm/utils/setIntlayerIdentifier.mjs.map +1 -1
  183. package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs.map +1 -1
  184. package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs.map +1 -1
  185. package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs.map +1 -1
  186. package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs.map +1 -1
  187. package/dist/types/built.d.ts +2 -1
  188. package/dist/types/built.d.ts.map +1 -1
  189. package/dist/types/bundle/index.d.ts +2 -4
  190. package/dist/types/bundle/index.d.ts.map +1 -1
  191. package/dist/types/bundle/logBundle.d.ts +0 -1
  192. package/dist/types/bundle/logBundle.d.ts.map +1 -1
  193. package/dist/types/callers/base.d.ts +13 -0
  194. package/dist/types/callers/base.d.ts.map +1 -0
  195. package/dist/types/callers/compat/i18next.d.ts +11 -0
  196. package/dist/types/callers/compat/i18next.d.ts.map +1 -0
  197. package/dist/types/callers/compat/lingui.d.ts +6 -0
  198. package/dist/types/callers/compat/lingui.d.ts.map +1 -0
  199. package/dist/types/callers/compat/nextIntl.d.ts +12 -0
  200. package/dist/types/callers/compat/nextIntl.d.ts.map +1 -0
  201. package/dist/types/callers/compat/reactI18next.d.ts +14 -0
  202. package/dist/types/callers/compat/reactI18next.d.ts.map +1 -0
  203. package/dist/types/callers/compat/reactIntl.d.ts +15 -0
  204. package/dist/types/callers/compat/reactIntl.d.ts.map +1 -0
  205. package/dist/types/callers/compat/useIntl.d.ts +11 -0
  206. package/dist/types/callers/compat/useIntl.d.ts.map +1 -0
  207. package/dist/types/callers/compat/vueI18n.d.ts +11 -0
  208. package/dist/types/callers/compat/vueI18n.d.ts.map +1 -0
  209. package/dist/types/callers/index.d.ts +48 -0
  210. package/dist/types/callers/index.d.ts.map +1 -0
  211. package/dist/types/callers/transform.d.ts +60 -0
  212. package/dist/types/callers/transform.d.ts.map +1 -0
  213. package/dist/types/callers/types.d.ts +160 -0
  214. package/dist/types/callers/types.d.ts.map +1 -0
  215. package/dist/types/client.d.ts +2 -2
  216. package/dist/types/colors.d.ts +14 -14
  217. package/dist/types/colors.d.ts.map +1 -1
  218. package/dist/types/configFile/buildBrowserConfiguration.d.ts +24 -4
  219. package/dist/types/configFile/buildBrowserConfiguration.d.ts.map +1 -1
  220. package/dist/types/configFile/buildConfigurationFields.d.ts +8 -4
  221. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  222. package/dist/types/configFile/configurationSchema.d.ts +43 -34
  223. package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
  224. package/dist/types/configFile/getConfiguration.d.ts +0 -1
  225. package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
  226. package/dist/types/configFile/index.d.ts +3 -3
  227. package/dist/types/configFile/loadConfigurationFile.d.ts +1 -2
  228. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
  229. package/dist/types/configFile/searchConfigurationFile.d.ts +1 -1
  230. package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
  231. package/dist/types/defaultValues/analytics.d.ts +11 -0
  232. package/dist/types/defaultValues/analytics.d.ts.map +1 -0
  233. package/dist/types/defaultValues/build.d.ts.map +1 -1
  234. package/dist/types/defaultValues/compiler.d.ts.map +1 -1
  235. package/dist/types/defaultValues/content.d.ts.map +1 -1
  236. package/dist/types/defaultValues/dictionary.d.ts +0 -1
  237. package/dist/types/defaultValues/dictionary.d.ts.map +1 -1
  238. package/dist/types/defaultValues/editor.d.ts.map +1 -1
  239. package/dist/types/defaultValues/index.d.ts +2 -1
  240. package/dist/types/defaultValues/internationalization.d.ts +0 -1
  241. package/dist/types/defaultValues/internationalization.d.ts.map +1 -1
  242. package/dist/types/defaultValues/log.d.ts.map +1 -1
  243. package/dist/types/defaultValues/routing.d.ts +0 -1
  244. package/dist/types/defaultValues/routing.d.ts.map +1 -1
  245. package/dist/types/defaultValues/system.d.ts.map +1 -1
  246. package/dist/types/envVars/envVars.d.ts +0 -1
  247. package/dist/types/envVars/envVars.d.ts.map +1 -1
  248. package/dist/types/loadEnvFile.d.ts +1 -1
  249. package/dist/types/loadEnvFile.d.ts.map +1 -1
  250. package/dist/types/loadExternalFile/bundleFile.d.ts +0 -1
  251. package/dist/types/loadExternalFile/bundleFile.d.ts.map +1 -1
  252. package/dist/types/loadExternalFile/bundleJSFile.d.ts +57 -59
  253. package/dist/types/loadExternalFile/bundleJSFile.d.ts.map +1 -1
  254. package/dist/types/loadExternalFile/index.d.ts +2 -2
  255. package/dist/types/loadExternalFile/loadExternalFile.d.ts +0 -1
  256. package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -1
  257. package/dist/types/loadExternalFile/parseFileContent.d.ts +9 -1
  258. package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -1
  259. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +4 -4
  260. package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -1
  261. package/dist/types/logger.d.ts +2 -3
  262. package/dist/types/logger.d.ts.map +1 -1
  263. package/dist/types/node.d.ts +3 -3
  264. package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
  265. package/dist/types/utils/alias.d.ts +1 -6
  266. package/dist/types/utils/alias.d.ts.map +1 -1
  267. package/dist/types/utils/builtConfigKeys.d.ts +25 -0
  268. package/dist/types/utils/builtConfigKeys.d.ts.map +1 -0
  269. package/dist/types/utils/cacheDisk.d.ts +22 -11
  270. package/dist/types/utils/cacheDisk.d.ts.map +1 -1
  271. package/dist/types/utils/cacheMemory.d.ts +3 -3
  272. package/dist/types/utils/cacheMemory.d.ts.map +1 -1
  273. package/dist/types/utils/clearModuleCache.d.ts.map +1 -1
  274. package/dist/types/utils/compareVersions.d.ts +1 -1
  275. package/dist/types/utils/compareVersions.d.ts.map +1 -1
  276. package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
  277. package/dist/types/utils/getDictionarySelectorUsage.d.ts +0 -1
  278. package/dist/types/utils/getDictionarySelectorUsage.d.ts.map +1 -1
  279. package/dist/types/utils/getExtension.d.ts +1 -2
  280. package/dist/types/utils/getExtension.d.ts.map +1 -1
  281. package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -1
  282. package/dist/types/utils/getStorageAttributes.d.ts +0 -1
  283. package/dist/types/utils/getStorageAttributes.d.ts.map +1 -1
  284. package/dist/types/utils/getUsedNodeTypes.d.ts +0 -1
  285. package/dist/types/utils/getUsedNodeTypes.d.ts.map +1 -1
  286. package/dist/types/utils/index.d.ts +2 -1
  287. package/dist/types/utils/logStack.d.ts.map +1 -1
  288. package/dist/types/utils/normalizePath.d.ts.map +1 -1
  289. package/dist/types/utils/parseFilePathPattern.d.ts +0 -1
  290. package/dist/types/utils/parseFilePathPattern.d.ts.map +1 -1
  291. package/dist/types/utils/pathSecurity.d.ts.map +1 -1
  292. package/dist/types/utils/retryManager.d.ts +8 -9
  293. package/dist/types/utils/retryManager.d.ts.map +1 -1
  294. package/dist/types/utils/setIntlayerIdentifier.d.ts.map +1 -1
  295. package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +1 -1
  296. package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +1 -1
  297. package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +1 -1
  298. package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +1 -1
  299. package/package.json +11 -7
  300. package/dist/cjs/built.browser.cjs +0 -46
  301. package/dist/cjs/built.browser.cjs.map +0 -1
  302. package/dist/esm/built.browser.mjs +0 -32
  303. package/dist/esm/built.browser.mjs.map +0 -1
  304. package/dist/types/built.browser.d.ts +0 -27
  305. package/dist/types/built.browser.d.ts.map +0 -1
@@ -0,0 +1,80 @@
1
+ //#region src/callers/compat/lingui.ts
2
+ /**
3
+ * Lingui — `@intlayer/lingui` compat adapter.
4
+ *
5
+ * Lingui is a single-catalog library: every message lives in the `messages`
6
+ * dictionary and catalog keys are flat (a dotted id such as
7
+ * `results-table.bundleSize` is one literal key, not a nested path).
8
+ *
9
+ * `t` and `_` are generic names, so all lingui callers require an import from
10
+ * a lingui module to participate in matching — this avoids false positives on
11
+ * unrelated `t()` helpers.
12
+ *
13
+ * Mirrors `compat/lingui/src/plugin/index.ts`.
14
+ */
15
+ const LINGUI_IMPORT_SOURCES = [
16
+ "@lingui/core",
17
+ "@lingui/react",
18
+ "@lingui/macro",
19
+ "@lingui/core/macro",
20
+ "@lingui/react/macro",
21
+ "@intlayer/lingui"
22
+ ];
23
+ const LINGUI_CALLERS = [
24
+ {
25
+ callerName: "useLingui",
26
+ library: "lingui",
27
+ importSources: LINGUI_IMPORT_SOURCES,
28
+ namespaceSources: [{
29
+ from: "fixed",
30
+ value: "messages"
31
+ }],
32
+ translationFunction: "destructured-t",
33
+ staticReplacement: "useDictionary",
34
+ dynamicReplacement: "useDictionaryDynamic"
35
+ },
36
+ {
37
+ callerName: "_",
38
+ library: "lingui",
39
+ importSources: LINGUI_IMPORT_SOURCES,
40
+ requiresImport: true,
41
+ matchAsMethod: true,
42
+ namespaceSources: [{
43
+ from: "fixed",
44
+ value: "messages"
45
+ }],
46
+ translationFunction: "self",
47
+ flatKey: true
48
+ },
49
+ {
50
+ callerName: "t",
51
+ library: "lingui",
52
+ importSources: LINGUI_IMPORT_SOURCES,
53
+ requiresImport: true,
54
+ matchAsMethod: true,
55
+ matchAsTaggedTemplate: true,
56
+ namespaceSources: [{
57
+ from: "fixed",
58
+ value: "messages"
59
+ }],
60
+ translationFunction: "self",
61
+ flatKey: true
62
+ },
63
+ {
64
+ callerName: "Trans",
65
+ library: "lingui",
66
+ importSources: LINGUI_IMPORT_SOURCES,
67
+ requiresImport: true,
68
+ jsxIdAttribute: "id",
69
+ namespaceSources: [{
70
+ from: "fixed",
71
+ value: "messages"
72
+ }],
73
+ translationFunction: "self",
74
+ flatKey: true
75
+ }
76
+ ];
77
+
78
+ //#endregion
79
+ export { LINGUI_CALLERS };
80
+ //# sourceMappingURL=lingui.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lingui.mjs","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,42 @@
1
+ //#region src/callers/compat/nextIntl.ts
2
+ /**
3
+ * next-intl — `@intlayer/next-intl` compat adapter.
4
+ *
5
+ * Mirrors `compat/next-intl/src/plugin/index.ts` (`NEXT_INTL_SWC_CALLERS`),
6
+ * adding the `getTranslations({ locale, namespace })` object overload.
7
+ */
8
+ const NEXT_INTL_CALLERS = [{
9
+ callerName: "useTranslations",
10
+ library: "next-intl",
11
+ importSources: ["next-intl", "@intlayer/next-intl"],
12
+ namespaceSources: [{
13
+ from: "argument",
14
+ index: 0
15
+ }],
16
+ translationFunction: "return-value",
17
+ nestedNamespace: true,
18
+ allowRootScope: true,
19
+ staticReplacement: "useDictionary",
20
+ dynamicReplacement: "useDictionaryDynamic"
21
+ }, {
22
+ callerName: "getTranslations",
23
+ library: "next-intl",
24
+ importSources: ["next-intl/server", "@intlayer/next-intl/server"],
25
+ namespaceSources: [{
26
+ from: "argument",
27
+ index: 0
28
+ }, {
29
+ from: "option",
30
+ argumentIndex: 0,
31
+ property: "namespace"
32
+ }],
33
+ translationFunction: "return-value",
34
+ nestedNamespace: true,
35
+ allowRootScope: true,
36
+ staticReplacement: "getDictionary",
37
+ dynamicReplacement: "getDictionaryDynamic"
38
+ }];
39
+
40
+ //#endregion
41
+ export { NEXT_INTL_CALLERS };
42
+ //# sourceMappingURL=nextIntl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextIntl.mjs","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,48 @@
1
+ //#region src/callers/compat/reactI18next.ts
2
+ /**
3
+ * react-i18next / next-i18next — `@intlayer/react-i18next` and
4
+ * `@intlayer/next-i18next` compat adapters (next-i18next re-exports the
5
+ * react-i18next hook, so both libraries share the same callers).
6
+ *
7
+ * Mirrors `compat/react-i18next/src/plugin/index.ts` and
8
+ * `compat/next-i18next/src/plugin/index.ts`.
9
+ */
10
+ const REACT_I18NEXT_CALLERS = [{
11
+ callerName: "useTranslation",
12
+ library: "react-i18next",
13
+ importSources: [
14
+ "react-i18next",
15
+ "next-i18next",
16
+ "@intlayer/react-i18next",
17
+ "@intlayer/next-i18next"
18
+ ],
19
+ namespaceSources: [{
20
+ from: "argument",
21
+ index: 0
22
+ }],
23
+ keyPrefixSources: [{
24
+ from: "option",
25
+ argumentIndex: 1,
26
+ property: "keyPrefix"
27
+ }],
28
+ translationFunction: "destructured-t",
29
+ staticReplacement: "useDictionary",
30
+ dynamicReplacement: "useDictionaryDynamic"
31
+ }, {
32
+ callerName: "Trans",
33
+ library: "react-i18next",
34
+ importSources: [
35
+ "react-i18next",
36
+ "next-i18next",
37
+ "@intlayer/react-i18next",
38
+ "@intlayer/next-i18next"
39
+ ],
40
+ jsxIdAttribute: "i18nKey",
41
+ jsxNamespaceAttribute: "ns",
42
+ namespaceSources: [],
43
+ translationFunction: "self"
44
+ }];
45
+
46
+ //#endregion
47
+ export { REACT_I18NEXT_CALLERS };
48
+ //# sourceMappingURL=reactI18next.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactI18next.mjs","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,29 @@
1
+ //#region src/callers/compat/reactIntl.ts
2
+ /**
3
+ * react-intl (FormatJS) — `@intlayer/react-intl` compat adapter.
4
+ *
5
+ * The full dotted message id encodes both the dictionary key and the field
6
+ * path: `formatMessage({ id: 'home.title' })` → dictionary `home`, field
7
+ * `title`.
8
+ *
9
+ * Mirrors `compat/react-intl/src/plugin/index.ts`.
10
+ */
11
+ const REACT_INTL_CALLERS = [{
12
+ callerName: "formatMessage",
13
+ library: "react-intl",
14
+ importSources: ["react-intl", "@intlayer/react-intl"],
15
+ matchAsMethod: true,
16
+ namespaceSources: [{ from: "path-first-segment" }],
17
+ translationFunction: "self"
18
+ }, {
19
+ callerName: "FormattedMessage",
20
+ library: "react-intl",
21
+ importSources: ["react-intl", "@intlayer/react-intl"],
22
+ jsxIdAttribute: "id",
23
+ namespaceSources: [{ from: "path-first-segment" }],
24
+ translationFunction: "self"
25
+ }];
26
+
27
+ //#endregion
28
+ export { REACT_INTL_CALLERS };
29
+ //# sourceMappingURL=reactIntl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactIntl.mjs","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,44 @@
1
+ //#region src/callers/compat/useIntl.ts
2
+ /**
3
+ * use-intl — `@intlayer/use-intl` compat adapter.
4
+ *
5
+ * Mirrors `compat/use-intl/src/plugin/index.ts`.
6
+ */
7
+ const USE_INTL_CALLERS = [{
8
+ callerName: "useTranslations",
9
+ library: "use-intl",
10
+ importSources: [
11
+ "use-intl",
12
+ "use-intl/react",
13
+ "@intlayer/use-intl"
14
+ ],
15
+ namespaceSources: [{
16
+ from: "argument",
17
+ index: 0
18
+ }],
19
+ translationFunction: "return-value",
20
+ nestedNamespace: true,
21
+ allowRootScope: true,
22
+ staticReplacement: "useDictionary",
23
+ dynamicReplacement: "useDictionaryDynamic"
24
+ }, {
25
+ callerName: "createTranslator",
26
+ library: "use-intl",
27
+ importSources: [
28
+ "use-intl",
29
+ "use-intl/core",
30
+ "@intlayer/use-intl"
31
+ ],
32
+ namespaceSources: [{
33
+ from: "option",
34
+ argumentIndex: 0,
35
+ property: "namespace"
36
+ }],
37
+ translationFunction: "return-value",
38
+ nestedNamespace: true,
39
+ allowRootScope: true
40
+ }];
41
+
42
+ //#endregion
43
+ export { USE_INTL_CALLERS };
44
+ //# sourceMappingURL=useIntl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntl.mjs","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,24 @@
1
+ //#region src/callers/compat/vueI18n.ts
2
+ /**
3
+ * vue-i18n — `@intlayer/vue-i18n` compat adapter.
4
+ *
5
+ * Mirrors `compat/vue-i18n/src/plugin/index.ts`.
6
+ */
7
+ const VUE_I18N_CALLERS = [{
8
+ callerName: "useI18n",
9
+ library: "vue-i18n",
10
+ importSources: ["vue-i18n", "@intlayer/vue-i18n"],
11
+ namespaceSources: [{
12
+ from: "option",
13
+ argumentIndex: 0,
14
+ property: "namespace"
15
+ }],
16
+ translationFunction: "destructured-t",
17
+ allowRootScope: true,
18
+ staticReplacement: "useDictionary",
19
+ dynamicReplacement: "useDictionaryDynamic"
20
+ }];
21
+
22
+ //#endregion
23
+ export { VUE_I18N_CALLERS };
24
+ //# sourceMappingURL=vueI18n.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vueI18n.mjs","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,72 @@
1
+ import { BASE_CALLERS } from "./base.mjs";
2
+ import { getRewritableCallers, toSwcExtraCallers } from "./transform.mjs";
3
+ import { I18NEXT_CALLERS } from "./compat/i18next.mjs";
4
+ import { LINGUI_CALLERS } from "./compat/lingui.mjs";
5
+ import { NEXT_INTL_CALLERS } from "./compat/nextIntl.mjs";
6
+ import { REACT_I18NEXT_CALLERS } from "./compat/reactI18next.mjs";
7
+ import { REACT_INTL_CALLERS } from "./compat/reactIntl.mjs";
8
+ import { USE_INTL_CALLERS } from "./compat/useIntl.mjs";
9
+ import { VUE_I18N_CALLERS } from "./compat/vueI18n.mjs";
10
+
11
+ //#region src/callers/index.ts
12
+ /**
13
+ * Compat-adapter callers, grouped in one list. Each compat package's bundler
14
+ * plugin injects its own slice (e.g. `REACT_I18NEXT_CALLERS`) into the build
15
+ * pipeline; this aggregate exists for consumers that need every syntax at
16
+ * once, such as the LSP.
17
+ */
18
+ const COMPAT_CALLERS = [
19
+ ...I18NEXT_CALLERS,
20
+ ...REACT_I18NEXT_CALLERS,
21
+ ...NEXT_INTL_CALLERS,
22
+ ...USE_INTL_CALLERS,
23
+ ...REACT_INTL_CALLERS,
24
+ ...LINGUI_CALLERS,
25
+ ...VUE_I18N_CALLERS
26
+ ];
27
+ /** Base + compat callers — the full registry the matchers run against. */
28
+ const ALL_CALLERS = [...BASE_CALLERS, ...COMPAT_CALLERS];
29
+ /**
30
+ * Descriptors indexed by caller name. A name can map to several descriptors
31
+ * (e.g. `Trans` exists in both react-i18next and lingui with different
32
+ * attributes); matchers try them in registry order.
33
+ */
34
+ const CALLERS_BY_NAME = (() => {
35
+ const byName = /* @__PURE__ */ new Map();
36
+ for (const descriptor of ALL_CALLERS) {
37
+ const existing = byName.get(descriptor.callerName);
38
+ if (existing) existing.push(descriptor);
39
+ else byName.set(descriptor.callerName, [descriptor]);
40
+ }
41
+ return byName;
42
+ })();
43
+ /**
44
+ * Caller names whose dictionary key can appear as a positional string literal
45
+ * argument (`caller('key', …)` / `caller(locale, 'key', …)`). Used to build
46
+ * text-search regexes over project source files (find-references) and the
47
+ * completion trigger pattern. Callers whose key never appears positionally
48
+ * (fixed namespace, options object, JSX-only) are excluded on purpose.
49
+ */
50
+ const getPositionalKeyCallerNames = () => {
51
+ const names = /* @__PURE__ */ new Set();
52
+ for (const descriptor of ALL_CALLERS) if (descriptor.namespaceSources.some((source) => source.from === "argument")) names.add(descriptor.callerName);
53
+ return [...names];
54
+ };
55
+ /**
56
+ * Returns `true` when the descriptor may participate in matching for a file
57
+ * importing from `importSources`. Descriptors flagged `requiresImport` only
58
+ * activate when the file imports from one of their declared modules;
59
+ * everything else is always active (results are still validated against the
60
+ * project's dictionaries downstream).
61
+ *
62
+ * @param descriptor - The caller descriptor to gate.
63
+ * @param fileImportSources - Module specifiers imported by the analysed file.
64
+ */
65
+ const isCallerActive = (descriptor, fileImportSources) => {
66
+ if (!descriptor.requiresImport) return true;
67
+ return descriptor.importSources.some((source) => fileImportSources.has(source));
68
+ };
69
+
70
+ //#endregion
71
+ export { ALL_CALLERS, BASE_CALLERS, CALLERS_BY_NAME, COMPAT_CALLERS, I18NEXT_CALLERS, LINGUI_CALLERS, NEXT_INTL_CALLERS, REACT_I18NEXT_CALLERS, REACT_INTL_CALLERS, USE_INTL_CALLERS, VUE_I18N_CALLERS, getPositionalKeyCallerNames, getRewritableCallers, isCallerActive, toSwcExtraCallers };
72
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"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,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;;AAGA,MAAa,cAAkC,CAC7C,GAAG,cACH,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"}
@@ -0,0 +1,43 @@
1
+ //#region src/callers/transform.ts
2
+ /**
3
+ * Returns the callers of a registry slice that the optimize pass can rewrite
4
+ * at build time: plain imported functions carrying both replacement names.
5
+ *
6
+ * Method-matched callers (`i18n.getFixedT`) and JSX components are excluded —
7
+ * their call sites cannot be re-pointed through an import specifier rename.
8
+ */
9
+ const getRewritableCallers = (descriptors) => descriptors.filter((descriptor) => descriptor.staticReplacement !== void 0 && descriptor.dynamicReplacement !== void 0 && descriptor.matchAsMethod !== true && descriptor.jsxIdAttribute === void 0);
10
+ const findSource = (sources, from) => sources.find((source) => source.from === from);
11
+ /**
12
+ * Serialises the rewritable callers of a registry slice into the
13
+ * `@intlayer/swc` plugin wire format (`extraCallers` option).
14
+ *
15
+ * Callers whose namespace can only be derived per-message id
16
+ * (`path-first-segment`) are skipped: the transform cannot bind a single
17
+ * dictionary to the call site.
18
+ *
19
+ * @param descriptors - Registry slice, e.g. `REACT_I18NEXT_CALLERS`.
20
+ * @returns Configs ready to pass as `swcExtraCallers` / `extraCallers`.
21
+ */
22
+ const toSwcExtraCallers = (descriptors) => getRewritableCallers(descriptors).flatMap((descriptor) => {
23
+ const argumentSource = findSource(descriptor.namespaceSources, "argument");
24
+ const optionSource = findSource(descriptor.namespaceSources, "option");
25
+ const fixedSource = findSource(descriptor.namespaceSources, "fixed");
26
+ if (!argumentSource && !optionSource && !fixedSource) return [];
27
+ return [{
28
+ callerName: descriptor.callerName,
29
+ importSources: descriptor.importSources,
30
+ ...argumentSource ? { namespaceArgIndex: argumentSource.index } : {},
31
+ ...fixedSource ? { fixedNamespace: fixedSource.value } : {},
32
+ ...optionSource ? { namespaceOption: {
33
+ argumentIndex: optionSource.argumentIndex,
34
+ property: optionSource.property
35
+ } } : {},
36
+ staticReplacement: descriptor.staticReplacement,
37
+ dynamicReplacement: descriptor.dynamicReplacement
38
+ }];
39
+ });
40
+
41
+ //#endregion
42
+ export { getRewritableCallers, toSwcExtraCallers };
43
+ //# sourceMappingURL=transform.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.mjs","names":[],"sources":["../../../src/callers/transform.ts"],"sourcesContent":["import type { CallerDescriptor, CallerValueSource } from './types';\n\n/**\n * Wire format of an extra caller forwarded to the `@intlayer/swc` plugin.\n *\n * Field names mirror the serde attributes of `ExtraCallerConfig` in\n * `packages/@intlayer/swc/src/lib.rs` — both sides must stay in sync.\n */\nexport type SwcExtraCallerConfig = {\n /** The function name the user calls, e.g. `\"useTranslation\"`. */\n callerName: string;\n /** Module specifiers exporting the function (original + `@intlayer/*`). */\n importSources: string[];\n /**\n * Zero-based index of the positional argument holding the namespace string.\n * Omitted for fixed/option namespace callers.\n */\n namespaceArgIndex?: number;\n /**\n * Compile-time constant namespace — the dictionary ident is inserted as a\n * new first argument (lingui's `useLingui()`).\n */\n fixedNamespace?: string;\n /**\n * Namespace read from a property of an options-object argument — the\n * dictionary ident is inserted as a new first argument and the property is\n * rewritten to the key-prefix remainder (vue-i18n's `useI18n({ namespace })`).\n */\n namespaceOption?: { argumentIndex: number; property: string };\n /** Replacement function name for static import mode, e.g. `\"useDictionary\"`. */\n staticReplacement: string;\n /** Replacement function name for dynamic/fetch mode, e.g. `\"useDictionaryDynamic\"`. */\n dynamicReplacement: string;\n};\n\n/**\n * Returns the callers of a registry slice that the optimize pass can rewrite\n * at build time: plain imported functions carrying both replacement names.\n *\n * Method-matched callers (`i18n.getFixedT`) and JSX components are excluded —\n * their call sites cannot be re-pointed through an import specifier rename.\n */\nexport const getRewritableCallers = (\n descriptors: CallerDescriptor[]\n): CallerDescriptor[] =>\n descriptors.filter(\n (descriptor) =>\n descriptor.staticReplacement !== undefined &&\n descriptor.dynamicReplacement !== undefined &&\n descriptor.matchAsMethod !== true &&\n descriptor.jsxIdAttribute === undefined\n );\n\nconst findSource = <F extends CallerValueSource['from']>(\n sources: CallerValueSource[],\n from: F\n): Extract<CallerValueSource, { from: F }> | undefined =>\n sources.find(\n (source): source is Extract<CallerValueSource, { from: F }> =>\n source.from === from\n );\n\n/**\n * Serialises the rewritable callers of a registry slice into the\n * `@intlayer/swc` plugin wire format (`extraCallers` option).\n *\n * Callers whose namespace can only be derived per-message id\n * (`path-first-segment`) are skipped: the transform cannot bind a single\n * dictionary to the call site.\n *\n * @param descriptors - Registry slice, e.g. `REACT_I18NEXT_CALLERS`.\n * @returns Configs ready to pass as `swcExtraCallers` / `extraCallers`.\n */\nexport const toSwcExtraCallers = (\n descriptors: CallerDescriptor[]\n): SwcExtraCallerConfig[] =>\n getRewritableCallers(descriptors).flatMap((descriptor) => {\n const argumentSource = findSource(descriptor.namespaceSources, 'argument');\n const optionSource = findSource(descriptor.namespaceSources, 'option');\n const fixedSource = findSource(descriptor.namespaceSources, 'fixed');\n\n if (!argumentSource && !optionSource && !fixedSource) return [];\n\n return [\n {\n callerName: descriptor.callerName,\n importSources: descriptor.importSources,\n ...(argumentSource ? { namespaceArgIndex: argumentSource.index } : {}),\n ...(fixedSource ? { fixedNamespace: fixedSource.value } : {}),\n ...(optionSource\n ? {\n namespaceOption: {\n argumentIndex: optionSource.argumentIndex,\n property: optionSource.property,\n },\n }\n : {}),\n staticReplacement: descriptor.staticReplacement!,\n dynamicReplacement: descriptor.dynamicReplacement!,\n },\n ];\n });\n"],"mappings":";;;;;;;;AA0CA,MAAa,wBACX,gBAEA,YAAY,QACT,eACC,WAAW,sBAAsB,UACjC,WAAW,uBAAuB,UAClC,WAAW,kBAAkB,QAC7B,WAAW,mBAAmB,MAClC;AAEF,MAAM,cACJ,SACA,SAEA,QAAQ,MACL,WACC,OAAO,SAAS,IACpB;;;;;;;;;;;;AAaF,MAAa,qBACX,gBAEA,qBAAqB,WAAW,CAAC,CAAC,SAAS,eAAe;CACxD,MAAM,iBAAiB,WAAW,WAAW,kBAAkB,UAAU;CACzE,MAAM,eAAe,WAAW,WAAW,kBAAkB,QAAQ;CACrE,MAAM,cAAc,WAAW,WAAW,kBAAkB,OAAO;CAEnE,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,aAAa,OAAO,CAAC;CAE9D,OAAO,CACL;EACE,YAAY,WAAW;EACvB,eAAe,WAAW;EAC1B,GAAI,iBAAiB,EAAE,mBAAmB,eAAe,MAAM,IAAI,CAAC;EACpE,GAAI,cAAc,EAAE,gBAAgB,YAAY,MAAM,IAAI,CAAC;EAC3D,GAAI,eACA,EACE,iBAAiB;GACf,eAAe,aAAa;GAC5B,UAAU,aAAa;EACzB,EACF,IACA,CAAC;EACL,mBAAmB,WAAW;EAC9B,oBAAoB,WAAW;CACjC,CACF;AACF,CAAC"}
File without changes
@@ -6,6 +6,6 @@ import { camelCaseToKebabCase } from "./utils/stringFormatter/camelCaseToKebabCa
6
6
  import { camelCaseToSentence } from "./utils/stringFormatter/camelCaseToSentence.mjs";
7
7
  import { kebabCaseToCamelCase } from "./utils/stringFormatter/kebabCaseToCamelCase.mjs";
8
8
  import { toLowerCamelCase } from "./utils/stringFormatter/toLowerCamelCase.mjs";
9
- import { buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration } from "./configFile/buildBrowserConfiguration.mjs";
9
+ import { buildAnalyticsFields, buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration } from "./configFile/buildBrowserConfiguration.mjs";
10
10
 
11
- export { buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, camelCaseToKebabCase, camelCaseToSentence, extractBrowserConfiguration, extractErrorMessage, kebabCaseToCamelCase, logStack, normalizePath, setIntlayerIdentifier, toLowerCamelCase };
11
+ export { buildAnalyticsFields, buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, camelCaseToKebabCase, camelCaseToSentence, extractBrowserConfiguration, extractErrorMessage, kebabCaseToCamelCase, logStack, normalizePath, setIntlayerIdentifier, toLowerCamelCase };
@@ -1,5 +1,6 @@
1
1
  import { BASE_PATH, ENABLE_PROXY, ROUTING_MODE, STORAGE } from "../defaultValues/routing.mjs";
2
2
  import { getStorageAttributes } from "../utils/getStorageAttributes.mjs";
3
+ import { ANALYTICS_ENABLED, ANALYTICS_FLUSH_INTERVAL, ANALYTICS_SAMPLE_RATE } from "../defaultValues/analytics.mjs";
3
4
  import { APPLICATION_URL, BACKEND_URL, CMS_URL, DICTIONARY_PRIORITY_STRATEGY, EDITOR_URL, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, PORT } from "../defaultValues/editor.mjs";
4
5
  import { DEFAULT_LOCALE, LOCALES, REQUIRED_LOCALES, STRICT_MODE } from "../defaultValues/internationalization.mjs";
5
6
  import { MODE, PREFIX } from "../defaultValues/log.mjs";
@@ -152,10 +153,19 @@ const buildRoutingFields = (customConfiguration) => {
152
153
  * (`clientId`, `clientSecret`). The browser-safe {@link BrowserIntlayerConfig}
153
154
  * omits those fields when exposing config to the client.
154
155
  *
156
+ * When the user does not explicitly set `clientId` / `clientSecret` in the
157
+ * configuration file, they fall back to the `INTLAYER_CLIENT_ID` /
158
+ * `INTLAYER_CLIENT_SECRET` environment variables read from `env`. This lets
159
+ * users authenticate purely through their `.env` file (including files passed
160
+ * via the CLI `--env-file` flag) without having to wire `process.env` into the
161
+ * configuration manually.
162
+ *
155
163
  * @param customConfiguration - Partial user-supplied editor config.
164
+ * @param env - Environment variables used to resolve credential fallbacks.
165
+ * Defaults to `process.env`.
156
166
  * @returns A fully-defaulted {@link EditorConfig}.
157
167
  */
158
- const buildEditorFields = (customConfiguration) => {
168
+ const buildEditorFields = (customConfiguration, env = process.env) => {
159
169
  const liveSyncPort = customConfiguration?.liveSyncPort ?? 4e3;
160
170
  return {
161
171
  /**
@@ -219,7 +229,7 @@ const buildEditorFields = (customConfiguration) => {
219
229
  *
220
230
  * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.
221
231
  */
222
- clientId: customConfiguration?.clientId ?? void 0,
232
+ clientId: customConfiguration?.clientId ?? env.INTLAYER_CLIENT_ID,
223
233
  /**
224
234
  * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
225
235
  * An access token is use to authenticate the user related to the project.
@@ -229,7 +239,7 @@ const buildEditorFields = (customConfiguration) => {
229
239
  *
230
240
  * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.
231
241
  */
232
- clientSecret: customConfiguration?.clientSecret ?? void 0,
242
+ clientSecret: customConfiguration?.clientSecret ?? env.INTLAYER_CLIENT_SECRET,
233
243
  /**
234
244
  * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.
235
245
  * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.
@@ -265,6 +275,36 @@ const buildEditorFields = (customConfiguration) => {
265
275
  };
266
276
  };
267
277
  /**
278
+ * Build the analytics section of the Intlayer configuration.
279
+ *
280
+ * Analytics is strictly opt-in: `enabled` defaults to `false` and, even when
281
+ * enabled, the runtime additionally requires a project key (`editor.clientId`)
282
+ * for attribution before collecting anything.
283
+ *
284
+ * @param customConfiguration - Partial user-supplied analytics config.
285
+ * @returns A fully-defaulted {@link AnalyticsConfig}.
286
+ */
287
+ const buildAnalyticsFields = (customConfiguration) => ({
288
+ /**
289
+ * Enables analytics collection (page views, content exposures, A/B events).
290
+ *
291
+ * Default: false
292
+ */
293
+ enabled: customConfiguration?.enabled ?? false,
294
+ /**
295
+ * Milliseconds between automatic batched flushes to the backend.
296
+ *
297
+ * Default: 20000
298
+ */
299
+ flushInterval: customConfiguration?.flushInterval ?? 2e4,
300
+ /**
301
+ * Fraction of sessions to record, from 0 (none) to 1 (all).
302
+ *
303
+ * Default: 1
304
+ */
305
+ sampleRate: customConfiguration?.sampleRate ?? 1
306
+ });
307
+ /**
268
308
  * Build the log section of the Intlayer configuration.
269
309
  *
270
310
  * @param customConfiguration - Partial user-supplied log config.
@@ -324,6 +364,7 @@ const buildBrowserConfiguration = (customConfig) => {
324
364
  const { locales, defaultLocale } = buildInternationalizationFields(customConfig?.internationalization);
325
365
  const routing = buildRoutingFields(customConfig?.routing);
326
366
  const { clientId: _clientId, clientSecret: _clientSecret, ...editorPublic } = buildEditorFields(customConfig?.editor);
367
+ const analytics = buildAnalyticsFields(customConfig?.analytics);
327
368
  const { mode, prefix } = buildLogFields(customConfig?.log);
328
369
  return {
329
370
  internationalization: {
@@ -332,6 +373,7 @@ const buildBrowserConfiguration = (customConfig) => {
332
373
  },
333
374
  routing,
334
375
  editor: editorPublic,
376
+ analytics,
335
377
  log: {
336
378
  mode,
337
379
  prefix
@@ -373,6 +415,7 @@ const extractBrowserConfiguration = (config) => ({
373
415
  liveSyncPort: config.editor.liveSyncPort,
374
416
  liveSyncURL: config.editor.liveSyncURL
375
417
  },
418
+ analytics: buildAnalyticsFields(config.analytics),
376
419
  log: {
377
420
  mode: config.log.mode,
378
421
  prefix: config.log.prefix
@@ -380,5 +423,5 @@ const extractBrowserConfiguration = (config) => ({
380
423
  });
381
424
 
382
425
  //#endregion
383
- export { buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration };
426
+ export { buildAnalyticsFields, buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration };
384
427
  //# sourceMappingURL=buildBrowserConfiguration.mjs.map