@sebbro/paraglide-lite 0.1.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 (715) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/bin/run.js +4 -0
  4. package/dist/bundler-plugins/esbuild.d.ts +1 -0
  5. package/dist/bundler-plugins/esbuild.d.ts.map +1 -0
  6. package/dist/bundler-plugins/esbuild.js +4 -0
  7. package/dist/bundler-plugins/esbuild.js.map +1 -0
  8. package/dist/bundler-plugins/index.d.ts +6 -0
  9. package/dist/bundler-plugins/index.d.ts.map +1 -0
  10. package/dist/bundler-plugins/index.js +7 -0
  11. package/dist/bundler-plugins/index.js.map +1 -0
  12. package/dist/bundler-plugins/lazy-modules/scan-message-keys.d.ts +19 -0
  13. package/dist/bundler-plugins/lazy-modules/scan-message-keys.d.ts.map +1 -0
  14. package/dist/bundler-plugins/lazy-modules/scan-message-keys.js +85 -0
  15. package/dist/bundler-plugins/lazy-modules/scan-message-keys.js.map +1 -0
  16. package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.d.ts +2 -0
  17. package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.d.ts.map +1 -0
  18. package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.js +53 -0
  19. package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.js.map +1 -0
  20. package/dist/bundler-plugins/lazy-modules/ssr.d.ts +31 -0
  21. package/dist/bundler-plugins/lazy-modules/ssr.d.ts.map +1 -0
  22. package/dist/bundler-plugins/lazy-modules/ssr.js +42 -0
  23. package/dist/bundler-plugins/lazy-modules/ssr.js.map +1 -0
  24. package/dist/bundler-plugins/lazy-modules/ssr.test.d.ts +2 -0
  25. package/dist/bundler-plugins/lazy-modules/ssr.test.d.ts.map +1 -0
  26. package/dist/bundler-plugins/lazy-modules/ssr.test.js +48 -0
  27. package/dist/bundler-plugins/lazy-modules/ssr.test.js.map +1 -0
  28. package/dist/bundler-plugins/lazy-modules/virtual-ids.d.ts +7 -0
  29. package/dist/bundler-plugins/lazy-modules/virtual-ids.d.ts.map +1 -0
  30. package/dist/bundler-plugins/lazy-modules/virtual-ids.js +30 -0
  31. package/dist/bundler-plugins/lazy-modules/virtual-ids.js.map +1 -0
  32. package/dist/bundler-plugins/lazy-modules/virtual.d.ts +86 -0
  33. package/dist/bundler-plugins/lazy-modules/virtual.d.ts.map +1 -0
  34. package/dist/bundler-plugins/lazy-modules/virtual.js +2 -0
  35. package/dist/bundler-plugins/lazy-modules/virtual.js.map +1 -0
  36. package/dist/bundler-plugins/lazy-modules/vite-plugin.d.ts +18 -0
  37. package/dist/bundler-plugins/lazy-modules/vite-plugin.d.ts.map +1 -0
  38. package/dist/bundler-plugins/lazy-modules/vite-plugin.js +328 -0
  39. package/dist/bundler-plugins/lazy-modules/vite-plugin.js.map +1 -0
  40. package/dist/bundler-plugins/lazy-modules/vite-plugin.test.d.ts +2 -0
  41. package/dist/bundler-plugins/lazy-modules/vite-plugin.test.d.ts.map +1 -0
  42. package/dist/bundler-plugins/lazy-modules/vite-plugin.test.js +45 -0
  43. package/dist/bundler-plugins/lazy-modules/vite-plugin.test.js.map +1 -0
  44. package/dist/bundler-plugins/per-locale-build/constants.d.ts +2 -0
  45. package/dist/bundler-plugins/per-locale-build/constants.d.ts.map +1 -0
  46. package/dist/bundler-plugins/per-locale-build/constants.js +3 -0
  47. package/dist/bundler-plugins/per-locale-build/constants.js.map +1 -0
  48. package/dist/bundler-plugins/per-locale-build/index.d.ts +6 -0
  49. package/dist/bundler-plugins/per-locale-build/index.d.ts.map +1 -0
  50. package/dist/bundler-plugins/per-locale-build/index.js +43 -0
  51. package/dist/bundler-plugins/per-locale-build/index.js.map +1 -0
  52. package/dist/bundler-plugins/per-locale-build/locale-id.d.ts +8 -0
  53. package/dist/bundler-plugins/per-locale-build/locale-id.d.ts.map +1 -0
  54. package/dist/bundler-plugins/per-locale-build/locale-id.js +13 -0
  55. package/dist/bundler-plugins/per-locale-build/locale-id.js.map +1 -0
  56. package/dist/bundler-plugins/per-locale-build/types.d.ts +4 -0
  57. package/dist/bundler-plugins/per-locale-build/types.d.ts.map +1 -0
  58. package/dist/bundler-plugins/per-locale-build/types.js +2 -0
  59. package/dist/bundler-plugins/per-locale-build/types.js.map +1 -0
  60. package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts +51 -0
  61. package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts.map +1 -0
  62. package/dist/bundler-plugins/per-locale-build/vite-environments.js +250 -0
  63. package/dist/bundler-plugins/per-locale-build/vite-environments.js.map +1 -0
  64. package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts +1 -0
  65. package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts.map +1 -0
  66. package/dist/bundler-plugins/per-locale-build/vite-environments.test.js +250 -0
  67. package/dist/bundler-plugins/per-locale-build/vite-environments.test.js.map +1 -0
  68. package/dist/bundler-plugins/plugin-core.d.ts +74 -0
  69. package/dist/bundler-plugins/plugin-core.d.ts.map +1 -0
  70. package/dist/bundler-plugins/plugin-core.js +292 -0
  71. package/dist/bundler-plugins/plugin-core.js.map +1 -0
  72. package/dist/bundler-plugins/rolldown.d.ts +10 -0
  73. package/dist/bundler-plugins/rolldown.d.ts.map +1 -0
  74. package/dist/bundler-plugins/rolldown.js +36 -0
  75. package/dist/bundler-plugins/rolldown.js.map +1 -0
  76. package/dist/bundler-plugins/rolldown.test.d.ts +1 -0
  77. package/dist/bundler-plugins/rolldown.test.d.ts.map +1 -0
  78. package/dist/bundler-plugins/rolldown.test.js +72 -0
  79. package/dist/bundler-plugins/rolldown.test.js.map +1 -0
  80. package/dist/bundler-plugins/rollup.d.ts +1 -0
  81. package/dist/bundler-plugins/rollup.d.ts.map +1 -0
  82. package/dist/bundler-plugins/rollup.js +4 -0
  83. package/dist/bundler-plugins/rollup.js.map +1 -0
  84. package/dist/bundler-plugins/rspack.d.ts +1 -0
  85. package/dist/bundler-plugins/rspack.d.ts.map +1 -0
  86. package/dist/bundler-plugins/rspack.js +4 -0
  87. package/dist/bundler-plugins/rspack.js.map +1 -0
  88. package/dist/bundler-plugins/unplugin.d.ts +3 -0
  89. package/dist/bundler-plugins/unplugin.d.ts.map +1 -0
  90. package/dist/bundler-plugins/unplugin.js +62 -0
  91. package/dist/bundler-plugins/unplugin.js.map +1 -0
  92. package/dist/bundler-plugins/unplugin.test.d.ts +1 -0
  93. package/dist/bundler-plugins/unplugin.test.d.ts.map +1 -0
  94. package/dist/bundler-plugins/unplugin.test.js +256 -0
  95. package/dist/bundler-plugins/unplugin.test.js.map +1 -0
  96. package/dist/bundler-plugins/virtual-modules.test.d.ts +1 -0
  97. package/dist/bundler-plugins/virtual-modules.test.d.ts.map +1 -0
  98. package/dist/bundler-plugins/virtual-modules.test.js +77 -0
  99. package/dist/bundler-plugins/virtual-modules.test.js.map +1 -0
  100. package/dist/bundler-plugins/vite.d.ts +17 -0
  101. package/dist/bundler-plugins/vite.d.ts.map +1 -0
  102. package/dist/bundler-plugins/vite.js +15 -0
  103. package/dist/bundler-plugins/vite.js.map +1 -0
  104. package/dist/bundler-plugins/vite.test.d.ts +1 -0
  105. package/dist/bundler-plugins/vite.test.d.ts.map +1 -0
  106. package/dist/bundler-plugins/vite.test.js +61 -0
  107. package/dist/bundler-plugins/vite.test.js.map +1 -0
  108. package/dist/bundler-plugins/webpack.d.ts +1 -0
  109. package/dist/bundler-plugins/webpack.d.ts.map +1 -0
  110. package/dist/bundler-plugins/webpack.js +4 -0
  111. package/dist/bundler-plugins/webpack.js.map +1 -0
  112. package/dist/cli/commands/compile/command.d.ts +2 -0
  113. package/dist/cli/commands/compile/command.d.ts.map +1 -0
  114. package/dist/cli/commands/compile/command.js +225 -0
  115. package/dist/cli/commands/compile/command.js.map +1 -0
  116. package/dist/cli/commands/compile/command.test.d.ts +1 -0
  117. package/dist/cli/commands/compile/command.test.d.ts.map +1 -0
  118. package/dist/cli/commands/compile/command.test.js +69 -0
  119. package/dist/cli/commands/compile/command.test.js.map +1 -0
  120. package/dist/cli/commands/init/command.d.ts +2 -0
  121. package/dist/cli/commands/init/command.d.ts.map +1 -0
  122. package/dist/cli/commands/init/command.js +90 -0
  123. package/dist/cli/commands/init/command.js.map +1 -0
  124. package/dist/cli/defaults.d.ts +11 -0
  125. package/dist/cli/defaults.d.ts.map +1 -0
  126. package/dist/cli/defaults.js +13 -0
  127. package/dist/cli/defaults.js.map +1 -0
  128. package/dist/cli/index.d.ts +2 -0
  129. package/dist/cli/index.d.ts.map +1 -0
  130. package/dist/cli/index.js +11 -0
  131. package/dist/cli/index.js.map +1 -0
  132. package/dist/cli/steps/add-vite-plugin.d.ts +31 -0
  133. package/dist/cli/steps/add-vite-plugin.d.ts.map +1 -0
  134. package/dist/cli/steps/add-vite-plugin.js +65 -0
  135. package/dist/cli/steps/add-vite-plugin.js.map +1 -0
  136. package/dist/cli/steps/add-vite-plugin.test.d.ts +1 -0
  137. package/dist/cli/steps/add-vite-plugin.test.d.ts.map +1 -0
  138. package/dist/cli/steps/add-vite-plugin.test.js +74 -0
  139. package/dist/cli/steps/add-vite-plugin.test.js.map +1 -0
  140. package/dist/cli/steps/check-for-uncomitted-changes.d.ts +5 -0
  141. package/dist/cli/steps/check-for-uncomitted-changes.d.ts.map +1 -0
  142. package/dist/cli/steps/check-for-uncomitted-changes.js +37 -0
  143. package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -0
  144. package/dist/cli/steps/detect-bundler.d.ts +10 -0
  145. package/dist/cli/steps/detect-bundler.d.ts.map +1 -0
  146. package/dist/cli/steps/detect-bundler.js +22 -0
  147. package/dist/cli/steps/detect-bundler.js.map +1 -0
  148. package/dist/cli/steps/detect-bundler.test.d.ts +1 -0
  149. package/dist/cli/steps/detect-bundler.test.d.ts.map +1 -0
  150. package/dist/cli/steps/detect-bundler.test.js +29 -0
  151. package/dist/cli/steps/detect-bundler.test.js.map +1 -0
  152. package/dist/cli/steps/initialize-messages.d.ts +11 -0
  153. package/dist/cli/steps/initialize-messages.d.ts.map +1 -0
  154. package/dist/cli/steps/initialize-messages.js +31 -0
  155. package/dist/cli/steps/initialize-messages.js.map +1 -0
  156. package/dist/cli/steps/prompt-for-outdir.d.ts +8 -0
  157. package/dist/cli/steps/prompt-for-outdir.d.ts.map +1 -0
  158. package/dist/cli/steps/prompt-for-outdir.js +19 -0
  159. package/dist/cli/steps/prompt-for-outdir.js.map +1 -0
  160. package/dist/cli/steps/update-package-json.d.ts +11 -0
  161. package/dist/cli/steps/update-package-json.d.ts.map +1 -0
  162. package/dist/cli/steps/update-package-json.js +34 -0
  163. package/dist/cli/steps/update-package-json.js.map +1 -0
  164. package/dist/cli/steps/update-ts-config.d.ts +26 -0
  165. package/dist/cli/steps/update-ts-config.d.ts.map +1 -0
  166. package/dist/cli/steps/update-ts-config.js +270 -0
  167. package/dist/cli/steps/update-ts-config.js.map +1 -0
  168. package/dist/cli/steps/update-ts-config.test.d.ts +1 -0
  169. package/dist/cli/steps/update-ts-config.test.d.ts.map +1 -0
  170. package/dist/cli/steps/update-ts-config.test.js +60 -0
  171. package/dist/cli/steps/update-ts-config.test.js.map +1 -0
  172. package/dist/cli/utils.d.ts +36 -0
  173. package/dist/cli/utils.d.ts.map +1 -0
  174. package/dist/cli/utils.js +20 -0
  175. package/dist/cli/utils.js.map +1 -0
  176. package/dist/compiler/assert-url-pattern-available.d.ts +7 -0
  177. package/dist/compiler/assert-url-pattern-available.d.ts.map +1 -0
  178. package/dist/compiler/assert-url-pattern-available.js +17 -0
  179. package/dist/compiler/assert-url-pattern-available.js.map +1 -0
  180. package/dist/compiler/compile-annotation.d.ts +12 -0
  181. package/dist/compiler/compile-annotation.d.ts.map +1 -0
  182. package/dist/compiler/compile-annotation.js +136 -0
  183. package/dist/compiler/compile-annotation.js.map +1 -0
  184. package/dist/compiler/compile-bundle.d.ts +28 -0
  185. package/dist/compiler/compile-bundle.d.ts.map +1 -0
  186. package/dist/compiler/compile-bundle.js +431 -0
  187. package/dist/compiler/compile-bundle.js.map +1 -0
  188. package/dist/compiler/compile-bundle.test.d.ts +1 -0
  189. package/dist/compiler/compile-bundle.test.d.ts.map +1 -0
  190. package/dist/compiler/compile-bundle.test.js +399 -0
  191. package/dist/compiler/compile-bundle.test.js.map +1 -0
  192. package/dist/compiler/compile-local-variable.d.ts +16 -0
  193. package/dist/compiler/compile-local-variable.d.ts.map +1 -0
  194. package/dist/compiler/compile-local-variable.js +28 -0
  195. package/dist/compiler/compile-local-variable.js.map +1 -0
  196. package/dist/compiler/compile-local-variable.test.d.ts +1 -0
  197. package/dist/compiler/compile-local-variable.test.d.ts.map +1 -0
  198. package/dist/compiler/compile-local-variable.test.js +359 -0
  199. package/dist/compiler/compile-local-variable.test.js.map +1 -0
  200. package/dist/compiler/compile-message.d.ts +8 -0
  201. package/dist/compiler/compile-message.d.ts.map +1 -0
  202. package/dist/compiler/compile-message.js +174 -0
  203. package/dist/compiler/compile-message.js.map +1 -0
  204. package/dist/compiler/compile-message.test.d.ts +1 -0
  205. package/dist/compiler/compile-message.test.d.ts.map +1 -0
  206. package/dist/compiler/compile-message.test.js +1060 -0
  207. package/dist/compiler/compile-message.test.js.map +1 -0
  208. package/dist/compiler/compile-pattern.d.ts +29 -0
  209. package/dist/compiler/compile-pattern.d.ts.map +1 -0
  210. package/dist/compiler/compile-pattern.js +143 -0
  211. package/dist/compiler/compile-pattern.js.map +1 -0
  212. package/dist/compiler/compile-pattern.test.d.ts +1 -0
  213. package/dist/compiler/compile-pattern.test.d.ts.map +1 -0
  214. package/dist/compiler/compile-pattern.test.js +255 -0
  215. package/dist/compiler/compile-pattern.test.js.map +1 -0
  216. package/dist/compiler/compile-project.d.ts +21 -0
  217. package/dist/compiler/compile-project.d.ts.map +1 -0
  218. package/dist/compiler/compile-project.js +147 -0
  219. package/dist/compiler/compile-project.js.map +1 -0
  220. package/dist/compiler/compile-project.test.d.ts +1 -0
  221. package/dist/compiler/compile-project.test.d.ts.map +1 -0
  222. package/dist/compiler/compile-project.test.js +1709 -0
  223. package/dist/compiler/compile-project.test.js.map +1 -0
  224. package/dist/compiler/compile.bench.d.ts +1 -0
  225. package/dist/compiler/compile.bench.d.ts.map +1 -0
  226. package/dist/compiler/compile.bench.js +89 -0
  227. package/dist/compiler/compile.bench.js.map +1 -0
  228. package/dist/compiler/compile.d.ts +24 -0
  229. package/dist/compiler/compile.d.ts.map +1 -0
  230. package/dist/compiler/compile.js +106 -0
  231. package/dist/compiler/compile.js.map +1 -0
  232. package/dist/compiler/compile.test.d.ts +1 -0
  233. package/dist/compiler/compile.test.d.ts.map +1 -0
  234. package/dist/compiler/compile.test.js +66 -0
  235. package/dist/compiler/compile.test.js.map +1 -0
  236. package/dist/compiler/compiler-options.d.ts +466 -0
  237. package/dist/compiler/compiler-options.d.ts.map +1 -0
  238. package/dist/compiler/compiler-options.js +22 -0
  239. package/dist/compiler/compiler-options.js.map +1 -0
  240. package/dist/compiler/create-paraglide.d.ts +21 -0
  241. package/dist/compiler/create-paraglide.d.ts.map +1 -0
  242. package/dist/compiler/create-paraglide.js +69 -0
  243. package/dist/compiler/create-paraglide.js.map +1 -0
  244. package/dist/compiler/create-paraglide.test.d.ts +1 -0
  245. package/dist/compiler/create-paraglide.test.d.ts.map +1 -0
  246. package/dist/compiler/create-paraglide.test.js +55 -0
  247. package/dist/compiler/create-paraglide.test.js.map +1 -0
  248. package/dist/compiler/create-readme.d.ts +9 -0
  249. package/dist/compiler/create-readme.d.ts.map +1 -0
  250. package/dist/compiler/create-readme.js +127 -0
  251. package/dist/compiler/create-readme.js.map +1 -0
  252. package/dist/compiler/emit-files.d.ts +15 -0
  253. package/dist/compiler/emit-files.d.ts.map +1 -0
  254. package/dist/compiler/emit-files.js +58 -0
  255. package/dist/compiler/emit-files.js.map +1 -0
  256. package/dist/compiler/emit-files.test.d.ts +1 -0
  257. package/dist/compiler/emit-files.test.d.ts.map +1 -0
  258. package/dist/compiler/emit-files.test.js +43 -0
  259. package/dist/compiler/emit-files.test.js.map +1 -0
  260. package/dist/compiler/emit-ts-declarations.d.ts +11 -0
  261. package/dist/compiler/emit-ts-declarations.d.ts.map +1 -0
  262. package/dist/compiler/emit-ts-declarations.interop.test.d.ts +1 -0
  263. package/dist/compiler/emit-ts-declarations.interop.test.d.ts.map +1 -0
  264. package/dist/compiler/emit-ts-declarations.interop.test.js +33 -0
  265. package/dist/compiler/emit-ts-declarations.interop.test.js.map +1 -0
  266. package/dist/compiler/emit-ts-declarations.js +353 -0
  267. package/dist/compiler/emit-ts-declarations.js.map +1 -0
  268. package/dist/compiler/emit-ts-declarations.test.d.ts +1 -0
  269. package/dist/compiler/emit-ts-declarations.test.d.ts.map +1 -0
  270. package/dist/compiler/emit-ts-declarations.test.js +161 -0
  271. package/dist/compiler/emit-ts-declarations.test.js.map +1 -0
  272. package/dist/compiler/index.d.ts +13 -0
  273. package/dist/compiler/index.d.ts.map +1 -0
  274. package/dist/compiler/index.js +11 -0
  275. package/dist/compiler/index.js.map +1 -0
  276. package/dist/compiler/jsdoc-types.d.ts +21 -0
  277. package/dist/compiler/jsdoc-types.d.ts.map +1 -0
  278. package/dist/compiler/jsdoc-types.js +59 -0
  279. package/dist/compiler/jsdoc-types.js.map +1 -0
  280. package/dist/compiler/jsdoc-types.test.d.ts +1 -0
  281. package/dist/compiler/jsdoc-types.test.d.ts.map +1 -0
  282. package/dist/compiler/jsdoc-types.test.js +100 -0
  283. package/dist/compiler/jsdoc-types.test.js.map +1 -0
  284. package/dist/compiler/lazy-modules/compile-cache.d.ts +37 -0
  285. package/dist/compiler/lazy-modules/compile-cache.d.ts.map +1 -0
  286. package/dist/compiler/lazy-modules/compile-cache.js +34 -0
  287. package/dist/compiler/lazy-modules/compile-cache.js.map +1 -0
  288. package/dist/compiler/lazy-modules/compile-project.lazy.test.d.ts +2 -0
  289. package/dist/compiler/lazy-modules/compile-project.lazy.test.d.ts.map +1 -0
  290. package/dist/compiler/lazy-modules/compile-project.lazy.test.js +65 -0
  291. package/dist/compiler/lazy-modules/compile-project.lazy.test.js.map +1 -0
  292. package/dist/compiler/lazy-modules/create-loader.d.ts +18 -0
  293. package/dist/compiler/lazy-modules/create-loader.d.ts.map +1 -0
  294. package/dist/compiler/lazy-modules/create-loader.js +182 -0
  295. package/dist/compiler/lazy-modules/create-loader.js.map +1 -0
  296. package/dist/compiler/lazy-modules/create-loader.test.d.ts +2 -0
  297. package/dist/compiler/lazy-modules/create-loader.test.d.ts.map +1 -0
  298. package/dist/compiler/lazy-modules/create-loader.test.js +82 -0
  299. package/dist/compiler/lazy-modules/create-loader.test.js.map +1 -0
  300. package/dist/compiler/lazy-modules/manifest.d.ts +32 -0
  301. package/dist/compiler/lazy-modules/manifest.d.ts.map +1 -0
  302. package/dist/compiler/lazy-modules/manifest.js +11 -0
  303. package/dist/compiler/lazy-modules/manifest.js.map +1 -0
  304. package/dist/compiler/match-literals.d.ts +2 -0
  305. package/dist/compiler/match-literals.d.ts.map +1 -0
  306. package/dist/compiler/match-literals.js +42 -0
  307. package/dist/compiler/match-literals.js.map +1 -0
  308. package/dist/compiler/output-structure/lazy-modules.d.ts +27 -0
  309. package/dist/compiler/output-structure/lazy-modules.d.ts.map +1 -0
  310. package/dist/compiler/output-structure/lazy-modules.js +157 -0
  311. package/dist/compiler/output-structure/lazy-modules.js.map +1 -0
  312. package/dist/compiler/output-structure/lazy-modules.test.d.ts +2 -0
  313. package/dist/compiler/output-structure/lazy-modules.test.d.ts.map +1 -0
  314. package/dist/compiler/output-structure/lazy-modules.test.js +128 -0
  315. package/dist/compiler/output-structure/lazy-modules.test.js.map +1 -0
  316. package/dist/compiler/output-structure/locale-modules.d.ts +4 -0
  317. package/dist/compiler/output-structure/locale-modules.d.ts.map +1 -0
  318. package/dist/compiler/output-structure/locale-modules.js +81 -0
  319. package/dist/compiler/output-structure/locale-modules.js.map +1 -0
  320. package/dist/compiler/output-structure/locale-modules.test.d.ts +1 -0
  321. package/dist/compiler/output-structure/locale-modules.test.d.ts.map +1 -0
  322. package/dist/compiler/output-structure/locale-modules.test.js +163 -0
  323. package/dist/compiler/output-structure/locale-modules.test.js.map +1 -0
  324. package/dist/compiler/output-structure/message-modules.d.ts +4 -0
  325. package/dist/compiler/output-structure/message-modules.d.ts.map +1 -0
  326. package/dist/compiler/output-structure/message-modules.js +100 -0
  327. package/dist/compiler/output-structure/message-modules.js.map +1 -0
  328. package/dist/compiler/output-structure/message-modules.test.d.ts +1 -0
  329. package/dist/compiler/output-structure/message-modules.test.d.ts.map +1 -0
  330. package/dist/compiler/output-structure/message-modules.test.js +148 -0
  331. package/dist/compiler/output-structure/message-modules.test.js.map +1 -0
  332. package/dist/compiler/per-locale-build.d.ts +2 -0
  333. package/dist/compiler/per-locale-build.d.ts.map +1 -0
  334. package/dist/compiler/per-locale-build.js +3 -0
  335. package/dist/compiler/per-locale-build.js.map +1 -0
  336. package/dist/compiler/registry.d.ts +13 -0
  337. package/dist/compiler/registry.d.ts.map +1 -0
  338. package/dist/compiler/registry.js +60 -0
  339. package/dist/compiler/registry.js.map +1 -0
  340. package/dist/compiler/resolve-tsc-js-path.d.ts +9 -0
  341. package/dist/compiler/resolve-tsc-js-path.d.ts.map +1 -0
  342. package/dist/compiler/resolve-tsc-js-path.js +23 -0
  343. package/dist/compiler/resolve-tsc-js-path.js.map +1 -0
  344. package/dist/compiler/runtime/check-locale.d.ts +31 -0
  345. package/dist/compiler/runtime/check-locale.d.ts.map +1 -0
  346. package/dist/compiler/runtime/check-locale.js +51 -0
  347. package/dist/compiler/runtime/check-locale.js.map +1 -0
  348. package/dist/compiler/runtime/check-locale.test.d.ts +1 -0
  349. package/dist/compiler/runtime/check-locale.test.d.ts.map +1 -0
  350. package/dist/compiler/runtime/check-locale.test.js +84 -0
  351. package/dist/compiler/runtime/check-locale.test.js.map +1 -0
  352. package/dist/compiler/runtime/create-runtime.d.ts +35 -0
  353. package/dist/compiler/runtime/create-runtime.d.ts.map +1 -0
  354. package/dist/compiler/runtime/create-runtime.js +196 -0
  355. package/dist/compiler/runtime/create-runtime.js.map +1 -0
  356. package/dist/compiler/runtime/extract-locale-from-cookie.d.ts +13 -0
  357. package/dist/compiler/runtime/extract-locale-from-cookie.d.ts.map +1 -0
  358. package/dist/compiler/runtime/extract-locale-from-cookie.js +43 -0
  359. package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -0
  360. package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts +1 -0
  361. package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts.map +1 -0
  362. package/dist/compiler/runtime/extract-locale-from-cookie.test.js +149 -0
  363. package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -0
  364. package/dist/compiler/runtime/extract-locale-from-header.d.ts +13 -0
  365. package/dist/compiler/runtime/extract-locale-from-header.d.ts.map +1 -0
  366. package/dist/compiler/runtime/extract-locale-from-header.js +45 -0
  367. package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -0
  368. package/dist/compiler/runtime/extract-locale-from-header.test.d.ts +1 -0
  369. package/dist/compiler/runtime/extract-locale-from-header.test.d.ts.map +1 -0
  370. package/dist/compiler/runtime/extract-locale-from-header.test.js +55 -0
  371. package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -0
  372. package/dist/compiler/runtime/extract-locale-from-navigator.d.ts +12 -0
  373. package/dist/compiler/runtime/extract-locale-from-navigator.d.ts.map +1 -0
  374. package/dist/compiler/runtime/extract-locale-from-navigator.js +33 -0
  375. package/dist/compiler/runtime/extract-locale-from-navigator.js.map +1 -0
  376. package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts +1 -0
  377. package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts.map +1 -0
  378. package/dist/compiler/runtime/extract-locale-from-navigator.test.js +45 -0
  379. package/dist/compiler/runtime/extract-locale-from-navigator.test.js.map +1 -0
  380. package/dist/compiler/runtime/extract-locale-from-request-async.d.ts +34 -0
  381. package/dist/compiler/runtime/extract-locale-from-request-async.d.ts.map +1 -0
  382. package/dist/compiler/runtime/extract-locale-from-request-async.js +70 -0
  383. package/dist/compiler/runtime/extract-locale-from-request-async.js.map +1 -0
  384. package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts +1 -0
  385. package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts.map +1 -0
  386. package/dist/compiler/runtime/extract-locale-from-request-async.test.js +119 -0
  387. package/dist/compiler/runtime/extract-locale-from-request-async.test.js.map +1 -0
  388. package/dist/compiler/runtime/extract-locale-from-request.d.ts +41 -0
  389. package/dist/compiler/runtime/extract-locale-from-request.d.ts.map +1 -0
  390. package/dist/compiler/runtime/extract-locale-from-request.js +96 -0
  391. package/dist/compiler/runtime/extract-locale-from-request.js.map +1 -0
  392. package/dist/compiler/runtime/extract-locale-from-request.test.d.ts +1 -0
  393. package/dist/compiler/runtime/extract-locale-from-request.test.d.ts.map +1 -0
  394. package/dist/compiler/runtime/extract-locale-from-request.test.js +351 -0
  395. package/dist/compiler/runtime/extract-locale-from-request.test.js.map +1 -0
  396. package/dist/compiler/runtime/extract-locale-from-url.d.ts +11 -0
  397. package/dist/compiler/runtime/extract-locale-from-url.d.ts.map +1 -0
  398. package/dist/compiler/runtime/extract-locale-from-url.js +68 -0
  399. package/dist/compiler/runtime/extract-locale-from-url.js.map +1 -0
  400. package/dist/compiler/runtime/extract-locale-from-url.test.d.ts +1 -0
  401. package/dist/compiler/runtime/extract-locale-from-url.test.d.ts.map +1 -0
  402. package/dist/compiler/runtime/extract-locale-from-url.test.js +127 -0
  403. package/dist/compiler/runtime/extract-locale-from-url.test.js.map +1 -0
  404. package/dist/compiler/runtime/generate-static-localized-urls.d.ts +44 -0
  405. package/dist/compiler/runtime/generate-static-localized-urls.d.ts.map +1 -0
  406. package/dist/compiler/runtime/generate-static-localized-urls.js +133 -0
  407. package/dist/compiler/runtime/generate-static-localized-urls.js.map +1 -0
  408. package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts +1 -0
  409. package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts.map +1 -0
  410. package/dist/compiler/runtime/generate-static-localized-urls.test.js +159 -0
  411. package/dist/compiler/runtime/generate-static-localized-urls.test.js.map +1 -0
  412. package/dist/compiler/runtime/get-locale.d.ts +42 -0
  413. package/dist/compiler/runtime/get-locale.d.ts.map +1 -0
  414. package/dist/compiler/runtime/get-locale.js +158 -0
  415. package/dist/compiler/runtime/get-locale.js.map +1 -0
  416. package/dist/compiler/runtime/get-locale.test.d.ts +1 -0
  417. package/dist/compiler/runtime/get-locale.test.d.ts.map +1 -0
  418. package/dist/compiler/runtime/get-locale.test.js +295 -0
  419. package/dist/compiler/runtime/get-locale.test.js.map +1 -0
  420. package/dist/compiler/runtime/get-text-direction.d.ts +15 -0
  421. package/dist/compiler/runtime/get-text-direction.d.ts.map +1 -0
  422. package/dist/compiler/runtime/get-text-direction.js +46 -0
  423. package/dist/compiler/runtime/get-text-direction.js.map +1 -0
  424. package/dist/compiler/runtime/get-text-direction.test.d.ts +1 -0
  425. package/dist/compiler/runtime/get-text-direction.test.d.ts.map +1 -0
  426. package/dist/compiler/runtime/get-text-direction.test.js +40 -0
  427. package/dist/compiler/runtime/get-text-direction.test.js.map +1 -0
  428. package/dist/compiler/runtime/get-url-origin.d.ts +19 -0
  429. package/dist/compiler/runtime/get-url-origin.d.ts.map +1 -0
  430. package/dist/compiler/runtime/get-url-origin.js +31 -0
  431. package/dist/compiler/runtime/get-url-origin.js.map +1 -0
  432. package/dist/compiler/runtime/get-url-origin.test.d.ts +1 -0
  433. package/dist/compiler/runtime/get-url-origin.test.d.ts.map +1 -0
  434. package/dist/compiler/runtime/get-url-origin.test.js +18 -0
  435. package/dist/compiler/runtime/get-url-origin.test.js.map +1 -0
  436. package/dist/compiler/runtime/host-routing.d.ts +28 -0
  437. package/dist/compiler/runtime/host-routing.d.ts.map +1 -0
  438. package/dist/compiler/runtime/host-routing.js +79 -0
  439. package/dist/compiler/runtime/host-routing.js.map +1 -0
  440. package/dist/compiler/runtime/host-routing.test.d.ts +1 -0
  441. package/dist/compiler/runtime/host-routing.test.d.ts.map +1 -0
  442. package/dist/compiler/runtime/host-routing.test.js +128 -0
  443. package/dist/compiler/runtime/host-routing.test.js.map +1 -0
  444. package/dist/compiler/runtime/localize-href.d.ts +84 -0
  445. package/dist/compiler/runtime/localize-href.d.ts.map +1 -0
  446. package/dist/compiler/runtime/localize-href.js +115 -0
  447. package/dist/compiler/runtime/localize-href.js.map +1 -0
  448. package/dist/compiler/runtime/localize-href.test.d.ts +1 -0
  449. package/dist/compiler/runtime/localize-href.test.d.ts.map +1 -0
  450. package/dist/compiler/runtime/localize-href.test.js +139 -0
  451. package/dist/compiler/runtime/localize-href.test.js.map +1 -0
  452. package/dist/compiler/runtime/localize-url.d.ts +95 -0
  453. package/dist/compiler/runtime/localize-url.d.ts.map +1 -0
  454. package/dist/compiler/runtime/localize-url.js +327 -0
  455. package/dist/compiler/runtime/localize-url.js.map +1 -0
  456. package/dist/compiler/runtime/localize-url.test.d.ts +1 -0
  457. package/dist/compiler/runtime/localize-url.test.d.ts.map +1 -0
  458. package/dist/compiler/runtime/localize-url.test.js +533 -0
  459. package/dist/compiler/runtime/localize-url.test.js.map +1 -0
  460. package/dist/compiler/runtime/route-strategy.d.ts +32 -0
  461. package/dist/compiler/runtime/route-strategy.d.ts.map +1 -0
  462. package/dist/compiler/runtime/route-strategy.js +72 -0
  463. package/dist/compiler/runtime/route-strategy.js.map +1 -0
  464. package/dist/compiler/runtime/set-locale.d.ts +46 -0
  465. package/dist/compiler/runtime/set-locale.d.ts.map +1 -0
  466. package/dist/compiler/runtime/set-locale.js +172 -0
  467. package/dist/compiler/runtime/set-locale.js.map +1 -0
  468. package/dist/compiler/runtime/set-locale.test.d.ts +1 -0
  469. package/dist/compiler/runtime/set-locale.test.d.ts.map +1 -0
  470. package/dist/compiler/runtime/set-locale.test.js +555 -0
  471. package/dist/compiler/runtime/set-locale.test.js.map +1 -0
  472. package/dist/compiler/runtime/should-redirect.d.ts +100 -0
  473. package/dist/compiler/runtime/should-redirect.d.ts.map +1 -0
  474. package/dist/compiler/runtime/should-redirect.js +155 -0
  475. package/dist/compiler/runtime/should-redirect.js.map +1 -0
  476. package/dist/compiler/runtime/should-redirect.test.d.ts +1 -0
  477. package/dist/compiler/runtime/should-redirect.test.d.ts.map +1 -0
  478. package/dist/compiler/runtime/should-redirect.test.js +270 -0
  479. package/dist/compiler/runtime/should-redirect.test.js.map +1 -0
  480. package/dist/compiler/runtime/strategy.d.ts +63 -0
  481. package/dist/compiler/runtime/strategy.d.ts.map +1 -0
  482. package/dist/compiler/runtime/strategy.js +65 -0
  483. package/dist/compiler/runtime/strategy.js.map +1 -0
  484. package/dist/compiler/runtime/strategy.test.d.ts +1 -0
  485. package/dist/compiler/runtime/strategy.test.d.ts.map +1 -0
  486. package/dist/compiler/runtime/strategy.test.js +90 -0
  487. package/dist/compiler/runtime/strategy.test.js.map +1 -0
  488. package/dist/compiler/runtime/track-message-call.d.ts +5 -0
  489. package/dist/compiler/runtime/track-message-call.d.ts.map +1 -0
  490. package/dist/compiler/runtime/track-message-call.js +14 -0
  491. package/dist/compiler/runtime/track-message-call.js.map +1 -0
  492. package/dist/compiler/runtime/track-message-call.test.d.ts +1 -0
  493. package/dist/compiler/runtime/track-message-call.test.d.ts.map +1 -0
  494. package/dist/compiler/runtime/track-message-call.test.js +22 -0
  495. package/dist/compiler/runtime/track-message-call.test.js.map +1 -0
  496. package/dist/compiler/runtime/type-definitions.d.ts +197 -0
  497. package/dist/compiler/runtime/type-definitions.d.ts.map +1 -0
  498. package/dist/compiler/runtime/type-definitions.js +150 -0
  499. package/dist/compiler/runtime/type-definitions.js.map +1 -0
  500. package/dist/compiler/runtime/type.d.ts +47 -0
  501. package/dist/compiler/runtime/type.d.ts.map +1 -0
  502. package/dist/compiler/runtime/type.js +2 -0
  503. package/dist/compiler/runtime/type.js.map +1 -0
  504. package/dist/compiler/runtime/type.test.d.ts +1 -0
  505. package/dist/compiler/runtime/type.test.d.ts.map +1 -0
  506. package/dist/compiler/runtime/type.test.js +153 -0
  507. package/dist/compiler/runtime/type.test.js.map +1 -0
  508. package/dist/compiler/runtime/url-pattern.d.ts +12 -0
  509. package/dist/compiler/runtime/url-pattern.d.ts.map +1 -0
  510. package/dist/compiler/runtime/url-pattern.js +35 -0
  511. package/dist/compiler/runtime/url-pattern.js.map +1 -0
  512. package/dist/compiler/runtime/variables.d.ts +128 -0
  513. package/dist/compiler/runtime/variables.d.ts.map +1 -0
  514. package/dist/compiler/runtime/variables.js +111 -0
  515. package/dist/compiler/runtime/variables.js.map +1 -0
  516. package/dist/compiler/safe-module-id.d.ts +7 -0
  517. package/dist/compiler/safe-module-id.d.ts.map +1 -0
  518. package/dist/compiler/safe-module-id.js +78 -0
  519. package/dist/compiler/safe-module-id.js.map +1 -0
  520. package/dist/compiler/safe-module-id.test.d.ts +1 -0
  521. package/dist/compiler/safe-module-id.test.d.ts.map +1 -0
  522. package/dist/compiler/safe-module-id.test.js +36 -0
  523. package/dist/compiler/safe-module-id.test.js.map +1 -0
  524. package/dist/compiler/seed-previous-compilation.d.ts +7 -0
  525. package/dist/compiler/seed-previous-compilation.d.ts.map +1 -0
  526. package/dist/compiler/seed-previous-compilation.js +9 -0
  527. package/dist/compiler/seed-previous-compilation.js.map +1 -0
  528. package/dist/compiler/server/create-server-file.d.ts +12 -0
  529. package/dist/compiler/server/create-server-file.d.ts.map +1 -0
  530. package/dist/compiler/server/create-server-file.js +91 -0
  531. package/dist/compiler/server/create-server-file.js.map +1 -0
  532. package/dist/compiler/server/create-server-file.test.d.ts +1 -0
  533. package/dist/compiler/server/create-server-file.test.d.ts.map +1 -0
  534. package/dist/compiler/server/create-server-file.test.js +48 -0
  535. package/dist/compiler/server/create-server-file.test.js.map +1 -0
  536. package/dist/compiler/server/middleware.d.ts +98 -0
  537. package/dist/compiler/server/middleware.d.ts.map +1 -0
  538. package/dist/compiler/server/middleware.js +278 -0
  539. package/dist/compiler/server/middleware.js.map +1 -0
  540. package/dist/compiler/server/middleware.test.d.ts +1 -0
  541. package/dist/compiler/server/middleware.test.d.ts.map +1 -0
  542. package/dist/compiler/server/middleware.test.js +1001 -0
  543. package/dist/compiler/server/middleware.test.js.map +1 -0
  544. package/dist/compiler/server/type.d.ts +6 -0
  545. package/dist/compiler/server/type.d.ts.map +1 -0
  546. package/dist/compiler/server/type.js +2 -0
  547. package/dist/compiler/server/type.js.map +1 -0
  548. package/dist/compiler/test-helpers.d.ts +30 -0
  549. package/dist/compiler/test-helpers.d.ts.map +1 -0
  550. package/dist/compiler/test-helpers.js +50 -0
  551. package/dist/compiler/test-helpers.js.map +1 -0
  552. package/dist/compiler/types.d.ts +7 -0
  553. package/dist/compiler/types.d.ts.map +1 -0
  554. package/dist/compiler/types.js +2 -0
  555. package/dist/compiler/types.js.map +1 -0
  556. package/dist/compiler/variable-access.d.ts +3 -0
  557. package/dist/compiler/variable-access.d.ts.map +1 -0
  558. package/dist/compiler/variable-access.js +15 -0
  559. package/dist/compiler/variable-access.js.map +1 -0
  560. package/dist/index.d.ts +2 -0
  561. package/dist/index.d.ts.map +1 -0
  562. package/dist/index.js +3 -0
  563. package/dist/index.js.map +1 -0
  564. package/dist/messages/ast.d.ts +102 -0
  565. package/dist/messages/ast.d.ts.map +1 -0
  566. package/dist/messages/ast.js +8 -0
  567. package/dist/messages/ast.js.map +1 -0
  568. package/dist/messages/create-bundle-nested.d.ts +16 -0
  569. package/dist/messages/create-bundle-nested.d.ts.map +1 -0
  570. package/dist/messages/create-bundle-nested.js +22 -0
  571. package/dist/messages/create-bundle-nested.js.map +1 -0
  572. package/dist/messages/index.d.ts +5 -0
  573. package/dist/messages/index.d.ts.map +1 -0
  574. package/dist/messages/index.js +5 -0
  575. package/dist/messages/index.js.map +1 -0
  576. package/dist/messages/load-messages.d.ts +19 -0
  577. package/dist/messages/load-messages.d.ts.map +1 -0
  578. package/dist/messages/load-messages.js +49 -0
  579. package/dist/messages/load-messages.js.map +1 -0
  580. package/dist/messages/message-format/flatten.d.ts +9 -0
  581. package/dist/messages/message-format/flatten.d.ts.map +1 -0
  582. package/dist/messages/message-format/flatten.js +32 -0
  583. package/dist/messages/message-format/flatten.js.map +1 -0
  584. package/dist/messages/message-format/import-files.d.ts +32 -0
  585. package/dist/messages/message-format/import-files.d.ts.map +1 -0
  586. package/dist/messages/message-format/import-files.js +53 -0
  587. package/dist/messages/message-format/import-files.js.map +1 -0
  588. package/dist/messages/message-format/import-files.test.d.ts +1 -0
  589. package/dist/messages/message-format/import-files.test.d.ts.map +1 -0
  590. package/dist/messages/message-format/import-files.test.js +145 -0
  591. package/dist/messages/message-format/import-files.test.js.map +1 -0
  592. package/dist/messages/message-format/index.d.ts +6 -0
  593. package/dist/messages/message-format/index.d.ts.map +1 -0
  594. package/dist/messages/message-format/index.js +7 -0
  595. package/dist/messages/message-format/index.js.map +1 -0
  596. package/dist/messages/message-format/parse-bundle.d.ts +31 -0
  597. package/dist/messages/message-format/parse-bundle.d.ts.map +1 -0
  598. package/dist/messages/message-format/parse-bundle.js +169 -0
  599. package/dist/messages/message-format/parse-bundle.js.map +1 -0
  600. package/dist/messages/message-format/parse-declaration.d.ts +2 -0
  601. package/dist/messages/message-format/parse-declaration.d.ts.map +1 -0
  602. package/dist/messages/message-format/parse-declaration.js +56 -0
  603. package/dist/messages/message-format/parse-declaration.js.map +1 -0
  604. package/dist/messages/message-format/parse-markup.d.ts +4 -0
  605. package/dist/messages/message-format/parse-markup.d.ts.map +1 -0
  606. package/dist/messages/message-format/parse-markup.js +167 -0
  607. package/dist/messages/message-format/parse-markup.js.map +1 -0
  608. package/dist/messages/message-format/parse-matches.d.ts +5 -0
  609. package/dist/messages/message-format/parse-matches.d.ts.map +1 -0
  610. package/dist/messages/message-format/parse-matches.js +31 -0
  611. package/dist/messages/message-format/parse-matches.js.map +1 -0
  612. package/dist/messages/message-format/parse-pattern.d.ts +5 -0
  613. package/dist/messages/message-format/parse-pattern.d.ts.map +1 -0
  614. package/dist/messages/message-format/parse-pattern.js +120 -0
  615. package/dist/messages/message-format/parse-pattern.js.map +1 -0
  616. package/dist/messages/message-format/unique.d.ts +2 -0
  617. package/dist/messages/message-format/unique.d.ts.map +1 -0
  618. package/dist/messages/message-format/unique.js +5 -0
  619. package/dist/messages/message-format/unique.js.map +1 -0
  620. package/dist/messages/nest-bundles.d.ts +19 -0
  621. package/dist/messages/nest-bundles.d.ts.map +1 -0
  622. package/dist/messages/nest-bundles.js +49 -0
  623. package/dist/messages/nest-bundles.js.map +1 -0
  624. package/dist/services/account/index.d.ts +14 -0
  625. package/dist/services/account/index.d.ts.map +1 -0
  626. package/dist/services/account/index.js +43 -0
  627. package/dist/services/account/index.js.map +1 -0
  628. package/dist/services/account/types.d.ts +4 -0
  629. package/dist/services/account/types.d.ts.map +1 -0
  630. package/dist/services/account/types.js +2 -0
  631. package/dist/services/account/types.js.map +1 -0
  632. package/dist/services/codegen/escape.d.ts +9 -0
  633. package/dist/services/codegen/escape.d.ts.map +1 -0
  634. package/dist/services/codegen/escape.js +19 -0
  635. package/dist/services/codegen/escape.js.map +1 -0
  636. package/dist/services/codegen/quotes.d.ts +4 -0
  637. package/dist/services/codegen/quotes.d.ts.map +1 -0
  638. package/dist/services/codegen/quotes.js +5 -0
  639. package/dist/services/codegen/quotes.js.map +1 -0
  640. package/dist/services/env-variables/create-index-file.d.ts +9 -0
  641. package/dist/services/env-variables/create-index-file.d.ts.map +1 -0
  642. package/dist/services/env-variables/create-index-file.js +28 -0
  643. package/dist/services/env-variables/create-index-file.js.map +1 -0
  644. package/dist/services/env-variables/index.d.ts +3 -0
  645. package/dist/services/env-variables/index.d.ts.map +1 -0
  646. package/dist/services/env-variables/index.js +4 -0
  647. package/dist/services/env-variables/index.js.map +1 -0
  648. package/dist/services/environment/package.d.ts +9 -0
  649. package/dist/services/environment/package.d.ts.map +1 -0
  650. package/dist/services/environment/package.js +31 -0
  651. package/dist/services/environment/package.js.map +1 -0
  652. package/dist/services/environment/package.test.d.ts +1 -0
  653. package/dist/services/environment/package.test.d.ts.map +1 -0
  654. package/dist/services/environment/package.test.js +21 -0
  655. package/dist/services/environment/package.test.js.map +1 -0
  656. package/dist/services/error-handling.d.ts +12 -0
  657. package/dist/services/error-handling.d.ts.map +1 -0
  658. package/dist/services/error-handling.js +27 -0
  659. package/dist/services/error-handling.js.map +1 -0
  660. package/dist/services/error-handling.test.d.ts +1 -0
  661. package/dist/services/error-handling.test.d.ts.map +1 -0
  662. package/dist/services/error-handling.test.js +10 -0
  663. package/dist/services/error-handling.test.js.map +1 -0
  664. package/dist/services/file-handling/content-hash.d.ts +9 -0
  665. package/dist/services/file-handling/content-hash.js +19 -0
  666. package/dist/services/file-handling/content-hash.js.map +1 -0
  667. package/dist/services/file-handling/exists.d.ts +7 -0
  668. package/dist/services/file-handling/exists.d.ts.map +1 -0
  669. package/dist/services/file-handling/exists.js +24 -0
  670. package/dist/services/file-handling/exists.js.map +1 -0
  671. package/dist/services/file-handling/exists.test.d.ts +1 -0
  672. package/dist/services/file-handling/exists.test.d.ts.map +1 -0
  673. package/dist/services/file-handling/exists.test.js +27 -0
  674. package/dist/services/file-handling/exists.test.js.map +1 -0
  675. package/dist/services/file-handling/types.d.ts +4 -0
  676. package/dist/services/file-handling/types.d.ts.map +1 -0
  677. package/dist/services/file-handling/types.js +2 -0
  678. package/dist/services/file-handling/types.js.map +1 -0
  679. package/dist/services/file-handling/write-output.d.ts +21 -0
  680. package/dist/services/file-handling/write-output.d.ts.map +1 -0
  681. package/dist/services/file-handling/write-output.js +157 -0
  682. package/dist/services/file-handling/write-output.js.map +1 -0
  683. package/dist/services/file-handling/write-output.test.d.ts +1 -0
  684. package/dist/services/file-handling/write-output.test.d.ts.map +1 -0
  685. package/dist/services/file-handling/write-output.test.js +217 -0
  686. package/dist/services/file-handling/write-output.test.js.map +1 -0
  687. package/dist/services/file-watching/tracked-fs.d.ts +25 -0
  688. package/dist/services/file-watching/tracked-fs.d.ts.map +1 -0
  689. package/dist/services/file-watching/tracked-fs.js +94 -0
  690. package/dist/services/file-watching/tracked-fs.js.map +1 -0
  691. package/dist/services/file-watching/tracked-fs.test.d.ts +1 -0
  692. package/dist/services/file-watching/tracked-fs.test.d.ts.map +1 -0
  693. package/dist/services/file-watching/tracked-fs.test.js +87 -0
  694. package/dist/services/file-watching/tracked-fs.test.js.map +1 -0
  695. package/dist/services/logger/index.d.ts +17 -0
  696. package/dist/services/logger/index.d.ts.map +1 -0
  697. package/dist/services/logger/index.js +58 -0
  698. package/dist/services/logger/index.js.map +1 -0
  699. package/dist/services/lookup.d.ts +14 -0
  700. package/dist/services/lookup.d.ts.map +1 -0
  701. package/dist/services/lookup.js +24 -0
  702. package/dist/services/lookup.js.map +1 -0
  703. package/dist/urlpattern-polyfill/index.d.ts +2 -0
  704. package/dist/urlpattern-polyfill/index.d.ts.map +1 -0
  705. package/dist/urlpattern-polyfill/index.js +2 -0
  706. package/dist/urlpattern-polyfill/index.js.map +1 -0
  707. package/dist/utilities/detect-json-formatting.d.ts +10 -0
  708. package/dist/utilities/detect-json-formatting.d.ts.map +1 -0
  709. package/dist/utilities/detect-json-formatting.js +80 -0
  710. package/dist/utilities/detect-json-formatting.js.map +1 -0
  711. package/dist/utilities/node-normalize-path.d.ts +1 -0
  712. package/dist/utilities/node-normalize-path.d.ts.map +1 -0
  713. package/dist/utilities/node-normalize-path.js +10 -0
  714. package/dist/utilities/node-normalize-path.js.map +1 -0
  715. package/package.json +87 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-message.test.js","sourceRoot":"","sources":["../../src/compiler/compile-message.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;IAC3D,MAAM,YAAY,GAAkB,EAAE,CAAC;IACvC,MAAM,OAAO,GAAY;QACxB,MAAM,EAAE,IAAI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ACtC,8BAA8B;QAC7B,IAAI,CAAC,gCAAgC,GAAG,QAAQ,CAAC,IAAI,CAAC,CACvD,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChE,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC7C,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from \"vitest\";\nimport { compileMessage } from \"./compile-message.js\";\nimport type { Declaration, Message, Variant } from \"../messages/ast.js\";\nimport { createRegistry } from \"./registry.js\";\n\ntest(\"compiles a message with a single variant\", async () => {\n\tconst declarations: Declaration[] = [];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"some_message\",\n\t\tid: \"message-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [{ type: \"text\", value: \"Hello\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { some_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const some_message =\" + compiled.code)\n\t);\n\n\texpect(some_message()).toBe(\"Hello\");\n});\n\ntest(\"compiles pattern-level annotations to registry calls\", async () => {\n\t// https://github.com/opral/paraglide-js/issues/694\n\t// i18next's `{{count, number}}` imports as an expression with a\n\t// function-reference annotation directly on the pattern.\n\tconst declarations: Declaration[] = [{ type: \"input-variable\", name: \"count\" }];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"views\",\n\t\tid: \"message-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"number\",\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" views\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\texpect(compiled.code).toContain('registry.number(\"en\", i?.count, {})');\n\n\tconst { views } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\tbtoa(\n\t\t\t\tcreateRegistry() +\n\t\t\t\t\t\"\\nexport const views = \" +\n\t\t\t\t\tcompiled.code.replaceAll(\"registry.\", \"\")\n\t\t\t)\n\t);\n\n\texpect(views({ count: 1234567.891 })).toBe(\"1,234,567.891 views\");\n});\n\ntest(\"compiles pattern-level annotations in multi-variant messages\", async () => {\n\tconst declarations: Declaration[] = [{ type: \"input-variable\", name: \"count\" }];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"views_multi\",\n\t\tid: \"message-id\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"count\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message-id\",\n\t\t\tmatches: [{ type: \"literal-match\", key: \"count\", value: \"1\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"One view\" }],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"message-id\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"count\" }],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"number\",\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" views\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { views_multi } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\tbtoa(\n\t\t\t\tcreateRegistry() +\n\t\t\t\t\t\"\\nexport const views_multi = \" +\n\t\t\t\t\tcompiled.code.replaceAll(\"registry.\", \"\")\n\t\t\t)\n\t);\n\n\texpect(views_multi({ count: 1 })).toBe(\"One view\");\n\texpect(views_multi({ count: 1234567.891 })).toBe(\"1,234,567.891 views\");\n});\n\ntest(\"compiles a markup message with .parts()\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"amount\" },\n\t\t{ type: \"input-variable\", name: \"relationship\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"balance\",\n\t\tid: \"balance-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"balance-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"You have \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"markup-start\",\n\t\t\t\t\tname: \"tooltip\",\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"rel\",\n\t\t\t\t\t\t\tvalue: { type: \"variable-reference\", name: \"relationship\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tattributes: [{ name: \"track\", value: true }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"amount\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" coins\" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"markup-end\",\n\t\t\t\t\tname: \"tooltip\",\n\t\t\t\t\toptions: [],\n\t\t\t\t\tattributes: [],\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { balance } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const balance =\" + compiled.code)\n\t);\n\n\texpect(balance({ amount: 5, relationship: \"noopener\" })).toBe(\n\t\t\"You have 5 coins.\"\n\t);\n\texpect(balance.parts({ amount: 5, relationship: \"noopener\" })).toEqual([\n\t\t{ type: \"text\", value: \"You have \" },\n\t\t{\n\t\t\ttype: \"markup-start\",\n\t\t\tname: \"tooltip\",\n\t\t\toptions: { rel: \"noopener\" },\n\t\t\tattributes: { track: true },\n\t\t},\n\t\t{ type: \"text\", value: \"5\" },\n\t\t{ type: \"text\", value: \" coins\" },\n\t\t{\n\t\t\ttype: \"markup-end\",\n\t\t\tname: \"tooltip\",\n\t\t\toptions: {},\n\t\t\tattributes: {},\n\t\t},\n\t\t{ type: \"text\", value: \".\" },\n\t]);\n});\n\ntest(\"does not add .parts() for plain messages\", async () => {\n\tconst declarations: Declaration[] = [];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"plain\",\n\t\tid: \"plain-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"plain-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [{ type: \"text\", value: \"Hello\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\tconst { plain } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const plain = \" + compiled.code)\n\t);\n\n\texpect(plain()).toBe(\"Hello\");\n\texpect(\"parts\" in plain).toBe(false);\n});\n\ntest(\"compiles multi-variant markup messages with .parts()\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"count\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"select-id\",\n\t\tbundleId: \"select_message\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"count\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"select-id\",\n\t\t\tmatches: [{ type: \"literal-match\", key: \"count\", value: \"1\" }],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"markup-start\", name: \"strong\", options: [], attributes: [] },\n\t\t\t\t{ type: \"text\", value: \"One item\" },\n\t\t\t\t{ type: \"markup-end\", name: \"strong\", options: [], attributes: [] },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"select-id\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"count\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"Many items\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\tconst { select_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const select_message = \" + compiled.code)\n\t);\n\n\texpect(select_message({ count: 1 })).toBe(\"One item\");\n\texpect(select_message.parts({ count: 1 })).toEqual([\n\t\t{ type: \"markup-start\", name: \"strong\", options: {}, attributes: {} },\n\t\t{ type: \"text\", value: \"One item\" },\n\t\t{ type: \"markup-end\", name: \"strong\", options: {}, attributes: {} },\n\t]);\n\texpect(select_message({ count: 2 })).toBe(\"Many items\");\n\texpect(select_message.parts({ count: 2 })).toEqual([\n\t\t{ type: \"text\", value: \"Many items\" },\n\t]);\n});\n\ntest(\"numeric literal matches accept number and string inputs without loose coercion\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"input\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"numeric-select-id\",\n\t\tbundleId: \"numeric_select_message\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"input\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"numeric-select-id\",\n\t\t\tmatches: [{ type: \"literal-match\", key: \"input\", value: \"1\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"Thing 1\" }],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"numeric-select-id\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"input\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"Fallback\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\tconst { numeric_select_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const numeric_select_message = \" + compiled.code)\n\t);\n\n\texpect(numeric_select_message({ input: 1 })).toBe(\"Thing 1\");\n\texpect(numeric_select_message({ input: \"1\" })).toBe(\"Thing 1\");\n\texpect(numeric_select_message({ input: true })).toBe(\"Fallback\");\n});\n\n// https://github.com/opral/paraglide-js/issues/682\ntest(\"infinity input matches accept number and string inputs\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"capacity\" },\n\t\t{ type: \"input-variable\", name: \"pending\" },\n\t\t{ type: \"input-variable\", name: \"count\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"group-member-count-id\",\n\t\tbundleId: \"group_member_count\",\n\t\tselectors: [\n\t\t\t{ type: \"variable-reference\", name: \"capacity\" },\n\t\t\t{ type: \"variable-reference\", name: \"pending\" },\n\t\t],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"group-member-count-id\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"literal-match\", key: \"capacity\", value: \"Infinity\" },\n\t\t\t\t{ type: \"catchall-match\", key: \"pending\" },\n\t\t\t],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"group-member-count-id\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"catchall-match\", key: \"capacity\" },\n\t\t\t\t{ type: \"literal-match\", key: \"pending\", value: \"0\" },\n\t\t\t],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" / \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"capacity\" },\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"3\",\n\t\t\tmessageId: \"group-member-count-id\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"catchall-match\", key: \"capacity\" },\n\t\t\t\t{ type: \"catchall-match\", key: \"pending\" },\n\t\t\t],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" / \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"capacity\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" (\" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"pending\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" pending)\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\tconst { group_member_count } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const group_member_count = \" + compiled.code)\n\t);\n\n\texpect(group_member_count({ capacity: Infinity, pending: 5, count: 5 })).toBe(\n\t\t\"5\"\n\t);\n\texpect(\n\t\tgroup_member_count({ capacity: \"Infinity\", pending: 5, count: 5 })\n\t).toBe(\"5\");\n\texpect(group_member_count({ capacity: 10, pending: 0, count: 5 })).toBe(\n\t\t\"5 / 10\"\n\t);\n\texpect(group_member_count({ capacity: 10, pending: 5, count: 5 })).toBe(\n\t\t\"5 / 10 (5 pending)\"\n\t);\n});\n\n// https://github.com/opral/paraglide-js/issues/571\ntest(\"compiles a message that can be parsed as JSON\", async () => {\n\tconst declarations: Declaration[] = [];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"json_message\",\n\t\tid: \"json-message-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"json-message-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [{ type: \"text\", value: '[\"a\",\"b\",\"c\"]' }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { json_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const json_message = \" + compiled.code)\n\t);\n\n\texpect(JSON.parse(json_message())).toEqual([\"a\", \"b\", \"c\"]);\n});\n\ntest(\"compiles a message with variants\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"fistInput\" },\n\t\t{ type: \"input-variable\", name: \"secondInput\" },\n\t];\n\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"some_message\",\n\t\tbundleId: \"some_message\",\n\t\tselectors: [\n\t\t\t{ type: \"variable-reference\", name: \"fistInput\" },\n\t\t\t{ type: \"variable-reference\", name: \"secondInput\" },\n\t\t],\n\t};\n\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"some_message\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"literal-match\", key: \"fistInput\", value: \"1\" },\n\t\t\t\t{ type: \"literal-match\", key: \"secondInput\", value: \"2\" },\n\t\t\t],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"The inputs are \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"fistInput\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" and \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"secondInput\" },\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"some_message\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"catchall-match\", key: \"fistInput\" },\n\t\t\t\t{ type: \"catchall-match\", key: \"secondInput\" },\n\t\t\t],\n\t\t\tpattern: [{ type: \"text\", value: \"Catch all\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { some_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const some_message = \" + compiled.code)\n\t);\n\n\texpect(some_message({ fistInput: 1, secondInput: 2 })).toBe(\n\t\t\"The inputs are 1 and 2\"\n\t);\n\texpect(some_message({ fistInput: 3, secondInput: 4 })).toBe(\"Catch all\");\n\texpect(some_message({ fistInput: 1, secondInput: 5 })).toBe(\"Catch all\");\n});\n\ntest(\"compiles a message with non-identifier input names\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"half!\" },\n\t];\n\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"special_input\",\n\t\tbundleId: \"special_input\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"half!\" }],\n\t};\n\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"special_input\",\n\t\t\tmatches: [{ type: \"literal-match\", key: \"half!\", value: \"1\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"First\" }],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"special_input\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"half!\" }],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"Value: \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"half!\" },\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { special_input } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const special_input = \" + compiled.code)\n\t);\n\n\texpect(special_input({ \"half!\": \"1\" })).toBe(\"First\");\n\texpect(special_input({ \"half!\": \"2\" })).toBe(\"Value: 2\");\n});\n\ntest(\"compiles multi-variant message with a fallback in case the variants are not matched\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"fistInput\" },\n\t\t{ type: \"input-variable\", name: \"secondInput\" },\n\t];\n\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tid: \"some_message\",\n\t\tbundleId: \"some_message\",\n\t\tselectors: [\n\t\t\t{ type: \"variable-reference\", name: \"fistInput\" },\n\t\t\t{ type: \"variable-reference\", name: \"secondInput\" },\n\t\t],\n\t};\n\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"some_message\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"literal-match\", key: \"fistInput\", value: \"1\" },\n\t\t\t\t{ type: \"literal-match\", key: \"secondInput\", value: \"2\" },\n\t\t\t],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"The inputs are \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"fistInput\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \" and \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"secondInput\" },\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"some_message\",\n\t\t\tmatches: [\n\t\t\t\t{ type: \"catchall-match\", key: \"fistInput\" },\n\t\t\t\t{ type: \"literal-match\", key: \"secondInput\", value: \"2\" },\n\t\t\t],\n\t\t\tpattern: [{ type: \"text\", value: \"Catch all\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { some_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const some_message = \" + compiled.code)\n\t);\n\n\texpect(some_message({ secondInput: 2 })).toBe(\"Catch all\");\n\texpect(some_message({})).toBe(\"some_message\");\n});\n\ntest(\"only emits input arguments when inputs exist\", async () => {\n\tconst declarations: Declaration[] = [];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"some_message\",\n\t\tid: \"message-id\",\n\t\tselectors: [],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message-id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [{ type: \"text\", value: \"Hello\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\texpect(compiled.code).toBe(\n\t\t\"/** @type {(inputs: {}) => LocalizedString} */ () => {\\n\\treturn /** @type {LocalizedString} */ (`Hello`)\\n};\"\n\t);\n});\n\n// https://github.com/opral/inlang-paraglide-js/issues/379\ntest(\"compiles messages that use plural()\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"date\" },\n\t\t{\n\t\t\ttype: \"local-variable\",\n\t\t\tname: \"countPlural\",\n\t\t\tvalue: {\n\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\tannotation: {\n\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\tname: \"plural\",\n\t\t\t\t\toptions: [],\n\t\t\t\t},\n\t\t\t\ttype: \"expression\",\n\t\t\t},\n\t\t},\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"plural_test\",\n\t\tid: \"message_id\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"countPlural\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [{ type: \"literal-match\", value: \"one\", key: \"countPlural\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"There is one cat.\" }],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"literal-match\",\n\t\t\t\t\tvalue: \"other\",\n\t\t\t\t\tkey: \"countPlural\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tpattern: [{ type: \"text\", value: \"There are many cats.\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { plural_test } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\tbtoa(createRegistry()) +\n\t\t\tbtoa(\n\t\t\t\t\"export const plural_test = \" + compiled.code.replace(\"registry.\", \"\")\n\t\t\t)\n\t);\n\n\texpect(plural_test({ count: 1 })).toBe(\"There is one cat.\");\n\texpect(plural_test({ count: 2 })).toBe(\"There are many cats.\");\n\t// INTL.plural will match \"other\" for undefined\n\texpect(plural_test({ count: undefined })).toBe(\"There are many cats.\");\n});\n\ntest(\"compiles messages that use plural() with ordinal type\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"count\" },\n\t\t{\n\t\t\ttype: \"local-variable\",\n\t\t\tname: \"countOrdinal\",\n\t\t\tvalue: {\n\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\tannotation: {\n\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\tname: \"plural\",\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{ name: \"type\", value: { type: \"literal\", value: \"ordinal\" } },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: \"expression\",\n\t\t\t},\n\t\t},\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"ordinal_test\",\n\t\tid: \"message_id\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"countOrdinal\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [{ type: \"literal-match\", value: \"one\", key: \"countOrdinal\" }],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \"st place\" },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [{ type: \"literal-match\", value: \"two\", key: \"countOrdinal\" }],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \"nd place\" },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"3\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [{ type: \"literal-match\", value: \"few\", key: \"countOrdinal\" }],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \"rd place\" },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"4\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [{ type: \"literal-match\", value: \"other\", key: \"countOrdinal\" }],\n\t\t\tpattern: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"count\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \"th place\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { ordinal_test } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(createRegistry()) +\n\t\t\tbtoa(\n\t\t\t\t\"export const ordinal_test = \" + compiled.code.replace(\"registry.\", \"\")\n\t\t\t)\n\t);\n\n\texpect(ordinal_test({ count: 1 })).toBe(\"1st place\");\n\texpect(ordinal_test({ count: 2 })).toBe(\"2nd place\");\n\texpect(ordinal_test({ count: 3 })).toBe(\"3rd place\");\n\texpect(ordinal_test({ count: 4 })).toBe(\"4th place\");\n});\n\ntest(\"compiles messages that use number()\", async () => {\n\tconst createMessage = async (locale: string) => {\n\t\tconst declarations: Declaration[] = [\n\t\t\t{ type: \"input-variable\", name: \"amount\" },\n\t\t\t{\n\t\t\t\ttype: \"local-variable\",\n\t\t\t\tname: \"formattedAmount\",\n\t\t\t\tvalue: {\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"amount\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"number\",\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tconst message: Message = {\n\t\t\tlocale,\n\t\t\tbundleId: \"number_test\",\n\t\t\tid: \"message_id\",\n\t\t\tselectors: [],\n\t\t};\n\n\t\tconst variants: Variant[] = [\n\t\t\t{\n\t\t\t\tid: \"1\",\n\t\t\t\tmessageId: \"message_id\",\n\t\t\t\tmatches: [],\n\t\t\t\tpattern: [\n\t\t\t\t\t{ type: \"text\", value: \"Your balance is \" },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedAmount\" },\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\n\t\tconst compiled = compileMessage(declarations, message, variants);\n\n\t\tconst { number_test } = await import(\n\t\t\t\"data:text/javascript;base64,\" +\n\t\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\t\tbtoa(createRegistry()) +\n\t\t\t\tbtoa(\n\t\t\t\t\t\"export const number_test = \" + compiled.code.replace(\"registry.\", \"\")\n\t\t\t\t)\n\t\t);\n\t\treturn number_test;\n\t};\n\n\tconst enMessage = await createMessage(\"en\");\n\tconst deMessage = await createMessage(\"de\");\n\n\texpect(enMessage({ amount: 1000.57 })).toBe(\"Your balance is 1,000.57.\");\n\texpect(deMessage({ amount: 1000.57 })).toBe(\"Your balance is 1.000,57.\");\n});\n\ntest(\"compiles messages that use number() with options\", async () => {\n\tconst createMessage = async (locale: string) => {\n\t\tconst declarations: Declaration[] = [\n\t\t\t{ type: \"input-variable\", name: \"amount\" },\n\t\t\t{\n\t\t\t\ttype: \"local-variable\",\n\t\t\t\tname: \"formattedAmount\",\n\t\t\t\tvalue: {\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"amount\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"number\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"minimumFractionDigits\",\n\t\t\t\t\t\t\t\tvalue: { type: \"literal\", value: \"2\" },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"maximumFractionDigits\",\n\t\t\t\t\t\t\t\tvalue: { type: \"literal\", value: \"2\" },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tconst message: Message = {\n\t\t\tlocale,\n\t\t\tbundleId: \"number_test\",\n\t\t\tid: \"message_id\",\n\t\t\tselectors: [],\n\t\t};\n\n\t\tconst variants: Variant[] = [\n\t\t\t{\n\t\t\t\tid: \"1\",\n\t\t\t\tmessageId: \"message_id\",\n\t\t\t\tmatches: [],\n\t\t\t\tpattern: [\n\t\t\t\t\t{ type: \"text\", value: \"Balance: \" },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedAmount\" },\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\n\t\tconst compiled = compileMessage(declarations, message, variants);\n\n\t\tconst { number_test } = await import(\n\t\t\t\"data:text/javascript;base64,\" +\n\t\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\t\tbtoa(createRegistry()) +\n\t\t\t\tbtoa(\n\t\t\t\t\t\"export const number_test = \" + compiled.code.replace(\"registry.\", \"\")\n\t\t\t\t)\n\t\t);\n\t\treturn number_test;\n\t};\n\n\tconst enMessage = await createMessage(\"en\");\n\tconst deMessage = await createMessage(\"de\");\n\n\texpect(enMessage({ amount: 1000.5 })).toBe(\"Balance: 1,000.50.\");\n\texpect(deMessage({ amount: 1000.5 })).toBe(\"Balance: 1.000,50.\");\n});\n\ntest(\"compiles messages that use datetime()\", async () => {\n\tconst createMessage = async (locale: string) => {\n\t\tconst declarations: Declaration[] = [\n\t\t\t{ type: \"input-variable\", name: \"date\" },\n\t\t\t{\n\t\t\t\ttype: \"local-variable\",\n\t\t\t\tname: \"formattedDate\",\n\t\t\t\tvalue: {\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"date\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"datetime\",\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tconst message: Message = {\n\t\t\tlocale,\n\t\t\tbundleId: \"datetime_test\",\n\t\t\tid: \"message_id\",\n\t\t\tselectors: [],\n\t\t};\n\n\t\tconst variants: Variant[] = [\n\t\t\t{\n\t\t\t\tid: \"1\",\n\t\t\t\tmessageId: \"message_id\",\n\t\t\t\tmatches: [],\n\t\t\t\tpattern: [\n\t\t\t\t\t{ type: \"text\", value: \"Today is \" },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedDate\" },\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\n\t\tconst compiled = compileMessage(declarations, message, variants);\n\n\t\tconst { datetime_test } = await import(\n\t\t\t\"data:text/javascript;base64,\" +\n\t\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\t\tbtoa(createRegistry()) +\n\t\t\t\tbtoa(\n\t\t\t\t\t\"export const datetime_test =\" +\n\t\t\t\t\t\tcompiled.code.replace(\"registry.\", \"\")\n\t\t\t\t)\n\t\t);\n\t\treturn datetime_test;\n\t};\n\n\tconst enMessage = await createMessage(\"en\");\n\tconst deMessage = await createMessage(\"de\");\n\n\texpect(enMessage({ date: \"2022-04-01\" })).toMatch(\n\t\t/Today is \\d{1,2}\\/\\d{1,2}\\/2022\\./\n\t);\n\n\texpect(deMessage({ date: \"2022-04-01\" })).toMatch(\n\t\t/Today is \\d{1,2}\\.\\d{1,2}\\.2022\\./\n\t);\n});\n\ntest(\"compiles messages that use datetime a function with options\", async () => {\n\tconst createMessage = async (locale: string) => {\n\t\tconst declarations: Declaration[] = [\n\t\t\t{ type: \"input-variable\", name: \"date\" },\n\t\t\t{\n\t\t\t\ttype: \"local-variable\",\n\t\t\t\tname: \"formattedDate\",\n\t\t\t\tvalue: {\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"date\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"datetime\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ name: \"month\", value: { type: \"literal\", value: \"long\" } },\n\t\t\t\t\t\t\t{ name: \"day\", value: { type: \"literal\", value: \"numeric\" } },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tconst message: Message = {\n\t\t\tlocale,\n\t\t\tbundleId: \"datetime_test\",\n\t\t\tid: \"message_id\",\n\t\t\tselectors: [],\n\t\t};\n\n\t\tconst variants: Variant[] = [\n\t\t\t{\n\t\t\t\tid: \"1\",\n\t\t\t\tmessageId: \"message_id\",\n\t\t\t\tmatches: [],\n\t\t\t\tpattern: [\n\t\t\t\t\t{ type: \"text\", value: \"Today is \" },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedDate\" },\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\n\t\tconst compiled = compileMessage(declarations, message, variants);\n\n\t\tconst { datetime_test } = await import(\n\t\t\t\"data:text/javascript;base64,\" +\n\t\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\t\tbtoa(createRegistry()) +\n\t\t\t\tbtoa(\n\t\t\t\t\t\"export const datetime_test = \" +\n\t\t\t\t\t\tcompiled.code.replace(\"registry.\", \"\")\n\t\t\t\t)\n\t\t);\n\t\treturn datetime_test;\n\t};\n\n\tconst enMessage = await createMessage(\"en\");\n\tconst deMessage = await createMessage(\"de\");\n\n\t// needs regex to avoid timezone's effecting the unit test\n\texpect(enMessage({ date: \"2022-03-31\" })).toMatch(/Today is March \\d{1,2}\\./);\n\texpect(deMessage({ date: \"2022-03-31\" })).toMatch(\n\t\t/Today is \\d{1,2}\\. März\\./\n\t);\n});\n\ntest(\"compiles messages that use relativetime() with options\", async () => {\n\tconst createMessage = async (locale: string) => {\n\t\tconst declarations: Declaration[] = [\n\t\t\t{ type: \"input-variable\", name: \"duration\" },\n\t\t\t{\n\t\t\t\ttype: \"local-variable\",\n\t\t\t\tname: \"formattedDuration\",\n\t\t\t\tvalue: {\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"duration\" },\n\t\t\t\t\tannotation: {\n\t\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\t\tname: \"relativetime\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ name: \"unit\", value: { type: \"literal\", value: \"day\" } },\n\t\t\t\t\t\t\t{ name: \"numeric\", value: { type: \"literal\", value: \"auto\" } },\n\t\t\t\t\t\t\t{ name: \"style\", value: { type: \"literal\", value: \"short\" } },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tconst message: Message = {\n\t\t\tlocale,\n\t\t\tbundleId: \"relative_time_test\",\n\t\t\tid: \"message_id\",\n\t\t\tselectors: [],\n\t\t};\n\n\t\tconst variants: Variant[] = [\n\t\t\t{\n\t\t\t\tid: \"1\",\n\t\t\t\tmessageId: \"message_id\",\n\t\t\t\tmatches: [],\n\t\t\t\tpattern: [\n\t\t\t\t\t{ type: \"text\", value: \"Updated \" },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedDuration\" },\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\n\t\tconst compiled = compileMessage(declarations, message, variants);\n\n\t\tconst { relative_time_test } = await import(\n\t\t\t\"data:text/javascript;base64,\" +\n\t\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\t\tbtoa(createRegistry()) +\n\t\t\t\tbtoa(\n\t\t\t\t\t\"export const relative_time_test = \" +\n\t\t\t\t\t\tcompiled.code.replace(\"registry.\", \"\")\n\t\t\t\t)\n\t\t);\n\t\treturn relative_time_test;\n\t};\n\n\tconst enMessage = await createMessage(\"en\");\n\tconst deMessage = await createMessage(\"de\");\n\n\texpect(enMessage({ duration: -1 })).toBe(\"Updated yesterday.\");\n\texpect(deMessage({ duration: 2 })).toBe(\"Updated übermorgen.\");\n});\n\ntest(\"compiles messages that use relativetime() with dynamic units\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"duration\" },\n\t\t{ type: \"input-variable\", name: \"unit\" },\n\t\t{\n\t\t\ttype: \"local-variable\",\n\t\t\tname: \"formattedDuration\",\n\t\t\tvalue: {\n\t\t\t\targ: { type: \"variable-reference\", name: \"duration\" },\n\t\t\t\tannotation: {\n\t\t\t\t\ttype: \"function-reference\",\n\t\t\t\t\tname: \"relativetime\",\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"unit\",\n\t\t\t\t\t\t\tvalue: { type: \"variable-reference\", name: \"unit\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ name: \"style\", value: { type: \"literal\", value: \"short\" } },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: \"expression\",\n\t\t\t},\n\t\t},\n\t];\n\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"relative_time_test\",\n\t\tid: \"message_id\",\n\t\tselectors: [],\n\t};\n\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"message_id\",\n\t\t\tmatches: [],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"Updated \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"formattedDuration\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \".\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { relative_time_test } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\t// bundling the registry inline to avoid managing module imports here\n\t\t\tbtoa(createRegistry()) +\n\t\t\tbtoa(\n\t\t\t\t\"export const relative_time_test = \" +\n\t\t\t\t\tcompiled.code.replace(\"registry.\", \"\")\n\t\t\t)\n\t);\n\n\texpect(relative_time_test({ duration: -3, unit: \"hour\" })).toBe(\n\t\t\"Updated 3 hr. ago.\"\n\t);\n});\n\ntest(\"does not throw when input is omitted for a single-variant message\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"name\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"greeting\",\n\t\tid: \"greeting\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"name\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"greeting\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"name\" }],\n\t\t\tpattern: [\n\t\t\t\t{ type: \"text\", value: \"Hello \" },\n\t\t\t\t{\n\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\targ: { type: \"variable-reference\", name: \"name\" },\n\t\t\t\t},\n\t\t\t\t{ type: \"text\", value: \"!\" },\n\t\t\t],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { greeting } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const greeting = \" + compiled.code)\n\t);\n\n\texpect(() => greeting()).not.toThrow();\n\texpect(greeting()).toBe(\"Hello undefined!\");\n});\n\ntest(\"does not throw when input is omitted for multi-variant message\", async () => {\n\tconst declarations: Declaration[] = [\n\t\t{ type: \"input-variable\", name: \"status\" },\n\t];\n\tconst message: Message = {\n\t\tlocale: \"en\",\n\t\tbundleId: \"status_message\",\n\t\tid: \"status_message\",\n\t\tselectors: [{ type: \"variable-reference\", name: \"status\" }],\n\t};\n\tconst variants: Variant[] = [\n\t\t{\n\t\t\tid: \"1\",\n\t\t\tmessageId: \"status_message\",\n\t\t\tmatches: [{ type: \"literal-match\", key: \"status\", value: \"ready\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"Ready to go\" }],\n\t\t},\n\t\t{\n\t\t\tid: \"2\",\n\t\t\tmessageId: \"status_message\",\n\t\t\tmatches: [{ type: \"catchall-match\", key: \"status\" }],\n\t\t\tpattern: [{ type: \"text\", value: \"Unknown status\" }],\n\t\t},\n\t];\n\n\tconst compiled = compileMessage(declarations, message, variants);\n\n\tconst { status_message } = await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tbtoa(\"export const status_message = \" + compiled.code)\n\t);\n\n\texpect(status_message({ status: \"ready\" })).toBe(\"Ready to go\");\n\texpect(() => status_message()).not.toThrow();\n\texpect(status_message()).toBe(\"Unknown status\");\n});\n"]}
@@ -0,0 +1,29 @@
1
+ import type { Declaration, Pattern } from "../messages/ast.js";
2
+ import type { Compiled } from "./types.js";
3
+ export type CompilePatternMode = "string" | "parts";
4
+ /**
5
+ * Compiles a pattern into either a template literal string or parts array.
6
+ *
7
+ * @example
8
+ * const pattern: Pattern = [
9
+ * { type: "text", value: "Your age is " },
10
+ * { type: "expression", arg: { type: "variable-reference", name: "age" } },
11
+ * ]
12
+ *
13
+ * const { code } = compilePattern({ pattern, declarations: [{ type: "input-variable", name: "age" }] });
14
+ *
15
+ * // code will be: `Your age is ${i?.age}`
16
+ */
17
+ export declare const compilePattern: (args: {
18
+ pattern: Pattern;
19
+ declarations: Declaration[];
20
+ mode?: CompilePatternMode;
21
+ /**
22
+ * The locale of the message the pattern belongs to.
23
+ *
24
+ * Required to compile expressions with annotations like
25
+ * `{ annotation: { type: "function-reference", name: "number" } }`
26
+ * into `registry.number(locale, ...)` calls.
27
+ */
28
+ locale?: string;
29
+ }) => Compiled<Pattern>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-pattern.d.ts","sourceRoot":"","sources":["../../src/compiler/compile-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,WAAW,EAGX,OAAO,EAEP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAU3C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,SAAU;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,QAAQ,CAAC,OAAO,CAQnB,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { escapeForTemplateLiteral } from "../services/codegen/escape.js";
2
+ import { compileInputAccess } from "./variable-access.js";
3
+ import { compileAnnotation, isRegistryFunction, registryFunctionNamesForDisplay, } from "./compile-annotation.js";
4
+ import { Logger } from "../services/logger/index.js";
5
+ /**
6
+ * Compiles a pattern into either a template literal string or parts array.
7
+ *
8
+ * @example
9
+ * const pattern: Pattern = [
10
+ * { type: "text", value: "Your age is " },
11
+ * { type: "expression", arg: { type: "variable-reference", name: "age" } },
12
+ * ]
13
+ *
14
+ * const { code } = compilePattern({ pattern, declarations: [{ type: "input-variable", name: "age" }] });
15
+ *
16
+ * // code will be: `Your age is ${i?.age}`
17
+ */
18
+ export const compilePattern = (args) => {
19
+ const mode = args.mode ?? "string";
20
+ if (mode === "parts") {
21
+ return compilePatternToParts(args);
22
+ }
23
+ return compilePatternToString(args);
24
+ };
25
+ function compilePatternToString(args) {
26
+ let result = "";
27
+ for (const part of args.pattern) {
28
+ switch (part.type) {
29
+ case "text":
30
+ result += escapeForTemplateLiteral(part.value);
31
+ break;
32
+ case "expression":
33
+ result += `\${${compileExpression(part, args.declarations, args.locale)}}`;
34
+ break;
35
+ case "markup-start":
36
+ case "markup-end":
37
+ case "markup-standalone":
38
+ // Markup wrappers are omitted for plain string output.
39
+ break;
40
+ }
41
+ }
42
+ return {
43
+ code: `\`${result}\``,
44
+ node: args.pattern,
45
+ };
46
+ }
47
+ function compilePatternToParts(args) {
48
+ const compiledParts = [];
49
+ for (const part of args.pattern) {
50
+ switch (part.type) {
51
+ case "text":
52
+ compiledParts.push(`{ type: "text", value: ${stringLiteral(part.value)} }`);
53
+ break;
54
+ case "expression":
55
+ compiledParts.push(`{ type: "text", value: String(${compileExpression(part, args.declarations, args.locale)}) }`);
56
+ break;
57
+ case "markup-start":
58
+ case "markup-end":
59
+ case "markup-standalone":
60
+ compiledParts.push(`{ type: ${stringLiteral(part.type)}, name: ${stringLiteral(part.name)}, options: ${compileMarkupOptions(part.options ?? [], args.declarations)}, attributes: ${compileMarkupAttributes(part.attributes ?? [])} }`);
61
+ break;
62
+ }
63
+ }
64
+ return {
65
+ code: `[${compiledParts.join(", ")}]`,
66
+ node: args.pattern,
67
+ };
68
+ }
69
+ const logger = new Logger();
70
+ /**
71
+ * Tracks annotation names that have already been warned about to avoid
72
+ * spamming the console when the same unsupported formatter is used in
73
+ * many messages (or across watch-mode recompiles).
74
+ */
75
+ const warnedUnsupportedAnnotations = new Set();
76
+ /**
77
+ * Compiles a pattern expression including its annotation (if any).
78
+ *
79
+ * Annotations referencing a registry function compile to a `registry.*`
80
+ * call, identical to annotations on local variable declarations. Unknown
81
+ * annotations fall back to plain interpolation with a warning to avoid
82
+ * breaking compilation of messages imported from other i18n libraries
83
+ * (e.g. i18next's `{{value, customFormat}}`).
84
+ */
85
+ function compileExpression(expression, declarations, locale) {
86
+ const value = compileExpressionValue(expression, declarations);
87
+ const annotation = expression.annotation;
88
+ if (!annotation) {
89
+ return value;
90
+ }
91
+ if (!isRegistryFunction(annotation.name)) {
92
+ if (!warnedUnsupportedAnnotations.has(annotation.name)) {
93
+ warnedUnsupportedAnnotations.add(annotation.name);
94
+ logger.warn(`The formatter "${annotation.name}" is unknown and will be ignored. The value is interpolated without formatting. Supported formatters: ${registryFunctionNamesForDisplay()}.`);
95
+ }
96
+ return value;
97
+ }
98
+ if (locale === undefined) {
99
+ throw new Error(`compilePattern() requires a locale to compile the formatter "${annotation.name}".`);
100
+ }
101
+ return compileAnnotation(value, locale, annotation);
102
+ }
103
+ function compileExpressionValue(expression, declarations) {
104
+ switch (expression.arg.type) {
105
+ case "literal":
106
+ return stringLiteral(expression.arg.value);
107
+ case "variable-reference":
108
+ return compileVariableReference(expression.arg, declarations);
109
+ }
110
+ }
111
+ function compileVariableReference(reference, declarations) {
112
+ const declaration = declarations.find((decl) => decl.name === reference.name);
113
+ if (declaration?.type === "input-variable") {
114
+ return compileInputAccess(reference.name);
115
+ }
116
+ if (declaration?.type === "local-variable") {
117
+ return reference.name;
118
+ }
119
+ throw new Error(`Variable reference "${reference.name}" not found in declarations`);
120
+ }
121
+ function compileMarkupOptions(options, declarations) {
122
+ if (options.length === 0) {
123
+ return "{}";
124
+ }
125
+ return `{ ${options
126
+ .map((option) => `${stringLiteral(option.name)}: ${compileExpressionValue({ arg: option.value }, declarations)}`)
127
+ .join(", ")} }`;
128
+ }
129
+ function compileMarkupAttributes(attributes) {
130
+ if (attributes.length === 0) {
131
+ return "{}";
132
+ }
133
+ return `{ ${attributes
134
+ .map((attribute) => {
135
+ const value = attribute.value === true ? "true" : stringLiteral(attribute.value.value);
136
+ return `${stringLiteral(attribute.name)}: ${value}`;
137
+ })
138
+ .join(", ")} }`;
139
+ }
140
+ function stringLiteral(value) {
141
+ return JSON.stringify(value);
142
+ }
143
+ //# sourceMappingURL=compile-pattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-pattern.js","sourceRoot":"","sources":["../../src/compiler/compile-pattern.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,wBAAwB,EAAE,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KAAK,gBAAgB,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,MAAM,IAAI,KAAK,CACd,uBAAuB,SAAS,CAAC,IAAI,6BAA6B,CAClE,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAC5B,OAAiB,EACjB,YAA2B;IAE3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,OAAO;SACjB,GAAG,CACH,CAAC,MAAM,EAAE,EAAE,CACV,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,sBAAsB,CACvD,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,EACrB,YAAY,CACZ,EAAE,CACJ;SACA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,SAAS,uBAAuB,CAAC,UAAuB;IACvD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,UAAU;SACpB,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,MAAM,KAAK,GACV,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;IACrD,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IACnC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type {\n\tAttribute,\n\tDeclaration,\n\tExpression,\n\tOption,\n\tPattern,\n\tVariableReference,\n} from \"../messages/ast.js\";\nimport type { Compiled } from \"./types.js\";\nimport { escapeForTemplateLiteral } from \"../services/codegen/escape.js\";\nimport { compileInputAccess } from \"./variable-access.js\";\nimport {\n\tcompileAnnotation,\n\tisRegistryFunction,\n\tregistryFunctionNamesForDisplay,\n} from \"./compile-annotation.js\";\nimport { Logger } from \"../services/logger/index.js\";\n\nexport type CompilePatternMode = \"string\" | \"parts\";\n\n/**\n * Compiles a pattern into either a template literal string or parts array.\n *\n * @example\n * const pattern: Pattern = [\n * \t { type: \"text\", value: \"Your age is \" },\n * \t { type: \"expression\", arg: { type: \"variable-reference\", name: \"age\" } },\n * ]\n *\n * const { code } = compilePattern({ pattern, declarations: [{ type: \"input-variable\", name: \"age\" }] });\n *\n * // code will be: `Your age is ${i?.age}`\n */\nexport const compilePattern = (args: {\n\tpattern: Pattern;\n\tdeclarations: Declaration[];\n\tmode?: CompilePatternMode;\n\t/**\n\t * The locale of the message the pattern belongs to.\n\t *\n\t * Required to compile expressions with annotations like\n\t * `{ annotation: { type: \"function-reference\", name: \"number\" } }`\n\t * into `registry.number(locale, ...)` calls.\n\t */\n\tlocale?: string;\n}): Compiled<Pattern> => {\n\tconst mode = args.mode ?? \"string\";\n\n\tif (mode === \"parts\") {\n\t\treturn compilePatternToParts(args);\n\t}\n\n\treturn compilePatternToString(args);\n};\n\nfunction compilePatternToString(args: {\n\tpattern: Pattern;\n\tdeclarations: Declaration[];\n\tlocale?: string;\n}): Compiled<Pattern> {\n\tlet result = \"\";\n\n\tfor (const part of args.pattern) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text\":\n\t\t\t\tresult += escapeForTemplateLiteral(part.value);\n\t\t\t\tbreak;\n\t\t\tcase \"expression\":\n\t\t\t\tresult += `\\${${compileExpression(part, args.declarations, args.locale)}}`;\n\t\t\t\tbreak;\n\t\t\tcase \"markup-start\":\n\t\t\tcase \"markup-end\":\n\t\t\tcase \"markup-standalone\":\n\t\t\t\t// Markup wrappers are omitted for plain string output.\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tcode: `\\`${result}\\``,\n\t\tnode: args.pattern,\n\t};\n}\n\nfunction compilePatternToParts(args: {\n\tpattern: Pattern;\n\tdeclarations: Declaration[];\n\tlocale?: string;\n}): Compiled<Pattern> {\n\tconst compiledParts: string[] = [];\n\n\tfor (const part of args.pattern) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text\":\n\t\t\t\tcompiledParts.push(\n\t\t\t\t\t`{ type: \"text\", value: ${stringLiteral(part.value)} }`\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"expression\":\n\t\t\t\tcompiledParts.push(\n\t\t\t\t\t`{ type: \"text\", value: String(${compileExpression(\n\t\t\t\t\t\tpart,\n\t\t\t\t\t\targs.declarations,\n\t\t\t\t\t\targs.locale\n\t\t\t\t\t)}) }`\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"markup-start\":\n\t\t\tcase \"markup-end\":\n\t\t\tcase \"markup-standalone\":\n\t\t\t\tcompiledParts.push(\n\t\t\t\t\t`{ type: ${stringLiteral(part.type)}, name: ${stringLiteral(\n\t\t\t\t\t\tpart.name\n\t\t\t\t\t)}, options: ${compileMarkupOptions(\n\t\t\t\t\t\tpart.options ?? [],\n\t\t\t\t\t\targs.declarations\n\t\t\t\t\t)}, attributes: ${compileMarkupAttributes(part.attributes ?? [])} }`\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tcode: `[${compiledParts.join(\", \")}]`,\n\t\tnode: args.pattern,\n\t};\n}\n\nconst logger = new Logger();\n\n/**\n * Tracks annotation names that have already been warned about to avoid\n * spamming the console when the same unsupported formatter is used in\n * many messages (or across watch-mode recompiles).\n */\nconst warnedUnsupportedAnnotations = new Set<string>();\n\n/**\n * Compiles a pattern expression including its annotation (if any).\n *\n * Annotations referencing a registry function compile to a `registry.*`\n * call, identical to annotations on local variable declarations. Unknown\n * annotations fall back to plain interpolation with a warning to avoid\n * breaking compilation of messages imported from other i18n libraries\n * (e.g. i18next's `{{value, customFormat}}`).\n */\nfunction compileExpression(\n\texpression: Expression,\n\tdeclarations: Declaration[],\n\tlocale?: string\n): string {\n\tconst value = compileExpressionValue(expression, declarations);\n\tconst annotation = expression.annotation;\n\n\tif (!annotation) {\n\t\treturn value;\n\t}\n\n\tif (!isRegistryFunction(annotation.name)) {\n\t\tif (!warnedUnsupportedAnnotations.has(annotation.name)) {\n\t\t\twarnedUnsupportedAnnotations.add(annotation.name);\n\t\t\tlogger.warn(\n\t\t\t\t`The formatter \"${annotation.name}\" is unknown and will be ignored. The value is interpolated without formatting. Supported formatters: ${registryFunctionNamesForDisplay()}.`\n\t\t\t);\n\t\t}\n\t\treturn value;\n\t}\n\n\tif (locale === undefined) {\n\t\tthrow new Error(\n\t\t\t`compilePattern() requires a locale to compile the formatter \"${annotation.name}\".`\n\t\t);\n\t}\n\n\treturn compileAnnotation(value, locale, annotation);\n}\n\nfunction compileExpressionValue(\n\texpression: Pick<Expression, \"arg\">,\n\tdeclarations: Declaration[]\n): string {\n\tswitch (expression.arg.type) {\n\t\tcase \"literal\":\n\t\t\treturn stringLiteral(expression.arg.value);\n\t\tcase \"variable-reference\":\n\t\t\treturn compileVariableReference(expression.arg, declarations);\n\t}\n}\n\nfunction compileVariableReference(\n\treference: VariableReference,\n\tdeclarations: Declaration[]\n): string {\n\tconst declaration = declarations.find((decl) => decl.name === reference.name);\n\n\tif (declaration?.type === \"input-variable\") {\n\t\treturn compileInputAccess(reference.name);\n\t}\n\tif (declaration?.type === \"local-variable\") {\n\t\treturn reference.name;\n\t}\n\n\tthrow new Error(\n\t\t`Variable reference \"${reference.name}\" not found in declarations`\n\t);\n}\n\nfunction compileMarkupOptions(\n\toptions: Option[],\n\tdeclarations: Declaration[]\n): string {\n\tif (options.length === 0) {\n\t\treturn \"{}\";\n\t}\n\n\treturn `{ ${options\n\t\t.map(\n\t\t\t(option) =>\n\t\t\t\t`${stringLiteral(option.name)}: ${compileExpressionValue(\n\t\t\t\t\t{ arg: option.value },\n\t\t\t\t\tdeclarations\n\t\t\t\t)}`\n\t\t)\n\t\t.join(\", \")} }`;\n}\n\nfunction compileMarkupAttributes(attributes: Attribute[]): string {\n\tif (attributes.length === 0) {\n\t\treturn \"{}\";\n\t}\n\n\treturn `{ ${attributes\n\t\t.map((attribute) => {\n\t\t\tconst value =\n\t\t\t\tattribute.value === true ? \"true\" : stringLiteral(attribute.value.value);\n\t\t\treturn `${stringLiteral(attribute.name)}: ${value}`;\n\t\t})\n\t\t.join(\", \")} }`;\n}\n\nfunction stringLiteral(value: string): string {\n\treturn JSON.stringify(value);\n}\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-pattern.test.d.ts","sourceRoot":"","sources":["../../src/compiler/compile-pattern.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,255 @@
1
+ import { test, expect } from "vitest";
2
+ import { compilePattern } from "./compile-pattern.js";
3
+ test("should compile a text only pattern", () => {
4
+ const pattern = [{ type: "text", value: "Hello" }];
5
+ const { code } = compilePattern({ pattern, declarations: [] });
6
+ expect(code).toBe("`Hello`");
7
+ });
8
+ test("should compile a pattern with multiple VariableReference's", () => {
9
+ const pattern = [
10
+ { type: "text", value: "Hello " },
11
+ {
12
+ type: "expression",
13
+ arg: {
14
+ type: "variable-reference",
15
+ name: "name",
16
+ },
17
+ },
18
+ { type: "text", value: "! You have " },
19
+ { type: "expression", arg: { type: "variable-reference", name: "count" } },
20
+ { type: "text", value: " messages." },
21
+ ];
22
+ const { code } = compilePattern({
23
+ pattern,
24
+ declarations: [
25
+ { type: "input-variable", name: "name" },
26
+ { type: "input-variable", name: "count" },
27
+ ],
28
+ });
29
+ expect(code).toBe("`Hello ${i?.name}! You have ${i?.count} messages.`");
30
+ });
31
+ test("uses bracket notation for input variables with non-identifier names", () => {
32
+ const pattern = [
33
+ { type: "text", value: "Half " },
34
+ {
35
+ type: "expression",
36
+ arg: {
37
+ type: "variable-reference",
38
+ name: "half!",
39
+ },
40
+ },
41
+ ];
42
+ const { code } = compilePattern({
43
+ pattern,
44
+ declarations: [{ type: "input-variable", name: "half!" }],
45
+ });
46
+ expect(code).toBe('`Half ${i?.["half!"]}`');
47
+ });
48
+ test("should escape backticks", () => {
49
+ const pattern = [{ type: "text", value: "`Hello world`" }];
50
+ const { code } = compilePattern({ pattern, declarations: [] });
51
+ expect(code).toBe("`\\`Hello world\\``");
52
+ });
53
+ test("should escape backslashes", () => {
54
+ const pattern = [{ type: "text", value: "\\Hello world\\" }];
55
+ const { code } = compilePattern({ pattern, declarations: [] });
56
+ expect(code).toBe("`\\\\Hello world\\\\`");
57
+ });
58
+ test("should escape escaped backticks", () => {
59
+ const pattern = [{ type: "text", value: "\\`Hello world\\`" }];
60
+ const { code } = compilePattern({ pattern, declarations: [] });
61
+ expect(code).toBe("`\\\\\\`Hello world\\\\\\``");
62
+ });
63
+ test("should escape variable interpolation ( ${} )", () => {
64
+ const pattern = [{ type: "text", value: "${name" }];
65
+ const { code } = compilePattern({ pattern, declarations: [] });
66
+ expect(code).toBe("`\\${name`");
67
+ });
68
+ test("it can reference local variables", () => {
69
+ const { code } = compilePattern({
70
+ pattern: [
71
+ { type: "text", value: "Hello " },
72
+ {
73
+ type: "expression",
74
+ arg: {
75
+ type: "variable-reference",
76
+ name: "name",
77
+ },
78
+ },
79
+ ],
80
+ declarations: [
81
+ {
82
+ type: "local-variable",
83
+ name: "name",
84
+ value: {
85
+ type: "expression",
86
+ arg: { type: "literal", value: "Peter" },
87
+ },
88
+ },
89
+ ],
90
+ });
91
+ expect(code).toBe("`Hello ${name}`");
92
+ });
93
+ test("plain string mode strips markup wrappers", () => {
94
+ const pattern = [
95
+ { type: "text", value: "Hello " },
96
+ { type: "markup-start", name: "b" },
97
+ { type: "expression", arg: { type: "variable-reference", name: "name" } },
98
+ { type: "markup-end", name: "b" },
99
+ { type: "text", value: "!" },
100
+ ];
101
+ const { code } = compilePattern({
102
+ pattern,
103
+ declarations: [{ type: "input-variable", name: "name" }],
104
+ });
105
+ expect(code).toBe("`Hello ${i?.name}!`");
106
+ });
107
+ test("compiles a pattern expression annotation to a registry call", () => {
108
+ // https://github.com/opral/paraglide-js/issues/694
109
+ const pattern = [
110
+ {
111
+ type: "expression",
112
+ arg: { type: "variable-reference", name: "count" },
113
+ annotation: { type: "function-reference", name: "number", options: [] },
114
+ },
115
+ { type: "text", value: " views" },
116
+ ];
117
+ const { code } = compilePattern({
118
+ pattern,
119
+ declarations: [{ type: "input-variable", name: "count" }],
120
+ locale: "en",
121
+ });
122
+ expect(code).toBe('`${registry.number("en", i?.count, {})} views`');
123
+ });
124
+ test("compiles pattern expression annotation options like local variable annotations", () => {
125
+ const pattern = [
126
+ {
127
+ type: "expression",
128
+ arg: { type: "variable-reference", name: "price" },
129
+ annotation: {
130
+ type: "function-reference",
131
+ name: "number",
132
+ options: [
133
+ {
134
+ name: "minimumFractionDigits",
135
+ value: { type: "literal", value: "2" },
136
+ },
137
+ { name: "style", value: { type: "literal", value: "percent" } },
138
+ ],
139
+ },
140
+ },
141
+ ];
142
+ const { code } = compilePattern({
143
+ pattern,
144
+ declarations: [{ type: "input-variable", name: "price" }],
145
+ locale: "de",
146
+ });
147
+ expect(code).toBe('`${registry.number("de", i?.price, { minimumFractionDigits: 2, style: "percent" })}`');
148
+ });
149
+ test("parts mode compiles pattern expression annotations to registry calls", () => {
150
+ const pattern = [
151
+ {
152
+ type: "expression",
153
+ arg: { type: "variable-reference", name: "count" },
154
+ annotation: { type: "function-reference", name: "number", options: [] },
155
+ },
156
+ { type: "text", value: " views" },
157
+ ];
158
+ const { code } = compilePattern({
159
+ mode: "parts",
160
+ pattern,
161
+ declarations: [{ type: "input-variable", name: "count" }],
162
+ locale: "en",
163
+ });
164
+ expect(code).toBe('[{ type: "text", value: String(registry.number("en", i?.count, {})) }, { type: "text", value: " views" }]');
165
+ });
166
+ test("falls back to plain interpolation for unknown formatters", () => {
167
+ const pattern = [
168
+ {
169
+ type: "expression",
170
+ arg: { type: "variable-reference", name: "name" },
171
+ annotation: {
172
+ type: "function-reference",
173
+ name: "uppercase",
174
+ options: [],
175
+ },
176
+ },
177
+ ];
178
+ const { code } = compilePattern({
179
+ pattern,
180
+ declarations: [{ type: "input-variable", name: "name" }],
181
+ locale: "en",
182
+ });
183
+ expect(code).toBe("`${i?.name}`");
184
+ });
185
+ test("throws when a pattern annotation is compiled without a locale", () => {
186
+ const pattern = [
187
+ {
188
+ type: "expression",
189
+ arg: { type: "variable-reference", name: "count" },
190
+ annotation: { type: "function-reference", name: "number", options: [] },
191
+ },
192
+ ];
193
+ expect(() => compilePattern({
194
+ pattern,
195
+ declarations: [{ type: "input-variable", name: "count" }],
196
+ })).toThrow('requires a locale to compile the formatter "number"');
197
+ });
198
+ test("validates relativetime options on pattern annotations", () => {
199
+ const pattern = [
200
+ {
201
+ type: "expression",
202
+ arg: { type: "variable-reference", name: "days" },
203
+ annotation: {
204
+ type: "function-reference",
205
+ name: "relativetime",
206
+ options: [],
207
+ },
208
+ },
209
+ ];
210
+ expect(() => compilePattern({
211
+ pattern,
212
+ declarations: [{ type: "input-variable", name: "days" }],
213
+ locale: "en",
214
+ })).toThrow('The "relativetime" formatter requires a "unit" option.');
215
+ });
216
+ test("parts mode compiles text, markup, options and attributes", () => {
217
+ const pattern = [
218
+ { type: "text", value: "Read " },
219
+ {
220
+ type: "markup-start",
221
+ name: "link",
222
+ options: [
223
+ { name: "to", value: { type: "literal", value: "/docs" } },
224
+ {
225
+ name: "rel",
226
+ value: { type: "variable-reference", name: "relationship" },
227
+ },
228
+ ],
229
+ attributes: [
230
+ { name: "track", value: true },
231
+ { name: "variant", value: { type: "literal", value: "hero" } },
232
+ ],
233
+ },
234
+ { type: "text", value: "docs" },
235
+ {
236
+ type: "markup-end",
237
+ name: "link",
238
+ options: [{ name: "to", value: { type: "literal", value: "/docs" } }],
239
+ attributes: [{ name: "track", value: true }],
240
+ },
241
+ {
242
+ type: "markup-standalone",
243
+ name: "icon",
244
+ options: [{ name: "name", value: { type: "literal", value: "arrow" } }],
245
+ attributes: [{ name: "filled", value: true }],
246
+ },
247
+ ];
248
+ const { code } = compilePattern({
249
+ mode: "parts",
250
+ pattern,
251
+ declarations: [{ type: "input-variable", name: "relationship" }],
252
+ });
253
+ expect(code).toBe('[{ type: "text", value: "Read " }, { type: "markup-start", name: "link", options: { "to": "/docs", "rel": i?.relationship }, attributes: { "track": true, "variant": "hero" } }, { type: "text", value: "docs" }, { type: "markup-end", name: "link", options: { "to": "/docs" }, attributes: { "track": true } }, { type: "markup-standalone", name: "icon", options: { "name": "arrow" }, attributes: { "filled": true } }]');
254
+ });
255
+ //# sourceMappingURL=compile-pattern.test.js.map