@inlang/paraglide-js 2.23.1 → 2.24.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 (454) hide show
  1. package/dist/bundler-plugins/esbuild.d.ts +0 -1
  2. package/dist/bundler-plugins/esbuild.js.map +1 -1
  3. package/dist/bundler-plugins/index.d.ts +0 -1
  4. package/dist/bundler-plugins/index.js.map +1 -1
  5. package/dist/bundler-plugins/per-locale-build/constants.d.ts +0 -1
  6. package/dist/bundler-plugins/per-locale-build/constants.js.map +1 -1
  7. package/dist/bundler-plugins/per-locale-build/index.d.ts +0 -1
  8. package/dist/bundler-plugins/per-locale-build/index.js.map +1 -1
  9. package/dist/bundler-plugins/per-locale-build/locale-id.d.ts +0 -1
  10. package/dist/bundler-plugins/per-locale-build/locale-id.js.map +1 -1
  11. package/dist/bundler-plugins/per-locale-build/types.d.ts +0 -1
  12. package/dist/bundler-plugins/per-locale-build/types.js.map +1 -1
  13. package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts +0 -1
  14. package/dist/bundler-plugins/per-locale-build/vite-environments.js +12 -7
  15. package/dist/bundler-plugins/per-locale-build/vite-environments.js.map +1 -1
  16. package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts +0 -1
  17. package/dist/bundler-plugins/per-locale-build/vite-environments.test.js.map +1 -1
  18. package/dist/bundler-plugins/rolldown.d.ts +0 -1
  19. package/dist/bundler-plugins/rolldown.js.map +1 -1
  20. package/dist/bundler-plugins/rollup.d.ts +0 -1
  21. package/dist/bundler-plugins/rollup.js.map +1 -1
  22. package/dist/bundler-plugins/rspack.d.ts +0 -1
  23. package/dist/bundler-plugins/rspack.js.map +1 -1
  24. package/dist/bundler-plugins/unplugin.d.ts +0 -1
  25. package/dist/bundler-plugins/unplugin.js +134 -4
  26. package/dist/bundler-plugins/unplugin.js.map +1 -1
  27. package/dist/bundler-plugins/unplugin.test.d.ts +0 -1
  28. package/dist/bundler-plugins/unplugin.test.js +77 -0
  29. package/dist/bundler-plugins/unplugin.test.js.map +1 -1
  30. package/dist/bundler-plugins/vite.d.ts +0 -1
  31. package/dist/bundler-plugins/vite.js.map +1 -1
  32. package/dist/bundler-plugins/vite.test.d.ts +0 -1
  33. package/dist/bundler-plugins/vite.test.js.map +1 -1
  34. package/dist/bundler-plugins/webpack.d.ts +0 -1
  35. package/dist/bundler-plugins/webpack.js.map +1 -1
  36. package/dist/cli/commands/compile/command.d.ts +0 -1
  37. package/dist/cli/commands/compile/command.js +8 -1
  38. package/dist/cli/commands/compile/command.js.map +1 -1
  39. package/dist/cli/commands/compile/command.test.d.ts +0 -1
  40. package/dist/cli/commands/compile/command.test.js +45 -0
  41. package/dist/cli/commands/compile/command.test.js.map +1 -1
  42. package/dist/cli/commands/init/command.d.ts +0 -1
  43. package/dist/cli/commands/init/command.js.map +1 -1
  44. package/dist/cli/defaults.d.ts +0 -1
  45. package/dist/cli/defaults.js.map +1 -1
  46. package/dist/cli/index.d.ts +0 -1
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/cli/steps/add-vite-plugin.d.ts +0 -1
  49. package/dist/cli/steps/add-vite-plugin.js.map +1 -1
  50. package/dist/cli/steps/add-vite-plugin.test.d.ts +0 -1
  51. package/dist/cli/steps/add-vite-plugin.test.js.map +1 -1
  52. package/dist/cli/steps/check-for-uncomitted-changes.d.ts +0 -1
  53. package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -1
  54. package/dist/cli/steps/detect-bundler.d.ts +0 -1
  55. package/dist/cli/steps/detect-bundler.js.map +1 -1
  56. package/dist/cli/steps/detect-bundler.test.d.ts +0 -1
  57. package/dist/cli/steps/detect-bundler.test.js.map +1 -1
  58. package/dist/cli/steps/initialize-inlang-project.d.ts +0 -1
  59. package/dist/cli/steps/initialize-inlang-project.js.map +1 -1
  60. package/dist/cli/steps/maybe-add-machine-translation.d.ts +0 -1
  61. package/dist/cli/steps/maybe-add-machine-translation.js.map +1 -1
  62. package/dist/cli/steps/maybe-add-sherlock.d.ts +0 -1
  63. package/dist/cli/steps/maybe-add-sherlock.js.map +1 -1
  64. package/dist/cli/steps/prompt-for-outdir.d.ts +0 -1
  65. package/dist/cli/steps/prompt-for-outdir.js.map +1 -1
  66. package/dist/cli/steps/update-package-json.d.ts +0 -1
  67. package/dist/cli/steps/update-package-json.js.map +1 -1
  68. package/dist/cli/steps/update-ts-config.d.ts +0 -1
  69. package/dist/cli/steps/update-ts-config.js.map +1 -1
  70. package/dist/cli/steps/update-ts-config.test.d.ts +0 -1
  71. package/dist/cli/steps/update-ts-config.test.js.map +1 -1
  72. package/dist/cli/utils.d.ts +0 -1
  73. package/dist/cli/utils.js.map +1 -1
  74. package/dist/compiler/compile-annotation.d.ts +0 -1
  75. package/dist/compiler/compile-annotation.js.map +1 -1
  76. package/dist/compiler/compile-bundle.d.ts +0 -1
  77. package/dist/compiler/compile-bundle.js.map +1 -1
  78. package/dist/compiler/compile-bundle.test.d.ts +0 -1
  79. package/dist/compiler/compile-bundle.test.js.map +1 -1
  80. package/dist/compiler/compile-local-variable.d.ts +0 -1
  81. package/dist/compiler/compile-local-variable.js.map +1 -1
  82. package/dist/compiler/compile-local-variable.test.d.ts +0 -1
  83. package/dist/compiler/compile-local-variable.test.js.map +1 -1
  84. package/dist/compiler/compile-message.d.ts +0 -1
  85. package/dist/compiler/compile-message.js.map +1 -1
  86. package/dist/compiler/compile-message.test.d.ts +0 -1
  87. package/dist/compiler/compile-message.test.js.map +1 -1
  88. package/dist/compiler/compile-pattern.d.ts +0 -1
  89. package/dist/compiler/compile-pattern.js.map +1 -1
  90. package/dist/compiler/compile-pattern.test.d.ts +0 -1
  91. package/dist/compiler/compile-pattern.test.js.map +1 -1
  92. package/dist/compiler/compile-project.d.ts +0 -1
  93. package/dist/compiler/compile-project.js.map +1 -1
  94. package/dist/compiler/compile-project.test.d.ts +0 -1
  95. package/dist/compiler/compile-project.test.js.map +1 -1
  96. package/dist/compiler/compile.bench.d.ts +0 -1
  97. package/dist/compiler/compile.bench.js.map +1 -1
  98. package/dist/compiler/compile.d.ts +0 -1
  99. package/dist/compiler/compile.js +0 -15
  100. package/dist/compiler/compile.js.map +1 -1
  101. package/dist/compiler/compile.test.d.ts +0 -1
  102. package/dist/compiler/compile.test.js +0 -52
  103. package/dist/compiler/compile.test.js.map +1 -1
  104. package/dist/compiler/compiler-options.d.ts +8 -1
  105. package/dist/compiler/compiler-options.js.map +1 -1
  106. package/dist/compiler/create-paraglide.d.ts +0 -1
  107. package/dist/compiler/create-paraglide.js.map +1 -1
  108. package/dist/compiler/create-paraglide.test.d.ts +0 -1
  109. package/dist/compiler/create-paraglide.test.js.map +1 -1
  110. package/dist/compiler/create-readme.d.ts +0 -1
  111. package/dist/compiler/create-readme.js.map +1 -1
  112. package/dist/compiler/emit-ts-declarations.d.ts +0 -1
  113. package/dist/compiler/emit-ts-declarations.interop.test.d.ts +0 -1
  114. package/dist/compiler/emit-ts-declarations.interop.test.js.map +1 -1
  115. package/dist/compiler/emit-ts-declarations.js.map +1 -1
  116. package/dist/compiler/emit-ts-declarations.test.d.ts +0 -1
  117. package/dist/compiler/emit-ts-declarations.test.js.map +1 -1
  118. package/dist/compiler/index.d.ts +0 -1
  119. package/dist/compiler/index.js.map +1 -1
  120. package/dist/compiler/jsdoc-types.d.ts +0 -1
  121. package/dist/compiler/jsdoc-types.js.map +1 -1
  122. package/dist/compiler/jsdoc-types.test.d.ts +0 -1
  123. package/dist/compiler/jsdoc-types.test.js.map +1 -1
  124. package/dist/compiler/match-literals.d.ts +0 -1
  125. package/dist/compiler/match-literals.js.map +1 -1
  126. package/dist/compiler/output-structure/locale-modules.d.ts +0 -1
  127. package/dist/compiler/output-structure/locale-modules.js.map +1 -1
  128. package/dist/compiler/output-structure/locale-modules.test.d.ts +0 -1
  129. package/dist/compiler/output-structure/locale-modules.test.js.map +1 -1
  130. package/dist/compiler/output-structure/message-modules.d.ts +0 -1
  131. package/dist/compiler/output-structure/message-modules.js.map +1 -1
  132. package/dist/compiler/output-structure/message-modules.test.d.ts +0 -1
  133. package/dist/compiler/output-structure/message-modules.test.js.map +1 -1
  134. package/dist/compiler/per-locale-build.d.ts +0 -1
  135. package/dist/compiler/per-locale-build.js.map +1 -1
  136. package/dist/compiler/registry.d.ts +0 -1
  137. package/dist/compiler/registry.js.map +1 -1
  138. package/dist/compiler/resolve-tsc-js-path.d.ts +0 -1
  139. package/dist/compiler/resolve-tsc-js-path.js.map +1 -1
  140. package/dist/compiler/runtime/check-locale.d.ts +0 -1
  141. package/dist/compiler/runtime/check-locale.js.map +1 -1
  142. package/dist/compiler/runtime/check-locale.test.d.ts +0 -1
  143. package/dist/compiler/runtime/check-locale.test.js.map +1 -1
  144. package/dist/compiler/runtime/create-runtime.d.ts +1 -1
  145. package/dist/compiler/runtime/create-runtime.js +11 -0
  146. package/dist/compiler/runtime/create-runtime.js.map +1 -1
  147. package/dist/compiler/runtime/exec-url-pattern.d.ts +9 -0
  148. package/dist/compiler/runtime/exec-url-pattern.js +31 -0
  149. package/dist/compiler/runtime/exec-url-pattern.js.map +1 -0
  150. package/dist/compiler/runtime/extract-locale-from-cookie.d.ts +0 -1
  151. package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -1
  152. package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts +0 -1
  153. package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -1
  154. package/dist/compiler/runtime/extract-locale-from-header.d.ts +0 -1
  155. package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -1
  156. package/dist/compiler/runtime/extract-locale-from-header.test.d.ts +0 -1
  157. package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -1
  158. package/dist/compiler/runtime/extract-locale-from-navigator.d.ts +0 -1
  159. package/dist/compiler/runtime/extract-locale-from-navigator.js.map +1 -1
  160. package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts +0 -1
  161. package/dist/compiler/runtime/extract-locale-from-navigator.test.js.map +1 -1
  162. package/dist/compiler/runtime/extract-locale-from-request-async.d.ts +0 -1
  163. package/dist/compiler/runtime/extract-locale-from-request-async.js.map +1 -1
  164. package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts +0 -1
  165. package/dist/compiler/runtime/extract-locale-from-request-async.test.js.map +1 -1
  166. package/dist/compiler/runtime/extract-locale-from-request.d.ts +0 -1
  167. package/dist/compiler/runtime/extract-locale-from-request.js.map +1 -1
  168. package/dist/compiler/runtime/extract-locale-from-request.test.d.ts +0 -1
  169. package/dist/compiler/runtime/extract-locale-from-request.test.js.map +1 -1
  170. package/dist/compiler/runtime/extract-locale-from-url.d.ts +0 -1
  171. package/dist/compiler/runtime/extract-locale-from-url.js +8 -3
  172. package/dist/compiler/runtime/extract-locale-from-url.js.map +1 -1
  173. package/dist/compiler/runtime/extract-locale-from-url.test.d.ts +0 -1
  174. package/dist/compiler/runtime/extract-locale-from-url.test.js.map +1 -1
  175. package/dist/compiler/runtime/generate-static-localized-urls.d.ts +0 -1
  176. package/dist/compiler/runtime/generate-static-localized-urls.js +12 -6
  177. package/dist/compiler/runtime/generate-static-localized-urls.js.map +1 -1
  178. package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts +0 -1
  179. package/dist/compiler/runtime/generate-static-localized-urls.test.js +46 -0
  180. package/dist/compiler/runtime/generate-static-localized-urls.test.js.map +1 -1
  181. package/dist/compiler/runtime/get-locale.d.ts +0 -1
  182. package/dist/compiler/runtime/get-locale.js.map +1 -1
  183. package/dist/compiler/runtime/get-locale.test.d.ts +0 -1
  184. package/dist/compiler/runtime/get-locale.test.js.map +1 -1
  185. package/dist/compiler/runtime/get-text-direction.d.ts +0 -1
  186. package/dist/compiler/runtime/get-text-direction.js.map +1 -1
  187. package/dist/compiler/runtime/get-text-direction.test.d.ts +0 -1
  188. package/dist/compiler/runtime/get-text-direction.test.js.map +1 -1
  189. package/dist/compiler/runtime/get-url-origin.d.ts +0 -1
  190. package/dist/compiler/runtime/get-url-origin.js.map +1 -1
  191. package/dist/compiler/runtime/get-url-origin.test.d.ts +0 -1
  192. package/dist/compiler/runtime/get-url-origin.test.js.map +1 -1
  193. package/dist/compiler/runtime/localize-href.bench.d.ts +1 -0
  194. package/dist/compiler/runtime/localize-href.bench.js +77 -0
  195. package/dist/compiler/runtime/localize-href.bench.js.map +1 -0
  196. package/dist/compiler/runtime/localize-href.d.ts +0 -1
  197. package/dist/compiler/runtime/localize-href.js.map +1 -1
  198. package/dist/compiler/runtime/localize-href.test.d.ts +0 -1
  199. package/dist/compiler/runtime/localize-href.test.js +43 -0
  200. package/dist/compiler/runtime/localize-href.test.js.map +1 -1
  201. package/dist/compiler/runtime/localize-url.d.ts +14 -1
  202. package/dist/compiler/runtime/localize-url.js +376 -18
  203. package/dist/compiler/runtime/localize-url.js.map +1 -1
  204. package/dist/compiler/runtime/localize-url.test.d.ts +0 -1
  205. package/dist/compiler/runtime/localize-url.test.js +163 -0
  206. package/dist/compiler/runtime/localize-url.test.js.map +1 -1
  207. package/dist/compiler/runtime/normalize-trailing-slash.d.ts +10 -0
  208. package/dist/compiler/runtime/normalize-trailing-slash.js +23 -0
  209. package/dist/compiler/runtime/normalize-trailing-slash.js.map +1 -0
  210. package/dist/compiler/runtime/route-strategy.d.ts +0 -1
  211. package/dist/compiler/runtime/route-strategy.js +4 -2
  212. package/dist/compiler/runtime/route-strategy.js.map +1 -1
  213. package/dist/compiler/runtime/set-locale.d.ts +0 -1
  214. package/dist/compiler/runtime/set-locale.js.map +1 -1
  215. package/dist/compiler/runtime/set-locale.test.d.ts +0 -1
  216. package/dist/compiler/runtime/set-locale.test.js.map +1 -1
  217. package/dist/compiler/runtime/should-redirect.d.ts +0 -1
  218. package/dist/compiler/runtime/should-redirect.js +4 -1
  219. package/dist/compiler/runtime/should-redirect.js.map +1 -1
  220. package/dist/compiler/runtime/should-redirect.test.d.ts +0 -1
  221. package/dist/compiler/runtime/should-redirect.test.js +30 -2
  222. package/dist/compiler/runtime/should-redirect.test.js.map +1 -1
  223. package/dist/compiler/runtime/strategy.d.ts +0 -1
  224. package/dist/compiler/runtime/strategy.js.map +1 -1
  225. package/dist/compiler/runtime/strategy.test.d.ts +0 -1
  226. package/dist/compiler/runtime/strategy.test.js.map +1 -1
  227. package/dist/compiler/runtime/track-message-call.d.ts +0 -1
  228. package/dist/compiler/runtime/track-message-call.js.map +1 -1
  229. package/dist/compiler/runtime/track-message-call.test.d.ts +0 -1
  230. package/dist/compiler/runtime/track-message-call.test.js.map +1 -1
  231. package/dist/compiler/runtime/type-definitions.d.ts +0 -1
  232. package/dist/compiler/runtime/type-definitions.js.map +1 -1
  233. package/dist/compiler/runtime/type.d.ts +1 -1
  234. package/dist/compiler/runtime/type.js.map +1 -1
  235. package/dist/compiler/runtime/type.test.d.ts +0 -1
  236. package/dist/compiler/runtime/type.test.js.map +1 -1
  237. package/dist/compiler/runtime/variables.d.ts +6 -1
  238. package/dist/compiler/runtime/variables.js +6 -0
  239. package/dist/compiler/runtime/variables.js.map +1 -1
  240. package/dist/compiler/safe-module-id.d.ts +0 -1
  241. package/dist/compiler/safe-module-id.js.map +1 -1
  242. package/dist/compiler/safe-module-id.test.d.ts +0 -1
  243. package/dist/compiler/safe-module-id.test.js.map +1 -1
  244. package/dist/compiler/seed-previous-compilation.d.ts +0 -1
  245. package/dist/compiler/seed-previous-compilation.js.map +1 -1
  246. package/dist/compiler/server/create-server-file.d.ts +0 -1
  247. package/dist/compiler/server/create-server-file.js.map +1 -1
  248. package/dist/compiler/server/create-server-file.test.d.ts +0 -1
  249. package/dist/compiler/server/create-server-file.test.js.map +1 -1
  250. package/dist/compiler/server/middleware.d.ts +0 -1
  251. package/dist/compiler/server/middleware.js +6 -2
  252. package/dist/compiler/server/middleware.js.map +1 -1
  253. package/dist/compiler/server/middleware.test.d.ts +0 -1
  254. package/dist/compiler/server/middleware.test.js +34 -0
  255. package/dist/compiler/server/middleware.test.js.map +1 -1
  256. package/dist/compiler/server/type.d.ts +0 -1
  257. package/dist/compiler/server/type.js.map +1 -1
  258. package/dist/compiler/types.d.ts +0 -1
  259. package/dist/compiler/types.js.map +1 -1
  260. package/dist/compiler/variable-access.d.ts +0 -1
  261. package/dist/compiler/variable-access.js.map +1 -1
  262. package/dist/index.d.ts +0 -1
  263. package/dist/index.js.map +1 -1
  264. package/dist/index.test.d.ts +1 -0
  265. package/dist/index.test.js +9 -0
  266. package/dist/index.test.js.map +1 -0
  267. package/dist/services/codegen/escape.d.ts +0 -1
  268. package/dist/services/codegen/escape.js.map +1 -1
  269. package/dist/services/codegen/quotes.d.ts +0 -1
  270. package/dist/services/codegen/quotes.js.map +1 -1
  271. package/dist/services/env-variables/create-index-file.d.ts +0 -1
  272. package/dist/services/env-variables/create-index-file.js.map +1 -1
  273. package/dist/services/env-variables/index.d.ts +0 -1
  274. package/dist/services/env-variables/index.js +1 -1
  275. package/dist/services/env-variables/index.js.map +1 -1
  276. package/dist/services/environment/package.d.ts +0 -1
  277. package/dist/services/environment/package.js.map +1 -1
  278. package/dist/services/environment/package.test.d.ts +0 -1
  279. package/dist/services/environment/package.test.js.map +1 -1
  280. package/dist/services/error-handling.d.ts +0 -1
  281. package/dist/services/error-handling.js.map +1 -1
  282. package/dist/services/error-handling.test.d.ts +0 -1
  283. package/dist/services/error-handling.test.js.map +1 -1
  284. package/dist/services/file-handling/exists.d.ts +0 -1
  285. package/dist/services/file-handling/exists.js.map +1 -1
  286. package/dist/services/file-handling/exists.test.d.ts +0 -1
  287. package/dist/services/file-handling/exists.test.js.map +1 -1
  288. package/dist/services/file-handling/types.d.ts +0 -1
  289. package/dist/services/file-handling/types.js.map +1 -1
  290. package/dist/services/file-handling/write-output.bench.d.ts +1 -0
  291. package/dist/services/file-handling/write-output.bench.js +24 -0
  292. package/dist/services/file-handling/write-output.bench.js.map +1 -0
  293. package/dist/services/file-handling/write-output.d.ts +0 -1
  294. package/dist/services/file-handling/write-output.js +16 -20
  295. package/dist/services/file-handling/write-output.js.map +1 -1
  296. package/dist/services/file-handling/write-output.test.d.ts +0 -1
  297. package/dist/services/file-handling/write-output.test.js +27 -0
  298. package/dist/services/file-handling/write-output.test.js.map +1 -1
  299. package/dist/services/file-watching/tracked-fs.d.ts +0 -1
  300. package/dist/services/file-watching/tracked-fs.js.map +1 -1
  301. package/dist/services/file-watching/tracked-fs.test.d.ts +0 -1
  302. package/dist/services/file-watching/tracked-fs.test.js.map +1 -1
  303. package/dist/services/logger/index.d.ts +0 -1
  304. package/dist/services/logger/index.js.map +1 -1
  305. package/dist/services/lookup.d.ts +0 -1
  306. package/dist/services/lookup.js.map +1 -1
  307. package/dist/urlpattern-polyfill/index.d.ts +0 -1
  308. package/dist/urlpattern-polyfill/index.js.map +1 -1
  309. package/dist/utilities/detect-json-formatting.d.ts +0 -1
  310. package/dist/utilities/detect-json-formatting.js.map +1 -1
  311. package/dist/utilities/node-normalize-path.d.ts +0 -1
  312. package/dist/utilities/node-normalize-path.js.map +1 -1
  313. package/package.json +2 -2
  314. package/dist/bundler-plugins/esbuild.d.ts.map +0 -1
  315. package/dist/bundler-plugins/index.d.ts.map +0 -1
  316. package/dist/bundler-plugins/per-locale-build/constants.d.ts.map +0 -1
  317. package/dist/bundler-plugins/per-locale-build/index.d.ts.map +0 -1
  318. package/dist/bundler-plugins/per-locale-build/locale-id.d.ts.map +0 -1
  319. package/dist/bundler-plugins/per-locale-build/types.d.ts.map +0 -1
  320. package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts.map +0 -1
  321. package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts.map +0 -1
  322. package/dist/bundler-plugins/rolldown.d.ts.map +0 -1
  323. package/dist/bundler-plugins/rollup.d.ts.map +0 -1
  324. package/dist/bundler-plugins/rspack.d.ts.map +0 -1
  325. package/dist/bundler-plugins/unplugin.d.ts.map +0 -1
  326. package/dist/bundler-plugins/unplugin.test.d.ts.map +0 -1
  327. package/dist/bundler-plugins/vite.d.ts.map +0 -1
  328. package/dist/bundler-plugins/vite.test.d.ts.map +0 -1
  329. package/dist/bundler-plugins/webpack.d.ts.map +0 -1
  330. package/dist/cli/commands/compile/command.d.ts.map +0 -1
  331. package/dist/cli/commands/compile/command.test.d.ts.map +0 -1
  332. package/dist/cli/commands/init/command.d.ts.map +0 -1
  333. package/dist/cli/defaults.d.ts.map +0 -1
  334. package/dist/cli/index.d.ts.map +0 -1
  335. package/dist/cli/steps/add-vite-plugin.d.ts.map +0 -1
  336. package/dist/cli/steps/add-vite-plugin.test.d.ts.map +0 -1
  337. package/dist/cli/steps/check-for-uncomitted-changes.d.ts.map +0 -1
  338. package/dist/cli/steps/detect-bundler.d.ts.map +0 -1
  339. package/dist/cli/steps/detect-bundler.test.d.ts.map +0 -1
  340. package/dist/cli/steps/initialize-inlang-project.d.ts.map +0 -1
  341. package/dist/cli/steps/maybe-add-machine-translation.d.ts.map +0 -1
  342. package/dist/cli/steps/maybe-add-sherlock.d.ts.map +0 -1
  343. package/dist/cli/steps/prompt-for-outdir.d.ts.map +0 -1
  344. package/dist/cli/steps/update-package-json.d.ts.map +0 -1
  345. package/dist/cli/steps/update-ts-config.d.ts.map +0 -1
  346. package/dist/cli/steps/update-ts-config.test.d.ts.map +0 -1
  347. package/dist/cli/utils.d.ts.map +0 -1
  348. package/dist/compiler/compile-annotation.d.ts.map +0 -1
  349. package/dist/compiler/compile-bundle.d.ts.map +0 -1
  350. package/dist/compiler/compile-bundle.test.d.ts.map +0 -1
  351. package/dist/compiler/compile-local-variable.d.ts.map +0 -1
  352. package/dist/compiler/compile-local-variable.test.d.ts.map +0 -1
  353. package/dist/compiler/compile-message.d.ts.map +0 -1
  354. package/dist/compiler/compile-message.test.d.ts.map +0 -1
  355. package/dist/compiler/compile-pattern.d.ts.map +0 -1
  356. package/dist/compiler/compile-pattern.test.d.ts.map +0 -1
  357. package/dist/compiler/compile-project.d.ts.map +0 -1
  358. package/dist/compiler/compile-project.test.d.ts.map +0 -1
  359. package/dist/compiler/compile.bench.d.ts.map +0 -1
  360. package/dist/compiler/compile.d.ts.map +0 -1
  361. package/dist/compiler/compile.test.d.ts.map +0 -1
  362. package/dist/compiler/compiler-options.d.ts.map +0 -1
  363. package/dist/compiler/create-paraglide.d.ts.map +0 -1
  364. package/dist/compiler/create-paraglide.test.d.ts.map +0 -1
  365. package/dist/compiler/create-readme.d.ts.map +0 -1
  366. package/dist/compiler/emit-ts-declarations.d.ts.map +0 -1
  367. package/dist/compiler/emit-ts-declarations.interop.test.d.ts.map +0 -1
  368. package/dist/compiler/emit-ts-declarations.test.d.ts.map +0 -1
  369. package/dist/compiler/index.d.ts.map +0 -1
  370. package/dist/compiler/jsdoc-types.d.ts.map +0 -1
  371. package/dist/compiler/jsdoc-types.test.d.ts.map +0 -1
  372. package/dist/compiler/match-literals.d.ts.map +0 -1
  373. package/dist/compiler/output-structure/locale-modules.d.ts.map +0 -1
  374. package/dist/compiler/output-structure/locale-modules.test.d.ts.map +0 -1
  375. package/dist/compiler/output-structure/message-modules.d.ts.map +0 -1
  376. package/dist/compiler/output-structure/message-modules.test.d.ts.map +0 -1
  377. package/dist/compiler/per-locale-build.d.ts.map +0 -1
  378. package/dist/compiler/registry.d.ts.map +0 -1
  379. package/dist/compiler/resolve-tsc-js-path.d.ts.map +0 -1
  380. package/dist/compiler/runtime/check-locale.d.ts.map +0 -1
  381. package/dist/compiler/runtime/check-locale.test.d.ts.map +0 -1
  382. package/dist/compiler/runtime/create-runtime.d.ts.map +0 -1
  383. package/dist/compiler/runtime/extract-locale-from-cookie.d.ts.map +0 -1
  384. package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts.map +0 -1
  385. package/dist/compiler/runtime/extract-locale-from-header.d.ts.map +0 -1
  386. package/dist/compiler/runtime/extract-locale-from-header.test.d.ts.map +0 -1
  387. package/dist/compiler/runtime/extract-locale-from-navigator.d.ts.map +0 -1
  388. package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts.map +0 -1
  389. package/dist/compiler/runtime/extract-locale-from-request-async.d.ts.map +0 -1
  390. package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts.map +0 -1
  391. package/dist/compiler/runtime/extract-locale-from-request.d.ts.map +0 -1
  392. package/dist/compiler/runtime/extract-locale-from-request.test.d.ts.map +0 -1
  393. package/dist/compiler/runtime/extract-locale-from-url.d.ts.map +0 -1
  394. package/dist/compiler/runtime/extract-locale-from-url.test.d.ts.map +0 -1
  395. package/dist/compiler/runtime/generate-static-localized-urls.d.ts.map +0 -1
  396. package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts.map +0 -1
  397. package/dist/compiler/runtime/get-locale.d.ts.map +0 -1
  398. package/dist/compiler/runtime/get-locale.test.d.ts.map +0 -1
  399. package/dist/compiler/runtime/get-text-direction.d.ts.map +0 -1
  400. package/dist/compiler/runtime/get-text-direction.test.d.ts.map +0 -1
  401. package/dist/compiler/runtime/get-url-origin.d.ts.map +0 -1
  402. package/dist/compiler/runtime/get-url-origin.test.d.ts.map +0 -1
  403. package/dist/compiler/runtime/localize-href.d.ts.map +0 -1
  404. package/dist/compiler/runtime/localize-href.test.d.ts.map +0 -1
  405. package/dist/compiler/runtime/localize-url.d.ts.map +0 -1
  406. package/dist/compiler/runtime/localize-url.test.d.ts.map +0 -1
  407. package/dist/compiler/runtime/route-strategy.d.ts.map +0 -1
  408. package/dist/compiler/runtime/set-locale.d.ts.map +0 -1
  409. package/dist/compiler/runtime/set-locale.test.d.ts.map +0 -1
  410. package/dist/compiler/runtime/should-redirect.d.ts.map +0 -1
  411. package/dist/compiler/runtime/should-redirect.test.d.ts.map +0 -1
  412. package/dist/compiler/runtime/strategy.d.ts.map +0 -1
  413. package/dist/compiler/runtime/strategy.test.d.ts.map +0 -1
  414. package/dist/compiler/runtime/track-message-call.d.ts.map +0 -1
  415. package/dist/compiler/runtime/track-message-call.test.d.ts.map +0 -1
  416. package/dist/compiler/runtime/type-definitions.d.ts.map +0 -1
  417. package/dist/compiler/runtime/type.d.ts.map +0 -1
  418. package/dist/compiler/runtime/type.test.d.ts.map +0 -1
  419. package/dist/compiler/runtime/variables.d.ts.map +0 -1
  420. package/dist/compiler/safe-module-id.d.ts.map +0 -1
  421. package/dist/compiler/safe-module-id.test.d.ts.map +0 -1
  422. package/dist/compiler/seed-previous-compilation.d.ts.map +0 -1
  423. package/dist/compiler/server/create-server-file.d.ts.map +0 -1
  424. package/dist/compiler/server/create-server-file.test.d.ts.map +0 -1
  425. package/dist/compiler/server/middleware.d.ts.map +0 -1
  426. package/dist/compiler/server/middleware.test.d.ts.map +0 -1
  427. package/dist/compiler/server/type.d.ts.map +0 -1
  428. package/dist/compiler/types.d.ts.map +0 -1
  429. package/dist/compiler/variable-access.d.ts.map +0 -1
  430. package/dist/index.d.ts.map +0 -1
  431. package/dist/services/account/index.d.ts +0 -15
  432. package/dist/services/account/index.d.ts.map +0 -1
  433. package/dist/services/account/index.js +0 -43
  434. package/dist/services/account/index.js.map +0 -1
  435. package/dist/services/codegen/escape.d.ts.map +0 -1
  436. package/dist/services/codegen/quotes.d.ts.map +0 -1
  437. package/dist/services/env-variables/create-index-file.d.ts.map +0 -1
  438. package/dist/services/env-variables/index.d.ts.map +0 -1
  439. package/dist/services/environment/package.d.ts.map +0 -1
  440. package/dist/services/environment/package.test.d.ts.map +0 -1
  441. package/dist/services/error-handling.d.ts.map +0 -1
  442. package/dist/services/error-handling.test.d.ts.map +0 -1
  443. package/dist/services/file-handling/exists.d.ts.map +0 -1
  444. package/dist/services/file-handling/exists.test.d.ts.map +0 -1
  445. package/dist/services/file-handling/types.d.ts.map +0 -1
  446. package/dist/services/file-handling/write-output.d.ts.map +0 -1
  447. package/dist/services/file-handling/write-output.test.d.ts.map +0 -1
  448. package/dist/services/file-watching/tracked-fs.d.ts.map +0 -1
  449. package/dist/services/file-watching/tracked-fs.test.d.ts.map +0 -1
  450. package/dist/services/logger/index.d.ts.map +0 -1
  451. package/dist/services/lookup.d.ts.map +0 -1
  452. package/dist/urlpattern-polyfill/index.d.ts.map +0 -1
  453. package/dist/utilities/detect-json-formatting.d.ts.map +0 -1
  454. package/dist/utilities/node-normalize-path.d.ts.map +0 -1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CAAC,CAAC;YAEH,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YAErD,KAAK,MAAM,cAAc,IAAI,iBAAiB,EAAE,CAAC;gBAChD,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC7B,CAAC;YAED,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YAEtB,OAAO,EAAE,YAAY,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,uCAAuC;YACvC,qBAAqB,GAAG,IAAI,CAAC;YAC7B,MAAM,CAAC,CAAC;QACT,CAAC;IACF,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,qBAAqB,CAAC,CAAC;IAC5D,qBAAqB,GAAG,IAAI,CAAC;IAE7B,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { loadProjectFromDirectory } from \"@inlang/sdk\";\nimport path from \"node:path\";\nimport { compileProject } from \"./compile-project.js\";\nimport { writeOutput } from \"../services/file-handling/write-output.js\";\nimport {\n\tdefaultCompilerOptions,\n\ttype CompilerOptions,\n} from \"./compiler-options.js\";\nimport { Logger } from \"../services/logger/index.js\";\n\n// This is a workaround to prevent multiple compilations from running at the same time.\n// https://github.com/opral/inlang-paraglide-js/issues/320#issuecomment-2596951222\nlet compilationInProgress: Promise<{\n\toutputHashes: Record<string, string> | undefined;\n}> | null = null;\n\nexport type CompilationResult = {\n\toutputHashes: Record<string, string> | undefined;\n};\n\nconst logger = new Logger();\n\n/**\n * Loads, compiles, and writes the output to disk.\n *\n * This is the main function to use when you want to compile a project.\n * If you want to adjust inlang project loading, or the output, use\n * `compileProject()` instead.\n *\n * @example\n * await compile({\n * project: 'path/to/project',\n * outdir: 'path/to/output',\n * })\n */\nexport async function compile(\n\toptions: CompilerOptions & {\n\t\tpreviousCompilation?: CompilationResult;\n\t}\n): Promise<CompilationResult> {\n\tconst withDefaultOptions = {\n\t\t...defaultCompilerOptions,\n\t\t...options,\n\t};\n\n\tif (compilationInProgress) {\n\t\tawait compilationInProgress;\n\t}\n\n\tcompilationInProgress = (async () => {\n\t\ttry {\n\t\t\tconst fs = withDefaultOptions.fs ?? (await import(\"node:fs\"));\n\t\t\tconst absoluteOutdir = path.resolve(\n\t\t\t\tprocess.cwd(),\n\t\t\t\twithDefaultOptions.outdir\n\t\t\t);\n\n\t\t\tconst project = await loadProjectFromDirectory({\n\t\t\t\tpath: withDefaultOptions.project,\n\t\t\t\tfs,\n\t\t\t});\n\n\t\t\tconst output = await compileProject({\n\t\t\t\tcompilerOptions: withDefaultOptions,\n\t\t\t\tproject,\n\t\t\t\tprojectPath: withDefaultOptions.project,\n\t\t\t});\n\n\t\t\tconst outputHashes = await writeOutput({\n\t\t\t\tdirectory: absoluteOutdir,\n\t\t\t\toutput,\n\t\t\t\tcleanDirectory: withDefaultOptions.cleanOutdir,\n\t\t\t\tfs: fs.promises,\n\t\t\t\tpreviousOutputHashes: options.previousCompilation?.outputHashes,\n\t\t\t});\n\n\t\t\tconst warningsAndErrors = await project.errors.get();\n\n\t\t\tfor (const warningOrError of warningsAndErrors) {\n\t\t\t\tlogger.warn(warningOrError);\n\t\t\t}\n\n\t\t\tawait project.close();\n\n\t\t\treturn { outputHashes };\n\t\t} catch (e) {\n\t\t\t// release the lock in case of an error\n\t\t\tcompilationInProgress = null;\n\t\t\tthrow e;\n\t\t}\n\t})();\n\n\tconst result = structuredClone(await compilationInProgress);\n\tcompilationInProgress = null;\n\n\treturn result;\n}\n"]}
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=compile.test.d.ts.map
@@ -2,7 +2,6 @@ import { loadProjectInMemory, newProject, saveProjectToDirectory, } from "@inlan
2
2
  import { memfs } from "memfs";
3
3
  import { test, expect, vi } from "vitest";
4
4
  import { compile } from "./compile.js";
5
- import { getAccountFilePath } from "../services/account/index.js";
6
5
  import { defaultCompilerOptions } from "./compiler-options.js";
7
6
  import consola from "consola";
8
7
  test("loads a project and compiles it", async () => {
@@ -30,57 +29,6 @@ test("loads a project and compiles it", async () => {
30
29
  //runtime.js and messages.js are always compiled with the default options
31
30
  expect(files).toEqual(expect.arrayContaining(["runtime.js", "server.js", "messages.js"]));
32
31
  });
33
- test.skip("loads a local account from app data if exists", async () => {
34
- const accountPath = getAccountFilePath();
35
- const fs = memfs({
36
- [accountPath]: JSON.stringify({ id: "mock", name: "test" }),
37
- }).fs;
38
- const spy = vi.spyOn(fs, "readFileSync");
39
- const project = await loadProjectInMemory({
40
- blob: await newProject({
41
- settings: {
42
- baseLocale: "en",
43
- locales: ["en", "de", "fr"],
44
- },
45
- }),
46
- });
47
- await saveProjectToDirectory({
48
- project,
49
- path: "/project.inlang",
50
- fs: fs.promises,
51
- });
52
- await compile({
53
- project: "/project.inlang",
54
- outdir: "/output",
55
- fs: fs,
56
- });
57
- expect(spy).toHaveBeenCalledWith(accountPath, "utf8");
58
- });
59
- test.skip("saves the local account to app data if not exists", async () => {
60
- const accountPath = getAccountFilePath();
61
- const fs = memfs().fs;
62
- const project = await loadProjectInMemory({
63
- blob: await newProject({
64
- settings: {
65
- baseLocale: "en",
66
- locales: ["en", "de", "fr"],
67
- },
68
- }),
69
- });
70
- await saveProjectToDirectory({
71
- project,
72
- path: "/project.inlang",
73
- fs: fs.promises,
74
- });
75
- await compile({
76
- project: "/project.inlang",
77
- outdir: "/output",
78
- fs: fs,
79
- });
80
- const account = JSON.parse(await fs.promises.readFile(accountPath, "utf8"));
81
- expect(account).toHaveProperty("id");
82
- expect(account).toHaveProperty("name");
83
- });
84
32
  test("cleans the output directory", async () => {
85
33
  const fs = memfs().fs;
86
34
  const project = await loadProjectInMemory({
@@ -1 +1 @@
1
- {"version":3,"file":"compile.test.js","sourceRoot":"","sources":["../../src/compiler/compile.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,sBAAsB,GACtB,MAAM,aAAa,CAAC;AACrB,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AK,EAAE,CAAC,EAAyC,CAAC;IAC7D,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;IAC5E,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAElC,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC;QACnE;YACC,OAAO,EACN,8EAA8E;SACxE;KACR,CAAC,CAAC;IAEH,4CAA4C;IAC5C,MAAM,sBAAsB,CAAC;QAC5B,OAAO;QACP,IAAI,EAAE,iBAAiB;QACvB,EAAE,EAAE,EAAE,CAAC,QAAQ;KACf,CAAC,CAAC;IAEH,IAAI,CAAC;QACJ,MAAM,OAAO,CAAC;YACb,OAAO,EAAE,iBAAiB;YAC1B,MAAM,EAAE,SAAS;YACjB,EAAE,EAAE,EAAE;SACN,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,SAAS,CAAC,WAAW,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC","sourcesContent":["import {\n\tloadProjectInMemory,\n\tnewProject,\n\tsaveProjectToDirectory,\n} from \"@inlang/sdk\";\nimport { memfs } from \"memfs\";\nimport { test, expect, vi } from \"vitest\";\nimport { compile } from \"./compile.js\";\nimport type { Runtime } from \"./runtime/type.js\";\nimport { defaultCompilerOptions } from \"./compiler-options.js\";\nimport consola from \"consola\";\n\ntest(\"loads a project and compiles it\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs: fs,\n\t});\n\n\tconst files = await fs.promises.readdir(\"/output\");\n\n\t//runtime.js and messages.js are always compiled with the default options\n\texpect(files).toEqual(\n\t\texpect.arrayContaining([\"runtime.js\", \"server.js\", \"messages.js\"])\n\t);\n});\n\ntest(\"cleans the output directory\", async () => {\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({}),\n\t});\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait fs.promises.mkdir(\"/output/subdir\", { recursive: true });\n\tawait fs.promises.writeFile(\"/output/subdir/x.js\", \"console.log('hello')\");\n\tawait fs.promises.writeFile(\"/output/y.js\", \"console.log('hello')\");\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs: fs,\n\t});\n\n\tconst outputDir = await fs.promises.readdir(\"/output\");\n\tconst outputSubDir = fs.existsSync(\"/output/subdir\");\n\n\texpect(outputDir).not.toContain(\"y.js\");\n\texpect(outputSubDir).toBe(false);\n});\n\n// Regression coverage for https://github.com/opral/paraglide-js/issues/581\ntest(\"runtime output strips sourcemap references\", async () => {\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs: fs,\n\t});\n\n\tconst runtimeFile = await fs.promises.readFile(\"/output/runtime.js\", \"utf8\");\n\tconst serverFile = await fs.promises.readFile(\"/output/server.js\", \"utf8\");\n\n\texpect(runtimeFile).not.toMatch(/sourceMappingURL=/);\n\texpect(serverFile).not.toMatch(/sourceMappingURL=/);\n});\n\ntest(\"experimental middleware locale splitting uses globalThis.__paraglide.ssr\", async () => {\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs,\n\t\texperimentalMiddlewareLocaleSplitting: true,\n\t});\n\n\tconst runtimeFile = await fs.promises.readFile(\"/output/runtime.js\", \"utf8\");\n\tconst serverFile = await fs.promises.readFile(\"/output/server.js\", \"utf8\");\n\n\texpect(runtimeFile).toContain(\"(globalThis).__paraglide =\");\n\texpect(runtimeFile).toContain(\"(globalThis).__paraglide.ssr =\");\n\texpect(runtimeFile).not.toContain(\"__paraglide_ssr\");\n\texpect(serverFile).toContain(\"globalThis.__paraglide = globalThis.__paraglide ?? {};\");\n\texpect(serverFile).toContain(\"globalThis.__paraglide.ssr = {\");\n\texpect(serverFile).toContain(\n\t\tString.raw`replace(/<\\/(script)/gi, \"<\\\\/$1\")`\n\t);\n\texpect(serverFile).not.toContain(\"__paraglide_ssr\");\n});\n\ntest(\"doesn't clean the output directory if option is set to false\", async () => {\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({}),\n\t});\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait fs.promises.mkdir(\"/output/subdir\", { recursive: true });\n\tawait fs.promises.writeFile(\"/output/subdir/x.js\", \"console.log('hello')\");\n\tawait fs.promises.writeFile(\"/output/y.js\", \"console.log('hello')\");\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tcleanOutdir: false,\n\t\tfs: fs,\n\t});\n\n\tconst outputDir = await fs.promises.readdir(\"/output\");\n\tconst outputSubDir = fs.existsSync(\"/output/subdir\");\n\n\texpect(outputDir).toContain(\"y.js\");\n\texpect(outputSubDir).toBe(true);\n});\n\ntest(\"multiple compile calls do not interfere with each other\", async () => {\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\t// different project settings to test compile output\n\tawait project.settings.set({\n\t\t...(await project.settings.get()),\n\t\tbaseLocale: \"de\",\n\t\tlocales: [\"de\"],\n\t});\n\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project2.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tconst compilations = [\n\t\tcompile({\n\t\t\tproject: \"/project.inlang\",\n\t\t\toutdir: \"/output\",\n\t\t\tfs: fs,\n\t\t}),\n\t\tcompile({\n\t\t\tproject: \"/project2.inlang\",\n\t\t\toutdir: \"/output\",\n\t\t\tfs: fs,\n\t\t}),\n\t];\n\n\tawait Promise.all(compilations);\n\n\tconst runtimeFile = await fs.promises.readFile(\"/output/runtime.js\", \"utf8\");\n\n\tconst runtime = (await import(\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tBuffer.from(\n\t\t\t\t// replace the\n\t\t\t\truntimeFile.replace(\n\t\t\t\t\t`import \"@inlang/paraglide-js/urlpattern-polyfill\";`,\n\t\t\t\t\t\"\"\n\t\t\t\t),\n\t\t\t\t\"utf-8\"\n\t\t\t).toString(\"base64\")\n\t)) as Runtime;\n\n\t// expecting the second compile step to overwrite the first\n\texpect(runtime.baseLocale).toBe(\"de\");\n\texpect(runtime.locales).toEqual([\"de\"]);\n});\n\ntest(\"emits additional files\", async () => {\n\tconst additionalFiles = {\n\t\t\"adapter/component.svelte\": \"<script>console.log('hello')</script>\",\n\t\t\"adapter.js\": \"console.log('hello')\",\n\t};\n\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs: fs,\n\t\tadditionalFiles,\n\t});\n\n\tconst outputDir = await fs.promises.readdir(\"/output\");\n\tconst adapterDir = await fs.promises.readdir(\"/output/adapter\");\n\n\texpect(outputDir).toEqual(\n\t\texpect.arrayContaining([\n\t\t\t\"runtime.js\",\n\t\t\t\"server.js\",\n\t\t\t\"messages.js\",\n\t\t\t\"adapter.js\",\n\t\t])\n\t);\n\n\texpect(adapterDir).toEqual([\"component.svelte\"]);\n});\n\ntest(\"includes eslint-disable comment\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tincludeEslintDisableComment: true,\n\t\tfs: fs,\n\t});\n\n\tconst messages = await fs.promises.readFile(\"/output/messages.js\", \"utf8\");\n\n\texpect(messages).toContain(\"/* eslint-disable */\");\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tincludeEslintDisableComment: false,\n\t\tfs: fs,\n\t});\n\n\tconst messagesWithoutComment = await fs.promises.readFile(\n\t\t\"/output/messages.js\",\n\t\t\"utf8\"\n\t);\n\n\texpect(messagesWithoutComment).not.toContain(\"/* eslint-disable */\");\n});\n\ntest(\"default compiler options should include cookied, variable and baseLocale to ensure easy try out of paraglide js, working both in server and browser environemnts\", () => {\n\t// someone trying out paraglide js should be able to call `getLocale()` and `setLocale()`\n\t// without getting an error slammed in their face saying \"define your strategy\".\n\t//\n\t// instead, make the apis work out of the box and once the developer is convinced that\n\t// paraglide js is the right tool for them, they can then define their own strategy.\n\n\texpect(defaultCompilerOptions.strategy).toEqual([\n\t\t\"cookie\",\n\t\t\"globalVariable\",\n\t\t\"baseLocale\",\n\t]);\n});\n\ntest(\"emits warnings for modules that couldn't be imported locally\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t\tmodules: [\"./non-existent-paraglide-plugin.js\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst mock = vi.fn();\n\n\tconsola.mockTypes(() => mock);\n\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tawait compile({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/output\",\n\t\tfs: fs,\n\t});\n\n\texpect(mock).toHaveBeenCalled();\n});\n\ntest(\"emits warnings for modules that couldn't be imported via http\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t\tmodules: [\"https://example.com/non-existent-paraglide-plugin.js\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst mock = vi.fn();\n\n\tconsola.mockTypes(() => mock);\n\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\tconst fetchMock = vi.fn().mockRejectedValue(new TypeError(\"network error\"));\n\tvi.stubGlobal(\"fetch\", fetchMock);\n\n\tconst errorsSpy = vi.spyOn(project.errors, \"get\").mockResolvedValue([\n\t\t{\n\t\t\tmessage:\n\t\t\t\t\"Failed to import module https://example.com/non-existent-paraglide-plugin.js\",\n\t\t} as any,\n\t]);\n\n\t// save project to directory to test loading\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\ttry {\n\t\tawait compile({\n\t\t\tproject: \"/project.inlang\",\n\t\t\toutdir: \"/output\",\n\t\t\tfs: fs,\n\t\t});\n\t} finally {\n\t\tvi.unstubAllGlobals();\n\t\terrorsSpy.mockRestore();\n\t}\n\n\texpect(mock).toHaveBeenCalled();\n});\n"]}
@@ -295,6 +295,14 @@ export type CompilerOptions = {
295
295
  * https://paraglidejs.com/strategy#url
296
296
  */
297
297
  urlPatterns?: Runtime["urlPatterns"];
298
+ /**
299
+ * Controls trailing slash canonicalization for localized URLs.
300
+ *
301
+ * Canonicalization happens before URL pattern matching and after URL
302
+ * localization. If omitted, Paraglide keeps its existing trailing slash
303
+ * behavior.
304
+ */
305
+ trailingSlash?: "always" | "never";
298
306
  /**
299
307
  * Whether to include an eslint-disable comment at the top of each .js file.
300
308
  *
@@ -392,4 +400,3 @@ export type CompilerOptions = {
392
400
  */
393
401
  fs?: any;
394
402
  };
395
- //# sourceMappingURL=compiler-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-options.js","sourceRoot":"","sources":["../../src/compiler/compiler-options.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,IAAI;IACnB,2BAA2B,EAAE,IAAI;IACjC,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,KAAK;IACzB,WAAW,EAAE,IAAI;IACjB,wBAAwB,EAAE,KAAK;IAC/B,qCAAqC,EAAE,KAAK;IAC5C,eAAe,EAAE,kBAAkB;IACnC,QAAQ,EAAE,+BAA+B;IACzC,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,YAAY,CAAC;IACpD,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;IAChC,YAAY,EAAE,EAAE;CAC4B,CAAC"}
1
+ {"version":3,"file":"compiler-options.js","sourceRoot":"","sources":["../../src/compiler/compiler-options.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,IAAI;IACnB,2BAA2B,EAAE,IAAI;IACjC,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,KAAK;IACzB,WAAW,EAAE,IAAI;IACjB,wBAAwB,EAAE,KAAK;IAC/B,qCAAqC,EAAE,KAAK;IAC5C,eAAe,EAAE,kBAAkB;IACnC,QAAQ,EAAE,+BAA+B;IACzC,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,YAAY,CAAC;IACpD,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;IAChC,YAAY,EAAE,EAAE;CAC4B,CAAC","sourcesContent":["import type { Runtime } from \"./runtime/type.js\";\n\nexport type RouteStrategy =\n\t| {\n\t\t\t/**\n\t\t\t * URLPattern-compatible matcher.\n\t\t\t */\n\t\t\tmatch: string;\n\t\t\t/**\n\t\t\t * Strategy override for matching requests.\n\t\t\t */\n\t\t\tstrategy: Runtime[\"strategy\"];\n\t\t\t/**\n\t\t\t * Prevent mutually exclusive configuration (`exclude` + `strategy`).\n\t\t\t */\n\t\t\texclude?: never;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * URLPattern-compatible matcher.\n\t\t\t */\n\t\t\tmatch: string;\n\t\t\t/**\n\t\t\t * Exclude matching requests from i18n middleware behavior.\n\t\t\t */\n\t\t\texclude: true;\n\t\t\t/**\n\t\t\t * Prevent mutually exclusive configuration (`exclude` + `strategy`).\n\t\t\t */\n\t\t\tstrategy?: never;\n\t };\n\nexport const defaultCompilerOptions = {\n\toutputStructure: \"message-modules\",\n\temitGitIgnore: true,\n\tincludeEslintDisableComment: true,\n\temitPrettierIgnore: true,\n\temitReadme: true,\n\temitTsDeclarations: false,\n\tcleanOutdir: true,\n\tdisableAsyncLocalStorage: false,\n\texperimentalMiddlewareLocaleSplitting: false,\n\tlocalStorageKey: \"PARAGLIDE_LOCALE\",\n\tisServer: \"typeof window === 'undefined'\",\n\tstrategy: [\"cookie\", \"globalVariable\", \"baseLocale\"],\n\tcookieName: \"PARAGLIDE_LOCALE\",\n\tcookieMaxAge: 60 * 60 * 24 * 400,\n\tcookieDomain: \"\",\n} as const satisfies Partial<CompilerOptions>;\n\nexport type CompilerOptions = {\n\t/**\n\t * The path to the inlang project.\n\t *\n\t * @example\n\t * ```diff\n\t * await compile({\n\t * + project: \"./project.inlang\",\n\t * outdir: \"./src/paraglide\"\n\t * })\n\t * ```\n\t */\n\tproject: string;\n\t/**\n\t * The path to the output directory.\n\t *\n\t * @example\n\t * ```diff\n\t * await compile({\n\t * project: \"./project.inlang\",\n\t * + outdir: \"./src/paraglide\"\n\t * })\n\t * ```\n\t */\n\toutdir: string;\n\t/**\n\t * The strategy to use for getting the locale.\n\t *\n\t * The order of the strategy defines the precedence of matches.\n\t *\n\t * For example, in `['url', 'cookie', 'baseLocale']`, the locale will be\n\t * first tried to be detected in the url, then in a cookie, and finally\n\t * fallback to the base locale.\n\t *\n\t * The default ensures that the browser takes a cookie approach,\n\t * server-side takes the globalVariable (because cookie is unavailable),\n\t * whereas both fallback to the base locale if not available.\n\t *\n\t * Custom strategies with the pattern `custom-[A-Za-z0-9]+` are supported.\n\t *\n\t * @default [\"cookie\", \"globalVariable\", \"baseLocale\"]\n\t */\n\tstrategy?: Runtime[\"strategy\"];\n\t/**\n\t * Route-level strategy overrides.\n\t *\n\t * Routes are matched in declaration order. The first matching rule wins.\n\t * `match` uses URLPattern syntax.\n\t *\n\t * - `strategy`: Override locale resolution for the matched route.\n\t * - `exclude: true`: Skip i18n middleware behavior for the matched route.\n\t *\n\t * @example\n\t * ```ts\n\t * routeStrategies: [\n\t * { match: \"/dashboard/:path(.*)?\", strategy: [\"cookie\", \"baseLocale\"] },\n\t * { match: \"/api/:path(.*)?\", exclude: true }\n\t * ]\n\t * ```\n\t */\n\trouteStrategies?: RouteStrategy[];\n\t/**\n\t * Whether or not to use experimental middleware locale splitting.\n\t *\n\t * ⚠️ This feature is experimental and only works in SSR/SSG environment\n\t * without client-side routing. Do not rely on this feature for production.\n\t *\n\t * This feature is part of the exploration of per locale splitting. The\n\t * issue is ongoing and can be followed here [#88](https://github.com/opral/inlang-paraglide-js/issues/88).\n\t *\n\t * - The client bundle will tree-shake all messages (have close to 0kb JS).\n\t * - The server middleware will inject the used messages into the HTML.\n\t * - The client will re-trieve the messages from the injected HTML.\n\t *\n\t * @default false\n\t */\n\texperimentalMiddlewareLocaleSplitting?: boolean;\n\t/**\n\t * The name of the localStorage key to use for the localStorage strategy.\n\t *\n\t * @default 'PARAGLIDE_LOCALE'\n\t */\n\tlocalStorageKey?: string;\n\t/**\n\t * Tree-shaking flag if the code is running on the server.\n\t *\n\t * Dependent on the bundler, this flag must be adapted to\n\t * enable tree-shaking.\n\t *\n\t * @example\n\t * // vite\n\t * isServer: \"import.meta.env.SSR\"\n\t *\n\t * @default typeof window === \"undefined\"\n\t */\n\tisServer?: string;\n\t/**\n\t * Compile-time locale constant used for per-locale tree-shaking.\n\t *\n\t * This is experimental and opt-in. It should be a JavaScript expression\n\t * (not a quoted literal) that resolves to a locale or `undefined` at build time.\n\t * You can pass a string literal (e.g. `\"de\"`) for programmatic builds, or an\n\t * injected env/define expression for bundler-driven builds.\n\t *\n\t * High-level flow for per-locale builds:\n\t *\n\t * client request (/)\n\t * |\n\t * v\n\t * +----------------------+\n\t * | detect locale |\n\t * | (cookie/Accept-L) |\n\t * | pick build prefix |\n\t * +----------------------+\n\t * | if \"de\"\n\t * v\n\t * serve dist/de/... <----> serve dist/en/...\n\t * (HTML + assets) (HTML + assets)\n\t *\n\t * @see https://github.com/opral/paraglide-js/issues/88#issuecomment-3634754638\n\t *\n\t * @example\n\t * // Vite define\n\t * experimentalStaticLocale: \"typeof __PARAGLIDE_STATIC_LOCALE__ === 'undefined' ? undefined : __PARAGLIDE_STATIC_LOCALE__\"\n\t *\n\t * @example\n\t * // Programmatic compile (literal)\n\t * experimentalStaticLocale: '\"de\"'\n\t */\n\texperimentalStaticLocale?: string;\n\t/**\n\t * The name of the cookie to use for the cookie strategy.\n\t *\n\t * @default 'PARAGLIDE_LOCALE'\n\t */\n\tcookieName?: string;\n\t/**\n\t * The max-age in seconds of the cookie until it expires.\n\t *\n\t * @default 60 * 60 * 24 * 400\n\t */\n\tcookieMaxAge?: number;\n\t/**\n\t * The host to which the cookie will be sent.\n\t * If undefined or empty, the domain attribute is omitted from the cookie, scoping it to the exact current domain only (no subdomains).\n\t * If specified, the cookie will be available to the specified domain and all its subdomains.\n\t *\n\t * Use this when you need cookies to be shared across subdomains (e.g., between `app.example.com` and `api.example.com`).\n\t * The default behavior (no domain) ensures better compatibility with server-side cookies that don't specify a domain attribute.\n\t *\n\t * @example\n\t * ```ts\n\t * // Default: exact domain only (compatible with server-side cookies)\n\t * cookieDomain: undefined // Cookie: \"PARAGLIDE_LOCALE=en; path=/; max-age=34560000\"\n\t *\n\t * // Subdomain sharing: available across all subdomains\n\t * cookieDomain: \"example.com\" // Cookie: \"PARAGLIDE_LOCALE=en; path=/; max-age=34560000; domain=example.com\"\n\t * ```\n\t *\n\t * @default \"\" (no domain attribute, exact domain only)\n\t */\n\tcookieDomain?: string;\n\t/**\n\t * The `additionalFiles` option is an array of paths to additional files that should be copied to the output directory.\n\t *\n\t * @example\n\t *\n\t * ```diff\n\t * await compile({\n\t * project: \"./project.inlang\",\n\t * outdir: \"./src/paraglide\",\n\t * additionalFiles: [\n\t * + \"my-file.js\": \"console.log('hello')\"\n\t * ]\n\t * })\n\t * ```\n\t *\n\t * The output will look like this:\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - my-file.js\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t */\n\tadditionalFiles?: Record<string, string>;\n\t/**\n\t * If `emitPrettierIgnore` is set to `true` a `.prettierignore` file will be emitted in the output directory. Defaults to `true`.\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - .prettierignore\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t *\n\t * @default true\n\t */\n\temitPrettierIgnore?: boolean;\n\t/**\n\t * If `emitReadme` is set to `true` a `README.md` file will be emitted in the output directory. Defaults to `true`.\n\t *\n\t * The README helps LLMs understand the compiled output.\n\t * See https://llmstxt.org/ for format guidelines.\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - README.md\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t *\n\t * @default true\n\t */\n\temitReadme?: boolean;\n\t/**\n\t * Emit `.d.ts` files for the generated output using the TypeScript compiler.\n\t *\n\t * Useful when `allowJs: true` cannot be set in your `tsconfig.json`\n\t * (e.g., due to project constraints or conflicting compiler options), or when\n\t * an editor language server caches stale JSDoc types for generated messages.\n\t *\n\t * Requires `typescript` to be resolvable in your toolchain.\n\t *\n\t * **Note:** Enabling this option reduces compiler speed because TypeScript\n\t * needs to generate declaration files for all output modules.\n\t *\n\t * **Note:** With TypeScript 5/6 the declarations are generated in-process.\n\t * TypeScript 7+ no longer provides the compiler API, so its `tsc` CLI is\n\t * invoked in a child process instead; the emitted declarations are\n\t * semantically equivalent but differ cosmetically between the two.\n\t *\n\t * @example\n\t * ```ts\n\t * await compile({\n\t * project: \"./project.inlang\",\n\t * outdir: \"./src/paraglide\",\n\t * emitTsDeclarations: true,\n\t * });\n\t * ```\n\t *\n\t * @default false\n\t */\n\temitTsDeclarations?: boolean;\n\t/**\n\t * https://paraglidejs.com/strategy#url\n\t */\n\turlPatterns?: Runtime[\"urlPatterns\"];\n\t/**\n\t * Controls trailing slash canonicalization for localized URLs.\n\t *\n\t * Canonicalization happens before URL pattern matching and after URL\n\t * localization. If omitted, Paraglide keeps its existing trailing slash\n\t * behavior.\n\t */\n\ttrailingSlash?: \"always\" | \"never\";\n\t/**\n\t * Whether to include an eslint-disable comment at the top of each .js file.\n\t *\n\t * @default true\n\t */\n\tincludeEslintDisableComment?: boolean;\n\t/**\n\t * Replaces AsyncLocalStorage with a synchronous implementation.\n\t *\n\t * Leave AsyncLocalStorage enabled by default. This option is a\n\t * compatibility fallback for runtimes that do not provide\n\t * AsyncLocalStorage or `node:async_hooks`.\n\t *\n\t * ⚠️ WARNING: Only use this option when your runtime also guarantees\n\t * request isolation. Disabling AsyncLocalStorage in multi-request\n\t * server environments risks cross-request pollution where state from\n\t * one request could leak into another concurrent request.\n\t */\n\tdisableAsyncLocalStorage?: boolean;\n\t/**\n\t * If `emitGitIgnore` is set to `true` a `.gitignore` file will be emitted in the output directory. Defaults to `true`.\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - .gitignore\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t *\n\t * @default true\n\t */\n\temitGitIgnore?: boolean;\n\t/**\n\t * The `outputStructure` defines how modules are structured in the output.\n\t *\n\t * - `message-modules` - Each module is a message. This is the default.\n\t * - `locale-modules` - Each module is a locale.\n\t *\n\t * It is recommended to use `locale-modules` for development and `message-modules` for production.\n\t * Bundlers speed up the dev mode by bypassing bundling which can lead to many http requests\n\t * during the dev mode with `message-modules`. See https://github.com/opral/inlang-paraglide-js/issues/486.\n\t *\n\t * **`message-modules`**\n\t *\n\t * Messages have their own module which eases tree-shaking for bundlers.\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - blue_elephant_tree/\n\t * + - index.js\n\t * + - en.js\n\t * + - fr.js\n\t * + - sky_phone_bottle/\n\t * + - index.js\n\t * + - en.js\n\t * + - fr.js\n\t * - ...\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t *\n\t * **`locale-modules`**\n\t *\n\t * Messages are bundled in a per locale module. Bundlers often struggle with tree-shaking this structure,\n\t * which can lead to more inefficient tree-shaking and larger bundle sizes compared to `message-modules`.\n\t *\n\t * The benefit are substantially fewer files which is needed in large projects.\n\t *\n\t * ```diff\n\t * - outdir/\n\t * - messages/\n\t * + - de.js\n\t * + - en.js\n\t * + - fr.js\n\t * - ...\n\t * - messages.js\n\t * - runtime.js\n\t * ```\n\t *\n\t * @default \"message-modules\"\n\t */\n\toutputStructure?: \"locale-modules\" | \"message-modules\";\n\t/**\n\t * Whether to clean the output directory before writing the new files.\n\t *\n\t * @default true\n\t */\n\tcleanOutdir?: boolean;\n\n\t/**\n\t * The file system to use. Defaults to `await import('node:fs')`.\n\t *\n\t * Useful for testing the paraglide compiler by mocking the fs.\n\t */\n\tfs?: any;\n};\n"]}
@@ -40,4 +40,3 @@ export declare function createParaglide(args: {
40
40
  } & Omit<CompilerOptions, "outdir" | "project" | "fs">): Promise<Runtime & ServerRuntime & {
41
41
  m: Record<string, unknown>;
42
42
  }>;
43
- //# sourceMappingURL=create-paraglide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-paraglide.js","sourceRoot":"","sources":["../../src/compiler/create-paraglide.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,sBAAsB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,IAKsD;IAEtD,iCAAiC;IACjC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAE9C,kDAAkD;IAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IAEjC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACtD,CAAC;IAED,iCAAiC;IACjC,yDAAyD;IACzD,IAAI,CAAC;QACJ,uCAAuC;QACvC,IAAI,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1C,CAA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CAAC,qCAAqC;gBAC1C,sBAAsB,CAAC,qCAAqC;YAC7D,wBAAwB,EACvB,IAAI,CAAC,wBAAwB;gBAC7B,sBAAsB,CAAC,wBAAwB;SAChD;KACD,CAAC;SACA,OAAO,CAAC,0CAA0C,EAAE,EAAE,CAAC;QACxD,wEAAwE;SACvE,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAE7B,uDAAuD;IACvD,MAAM,eAAe,GAAG;;;;;;;;;;;;KAYpB,CAAC;IAEL,4DAA4D;IAC5D,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,eAAe,CAAC;IAE7E,gEAAgE;IAChE,OAAO,MAAM,MAAM;IAClB,kBAAkB;IAClB,8BAA8B;QAC7B,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACtD,CAAC;AACH,CAAC","sourcesContent":["import type { Runtime } from \"./runtime/type.js\";\nimport type { ServerRuntime } from \"./server/type.js\";\nimport {\n\tdefaultCompilerOptions,\n\ttype CompilerOptions,\n} from \"./compiler-options.js\";\nimport { createRuntimeFile } from \"./runtime/create-runtime.js\";\nimport { createServerFile } from \"./server/create-server-file.js\";\nimport { loadProjectInMemory } from \"@inlang/sdk\";\n\n/**\n * Creates an in-memory Paraglide module for use in tests and non-bundled environments.\n *\n * @example\n *\t const blob = await fs.readFile(\"./project.inlang\");\n * const paraglide = await createParaglide({\n * blob,\n * // other options\n * })\n *\n * // Access functions\n * paraglide.localizeUrl(\"https://example.com\", { locale: \"de\" })\n * app.use(paraglide.paraglideMiddleware())\n *\n * You can load a project from a directory as well.\n *\n * @example\n * import { loadProjectFromDirectory } from \"@inlang/sdk\";\n *\n * \t const project = await loadProjectFromDirectory(\"./project\");\n *\n * const paraglide = await createParaglide({\n * blob: await project.toBlob(),\n * // other options\n * })\n *\n * // Access functions\n * paraglide.localizeUrl(\"https://example.com\", { locale: \"de\" })\n * app.use(paraglide.paraglideMiddleware())\n *\n */\nexport async function createParaglide(\n\targs: {\n\t\t/**\n\t\t * The inlang file.\n\t\t */\n\t\tblob: Blob;\n\t} & Omit<CompilerOptions, \"outdir\" | \"project\" | \"fs\">\n): Promise<Runtime & ServerRuntime & { m: Record<string, unknown> }> {\n\t// Load the project from the blob\n\tconst project = await loadProjectInMemory({ blob: args.blob });\n\tconst settings = await project.settings.get();\n\n\t// Extract baseLocale and locales from the project\n\tconst baseLocale = settings.baseLocale;\n\tconst locales = settings.locales;\n\n\tif (!baseLocale) {\n\t\tthrow new Error(\"Project must have a baseLocale defined\");\n\t}\n\n\tif (!locales || locales.length === 0) {\n\t\tthrow new Error(\"Project must have locales defined\");\n\t}\n\n\t// Ensure URLPattern is available\n\t// Note: This is required for URL-based locale strategies\n\ttry {\n\t\t// Just test if URLPattern is available\n\t\tnew URLPattern({ pathname: \"/:locale\" });\n\t} catch {\n\t\t// Load the polyfill if URLPattern is not available\n\t\tawait import(\"urlpattern-polyfill\");\n\t}\n\n\tconst clientSideRuntime = createRuntimeFile({\n\t\tbaseLocale,\n\t\tlocales,\n\t\tcompilerOptions: {\n\t\t\t...defaultCompilerOptions,\n\t\t\t...args,\n\t\t},\n\t})\n\t\t// remove the polyfill import statement to avoid module resolution issues\n\t\t.replace(`import \"@inlang/paraglide-js/urlpattern-polyfill\";`, \"\");\n\n\t// remove the runtime import statement to avoid module resolution issues\n\tconst serverSideRuntime = createServerFile({\n\t\tcompiledBundles: [],\n\t\tcompilerOptions: {\n\t\t\texperimentalMiddlewareLocaleSplitting:\n\t\t\t\targs.experimentalMiddlewareLocaleSplitting ??\n\t\t\t\tdefaultCompilerOptions.experimentalMiddlewareLocaleSplitting,\n\t\t\tdisableAsyncLocalStorage:\n\t\t\t\targs.disableAsyncLocalStorage ??\n\t\t\t\tdefaultCompilerOptions.disableAsyncLocalStorage,\n\t\t},\n\t})\n\t\t.replace(`import * as runtime from \"./runtime.js\";`, \"\")\n\t\t// the runtime functions are bundled, hence remove the runtime namespace\n\t\t.replaceAll(\"runtime.\", \"\");\n\n\t// Add mock message functions that throw helpful errors\n\tconst mockMessageCode = `\n\texport const m = new Proxy({}, {\n\t\tget(target, prop) {\n\t\t\t// Only handle property access, not other operations like 'in' operator\n\t\t\tif (typeof prop === 'string' && prop !== 'then') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Message functions are not available in createParaglideModule. \" +\n\t\t\t\t\t\"Upvote and explain your use case in https://github.com/opral/inlang-paraglide-js/issues/471\"\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t});`;\n\n\t// Combine client and server runtime code with mock messages\n\tconst combinedCode = clientSideRuntime + serverSideRuntime + mockMessageCode;\n\n\t// Import the combined code dynamically using the data: protocol\n\treturn await import(\n\t\t/* @vite-ignore */\n\t\t\"data:text/javascript;base64,\" +\n\t\t\tBuffer.from(combinedCode, \"utf-8\").toString(\"base64\")\n\t);\n}\n"]}
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=create-paraglide.test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-paraglide.test.js","sourceRoot":"","sources":["../../src/compiler/create-paraglide.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,IAAI,CAAC,gFAAgF,EAAE,KAAK,IAAI,EAAE;IACjG,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC;QACvC,IAAI,EAAE,MAAM,UAAU,CAAC;YACtB,QAAQ,EAAE;gBACT,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;aAC3B;SACD,CAAC;KACF,CAAC,CAAC;IAEH,8CAA8C;IAC9C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,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AAI,EAAE,IAAI,CAAC;aAC3B;SACD,CAAC;KACF,CAAC,CAAC;IAEH,yBAAyB;IACzB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAElC,6DAA6D;IAC7D,MAAM,CAAC,GAAG,EAAE;QACX,oDAAoD;QACpD,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC,OAAO,CAAC,8DAA8D,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from \"vitest\";\nimport { createParaglide } from \"./create-paraglide.js\";\nimport { newProject } from \"@inlang/sdk\";\n\ntest(\"createParaglideModule should create a module with runtime and server functions\", async () => {\n\tconst paraglide = await createParaglide({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Check that runtime properties are available\n\texpect(paraglide.baseLocale).toBe(\"en\");\n\texpect(paraglide.locales).toEqual([\"en\", \"de\", \"fr\"]);\n\texpect(typeof paraglide.localizeUrl).toBe(\"function\");\n\texpect(typeof paraglide.getLocale).toBe(\"function\");\n\texpect(typeof paraglide.setLocale).toBe(\"function\");\n\n\t// Check that server functions are available\n\texpect(typeof paraglide.paraglideMiddleware).toBe(\"function\");\n});\n\ntest(\"createParaglideModule should allow configuring compiler options\", async () => {\n\tconst paraglide = await createParaglide({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t\tstrategy: [\"url\"],\n\t\tcookieName: \"custom-cookie\",\n\t});\n\n\t// Check that compiler options are applied\n\texpect(paraglide.strategy).toEqual([\"url\"]);\n\texpect(paraglide.cookieName).toBe(\"custom-cookie\");\n});\n\ntest(\"createParaglideModule should work with URL localization\", async () => {\n\tconst paraglide = await createParaglide({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t\tstrategy: [\"url\"],\n\t});\n\n\t// Test URL localization\n\tconst url = \"https://example.com/products\";\n\tconst localizedUrl = paraglide.localizeUrl(url, { locale: \"de\" });\n\n\texpect(localizedUrl.href).toBe(\"https://example.com/de/products\");\n\n\t// Test URL delocalization\n\tconst deLocalizedUrl = paraglide.deLocalizeUrl(localizedUrl);\n\texpect(deLocalizedUrl.href).toBe(url);\n});\n\ntest(\"createParaglideModule should provide mock message functions that throw helpful errors\", async () => {\n\tconst paraglide = await createParaglide({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Verify m object exists\n\texpect(paraglide.m).toBeDefined();\n\n\t// Verify accessing a message function throws a helpful error\n\texpect(() => {\n\t\t// @ts-expect-error - We're testing runtime behavior\n\t\tparaglide.m.someMessage();\n\t}).toThrow(/Message functions are not available in createParaglideModule/);\n});\n"]}
@@ -7,4 +7,3 @@
7
7
  export declare function createReadme(args: {
8
8
  projectPath?: string;
9
9
  }): string;
10
- //# sourceMappingURL=create-readme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-readme.js","sourceRoot":"","sources":["../../src/compiler/create-readme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAA8B;IAC1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW;QACxC,CAAC,CAAC,sBAAsB,IAAI,CAAC,WAAW,MAAM;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEN,OAAO;;;EAGN,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6JjB,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"create-readme.js","sourceRoot":"","sources":["../../src/compiler/create-readme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAA8B;IAC1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW;QACxC,CAAC,CAAC,sBAAsB,IAAI,CAAC,WAAW,MAAM;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEN,OAAO;;;EAGN,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6JjB,CAAC;AACF,CAAC","sourcesContent":["/**\n * Creates the README.md content for the compiled output.\n *\n * This helps LLMs understand the compiled Paraglide JS output.\n * See https://llmstxt.org/ for the format guidelines.\n */\nexport function createReadme(args: { projectPath?: string }): string {\n\tconst compiledFromLine = args.projectPath\n\t\t? `\\nCompiled from: \\`${args.projectPath}\\`\\n`\n\t\t: \"\";\n\n\treturn `# Paraglide JS Compiled Output\n\n> Auto-generated i18n message functions. Import \\`messages.js\\` to use translated strings.\n${compiledFromLine}\n\n## What is this folder?\n\nThis folder contains compiled [Paraglide JS](https://github.com/opral/paraglide-js) output. Paraglide JS compiles your translation messages into tree-shakeable JavaScript functions.\n\n## At a glance\n\nPurpose:\n- This folder stores compiled i18n message functions.\n- Source translations live outside this folder in your inlang project.\n\nSafe to import:\n- \\`messages.js\\` — all message functions\n- \\`runtime.js\\` — locale utilities\n- \\`server.js\\` — server-side middleware\n\nDo not edit:\n- All files in this folder are auto-generated.\n- Changes will be overwritten on next compilation.\n\n\\`\\`\\`\nparaglide/\n├── messages.js # Message exports (import this)\n├── messages/ # Individual message functions\n├── runtime.js # Locale detection & configuration\n├── registry.js # Formatting utilities (plural, number, datetime, relativetime)\n├── server.js # Server-side middleware\n└── .gitignore # Marks folder as generated\n\\`\\`\\`\n\n## Usage\n\n\\`\\`\\`js\nimport * as m from \"./paraglide/messages.js\";\n\n// Messages are functions that return localized strings\nm.hello_world(); // \"Hello, World!\" (in current locale)\nm.greeting({ name: \"Sam\" }); // \"Hello, Sam!\"\n\n// Override locale per-call\nm.hello_world({}, { locale: \"de\" }); // \"Hallo, Welt!\"\nm.greeting({ name: \"Sam\" }, { locale: \"de\" }); // \"Hallo, Sam!\"\n\\`\\`\\`\n\n## Runtime API\n\n\\`\\`\\`js\nimport { getLocale, getTextDirection, setLocale, locales, baseLocale } from \"./paraglide/runtime.js\";\n\ngetLocale(); // Current locale, e.g., \"en\"\ngetTextDirection(); // \"ltr\" | \"rtl\" for current locale\nsetLocale(\"de\"); // Set locale\nlocales; // Available locales, e.g., [\"en\", \"de\", \"fr\"]\nbaseLocale; // Default locale, e.g., \"en\"\n\\`\\`\\`\n\n## Strategy\n\nThe strategy determines how the current locale is detected and persisted:\n\n- **Cookie**: Stores locale preference in a cookie.\n- **URL**: Derives locale from URL patterns (e.g., \\`/en/about\\`, \\`en.example.com\\`).\n- **GlobalVariable**: Uses a global variable (client-side only).\n- **BaseLocale**: Always returns the base locale.\n\nStrategies can be combined. The order defines precedence:\n\n\\`\\`\\`js\nawait compile({\n project: \"./project.inlang\",\n outdir: \"./src/paraglide\",\n strategy: [\"url\", \"cookie\", \"baseLocale\"],\n});\n\\`\\`\\`\n\nSee the [strategy documentation](https://paraglidejs.com/strategy) for details.\n\n## Markup (Rich Text)\n\nMessages can contain markup tags for bold, links, and other inline elements. Translators control where tags appear; developers control how they render.\n\nImportant:\n- Tag names are app-defined. There is no built-in list of HTML tags.\n- \\`{#b}...{/b}\\` does not automatically render as \\`<b>...</b>\\`.\n- Renderers/snippets are looked up by the same tag name used in the message.\n\n### Message syntax\n\n\\`\\`\\`json\n{\n \"cta\": \"{#link to=|/docs| rel=$relationship @track}Read the docs{/link}\",\n \"welcome\": \"{#b}Hi {name}{/b}{#icon/}\"\n}\n\\`\\`\\`\n\n- \\`{#tagName}\\` opens a tag, \\`{/tagName}\\` closes it.\n- \\`{#tagName/}\\` creates a standalone tag.\n- Options: \\`to=|/docs|\\` or \\`rel=$relationship\\` (accessed via \\`options.*\\`).\n- Attributes: \\`@track\\` or \\`@variant=|hero|\\` (accessed via \\`attributes.*\\`).\n\nThis is the default inlang message syntax. Paraglide's message format is plugin-based — you can use [ICU MessageFormat 1](https://inlang.com/m/p7c8m1d2/plugin-inlang-icu-messageformat-1), [i18next](https://inlang.com/m/3i8bor92/plugin-inlang-i18next), or other [plugins](https://inlang.com/c/plugins) instead.\n\n### Rendering markup\n\nCalling the message function still returns **plain text** (markup stripped):\n\n\\`\\`\\`js\nm.cta({ relationship: \"noopener\" }); // \"Read the docs\"\n\\`\\`\\`\n\nTo render markup, use the framework adapter or the low-level \\`parts()\\` API:\n\n\\`\\`\\`js\nconst parts = m.cta.parts({ relationship: \"noopener\" });\n// [\n// { type: \"markup-start\", name: \"link\", options: { to: \"/docs\", rel: \"noopener\" }, attributes: { track: true } },\n// { type: \"text\", value: \"Read the docs\" },\n// { type: \"markup-end\", name: \"link\" }\n// ]\n\\`\\`\\`\n\nFramework adapters provide a \\`<ParaglideMessage>\\` component that accepts markup renderers:\n\n- \\`@inlang/paraglide-js-react\\`\n- \\`@inlang/paraglide-js-vue\\`\n- \\`@inlang/paraglide-js-svelte\\`\n- \\`@inlang/paraglide-js-solid\\`\n\n\\`\\`\\`jsx\nimport { ParaglideMessage } from \"@inlang/paraglide-js-react\"; // or -vue, -svelte, -solid\n\n<ParaglideMessage\n message={m.welcome}\n inputs={{ name: \"Ada\" }}\n markup={{\n b: ({ children }) => <b>{children}</b>,\n icon: () => <span aria-hidden=\"true\" className=\"icon-wave\" />,\n }}\n/>\n\\`\\`\\`\n\nThe available renderer/snippet names come from the message itself. You can inspect them through \\`message.parts()\\`, and TypeScript uses the same names to type-check your markup renderers.\n\nSee the [markup documentation](https://paraglidejs.com/markup) for details.\n\n## Key concepts\n\n- **Tree-shakeable**: Each message is a function, enabling [up to 70% smaller i18n bundle sizes](https://paraglidejs.com/benchmark) than traditional i18n libraries.\n- **Typesafe**: Full TypeScript/JSDoc support with autocomplete.\n- **Variants**: Messages can have variants for pluralization, gender, etc.\n- **Fallbacks**: Missing translations fall back to the base locale.\n\n## Links\n\n- [Paraglide JS Documentation](https://paraglidejs.com)\n- [Source Repository](https://github.com/opral/paraglide-js)\n`;\n}\n"]}
@@ -9,4 +9,3 @@
9
9
  * // Merge them into the compiler output before writing to disk
10
10
  */
11
11
  export declare function emitTsDeclarations(output: Record<string, string>): Promise<Record<string, string>>;
12
- //# sourceMappingURL=emit-ts-declarations.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=emit-ts-declarations.interop.test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit-ts-declarations.interop.test.js","sourceRoot":"","sources":["../../src/compiler/emit-ts-declarations.interop.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAEN,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,oEAAoE;AACpE,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,yEAAyE;AACzE,2DAA2D;AAC3D,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,8CAA8C;AAC9C,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;IAChC,MAAM,MAAM,GACX,MAAM,EAAE,CAAC,YAAY,CAA8B,YAAY,CAAC,CA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,EAAE,OAAO,EAAE,CAAC;qBAC3C;iBACD;aACD;SACD;KACD,CAAC;IACF,MAAM,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;QACnC,OAAO;QACP,eAAe,EAAE;YAChB,kBAAkB,EAAE,IAAI;SACxB;KACD,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC9C,yEAAyE;IACzE,yEAAyE;IACzE,MAAM,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CACvD,gDAAgD,CAChD,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test, vi } from \"vitest\";\nimport {\n\ttype BundleNested,\n\tinsertBundleNested,\n\tloadProjectInMemory,\n\tnewProject,\n} from \"@inlang/sdk\";\nimport { compileProject } from \"./compile-project.js\";\n\n// Bundlers and CJS interop can deliver the `typescript` module in a\n// default-only shape (`{ default: ts }` without hoisted named exports).\n// TypeScript 5/6 in that shape must still be routed to the in-process\n// compiler API: the CLI fallback intended for TypeScript 7+ would run\n// TypeScript 5's `tsc`, whose declaration emitter produces syntactically\n// invalid unquoted export aliases (`export { x as a.b }`).\n//\n// `createProgram: undefined` is stubbed explicitly because vitest wraps\n// factory mocks in a proxy that throws on missing exports, while a real\n// default-only namespace returns `undefined`.\nvi.mock(\"typescript\", async () => {\n\tconst actual =\n\t\tawait vi.importActual<typeof import(\"typescript\")>(\"typescript\");\n\treturn {\n\t\tdefault: actual,\n\t\tcreateProgram: undefined,\n\t};\n});\n\ntest(\"emitTsDeclarations uses the compiler API for a default-only interop shape of TypeScript 5\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tlocales: [\"en\"],\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t},\n\t\t}),\n\t});\n\n\tconst bundle: BundleNested = {\n\t\tid: \"greeting.hello\",\n\t\tdeclarations: [],\n\t\tmessages: [\n\t\t\t{\n\t\t\t\tid: \"greeting.hello_en\",\n\t\t\t\tbundleId: \"greeting.hello\",\n\t\t\t\tlocale: \"en\",\n\t\t\t\tselectors: [],\n\t\t\t\tvariants: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"greeting.hello_en_variant\",\n\t\t\t\t\t\tmessageId: \"greeting.hello\",\n\t\t\t\t\t\tmatches: [],\n\t\t\t\t\t\tpattern: [{ type: \"text\", value: \"Hello\" }],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\tawait insertBundleNested(project.db, bundle);\n\n\tconst output = await compileProject({\n\t\tproject,\n\t\tcompilerOptions: {\n\t\t\temitTsDeclarations: true,\n\t\t},\n\t});\n\n\texpect(output).toHaveProperty(\"runtime.d.ts\");\n\t// the quoted alias distinguishes the two paths: TypeScript 5's CLI would\n\t// emit the invalid `export { greeting_hello as greeting.hello }` instead\n\texpect(output[\"messages/greeting_hello.d.ts\"]).toContain(\n\t\t`export { greeting_hello as \"greeting.hello\" };`\n\t);\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"emit-ts-declarations.js","sourceRoot":"","sources":["../../src/compiler/emit-ts-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAI1C,MAAM,wBAAwB,GAAG;;qEAEoC,CAAC;AAEtE,MAAM,6BAA6B,GAAG;;yFAEmD,CAAC;AAE1F;;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EAAE,OAAO,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,OAAO,CAAC,kBAAkB,EAAE,EAAE;YAC7B,IAAI,UAAU,IAAI,kBAAkB,EAAE,CAAC;gBACtC,OAAO,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,kBAAkB,CAAC;QAC3B,CAAC,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,IAA2C;IACxE,OAAO,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,gBAAgB;IAC9B,IAAI,CAAC;QACJ,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,+BAA+B,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACF,CAAC;AAED,SAAS,+BAA+B,CAAC,KAAc;IACtD,IAAI,KAAK,YAAY,KAAK,KAAK,KAAK,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAsB,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import path from \"node:path\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { resolveTscJsPath } from \"./resolve-tsc-js-path.js\";\n\nconst execFileAsync = promisify(execFile);\n\ntype TypeScript = typeof import(\"typescript\");\n\nconst missingTypeScriptMessage = `Paraglide's \"emitTsDeclarations\" option requires the \"typescript\" package.\n\nInstall TypeScript in your project, or disable \"emitTsDeclarations\".`;\n\nconst failedToLoadTypeScriptMessage = `Paraglide's \"emitTsDeclarations\" option requires the \"typescript\" package.\n\nTypeScript appears to be installed, but failed to load. See the error cause for details.`;\n\n/**\n * Generates `.d.ts` files for the compiled Paraglide output using the TypeScript compiler.\n *\n * @param output - The generated compiler output keyed by relative file path.\n * @returns The generated declaration files keyed by relative path.\n *\n * @example\n * const declarations = await emitTsDeclarations(output);\n * // Merge them into the compiler output before writing to disk\n */\nexport async function emitTsDeclarations(\n\toutput: Record<string, string>\n): Promise<Record<string, string>> {\n\tconst ts = await importTypeScript();\n\n\tconst jsEntries = Object.entries(output).filter(([fileName]) =>\n\t\tfileName.endsWith(\".js\")\n\t);\n\n\tif (jsEntries.length === 0) {\n\t\treturn {};\n\t}\n\n\t// TypeScript 7+ (the Go-based compiler) no longer ships the in-process\n\t// compiler API — its main entry point only exports version metadata.\n\t// https://github.com/opral/paraglide-js/issues/711\n\tconst compilerApi = resolveCompilerApi(ts);\n\tif (compilerApi === undefined) {\n\t\treturn emitWithTscCli(jsEntries);\n\t}\n\n\treturn emitWithCompilerApi(compilerApi, jsEntries);\n}\n\n/**\n * Returns the in-process compiler API (TypeScript 5/6), or `undefined` when\n * the installed TypeScript does not provide one (TypeScript 7+).\n *\n * Unwraps default-only interop shapes (`{ default: ts }`) that bundlers and\n * CJS interop can produce. Without the unwrap, TypeScript 5/6 would be\n * misrouted to the CLI path, whose TypeScript 5 declaration emitter produces\n * syntactically invalid quoted export aliases.\n */\nfunction resolveCompilerApi(ts: TypeScript): TypeScript | undefined {\n\tif (typeof ts.createProgram === \"function\") {\n\t\treturn ts;\n\t}\n\tconst defaultExport = (ts as { default?: TypeScript }).default;\n\tif (defaultExport && typeof defaultExport.createProgram === \"function\") {\n\t\treturn defaultExport;\n\t}\n\treturn undefined;\n}\n\n/**\n * Emits declarations with the in-process TypeScript compiler API (TypeScript 5/6).\n */\nasync function emitWithCompilerApi(\n\tts: TypeScript,\n\tjsEntries: [string, string][]\n): Promise<Record<string, string>> {\n\tconst virtualRoot = path.join(process.cwd(), \"__paraglide_virtual_output\");\n\tconst normalizeFileName = (fileName: string) =>\n\t\tpath.normalize(\n\t\t\tpath.isAbsolute(fileName) ? fileName : path.join(virtualRoot, fileName)\n\t\t);\n\n\tconst files = new Map(\n\t\tjsEntries.map(([fileName, content]) => [\n\t\t\tnormalizeFileName(fileName),\n\t\t\tcontent,\n\t\t])\n\t);\n\tconst quotedExportAliases = collectQuotedExportAliases(ts, files);\n\n\tconst virtualDirectories = new Set(\n\t\tArray.from(files.keys()).flatMap((filePath) => {\n\t\t\tconst directories: string[] = [];\n\t\t\tlet current = path.dirname(filePath);\n\t\t\twhile (current.startsWith(virtualRoot) && current !== virtualRoot) {\n\t\t\t\tdirectories.push(current);\n\t\t\t\tconst parent = path.dirname(current);\n\t\t\t\tif (parent === current) break;\n\t\t\t\tcurrent = parent;\n\t\t\t}\n\t\t\treturn directories;\n\t\t})\n\t);\n\t// Ensure the virtual root itself is treated as existing\n\tvirtualDirectories.add(virtualRoot);\n\n\tconst compilerOptions: import(\"typescript\").CompilerOptions = {\n\t\tallowJs: true,\n\t\tcheckJs: true,\n\t\tdeclaration: true,\n\t\temitDeclarationOnly: true,\n\t\tisolatedDeclarations: true,\n\t\tesModuleInterop: true,\n\t\tlib: [\"ESNext\", \"DOM\"],\n\t\tmodule: ts.ModuleKind.ESNext,\n\t\tmoduleResolution: ts.ModuleResolutionKind.Bundler,\n\t\tnoEmitOnError: false,\n\t\toutDir: virtualRoot,\n\t\trootDir: virtualRoot,\n\t\tskipLibCheck: true,\n\t\ttarget: ts.ScriptTarget.ESNext,\n\t};\n\n\tconst defaultHost = ts.createCompilerHost(compilerOptions, true);\n\tconst declarations: Record<string, string> = {};\n\n\tconst host: import(\"typescript\").CompilerHost = {\n\t\t...defaultHost,\n\t\tfileExists: (fileName) => {\n\t\t\tconst normalized = normalizeFileName(fileName);\n\t\t\treturn files.has(normalized) || defaultHost.fileExists(fileName);\n\t\t},\n\t\tdirectoryExists: (directoryName) => {\n\t\t\tconst normalized = normalizeFileName(directoryName);\n\t\t\treturn (\n\t\t\t\tvirtualDirectories.has(normalized) ||\n\t\t\t\tdefaultHost.directoryExists?.(directoryName) === true\n\t\t\t);\n\t\t},\n\t\tgetDirectories: (directoryName) => {\n\t\t\tconst normalized = normalizeFileName(directoryName);\n\t\t\tconst children = Array.from(virtualDirectories).filter(\n\t\t\t\t(dir) => path.dirname(dir) === normalized\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...(defaultHost.getDirectories?.(directoryName) ?? []),\n\t\t\t\t...children.map((dir) => path.basename(dir)),\n\t\t\t];\n\t\t},\n\t\treadFile: (fileName) => {\n\t\t\tconst normalized = normalizeFileName(fileName);\n\t\t\treturn files.get(normalized) ?? defaultHost.readFile(fileName);\n\t\t},\n\t\tgetSourceFile: (\n\t\t\tfileName,\n\t\t\tlanguageVersion,\n\t\t\tonError,\n\t\t\tshouldCreateNewFile\n\t\t) => {\n\t\t\tconst normalized = normalizeFileName(fileName);\n\t\t\tconst sourceText = files.get(normalized);\n\t\t\tif (sourceText !== undefined) {\n\t\t\t\treturn ts.createSourceFile(fileName, sourceText, languageVersion, true);\n\t\t\t}\n\t\t\treturn defaultHost.getSourceFile(\n\t\t\t\tfileName,\n\t\t\t\tlanguageVersion,\n\t\t\t\tonError,\n\t\t\t\tshouldCreateNewFile\n\t\t\t);\n\t\t},\n\t\twriteFile: (fileName, text) => {\n\t\t\tconst relativePath = path\n\t\t\t\t.relative(virtualRoot, fileName)\n\t\t\t\t.split(path.sep)\n\t\t\t\t.join(path.posix.sep);\n\n\t\t\tif (!relativePath.startsWith(\"..\")) {\n\t\t\t\tdeclarations[relativePath] = text;\n\t\t\t}\n\t\t},\n\t};\n\n\tconst program = ts.createProgram(\n\t\tArray.from(files.keys()),\n\t\tcompilerOptions,\n\t\thost\n\t);\n\n\tprogram.emit(undefined, undefined, undefined, true, {\n\t\tafterDeclarations: [\n\t\t\tcreateQuotedExportAliasTransformer(\n\t\t\t\tts,\n\t\t\t\tquotedExportAliases,\n\t\t\t\tnormalizeFileName\n\t\t\t),\n\t\t],\n\t});\n\n\treturn declarations;\n}\n\nconst failedToEmitWithTscMessage = `Paraglide's \"emitTsDeclarations\" option failed to generate declaration files with the installed TypeScript version.\n\nTypeScript 7+ no longer provides the in-process compiler API, so Paraglide invokes its \"tsc\" CLI instead — which did not produce a declaration file for every compiled file. As a workaround, install TypeScript 5 or 6, or disable \"emitTsDeclarations\".`;\n\n/**\n * Emits declarations by invoking the `tsc` CLI of the installed TypeScript\n * package (TypeScript 7+, where the in-process compiler API is unavailable).\n *\n * The compiled output is written to a temporary directory because the\n * Go-based compiler cannot read from a virtual filesystem.\n */\nasync function emitWithTscCli(\n\tjsEntries: [string, string][]\n): Promise<Record<string, string>> {\n\t// entries escaping the output root cannot be declared safely; the\n\t// compiler-API path silently drops them too (see the writeFile hook).\n\t// Checked against both separator conventions because path.join interprets\n\t// backslashes on Windows (`foo\\..\\..\\x.js` would escape the temp dir).\n\tconst safeEntries = jsEntries.filter(([fileName]) =>\n\t\t[path.posix, path.win32].every((platformPath) => {\n\t\t\tconst normalized = platformPath.normalize(fileName);\n\t\t\treturn (\n\t\t\t\tnormalized.startsWith(\"..\") === false &&\n\t\t\t\tplatformPath.isAbsolute(normalized) === false\n\t\t\t);\n\t\t})\n\t);\n\n\t// resolved before spawning so a missing tsc entry point surfaces its own\n\t// pointed error instead of the generic \"no declaration files\" one\n\tconst tscJsPath = resolveTscJsPath();\n\n\tconst tempDir = await fs.mkdtemp(path.join(os.tmpdir(), \"paraglide-dts-\"));\n\n\ttry {\n\t\tconst srcDir = path.join(tempDir, \"src\");\n\t\tconst outDir = path.join(tempDir, \"dist\");\n\t\tawait fs.mkdir(outDir, { recursive: true });\n\n\t\tfor (const [fileName, content] of safeEntries) {\n\t\t\tconst filePath = path.join(srcDir, fileName);\n\t\t\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\t\t\tawait fs.writeFile(filePath, content);\n\t\t}\n\n\t\tconst tsconfigPath = path.join(tempDir, \"tsconfig.json\");\n\t\tawait fs.writeFile(\n\t\t\ttsconfigPath,\n\t\t\tJSON.stringify({\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\tallowJs: true,\n\t\t\t\t\tcheckJs: true,\n\t\t\t\t\tdeclaration: true,\n\t\t\t\t\temitDeclarationOnly: true,\n\t\t\t\t\tesModuleInterop: true,\n\t\t\t\t\tlib: [\"ESNext\", \"DOM\"],\n\t\t\t\t\tmodule: \"ESNext\",\n\t\t\t\t\tmoduleResolution: \"bundler\",\n\t\t\t\t\t// Declaration emit does not need a typecheck; skipping it also\n\t\t\t\t\t// suppresses diagnostics about the project's environment (e.g.\n\t\t\t\t\t// a missing @types/node) that are irrelevant to the output.\n\t\t\t\t\tnoCheck: true,\n\t\t\t\t\tnoEmitOnError: false,\n\t\t\t\t\toutDir: \"./dist\",\n\t\t\t\t\trootDir: \"./src\",\n\t\t\t\t\tskipLibCheck: true,\n\t\t\t\t\ttarget: \"ESNext\",\n\t\t\t\t},\n\t\t\t\tfiles: safeEntries.map(([fileName]) => `./src/${fileName}`),\n\t\t\t})\n\t\t);\n\n\t\tlet tscError: unknown;\n\t\ttry {\n\t\t\tawait execFileAsync(\n\t\t\t\tprocess.execPath,\n\t\t\t\t[tscJsPath, \"--project\", tsconfigPath],\n\t\t\t\t{\n\t\t\t\t\tmaxBuffer: 64 * 1024 * 1024,\n\t\t\t\t\t// Electron-based hosts must execute tsc with their embedded\n\t\t\t\t\t// Node instead of launching another instance of the host app.\n\t\t\t\t\t// Harmless under node and bun.\n\t\t\t\t\tenv: { ...process.env, ELECTRON_RUN_AS_NODE: \"1\" },\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (error) {\n\t\t\t// tsc exits non-zero when the input has diagnostics even though the\n\t\t\t// declaration files are still emitted (noEmitOnError is false).\n\t\t\t// Success is judged by the presence of declaration files below.\n\t\t\ttscError = error;\n\t\t}\n\n\t\tconst declarations: Record<string, string> = {};\n\n\t\tfor (const entry of await fs.readdir(outDir, { recursive: true })) {\n\t\t\tif (entry.endsWith(\".d.ts\")) {\n\t\t\t\tdeclarations[entry.split(path.sep).join(path.posix.sep)] =\n\t\t\t\t\tawait fs.readFile(path.join(outDir, entry), \"utf-8\");\n\t\t\t}\n\t\t}\n\n\t\t// tsc emits exactly one .d.ts per input .js (even for inputs with\n\t\t// syntax errors), so a count mismatch means the compiler died mid-emit\n\t\t// and the result would be silently incomplete.\n\t\tif (Object.keys(declarations).length !== safeEntries.length) {\n\t\t\tthrow new Error(withTscOutput(failedToEmitWithTscMessage, tscError), {\n\t\t\t\tcause: tscError,\n\t\t\t});\n\t\t}\n\n\t\treturn declarations;\n\t} finally {\n\t\tawait fs.rm(tempDir, { recursive: true, force: true });\n\t}\n}\n\n/**\n * Appends the spawned compiler's output to the error message.\n *\n * tsc writes diagnostics to stdout, which `execFile` errors expose only as a\n * property — not in the message — so error reporters that print only\n * message/stack would otherwise hide the reason the emit failed.\n */\nfunction withTscOutput(message: string, tscError: unknown): string {\n\tconst { stdout, stderr } = (tscError ?? {}) as {\n\t\tstdout?: unknown;\n\t\tstderr?: unknown;\n\t};\n\tconst output = [stdout, stderr]\n\t\t.filter((value): value is string => typeof value === \"string\")\n\t\t.join(\"\\n\")\n\t\t.trim();\n\tif (output === \"\") {\n\t\treturn message;\n\t}\n\tconst truncated =\n\t\toutput.length > 4000 ? output.slice(0, 4000) + \"\\n… (truncated)\" : output;\n\treturn `${message}\\n\\nCompiler output:\\n${truncated}`;\n}\n\ntype QuotedExportAliases = Map<string, Map<string, Set<string>>>;\n\nfunction collectQuotedExportAliases(\n\tts: TypeScript,\n\tfiles: Map<string, string>\n): QuotedExportAliases {\n\tconst aliases: QuotedExportAliases = new Map();\n\n\tfor (const [fileName, content] of files) {\n\t\tconst sourceFile = ts.createSourceFile(\n\t\t\tfileName,\n\t\t\tcontent,\n\t\t\tts.ScriptTarget.ESNext,\n\t\t\ttrue,\n\t\t\tts.ScriptKind.JS\n\t\t);\n\t\tconst fileAliases = new Map<string, Set<string>>();\n\n\t\tconst visit = (node: import(\"typescript\").Node) => {\n\t\t\tif (\n\t\t\t\tts.isExportDeclaration(node) &&\n\t\t\t\tnode.exportClause &&\n\t\t\t\tts.isNamedExports(node.exportClause)\n\t\t\t) {\n\t\t\t\tfor (const specifier of node.exportClause.elements) {\n\t\t\t\t\tif (ts.isStringLiteral(specifier.name)) {\n\t\t\t\t\t\tconst localName = moduleExportNameText(\n\t\t\t\t\t\t\tspecifier.propertyName ?? specifier.name\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst exportedName = specifier.name.text;\n\t\t\t\t\t\tconst localAliases =\n\t\t\t\t\t\t\tfileAliases.get(localName) ?? new Set<string>();\n\t\t\t\t\t\tlocalAliases.add(exportedName);\n\t\t\t\t\t\tfileAliases.set(localName, localAliases);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tts.forEachChild(node, visit);\n\t\t};\n\n\t\tvisit(sourceFile);\n\n\t\tif (fileAliases.size > 0) {\n\t\t\taliases.set(fileName, fileAliases);\n\t\t}\n\t}\n\n\treturn aliases;\n}\n\nfunction createQuotedExportAliasTransformer(\n\tts: TypeScript,\n\tquotedExportAliases: QuotedExportAliases,\n\tnormalizeFileName: (fileName: string) => string\n): import(\"typescript\").TransformerFactory<\n\timport(\"typescript\").SourceFile | import(\"typescript\").Bundle\n> {\n\treturn (context) => {\n\t\tconst visitSourceFile = (sourceFile: import(\"typescript\").SourceFile) => {\n\t\t\tconst fileAliases = quotedExportAliases.get(\n\t\t\t\tnormalizeFileName(sourceFile.fileName)\n\t\t\t);\n\n\t\t\tif (!fileAliases) {\n\t\t\t\treturn sourceFile;\n\t\t\t}\n\n\t\t\tconst visit = (\n\t\t\t\tnode: import(\"typescript\").Node\n\t\t\t): import(\"typescript\").VisitResult<import(\"typescript\").Node> => {\n\t\t\t\tif (\n\t\t\t\t\tts.isExportDeclaration(node) &&\n\t\t\t\t\tnode.exportClause &&\n\t\t\t\t\tts.isNamedExports(node.exportClause)\n\t\t\t\t) {\n\t\t\t\t\tconst elements: import(\"typescript\").ExportSpecifier[] = [];\n\t\t\t\t\tconst emitted = new Set<string>();\n\n\t\t\t\t\tfor (const specifier of node.exportClause.elements) {\n\t\t\t\t\t\tconst localName = moduleExportNameText(\n\t\t\t\t\t\t\tspecifier.propertyName ?? specifier.name\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst exportedName = moduleExportNameText(specifier.name);\n\t\t\t\t\t\tconst shouldQuote = fileAliases.get(localName)?.has(exportedName);\n\t\t\t\t\t\tconst nextSpecifier = shouldQuote\n\t\t\t\t\t\t\t? ts.factory.updateExportSpecifier(\n\t\t\t\t\t\t\t\t\tspecifier,\n\t\t\t\t\t\t\t\t\tspecifier.isTypeOnly,\n\t\t\t\t\t\t\t\t\tspecifier.propertyName,\n\t\t\t\t\t\t\t\t\tts.factory.createStringLiteral(exportedName)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: specifier;\n\t\t\t\t\t\tconst emittedKey = `${moduleExportNameText(\n\t\t\t\t\t\t\tnextSpecifier.propertyName ?? nextSpecifier.name\n\t\t\t\t\t\t)}\\0${moduleExportNameText(nextSpecifier.name)}`;\n\n\t\t\t\t\t\tif (!emitted.has(emittedKey)) {\n\t\t\t\t\t\t\telements.push(nextSpecifier);\n\t\t\t\t\t\t\temitted.add(emittedKey);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ts.factory.updateExportDeclaration(\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode.modifiers,\n\t\t\t\t\t\tnode.isTypeOnly,\n\t\t\t\t\t\tts.factory.updateNamedExports(node.exportClause, elements),\n\t\t\t\t\t\tnode.moduleSpecifier,\n\t\t\t\t\t\tnode.attributes\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn ts.visitEachChild(node, visit, context);\n\t\t\t};\n\n\t\t\treturn ts.visitEachChild(sourceFile, visit, context);\n\t\t};\n\n\t\treturn (sourceFileOrBundle) => {\n\t\t\tif (\"fileName\" in sourceFileOrBundle) {\n\t\t\t\treturn visitSourceFile(sourceFileOrBundle);\n\t\t\t}\n\t\t\treturn sourceFileOrBundle;\n\t\t};\n\t};\n}\n\nfunction moduleExportNameText(name: import(\"typescript\").ModuleExportName) {\n\treturn name.text;\n}\n\nasync function importTypeScript(): Promise<TypeScript> {\n\ttry {\n\t\treturn await import(\"typescript\");\n\t} catch (cause) {\n\t\tif (isMissingTypeScriptPackageError(cause)) {\n\t\t\tthrow new Error(missingTypeScriptMessage);\n\t\t}\n\t\tthrow new Error(failedToLoadTypeScriptMessage, { cause });\n\t}\n}\n\nfunction isMissingTypeScriptPackageError(cause: unknown): boolean {\n\tif (cause instanceof Error === false) {\n\t\treturn false;\n\t}\n\tif (\"code\" in cause && cause.code !== \"ERR_MODULE_NOT_FOUND\") {\n\t\treturn false;\n\t}\n\treturn cause.message.includes(\"Cannot find package 'typescript'\");\n}\n"]}
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=emit-ts-declarations.test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit-ts-declarations.test.js","sourceRoot":"","sources":["../../src/compiler/emit-ts-declarations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAEN,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBA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S,GAAG,IAAI,CAAC,IAAI,CAClC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EACnC,mBAAmB,CACnB,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAE/C,MAAM,MAAM,CACX,cAAc,CAAC;QACd,OAAO;QACP,eAAe,EAAE;YAChB,kBAAkB,EAAE,IAAI;SACxB;KACD,CAAC,CACF,CAAC,OAAO,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"emit-ts-declarations.test.js","sourceRoot":"","sources":["../../src/compiler/emit-ts-declarations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAEN,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,2EAA2E;AAC3E,uEAAuE;AACvE,6EAA6E;AAC7E,uEAAuE;AACvE,4DAA4D;AAC5D,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,qBAAqB;AACrB,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;IAChC,MAAM,MAAM,GACX,MAAM,EAAE,CAAC,YAAY,CAAiC,eAAe,CAAC,CAAC;IACxE,OAAO;QACN,GAAG,MAAM;QACT,aAAa,EAAE,SAAS;QACxB,kBAAkB,EAAE,SAAS;QAC7B,gBAAgB,EAAE,SAA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AC,CAAC;QAEH,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC5C,CAAC;QACF,CAAC;QAED,SAAS,CAAC,gBAAgB,CACzB,SAAS,EACT;;;;;IAKC,CACD,CAAC;QAEF,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,WAAW,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACtD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;AACF,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,yFAAyF,EAAE,KAAK,IAAI,EAAE;IAC1G,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAClC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EACnC,mBAAmB,CACnB,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAE/C,MAAM,MAAM,CACX,cAAc,CAAC;QACd,OAAO;QACP,eAAe,EAAE;YAChB,kBAAkB,EAAE,IAAI;SACxB;KACD,CAAC,CACF,CAAC,OAAO,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC","sourcesContent":["import { beforeEach, expect, test, vi } from \"vitest\";\nimport { createProject as typescriptProject, ts } from \"@ts-morph/bootstrap\";\nimport {\n\ttype BundleNested,\n\tinsertBundleNested,\n\tloadProjectInMemory,\n\tnewProject,\n} from \"@inlang/sdk\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { compileProject } from \"./compile-project.js\";\n\n// TypeScript 7 (the Go-based compiler, npm `latest` since 7.0.2) no longer\n// ships the in-process compiler API. Its main entry point only exports\n// `version` and `versionMajorMinor` — no `createProgram`, no `ScriptTarget`,\n// no `ModuleKind`. Emitting declarations must go through the `tsc` CLI\n// instead. https://github.com/opral/paraglide-js/issues/711\n//\n// The repo's own `typescript` dev dependency stays on 5.x for the existing\n// tests; this file swaps in the aliased TypeScript 7 package to simulate a\n// user who upgraded.\n//\n// Note: vitest wraps factory mocks in a proxy that throws on missing exports.\n// The real TypeScript 7 module returns `undefined` for them instead, so the\n// classic compiler API surface is stubbed out explicitly to mirror that.\nvi.mock(\"typescript\", async () => {\n\tconst actual =\n\t\tawait vi.importActual<typeof import(\"typescript-go\")>(\"typescript-go\");\n\treturn {\n\t\t...actual,\n\t\tcreateProgram: undefined,\n\t\tcreateCompilerHost: undefined,\n\t\tcreateSourceFile: undefined,\n\t\tScriptTarget: undefined,\n\t\tScriptKind: undefined,\n\t\tModuleKind: undefined,\n\t\tModuleResolutionKind: undefined,\n\t};\n});\n\n// In production, the `typescript` module and the `tsc` CLI resolve to the\n// same package. In this test the module is mocked with the TypeScript 7\n// alias, so the CLI resolution must point at that alias too — otherwise it\n// would find the repo's TypeScript 5 dev dependency. Mutable so the error\n// path can be tested with a broken resolution.\nconst tscResolution = vi.hoisted(() => ({ tscJsPath: \"\" }));\n\nvi.mock(\"./resolve-tsc-js-path.js\", () => ({\n\tresolveTscJsPath: () => tscResolution.tscJsPath,\n}));\n\nconst typescriptGoTscJsPath = path.join(\n\tpath.dirname(\n\t\tcreateRequire(import.meta.url).resolve(\"typescript-go/package.json\")\n\t),\n\t\"lib\",\n\t\"tsc.js\"\n);\n\nbeforeEach(() => {\n\ttscResolution.tscJsPath = typescriptGoTscJsPath;\n});\n\nasync function newProjectWithMessages() {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: {\n\t\t\t\tlocales: [\"en\"],\n\t\t\t\tbaseLocale: \"en\",\n\t\t\t},\n\t\t}),\n\t});\n\n\t// a message id that is not a valid JS identifier -> quoted export alias\n\tconst quotedAliasBundle: BundleNested = {\n\t\tid: \"greeting.hello\",\n\t\tdeclarations: [],\n\t\tmessages: [\n\t\t\t{\n\t\t\t\tid: \"greeting.hello_en\",\n\t\t\t\tbundleId: \"greeting.hello\",\n\t\t\t\tlocale: \"en\",\n\t\t\t\tselectors: [],\n\t\t\t\tvariants: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"greeting.hello_en_variant\",\n\t\t\t\t\t\tmessageId: \"greeting.hello\",\n\t\t\t\t\t\tmatches: [],\n\t\t\t\t\t\tpattern: [{ type: \"text\", value: \"Hello\" }],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\t// a message with an input so the declarations carry a typed parameter\n\tconst parameterizedBundle: BundleNested = {\n\t\tid: \"balance\",\n\t\tdeclarations: [{ type: \"input-variable\", name: \"amount\" }],\n\t\tmessages: [\n\t\t\t{\n\t\t\t\tid: \"balance_en\",\n\t\t\t\tbundleId: \"balance\",\n\t\t\t\tlocale: \"en\",\n\t\t\t\tselectors: [],\n\t\t\t\tvariants: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"balance_en_variant\",\n\t\t\t\t\t\tmessageId: \"balance\",\n\t\t\t\t\t\tmatches: [],\n\t\t\t\t\t\tpattern: [\n\t\t\t\t\t\t\t{ type: \"text\", value: \"You have \" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"expression\",\n\t\t\t\t\t\t\t\targ: { type: \"variable-reference\", name: \"amount\" },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ type: \"text\", value: \" coins.\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tawait insertBundleNested(project.db, quotedAliasBundle);\n\tawait insertBundleNested(project.db, parameterizedBundle);\n\treturn project;\n}\n\ntest(\"emitTsDeclarations works with TypeScript 7 (tsgo)\", async () => {\n\tconst project = await newProjectWithMessages();\n\n\tfor (const outputStructure of [\n\t\t\"message-modules\",\n\t\t\"locale-modules\",\n\t] as const) {\n\t\tconst output = await compileProject({\n\t\t\tproject,\n\t\t\tcompilerOptions: {\n\t\t\t\temitTsDeclarations: true,\n\t\t\t\toutputStructure,\n\t\t\t\t// path-traversing keys (incl. Windows separators) must be\n\t\t\t\t// silently skipped like on the compiler-API path — neither\n\t\t\t\t// escaping the temp dir nor failing the completeness check\n\t\t\t\tadditionalFiles: {\n\t\t\t\t\t\"../escape.js\": \"export const escape = 1;\",\n\t\t\t\t\t\"foo\\\\..\\\\..\\\\escape.js\": \"export const escape = 1;\",\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\texpect(output[\"../escape.d.ts\"]).toBeUndefined();\n\t\texpect(output[\"foo\\\\..\\\\..\\\\escape.d.ts\"]).toBeUndefined();\n\n\t\texpect(output).toHaveProperty(\"runtime.d.ts\");\n\t\texpect(output).toHaveProperty(\"messages.d.ts\");\n\t\texpect(output).toHaveProperty(\"registry.d.ts\");\n\t\texpect(output[\"runtime.d.ts\"]).toContain(\"getLocale\");\n\n\t\t// TypeScript 5's declaration emitter drops the quotes around export\n\t\t// aliases that are not valid identifiers (worked around by a custom\n\t\t// transformer on the compiler-API path); tsgo emits them correctly.\n\t\tconst declarationFile =\n\t\t\toutputStructure === \"message-modules\"\n\t\t\t\t? \"messages/greeting_hello.d.ts\"\n\t\t\t\t: \"messages/_index.d.ts\";\n\n\t\texpect(output[declarationFile]).toContain(`as \"greeting.hello\"`);\n\n\t\t// the emitted declarations must typecheck for a consumer\n\t\t// (@ts-morph/bootstrap bundles its own compiler and is unaffected\n\t\t// by the TypeScript 7 mock above)\n\t\tconst tsProject = await typescriptProject({\n\t\t\tuseInMemoryFileSystem: true,\n\t\t\tcompilerOptions: {\n\t\t\t\tmodule: ts.ModuleKind.Node16,\n\t\t\t\tmoduleResolution: ts.ModuleResolutionKind.Node16,\n\t\t\t\tstrict: true,\n\t\t\t},\n\t\t});\n\n\t\tfor (const [fileName, code] of Object.entries(output)) {\n\t\t\tif (fileName.endsWith(\".d.ts\")) {\n\t\t\t\ttsProject.createSourceFile(fileName, code);\n\t\t\t}\n\t\t}\n\n\t\ttsProject.createSourceFile(\n\t\t\t\"test.ts\",\n\t\t\t`\n\t\t\t\timport { \"greeting.hello\" as greetingHello, balance } from \"./messages.js\";\n\n\t\t\t\tgreetingHello() satisfies string;\n\t\t\t\tbalance({ amount: 5 }) satisfies string;\n\t\t\t`\n\t\t);\n\n\t\tconst program = tsProject.createProgram();\n\t\tconst diagnostics = ts.getPreEmitDiagnostics(program);\n\t\tfor (const diagnostic of diagnostics) {\n\t\t\tconsole.error(diagnostic.messageText, diagnostic.file?.fileName);\n\t\t}\n\t\texpect(diagnostics.length).toEqual(0);\n\t}\n});\n\ntest(\"emitTsDeclarations throws a descriptive error when the tsc CLI produces no declarations\", async () => {\n\ttscResolution.tscJsPath = path.join(\n\t\tpath.dirname(typescriptGoTscJsPath),\n\t\t\"does-not-exist.js\"\n\t);\n\n\tconst project = await newProjectWithMessages();\n\n\tawait expect(\n\t\tcompileProject({\n\t\t\tproject,\n\t\t\tcompilerOptions: {\n\t\t\t\temitTsDeclarations: true,\n\t\t\t},\n\t\t})\n\t).rejects.toThrow(/did not produce a declaration file for every compiled/);\n});\n"]}
@@ -9,4 +9,3 @@ export { compileMessage } from "./compile-message.js";
9
9
  export { compilePattern } from "./compile-pattern.js";
10
10
  export { writeOutput } from "../services/file-handling/write-output.js";
11
11
  export { createParaglide } from "./create-paraglide.js";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,GAEtB,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,GAEtB,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export {\n\tdefaultCompilerOptions,\n\ttype CompilerOptions,\n} from \"./compiler-options.js\";\nexport type {\n\tLocalizedString,\n\tMessagePart,\n\tMessageMarkupAttribute,\n\tMessageMarkupOption,\n\tMessageMarkupAttributes,\n\tMessageMarkupOptions,\n\tMessageMarkupTag,\n\tMessageMarkupSchema,\n\tMessageMetadata,\n\tMessageBundleFunction,\n\tMessageFunction,\n} from \"./types.js\";\nexport type { Runtime } from \"./runtime/type.js\";\nexport type { ServerRuntime } from \"./server/type.js\";\nexport { compile } from \"./compile.js\";\nexport { compileProject } from \"./compile-project.js\";\nexport { compileBundle } from \"./compile-bundle.js\";\nexport { compileMessage } from \"./compile-message.js\";\nexport { compilePattern } from \"./compile-pattern.js\";\nexport { writeOutput } from \"../services/file-handling/write-output.js\";\nexport { createParaglide } from \"./create-paraglide.js\";\n"]}
@@ -19,4 +19,3 @@ export declare function jsDocBundleFunctionTypes(args: {
19
19
  */
20
20
  export declare function inputsType(inputs: InputVariable[], matchTypes?: InputMatchTypes): string;
21
21
  export declare function inputTypeForName(name: string, matchTypes?: InputMatchTypes): string;
22
- //# sourceMappingURL=jsdoc-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsdoc-types.js","sourceRoot":"","sources":["../../src/compiler/jsdoc-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAO3E,MAAM,UAAU,wBAAwB,CAAC,IAKxC;IACA,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,SAAS,GACd,IAAI,CAAC,iBAAiB,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAEpE,OAAO;YACI,SAAS;uBACE,YAAY;6BACN,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACzB,MAAuB,EACvB,UAA4B;IAE5B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,2FAA2F;IAC3F,MAAM,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAExD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;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B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import type { InputVariable } from \"@inlang/sdk\";\nimport { renderInputMatchTypeVariants } from \"./match-literals.js\";\nimport { isValidIdentifier, quotePropertyKey } from \"./variable-access.js\";\n\nexport type InputMatchTypes = Map<\n\tstring,\n\t{ literals: Set<string>; hasCatchAll: boolean }\n>;\n\nexport function jsDocBundleFunctionTypes(args: {\n\tinputs: InputVariable[];\n\tlocales: string[];\n\tmatchTypes?: InputMatchTypes;\n\tinputTypeOverride?: string;\n}): string {\n\tconst localesUnion = args.locales.map((locale) => `\"${locale}\"`).join(\" | \");\n\tconst inputType =\n\t\targs.inputTypeOverride ?? inputsType(args.inputs, args.matchTypes);\n\n\treturn `\n* @param {${inputType}} inputs\n* @param {{ locale?: ${localesUnion} }} options\n* @returns {LocalizedString}`;\n}\n\n/**\n * Returns the types for the input variables.\n *\n * @example\n * const inputs = [{ name: \"age\" }]\n * inputsType(inputs)\n * >> \"{ age: NonNullable<unknown> }\"\n */\nexport function inputsType(\n\tinputs: InputVariable[],\n\tmatchTypes?: InputMatchTypes\n): string {\n\tif (inputs.length === 0) {\n\t\treturn \"{}\";\n\t}\n\n\t// Deduplicate inputs by name to avoid TypeScript errors with duplicate properties in JSDoc\n\tconst uniqueInputMap = new Map<string, InputVariable>();\n\n\tfor (const input of inputs) {\n\t\tuniqueInputMap.set(input.name, input);\n\t}\n\n\tconst uniqueInputs = Array.from(uniqueInputMap.values());\n\n\tconst inputParams = uniqueInputs\n\t\t.map((input) => {\n\t\t\tconst name = isValidIdentifier(input.name)\n\t\t\t\t? input.name\n\t\t\t\t: quotePropertyKey(input.name);\n\t\t\treturn `${name}: ${resolveInputType(input.name, matchTypes)}`;\n\t\t})\n\t\t.join(\", \");\n\treturn `{ ${inputParams} }`;\n}\n\nfunction resolveInputType(name: string, matchTypes?: InputMatchTypes): string {\n\tif (!matchTypes) return \"NonNullable<unknown>\";\n\n\tconst info = matchTypes.get(name);\n\tif (!info) return \"NonNullable<unknown>\";\n\tif (info.hasCatchAll) return \"NonNullable<unknown>\";\n\n\tconst literals = Array.from(info.literals);\n\tif (literals.length === 0) return \"NonNullable<unknown>\";\n\n\tliterals.sort();\n\treturn literals\n\t\t.flatMap((value) => renderInputMatchTypeVariants(value))\n\t\t.filter((value, index, values) => values.indexOf(value) === index)\n\t\t.join(\" | \");\n}\n\nexport function inputTypeForName(\n\tname: string,\n\tmatchTypes?: InputMatchTypes\n): string {\n\treturn resolveInputType(name, matchTypes);\n}\n"]}
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=jsdoc-types.test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsdoc-types.test.js","sourceRoot":"","sources":["../../src/compiler/jsdoc-types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGxE,IAAI,CAAC,6FAA6F,EAAE,GAAG,EAAE;IACxG,wGAAwG;IACxG,MAAM,MAAM,GAAoB;QAC/B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACxC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,mBAAmB;KAC7D,CAAC;IAEF,mEAAmE;IACnE,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAEtD,+CAA+C;IAC/C,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CACtB,4DAA4D,CAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8CAA8C,EAAE,GAAG,EAAE;IACzD,MAAM,MAAM,GAAoB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,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C;AAEH,IAAI,CAAC,oEAAoE,EAAE,GAAG,EAAE;IAC/E,MAAM,MAAM,GAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAE3E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;QAC1B,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;KAC/D,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAE9C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,yEAAyE,EAAE,GAAG,EAAE;IACpF,MAAM,MAAM,GAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAElC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from \"vitest\";\nimport { inputsType, jsDocBundleFunctionTypes } from \"./jsdoc-types.js\";\nimport type { InputVariable } from \"@inlang/sdk\";\n\ntest(\"inputsType generates unique parameter types even when the same input appears multiple times\", () => {\n\t// Simulate a case where the same input appears multiple times (like in a translation with placeholders)\n\tconst inputs: InputVariable[] = [\n\t\t{ name: \"days\", type: \"input-variable\" },\n\t\t{ name: \"days\", type: \"input-variable\" }, // Duplicated input\n\t];\n\n\t// The generated input type should only include each parameter once\n\tconst result = inputsType(inputs);\n\texpect(result).toBe(\"{ days: NonNullable<unknown> }\");\n\n\t// It should not generate a duplicate parameter\n\texpect(result).not.toBe(\n\t\t\"{ days: NonNullable<unknown>, days: NonNullable<unknown> }\"\n\t);\n});\n\ntest(\"inputsType quotes non-identifier input names\", () => {\n\tconst inputs: InputVariable[] = [{ name: \"half!\", type: \"input-variable\" }];\n\n\tconst result = inputsType(inputs);\n\n\texpect(result).toBe('{ \"half!\": NonNullable<unknown> }');\n});\n\ntest(\"jsDocBundleFunctionTypes correctly handles messages with duplicate inputs\", () => {\n\tconst inputs: InputVariable[] = [\n\t\t{ name: \"days\", type: \"input-variable\" },\n\t\t{ name: \"days\", type: \"input-variable\" }, // Duplicated input\n\t];\n\n\tconst locales = [\"en-us\", \"de-de\"];\n\n\tconst result = jsDocBundleFunctionTypes({ inputs, locales });\n\n\t// The JSDoc should only include each parameter once\n\texpect(result).toContain(\"@param {{ days: NonNullable<unknown> }} inputs\");\n\n\t// It should not contain duplicated parameters\n\texpect(result).not.toContain(\n\t\t\"@param {{ days: NonNullable<unknown>, days: NonNullable<unknown> }} inputs\"\n\t);\n});\n\ntest(\"jsDocBundleFunctionTypes returns LocalizedString type\", () => {\n\tconst inputs: InputVariable[] = [];\n\tconst locales = [\"en\", \"de\"];\n\n\tconst result = jsDocBundleFunctionTypes({ inputs, locales });\n\n\t// The JSDoc should specify LocalizedString as the return type\n\texpect(result).toContain(\"@returns {LocalizedString}\");\n\n\t// It should not return plain string\n\texpect(result).not.toContain(\"@returns {string}\");\n});\n\ntest(\"inputsType emits literal unions for match values\", () => {\n\tconst inputs: InputVariable[] = [\n\t\t{ name: \"type\", type: \"input-variable\" },\n\t\t{ name: \"status\", type: \"input-variable\" },\n\t];\n\n\tconst matchTypes = new Map([\n\t\t[\n\t\t\t\"type\",\n\t\t\t{\n\t\t\t\tliterals: new Set([\"invalid\", \"empty\", \"min_length\"]),\n\t\t\t\thasCatchAll: false,\n\t\t\t},\n\t\t],\n\t\t[\"status\", { literals: new Set([\"ready\", \"done\"]), hasCatchAll: false }],\n\t]);\n\n\tconst result = inputsType(inputs, matchTypes);\n\n\texpect(result).toBe(\n\t\t'{ type: \"empty\" | \"invalid\" | \"min_length\", status: \"done\" | \"ready\" }'\n\t);\n});\n\ntest(\"inputsType accepts both number and string forms for numeric match values\", () => {\n\tconst inputs: InputVariable[] = [{ name: \"input\", type: \"input-variable\" }];\n\n\tconst matchTypes = new Map([\n\t\t[\n\t\t\t\"input\",\n\t\t\t{\n\t\t\t\tliterals: new Set([\"1\", \"2\"]),\n\t\t\t\thasCatchAll: false,\n\t\t\t},\n\t\t],\n\t]);\n\n\tconst result = inputsType(inputs, matchTypes);\n\n\texpect(result).toBe('{ input: 1 | \"1\" | 2 | \"2\" }');\n});\n\ntest(\"inputsType widens infinity match values to number and string forms\", () => {\n\tconst inputs: InputVariable[] = [{ name: \"input\", type: \"input-variable\" }];\n\n\tconst matchTypes = new Map([\n\t\t[\n\t\t\t\"input\",\n\t\t\t{\n\t\t\t\tliterals: new Set([\"Infinity\", \"-Infinity\"]),\n\t\t\t\thasCatchAll: false,\n\t\t\t},\n\t\t],\n\t]);\n\n\tconst result = inputsType(inputs, matchTypes);\n\n\texpect(result).toBe('{ input: number | \"-Infinity\" | \"Infinity\" }');\n});\n\ntest(\"inputsType falls back to NonNullable<unknown> when catchall exists\", () => {\n\tconst inputs: InputVariable[] = [{ name: \"type\", type: \"input-variable\" }];\n\n\tconst matchTypes = new Map([\n\t\t[\"type\", { literals: new Set([\"invalid\"]), hasCatchAll: true }],\n\t]);\n\n\tconst result = inputsType(inputs, matchTypes);\n\n\texpect(result).toBe(\"{ type: NonNullable<unknown> }\");\n});\n\ntest(\"inputsType falls back to NonNullable<unknown> when no match info exists\", () => {\n\tconst inputs: InputVariable[] = [{ name: \"type\", type: \"input-variable\" }];\n\n\tconst result = inputsType(inputs);\n\n\texpect(result).toBe(\"{ type: NonNullable<unknown> }\");\n});\n"]}
@@ -1,3 +1,2 @@
1
1
  export declare function renderInputMatchCondition(inputExpression: string, literalValue: string): string;
2
2
  export declare function renderInputMatchTypeVariants(literalValue: string): string[];
3
- //# sourceMappingURL=match-literals.d.ts.map