@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":"middleware.test.js","sourceRoot":"","sources":["../../../src/compiler/server/middleware.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,IAAI,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;IAC7C,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC;QACrC,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QAC3B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3B,yBAAyB,EACxB,gEAAgE;aACjE;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAE1E,yEAAyE;IACzE,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE;QAC1E,OAAO,IAAI,QAAQ,CAAC,yCAAyC,EAAE;YAC9D,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;SACxC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;IACrD,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from \"vitest\";\nimport { createParaglide } from \"../create-paraglide.js\";\n\ntest(\"sets the locale and origin\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\tstrategy: [\"url\", \"globalVariable\"],\n\t});\n\n\t// setting the global variable to fr to assure that\n\truntime.setLocale(\"fr\");\n\n\t// simulating multiple requests that could interfere with each other\n\tawait Promise.all([\n\t\truntime.paraglideMiddleware(\n\t\t\tnew Request(new URL(\"https://example.com/page\"), {\n\t\t\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t\t\t}),\n\t\t\t() => {\n\t\t\t\texpect(runtime.getLocale()).toBe(\"en\");\n\t\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\t\t\treturn new Response();\n\t\t\t}\n\t\t),\n\t\truntime.paraglideMiddleware(\n\t\t\tnew Request(new URL(\"https://peter.com/de/page\"), {\n\t\t\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t\t\t}),\n\t\t\t() => {\n\t\t\t\texpect(runtime.getLocale()).toBe(\"de\");\n\t\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://peter.com\");\n\t\t\t\treturn new Response();\n\t\t\t}\n\t\t),\n\t]);\n\n\t// global variable is not impacted by middleware\n\texpect(runtime.getLocale()).toBe(\"fr\");\n});\n\ntest(\"delocalizes the url if the url strategy is used and returns the locale\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"url\"],\n\t});\n\n\tconst request = new Request(new URL(\"https://example.com/de/page\"), {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\tconst result = await runtime.paraglideMiddleware(request, (args) => {\n\t\texpect(args.locale).toBe(\"de\");\n\t\texpect(args.request.url).toBe(\"https://example.com/page\");\n\t\treturn new Response(\"Hello World\");\n\t});\n\n\texpect(await result.text()).toBe(\"Hello World\");\n});\n\ntest(\"does not delocalize the url if the url strategy is not used\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t});\n\n\tconst request = new Request(new URL(\"https://example.com/de/page\"), {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\tconst result = await runtime.paraglideMiddleware(request, (args) => {\n\t\texpect(args.locale).toBe(\"en\");\n\t\texpect(args.request.url).toBe(\"https://example.com/de/page\");\n\t\treturn new Response(\"Hello World\");\n\t});\n\n\texpect(await result.text()).toBe(\"Hello World\");\n});\n\ntest(\"skips i18n middleware behavior for excluded routeStrategies\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\trouteStrategies: [{ match: \"/api/:path(.*)?\", exclude: true }],\n\t});\n\n\tconst request = new Request(\"https://example.com/api/data\", {\n\t\theaders: {\n\t\t\tcookie: \"PARAGLIDE_LOCALE=fr\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\trequest,\n\t\t({ locale, request }) => new Response(`${locale}|${request.url}`)\n\t);\n\n\texpect(response.status).toBe(200);\n\texpect(await response.text()).toBe(\"en|https://example.com/api/data\");\n});\n\ntest(\"localized URLs still match routeStrategies after delocalization\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"url\", \"cookie\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\trouteStrategies: [\n\t\t\t{\n\t\t\t\tmatch: \"/dashboard/:path(.*)?\",\n\t\t\t\tstrategy: [\"cookie\", \"baseLocale\"],\n\t\t\t},\n\t\t\t{ match: \"/api/:path(.*)?\", exclude: true },\n\t\t],\n\t});\n\n\tconst dashboard = await runtime.paraglideMiddleware(\n\t\tnew Request(\"https://example.com/fr/dashboard\", {\n\t\t\theaders: { cookie: \"PARAGLIDE_LOCALE=en\" },\n\t\t}),\n\t\t({ locale }) => new Response(locale)\n\t);\n\texpect(await dashboard.text()).toBe(\"en\");\n\n\tconst api = await runtime.paraglideMiddleware(\n\t\tnew Request(\"https://example.com/fr/api/data\", {\n\t\t\theaders: { cookie: \"PARAGLIDE_LOCALE=fr\" },\n\t\t}),\n\t\t({ locale, request }) => new Response(`${locale}|${request.url}`)\n\t);\n\texpect(await api.text()).toBe(\"en|https://example.com/fr/api/data\");\n});\n\ntest(\"excluded routeStrategies keep request-scoped locale context and clone request when possible\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t\trouteStrategies: [{ match: \"/api/:path(.*)?\", exclude: true }],\n\t});\n\n\truntime.setLocale(\"fr\");\n\tconst originalRequest = new Request(\"https://example.com/api/data\", {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\toriginalRequest,\n\t\t({ locale, request }) => {\n\t\t\texpect(locale).toBe(\"en\");\n\t\t\texpect(runtime.getLocale()).toBe(\"en\");\n\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\t\texpect(request).not.toBe(originalRequest);\n\t\t\texpect(request.url).toBe(\"https://example.com/api/data\");\n\t\t\treturn new Response(\"ok\");\n\t\t}\n\t);\n\n\texpect(await response.text()).toBe(\"ok\");\n\texpect(runtime.getLocale()).toBe(\"fr\");\n});\n\ntest(\"excluded routeStrategies fall back to original request when cloning fails\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t\trouteStrategies: [{ match: \"/api/:path(.*)?\", exclude: true }],\n\t});\n\n\tconst customRequest = {\n\t\turl: \"https://example.com/api/data\",\n\t\theaders: new Headers({ \"Sec-Fetch-Dest\": \"document\" }),\n\t\tmethod: \"GET\",\n\t} as unknown as Request;\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\tcustomRequest,\n\t\t({ locale, request }) => {\n\t\t\texpect(locale).toBe(\"en\");\n\t\t\texpect(request).toBe(customRequest);\n\t\t\treturn new Response(\"ok\");\n\t\t}\n\t);\n\n\texpect(await response.text()).toBe(\"ok\");\n});\n\ntest(\"excluded routeStrategies preserve original request body readability\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t\trouteStrategies: [{ match: \"/api/:path(.*)?\", exclude: true }],\n\t});\n\n\tconst originalRequest = new Request(\"https://example.com/api/data\", {\n\t\tmethod: \"POST\",\n\t\tbody: \"hello=world\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\toriginalRequest,\n\t\tasync ({ request }) => {\n\t\t\texpect(await request.text()).toBe(\"hello=world\");\n\t\t\treturn new Response(\"ok\");\n\t\t}\n\t);\n\n\texpect(await response.text()).toBe(\"ok\");\n\texpect(await originalRequest.text()).toBe(\"hello=world\");\n});\n\ntest(\"routeStrategies layering is first-match-wins when exclude comes first\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\trouteStrategies: [\n\t\t\t{ match: \"/api/:path(.*)?\", exclude: true },\n\t\t\t{ match: \"/api/:path(.*)?\", strategy: [\"cookie\", \"baseLocale\"] },\n\t\t],\n\t});\n\n\tconst request = new Request(\"https://example.com/api/data\", {\n\t\theaders: {\n\t\t\tcookie: \"PARAGLIDE_LOCALE=fr\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\trequest,\n\t\t({ locale, request }) => new Response(`${locale}|${request.url}`)\n\t);\n\n\texpect(response.status).toBe(200);\n\texpect(await response.text()).toBe(\"en|https://example.com/api/data\");\n});\n\ntest(\"routeStrategies layering is first-match-wins when strategy comes first\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\trouteStrategies: [\n\t\t\t{ match: \"/api/:path(.*)?\", strategy: [\"cookie\", \"baseLocale\"] },\n\t\t\t{ match: \"/api/:path(.*)?\", exclude: true },\n\t\t],\n\t});\n\n\tconst request = new Request(\"https://example.com/api/data\", {\n\t\theaders: {\n\t\t\tcookie: \"PARAGLIDE_LOCALE=fr\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\trequest,\n\t\t({ locale, request }) => new Response(`${locale}|${request.url}`)\n\t);\n\n\texpect(response.status).toBe(200);\n\texpect(await response.text()).toBe(\"fr|https://example.com/api/data\");\n});\n\ntest(\"redirects to localized URL when non-URL strategy determines locale\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request to URL in en with cookie specifying French\n\tconst request = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(request, () => {\n\t\t// This shouldn't be called since we should redirect\n\t\tthrow new Error(\"Should not reach here\");\n\t});\n\n\texpect(response instanceof Response).toBe(true);\n\t// needs to be 307 status code https://github.com/opral/inlang-paraglide-js/issues/416\n\texpect(response.status).toBe(307); // Redirect status code\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n});\n\ntest(\"call onRedirect callback when redirecting to new url\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request to URL in en with cookie specifying French\n\tconst request = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tlet response: any;\n\n\tawait runtime.paraglideMiddleware(\n\t\trequest,\n\t\t() => {\n\t\t\t// This shouldn't be called since we should redirect\n\t\t\tthrow new Error(\"Should not reach here\");\n\t\t},\n\t\t{\n\t\t\tonRedirect: (res: Response) => {\n\t\t\t\tresponse = res;\n\t\t\t},\n\t\t}\n\t);\n\n\texpect(response instanceof Response).toBe(true);\n\t// needs to be 307 status code https://github.com/opral/inlang-paraglide-js/issues/416\n\texpect(response.status).toBe(307); // Redirect status code\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n});\n\ntest(\"uses the provided public url for redirects behind a proxy\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\tconst request = new Request(\"http://internal.example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\trequest,\n\t\t() => {\n\t\t\tthrow new Error(\"Should not reach here\");\n\t\t},\n\t\t{\n\t\t\teffectiveRequestUrl: \"https://example.com/en/some-path\",\n\t\t}\n\t);\n\n\texpect(response.status).toBe(307);\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n});\n\ntest(\"uses the provided public url for callback request and origin\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"url\", \"baseLocale\"],\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\tconst request = new Request(\"http://internal.example.com/fr/some-path\", {\n\t\theaders: {\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(\n\t\trequest,\n\t\t({ request }) => {\n\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\t\treturn new Response(request.url);\n\t\t},\n\t\t{\n\t\t\teffectiveRequestUrl: \"https://example.com/fr/some-path\",\n\t\t}\n\t);\n\n\texpect(await response.text()).toBe(\"https://example.com/some-path\");\n});\n\ntest(\"sets Vary: Accept-Language header when preferredLanguage strategy is used and redirect occurs\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"preferredLanguage\", \"url\"],\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request with Accept-Language header preferring French\n\tconst request = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\t\"Accept-Language\": \"fr,en;q=0.8\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(request, () => {\n\t\t// This shouldn't be called since we should redirect\n\t\tthrow new Error(\"Should not reach here\");\n\t});\n\n\texpect(response instanceof Response).toBe(true);\n\texpect(response.status).toBe(307); // Redirect status code\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n\t// Should have Vary header when preferredLanguage strategy is used\n\texpect(response.headers.get(\"Vary\")).toBe(\"Accept-Language\");\n});\n\ntest(\"does not set Vary header when preferredLanguage strategy is not used\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request with cookie specifying French\n\tconst request = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst response = await runtime.paraglideMiddleware(request, () => {\n\t\t// This shouldn't be called since we should redirect\n\t\tthrow new Error(\"Should not reach here\");\n\t});\n\n\texpect(response instanceof Response).toBe(true);\n\texpect(response.status).toBe(307); // Redirect status code\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n\t// Should NOT have Vary header when preferredLanguage strategy is not used\n\texpect(response.headers.get(\"Vary\")).toBe(null);\n});\n\ntest(\"does not call onRedirect callback when there is no redirecting\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request to URL in en with cookie specifying French\n\tconst request = new Request(\"https://example.com/fr/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tlet response: any = null;\n\n\tawait runtime.paraglideMiddleware(\n\t\trequest,\n\t\t() => {\n\t\t\treturn new Response(\"Hello World\");\n\t\t},\n\t\t{\n\t\t\tonRedirect: (res: Response) => {\n\t\t\t\tresponse = res;\n\t\t\t},\n\t\t}\n\t);\n\n\texpect(response).toBe(null);\n});\n\ntest(\"does not redirect if URL already matches determined locale\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request to already localized URL matching cookie locale\n\tconst request = new Request(\"https://example.com/fr/some-path\", {\n\t\theaders: {\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t},\n\t});\n\n\tlet middlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(request, () => {\n\t\tmiddlewareResolveWasCalled = true;\n\t\treturn new Response();\n\t});\n\n\texpect(middlewareResolveWasCalled).toBe(true); // Middleware should be called since no redirect needed\n});\n\ntest(\"works with disableAsyncLocalStorage option\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\tstrategy: [\"url\", \"globalVariable\"],\n\t\tdisableAsyncLocalStorage: true,\n\t});\n\n\t// Set a global locale to verify it doesn't interfere with request processing\n\truntime.setLocale(\"fr\");\n\n\t// Create a request with a \"de\" locale in the URL\n\tconst request = new Request(new URL(\"https://example.com/de/page\"), {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\t// Process the request with AsyncLocalStorage disabled\n\tconst response = await runtime.paraglideMiddleware(request, (args) => {\n\t\t// Verify we still get the correct locale\n\t\texpect(args.locale).toBe(\"de\");\n\t\texpect(runtime.getLocale()).toBe(\"de\");\n\t\t// Verify URL is still properly delocalized\n\t\texpect(args.request.url).toBe(\"https://example.com/page\");\n\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\treturn new Response(\"hello\");\n\t});\n\n\t// Verify the result contains the correct data\n\texpect(await response.text()).toBe(\"hello\");\n\n\t// Verify that global variable wasn't affected by this request\n\texpect(runtime.getLocale()).toBe(\"fr\");\n});\n\ntest(\"works with sequential parallel requests using disableAsyncLocalStorage\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\tstrategy: [\"url\", \"globalVariable\"],\n\t});\n\n\t// setting the global variable to fr to assure that\n\truntime.setLocale(\"fr\");\n\n\t// simulating multiple requests that could interference with each other\n\tawait Promise.all([\n\t\truntime.paraglideMiddleware(\n\t\t\tnew Request(new URL(\"https://example.com/page\"), {\n\t\t\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t\t\t}),\n\t\t\t() => {\n\t\t\t\texpect(runtime.getLocale()).toBe(\"en\");\n\t\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\t\t\treturn new Response();\n\t\t\t}\n\t\t),\n\n\t\truntime.paraglideMiddleware(\n\t\t\tnew Request(new URL(\"https://peter.com/de/page\"), {\n\t\t\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t\t\t}),\n\t\t\t() => {\n\t\t\t\texpect(runtime.getLocale()).toBe(\"de\");\n\t\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://peter.com\");\n\t\t\t\treturn new Response();\n\t\t\t}\n\t\t),\n\t]);\n\n\t// global variable is not impacted by middleware\n\texpect(runtime.getLocale()).toBe(\"fr\");\n});\n\n// https://github.com/opral/inlang-paraglide-js/issues/442\ntest(\"falls back to next strategy when cookie contains invalid locale\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Request with an invalid locale in cookie\n\tconst request = new Request(\"https://example.com/fr/some-path\", {\n\t\theaders: {\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t\tcookie: `PARAGLIDE_LOCALE=invalid_locale`,\n\t\t},\n\t});\n\n\tlet middlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(request, (args) => {\n\t\tmiddlewareResolveWasCalled = true;\n\t\t// Should fall back to URL strategy, which will detect 'fr' from the URL\n\t\texpect(args.locale).toBe(\"fr\");\n\t\treturn new Response();\n\t});\n\n\texpect(middlewareResolveWasCalled).toBe(true);\n\n\t// Try with a request that would fall back to baseLocale\n\tconst baseRequest = new Request(\"https://example.com/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=invalid_locale`,\n\t\t},\n\t});\n\n\tawait runtime.paraglideMiddleware(baseRequest, (args) => {\n\t\t// Should fall back all the way to baseLocale since URL has no locale\n\t\texpect(args.locale).toBe(\"en\");\n\t\treturn new Response();\n\t});\n});\n\n// can likely be removed once the default url pattern polyfill workaround is removed\n// because URLPattern seems to be handling this correctly\ntest(\"prevents redirect loops by normalizing URLs with trailing slashes in different scenarios\", async () => {\n\t// Create two different runtimes to test different strategy configurations\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// SCENARIO 1: Basic trailing slash normalization with cookie strategy\n\n\t// Case 1A: Request URL has trailing slash, but localized URL might not\n\tconst requestWithTrailingSlash = new Request(\"https://example.com/fr/page/\", {\n\t\theaders: {\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t},\n\t});\n\n\tlet response = await runtime.paraglideMiddleware(\n\t\trequestWithTrailingSlash,\n\t\t() => {\n\t\t\treturn new Response(\"No redirect needed\");\n\t\t}\n\t);\n\n\t// Middleware should be called (no redirect) because normalized URLs match\n\texpect(response.status).toBe(200);\n\texpect(await response.text()).toBe(\"No redirect needed\");\n\n\t// Case 1B: Request URL has no trailing slash, but localized URL might\n\tconst requestWithoutTrailingSlash = new Request(\n\t\t\"https://example.com/fr/page\",\n\t\t{\n\t\t\theaders: {\n\t\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t},\n\t\t}\n\t);\n\n\tresponse = await runtime.paraglideMiddleware(\n\t\trequestWithoutTrailingSlash,\n\t\t() => {\n\t\t\treturn new Response(\"No redirect needed\");\n\t\t}\n\t);\n\n\texpect(response.status).toBe(200);\n\n\t// Case 1C: redirect wanted because cookie is set to fr but url is en\n\tconst requestDifferentPath = new Request(\n\t\t\"https://example.com/en/different-page\",\n\t\t{\n\t\t\theaders: {\n\t\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t},\n\t\t}\n\t);\n\n\tresponse = await runtime.paraglideMiddleware(requestDifferentPath, () => {\n\t\t// This shouldn't be called since we should redirect\n\t\tthrow new Error(\"Should not reach here\");\n\t});\n\n\t// Should redirect to fr version\n\texpect(response.status).toBe(307);\n\texpect(response.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/different-page\"\n\t);\n});\n\n// not implemented because users should disable redirects by\n// making another strategy preceed the url strategy\n//\n// strategy: [\"cookie\", \"url\"]\ntest.skip(\"doesn't redirect if disableUrlRedirect is true\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Create a request that would normally be redirected\n\tconst request = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\t// Test with disableUrlRedirect = true\n\tlet middlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(\n\t\trequest,\n\t\t() => {\n\t\t\tmiddlewareResolveWasCalled = true;\n\t\t\treturn new Response(\"No redirect\");\n\t\t}\n\t\t// { disableUrlRedirect: true }\n\t);\n\n\t// Middleware should be called since redirect is disabled\n\texpect(middlewareResolveWasCalled).toBe(true);\n});\n\ntest(\"only redirects if the request.headers.get('Sec-Fetch-Dest') === 'document'\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"cookie\", \"url\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t\turlPatterns: [\n\t\t\t{\n\t\t\t\tpattern: \"https://example.com/:path(.*)?\",\n\t\t\t\tlocalized: [\n\t\t\t\t\t[\"en\", \"https://example.com/en/:path(.*)?\"],\n\t\t\t\t\t[\"fr\", \"https://example.com/fr/:path(.*)?\"],\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t});\n\n\t// Test with Sec-Fetch-Dest = document (should redirect)\n\tconst documentRequest = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tconst documentResponse = await runtime.paraglideMiddleware(\n\t\tdocumentRequest,\n\t\t() => {\n\t\t\t// This shouldn't be called since we should redirect\n\t\t\tthrow new Error(\"Should not reach here\");\n\t\t}\n\t);\n\n\t// Should redirect to fr version\n\texpect(documentResponse instanceof Response).toBe(true);\n\texpect(documentResponse.status).toBe(307);\n\texpect(documentResponse.headers.get(\"Location\")).toBe(\n\t\t\"https://example.com/fr/some-path\"\n\t);\n\n\t// Test with Sec-Fetch-Dest = empty (should not redirect)\n\tconst apiRequest = new Request(\"https://example.com/en/some-path\", {\n\t\theaders: {\n\t\t\tcookie: `PARAGLIDE_LOCALE=fr`,\n\t\t\t// No Sec-Fetch-Dest header or set to something other than \"document\"\n\t\t\t\"Sec-Fetch-Dest\": \"empty\",\n\t\t},\n\t});\n\n\tlet apiMiddlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(apiRequest, () => {\n\t\tapiMiddlewareResolveWasCalled = true;\n\t\treturn new Response(\"API response\");\n\t});\n\n\t// Middleware should be called since no redirect for API requests\n\texpect(apiMiddlewareResolveWasCalled).toBe(true);\n});\n\n// https://github.com/opral/inlang-paraglide-js/issues/477\ntest(\"does not catch errors thrown by downstream resolve call\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\"],\n\t\tstrategy: [\"url\"],\n\t});\n\n\tawait expect(() =>\n\t\truntime.paraglideMiddleware(\n\t\t\tnew Request(new URL(\"https://example.com/page\"), {\n\t\t\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t\t\t}),\n\t\t\t() => {\n\t\t\t\tthrow new Error(\"Downstream error\");\n\t\t\t}\n\t\t)\n\t).rejects.toThrow();\n});\n\ntest(\"middleware supports async custom server strategies\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\", \"de\"],\n\t\tstrategy: [\"custom-database\", \"baseLocale\"],\n\t});\n\n\t// Mock an async custom strategy that simulates a database call\n\tlet databaseCallCount = 0;\n\truntime.defineCustomServerStrategy(\"custom-database\", {\n\t\tgetLocale: async (request) => {\n\t\t\tdatabaseCallCount++;\n\t\t\t// Simulate async database call delay\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\n\t\t\t// Extract user ID from a custom header (simulating authentication)\n\t\t\tif (!request) return undefined;\n\t\t\tconst userId = request.headers.get(\"X-User-ID\");\n\t\t\tif (userId === \"user123\") {\n\t\t\t\treturn \"fr\";\n\t\t\t}\n\t\t\tif (userId === \"user456\") {\n\t\t\t\treturn \"de\";\n\t\t\t}\n\t\t\treturn undefined; // No user preference found\n\t\t},\n\t});\n\n\t// Test 1: Request with user preference\n\tconst requestWithUserPref = new Request(\"https://example.com/page\", {\n\t\theaders: {\n\t\t\t\"X-User-ID\": \"user123\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tlet middlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(requestWithUserPref, (args) => {\n\t\tmiddlewareResolveWasCalled = true;\n\t\texpect(args.locale).toBe(\"fr\"); // Should get locale from async custom strategy\n\t\treturn new Response(\"User preference locale\");\n\t});\n\n\texpect(middlewareResolveWasCalled).toBe(true);\n\texpect(databaseCallCount).toBe(1);\n\n\t// Test 2: Request with different user preference\n\tconst requestWithOtherUser = new Request(\"https://example.com/page\", {\n\t\theaders: {\n\t\t\t\"X-User-ID\": \"user456\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tawait runtime.paraglideMiddleware(requestWithOtherUser, (args) => {\n\t\texpect(args.locale).toBe(\"de\"); // Should get different locale\n\t\treturn new Response(\"Other user preference\");\n\t});\n\n\texpect(databaseCallCount).toBe(2);\n});\n\ntest(\"middleware falls back to other strategies when async custom strategy returns undefined\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\", \"de\"],\n\t\tstrategy: [\"custom-database\", \"cookie\", \"baseLocale\"],\n\t\tcookieName: \"PARAGLIDE_LOCALE\",\n\t});\n\n\t// Mock async custom strategy that returns undefined for unknown users\n\truntime.defineCustomServerStrategy(\"custom-database\", {\n\t\tgetLocale: async (request) => {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5));\n\t\t\tif (!request) return undefined;\n\t\t\tconst userId = request.headers.get(\"X-User-ID\");\n\t\t\t// Only return locale for known users\n\t\t\tif (userId === \"known-user\") {\n\t\t\t\treturn \"fr\";\n\t\t\t}\n\t\t\treturn undefined; // Unknown user, fallback to other strategies\n\t\t},\n\t});\n\n\t// Request from unknown user with cookie fallback\n\tconst request = new Request(\"https://example.com/page\", {\n\t\theaders: {\n\t\t\t\"X-User-ID\": \"unknown-user\",\n\t\t\tcookie: \"PARAGLIDE_LOCALE=de\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tlet middlewareResolveWasCalled = false;\n\tawait runtime.paraglideMiddleware(request, (args) => {\n\t\tmiddlewareResolveWasCalled = true;\n\t\texpect(args.locale).toBe(\"de\"); // Should fallback to cookie strategy\n\t\treturn new Response(\"Fallback locale\");\n\t});\n\n\texpect(middlewareResolveWasCalled).toBe(true);\n});\n\ntest(\"middleware handles async custom strategy errors gracefully\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\"],\n\t\tstrategy: [\"custom-database\", \"baseLocale\"],\n\t});\n\n\t// Mock async custom strategy that throws an error\n\truntime.defineCustomServerStrategy(\"custom-database\", {\n\t\tgetLocale: async () => {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5));\n\t\t\tthrow new Error(\"Database connection failed\");\n\t\t},\n\t});\n\n\tconst request = new Request(\"https://example.com/page\", {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\t// The middleware should handle the error and not crash\n\tawait expect(\n\t\truntime.paraglideMiddleware(request, (args) => {\n\t\t\t// If we reach here, the error was handled and fallback worked\n\t\t\texpect(args.locale).toBe(\"en\"); // Should fallback to baseLocale\n\t\t\treturn new Response(\"Error handled\");\n\t\t})\n\t).rejects.toThrow(\"Database connection failed\");\n});\n\n// https://github.com/opral/paraglide-js/issues/573\ntest(\"falls back to original request when cloning fails (e.g., TanStack Start custom Request)\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\t// Using a strategy that doesn't include \"url\" to trigger the clone path\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t});\n\n\t// Create a custom request-like object that cannot be cloned\n\t// This simulates TanStack Start's custom Request implementation\n\tconst customRequest = {\n\t\turl: \"https://example.com/page\",\n\t\theaders: new Headers({ \"Sec-Fetch-Dest\": \"document\" }),\n\t\tmethod: \"GET\",\n\t\t// Missing other required properties that would cause `new Request(request)` to fail\n\t} as unknown as Request;\n\n\tlet middlewareResolveWasCalled = false;\n\tconst response = await runtime.paraglideMiddleware(customRequest, (args) => {\n\t\tmiddlewareResolveWasCalled = true;\n\t\texpect(args.locale).toBe(\"en\");\n\t\t// The request should be the original custom request since cloning failed\n\t\texpect(args.request).toBe(customRequest);\n\t\treturn new Response(\"Success\");\n\t});\n\n\texpect(middlewareResolveWasCalled).toBe(true);\n\texpect(await response.text()).toBe(\"Success\");\n});\n\n// https://github.com/opral/paraglide-js/issues/652\ntest(\"falls back to original request when cloning a rewritten request fails\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t});\n\n\tconst customRequest = {\n\t\turl: \"http://internal.example.com/page\",\n\t\theaders: new Headers({ \"Sec-Fetch-Dest\": \"document\" }),\n\t\tmethod: \"GET\",\n\t} as unknown as Request;\n\n\tconst NativeRequest = globalThis.Request;\n\tObject.defineProperty(globalThis, \"Request\", {\n\t\tvalue: class extends NativeRequest {\n\t\t\tconstructor(input: RequestInfo | URL, init?: RequestInit) {\n\t\t\t\tif (\n\t\t\t\t\t(typeof input === \"string\" && input === \"https://example.com/page\") ||\n\t\t\t\t\t(input instanceof URL && input.href === \"https://example.com/page\")\n\t\t\t\t) {\n\t\t\t\t\tthrow new TypeError(\"Simulated rewritten request clone failure\");\n\t\t\t\t}\n\t\t\t\tsuper(input, init);\n\t\t\t}\n\t\t},\n\t\tconfigurable: true,\n\t\twritable: true,\n\t});\n\n\ttry {\n\t\tlet middlewareResolveWasCalled = false;\n\t\tconst response = await runtime.paraglideMiddleware(\n\t\t\tcustomRequest,\n\t\t\t(args) => {\n\t\t\t\tmiddlewareResolveWasCalled = true;\n\t\t\t\texpect(args.locale).toBe(\"en\");\n\t\t\t\texpect(runtime.getUrlOrigin()).toBe(\"https://example.com\");\n\t\t\t\texpect(args.request).toBe(customRequest);\n\t\t\t\texpect(args.request.url).toBe(\"http://internal.example.com/page\");\n\t\t\t\treturn new Response(\"Success\");\n\t\t\t},\n\t\t\t{\n\t\t\t\teffectiveRequestUrl: \"https://example.com/page\",\n\t\t\t}\n\t\t);\n\n\t\texpect(middlewareResolveWasCalled).toBe(true);\n\t\texpect(await response.text()).toBe(\"Success\");\n\t} finally {\n\t\tObject.defineProperty(globalThis, \"Request\", {\n\t\t\tvalue: NativeRequest,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t});\n\t}\n});\n\ntest(\"middleware works with multiple async custom strategies\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"fr\", \"de\", \"es\"],\n\t\tstrategy: [\"custom-userPref\", \"custom-region\", \"baseLocale\"],\n\t});\n\n\tlet userPrefCallCount = 0;\n\tlet regionCallCount = 0;\n\n\t// First strategy: user preference\n\truntime.defineCustomServerStrategy(\"custom-userPref\", {\n\t\tgetLocale: async (request) => {\n\t\t\tuserPrefCallCount++;\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5));\n\t\t\tif (!request) return undefined;\n\t\t\tconst userId = request.headers.get(\"X-User-ID\");\n\t\t\treturn userId === \"premium-user\" ? \"fr\" : undefined;\n\t\t},\n\t});\n\n\t// Second strategy: region detection\n\truntime.defineCustomServerStrategy(\"custom-region\", {\n\t\tgetLocale: async (request) => {\n\t\t\tregionCallCount++;\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5));\n\t\t\tif (!request) return undefined;\n\t\t\tconst region = request.headers.get(\"X-Region\");\n\t\t\treturn region === \"europe\" ? \"de\" : undefined;\n\t\t},\n\t});\n\n\t// Test 1: First strategy succeeds\n\tconst premiumUserRequest = new Request(\"https://example.com/page\", {\n\t\theaders: {\n\t\t\t\"X-User-ID\": \"premium-user\",\n\t\t\t\"X-Region\": \"europe\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tawait runtime.paraglideMiddleware(premiumUserRequest, (args) => {\n\t\texpect(args.locale).toBe(\"fr\"); // Should use first strategy result\n\t\treturn new Response(\"Premium user\");\n\t});\n\n\texpect(userPrefCallCount).toBe(1);\n\t// Second strategy should not be called since first one succeeded\n\texpect(regionCallCount).toBe(0);\n\n\t// Test 2: First strategy fails, second succeeds\n\tconst regionalUserRequest = new Request(\"https://example.com/page\", {\n\t\theaders: {\n\t\t\t\"X-User-ID\": \"regular-user\",\n\t\t\t\"X-Region\": \"europe\",\n\t\t\t\"Sec-Fetch-Dest\": \"document\",\n\t\t},\n\t});\n\n\tawait runtime.paraglideMiddleware(regionalUserRequest, (args) => {\n\t\texpect(args.locale).toBe(\"de\"); // Should use second strategy result\n\t\treturn new Response(\"Regional user\");\n\t});\n\n\texpect(userPrefCallCount).toBe(2);\n\texpect(regionCallCount).toBe(1);\n});\n\ntest(\"injected script reuses the Content-Security-Policy nonce when present and omits it otherwise\", async () => {\n\tconst runtime = await createParaglide({\n\t\tbaseLocale: \"en\",\n\t\tlocales: [\"en\", \"de\"],\n\t\tstrategy: [\"globalVariable\", \"baseLocale\"],\n\t\texperimentalMiddlewareLocaleSplitting: true,\n\t});\n\n\tconst request = new Request(new URL(\"https://example.com/page\"), {\n\t\theaders: { \"Sec-Fetch-Dest\": \"document\" },\n\t});\n\n\t// With a CSP nonce -> the injected script reuses it.\n\tconst responseWithCsp = await runtime.paraglideMiddleware(request, () => {\n\t\treturn new Response(\"<html><head></head><body></body></html>\", {\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"text/html\",\n\t\t\t\t\"Content-Security-Policy\":\n\t\t\t\t\t\"default-src 'self'; script-src 'nonce-abc123' 'strict-dynamic'\",\n\t\t\t},\n\t\t});\n\t});\n\texpect(await responseWithCsp.text()).toContain('<script nonce=\"abc123\">');\n\n\t// Without a CSP header -> the script is still injected, without a nonce.\n\tconst responseWithoutCsp = await runtime.paraglideMiddleware(request, () => {\n\t\treturn new Response(\"<html><head></head><body></body></html>\", {\n\t\t\theaders: { \"Content-Type\": \"text/html\" },\n\t\t});\n\t});\n\tconst html = await responseWithoutCsp.text();\n\texpect(html).toContain(\"globalThis.__paraglide.ssr\");\n\texpect(html).not.toContain(\"nonce=\");\n});\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The Paraglide runtime API.
3
+ */
4
+ export type ServerRuntime = {
5
+ paraglideMiddleware: typeof import("./middleware.js").paraglideMiddleware;
6
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/compiler/server/type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,mBAAmB,EAAE,cAAc,iBAAiB,EAAE,mBAAmB,CAAC;CAC1E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/compiler/server/type.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The Paraglide runtime API.\n */\nexport type ServerRuntime = {\n\tparaglideMiddleware: typeof import(\"./middleware.js\").paraglideMiddleware;\n};\n"]}
@@ -0,0 +1,30 @@
1
+ import type { BundleNested, ParaglideSettings } from "../messages/ast.js";
2
+ import { createBundleNested } from "../messages/create-bundle-nested.js";
3
+ export declare function testMessageFilePath(locale: string, pattern?: string): string;
4
+ export declare const defaultTestSettings: ParaglideSettings;
5
+ export declare function compileProjectInput(args: {
6
+ bundles?: BundleNested[];
7
+ settings?: ParaglideSettings;
8
+ }): {
9
+ bundles: BundleNested[];
10
+ settings: ParaglideSettings;
11
+ };
12
+ export { createBundleNested };
13
+ export declare function createTestFsWithMessages(args: {
14
+ messages?: Record<string, Record<string, unknown>>;
15
+ pathPattern?: string;
16
+ cwd?: string;
17
+ }): typeof import("node:fs");
18
+ export declare const defaultCompileOptions: {
19
+ messages: string;
20
+ locales: string[];
21
+ baseLocale: string;
22
+ outdir: string;
23
+ };
24
+ export declare function createPluginTestFs(): typeof import("node:fs");
25
+ export declare const defaultPluginCompileOptions: {
26
+ messages: string;
27
+ locales: string[];
28
+ baseLocale: string;
29
+ outdir: string;
30
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/compiler/test-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,SAA6B,UAGpC;AAED,eAAO,MAAM,mBAAmB,EAAE,iBAGjC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACzC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC7B;IAEC,OAAO;IACP,QAAQ;EAET;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GAS4C,cAAc,SAAS,CAAC,CACpE;AAED,eAAO,MAAM,qBAAqB;IACjC,QAAQ;IACR,OAAO,EAAkB,MAAM,EAAE;IACjC,UAAU;IACV,MAAM;CACN,CAAC;AAEF,wBAAgB,kBAAkB,6BAQjC;AAED,eAAO,MAAM,2BAA2B;IACvC,QAAQ;IACR,OAAO,EAAwB,MAAM,EAAE;IACvC,UAAU;IACV,MAAM;CACN,CAAC"}
@@ -0,0 +1,50 @@
1
+ import path from "node:path";
2
+ import { createBundleNested } from "../messages/create-bundle-nested.js";
3
+ import { memfs } from "memfs";
4
+ export function testMessageFilePath(locale, pattern = "./messages/{locale}.json") {
5
+ return path.resolve(process.cwd(), pattern.replace("{locale}", locale));
6
+ }
7
+ export const defaultTestSettings = {
8
+ baseLocale: "en",
9
+ locales: ["en", "de"],
10
+ };
11
+ export function compileProjectInput(args) {
12
+ return {
13
+ bundles: args.bundles ?? [],
14
+ settings: args.settings ?? defaultTestSettings,
15
+ };
16
+ }
17
+ export { createBundleNested };
18
+ export function createTestFsWithMessages(args) {
19
+ const pathPattern = args.pathPattern ?? "./messages/{locale}.json";
20
+ const cwd = args.cwd ?? process.cwd();
21
+ const fsObj = {};
22
+ for (const [locale, messages] of Object.entries(args.messages ?? {})) {
23
+ const relativePath = pathPattern.replace("{locale}", locale);
24
+ const absolutePath = path.resolve(cwd, relativePath);
25
+ fsObj[absolutePath] = JSON.stringify(messages, null, 2) + "\n";
26
+ }
27
+ return memfs({ ...fsObj }).fs;
28
+ }
29
+ export const defaultCompileOptions = {
30
+ messages: "./messages/{locale}.json",
31
+ locales: ["en", "de"],
32
+ baseLocale: "en",
33
+ outdir: "./src/paraglide",
34
+ };
35
+ export function createPluginTestFs() {
36
+ return createTestFsWithMessages({
37
+ messages: {
38
+ en: { hello: "Hello" },
39
+ de: { hello: "Hallo" },
40
+ fr: { hello: "Bonjour" },
41
+ },
42
+ });
43
+ }
44
+ export const defaultPluginCompileOptions = {
45
+ messages: "./messages/{locale}.json",
46
+ locales: ["en", "de", "fr"],
47
+ baseLocale: "en",
48
+ outdir: "/test-output",
49
+ };
50
+ //# sourceMappingURL=test-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/compiler/test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,UAAU,mBAAmB,CAClC,MAAc,EACd,OAAO,GAAG,0BAA0B;IAEpC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACrD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,IAGnC;IACA,OAAO;QACN,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,mBAAmB;KAC9C,CAAC;AACH,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,MAAM,UAAU,wBAAwB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AAI,CAAa;IACvC,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,cAAc;CACtB,CAAC","sourcesContent":["import path from \"node:path\";\nimport type { BundleNested, ParaglideSettings } from \"../messages/ast.js\";\nimport { createBundleNested } from \"../messages/create-bundle-nested.js\";\nimport { memfs } from \"memfs\";\n\nexport function testMessageFilePath(\n\tlocale: string,\n\tpattern = \"./messages/{locale}.json\"\n) {\n\treturn path.resolve(process.cwd(), pattern.replace(\"{locale}\", locale));\n}\n\nexport const defaultTestSettings: ParaglideSettings = {\n\tbaseLocale: \"en\",\n\tlocales: [\"en\", \"de\"],\n};\n\nexport function compileProjectInput(args: {\n\tbundles?: BundleNested[];\n\tsettings?: ParaglideSettings;\n}) {\n\treturn {\n\t\tbundles: args.bundles ?? [],\n\t\tsettings: args.settings ?? defaultTestSettings,\n\t};\n}\n\nexport { createBundleNested };\n\nexport function createTestFsWithMessages(args: {\n\tmessages?: Record<string, Record<string, unknown>>;\n\tpathPattern?: string;\n\tcwd?: string;\n}) {\n\tconst pathPattern = args.pathPattern ?? \"./messages/{locale}.json\";\n\tconst cwd = args.cwd ?? process.cwd();\n\tconst fsObj: Record<string, string> = {};\n\tfor (const [locale, messages] of Object.entries(args.messages ?? {})) {\n\t\tconst relativePath = pathPattern.replace(\"{locale}\", locale);\n\t\tconst absolutePath = path.resolve(cwd, relativePath);\n\t\tfsObj[absolutePath] = JSON.stringify(messages, null, 2) + \"\\n\";\n\t}\n\treturn memfs({ ...fsObj }).fs as unknown as typeof import(\"node:fs\");\n}\n\nexport const defaultCompileOptions = {\n\tmessages: \"./messages/{locale}.json\",\n\tlocales: [\"en\", \"de\"] as string[],\n\tbaseLocale: \"en\",\n\toutdir: \"./src/paraglide\",\n};\n\nexport function createPluginTestFs() {\n\treturn createTestFsWithMessages({\n\t\tmessages: {\n\t\t\ten: { hello: \"Hello\" },\n\t\t\tde: { hello: \"Hallo\" },\n\t\t\tfr: { hello: \"Bonjour\" },\n\t\t},\n\t});\n}\n\nexport const defaultPluginCompileOptions = {\n\tmessages: \"./messages/{locale}.json\",\n\tlocales: [\"en\", \"de\", \"fr\"] as string[],\n\tbaseLocale: \"en\",\n\toutdir: \"/test-output\",\n};\n"]}
@@ -0,0 +1,7 @@
1
+ export type Compiled<Node> = {
2
+ /** The original AST node */
3
+ node: Node;
4
+ /** The code generated to implement the AST node */
5
+ code: string;
6
+ };
7
+ export type { LocalizedString, MessageMarkupOption, MessageMarkupAttribute, MessageMarkupOptions, MessageMarkupAttributes, MessageMarkupTag, MessageMarkupSchema, MessageMetadata, MessagePart, MessageFunction, MessageBundleFunction, } from "./runtime/type-definitions.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compiler/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,IAAI,IAAI;IAC5B,4BAA4B;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,YAAY,EACX,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,eAAe,EACf,qBAAqB,GACrB,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/compiler/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Compiled<Node> = {\n\t/** The original AST node */\n\tnode: Node;\n\t/** The code generated to implement the AST node */\n\tcode: string;\n};\n\nexport type {\n\tLocalizedString,\n\tMessageMarkupOption,\n\tMessageMarkupAttribute,\n\tMessageMarkupOptions,\n\tMessageMarkupAttributes,\n\tMessageMarkupTag,\n\tMessageMarkupSchema,\n\tMessageMetadata,\n\tMessagePart,\n\tMessageFunction,\n\tMessageBundleFunction,\n} from \"./runtime/type-definitions.js\";\n"]}
@@ -0,0 +1,3 @@
1
+ export declare function isValidIdentifier(name: string): boolean;
2
+ export declare function quotePropertyKey(name: string): string;
3
+ export declare function compileInputAccess(name: string): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variable-access.d.ts","sourceRoot":"","sources":["../../src/compiler/variable-access.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKvD"}
@@ -0,0 +1,15 @@
1
+ import { escapeForDoubleQuoteString } from "../services/codegen/escape.js";
2
+ const identifierPattern = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
3
+ export function isValidIdentifier(name) {
4
+ return identifierPattern.test(name);
5
+ }
6
+ export function quotePropertyKey(name) {
7
+ return `"${escapeForDoubleQuoteString(name)}"`;
8
+ }
9
+ export function compileInputAccess(name) {
10
+ if (isValidIdentifier(name)) {
11
+ return `i?.${name}`;
12
+ }
13
+ return `i?.[${quotePropertyKey(name)}]`;
14
+ }
15
+ //# sourceMappingURL=variable-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variable-access.js","sourceRoot":"","sources":["../../src/compiler/variable-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAEvD,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC7C,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,GAAG,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,MAAM,IAAI,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC,CAAC","sourcesContent":["import { escapeForDoubleQuoteString } from \"../services/codegen/escape.js\";\n\nconst identifierPattern = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nexport function isValidIdentifier(name: string): boolean {\n\treturn identifierPattern.test(name);\n}\n\nexport function quotePropertyKey(name: string): string {\n\treturn `\"${escapeForDoubleQuoteString(name)}\"`;\n}\n\nexport function compileInputAccess(name: string): string {\n\tif (isValidIdentifier(name)) {\n\t\treturn `i?.${name}`;\n\t}\n\treturn `i?.[${quotePropertyKey(name)}]`;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./bundler-plugins/index.js";
2
+ export * from "./compiler/index.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./bundler-plugins/index.js";
2
+ export * from "./compiler/index.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./bundler-plugins/index.js\";\nexport * from \"./compiler/index.js\";\n"]}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Message AST types used by the Paraglide compiler.
3
+ *
4
+ * Previously sourced from @inlang/sdk — kept locally so compilation does not
5
+ * depend on the inlang project runtime.
6
+ */
7
+ export type VariableReference = {
8
+ type: "variable-reference";
9
+ name: string;
10
+ };
11
+ export type Literal = {
12
+ type: "literal";
13
+ value: string;
14
+ };
15
+ export type Option = {
16
+ name: string;
17
+ value: VariableReference | Literal;
18
+ };
19
+ export type Attribute = {
20
+ name: string;
21
+ value: Literal | true;
22
+ };
23
+ export type FunctionReference = {
24
+ type: "function-reference";
25
+ name: string;
26
+ options: Option[];
27
+ };
28
+ export type Expression = {
29
+ type: "expression";
30
+ arg: VariableReference | Literal;
31
+ annotation?: FunctionReference;
32
+ };
33
+ export type Text = {
34
+ type: "text";
35
+ value: string;
36
+ };
37
+ export type MarkupStart = {
38
+ type: "markup-start";
39
+ name: string;
40
+ options?: Option[];
41
+ attributes?: Attribute[];
42
+ };
43
+ export type MarkupEnd = {
44
+ type: "markup-end";
45
+ name: string;
46
+ options?: Option[];
47
+ attributes?: Attribute[];
48
+ };
49
+ export type MarkupStandalone = {
50
+ type: "markup-standalone";
51
+ name: string;
52
+ options?: Option[];
53
+ attributes?: Attribute[];
54
+ };
55
+ export type LocalVariable = {
56
+ type: "local-variable";
57
+ name: string;
58
+ value: Expression;
59
+ };
60
+ export type InputVariable = {
61
+ type: "input-variable";
62
+ name: string;
63
+ annotation?: FunctionReference;
64
+ };
65
+ export type Declaration = InputVariable | LocalVariable;
66
+ export type Pattern = Array<Text | Expression | MarkupStart | MarkupEnd | MarkupStandalone>;
67
+ export type LiteralMatch = {
68
+ type: "literal-match";
69
+ key: string;
70
+ value: string;
71
+ };
72
+ export type CatchAllMatch = {
73
+ type: "catchall-match";
74
+ key: string;
75
+ };
76
+ export type Match = LiteralMatch | CatchAllMatch;
77
+ export type Variant = {
78
+ id: string;
79
+ messageId: string;
80
+ matches: Match[];
81
+ pattern: Pattern;
82
+ };
83
+ export type Message = {
84
+ id: string;
85
+ bundleId: string;
86
+ locale: string;
87
+ selectors: VariableReference[];
88
+ };
89
+ export type MessageNested = Message & {
90
+ variants: Variant[];
91
+ };
92
+ export type Bundle = {
93
+ id: string;
94
+ declarations: Declaration[];
95
+ };
96
+ export type BundleNested = Bundle & {
97
+ messages: MessageNested[];
98
+ };
99
+ export type ParaglideSettings = {
100
+ baseLocale: string;
101
+ locales: string[];
102
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/messages/ast.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,YAAY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MAAM,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IACrC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,WAAW,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IACnC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Message AST types used by the Paraglide compiler.
3
+ *
4
+ * Previously sourced from @inlang/sdk — kept locally so compilation does not
5
+ * depend on the inlang project runtime.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=ast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/messages/ast.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Message AST types used by the Paraglide compiler.\n *\n * Previously sourced from @inlang/sdk — kept locally so compilation does not\n * depend on the inlang project runtime.\n */\n\nexport type VariableReference = {\n\ttype: \"variable-reference\";\n\tname: string;\n};\n\nexport type Literal = {\n\ttype: \"literal\";\n\tvalue: string;\n};\n\nexport type Option = {\n\tname: string;\n\tvalue: VariableReference | Literal;\n};\n\nexport type Attribute = {\n\tname: string;\n\tvalue: Literal | true;\n};\n\nexport type FunctionReference = {\n\ttype: \"function-reference\";\n\tname: string;\n\toptions: Option[];\n};\n\nexport type Expression = {\n\ttype: \"expression\";\n\targ: VariableReference | Literal;\n\tannotation?: FunctionReference;\n};\n\nexport type Text = {\n\ttype: \"text\";\n\tvalue: string;\n};\n\nexport type MarkupStart = {\n\ttype: \"markup-start\";\n\tname: string;\n\toptions?: Option[];\n\tattributes?: Attribute[];\n};\n\nexport type MarkupEnd = {\n\ttype: \"markup-end\";\n\tname: string;\n\toptions?: Option[];\n\tattributes?: Attribute[];\n};\n\nexport type MarkupStandalone = {\n\ttype: \"markup-standalone\";\n\tname: string;\n\toptions?: Option[];\n\tattributes?: Attribute[];\n};\n\nexport type LocalVariable = {\n\ttype: \"local-variable\";\n\tname: string;\n\tvalue: Expression;\n};\n\nexport type InputVariable = {\n\ttype: \"input-variable\";\n\tname: string;\n\tannotation?: FunctionReference;\n};\n\nexport type Declaration = InputVariable | LocalVariable;\n\nexport type Pattern = Array<\n\t| Text\n\t| Expression\n\t| MarkupStart\n\t| MarkupEnd\n\t| MarkupStandalone\n>;\n\nexport type LiteralMatch = {\n\ttype: \"literal-match\";\n\tkey: string;\n\tvalue: string;\n};\n\nexport type CatchAllMatch = {\n\ttype: \"catchall-match\";\n\tkey: string;\n};\n\nexport type Match = LiteralMatch | CatchAllMatch;\n\nexport type Variant = {\n\tid: string;\n\tmessageId: string;\n\tmatches: Match[];\n\tpattern: Pattern;\n};\n\nexport type Message = {\n\tid: string;\n\tbundleId: string;\n\tlocale: string;\n\tselectors: VariableReference[];\n};\n\nexport type MessageNested = Message & {\n\tvariants: Variant[];\n};\n\nexport type Bundle = {\n\tid: string;\n\tdeclarations: Declaration[];\n};\n\nexport type BundleNested = Bundle & {\n\tmessages: MessageNested[];\n};\n\nexport type ParaglideSettings = {\n\tbaseLocale: string;\n\tlocales: string[];\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import type { BundleNested, Declaration, Match, Pattern, VariableReference } from "./ast.js";
2
+ /**
3
+ * Builds a {@link BundleNested} for tests and programmatic compilation.
4
+ */
5
+ export declare function createBundleNested(args: {
6
+ id: string;
7
+ declarations?: Declaration[];
8
+ messages: {
9
+ selectors?: VariableReference[];
10
+ locale: string;
11
+ variants: {
12
+ matches?: Match[];
13
+ pattern: Pattern;
14
+ }[];
15
+ }[];
16
+ }): BundleNested;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-bundle-nested.d.ts","sourceRoot":"","sources":["../../src/messages/create-bundle-nested.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,EACZ,WAAW,EACX,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,QAAQ,EAAE;QACT,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE;YACT,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,CAAC;SACjB,EAAE,CAAC;KACJ,EAAE,CAAC;CACJ,GAAG,YAAY,CAiBf"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Builds a {@link BundleNested} for tests and programmatic compilation.
3
+ */
4
+ export function createBundleNested(args) {
5
+ return {
6
+ id: args.id,
7
+ declarations: args.declarations ?? [],
8
+ messages: args.messages.map((message) => ({
9
+ id: `${args.id}_${message.locale}`,
10
+ bundleId: args.id,
11
+ locale: message.locale,
12
+ selectors: message.selectors ?? [],
13
+ variants: message.variants.map((variant, index) => ({
14
+ id: `${args.id}_${message.locale}_${index}`,
15
+ messageId: `${args.id}_${message.locale}`,
16
+ matches: variant.matches ?? [],
17
+ pattern: variant.pattern,
18
+ })),
19
+ })),
20
+ };
21
+ }
22
+ //# sourceMappingURL=create-bundle-nested.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-bundle-nested.js","sourceRoot":"","sources":["../../src/messages/create-bundle-nested.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAWlC;IACA,OAAO;QACN,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;QACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzC,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;YAClC,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;YAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;gBACnD,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE;gBAC3C,SAAS,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;gBACzC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;SACH,CAAC,CAAC;KACH,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tBundleNested,\n\tDeclaration,\n\tMatch,\n\tPattern,\n\tVariableReference,\n} from \"./ast.js\";\n\n/**\n * Builds a {@link BundleNested} for tests and programmatic compilation.\n */\nexport function createBundleNested(args: {\n\tid: string;\n\tdeclarations?: Declaration[];\n\tmessages: {\n\t\tselectors?: VariableReference[];\n\t\tlocale: string;\n\t\tvariants: {\n\t\t\tmatches?: Match[];\n\t\t\tpattern: Pattern;\n\t\t}[];\n\t}[];\n}): BundleNested {\n\treturn {\n\t\tid: args.id,\n\t\tdeclarations: args.declarations ?? [],\n\t\tmessages: args.messages.map((message) => ({\n\t\t\tid: `${args.id}_${message.locale}`,\n\t\t\tbundleId: args.id,\n\t\t\tlocale: message.locale,\n\t\t\tselectors: message.selectors ?? [],\n\t\t\tvariants: message.variants.map((variant, index) => ({\n\t\t\t\tid: `${args.id}_${message.locale}_${index}`,\n\t\t\t\tmessageId: `${args.id}_${message.locale}`,\n\t\t\t\tmatches: variant.matches ?? [],\n\t\t\t\tpattern: variant.pattern,\n\t\t\t})),\n\t\t})),\n\t};\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export type * from "./ast.js";
2
+ export { createBundleNested } from "./create-bundle-nested.js";
3
+ export { loadMessages, type LoadMessagesOptions } from "./load-messages.js";
4
+ export { nestBundles } from "./nest-bundles.js";
5
+ export { importFiles } from "./message-format/import-files.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { createBundleNested } from "./create-bundle-nested.js";
2
+ export { loadMessages } from "./load-messages.js";
3
+ export { nestBundles } from "./nest-bundles.js";
4
+ export { importFiles } from "./message-format/import-files.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAA4B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC","sourcesContent":["export type * from \"./ast.js\";\nexport { createBundleNested } from \"./create-bundle-nested.js\";\nexport { loadMessages, type LoadMessagesOptions } from \"./load-messages.js\";\nexport { nestBundles } from \"./nest-bundles.js\";\nexport { importFiles } from \"./message-format/import-files.js\";\n"]}
@@ -0,0 +1,19 @@
1
+ import type { BundleNested, ParaglideSettings } from "./ast.js";
2
+ export type LoadMessagesOptions = ParaglideSettings & {
3
+ /**
4
+ * Path pattern with a `{locale}` placeholder.
5
+ *
6
+ * @example "./messages/{locale}.json"
7
+ */
8
+ messages: string;
9
+ fs: typeof import("node:fs");
10
+ cwd?: string;
11
+ };
12
+ export type LoadedMessages = {
13
+ bundles: BundleNested[];
14
+ settings: ParaglideSettings;
15
+ };
16
+ /**
17
+ * Reads locale JSON files and parses them into compiler-ready bundles.
18
+ */
19
+ export declare function loadMessages(options: LoadMessagesOptions): Promise<LoadedMessages>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-messages.d.ts","sourceRoot":"","sources":["../../src/messages/load-messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIhE,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACrD;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,cAAc,SAAS,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,CACjC,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,cAAc,CAAC,CAiDzB"}