@inlang/paraglide-js 2.26.0 → 2.28.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 (225) hide show
  1. package/README.md +11 -1
  2. package/dist/bundler-plugins/per-locale-build/index.js +14 -7
  3. package/dist/bundler-plugins/per-locale-build/index.js.map +1 -1
  4. package/dist/bundler-plugins/per-locale-build/vite-environments.test.js +237 -4
  5. package/dist/bundler-plugins/per-locale-build/vite-environments.test.js.map +1 -1
  6. package/dist/bundler-plugins/unplugin.d.ts +1 -1
  7. package/dist/bundler-plugins/unplugin.js +79 -10
  8. package/dist/bundler-plugins/unplugin.js.map +1 -1
  9. package/dist/bundler-plugins/unplugin.test.js +334 -1
  10. package/dist/bundler-plugins/unplugin.test.js.map +1 -1
  11. package/dist/bundler-plugins/vite.js +2 -1
  12. package/dist/bundler-plugins/vite.js.map +1 -1
  13. package/dist/bundler-plugins/vite.test.js +1 -1
  14. package/dist/bundler-plugins/vite.test.js.map +1 -1
  15. package/dist/cli/commands/compile/command.js +13 -0
  16. package/dist/cli/commands/compile/command.js.map +1 -1
  17. package/dist/cli/commands/compile/command.test.js +87 -3
  18. package/dist/cli/commands/compile/command.test.js.map +1 -1
  19. package/dist/cli/commands/init/command.d.ts +5 -0
  20. package/dist/cli/commands/init/command.js +216 -44
  21. package/dist/cli/commands/init/command.js.map +1 -1
  22. package/dist/cli/commands/init/command.test.d.ts +1 -0
  23. package/dist/cli/commands/init/command.test.js +123 -0
  24. package/dist/cli/commands/init/command.test.js.map +1 -0
  25. package/dist/cli/defaults.js +2 -2
  26. package/dist/cli/defaults.js.map +1 -1
  27. package/dist/cli/init-options.d.ts +11 -0
  28. package/dist/cli/init-options.js +2 -0
  29. package/dist/cli/init-options.js.map +1 -0
  30. package/dist/cli/steps/add-inlang-check.d.ts +19 -0
  31. package/dist/cli/steps/add-inlang-check.js +60 -0
  32. package/dist/cli/steps/add-inlang-check.js.map +1 -0
  33. package/dist/cli/steps/add-inlang-check.test.d.ts +1 -0
  34. package/dist/cli/steps/add-inlang-check.test.js +88 -0
  35. package/dist/cli/steps/add-inlang-check.test.js.map +1 -0
  36. package/dist/cli/steps/add-message-lint.d.ts +34 -0
  37. package/dist/cli/steps/add-message-lint.js +105 -0
  38. package/dist/cli/steps/add-message-lint.js.map +1 -0
  39. package/dist/cli/steps/add-message-lint.test.d.ts +1 -0
  40. package/dist/cli/steps/add-message-lint.test.js +74 -0
  41. package/dist/cli/steps/add-message-lint.test.js.map +1 -0
  42. package/dist/cli/steps/add-vite-plugin.d.ts +18 -0
  43. package/dist/cli/steps/add-vite-plugin.js +34 -6
  44. package/dist/cli/steps/add-vite-plugin.js.map +1 -1
  45. package/dist/cli/steps/add-vite-plugin.test.js +25 -9
  46. package/dist/cli/steps/add-vite-plugin.test.js.map +1 -1
  47. package/dist/cli/steps/agents-md-suggestion.d.ts +11 -0
  48. package/dist/cli/steps/agents-md-suggestion.js +19 -0
  49. package/dist/cli/steps/agents-md-suggestion.js.map +1 -0
  50. package/dist/cli/steps/agents-md-suggestion.test.d.ts +1 -0
  51. package/dist/cli/steps/agents-md-suggestion.test.js +36 -0
  52. package/dist/cli/steps/agents-md-suggestion.test.js.map +1 -0
  53. package/dist/cli/steps/check-for-uncomitted-changes.d.ts +3 -0
  54. package/dist/cli/steps/check-for-uncomitted-changes.js +15 -3
  55. package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -1
  56. package/dist/cli/steps/detect-bundler.d.ts +1 -0
  57. package/dist/cli/steps/detect-bundler.js +7 -1
  58. package/dist/cli/steps/detect-bundler.js.map +1 -1
  59. package/dist/cli/steps/initialize-inlang-project.d.ts +4 -3
  60. package/dist/cli/steps/initialize-inlang-project.js +60 -157
  61. package/dist/cli/steps/initialize-inlang-project.js.map +1 -1
  62. package/dist/cli/steps/maybe-add-machine-translation.d.ts +4 -0
  63. package/dist/cli/steps/maybe-add-machine-translation.js +14 -8
  64. package/dist/cli/steps/maybe-add-machine-translation.js.map +1 -1
  65. package/dist/cli/steps/maybe-add-sherlock.d.ts +2 -0
  66. package/dist/cli/steps/maybe-add-sherlock.js +13 -7
  67. package/dist/cli/steps/maybe-add-sherlock.js.map +1 -1
  68. package/dist/cli/steps/maybe-add-sherlock.test.d.ts +1 -0
  69. package/dist/cli/steps/maybe-add-sherlock.test.js +44 -0
  70. package/dist/cli/steps/maybe-add-sherlock.test.js.map +1 -0
  71. package/dist/cli/steps/prompt-for-outdir.d.ts +2 -0
  72. package/dist/cli/steps/prompt-for-outdir.js +4 -0
  73. package/dist/cli/steps/prompt-for-outdir.js.map +1 -1
  74. package/dist/cli/steps/update-package-json.js +8 -13
  75. package/dist/cli/steps/update-package-json.js.map +1 -1
  76. package/dist/cli/steps/update-ts-config.d.ts +6 -0
  77. package/dist/cli/steps/update-ts-config.js +27 -4
  78. package/dist/cli/steps/update-ts-config.js.map +1 -1
  79. package/dist/cli/utils.d.ts +11 -0
  80. package/dist/cli/utils.js +21 -0
  81. package/dist/cli/utils.js.map +1 -1
  82. package/dist/cli/utils.test.d.ts +1 -0
  83. package/dist/cli/utils.test.js +16 -0
  84. package/dist/cli/utils.test.js.map +1 -0
  85. package/dist/compiler/compile-annotation.d.ts +48 -1
  86. package/dist/compiler/compile-annotation.js +243 -10
  87. package/dist/compiler/compile-annotation.js.map +1 -1
  88. package/dist/compiler/compile-bundle.d.ts +7 -2
  89. package/dist/compiler/compile-bundle.js +97 -3
  90. package/dist/compiler/compile-bundle.js.map +1 -1
  91. package/dist/compiler/compile-bundle.test.js +232 -19
  92. package/dist/compiler/compile-bundle.test.js.map +1 -1
  93. package/dist/compiler/compile-lifecycle.test.d.ts +1 -0
  94. package/dist/compiler/compile-lifecycle.test.js +69 -0
  95. package/dist/compiler/compile-lifecycle.test.js.map +1 -0
  96. package/dist/compiler/compile-local-variable.d.ts +3 -0
  97. package/dist/compiler/compile-local-variable.js +5 -2
  98. package/dist/compiler/compile-local-variable.js.map +1 -1
  99. package/dist/compiler/compile-local-variable.test.js +55 -15
  100. package/dist/compiler/compile-local-variable.test.js.map +1 -1
  101. package/dist/compiler/compile-message.d.ts +29 -1
  102. package/dist/compiler/compile-message.exact-number.test.d.ts +1 -0
  103. package/dist/compiler/compile-message.exact-number.test.js +786 -0
  104. package/dist/compiler/compile-message.exact-number.test.js.map +1 -0
  105. package/dist/compiler/compile-message.js +162 -66
  106. package/dist/compiler/compile-message.js.map +1 -1
  107. package/dist/compiler/compile-message.locals.test.d.ts +1 -0
  108. package/dist/compiler/compile-message.locals.test.js +498 -0
  109. package/dist/compiler/compile-message.locals.test.js.map +1 -0
  110. package/dist/compiler/compile-message.test.js +113 -22
  111. package/dist/compiler/compile-message.test.js.map +1 -1
  112. package/dist/compiler/compile-pattern.d.ts +5 -0
  113. package/dist/compiler/compile-pattern.js +6 -18
  114. package/dist/compiler/compile-pattern.js.map +1 -1
  115. package/dist/compiler/compile-pattern.test.js +169 -5
  116. package/dist/compiler/compile-pattern.test.js.map +1 -1
  117. package/dist/compiler/compile-project.js +5 -1
  118. package/dist/compiler/compile-project.js.map +1 -1
  119. package/dist/compiler/compile-project.test.js +1260 -185
  120. package/dist/compiler/compile-project.test.js.map +1 -1
  121. package/dist/compiler/compile.js +36 -17
  122. package/dist/compiler/compile.js.map +1 -1
  123. package/dist/compiler/compile.test.js +71 -1
  124. package/dist/compiler/compile.test.js.map +1 -1
  125. package/dist/compiler/compiler-options.d.ts +41 -0
  126. package/dist/compiler/compiler-options.js.map +1 -1
  127. package/dist/compiler/create-readme.d.ts +4 -1
  128. package/dist/compiler/create-readme.js +33 -125
  129. package/dist/compiler/create-readme.js.map +1 -1
  130. package/dist/compiler/emit-ts-declarations.interop.test.js +2 -2
  131. package/dist/compiler/emit-ts-declarations.interop.test.js.map +1 -1
  132. package/dist/compiler/emit-ts-declarations.test.js +4 -4
  133. package/dist/compiler/emit-ts-declarations.test.js.map +1 -1
  134. package/dist/compiler/index.d.ts +1 -1
  135. package/dist/compiler/index.js +1 -1
  136. package/dist/compiler/index.js.map +1 -1
  137. package/dist/compiler/input-alias.d.ts +21 -0
  138. package/dist/compiler/input-alias.js +42 -0
  139. package/dist/compiler/input-alias.js.map +1 -0
  140. package/dist/compiler/input-alias.test.d.ts +1 -0
  141. package/dist/compiler/input-alias.test.js +58 -0
  142. package/dist/compiler/input-alias.test.js.map +1 -0
  143. package/dist/compiler/message-locals.d.ts +46 -0
  144. package/dist/compiler/message-locals.js +129 -0
  145. package/dist/compiler/message-locals.js.map +1 -0
  146. package/dist/compiler/output-structure/locale-modules.js +7 -1
  147. package/dist/compiler/output-structure/locale-modules.js.map +1 -1
  148. package/dist/compiler/output-structure/locale-modules.test.js +35 -0
  149. package/dist/compiler/output-structure/locale-modules.test.js.map +1 -1
  150. package/dist/compiler/output-structure/message-modules.js +6 -4
  151. package/dist/compiler/output-structure/message-modules.js.map +1 -1
  152. package/dist/compiler/output-structure/message-modules.test.js +35 -0
  153. package/dist/compiler/output-structure/message-modules.test.js.map +1 -1
  154. package/dist/compiler/registry.d.ts +12 -0
  155. package/dist/compiler/registry.js +158 -31
  156. package/dist/compiler/registry.js.map +1 -1
  157. package/dist/compiler/registry.test.d.ts +1 -0
  158. package/dist/compiler/registry.test.js +291 -0
  159. package/dist/compiler/registry.test.js.map +1 -0
  160. package/dist/compiler/runtime/create-runtime.d.ts +2 -0
  161. package/dist/compiler/runtime/create-runtime.js +9 -0
  162. package/dist/compiler/runtime/create-runtime.js.map +1 -1
  163. package/dist/compiler/runtime/extract-locale-from-cookie.js +8 -1
  164. package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -1
  165. package/dist/compiler/runtime/extract-locale-from-cookie.test.js +26 -0
  166. package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -1
  167. package/dist/compiler/runtime/extract-locale-from-header.js +47 -5
  168. package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -1
  169. package/dist/compiler/runtime/extract-locale-from-header.test.js +58 -0
  170. package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -1
  171. package/dist/compiler/runtime/get-locale.js +7 -1
  172. package/dist/compiler/runtime/get-locale.js.map +1 -1
  173. package/dist/compiler/runtime/get-locale.test.js +95 -0
  174. package/dist/compiler/runtime/get-locale.test.js.map +1 -1
  175. package/dist/compiler/runtime/localize-href.d.ts +8 -0
  176. package/dist/compiler/runtime/localize-href.js +60 -0
  177. package/dist/compiler/runtime/localize-href.js.map +1 -1
  178. package/dist/compiler/runtime/localize-href.test.js +227 -1
  179. package/dist/compiler/runtime/localize-href.test.js.map +1 -1
  180. package/dist/compiler/runtime/set-locale.js +24 -6
  181. package/dist/compiler/runtime/set-locale.js.map +1 -1
  182. package/dist/compiler/runtime/set-locale.test.js +182 -0
  183. package/dist/compiler/runtime/set-locale.test.js.map +1 -1
  184. package/dist/compiler/runtime/type.d.ts +2 -0
  185. package/dist/compiler/runtime/type.js.map +1 -1
  186. package/dist/compiler/runtime/type.test.js +34 -0
  187. package/dist/compiler/runtime/type.test.js.map +1 -1
  188. package/dist/compiler/runtime/variables.d.ts +2 -0
  189. package/dist/compiler/runtime/variables.js +7 -0
  190. package/dist/compiler/runtime/variables.js.map +1 -1
  191. package/dist/compiler/server/create-server-file.js +24 -0
  192. package/dist/compiler/server/create-server-file.js.map +1 -1
  193. package/dist/compiler/server/create-server-file.test.js +8 -2
  194. package/dist/compiler/server/create-server-file.test.js.map +1 -1
  195. package/dist/compiler/server/middleware.d.ts +8 -2
  196. package/dist/compiler/server/middleware.js +204 -11
  197. package/dist/compiler/server/middleware.js.map +1 -1
  198. package/dist/compiler/server/middleware.test.js +750 -3
  199. package/dist/compiler/server/middleware.test.js.map +1 -1
  200. package/dist/eslint/index.d.ts +4 -0
  201. package/dist/eslint/index.js +8 -0
  202. package/dist/eslint/index.js.map +1 -0
  203. package/dist/eslint/no-dynamic-message-access.d.ts +3 -0
  204. package/dist/eslint/no-dynamic-message-access.js +150 -0
  205. package/dist/eslint/no-dynamic-message-access.js.map +1 -0
  206. package/dist/eslint/no-dynamic-message-access.test.d.ts +1 -0
  207. package/dist/eslint/no-dynamic-message-access.test.js +126 -0
  208. package/dist/eslint/no-dynamic-message-access.test.js.map +1 -0
  209. package/dist/eslint/oxlint.test.d.ts +1 -0
  210. package/dist/eslint/oxlint.test.js +64 -0
  211. package/dist/eslint/oxlint.test.js.map +1 -0
  212. package/dist/services/config/config-schema.d.ts +2 -0
  213. package/dist/services/config/config-schema.js +2 -0
  214. package/dist/services/config/config-schema.js.map +1 -1
  215. package/dist/services/config/load-paraglide-config.test.js +12 -0
  216. package/dist/services/config/load-paraglide-config.test.js.map +1 -1
  217. package/dist/services/env-variables/index.js +1 -1
  218. package/dist/services/env-variables/index.js.map +1 -1
  219. package/dist/services/file-handling/write-output.bench.js +51 -11
  220. package/dist/services/file-handling/write-output.bench.js.map +1 -1
  221. package/dist/services/file-handling/write-output.js +60 -20
  222. package/dist/services/file-handling/write-output.js.map +1 -1
  223. package/dist/services/file-handling/write-output.test.js +175 -0
  224. package/dist/services/file-handling/write-output.test.js.map +1 -1
  225. package/package.json +15 -5
@@ -1 +1 @@
1
- {"version":3,"file":"unplugin.test.js","sourceRoot":"","sources":["../../src/bundler-plugins/unplugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,sBAAsB,GACtB,MAAM,aAAa,CAAC;AAErB,IAAI,eAAmC,CAAC;AACxC,IAAI,eAAe,GAAa,EAAE,CAAC;AAEnC,UAAU,CAAC,GAAG,EAAE;IACf,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;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CAAC;QACH,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;AACF,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect, beforeEach, afterEach, vi } from \"vitest\";\nimport consola from \"consola\";\nimport { memfs } from \"memfs\";\nimport path from \"node:path\";\nimport realFs from \"node:fs\";\nimport {\n\tloadProjectInMemory,\n\tnewProject,\n\tsaveProjectToDirectory,\n} from \"@inlang/sdk\";\n\nlet originalNodeEnv: string | undefined;\nlet testDirectories: string[] = [];\n\nbeforeEach(() => {\n\toriginalNodeEnv = process.env.NODE_ENV;\n\n\t// Reset module state between tests so the module-scoped\n\t// `previousCompilation` doesn't leak across tests.\n\tvi.resetModules();\n\n\t// Mock logging methods to suppress error messages in tests\n\tconsola.mockTypes(() => vi.fn());\n});\n\nafterEach(async () => {\n\tif (originalNodeEnv !== undefined) {\n\t\tprocess.env.NODE_ENV = originalNodeEnv;\n\t} else {\n\t\tdelete process.env.NODE_ENV;\n\t}\n\tvi.restoreAllMocks();\n\tfor (const directory of testDirectories.splice(0)) {\n\t\tawait realFs.promises.rm(directory, { recursive: true, force: true });\n\t}\n});\n\n/**\n * Creates a real on-disk fixture: `<workspace>/project.inlang` with a\n * saved inlang project. The paraglide config lives inside the project\n * directory and is loaded through jiti, so it must exist on the real\n * filesystem.\n */\nasync function createProjectFixture(\n\toptions: {\n\t\tlocales?: string[];\n\t\toutdirName?: string;\n\t\t/** `false` skips writing a config file entirely. */\n\t\tconfig?:\n\t\t\t| {\n\t\t\t\t\tfileName?: string;\n\t\t\t\t\tcontent?: string;\n\t\t\t }\n\t\t\t| false;\n\t} = {}\n): Promise<{\n\tworkspace: string;\n\tprojectDir: string;\n\toutdir: string;\n}> {\n\tconst { mkdtemp, mkdir, writeFile } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = await mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"));\n\ttestDirectories.push(workspace);\n\tconst projectDir = path.join(workspace, \"project.inlang\");\n\tawait mkdir(projectDir, { recursive: true });\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: options.locales ?? [\"en\", \"de\"],\n\t\t\t},\n\t\t}),\n\t});\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: projectDir,\n\t\tfs: realFs.promises,\n\t});\n\n\tconst outdir = path.join(workspace, options.outdirName ?? \"test-output\");\n\tif (options.config !== false) {\n\t\tconst content =\n\t\t\toptions.config?.content ??\n\t\t\t[\"export default {\", ` outdir: ${JSON.stringify(outdir)},`, \"}\"].join(\n\t\t\t\t\"\\n\"\n\t\t\t);\n\t\tawait writeFile(\n\t\t\tpath.join(projectDir, options.config?.fileName ?? \"paraglide.config.js\"),\n\t\t\tcontent\n\t\t);\n\t}\n\treturn { workspace, projectDir, outdir };\n}\n\n/** Fires Vite's configResolved so the plugin learns its root. */\nfunction setViteRoot(plugin: any, root: string): void {\n\tconst configResolved =\n\t\t(plugin.vite?.configResolved as\n\t\t\t| { handler?: (config: unknown) => void }\n\t\t\t| undefined) ??\n\t\t(plugin.configResolved as\n\t\t\t| { handler?: (config: unknown) => void }\n\t\t\t| undefined);\n\tconfigResolved?.handler?.({ root });\n}\n\nconst mockContext = { addWatchFile: () => {} };\n\ntest(\"watch mode follows config precedence flips\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst { writeFile, rm } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\tconfig: { fileName: \"paraglide.config.ts\" },\n\t});\n\tconst jsOutdir = path.join(workspace, \"js-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Delete the winning .ts config and create a .js one.\n\tawait rm(path.join(projectDir, \"paraglide.config.ts\"));\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(jsOutdir)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\n\tawait expect(\n\t\tplugin.watchChange?.call(\n\t\t\tmockContext,\n\t\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t\t)\n\t).resolves.toBeUndefined();\n\n\texpect(await realFs.promises.readdir(jsOutdir)).not.toHaveLength(0);\n});\n\ntest(\"vite plugin does not throw on compilation errors in development\", async () => {\n\tconst { paraglideVitePlugin } = await import(\"../bundler-plugins/vite.js\");\n\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { mkdtemp } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = await mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"));\n\ttestDirectories.push(workspace);\n\n\tconst plugin = paraglideVitePlugin({\n\t\tproject: path.join(workspace, \"does-not-exist.inlang\"),\n\t\toutdir: path.join(workspace, \"out\"),\n\t}) as any;\n\n\t// In development mode - should catch errors and NOT throw\n\tawait expect(plugin.buildStart?.call(mockContext)).resolves.toBeUndefined();\n});\n\ntest(\"vite plugin throws on compilation errors at build time\", async () => {\n\tconst { paraglideVitePlugin } = await import(\"../bundler-plugins/vite.js\");\n\n\tprocess.env.NODE_ENV = \"production\";\n\n\tconst { mkdtemp } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = await mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"));\n\ttestDirectories.push(workspace);\n\n\tconst plugin = paraglideVitePlugin({\n\t\tproject: path.join(workspace, \"does-not-exist.inlang\"),\n\t\toutdir: path.join(workspace, \"out\"),\n\t}) as any;\n\n\t// In production mode - should throw the error\n\tawait expect(plugin.buildStart?.call(mockContext)).rejects.toThrow();\n});\n\n// Regression test for https://github.com/opral/inlang-paraglide-js/issues/659:\n// the bundler plugins used to wipe `outdir` on every fresh process, racing\n// concurrent reads (SSR/prerender modules, sibling Vite processes, the\n// config-watcher reload) and producing ENOENT/MISSING_EXPORT/ERR_LOAD_URL.\ntest(\"vite plugin does not wipe outdir during first buildStart (#659)\", async () => {\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t// Pre-seed outdir with a sentinel file mimicking a prior compilation\n\t// still on disk from an earlier process.\n\tawait realFs.promises.mkdir(outdir, { recursive: true });\n\tawait realFs.promises.writeFile(\n\t\tpath.join(outdir, \"__sentinel__.txt\"),\n\t\t\"kept\"\n\t);\n\n\tconst rmSpy = vi.spyOn(realFs.promises, \"rm\");\n\n\tconst plugin = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir,\n\t\tcleanOutdir: true,\n\t}) as any;\n\n\tawait plugin.buildStart?.call(mockContext);\n\n\t// The plugin must not recursively remove the outdir during the first\n\t// compile, even though previousCompilation is undefined. Concurrent\n\t// readers may be holding file handles into outdir.\n\tfor (const call of rmSpy.mock.calls) {\n\t\texpect(String(call[0])).not.toBe(outdir);\n\t}\n});\n\ntest(\"vite plugin warm-restart writes nothing when inputs unchanged (#659)\", async () => {\n\tconst { projectDir, outdir } = await createProjectFixture();\n\tconst mockCtx = { addWatchFile: () => {} };\n\n\t// First process: compile and persist files to outdir.\n\t{\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\t\tawait plugin.buildStart?.call(mockCtx);\n\t}\n\n\t// Second process: simulate a fresh node process by resetting modules so\n\t// the module-scoped `previousCompilation` is undefined again. The plugin\n\t// should seed from on-disk hashes and write zero files (no race window).\n\tvi.resetModules();\n\tconst { paraglideVitePlugin: vitePluginFresh } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin2 = vitePluginFresh({ project: projectDir, outdir }) as any;\n\n\tconst writeFileSpy = vi.spyOn(realFs.promises, \"writeFile\");\n\tawait plugin2.buildStart?.call(mockCtx);\n\n\texpect(writeFileSpy).not.toHaveBeenCalled();\n});\n\n// Regression test for https://github.com/opral/paraglide-js/issues/741:\n// a new Vite process should validate the persisted inputs and output instead\n// of loading the project and compiling every message again.\ntest(\"vite plugin skips compile on an unchanged fresh process (#741)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tlet emitReadme = true;\n\t\tconst optionsGetter = () => ({\n\t\t\temitReadme,\n\t\t});\n\n\t\tconst { projectDir, outdir } = await createProjectFixture({\n\t\t\tlocales: [\"en\", \"de\"],\n\t\t});\n\t\tconst startFreshProcess = async () => {\n\t\t\tvi.resetModules();\n\t\t\tconst { paraglideVitePlugin } =\n\t\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\t\t\tconst plugin = paraglideVitePlugin({\n\t\t\t\tproject: projectDir,\n\t\t\t\toutdir,\n\t\t\t\t...optionsGetter(),\n\t\t\t}) as any;\n\t\t\tawait plugin.buildStart?.call(mockContext);\n\t\t};\n\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// The persisted cache makes the unchanged cold restart skip compile().\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// A file added beside a tracked project input invalidates the cache.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(projectDir, \"new-project-input.txt\"),\n\t\t\t\"new\"\n\t\t);\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\n\t\t// Compiler options are part of the cache key.\n\t\temitReadme = false;\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(3);\n\n\t\t// Generated output is validated too, so edited output self-repairs.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(outdir, \"runtime.js\"),\n\t\t\t\"tampered\"\n\t\t);\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(4);\n\t\texpect(\n\t\t\tawait realFs.promises.readFile(path.join(outdir, \"runtime.js\"), \"utf8\")\n\t\t).not.toBe(\"tampered\");\n\n\t\t// A compiler version change invalidates the persisted cache.\n\t\tconst cacheDirectory = path.join(projectDir, \"cache\", \"paraglide-js\");\n\t\tfor (const cacheFile of await realFs.promises.readdir(cacheDirectory)) {\n\t\t\tconst cachePath = path.join(cacheDirectory, cacheFile as string);\n\t\t\tconst cache = JSON.parse(\n\t\t\t\tawait realFs.promises.readFile(cachePath, \"utf8\")\n\t\t\t);\n\t\t\tcache.compilerVersion = \"0.0.0-stale\";\n\t\t\tawait realFs.promises.writeFile(cachePath, JSON.stringify(cache));\n\t\t}\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(5);\n\n\t\t// A syntactically valid but malformed cache is treated as a miss.\n\t\tfor (const cacheFile of await realFs.promises.readdir(cacheDirectory)) {\n\t\t\tconst cachePath = path.join(cacheDirectory, cacheFile as string);\n\t\t\tconst cache = JSON.parse(\n\t\t\t\tawait realFs.promises.readFile(cachePath, \"utf8\")\n\t\t\t);\n\t\t\tcache.outputHashes = null;\n\t\t\tawait realFs.promises.writeFile(cachePath, JSON.stringify(cache));\n\t\t}\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(6);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// Regression test for https://github.com/opral/paraglide-js/issues/693:\n// `vite build` fires buildStart once per environment (client, ssr) and each\n// run used to do a full compile() even though the inputs hadn't changed.\ntest(\"vite plugin skips compile() when buildStart fires again with unchanged inputs (#693)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture({\n\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t});\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\t// First environment (e.g. client) compiles.\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// Second environment (e.g. ssr) — inputs unchanged, compile skipped.\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// Changing an input file invalidates the digest and recompiles.\n\t\tconst settingsPath = path.join(projectDir, \"settings.json\");\n\t\tconst settings = JSON.parse(\n\t\t\tawait realFs.promises.readFile(settingsPath, \"utf-8\")\n\t\t);\n\t\tsettings.locales = [\"en\", \"de\", \"fr\", \"es\"];\n\t\tawait realFs.promises.writeFile(settingsPath, JSON.stringify(settings));\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// A new file added next to tracked inputs must invalidate the digest via\n// the directory-listing part of the hash, not only edits to known files.\ntest(\"vite plugin recompiles when a file is added to a tracked directory (#693)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// No tracked file changed, but the listing of a tracked directory did.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(projectDir, \"added-later.txt\"),\n\t\t\t\"new\"\n\t\t);\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// After a failed compile the stored digest must not be reused: restoring an\n// input to its previous content has to trigger a real recompile.\ntest(\"vite plugin does not reuse a digest from before a failed compile (#693)\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\tconst settingsPath = path.join(projectDir, \"settings.json\");\n\t\tconst originalSettings = await realFs.promises.readFile(\n\t\t\tsettingsPath,\n\t\t\t\"utf-8\"\n\t\t);\n\n\t\t// Break the settings file — the compile attempt fails (dev mode\n\t\t// swallows the error) and must clear the stored digest.\n\t\tawait realFs.promises.writeFile(settingsPath, \"{ not json\");\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\n\t\t// Restore the exact original content. It must compile again instead\n\t\t// of skipping.\n\t\tawait realFs.promises.writeFile(settingsPath, originalSettings);\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(3);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// Two plugin instances with different filesystems must not share the tracked\n// fs wrapper or cached compilation state — each compiles into its own fs.\n// The project and config live on the real filesystem (the config loader\n// always uses the native fs); only compiler I/O is virtualized here.\ntest(\"vite plugin instances with different fs compile against their own fs (#693)\", async () => {\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\tconst { projectDir, outdir } = await createProjectFixture({\n\t\tlocales: [\"en\"],\n\t});\n\n\tconst fsA = memfs().fs as unknown as typeof import(\"node:fs\");\n\tconst fsB = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// The compiler reads the project through its own fs, so seed a copy of\n\t// the real project into each instance's filesystem at /project.inlang.\n\tasync function seedIntoFs(target: typeof import(\"node:fs\")) {\n\t\tasync function walk(dir: string, virtualDir: string) {\n\t\t\tfor (const entry of await realFs.promises.readdir(dir, {\n\t\t\t\twithFileTypes: true,\n\t\t\t})) {\n\t\t\t\tconst source = path.join(dir, entry.name);\n\t\t\t\tconst destination = path.join(virtualDir, entry.name);\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tawait target.promises.mkdir(destination, { recursive: true });\n\t\t\t\t\tawait walk(source, destination);\n\t\t\t\t} else {\n\t\t\t\t\tawait target.promises.writeFile(\n\t\t\t\t\t\tdestination,\n\t\t\t\t\t\tawait realFs.promises.readFile(source)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tawait target.promises.mkdir(\"/project.inlang\", { recursive: true });\n\t\tawait walk(projectDir, \"/project.inlang\");\n\t}\n\tawait seedIntoFs(fsA);\n\tawait seedIntoFs(fsB);\n\n\tconst pluginA = vitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir,\n\t\tfs: fsA,\n\t}) as any;\n\tawait pluginA.buildStart?.call(mockContext);\n\n\tconst pluginB = vitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir,\n\t\tfs: fsB,\n\t}) as any;\n\tawait pluginB.buildStart?.call(mockContext);\n\t// B's output must exist in B's filesystem — with a shared tracked fs it\n\t// would have been read from and written into A's filesystem instead.\n\tconst outputB = await fsB.promises.readdir(outdir);\n\texpect(outputB.length).toBeGreaterThan(0);\n});\n\n// The plugins must pick up options from a paraglide.config file inside the\n// project directory when they are not passed explicitly, and explicit\n// options must win over the file.\ntest(\"vite plugin reads options from a paraglide config file\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\toutdirName: \"from-config\",\n\t\tconfig: false,\n\t});\n\tconst flagOutdir = path.join(workspace, \"from-flag\");\n\n\t// No config yet: the plugin falls back to the default outdir.\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst pluginWithoutConfig = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir,\n\t}) as any;\n\tsetViteRoot(pluginWithoutConfig, workspace);\n\tawait pluginWithoutConfig.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// A config inside the project directory wins over the defaults...\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\n\t\t\t\"export default {\",\n\t\t\t` outdir: ${JSON.stringify(path.join(workspace, \"from-config-file\"))},`,\n\t\t\t\"}\",\n\t\t].join(\"\\n\")\n\t);\n\tconst pluginWithConfig = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(pluginWithConfig, workspace);\n\tawait pluginWithConfig.buildStart?.call(mockContext);\n\texpect(\n\t\tawait realFs.promises.readdir(path.join(workspace, \"from-config-file\"))\n\t).not.toHaveLength(0);\n\n\t// ...and an explicit option wins over the config file.\n\tconst pluginWithOverride = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir: flagOutdir,\n\t}) as any;\n\tsetViteRoot(pluginWithOverride, workspace);\n\tawait pluginWithOverride.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(flagOutdir)).not.toHaveLength(0);\n});\n\n// A relative `project` option is resolved against the tool root.\ntest(\"resolves a relative project option against the vite root\", async () => {\n\tconst { workspace, projectDir, outdir } = await createProjectFixture();\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({\n\t\tproject: \"./project.inlang\", // relative — resolved against the root\n\t\toutdir,\n\t}) as any;\n\tsetViteRoot(plugin, workspace);\n\n\texpect(projectDir).toBe(path.join(workspace, \"project.inlang\"));\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n});\n\ntest(\"watch mode hot-reloads when the config file changes\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\toutdirName: \"cold-output\",\n\t});\n\tconst hotOutput = path.join(workspace, \"hot-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tconst capturingContext = {\n\t\taddWatchFile: (p: string) => {\n\t\t\taddedWatchFiles.push(p);\n\t\t},\n\t};\n\tconst addedWatchFiles: string[] = [];\n\n\tawait plugin.buildStart?.call(capturingContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Changes to unrelated files do not recompile.\n\tconst outputBefore = await realFs.promises.readdir(outdir);\n\tawait plugin.watchChange?.call(undefined, \"/unrelated.ts\");\n\texpect(await realFs.promises.readdir(outdir)).toEqual(outputBefore);\n\n\t// A config change recompiles with the new options.\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(hotOutput)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\tawait plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t);\n\n\texpect(await realFs.promises.readdir(hotOutput)).not.toHaveLength(0);\n});\n\n// An invalid edited config must not crash the dev server — the previously\n// compiled output keeps being served.\ntest(\"watchChange keeps the previous output when the edited config is invalid\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Break the config, then trigger a change on it.\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t\"export default { outdir: 42 }\"\n\t);\n\tawait expect(\n\t\tplugin.watchChange?.call(\n\t\t\tundefined,\n\t\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t\t)\n\t).resolves.toBeUndefined();\n\n\t// The previous compilation is still in place.\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n});\n\n// An invalid config at startup follows the same policy as compilation\n// errors: swallowed in development, thrown in production.\ntest(\"buildStart does not throw when the config file is invalid in development\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture({ config: false });\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.ts\"),\n\t\t'export default { outdir: \"./o\", cookieMaxAge: \"forever\" }'\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait expect(plugin.buildStart?.call(mockContext)).resolves.toBeUndefined();\n});\n\n// Regression: with no valid cached config (dev server started on an\n// invalid config), an unrelated file change must not reject watchChange —\n// that would crash the bundler's watcher.\ntest(\"watchChange does not throw for unrelated files while the config is invalid\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture({ config: false });\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.ts\"),\n\t\t'export default { outdir: \"./o\", cookieMaxAge: \"forever\" }'\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\t// Swallowed by buildStart; nothing valid ends up in the cache.\n\tawait plugin.buildStart?.call(mockContext);\n\n\tawait expect(\n\t\tplugin.watchChange?.call(undefined, \"/some/unrelated.ts\")\n\t).resolves.toBeUndefined();\n});\n\n// Regression (review): webpack fires one watchChange per modified file and\n// a config event must never be starved by later input events.\ntest(\"queued config events are applied even when input events follow\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir } = await createProjectFixture({\n\t\toutdirName: \"cold-output\",\n\t});\n\tconst hotOutput = path.join(workspace, \"hot-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tawait plugin.buildStart?.call(mockContext);\n\n\t// Volley: input, config, input — fired while the first rebuild is still\n\t// in flight (no awaiting between calls).\n\tconst first = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"messages\", \"en.json\")\n\t);\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(hotOutput)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\tconst second = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t);\n\tconst third = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"messages\", \"de.json\")\n\t);\n\tawait Promise.all([first, second, third]);\n\n\texpect(await realFs.promises.readdir(hotOutput)).not.toHaveLength(0);\n});\n\n// Regression (review): an invalid config in production must fail the build\n// loudly instead of silently compiling with default options.\ntest(\"buildStart throws when the config is invalid in production\", async () => {\n\tprocess.env.NODE_ENV = \"production\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture();\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t\"export default { outdir: 42 }\"\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait expect(plugin.buildStart?.call(mockContext)).rejects.toThrow(\n\t\t/paraglide config/i\n\t);\n});\n\n// Regression (review): pinning outputStructure in the shared defaults\n// template killed the development default (#486). Without an explicit\n// structure, plugins must emit locale-modules outside production.\ntest(\"development default output structure is locale-modules\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t// Ensure at least one message exists so the two structures differ.\n\tawait realFs.promises.mkdir(path.join(projectDir, \"messages\"), {\n\t\trecursive: true,\n\t});\n\tawait writeFile(\n\t\tpath.join(projectDir, \"messages\", \"en.json\"),\n\t\tJSON.stringify({ hello: \"Hello\" })\n\t);\n\tawait writeFile(\n\t\tpath.join(projectDir, \"messages\", \"de.json\"),\n\t\tJSON.stringify({ hello: \"Hallo\" })\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tdelete process.env.NODE_ENV;\n\tawait plugin.buildStart?.call(mockContext);\n\n\tconst messages = await realFs.promises.readdir(path.join(outdir, \"messages\"));\n\texpect(messages).toContain(\"en.js\");\n\texpect(messages).toContain(\"de.js\");\n\texpect(messages).not.toContain(\"hello.js\");\n});\n\n// All four candidate names are registered inside the project directory so\n// renames/format switches are reported even by backends whose watchers only\n// report registered files (webpack).\ntest(\"registers all config candidates inside the project directory\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { workspace, projectDir } = await createProjectFixture({\n\t\tconfig: false,\n\t});\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tconst addedWatchFiles: string[] = [];\n\tawait plugin.buildStart?.call({\n\t\taddWatchFile: (p: string) => {\n\t\t\taddedWatchFiles.push(p);\n\t\t},\n\t});\n\n\tfor (const name of [\n\t\t\"paraglide.config.js\",\n\t\t\"paraglide.config.mjs\",\n\t\t\"paraglide.config.ts\",\n\t\t\"paraglide.config.cjs\",\n\t]) {\n\t\texpect(addedWatchFiles).toContain(path.join(projectDir, name));\n\t}\n});\n"]}
1
+ {"version":3,"file":"unplugin.test.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;QAClB,qBAAqB;QACrB,sBAAsB;QACtB,qBAAqB;QACrB,sBAAsB;KACtB,EAAE,CAAC;QACH,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;AACF,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect, beforeEach, afterEach, vi } from \"vitest\";\nimport consola from \"consola\";\nimport { memfs } from \"memfs\";\nimport path from \"node:path\";\nimport realFs from \"node:fs\";\nimport type { HotPayload, ViteDevServer } from \"vite\";\nimport {\n\tloadProjectInMemory,\n\tnewProject,\n\tsaveProjectToDirectory,\n} from \"@inlang/sdk\";\n\nlet originalNodeEnv: string | undefined;\nlet testDirectories: string[] = [];\n\nbeforeEach(() => {\n\toriginalNodeEnv = process.env.NODE_ENV;\n\n\t// Reset module state between tests so the module-scoped\n\t// `previousCompilation` doesn't leak across tests.\n\tvi.resetModules();\n\n\t// Mock logging methods to suppress error messages in tests\n\tconsola.mockTypes(() => vi.fn());\n});\n\nafterEach(async () => {\n\tif (originalNodeEnv !== undefined) {\n\t\tprocess.env.NODE_ENV = originalNodeEnv;\n\t} else {\n\t\tdelete process.env.NODE_ENV;\n\t}\n\tvi.restoreAllMocks();\n\tfor (const directory of testDirectories.splice(0)) {\n\t\tawait realFs.promises.rm(directory, { recursive: true, force: true });\n\t}\n});\n\n/**\n * Creates a real on-disk fixture: `<workspace>/project.inlang` with a\n * saved inlang project. The paraglide config lives inside the project\n * directory and is loaded through jiti, so it must exist on the real\n * filesystem.\n */\nasync function createProjectFixture(\n\toptions: {\n\t\tlocales?: string[];\n\t\toutdirName?: string;\n\t\t/** `false` skips writing a config file entirely. */\n\t\tconfig?:\n\t\t\t| {\n\t\t\t\t\tfileName?: string;\n\t\t\t\t\tcontent?: string;\n\t\t\t }\n\t\t\t| false;\n\t} = {}\n): Promise<{\n\tworkspace: string;\n\tprojectDir: string;\n\toutdir: string;\n}> {\n\tconst { mkdtemp, mkdir, writeFile } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = realFs.realpathSync(\n\t\tawait mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"))\n\t);\n\ttestDirectories.push(workspace);\n\tconst projectDir = path.join(workspace, \"project.inlang\");\n\tawait mkdir(projectDir, { recursive: true });\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: options.locales ?? [\"en\", \"de\"],\n\t\t\t},\n\t\t}),\n\t});\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: projectDir,\n\t\tfs: realFs.promises,\n\t});\n\n\tconst outdir = path.join(workspace, options.outdirName ?? \"test-output\");\n\tif (options.config !== false) {\n\t\tconst content =\n\t\t\toptions.config?.content ??\n\t\t\t[\"export default {\", ` outdir: ${JSON.stringify(outdir)},`, \"}\"].join(\n\t\t\t\t\"\\n\"\n\t\t\t);\n\t\tawait writeFile(\n\t\t\tpath.join(projectDir, options.config?.fileName ?? \"paraglide.config.js\"),\n\t\t\tcontent\n\t\t);\n\t}\n\treturn { workspace, projectDir, outdir };\n}\n\n/** Fires Vite's configResolved so the plugin learns its root. */\nfunction setViteRoot(plugin: any, root: string): void {\n\tconst configResolved =\n\t\t(plugin.vite?.configResolved as\n\t\t\t| { handler?: (config: unknown) => void }\n\t\t\t| undefined) ??\n\t\t(plugin.configResolved as\n\t\t\t| { handler?: (config: unknown) => void }\n\t\t\t| undefined);\n\tconfigResolved?.handler?.({ root });\n}\n\nconst mockContext = { addWatchFile: () => {} };\n\nfunction configureViteServer(plugin: any) {\n\tconst ws = {\n\t\tsend: vi.fn(),\n\t\tclients: new Set([{}]),\n\t\ton: vi.fn(),\n\t};\n\tplugin.configureServer?.({ ws });\n\treturn ws;\n}\n\nasync function connectViteClient(server: ViteDevServer) {\n\tconst url = new URL(server.resolvedUrls!.local[0]!);\n\turl.protocol = \"ws:\";\n\turl.searchParams.set(\"token\", server.config.webSocketToken);\n\tconst socket = new WebSocket(url, \"vite-hmr\");\n\tconst messages: HotPayload[] = [];\n\tsocket.addEventListener(\"message\", (event) => {\n\t\tmessages.push(JSON.parse(String(event.data)));\n\t});\n\tawait vi.waitFor(() => {\n\t\texpect(messages).toContainEqual({ type: \"connected\" });\n\t});\n\t// A message sent after connection callbacks provides a transport barrier.\n\tserver.ws.send({ type: \"custom\", event: \"paraglide:test-barrier\" });\n\tawait vi.waitFor(() => {\n\t\texpect(messages).toContainEqual({\n\t\t\ttype: \"custom\",\n\t\t\tevent: \"paraglide:test-barrier\",\n\t\t});\n\t});\n\treturn { socket, messages };\n}\n\nasync function startOverlayServer(invalidSettings = false) {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst { createServer } = await import(\"vite\");\n\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\tconst fixture = await createProjectFixture();\n\tconst { workspace, projectDir, outdir } = fixture;\n\tconst file = path.join(projectDir, \"settings.json\");\n\tconst original = await realFs.promises.readFile(file, \"utf8\");\n\tif (invalidSettings) await realFs.promises.writeFile(file, \"{\");\n\tawait realFs.promises.writeFile(\n\t\tpath.join(workspace, \"index.html\"),\n\t\t\"<html><body>Translation preview</body></html>\"\n\t);\n\tconst server = await createServer({\n\t\troot: workspace,\n\t\tconfigFile: false,\n\t\tlogLevel: \"silent\",\n\t\tplugins: [paraglideVitePlugin({ project: projectDir, outdir })],\n\t\tserver: { host: \"127.0.0.1\", port: 0, watch: null },\n\t\toptimizeDeps: { noDiscovery: true, include: [] },\n\t});\n\ttry {\n\t\tawait server.listen();\n\t} catch (error) {\n\t\tawait server.close();\n\t\tthrow error;\n\t}\n\treturn { ...fixture, server, file, original };\n}\n\ntest.each([\"settings\", \"config\"])(\n\t\"vite error overlay reports invalid %s at startup and clears after recovery\",\n\tasync (source) => {\n\t\tprocess.env.NODE_ENV = \"development\";\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\t\tconst file = path.join(\n\t\t\tprojectDir,\n\t\t\tsource === \"settings\" ? \"settings.json\" : \"paraglide.config.js\"\n\t\t);\n\t\tconst original = await realFs.promises.readFile(file, \"utf8\");\n\t\tawait realFs.promises.writeFile(\n\t\t\tfile,\n\t\t\tsource === \"settings\" ? \"{\" : \"export default { outdir: 42 }\"\n\t\t);\n\t\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\t\tconst plugin = paraglideVitePlugin({ project: projectDir, outdir }) as any;\n\t\tconst { send } = configureViteServer(plugin);\n\n\t\tawait expect(plugin.buildStart.call(mockContext)).resolves.toBeUndefined();\n\t\texpect(send).toHaveBeenCalledWith({\n\t\t\ttype: \"error\",\n\t\t\terr: {\n\t\t\t\tmessage: expect.any(String),\n\t\t\t\tstack: expect.any(String),\n\t\t\t\tplugin: \"unplugin-paraglide-js\",\n\t\t\t},\n\t\t});\n\t\texpect(send.mock.calls[0]![0].err.message.length).toBeGreaterThan(0);\n\n\t\tawait realFs.promises.writeFile(file, original);\n\t\tawait plugin.watchChange.call(mockContext, file);\n\t\texpect(send).toHaveBeenLastCalledWith({ type: \"full-reload\" });\n\t\texpect(await realFs.promises.readdir(outdir)).toContain(\"runtime.js\");\n\t}\n);\n\ntest.each([\"settings\", \"config\"])(\n\t\"vite error overlay recovers from invalid %s and preserves the last output until recovery\",\n\tasync (source) => {\n\t\tprocess.env.NODE_ENV = \"development\";\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\t\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\t\tconst writeFile = vi.spyOn(realFs.promises, \"writeFile\");\n\t\tconst plugin = paraglideVitePlugin({ project: projectDir, outdir }) as any;\n\t\tconst { send } = configureViteServer(plugin);\n\t\tawait plugin.buildStart.call(mockContext);\n\t\texpect(send).not.toHaveBeenCalled();\n\t\tconst runtime = await realFs.promises.readFile(\n\t\t\tpath.join(outdir, \"runtime.js\"),\n\t\t\t\"utf8\"\n\t\t);\n\t\tconst file = path.join(\n\t\t\tprojectDir,\n\t\t\tsource === \"settings\" ? \"settings.json\" : \"paraglide.config.js\"\n\t\t);\n\t\tconst original = await realFs.promises.readFile(file, \"utf8\");\n\t\tawait realFs.promises.writeFile(\n\t\t\tfile,\n\t\t\tsource === \"settings\" ? \"{\" : \"export default { outdir: 42 }\"\n\t\t);\n\t\tawait expect(\n\t\t\tplugin.watchChange.call(mockContext, file)\n\t\t).resolves.toBeUndefined();\n\t\texpect(send).toHaveBeenLastCalledWith({\n\t\t\ttype: \"error\",\n\t\t\terr: expect.objectContaining({ message: expect.any(String) }),\n\t\t});\n\t\texpect(\n\t\t\tawait realFs.promises.readFile(path.join(outdir, \"runtime.js\"), \"utf8\")\n\t\t).toBe(runtime);\n\n\t\tawait plugin.watchChange.call(mockContext, path.join(outdir, \"runtime.js\"));\n\t\texpect(send).toHaveBeenCalledTimes(1);\n\t\tawait realFs.promises.writeFile(file, original);\n\t\twriteFile.mockClear();\n\t\tawait plugin.watchChange.call(mockContext, file);\n\t\texpect(send).toHaveBeenLastCalledWith({ type: \"full-reload\" });\n\t\tconst outputWrites = writeFile.mock.calls.filter(([file]) =>\n\t\t\tString(file).startsWith(outdir)\n\t\t);\n\t\tif (source === \"config\") {\n\t\t\texpect(outputWrites).toHaveLength(0);\n\t\t} else {\n\t\t\texpect(outputWrites.length).toBeGreaterThan(0);\n\t\t}\n\t\tawait plugin.watchChange.call(mockContext, file);\n\t\texpect(send).toHaveBeenCalledTimes(2);\n\t}\n);\n\ntest(\"vite error overlay prevents generated HMR while the config remains invalid\", async () => {\n\tconst { server, workspace, projectDir, outdir, file, original } =\n\t\tawait startOverlayServer();\n\ttry {\n\t\tconst main = path.join(workspace, \"main.js\");\n\t\tawait realFs.promises.writeFile(\n\t\t\tmain,\n\t\t\t\"import './test-output/runtime.js'; import.meta.hot.accept(); import.meta.hot.accept('./test-output/runtime.js', () => {});\"\n\t\t);\n\t\tawait server.transformRequest(\"/main.js\");\n\t\tawait server.transformRequest(\"/test-output/runtime.js\");\n\t\tconst client = await connectViteClient(server);\n\t\tserver.watcher.emit(\"change\", main);\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages.some((message) => message.type === \"update\")).toBe(\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t\tawait server.transformRequest(\"/main.js\");\n\n\t\tconst configFile = path.join(projectDir, \"paraglide.config.js\");\n\t\tconst config = await realFs.promises.readFile(configFile, \"utf8\");\n\t\tawait realFs.promises.writeFile(\n\t\t\tconfigFile,\n\t\t\t\"export default { outdir: 42 }\"\n\t\t);\n\t\tawait server.pluginContainer.watchChange(configFile, { event: \"update\" });\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t\tconst runtimeFile = path.join(outdir, \"runtime.js\");\n\t\tconst outputBefore = await realFs.promises.readFile(runtimeFile, \"utf8\");\n\t\tconst settings = JSON.parse(original);\n\t\tsettings.locales.push(\"fr\");\n\t\tawait realFs.promises.writeFile(file, JSON.stringify(settings));\n\t\tawait server.pluginContainer.watchChange(file, { event: \"update\" });\n\t\tconst outputAfter = await realFs.promises.readFile(runtimeFile, \"utf8\");\n\t\t// The fixture disables file watching; deliver the event a changed output produces.\n\t\tif (outputAfter !== outputBefore) {\n\t\t\tserver.watcher.emit(\"change\", runtimeFile);\n\t\t\tawait vi.waitFor(() =>\n\t\t\t\texpect(\n\t\t\t\t\tclient.messages.filter((message) => message.type === \"update\")\n\t\t\t\t).toHaveLength(2)\n\t\t\t);\n\t\t}\n\t\tserver.ws.send({ type: \"custom\", event: \"paraglide:input-processed\" });\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages).toContainEqual({\n\t\t\t\ttype: \"custom\",\n\t\t\t\tevent: \"paraglide:input-processed\",\n\t\t\t})\n\t\t);\n\t\texpect(\n\t\t\tclient.messages\n\t\t\t\t.filter((message) =>\n\t\t\t\t\t[\"update\", \"error\", \"full-reload\"].includes(message.type)\n\t\t\t\t)\n\t\t\t\t.at(-1)?.type\n\t\t).toBe(\"error\");\n\t\texpect(outputAfter).toBe(outputBefore);\n\t\texpect((await fetch(server.resolvedUrls!.local[0]!)).status).toBe(200);\n\n\t\tawait realFs.promises.writeFile(configFile, config);\n\t\tawait server.pluginContainer.watchChange(configFile, { event: \"update\" });\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages).toContainEqual({ type: \"full-reload\" })\n\t\t);\n\t\texpect(await realFs.promises.readFile(runtimeFile, \"utf8\")).not.toBe(\n\t\t\toutputBefore\n\t\t);\n\t} finally {\n\t\tawait server.close();\n\t}\n});\n\ntest(\"vite error overlay still reports failures after restarting an inline plugin\", async () => {\n\tconst { server, file } = await startOverlayServer();\n\ttry {\n\t\tawait server.restart();\n\t\tconst client = await connectViteClient(server);\n\t\tawait realFs.promises.writeFile(file, \"{\");\n\t\tawait server.pluginContainer.watchChange(file, { event: \"update\" });\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t} finally {\n\t\tawait server.close();\n\t}\n});\n\ntest(\"vite error overlay retains errors without buffering them in Vite\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst { projectDir, outdir } = await createProjectFixture();\n\tconst file = path.join(projectDir, \"settings.json\");\n\tconst original = await realFs.promises.readFile(file, \"utf8\");\n\tawait realFs.promises.writeFile(file, \"{\");\n\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\tconst plugin = paraglideVitePlugin({ project: projectDir, outdir }) as any;\n\tconst ws = configureViteServer(plugin);\n\tws.clients.clear();\n\tawait plugin.buildStart.call(mockContext);\n\texpect(ws.send).not.toHaveBeenCalled();\n\texpect(ws.on).toHaveBeenCalledWith(\"connection\", expect.any(Function));\n\tconst onConnection = ws.on.mock.calls[0]![1];\n\tconst socket = { send: vi.fn() };\n\tonConnection(socket);\n\texpect(JSON.parse(socket.send.mock.calls[0]![0])).toMatchObject({\n\t\ttype: \"error\",\n\t\terr: { message: expect.any(String), plugin: \"unplugin-paraglide-js\" },\n\t});\n\tawait realFs.promises.writeFile(file, original);\n\tawait plugin.watchChange.call(mockContext, file);\n\texpect(ws.send).not.toHaveBeenCalled();\n\tsocket.send.mockClear();\n\tonConnection(socket);\n\texpect(socket.send).not.toHaveBeenCalled();\n});\n\ntest(\"vite error overlay preserves compiler diagnostics and clears after a successful buildStart\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst actual = await vi.importActual<typeof import(\"../compiler/compile.js\")>(\n\t\t\"../compiler/compile.js\"\n\t);\n\tconst error = new SyntaxError(\"Invalid message pattern in messages/en.json\");\n\tconst compile = vi.fn(actual.compile).mockRejectedValueOnce(error);\n\tvi.doMock(\"../compiler/compile.js\", () => ({ ...actual, compile }));\n\ttry {\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\t\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\t\tconst plugin = paraglideVitePlugin({ project: projectDir, outdir }) as any;\n\t\tconst { send } = configureViteServer(plugin);\n\t\tawait plugin.buildStart.call(mockContext);\n\t\texpect(send).toHaveBeenCalledWith({\n\t\t\ttype: \"error\",\n\t\t\terr: {\n\t\t\t\tmessage: error.message,\n\t\t\t\tstack: error.stack,\n\t\t\t\tplugin: \"unplugin-paraglide-js\",\n\t\t\t},\n\t\t});\n\t\tawait plugin.buildStart.call(mockContext);\n\t\texpect(send).toHaveBeenLastCalledWith({ type: \"full-reload\" });\n\t\tawait plugin.buildStart.call(mockContext);\n\t\texpect(send).toHaveBeenCalledTimes(2);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\ntest(\"vite error overlay reports non-Error compiler failures during watchChange\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst actual = await vi.importActual<typeof import(\"../compiler/compile.js\")>(\n\t\t\"../compiler/compile.js\"\n\t);\n\tconst compile = vi.fn(actual.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({ ...actual, compile }));\n\ttry {\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\t\tconst { paraglideVitePlugin } = await import(\"./vite.js\");\n\t\tconst plugin = paraglideVitePlugin({ project: projectDir, outdir }) as any;\n\t\tconst { send } = configureViteServer(plugin);\n\t\tawait plugin.buildStart.call(mockContext);\n\t\tcompile.mockRejectedValueOnce(\"Invalid translation\");\n\t\tconst file = path.join(projectDir, \"settings.json\");\n\t\tawait plugin.watchChange.call(mockContext, file);\n\t\texpect(send).toHaveBeenLastCalledWith({\n\t\t\ttype: \"error\",\n\t\t\terr: {\n\t\t\t\tmessage: \"Invalid translation\",\n\t\t\t\tstack: expect.any(String),\n\t\t\t\tplugin: \"unplugin-paraglide-js\",\n\t\t\t},\n\t\t});\n\t\tawait plugin.watchChange.call(mockContext, file);\n\t\texpect(send).toHaveBeenLastCalledWith({ type: \"full-reload\" });\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\ntest(\"vite error overlay keeps serving requests while the dev watcher recovers\", async () => {\n\tconst { server, file, original } = await startOverlayServer();\n\ttry {\n\t\tconst send = vi.spyOn(server.ws, \"send\");\n\t\tconst client = await connectViteClient(server);\n\t\tconst url = server.resolvedUrls!.local[0]!;\n\t\tawait realFs.promises.writeFile(file, \"{\");\n\t\tserver.watcher.emit(\"change\", file);\n\t\tawait vi.waitFor(\n\t\t\t() => {\n\t\t\t\texpect(send).toHaveBeenCalledWith({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: expect.objectContaining({ message: expect.any(String) }),\n\t\t\t\t});\n\t\t\t},\n\t\t\t{ timeout: 10000 }\n\t\t);\n\t\tawait vi.waitFor(() =>\n\t\t\texpect(client.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t\tconst response = await fetch(url);\n\t\texpect(response.status).toBe(200);\n\t\texpect(await response.text()).toContain(\"Translation preview\");\n\t\tsend.mockClear();\n\t\tawait realFs.promises.writeFile(file, original);\n\t\tserver.watcher.emit(\"change\", file);\n\t\tawait vi.waitFor(\n\t\t\t() => expect(send).toHaveBeenCalledWith({ type: \"full-reload\" }),\n\t\t\t{ timeout: 10000 }\n\t\t);\n\t} finally {\n\t\tawait server.close();\n\t}\n});\n\n// Vite 7 and earlier can retain a buffered error after a full reload.\ntest(\"vite error overlay does not replay an error recovered before the first connection\", async () => {\n\tconst { server, file, original, outdir } = await startOverlayServer(true);\n\ttry {\n\t\tawait realFs.promises.writeFile(file, original);\n\t\tawait server.pluginContainer.watchChange(file, { event: \"update\" });\n\t\texpect(await realFs.promises.readdir(outdir)).toContain(\"runtime.js\");\n\t\tconst client = await connectViteClient(server);\n\t\texpect(client.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\tfalse\n\t\t);\n\t} finally {\n\t\tawait server.close();\n\t}\n});\n\ntest(\"vite error overlay reaches new tabs and reconnecting clients after a startup failure\", async () => {\n\tconst { server, file, original } = await startOverlayServer(true);\n\ttry {\n\t\tconst first = await connectViteClient(server);\n\t\tawait vi.waitFor(() => {\n\t\t\texpect(first.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\t\tconst second = await connectViteClient(server);\n\t\texpect(second.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\ttrue\n\t\t);\n\t\tawait Promise.all(\n\t\t\t[first, second].map(\n\t\t\t\t({ socket }) =>\n\t\t\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\t\t\tsocket.addEventListener(\"close\", () => resolve(), { once: true });\n\t\t\t\t\t\tsocket.close();\n\t\t\t\t\t})\n\t\t\t)\n\t\t);\n\t\tconst reconnected = await connectViteClient(server);\n\t\texpect(\n\t\t\treconnected.messages.some((message) => message.type === \"error\")\n\t\t).toBe(true);\n\t\tawait realFs.promises.writeFile(file, original);\n\t\tawait server.pluginContainer.watchChange(file, { event: \"update\" });\n\t\tawait vi.waitFor(() => {\n\t\t\texpect(reconnected.messages).toContainEqual({ type: \"full-reload\" });\n\t\t});\n\t\tconst recovered = await connectViteClient(server);\n\t\texpect(recovered.messages.some((message) => message.type === \"error\")).toBe(\n\t\t\tfalse\n\t\t);\n\t} finally {\n\t\tawait server.close();\n\t}\n});\n\ntest(\"watch mode follows config precedence flips\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\tconst { writeFile, rm } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\tconfig: { fileName: \"paraglide.config.ts\" },\n\t});\n\tconst jsOutdir = path.join(workspace, \"js-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Delete the winning .ts config and create a .js one.\n\tawait rm(path.join(projectDir, \"paraglide.config.ts\"));\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(jsOutdir)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\n\tawait expect(\n\t\tplugin.watchChange?.call(\n\t\t\tmockContext,\n\t\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t\t)\n\t).resolves.toBeUndefined();\n\n\texpect(await realFs.promises.readdir(jsOutdir)).not.toHaveLength(0);\n});\n\ntest(\"vite plugin does not throw on compilation errors in development\", async () => {\n\tconst { paraglideVitePlugin } = await import(\"../bundler-plugins/vite.js\");\n\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { mkdtemp } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = await mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"));\n\ttestDirectories.push(workspace);\n\n\tconst plugin = paraglideVitePlugin({\n\t\tproject: path.join(workspace, \"does-not-exist.inlang\"),\n\t\toutdir: path.join(workspace, \"out\"),\n\t}) as any;\n\n\t// In development mode - should catch errors and NOT throw\n\tawait expect(plugin.buildStart?.call(mockContext)).resolves.toBeUndefined();\n});\n\ntest(\"vite plugin throws on compilation errors at build time\", async () => {\n\tconst { paraglideVitePlugin } = await import(\"../bundler-plugins/vite.js\");\n\n\tprocess.env.NODE_ENV = \"production\";\n\n\tconst { mkdtemp } = await import(\"node:fs/promises\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst workspace = await mkdtemp(path.join(tmpdir(), \"paraglide-plugin-\"));\n\ttestDirectories.push(workspace);\n\n\tconst plugin = paraglideVitePlugin({\n\t\tproject: path.join(workspace, \"does-not-exist.inlang\"),\n\t\toutdir: path.join(workspace, \"out\"),\n\t}) as any;\n\n\t// In production mode - should throw the error\n\tconst { send } = configureViteServer(plugin);\n\tawait expect(plugin.buildStart?.call(mockContext)).rejects.toThrow();\n\texpect(send).not.toHaveBeenCalled();\n});\n\n// Regression test for https://github.com/opral/inlang-paraglide-js/issues/659:\n// the bundler plugins used to wipe `outdir` on every fresh process, racing\n// concurrent reads (SSR/prerender modules, sibling Vite processes, the\n// config-watcher reload) and producing ENOENT/MISSING_EXPORT/ERR_LOAD_URL.\ntest(\"vite plugin does not wipe outdir during first buildStart (#659)\", async () => {\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t// Pre-seed outdir with a sentinel file mimicking a prior compilation\n\t// still on disk from an earlier process.\n\tawait realFs.promises.mkdir(outdir, { recursive: true });\n\tawait realFs.promises.writeFile(\n\t\tpath.join(outdir, \"__sentinel__.txt\"),\n\t\t\"kept\"\n\t);\n\n\tconst rmSpy = vi.spyOn(realFs.promises, \"rm\");\n\n\tconst plugin = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir,\n\t\tcleanOutdir: true,\n\t}) as any;\n\n\tawait plugin.buildStart?.call(mockContext);\n\n\t// The plugin must not recursively remove the outdir during the first\n\t// compile, even though previousCompilation is undefined. Concurrent\n\t// readers may be holding file handles into outdir.\n\tfor (const call of rmSpy.mock.calls) {\n\t\texpect(String(call[0])).not.toBe(outdir);\n\t}\n});\n\ntest(\"vite plugin warm-restart writes nothing when inputs unchanged (#659)\", async () => {\n\tconst { projectDir, outdir } = await createProjectFixture();\n\tconst mockCtx = { addWatchFile: () => {} };\n\n\t// First process: compile and persist files to outdir.\n\t{\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\t\tawait plugin.buildStart?.call(mockCtx);\n\t}\n\n\t// Second process: simulate a fresh node process by resetting modules so\n\t// the module-scoped `previousCompilation` is undefined again. The plugin\n\t// should seed from on-disk hashes and write zero files (no race window).\n\tvi.resetModules();\n\tconst { paraglideVitePlugin: vitePluginFresh } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin2 = vitePluginFresh({ project: projectDir, outdir }) as any;\n\n\tconst writeFileSpy = vi.spyOn(realFs.promises, \"writeFile\");\n\tawait plugin2.buildStart?.call(mockCtx);\n\n\texpect(writeFileSpy).not.toHaveBeenCalled();\n});\n\n// Regression test for https://github.com/opral/paraglide-js/issues/741:\n// a new Vite process should validate the persisted inputs and output instead\n// of loading the project and compiling every message again.\ntest(\"vite plugin skips compile on an unchanged fresh process (#741)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tlet emitReadme = true;\n\t\tconst optionsGetter = () => ({\n\t\t\temitReadme,\n\t\t});\n\n\t\tconst { projectDir, outdir } = await createProjectFixture({\n\t\t\tlocales: [\"en\", \"de\"],\n\t\t});\n\t\tconst startFreshProcess = async () => {\n\t\t\tvi.resetModules();\n\t\t\tconst { paraglideVitePlugin } =\n\t\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\t\t\tconst plugin = paraglideVitePlugin({\n\t\t\t\tproject: projectDir,\n\t\t\t\toutdir,\n\t\t\t\t...optionsGetter(),\n\t\t\t}) as any;\n\t\t\tawait plugin.buildStart?.call(mockContext);\n\t\t};\n\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// The persisted cache makes the unchanged cold restart skip compile().\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// A file added beside a tracked project input invalidates the cache.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(projectDir, \"new-project-input.txt\"),\n\t\t\t\"new\"\n\t\t);\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\n\t\t// Compiler options are part of the cache key.\n\t\temitReadme = false;\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(3);\n\n\t\t// Generated output is validated too, so edited output self-repairs.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(outdir, \"runtime.js\"),\n\t\t\t\"tampered\"\n\t\t);\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(4);\n\t\texpect(\n\t\t\tawait realFs.promises.readFile(path.join(outdir, \"runtime.js\"), \"utf8\")\n\t\t).not.toBe(\"tampered\");\n\n\t\t// A compiler version change invalidates the persisted cache.\n\t\tconst cacheDirectory = path.join(projectDir, \"cache\", \"paraglide-js\");\n\t\tfor (const cacheFile of await realFs.promises.readdir(cacheDirectory)) {\n\t\t\tconst cachePath = path.join(cacheDirectory, cacheFile as string);\n\t\t\tconst cache = JSON.parse(\n\t\t\t\tawait realFs.promises.readFile(cachePath, \"utf8\")\n\t\t\t);\n\t\t\tcache.compilerVersion = \"0.0.0-stale\";\n\t\t\tawait realFs.promises.writeFile(cachePath, JSON.stringify(cache));\n\t\t}\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(5);\n\n\t\t// A syntactically valid but malformed cache is treated as a miss.\n\t\tfor (const cacheFile of await realFs.promises.readdir(cacheDirectory)) {\n\t\t\tconst cachePath = path.join(cacheDirectory, cacheFile as string);\n\t\t\tconst cache = JSON.parse(\n\t\t\t\tawait realFs.promises.readFile(cachePath, \"utf8\")\n\t\t\t);\n\t\t\tcache.outputHashes = null;\n\t\t\tawait realFs.promises.writeFile(cachePath, JSON.stringify(cache));\n\t\t}\n\t\tawait startFreshProcess();\n\t\texpect(compileSpy).toHaveBeenCalledTimes(6);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// Regression test for https://github.com/opral/paraglide-js/issues/693:\n// `vite build` fires buildStart once per environment (client, ssr) and each\n// run used to do a full compile() even though the inputs hadn't changed.\ntest(\"vite plugin skips compile() when buildStart fires again with unchanged inputs (#693)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture({\n\t\t\tlocales: [\"en\", \"de\", \"fr\"],\n\t\t});\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\t// First environment (e.g. client) compiles.\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// Second environment (e.g. ssr) — inputs unchanged, compile skipped.\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// Changing an input file invalidates the digest and recompiles.\n\t\tconst settingsPath = path.join(projectDir, \"settings.json\");\n\t\tconst settings = JSON.parse(\n\t\t\tawait realFs.promises.readFile(settingsPath, \"utf-8\")\n\t\t);\n\t\tsettings.locales = [\"en\", \"de\", \"fr\", \"es\"];\n\t\tawait realFs.promises.writeFile(settingsPath, JSON.stringify(settings));\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// A new file added next to tracked inputs must invalidate the digest via\n// the directory-listing part of the hash, not only edits to known files.\ntest(\"vite plugin recompiles when a file is added to a tracked directory (#693)\", async () => {\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\t// No tracked file changed, but the listing of a tracked directory did.\n\t\tawait realFs.promises.writeFile(\n\t\t\tpath.join(projectDir, \"added-later.txt\"),\n\t\t\t\"new\"\n\t\t);\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// After a failed compile the stored digest must not be reused: restoring an\n// input to its previous content has to trigger a real recompile.\ntest(\"vite plugin does not reuse a digest from before a failed compile (#693)\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst actualCompileModule = await vi.importActual<\n\t\ttypeof import(\"../compiler/compile.js\")\n\t>(\"../compiler/compile.js\");\n\tconst compileSpy = vi.fn(actualCompileModule.compile);\n\tvi.doMock(\"../compiler/compile.js\", () => ({\n\t\t...actualCompileModule,\n\t\tcompile: compileSpy,\n\t}));\n\n\ttry {\n\t\tconst { paraglideVitePlugin: vitePlugin } =\n\t\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\t\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(1);\n\n\t\tconst settingsPath = path.join(projectDir, \"settings.json\");\n\t\tconst originalSettings = await realFs.promises.readFile(\n\t\t\tsettingsPath,\n\t\t\t\"utf-8\"\n\t\t);\n\n\t\t// Break the settings file — the compile attempt fails (dev mode\n\t\t// swallows the error) and must clear the stored digest.\n\t\tawait realFs.promises.writeFile(settingsPath, \"{ not json\");\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(2);\n\n\t\t// Restore the exact original content. It must compile again instead\n\t\t// of skipping.\n\t\tawait realFs.promises.writeFile(settingsPath, originalSettings);\n\t\tawait plugin.buildStart?.call(mockContext);\n\t\texpect(compileSpy).toHaveBeenCalledTimes(3);\n\t} finally {\n\t\tvi.doUnmock(\"../compiler/compile.js\");\n\t}\n});\n\n// Two plugin instances with different filesystems must not share the tracked\n// fs wrapper or cached compilation state — each compiles into its own fs.\n// The project and config live on the real filesystem (the config loader\n// always uses the native fs); only compiler I/O is virtualized here.\ntest(\"vite plugin instances with different fs compile against their own fs (#693)\", async () => {\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\n\tconst { projectDir, outdir } = await createProjectFixture({\n\t\tlocales: [\"en\"],\n\t});\n\n\tconst fsA = memfs().fs as unknown as typeof import(\"node:fs\");\n\tconst fsB = memfs().fs as unknown as typeof import(\"node:fs\");\n\n\t// The compiler reads the project through its own fs, so seed a copy of\n\t// the real project into each instance's filesystem at /project.inlang.\n\tasync function seedIntoFs(target: typeof import(\"node:fs\")) {\n\t\tasync function walk(dir: string, virtualDir: string) {\n\t\t\tfor (const entry of await realFs.promises.readdir(dir, {\n\t\t\t\twithFileTypes: true,\n\t\t\t})) {\n\t\t\t\tconst source = path.join(dir, entry.name);\n\t\t\t\tconst destination = path.join(virtualDir, entry.name);\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tawait target.promises.mkdir(destination, { recursive: true });\n\t\t\t\t\tawait walk(source, destination);\n\t\t\t\t} else {\n\t\t\t\t\tawait target.promises.writeFile(\n\t\t\t\t\t\tdestination,\n\t\t\t\t\t\tawait realFs.promises.readFile(source)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tawait target.promises.mkdir(\"/project.inlang\", { recursive: true });\n\t\tawait walk(projectDir, \"/project.inlang\");\n\t}\n\tawait seedIntoFs(fsA);\n\tawait seedIntoFs(fsB);\n\n\tconst pluginA = vitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir,\n\t\tfs: fsA,\n\t}) as any;\n\tawait pluginA.buildStart?.call(mockContext);\n\n\tconst pluginB = vitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir,\n\t\tfs: fsB,\n\t}) as any;\n\tawait pluginB.buildStart?.call(mockContext);\n\t// B's output must exist in B's filesystem — with a shared tracked fs it\n\t// would have been read from and written into A's filesystem instead.\n\tconst outputB = await fsB.promises.readdir(outdir);\n\texpect(outputB.length).toBeGreaterThan(0);\n});\n\n// The plugins must pick up options from a paraglide.config file inside the\n// project directory when they are not passed explicitly, and explicit\n// options must win over the file.\ntest(\"vite plugin reads options from a paraglide config file\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\toutdirName: \"from-config\",\n\t\tconfig: false,\n\t});\n\tconst flagOutdir = path.join(workspace, \"from-flag\");\n\n\t// No config yet: the plugin falls back to the default outdir.\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst pluginWithoutConfig = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir,\n\t}) as any;\n\tsetViteRoot(pluginWithoutConfig, workspace);\n\tawait pluginWithoutConfig.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// A config inside the project directory wins over the defaults...\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\n\t\t\t\"export default {\",\n\t\t\t` outdir: ${JSON.stringify(path.join(workspace, \"from-config-file\"))},`,\n\t\t\t\"}\",\n\t\t].join(\"\\n\")\n\t);\n\tconst pluginWithConfig = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(pluginWithConfig, workspace);\n\tawait pluginWithConfig.buildStart?.call(mockContext);\n\texpect(\n\t\tawait realFs.promises.readdir(path.join(workspace, \"from-config-file\"))\n\t).not.toHaveLength(0);\n\n\t// ...and an explicit option wins over the config file.\n\tconst pluginWithOverride = vitePlugin({\n\t\tproject: projectDir,\n\t\toutdir: flagOutdir,\n\t}) as any;\n\tsetViteRoot(pluginWithOverride, workspace);\n\tawait pluginWithOverride.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(flagOutdir)).not.toHaveLength(0);\n});\n\n// A relative `project` option is resolved against the tool root.\ntest(\"resolves a relative project option against the vite root\", async () => {\n\tconst { workspace, projectDir, outdir } = await createProjectFixture();\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({\n\t\tproject: \"./project.inlang\", // relative — resolved against the root\n\t\toutdir,\n\t}) as any;\n\tsetViteRoot(plugin, workspace);\n\n\texpect(projectDir).toBe(path.join(workspace, \"project.inlang\"));\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n});\n\ntest(\"watch mode hot-reloads when the config file changes\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir, outdir } = await createProjectFixture({\n\t\toutdirName: \"cold-output\",\n\t});\n\tconst hotOutput = path.join(workspace, \"hot-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tconst capturingContext = {\n\t\taddWatchFile: (p: string) => {\n\t\t\taddedWatchFiles.push(p);\n\t\t},\n\t};\n\tconst addedWatchFiles: string[] = [];\n\n\tawait plugin.buildStart?.call(capturingContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Changes to unrelated files do not recompile.\n\tconst outputBefore = await realFs.promises.readdir(outdir);\n\tawait plugin.watchChange?.call(undefined, \"/unrelated.ts\");\n\texpect(await realFs.promises.readdir(outdir)).toEqual(outputBefore);\n\n\t// A config change recompiles with the new options.\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(hotOutput)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\tawait plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t);\n\n\texpect(await realFs.promises.readdir(hotOutput)).not.toHaveLength(0);\n});\n\n// An invalid edited config must not crash the dev server — the previously\n// compiled output keeps being served.\ntest(\"watchChange keeps the previous output when the edited config is invalid\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait plugin.buildStart?.call(mockContext);\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n\n\t// Break the config, then trigger a change on it.\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t\"export default { outdir: 42 }\"\n\t);\n\tawait expect(\n\t\tplugin.watchChange?.call(\n\t\t\tundefined,\n\t\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t\t)\n\t).resolves.toBeUndefined();\n\n\t// The previous compilation is still in place.\n\texpect(await realFs.promises.readdir(outdir)).not.toHaveLength(0);\n});\n\n// An invalid config at startup follows the same policy as compilation\n// errors: swallowed in development, thrown in production.\ntest(\"buildStart does not throw when the config file is invalid in development\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture({ config: false });\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.ts\"),\n\t\t'export default { outdir: \"./o\", cookieMaxAge: \"forever\" }'\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait expect(plugin.buildStart?.call(mockContext)).resolves.toBeUndefined();\n});\n\n// Regression: with no valid cached config (dev server started on an\n// invalid config), an unrelated file change must not reject watchChange —\n// that would crash the bundler's watcher.\ntest(\"watchChange does not throw for unrelated files while the config is invalid\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture({ config: false });\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.ts\"),\n\t\t'export default { outdir: \"./o\", cookieMaxAge: \"forever\" }'\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\t// Swallowed by buildStart; nothing valid ends up in the cache.\n\tawait plugin.buildStart?.call(mockContext);\n\n\tawait expect(\n\t\tplugin.watchChange?.call(undefined, \"/some/unrelated.ts\")\n\t).resolves.toBeUndefined();\n});\n\n// Regression (review): webpack fires one watchChange per modified file and\n// a config event must never be starved by later input events.\ntest(\"queued config events are applied even when input events follow\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { workspace, projectDir } = await createProjectFixture({\n\t\toutdirName: \"cold-output\",\n\t});\n\tconst hotOutput = path.join(workspace, \"hot-output\");\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tawait plugin.buildStart?.call(mockContext);\n\n\t// Volley: input, config, input — fired while the first rebuild is still\n\t// in flight (no awaiting between calls).\n\tconst first = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"messages\", \"en.json\")\n\t);\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t[\"export default {\", ` outdir: ${JSON.stringify(hotOutput)},`, \"}\"].join(\n\t\t\t\"\\n\"\n\t\t)\n\t);\n\tconst second = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"paraglide.config.js\")\n\t);\n\tconst third = plugin.watchChange?.call(\n\t\tundefined,\n\t\tpath.join(projectDir, \"messages\", \"de.json\")\n\t);\n\tawait Promise.all([first, second, third]);\n\n\texpect(await realFs.promises.readdir(hotOutput)).not.toHaveLength(0);\n});\n\n// Regression (review): an invalid config in production must fail the build\n// loudly instead of silently compiling with default options.\ntest(\"buildStart throws when the config is invalid in production\", async () => {\n\tprocess.env.NODE_ENV = \"production\";\n\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir } = await createProjectFixture();\n\tawait writeFile(\n\t\tpath.join(projectDir, \"paraglide.config.js\"),\n\t\t\"export default { outdir: 42 }\"\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tawait expect(plugin.buildStart?.call(mockContext)).rejects.toThrow(\n\t\t/paraglide config/i\n\t);\n});\n\n// Regression (review): pinning outputStructure in the shared defaults\n// template killed the development default (#486). Without an explicit\n// structure, plugins must emit locale-modules outside production.\ntest(\"development default output structure is locale-modules\", async () => {\n\tconst { writeFile } = await import(\"node:fs/promises\");\n\tconst { projectDir, outdir } = await createProjectFixture();\n\n\t// Ensure at least one message exists so the two structures differ.\n\tawait realFs.promises.mkdir(path.join(projectDir, \"messages\"), {\n\t\trecursive: true,\n\t});\n\tawait writeFile(\n\t\tpath.join(projectDir, \"messages\", \"en.json\"),\n\t\tJSON.stringify({ hello: \"Hello\" })\n\t);\n\tawait writeFile(\n\t\tpath.join(projectDir, \"messages\", \"de.json\"),\n\t\tJSON.stringify({ hello: \"Hallo\" })\n\t);\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir, outdir }) as any;\n\tsetViteRoot(plugin, path.dirname(projectDir));\n\n\tdelete process.env.NODE_ENV;\n\tawait plugin.buildStart?.call(mockContext);\n\n\tconst messages = await realFs.promises.readdir(path.join(outdir, \"messages\"));\n\texpect(messages).toContain(\"en.js\");\n\texpect(messages).toContain(\"de.js\");\n\texpect(messages).not.toContain(\"hello.js\");\n});\n\n// All four candidate names are registered inside the project directory so\n// renames/format switches are reported even by backends whose watchers only\n// report registered files (webpack).\ntest(\"registers all config candidates inside the project directory\", async () => {\n\tprocess.env.NODE_ENV = \"development\";\n\n\tconst { workspace, projectDir } = await createProjectFixture({\n\t\tconfig: false,\n\t});\n\n\tconst { paraglideVitePlugin: vitePlugin } =\n\t\tawait import(\"../bundler-plugins/vite.js\");\n\tconst plugin = vitePlugin({ project: projectDir }) as any;\n\tsetViteRoot(plugin, workspace);\n\n\tconst addedWatchFiles: string[] = [];\n\tawait plugin.buildStart?.call({\n\t\taddWatchFile: (p: string) => {\n\t\t\taddedWatchFiles.push(p);\n\t\t},\n\t});\n\n\tfor (const name of [\n\t\t\"paraglide.config.js\",\n\t\t\"paraglide.config.mjs\",\n\t\t\"paraglide.config.ts\",\n\t\t\"paraglide.config.cjs\",\n\t]) {\n\t\texpect(addedWatchFiles).toContain(path.join(projectDir, name));\n\t}\n});\n"]}
@@ -2,6 +2,7 @@ import { createVitePlugin } from "unplugin";
2
2
  import { createPerLocaleBuildPlugins } from "./per-locale-build/index.js";
3
3
  import { unpluginFactory } from "./unplugin.js";
4
4
  const createCompilerVitePlugin = createVitePlugin(unpluginFactory);
5
+ const createPerLocaleCompilerVitePlugin = createVitePlugin((options, meta) => unpluginFactory(options, meta, { outputStructure: "locale-modules" }));
5
6
  export function paraglideVitePlugin(options) {
6
7
  const { experimentalPerLocaleBuild, ...compilerOptions } = options;
7
8
  if (!experimentalPerLocaleBuild) {
@@ -9,7 +10,7 @@ export function paraglideVitePlugin(options) {
9
10
  }
10
11
  return createPerLocaleBuildPlugins({
11
12
  compilerOptions,
12
- createCompilerPlugin: (options) => createCompilerVitePlugin(options),
13
+ createCompilerPlugin: (options) => createPerLocaleCompilerVitePlugin(options),
13
14
  });
14
15
  }
15
16
  //# sourceMappingURL=vite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAiBhD,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;AAEnE,MAAM,UAAU,mBAAmB,CAClC,OAAmC;IAEnC,MAAM,EAAE,0BAA0B,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IACnE,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACjC,OAAO,wBAAwB,CAAC,eAAe,CAAW,CAAC;IAC5D,CAAC;IAED,OAAO,2BAA2B,CAAC;QAClC,eAAe;QACf,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CACjC,wBAAwB,CAAC,OAAO,CAAW;KAC5C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { createVitePlugin } from \"unplugin\";\nimport type { Plugin } from \"vite\";\nimport type { ParaglidePluginOptions } from \"./unplugin.js\";\nimport { createPerLocaleBuildPlugins } from \"./per-locale-build/index.js\";\nimport { unpluginFactory } from \"./unplugin.js\";\n\nexport type ParaglideVitePluginOptions = ParaglidePluginOptions & {\n\t/**\n\t * Emit one compiler-specialized client asset tree per project locale.\n\t *\n\t * Requires Vite 8+. Builds one untouched Rolldown client environment per\n\t * locale and emits `paraglide-vite-locales.json`. Locale changes need to use\n\t * full-document navigation. Framework SSR graph selection requires a public\n\t * framework integration API.\n\t *\n\t * @experimental\n\t * @default false\n\t */\n\texperimentalPerLocaleBuild?: boolean;\n};\n\nconst createCompilerVitePlugin = createVitePlugin(unpluginFactory);\n\nexport function paraglideVitePlugin(\n\toptions: ParaglideVitePluginOptions\n): Plugin | Plugin[] {\n\tconst { experimentalPerLocaleBuild, ...compilerOptions } = options;\n\tif (!experimentalPerLocaleBuild) {\n\t\treturn createCompilerVitePlugin(compilerOptions) as Plugin;\n\t}\n\n\treturn createPerLocaleBuildPlugins({\n\t\tcompilerOptions,\n\t\tcreateCompilerPlugin: (options) =>\n\t\t\tcreateCompilerVitePlugin(options) as Plugin,\n\t});\n}\n"]}
1
+ {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAiBhD,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;AACnE,MAAM,iCAAiC,GACtC,gBAAgB,CAAyB,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAC1D,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC,CACrE,CAAC;AAEH,MAAM,UAAU,mBAAmB,CAClC,OAAmC;IAEnC,MAAM,EAAE,0BAA0B,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IACnE,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACjC,OAAO,wBAAwB,CAAC,eAAe,CAAW,CAAC;IAC5D,CAAC;IAED,OAAO,2BAA2B,CAAC;QAClC,eAAe;QACf,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CACjC,iCAAiC,CAAC,OAAO,CAAW;KACrD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { createVitePlugin } from \"unplugin\";\nimport type { Plugin } from \"vite\";\nimport type { ParaglidePluginOptions } from \"./unplugin.js\";\nimport { createPerLocaleBuildPlugins } from \"./per-locale-build/index.js\";\nimport { unpluginFactory } from \"./unplugin.js\";\n\nexport type ParaglideVitePluginOptions = ParaglidePluginOptions & {\n\t/**\n\t * Emit one compiler-specialized client asset tree per project locale.\n\t *\n\t * Requires Vite 8+. Builds one untouched Rolldown client environment per\n\t * locale and emits `paraglide-vite-locales.json`. Locale changes need to use\n\t * full-document navigation. Framework SSR graph selection requires a public\n\t * framework integration API.\n\t *\n\t * @experimental\n\t * @default false\n\t */\n\texperimentalPerLocaleBuild?: boolean;\n};\n\nconst createCompilerVitePlugin = createVitePlugin(unpluginFactory);\nconst createPerLocaleCompilerVitePlugin =\n\tcreateVitePlugin<ParaglidePluginOptions>((options, meta) =>\n\t\tunpluginFactory(options, meta, { outputStructure: \"locale-modules\" })\n\t);\n\nexport function paraglideVitePlugin(\n\toptions: ParaglideVitePluginOptions\n): Plugin | Plugin[] {\n\tconst { experimentalPerLocaleBuild, ...compilerOptions } = options;\n\tif (!experimentalPerLocaleBuild) {\n\t\treturn createCompilerVitePlugin(compilerOptions) as Plugin;\n\t}\n\n\treturn createPerLocaleBuildPlugins({\n\t\tcompilerOptions,\n\t\tcreateCompilerPlugin: (options) =>\n\t\t\tcreatePerLocaleCompilerVitePlugin(options) as Plugin,\n\t});\n}\n"]}
@@ -58,7 +58,7 @@ test("experimentalPerLocaleBuild rejects conflicting compiler options", () => {
58
58
  ...common,
59
59
  experimentalPerLocaleBuild: true,
60
60
  outputStructure: "message-modules",
61
- })).toThrow('requires outputStructure: "locale-modules"');
61
+ })).not.toThrow();
62
62
  expect(() => paraglideVitePlugin({
63
63
  ...common,
64
64
  experimentalPerLocaleBuild: true,
@@ -1 +1 @@
1
- {"version":3,"file":"vite.test.js","sourceRoot":"","sources":["../../src/bundler-plugins/vite.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,sBAAsB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,IAAI,CAAC,2GAA2G,EAAE,KAAK,IAAI,EAAE;IAC5H,MAAM,OAAO,GAAG,MAA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;KAClC,CAAC,CACF,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,EAAE,CACX,mBAAmB,CAAC;QACnB,GAAG,MAAM;QACT,0BAA0B,EAAE,IAAI;QAChC,eAAe,EAAE;YAChB;gBACC,KAAK,EAAE,iBAAiB;gBACxB,OAAO,EAAE,IAAI;aACb;SACD;KACD,CAAC,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["import {\n\tloadProjectInMemory,\n\tnewProject,\n\tsaveProjectToDirectory,\n} from \"@inlang/sdk\";\nimport { memfs } from \"memfs\";\nimport { expect, test } from \"vitest\";\nimport { perLocaleBuildStaticLocaleExpression } from \"../compiler/per-locale-build.js\";\nimport { paraglideVitePlugin } from \"./vite.js\";\n\ntest(\"experimentalPerLocaleBuild generates locale source modules and installs the Vite environment orchestrator\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: { baseLocale: \"en\", locales: [\"en\", \"de\"] },\n\t\t}),\n\t});\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tconst plugins = paraglideVitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/src/paraglide\",\n\t\tfs,\n\t\texperimentalPerLocaleBuild: true,\n\t\tstrategy: [\"preferredLanguage\", \"baseLocale\"],\n\t\tadditionalFiles: { \"custom.js\": \"export const custom = true;\\n\" },\n\t});\n\tif (!Array.isArray(plugins)) {\n\t\tthrow new Error(\"Expected multiple Vite plugins\");\n\t}\n\texpect(plugins.map((plugin) => plugin.name)).toEqual([\n\t\t\"paraglide-config-discovery-root\",\n\t\t\"unplugin-paraglide-js\",\n\t\t\"paraglide-vite-locale-environments\",\n\t]);\n\n\tconst compiler = plugins[1]!;\n\tif (typeof compiler.buildStart !== \"function\") {\n\t\tthrow new Error(\"Expected the compiler buildStart hook\");\n\t}\n\tawait compiler.buildStart.call({ addWatchFile() {} } as never, {} as never);\n\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/messages/en.js\", \"utf8\")\n\t).toBeDefined();\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/messages/de.js\", \"utf8\")\n\t).toBeDefined();\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/runtime.js\", \"utf8\")\n\t).toContain(perLocaleBuildStaticLocaleExpression);\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/custom.js\", \"utf8\")\n\t).toContain(\"export const custom = true;\");\n\tawait expect(\n\t\tfs.promises.readFile(\"/src/paraglide/tanstack-start.server.js\", \"utf8\")\n\t).rejects.toThrow();\n});\n\ntest(\"experimentalPerLocaleBuild rejects conflicting compiler options\", () => {\n\tconst common = { project: \"/project.inlang\", outdir: \"/src/paraglide\" };\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\texperimentalStaticLocale: '\"de\"',\n\t\t})\n\t).toThrow(\"cannot be combined with experimentalStaticLocale\");\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\texperimentalMiddlewareLocaleSplitting: true,\n\t\t})\n\t).toThrow(\"cannot be combined with experimentalMiddlewareLocaleSplitting\");\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\toutputStructure: \"message-modules\",\n\t\t})\n\t).toThrow('requires outputStructure: \"locale-modules\"');\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\trouteStrategies: [\n\t\t\t\t{\n\t\t\t\t\tmatch: \"/api/:path(.*)?\",\n\t\t\t\t\texclude: true,\n\t\t\t\t},\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,gBAAgB,EAAE,CAAC;IACxE,MAAM,CAAC,GAAG,EAAE,CACX,mBAAmB,CAAC;QACnB,GAAG,MAAM;QACT,0BAA0B,EAAE,IAAI;QAChC,wBAAwB,EAAE,MAAM;KAChC,CAAC,CACF,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAC;IAC9D,MAAM,CAAC,GAAG,EAAE,CACX,mBAAmB,CAAC;QACnB,GAAG,MAAM;QACT,0BAA0B,EAAE,IAAI;QAChC,qCAAqC,EAAE,IAAI;KAC3C,CAAC,CACF,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;IAC3E,MAAM,CAAC,GAAG,EAAE,CACX,mBAAmB,CAAC;QACnB,GAAG,MAAM;QACT,0BAA0B,EAAE,IAAI;QAChC,eAAe,EAAE,iBAAiB;KAClC,CAAC,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAChB,MAAM,CAAC,GAAG,EAAE,CACX,mBAAmB,CAAC;QACnB,GAAG,MAAM;QACT,0BAA0B,EAAE,IAAI;QAChC,eAAe,EAAE;YAChB;gBACC,KAAK,EAAE,iBAAiB;gBACxB,OAAO,EAAE,IAAI;aACb;SACD;KACD,CAAC,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["import {\n\tloadProjectInMemory,\n\tnewProject,\n\tsaveProjectToDirectory,\n} from \"@inlang/sdk\";\nimport { memfs } from \"memfs\";\nimport { expect, test } from \"vitest\";\nimport { perLocaleBuildStaticLocaleExpression } from \"../compiler/per-locale-build.js\";\nimport { paraglideVitePlugin } from \"./vite.js\";\n\ntest(\"experimentalPerLocaleBuild generates locale source modules and installs the Vite environment orchestrator\", async () => {\n\tconst project = await loadProjectInMemory({\n\t\tblob: await newProject({\n\t\t\tsettings: { baseLocale: \"en\", locales: [\"en\", \"de\"] },\n\t\t}),\n\t});\n\tconst fs = memfs().fs as unknown as typeof import(\"node:fs\");\n\tawait saveProjectToDirectory({\n\t\tproject,\n\t\tpath: \"/project.inlang\",\n\t\tfs: fs.promises,\n\t});\n\n\tconst plugins = paraglideVitePlugin({\n\t\tproject: \"/project.inlang\",\n\t\toutdir: \"/src/paraglide\",\n\t\tfs,\n\t\texperimentalPerLocaleBuild: true,\n\t\tstrategy: [\"preferredLanguage\", \"baseLocale\"],\n\t\tadditionalFiles: { \"custom.js\": \"export const custom = true;\\n\" },\n\t});\n\tif (!Array.isArray(plugins)) {\n\t\tthrow new Error(\"Expected multiple Vite plugins\");\n\t}\n\texpect(plugins.map((plugin) => plugin.name)).toEqual([\n\t\t\"paraglide-config-discovery-root\",\n\t\t\"unplugin-paraglide-js\",\n\t\t\"paraglide-vite-locale-environments\",\n\t]);\n\n\tconst compiler = plugins[1]!;\n\tif (typeof compiler.buildStart !== \"function\") {\n\t\tthrow new Error(\"Expected the compiler buildStart hook\");\n\t}\n\tawait compiler.buildStart.call({ addWatchFile() {} } as never, {} as never);\n\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/messages/en.js\", \"utf8\")\n\t).toBeDefined();\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/messages/de.js\", \"utf8\")\n\t).toBeDefined();\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/runtime.js\", \"utf8\")\n\t).toContain(perLocaleBuildStaticLocaleExpression);\n\texpect(\n\t\tawait fs.promises.readFile(\"/src/paraglide/custom.js\", \"utf8\")\n\t).toContain(\"export const custom = true;\");\n\tawait expect(\n\t\tfs.promises.readFile(\"/src/paraglide/tanstack-start.server.js\", \"utf8\")\n\t).rejects.toThrow();\n});\n\ntest(\"experimentalPerLocaleBuild rejects conflicting compiler options\", () => {\n\tconst common = { project: \"/project.inlang\", outdir: \"/src/paraglide\" };\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\texperimentalStaticLocale: '\"de\"',\n\t\t})\n\t).toThrow(\"cannot be combined with experimentalStaticLocale\");\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\texperimentalMiddlewareLocaleSplitting: true,\n\t\t})\n\t).toThrow(\"cannot be combined with experimentalMiddlewareLocaleSplitting\");\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\toutputStructure: \"message-modules\",\n\t\t})\n\t).not.toThrow();\n\texpect(() =>\n\t\tparaglideVitePlugin({\n\t\t\t...common,\n\t\t\texperimentalPerLocaleBuild: true,\n\t\t\trouteStrategies: [\n\t\t\t\t{\n\t\t\t\t\tmatch: \"/api/:path(.*)?\",\n\t\t\t\t\texclude: true,\n\t\t\t\t},\n\t\t\t],\n\t\t})\n\t).not.toThrow();\n});\n"]}
@@ -142,6 +142,7 @@ export const compileCommand = new Command()
142
142
  let compileTimer;
143
143
  let compileInProgress = false;
144
144
  let compileRequested = false;
145
+ let watching = true;
145
146
  // Set by the project-directory watcher when a config-named file
146
147
  // changes — survives debounced coalescing with unrelated events.
147
148
  let configChangedSinceLastBuild = false;
@@ -177,6 +178,8 @@ export const compileCommand = new Command()
177
178
  }
178
179
  };
179
180
  const updateWatchers = (files) => {
181
+ if (!watching)
182
+ return;
180
183
  const { files: nextFiles, directories: nextDirectories, isIgnoredPath, } = getWatchTargets(files, { outdir: compileOptions.outdir });
181
184
  for (const [filePath, watcher] of fileWatchers) {
182
185
  if (!nextFiles.has(filePath)) {
@@ -251,6 +254,8 @@ export const compileCommand = new Command()
251
254
  }
252
255
  };
253
256
  const runCompile = async (changedPath) => {
257
+ if (!watching)
258
+ return;
254
259
  if (compileInProgress) {
255
260
  compileRequested = true;
256
261
  return;
@@ -320,6 +325,8 @@ export const compileCommand = new Command()
320
325
  }
321
326
  };
322
327
  const scheduleCompile = (changedPath) => {
328
+ if (!watching)
329
+ return;
323
330
  if (compileTimer) {
324
331
  clearTimeout(compileTimer);
325
332
  }
@@ -328,6 +335,12 @@ export const compileCommand = new Command()
328
335
  }, 100);
329
336
  };
330
337
  const closeWatchers = () => {
338
+ watching = false;
339
+ compileRequested = false;
340
+ if (compileTimer) {
341
+ clearTimeout(compileTimer);
342
+ compileTimer = undefined;
343
+ }
331
344
  for (const watcher of fileWatchers.values()) {
332
345
  watcher.close();
333
346
  }