@sebbro/paraglide-lite 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/bin/run.js +4 -0
- package/dist/bundler-plugins/esbuild.d.ts +1 -0
- package/dist/bundler-plugins/esbuild.d.ts.map +1 -0
- package/dist/bundler-plugins/esbuild.js +4 -0
- package/dist/bundler-plugins/esbuild.js.map +1 -0
- package/dist/bundler-plugins/index.d.ts +6 -0
- package/dist/bundler-plugins/index.d.ts.map +1 -0
- package/dist/bundler-plugins/index.js +7 -0
- package/dist/bundler-plugins/index.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.d.ts +19 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.js +85 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.d.ts +2 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.js +53 -0
- package/dist/bundler-plugins/lazy-modules/scan-message-keys.test.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/ssr.d.ts +31 -0
- package/dist/bundler-plugins/lazy-modules/ssr.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/ssr.js +42 -0
- package/dist/bundler-plugins/lazy-modules/ssr.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/ssr.test.d.ts +2 -0
- package/dist/bundler-plugins/lazy-modules/ssr.test.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/ssr.test.js +48 -0
- package/dist/bundler-plugins/lazy-modules/ssr.test.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/virtual-ids.d.ts +7 -0
- package/dist/bundler-plugins/lazy-modules/virtual-ids.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/virtual-ids.js +30 -0
- package/dist/bundler-plugins/lazy-modules/virtual-ids.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/virtual.d.ts +86 -0
- package/dist/bundler-plugins/lazy-modules/virtual.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/virtual.js +2 -0
- package/dist/bundler-plugins/lazy-modules/virtual.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.d.ts +18 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.js +328 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.js.map +1 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.test.d.ts +2 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.test.d.ts.map +1 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.test.js +45 -0
- package/dist/bundler-plugins/lazy-modules/vite-plugin.test.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/constants.d.ts +2 -0
- package/dist/bundler-plugins/per-locale-build/constants.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/constants.js +3 -0
- package/dist/bundler-plugins/per-locale-build/constants.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/index.d.ts +6 -0
- package/dist/bundler-plugins/per-locale-build/index.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/index.js +43 -0
- package/dist/bundler-plugins/per-locale-build/index.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/locale-id.d.ts +8 -0
- package/dist/bundler-plugins/per-locale-build/locale-id.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/locale-id.js +13 -0
- package/dist/bundler-plugins/per-locale-build/locale-id.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/types.d.ts +4 -0
- package/dist/bundler-plugins/per-locale-build/types.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/types.js +2 -0
- package/dist/bundler-plugins/per-locale-build/types.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts +51 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.js +250 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.js.map +1 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts +1 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.test.d.ts.map +1 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.test.js +250 -0
- package/dist/bundler-plugins/per-locale-build/vite-environments.test.js.map +1 -0
- package/dist/bundler-plugins/plugin-core.d.ts +74 -0
- package/dist/bundler-plugins/plugin-core.d.ts.map +1 -0
- package/dist/bundler-plugins/plugin-core.js +292 -0
- package/dist/bundler-plugins/plugin-core.js.map +1 -0
- package/dist/bundler-plugins/rolldown.d.ts +10 -0
- package/dist/bundler-plugins/rolldown.d.ts.map +1 -0
- package/dist/bundler-plugins/rolldown.js +36 -0
- package/dist/bundler-plugins/rolldown.js.map +1 -0
- package/dist/bundler-plugins/rolldown.test.d.ts +1 -0
- package/dist/bundler-plugins/rolldown.test.d.ts.map +1 -0
- package/dist/bundler-plugins/rolldown.test.js +72 -0
- package/dist/bundler-plugins/rolldown.test.js.map +1 -0
- package/dist/bundler-plugins/rollup.d.ts +1 -0
- package/dist/bundler-plugins/rollup.d.ts.map +1 -0
- package/dist/bundler-plugins/rollup.js +4 -0
- package/dist/bundler-plugins/rollup.js.map +1 -0
- package/dist/bundler-plugins/rspack.d.ts +1 -0
- package/dist/bundler-plugins/rspack.d.ts.map +1 -0
- package/dist/bundler-plugins/rspack.js +4 -0
- package/dist/bundler-plugins/rspack.js.map +1 -0
- package/dist/bundler-plugins/unplugin.d.ts +3 -0
- package/dist/bundler-plugins/unplugin.d.ts.map +1 -0
- package/dist/bundler-plugins/unplugin.js +62 -0
- package/dist/bundler-plugins/unplugin.js.map +1 -0
- package/dist/bundler-plugins/unplugin.test.d.ts +1 -0
- package/dist/bundler-plugins/unplugin.test.d.ts.map +1 -0
- package/dist/bundler-plugins/unplugin.test.js +256 -0
- package/dist/bundler-plugins/unplugin.test.js.map +1 -0
- package/dist/bundler-plugins/virtual-modules.test.d.ts +1 -0
- package/dist/bundler-plugins/virtual-modules.test.d.ts.map +1 -0
- package/dist/bundler-plugins/virtual-modules.test.js +77 -0
- package/dist/bundler-plugins/virtual-modules.test.js.map +1 -0
- package/dist/bundler-plugins/vite.d.ts +17 -0
- package/dist/bundler-plugins/vite.d.ts.map +1 -0
- package/dist/bundler-plugins/vite.js +15 -0
- package/dist/bundler-plugins/vite.js.map +1 -0
- package/dist/bundler-plugins/vite.test.d.ts +1 -0
- package/dist/bundler-plugins/vite.test.d.ts.map +1 -0
- package/dist/bundler-plugins/vite.test.js +61 -0
- package/dist/bundler-plugins/vite.test.js.map +1 -0
- package/dist/bundler-plugins/webpack.d.ts +1 -0
- package/dist/bundler-plugins/webpack.d.ts.map +1 -0
- package/dist/bundler-plugins/webpack.js +4 -0
- package/dist/bundler-plugins/webpack.js.map +1 -0
- package/dist/cli/commands/compile/command.d.ts +2 -0
- package/dist/cli/commands/compile/command.d.ts.map +1 -0
- package/dist/cli/commands/compile/command.js +225 -0
- package/dist/cli/commands/compile/command.js.map +1 -0
- package/dist/cli/commands/compile/command.test.d.ts +1 -0
- package/dist/cli/commands/compile/command.test.d.ts.map +1 -0
- package/dist/cli/commands/compile/command.test.js +69 -0
- package/dist/cli/commands/compile/command.test.js.map +1 -0
- package/dist/cli/commands/init/command.d.ts +2 -0
- package/dist/cli/commands/init/command.d.ts.map +1 -0
- package/dist/cli/commands/init/command.js +90 -0
- package/dist/cli/commands/init/command.js.map +1 -0
- package/dist/cli/defaults.d.ts +11 -0
- package/dist/cli/defaults.d.ts.map +1 -0
- package/dist/cli/defaults.js +13 -0
- package/dist/cli/defaults.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/steps/add-vite-plugin.d.ts +31 -0
- package/dist/cli/steps/add-vite-plugin.d.ts.map +1 -0
- package/dist/cli/steps/add-vite-plugin.js +65 -0
- package/dist/cli/steps/add-vite-plugin.js.map +1 -0
- package/dist/cli/steps/add-vite-plugin.test.d.ts +1 -0
- package/dist/cli/steps/add-vite-plugin.test.d.ts.map +1 -0
- package/dist/cli/steps/add-vite-plugin.test.js +74 -0
- package/dist/cli/steps/add-vite-plugin.test.js.map +1 -0
- package/dist/cli/steps/check-for-uncomitted-changes.d.ts +5 -0
- package/dist/cli/steps/check-for-uncomitted-changes.d.ts.map +1 -0
- package/dist/cli/steps/check-for-uncomitted-changes.js +37 -0
- package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -0
- package/dist/cli/steps/detect-bundler.d.ts +10 -0
- package/dist/cli/steps/detect-bundler.d.ts.map +1 -0
- package/dist/cli/steps/detect-bundler.js +22 -0
- package/dist/cli/steps/detect-bundler.js.map +1 -0
- package/dist/cli/steps/detect-bundler.test.d.ts +1 -0
- package/dist/cli/steps/detect-bundler.test.d.ts.map +1 -0
- package/dist/cli/steps/detect-bundler.test.js +29 -0
- package/dist/cli/steps/detect-bundler.test.js.map +1 -0
- package/dist/cli/steps/initialize-messages.d.ts +11 -0
- package/dist/cli/steps/initialize-messages.d.ts.map +1 -0
- package/dist/cli/steps/initialize-messages.js +31 -0
- package/dist/cli/steps/initialize-messages.js.map +1 -0
- package/dist/cli/steps/prompt-for-outdir.d.ts +8 -0
- package/dist/cli/steps/prompt-for-outdir.d.ts.map +1 -0
- package/dist/cli/steps/prompt-for-outdir.js +19 -0
- package/dist/cli/steps/prompt-for-outdir.js.map +1 -0
- package/dist/cli/steps/update-package-json.d.ts +11 -0
- package/dist/cli/steps/update-package-json.d.ts.map +1 -0
- package/dist/cli/steps/update-package-json.js +34 -0
- package/dist/cli/steps/update-package-json.js.map +1 -0
- package/dist/cli/steps/update-ts-config.d.ts +26 -0
- package/dist/cli/steps/update-ts-config.d.ts.map +1 -0
- package/dist/cli/steps/update-ts-config.js +270 -0
- package/dist/cli/steps/update-ts-config.js.map +1 -0
- package/dist/cli/steps/update-ts-config.test.d.ts +1 -0
- package/dist/cli/steps/update-ts-config.test.d.ts.map +1 -0
- package/dist/cli/steps/update-ts-config.test.js +60 -0
- package/dist/cli/steps/update-ts-config.test.js.map +1 -0
- package/dist/cli/utils.d.ts +36 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +20 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/compiler/assert-url-pattern-available.d.ts +7 -0
- package/dist/compiler/assert-url-pattern-available.d.ts.map +1 -0
- package/dist/compiler/assert-url-pattern-available.js +17 -0
- package/dist/compiler/assert-url-pattern-available.js.map +1 -0
- package/dist/compiler/compile-annotation.d.ts +12 -0
- package/dist/compiler/compile-annotation.d.ts.map +1 -0
- package/dist/compiler/compile-annotation.js +136 -0
- package/dist/compiler/compile-annotation.js.map +1 -0
- package/dist/compiler/compile-bundle.d.ts +28 -0
- package/dist/compiler/compile-bundle.d.ts.map +1 -0
- package/dist/compiler/compile-bundle.js +431 -0
- package/dist/compiler/compile-bundle.js.map +1 -0
- package/dist/compiler/compile-bundle.test.d.ts +1 -0
- package/dist/compiler/compile-bundle.test.d.ts.map +1 -0
- package/dist/compiler/compile-bundle.test.js +399 -0
- package/dist/compiler/compile-bundle.test.js.map +1 -0
- package/dist/compiler/compile-local-variable.d.ts +16 -0
- package/dist/compiler/compile-local-variable.d.ts.map +1 -0
- package/dist/compiler/compile-local-variable.js +28 -0
- package/dist/compiler/compile-local-variable.js.map +1 -0
- package/dist/compiler/compile-local-variable.test.d.ts +1 -0
- package/dist/compiler/compile-local-variable.test.d.ts.map +1 -0
- package/dist/compiler/compile-local-variable.test.js +359 -0
- package/dist/compiler/compile-local-variable.test.js.map +1 -0
- package/dist/compiler/compile-message.d.ts +8 -0
- package/dist/compiler/compile-message.d.ts.map +1 -0
- package/dist/compiler/compile-message.js +174 -0
- package/dist/compiler/compile-message.js.map +1 -0
- package/dist/compiler/compile-message.test.d.ts +1 -0
- package/dist/compiler/compile-message.test.d.ts.map +1 -0
- package/dist/compiler/compile-message.test.js +1060 -0
- package/dist/compiler/compile-message.test.js.map +1 -0
- package/dist/compiler/compile-pattern.d.ts +29 -0
- package/dist/compiler/compile-pattern.d.ts.map +1 -0
- package/dist/compiler/compile-pattern.js +143 -0
- package/dist/compiler/compile-pattern.js.map +1 -0
- package/dist/compiler/compile-pattern.test.d.ts +1 -0
- package/dist/compiler/compile-pattern.test.d.ts.map +1 -0
- package/dist/compiler/compile-pattern.test.js +255 -0
- package/dist/compiler/compile-pattern.test.js.map +1 -0
- package/dist/compiler/compile-project.d.ts +21 -0
- package/dist/compiler/compile-project.d.ts.map +1 -0
- package/dist/compiler/compile-project.js +147 -0
- package/dist/compiler/compile-project.js.map +1 -0
- package/dist/compiler/compile-project.test.d.ts +1 -0
- package/dist/compiler/compile-project.test.d.ts.map +1 -0
- package/dist/compiler/compile-project.test.js +1709 -0
- package/dist/compiler/compile-project.test.js.map +1 -0
- package/dist/compiler/compile.bench.d.ts +1 -0
- package/dist/compiler/compile.bench.d.ts.map +1 -0
- package/dist/compiler/compile.bench.js +89 -0
- package/dist/compiler/compile.bench.js.map +1 -0
- package/dist/compiler/compile.d.ts +24 -0
- package/dist/compiler/compile.d.ts.map +1 -0
- package/dist/compiler/compile.js +106 -0
- package/dist/compiler/compile.js.map +1 -0
- package/dist/compiler/compile.test.d.ts +1 -0
- package/dist/compiler/compile.test.d.ts.map +1 -0
- package/dist/compiler/compile.test.js +66 -0
- package/dist/compiler/compile.test.js.map +1 -0
- package/dist/compiler/compiler-options.d.ts +466 -0
- package/dist/compiler/compiler-options.d.ts.map +1 -0
- package/dist/compiler/compiler-options.js +22 -0
- package/dist/compiler/compiler-options.js.map +1 -0
- package/dist/compiler/create-paraglide.d.ts +21 -0
- package/dist/compiler/create-paraglide.d.ts.map +1 -0
- package/dist/compiler/create-paraglide.js +69 -0
- package/dist/compiler/create-paraglide.js.map +1 -0
- package/dist/compiler/create-paraglide.test.d.ts +1 -0
- package/dist/compiler/create-paraglide.test.d.ts.map +1 -0
- package/dist/compiler/create-paraglide.test.js +55 -0
- package/dist/compiler/create-paraglide.test.js.map +1 -0
- package/dist/compiler/create-readme.d.ts +9 -0
- package/dist/compiler/create-readme.d.ts.map +1 -0
- package/dist/compiler/create-readme.js +127 -0
- package/dist/compiler/create-readme.js.map +1 -0
- package/dist/compiler/emit-files.d.ts +15 -0
- package/dist/compiler/emit-files.d.ts.map +1 -0
- package/dist/compiler/emit-files.js +58 -0
- package/dist/compiler/emit-files.js.map +1 -0
- package/dist/compiler/emit-files.test.d.ts +1 -0
- package/dist/compiler/emit-files.test.d.ts.map +1 -0
- package/dist/compiler/emit-files.test.js +43 -0
- package/dist/compiler/emit-files.test.js.map +1 -0
- package/dist/compiler/emit-ts-declarations.d.ts +11 -0
- package/dist/compiler/emit-ts-declarations.d.ts.map +1 -0
- package/dist/compiler/emit-ts-declarations.interop.test.d.ts +1 -0
- package/dist/compiler/emit-ts-declarations.interop.test.d.ts.map +1 -0
- package/dist/compiler/emit-ts-declarations.interop.test.js +33 -0
- package/dist/compiler/emit-ts-declarations.interop.test.js.map +1 -0
- package/dist/compiler/emit-ts-declarations.js +353 -0
- package/dist/compiler/emit-ts-declarations.js.map +1 -0
- package/dist/compiler/emit-ts-declarations.test.d.ts +1 -0
- package/dist/compiler/emit-ts-declarations.test.d.ts.map +1 -0
- package/dist/compiler/emit-ts-declarations.test.js +161 -0
- package/dist/compiler/emit-ts-declarations.test.js.map +1 -0
- package/dist/compiler/index.d.ts +13 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +11 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/jsdoc-types.d.ts +21 -0
- package/dist/compiler/jsdoc-types.d.ts.map +1 -0
- package/dist/compiler/jsdoc-types.js +59 -0
- package/dist/compiler/jsdoc-types.js.map +1 -0
- package/dist/compiler/jsdoc-types.test.d.ts +1 -0
- package/dist/compiler/jsdoc-types.test.d.ts.map +1 -0
- package/dist/compiler/jsdoc-types.test.js +100 -0
- package/dist/compiler/jsdoc-types.test.js.map +1 -0
- package/dist/compiler/lazy-modules/compile-cache.d.ts +37 -0
- package/dist/compiler/lazy-modules/compile-cache.d.ts.map +1 -0
- package/dist/compiler/lazy-modules/compile-cache.js +34 -0
- package/dist/compiler/lazy-modules/compile-cache.js.map +1 -0
- package/dist/compiler/lazy-modules/compile-project.lazy.test.d.ts +2 -0
- package/dist/compiler/lazy-modules/compile-project.lazy.test.d.ts.map +1 -0
- package/dist/compiler/lazy-modules/compile-project.lazy.test.js +65 -0
- package/dist/compiler/lazy-modules/compile-project.lazy.test.js.map +1 -0
- package/dist/compiler/lazy-modules/create-loader.d.ts +18 -0
- package/dist/compiler/lazy-modules/create-loader.d.ts.map +1 -0
- package/dist/compiler/lazy-modules/create-loader.js +182 -0
- package/dist/compiler/lazy-modules/create-loader.js.map +1 -0
- package/dist/compiler/lazy-modules/create-loader.test.d.ts +2 -0
- package/dist/compiler/lazy-modules/create-loader.test.d.ts.map +1 -0
- package/dist/compiler/lazy-modules/create-loader.test.js +82 -0
- package/dist/compiler/lazy-modules/create-loader.test.js.map +1 -0
- package/dist/compiler/lazy-modules/manifest.d.ts +32 -0
- package/dist/compiler/lazy-modules/manifest.d.ts.map +1 -0
- package/dist/compiler/lazy-modules/manifest.js +11 -0
- package/dist/compiler/lazy-modules/manifest.js.map +1 -0
- package/dist/compiler/match-literals.d.ts +2 -0
- package/dist/compiler/match-literals.d.ts.map +1 -0
- package/dist/compiler/match-literals.js +42 -0
- package/dist/compiler/match-literals.js.map +1 -0
- package/dist/compiler/output-structure/lazy-modules.d.ts +27 -0
- package/dist/compiler/output-structure/lazy-modules.d.ts.map +1 -0
- package/dist/compiler/output-structure/lazy-modules.js +157 -0
- package/dist/compiler/output-structure/lazy-modules.js.map +1 -0
- package/dist/compiler/output-structure/lazy-modules.test.d.ts +2 -0
- package/dist/compiler/output-structure/lazy-modules.test.d.ts.map +1 -0
- package/dist/compiler/output-structure/lazy-modules.test.js +128 -0
- package/dist/compiler/output-structure/lazy-modules.test.js.map +1 -0
- package/dist/compiler/output-structure/locale-modules.d.ts +4 -0
- package/dist/compiler/output-structure/locale-modules.d.ts.map +1 -0
- package/dist/compiler/output-structure/locale-modules.js +81 -0
- package/dist/compiler/output-structure/locale-modules.js.map +1 -0
- package/dist/compiler/output-structure/locale-modules.test.d.ts +1 -0
- package/dist/compiler/output-structure/locale-modules.test.d.ts.map +1 -0
- package/dist/compiler/output-structure/locale-modules.test.js +163 -0
- package/dist/compiler/output-structure/locale-modules.test.js.map +1 -0
- package/dist/compiler/output-structure/message-modules.d.ts +4 -0
- package/dist/compiler/output-structure/message-modules.d.ts.map +1 -0
- package/dist/compiler/output-structure/message-modules.js +100 -0
- package/dist/compiler/output-structure/message-modules.js.map +1 -0
- package/dist/compiler/output-structure/message-modules.test.d.ts +1 -0
- package/dist/compiler/output-structure/message-modules.test.d.ts.map +1 -0
- package/dist/compiler/output-structure/message-modules.test.js +148 -0
- package/dist/compiler/output-structure/message-modules.test.js.map +1 -0
- package/dist/compiler/per-locale-build.d.ts +2 -0
- package/dist/compiler/per-locale-build.d.ts.map +1 -0
- package/dist/compiler/per-locale-build.js +3 -0
- package/dist/compiler/per-locale-build.js.map +1 -0
- package/dist/compiler/registry.d.ts +13 -0
- package/dist/compiler/registry.d.ts.map +1 -0
- package/dist/compiler/registry.js +60 -0
- package/dist/compiler/registry.js.map +1 -0
- package/dist/compiler/resolve-tsc-js-path.d.ts +9 -0
- package/dist/compiler/resolve-tsc-js-path.d.ts.map +1 -0
- package/dist/compiler/resolve-tsc-js-path.js +23 -0
- package/dist/compiler/resolve-tsc-js-path.js.map +1 -0
- package/dist/compiler/runtime/check-locale.d.ts +31 -0
- package/dist/compiler/runtime/check-locale.d.ts.map +1 -0
- package/dist/compiler/runtime/check-locale.js +51 -0
- package/dist/compiler/runtime/check-locale.js.map +1 -0
- package/dist/compiler/runtime/check-locale.test.d.ts +1 -0
- package/dist/compiler/runtime/check-locale.test.d.ts.map +1 -0
- package/dist/compiler/runtime/check-locale.test.js +84 -0
- package/dist/compiler/runtime/check-locale.test.js.map +1 -0
- package/dist/compiler/runtime/create-runtime.d.ts +35 -0
- package/dist/compiler/runtime/create-runtime.d.ts.map +1 -0
- package/dist/compiler/runtime/create-runtime.js +196 -0
- package/dist/compiler/runtime/create-runtime.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.d.ts +13 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.js +43 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.js +149 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.d.ts +13 -0
- package/dist/compiler/runtime/extract-locale-from-header.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.js +45 -0
- package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.js +55 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.d.ts +12 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.js +33 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.js +45 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.d.ts +34 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.js +70 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.js +119 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.d.ts +41 -0
- package/dist/compiler/runtime/extract-locale-from-request.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.js +96 -0
- package/dist/compiler/runtime/extract-locale-from-request.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.js +351 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.d.ts +11 -0
- package/dist/compiler/runtime/extract-locale-from-url.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.js +68 -0
- package/dist/compiler/runtime/extract-locale-from-url.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.d.ts +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.d.ts.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.js +127 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.js.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.d.ts +44 -0
- package/dist/compiler/runtime/generate-static-localized-urls.d.ts.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.js +133 -0
- package/dist/compiler/runtime/generate-static-localized-urls.js.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.d.ts.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.js +159 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.js.map +1 -0
- package/dist/compiler/runtime/get-locale.d.ts +42 -0
- package/dist/compiler/runtime/get-locale.d.ts.map +1 -0
- package/dist/compiler/runtime/get-locale.js +158 -0
- package/dist/compiler/runtime/get-locale.js.map +1 -0
- package/dist/compiler/runtime/get-locale.test.d.ts +1 -0
- package/dist/compiler/runtime/get-locale.test.d.ts.map +1 -0
- package/dist/compiler/runtime/get-locale.test.js +295 -0
- package/dist/compiler/runtime/get-locale.test.js.map +1 -0
- package/dist/compiler/runtime/get-text-direction.d.ts +15 -0
- package/dist/compiler/runtime/get-text-direction.d.ts.map +1 -0
- package/dist/compiler/runtime/get-text-direction.js +46 -0
- package/dist/compiler/runtime/get-text-direction.js.map +1 -0
- package/dist/compiler/runtime/get-text-direction.test.d.ts +1 -0
- package/dist/compiler/runtime/get-text-direction.test.d.ts.map +1 -0
- package/dist/compiler/runtime/get-text-direction.test.js +40 -0
- package/dist/compiler/runtime/get-text-direction.test.js.map +1 -0
- package/dist/compiler/runtime/get-url-origin.d.ts +19 -0
- package/dist/compiler/runtime/get-url-origin.d.ts.map +1 -0
- package/dist/compiler/runtime/get-url-origin.js +31 -0
- package/dist/compiler/runtime/get-url-origin.js.map +1 -0
- package/dist/compiler/runtime/get-url-origin.test.d.ts +1 -0
- package/dist/compiler/runtime/get-url-origin.test.d.ts.map +1 -0
- package/dist/compiler/runtime/get-url-origin.test.js +18 -0
- package/dist/compiler/runtime/get-url-origin.test.js.map +1 -0
- package/dist/compiler/runtime/host-routing.d.ts +28 -0
- package/dist/compiler/runtime/host-routing.d.ts.map +1 -0
- package/dist/compiler/runtime/host-routing.js +79 -0
- package/dist/compiler/runtime/host-routing.js.map +1 -0
- package/dist/compiler/runtime/host-routing.test.d.ts +1 -0
- package/dist/compiler/runtime/host-routing.test.d.ts.map +1 -0
- package/dist/compiler/runtime/host-routing.test.js +128 -0
- package/dist/compiler/runtime/host-routing.test.js.map +1 -0
- package/dist/compiler/runtime/localize-href.d.ts +84 -0
- package/dist/compiler/runtime/localize-href.d.ts.map +1 -0
- package/dist/compiler/runtime/localize-href.js +115 -0
- package/dist/compiler/runtime/localize-href.js.map +1 -0
- package/dist/compiler/runtime/localize-href.test.d.ts +1 -0
- package/dist/compiler/runtime/localize-href.test.d.ts.map +1 -0
- package/dist/compiler/runtime/localize-href.test.js +139 -0
- package/dist/compiler/runtime/localize-href.test.js.map +1 -0
- package/dist/compiler/runtime/localize-url.d.ts +95 -0
- package/dist/compiler/runtime/localize-url.d.ts.map +1 -0
- package/dist/compiler/runtime/localize-url.js +327 -0
- package/dist/compiler/runtime/localize-url.js.map +1 -0
- package/dist/compiler/runtime/localize-url.test.d.ts +1 -0
- package/dist/compiler/runtime/localize-url.test.d.ts.map +1 -0
- package/dist/compiler/runtime/localize-url.test.js +533 -0
- package/dist/compiler/runtime/localize-url.test.js.map +1 -0
- package/dist/compiler/runtime/route-strategy.d.ts +32 -0
- package/dist/compiler/runtime/route-strategy.d.ts.map +1 -0
- package/dist/compiler/runtime/route-strategy.js +72 -0
- package/dist/compiler/runtime/route-strategy.js.map +1 -0
- package/dist/compiler/runtime/set-locale.d.ts +46 -0
- package/dist/compiler/runtime/set-locale.d.ts.map +1 -0
- package/dist/compiler/runtime/set-locale.js +172 -0
- package/dist/compiler/runtime/set-locale.js.map +1 -0
- package/dist/compiler/runtime/set-locale.test.d.ts +1 -0
- package/dist/compiler/runtime/set-locale.test.d.ts.map +1 -0
- package/dist/compiler/runtime/set-locale.test.js +555 -0
- package/dist/compiler/runtime/set-locale.test.js.map +1 -0
- package/dist/compiler/runtime/should-redirect.d.ts +100 -0
- package/dist/compiler/runtime/should-redirect.d.ts.map +1 -0
- package/dist/compiler/runtime/should-redirect.js +155 -0
- package/dist/compiler/runtime/should-redirect.js.map +1 -0
- package/dist/compiler/runtime/should-redirect.test.d.ts +1 -0
- package/dist/compiler/runtime/should-redirect.test.d.ts.map +1 -0
- package/dist/compiler/runtime/should-redirect.test.js +270 -0
- package/dist/compiler/runtime/should-redirect.test.js.map +1 -0
- package/dist/compiler/runtime/strategy.d.ts +63 -0
- package/dist/compiler/runtime/strategy.d.ts.map +1 -0
- package/dist/compiler/runtime/strategy.js +65 -0
- package/dist/compiler/runtime/strategy.js.map +1 -0
- package/dist/compiler/runtime/strategy.test.d.ts +1 -0
- package/dist/compiler/runtime/strategy.test.d.ts.map +1 -0
- package/dist/compiler/runtime/strategy.test.js +90 -0
- package/dist/compiler/runtime/strategy.test.js.map +1 -0
- package/dist/compiler/runtime/track-message-call.d.ts +5 -0
- package/dist/compiler/runtime/track-message-call.d.ts.map +1 -0
- package/dist/compiler/runtime/track-message-call.js +14 -0
- package/dist/compiler/runtime/track-message-call.js.map +1 -0
- package/dist/compiler/runtime/track-message-call.test.d.ts +1 -0
- package/dist/compiler/runtime/track-message-call.test.d.ts.map +1 -0
- package/dist/compiler/runtime/track-message-call.test.js +22 -0
- package/dist/compiler/runtime/track-message-call.test.js.map +1 -0
- package/dist/compiler/runtime/type-definitions.d.ts +197 -0
- package/dist/compiler/runtime/type-definitions.d.ts.map +1 -0
- package/dist/compiler/runtime/type-definitions.js +150 -0
- package/dist/compiler/runtime/type-definitions.js.map +1 -0
- package/dist/compiler/runtime/type.d.ts +47 -0
- package/dist/compiler/runtime/type.d.ts.map +1 -0
- package/dist/compiler/runtime/type.js +2 -0
- package/dist/compiler/runtime/type.js.map +1 -0
- package/dist/compiler/runtime/type.test.d.ts +1 -0
- package/dist/compiler/runtime/type.test.d.ts.map +1 -0
- package/dist/compiler/runtime/type.test.js +153 -0
- package/dist/compiler/runtime/type.test.js.map +1 -0
- package/dist/compiler/runtime/url-pattern.d.ts +12 -0
- package/dist/compiler/runtime/url-pattern.d.ts.map +1 -0
- package/dist/compiler/runtime/url-pattern.js +35 -0
- package/dist/compiler/runtime/url-pattern.js.map +1 -0
- package/dist/compiler/runtime/variables.d.ts +128 -0
- package/dist/compiler/runtime/variables.d.ts.map +1 -0
- package/dist/compiler/runtime/variables.js +111 -0
- package/dist/compiler/runtime/variables.js.map +1 -0
- package/dist/compiler/safe-module-id.d.ts +7 -0
- package/dist/compiler/safe-module-id.d.ts.map +1 -0
- package/dist/compiler/safe-module-id.js +78 -0
- package/dist/compiler/safe-module-id.js.map +1 -0
- package/dist/compiler/safe-module-id.test.d.ts +1 -0
- package/dist/compiler/safe-module-id.test.d.ts.map +1 -0
- package/dist/compiler/safe-module-id.test.js +36 -0
- package/dist/compiler/safe-module-id.test.js.map +1 -0
- package/dist/compiler/seed-previous-compilation.d.ts +7 -0
- package/dist/compiler/seed-previous-compilation.d.ts.map +1 -0
- package/dist/compiler/seed-previous-compilation.js +9 -0
- package/dist/compiler/seed-previous-compilation.js.map +1 -0
- package/dist/compiler/server/create-server-file.d.ts +12 -0
- package/dist/compiler/server/create-server-file.d.ts.map +1 -0
- package/dist/compiler/server/create-server-file.js +91 -0
- package/dist/compiler/server/create-server-file.js.map +1 -0
- package/dist/compiler/server/create-server-file.test.d.ts +1 -0
- package/dist/compiler/server/create-server-file.test.d.ts.map +1 -0
- package/dist/compiler/server/create-server-file.test.js +48 -0
- package/dist/compiler/server/create-server-file.test.js.map +1 -0
- package/dist/compiler/server/middleware.d.ts +98 -0
- package/dist/compiler/server/middleware.d.ts.map +1 -0
- package/dist/compiler/server/middleware.js +278 -0
- package/dist/compiler/server/middleware.js.map +1 -0
- package/dist/compiler/server/middleware.test.d.ts +1 -0
- package/dist/compiler/server/middleware.test.d.ts.map +1 -0
- package/dist/compiler/server/middleware.test.js +1001 -0
- package/dist/compiler/server/middleware.test.js.map +1 -0
- package/dist/compiler/server/type.d.ts +6 -0
- package/dist/compiler/server/type.d.ts.map +1 -0
- package/dist/compiler/server/type.js +2 -0
- package/dist/compiler/server/type.js.map +1 -0
- package/dist/compiler/test-helpers.d.ts +30 -0
- package/dist/compiler/test-helpers.d.ts.map +1 -0
- package/dist/compiler/test-helpers.js +50 -0
- package/dist/compiler/test-helpers.js.map +1 -0
- package/dist/compiler/types.d.ts +7 -0
- package/dist/compiler/types.d.ts.map +1 -0
- package/dist/compiler/types.js +2 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/compiler/variable-access.d.ts +3 -0
- package/dist/compiler/variable-access.d.ts.map +1 -0
- package/dist/compiler/variable-access.js +15 -0
- package/dist/compiler/variable-access.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/messages/ast.d.ts +102 -0
- package/dist/messages/ast.d.ts.map +1 -0
- package/dist/messages/ast.js +8 -0
- package/dist/messages/ast.js.map +1 -0
- package/dist/messages/create-bundle-nested.d.ts +16 -0
- package/dist/messages/create-bundle-nested.d.ts.map +1 -0
- package/dist/messages/create-bundle-nested.js +22 -0
- package/dist/messages/create-bundle-nested.js.map +1 -0
- package/dist/messages/index.d.ts +5 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +5 -0
- package/dist/messages/index.js.map +1 -0
- package/dist/messages/load-messages.d.ts +19 -0
- package/dist/messages/load-messages.d.ts.map +1 -0
- package/dist/messages/load-messages.js +49 -0
- package/dist/messages/load-messages.js.map +1 -0
- package/dist/messages/message-format/flatten.d.ts +9 -0
- package/dist/messages/message-format/flatten.d.ts.map +1 -0
- package/dist/messages/message-format/flatten.js +32 -0
- package/dist/messages/message-format/flatten.js.map +1 -0
- package/dist/messages/message-format/import-files.d.ts +32 -0
- package/dist/messages/message-format/import-files.d.ts.map +1 -0
- package/dist/messages/message-format/import-files.js +53 -0
- package/dist/messages/message-format/import-files.js.map +1 -0
- package/dist/messages/message-format/import-files.test.d.ts +1 -0
- package/dist/messages/message-format/import-files.test.d.ts.map +1 -0
- package/dist/messages/message-format/import-files.test.js +145 -0
- package/dist/messages/message-format/import-files.test.js.map +1 -0
- package/dist/messages/message-format/index.d.ts +6 -0
- package/dist/messages/message-format/index.d.ts.map +1 -0
- package/dist/messages/message-format/index.js +7 -0
- package/dist/messages/message-format/index.js.map +1 -0
- package/dist/messages/message-format/parse-bundle.d.ts +31 -0
- package/dist/messages/message-format/parse-bundle.d.ts.map +1 -0
- package/dist/messages/message-format/parse-bundle.js +169 -0
- package/dist/messages/message-format/parse-bundle.js.map +1 -0
- package/dist/messages/message-format/parse-declaration.d.ts +2 -0
- package/dist/messages/message-format/parse-declaration.d.ts.map +1 -0
- package/dist/messages/message-format/parse-declaration.js +56 -0
- package/dist/messages/message-format/parse-declaration.js.map +1 -0
- package/dist/messages/message-format/parse-markup.d.ts +4 -0
- package/dist/messages/message-format/parse-markup.d.ts.map +1 -0
- package/dist/messages/message-format/parse-markup.js +167 -0
- package/dist/messages/message-format/parse-markup.js.map +1 -0
- package/dist/messages/message-format/parse-matches.d.ts +5 -0
- package/dist/messages/message-format/parse-matches.d.ts.map +1 -0
- package/dist/messages/message-format/parse-matches.js +31 -0
- package/dist/messages/message-format/parse-matches.js.map +1 -0
- package/dist/messages/message-format/parse-pattern.d.ts +5 -0
- package/dist/messages/message-format/parse-pattern.d.ts.map +1 -0
- package/dist/messages/message-format/parse-pattern.js +120 -0
- package/dist/messages/message-format/parse-pattern.js.map +1 -0
- package/dist/messages/message-format/unique.d.ts +2 -0
- package/dist/messages/message-format/unique.d.ts.map +1 -0
- package/dist/messages/message-format/unique.js +5 -0
- package/dist/messages/message-format/unique.js.map +1 -0
- package/dist/messages/nest-bundles.d.ts +19 -0
- package/dist/messages/nest-bundles.d.ts.map +1 -0
- package/dist/messages/nest-bundles.js +49 -0
- package/dist/messages/nest-bundles.js.map +1 -0
- package/dist/services/account/index.d.ts +14 -0
- package/dist/services/account/index.d.ts.map +1 -0
- package/dist/services/account/index.js +43 -0
- package/dist/services/account/index.js.map +1 -0
- package/dist/services/account/types.d.ts +4 -0
- package/dist/services/account/types.d.ts.map +1 -0
- package/dist/services/account/types.js +2 -0
- package/dist/services/account/types.js.map +1 -0
- package/dist/services/codegen/escape.d.ts +9 -0
- package/dist/services/codegen/escape.d.ts.map +1 -0
- package/dist/services/codegen/escape.js +19 -0
- package/dist/services/codegen/escape.js.map +1 -0
- package/dist/services/codegen/quotes.d.ts +4 -0
- package/dist/services/codegen/quotes.d.ts.map +1 -0
- package/dist/services/codegen/quotes.js +5 -0
- package/dist/services/codegen/quotes.js.map +1 -0
- package/dist/services/env-variables/create-index-file.d.ts +9 -0
- package/dist/services/env-variables/create-index-file.d.ts.map +1 -0
- package/dist/services/env-variables/create-index-file.js +28 -0
- package/dist/services/env-variables/create-index-file.js.map +1 -0
- package/dist/services/env-variables/index.d.ts +3 -0
- package/dist/services/env-variables/index.d.ts.map +1 -0
- package/dist/services/env-variables/index.js +4 -0
- package/dist/services/env-variables/index.js.map +1 -0
- package/dist/services/environment/package.d.ts +9 -0
- package/dist/services/environment/package.d.ts.map +1 -0
- package/dist/services/environment/package.js +31 -0
- package/dist/services/environment/package.js.map +1 -0
- package/dist/services/environment/package.test.d.ts +1 -0
- package/dist/services/environment/package.test.d.ts.map +1 -0
- package/dist/services/environment/package.test.js +21 -0
- package/dist/services/environment/package.test.js.map +1 -0
- package/dist/services/error-handling.d.ts +12 -0
- package/dist/services/error-handling.d.ts.map +1 -0
- package/dist/services/error-handling.js +27 -0
- package/dist/services/error-handling.js.map +1 -0
- package/dist/services/error-handling.test.d.ts +1 -0
- package/dist/services/error-handling.test.d.ts.map +1 -0
- package/dist/services/error-handling.test.js +10 -0
- package/dist/services/error-handling.test.js.map +1 -0
- package/dist/services/file-handling/content-hash.d.ts +9 -0
- package/dist/services/file-handling/content-hash.js +19 -0
- package/dist/services/file-handling/content-hash.js.map +1 -0
- package/dist/services/file-handling/exists.d.ts +7 -0
- package/dist/services/file-handling/exists.d.ts.map +1 -0
- package/dist/services/file-handling/exists.js +24 -0
- package/dist/services/file-handling/exists.js.map +1 -0
- package/dist/services/file-handling/exists.test.d.ts +1 -0
- package/dist/services/file-handling/exists.test.d.ts.map +1 -0
- package/dist/services/file-handling/exists.test.js +27 -0
- package/dist/services/file-handling/exists.test.js.map +1 -0
- package/dist/services/file-handling/types.d.ts +4 -0
- package/dist/services/file-handling/types.d.ts.map +1 -0
- package/dist/services/file-handling/types.js +2 -0
- package/dist/services/file-handling/types.js.map +1 -0
- package/dist/services/file-handling/write-output.d.ts +21 -0
- package/dist/services/file-handling/write-output.d.ts.map +1 -0
- package/dist/services/file-handling/write-output.js +157 -0
- package/dist/services/file-handling/write-output.js.map +1 -0
- package/dist/services/file-handling/write-output.test.d.ts +1 -0
- package/dist/services/file-handling/write-output.test.d.ts.map +1 -0
- package/dist/services/file-handling/write-output.test.js +217 -0
- package/dist/services/file-handling/write-output.test.js.map +1 -0
- package/dist/services/file-watching/tracked-fs.d.ts +25 -0
- package/dist/services/file-watching/tracked-fs.d.ts.map +1 -0
- package/dist/services/file-watching/tracked-fs.js +94 -0
- package/dist/services/file-watching/tracked-fs.js.map +1 -0
- package/dist/services/file-watching/tracked-fs.test.d.ts +1 -0
- package/dist/services/file-watching/tracked-fs.test.d.ts.map +1 -0
- package/dist/services/file-watching/tracked-fs.test.js +87 -0
- package/dist/services/file-watching/tracked-fs.test.js.map +1 -0
- package/dist/services/logger/index.d.ts +17 -0
- package/dist/services/logger/index.d.ts.map +1 -0
- package/dist/services/logger/index.js +58 -0
- package/dist/services/logger/index.js.map +1 -0
- package/dist/services/lookup.d.ts +14 -0
- package/dist/services/lookup.d.ts.map +1 -0
- package/dist/services/lookup.js +24 -0
- package/dist/services/lookup.js.map +1 -0
- package/dist/urlpattern-polyfill/index.d.ts +2 -0
- package/dist/urlpattern-polyfill/index.d.ts.map +1 -0
- package/dist/urlpattern-polyfill/index.js +2 -0
- package/dist/urlpattern-polyfill/index.js.map +1 -0
- package/dist/utilities/detect-json-formatting.d.ts +10 -0
- package/dist/utilities/detect-json-formatting.d.ts.map +1 -0
- package/dist/utilities/detect-json-formatting.js +80 -0
- package/dist/utilities/detect-json-formatting.js.map +1 -0
- package/dist/utilities/node-normalize-path.d.ts +1 -0
- package/dist/utilities/node-normalize-path.d.ts.map +1 -0
- package/dist/utilities/node-normalize-path.js +10 -0
- package/dist/utilities/node-normalize-path.js.map +1 -0
- package/package.json +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Opral US Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @sebbro/paraglide-lite
|
|
2
|
+
|
|
3
|
+
Unofficial personal fork of [opral/paraglide-js](https://github.com/opral/paraglide-js).
|
|
4
|
+
|
|
5
|
+
**Not affiliated with Opral / inlang.** For most projects, use official [Paraglide JS](https://github.com/opral/paraglide-js) and the [docs](https://paraglidejs.com).
|
|
6
|
+
|
|
7
|
+
This package exists for apps that want a compiler-first i18n setup **without** an inlang project (`project.inlang`), plus a few compile/runtime tweaks.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @sebbro/paraglide-lite
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
// messages/en.json
|
|
19
|
+
{
|
|
20
|
+
"greeting": "Hello {name}!"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { defineConfig } from "vite";
|
|
26
|
+
import { paraglideVitePlugin } from "@sebbro/paraglide-lite";
|
|
27
|
+
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
plugins: [
|
|
30
|
+
paraglideVitePlugin({
|
|
31
|
+
messages: "./messages/{locale}.json",
|
|
32
|
+
locales: ["en", "de"],
|
|
33
|
+
baseLocale: "en",
|
|
34
|
+
outdir: "./src/paraglide",
|
|
35
|
+
}),
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { m } from "./paraglide/messages.js";
|
|
42
|
+
import { locales, setLocale } from "./paraglide/runtime.js";
|
|
43
|
+
|
|
44
|
+
m.greeting({ name: "World" });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
CLI:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
paraglide-lite compile \
|
|
51
|
+
--messages './messages/{locale}.json' \
|
|
52
|
+
--locales en,de \
|
|
53
|
+
--base-locale en \
|
|
54
|
+
--outdir ./src/paraglide
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See `examples/sveltekit`, `examples/vite`, and `examples/cli`.
|
|
58
|
+
|
|
59
|
+
## Differs from upstream
|
|
60
|
+
|
|
61
|
+
- No inlang project / SDK — configure `messages`, `locales`, `baseLocale`, `outdir` directly
|
|
62
|
+
- Published as `@sebbro/paraglide-lite` with bin `paraglide-lite`
|
|
63
|
+
- Some compile and URL-routing performance changes for my use cases
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT. Based on [opral/paraglide-js](https://github.com/opral/paraglide-js); see [LICENSE](./LICENSE) (Copyright Opral US Inc.).
|
package/bin/run.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const paraglideEsbuildPlugin: (options: import("../index.js").CompilerOptions) => import("unplugin").EsbuildPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/esbuild.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,sFAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esbuild.js","sourceRoot":"","sources":["../../src/bundler-plugins/esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { createEsbuildPlugin } from \"unplugin\";\nimport { unpluginFactory } from \"./unplugin.js\";\n\nexport const paraglideEsbuildPlugin = createEsbuildPlugin(unpluginFactory);\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { paraglideEsbuildPlugin } from "./esbuild.js";
|
|
2
|
+
export { paraglideRolldownPlugin } from "./rolldown.js";
|
|
3
|
+
export { paraglideRollupPlugin } from "./rollup.js";
|
|
4
|
+
export { paraglideRspackPlugin } from "./rspack.js";
|
|
5
|
+
export { paraglideVitePlugin, type ParaglideVitePluginOptions, } from "./vite.js";
|
|
6
|
+
export { paraglideWebpackPlugin } from "./webpack.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACN,mBAAmB,EACnB,KAAK,0BAA0B,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { paraglideEsbuildPlugin } from "./esbuild.js";
|
|
2
|
+
export { paraglideRolldownPlugin } from "./rolldown.js";
|
|
3
|
+
export { paraglideRollupPlugin } from "./rollup.js";
|
|
4
|
+
export { paraglideRspackPlugin } from "./rspack.js";
|
|
5
|
+
export { paraglideVitePlugin, } from "./vite.js";
|
|
6
|
+
export { paraglideWebpackPlugin } from "./webpack.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bundler-plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACN,mBAAmB,GAEnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { paraglideEsbuildPlugin } from \"./esbuild.js\";\nexport { paraglideRolldownPlugin } from \"./rolldown.js\";\nexport { paraglideRollupPlugin } from \"./rollup.js\";\nexport { paraglideRspackPlugin } from \"./rspack.js\";\nexport {\n\tparaglideVitePlugin,\n\ttype ParaglideVitePluginOptions,\n} from \"./vite.js\";\nexport { paraglideWebpackPlugin } from \"./webpack.js\";\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regex-based static scan for `m.<key>(...)` call sites.
|
|
3
|
+
*
|
|
4
|
+
* Limitations (no AST): nested keys (`m.a.b()`), computed non-literal
|
|
5
|
+
* access, and matches inside strings/template literals are not handled
|
|
6
|
+
* precisely. Line/block comments are stripped before matching.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Returns unique message keys referenced via static `m` calls, sorted.
|
|
10
|
+
*/
|
|
11
|
+
export declare function scanMessageKeys(source: string): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Scans each file independently; values are sorted unique keys per file id.
|
|
14
|
+
*/
|
|
15
|
+
export declare function scanMessageKeysFromFiles(files: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
code: string;
|
|
18
|
+
}>): Record<string, string[]>;
|
|
19
|
+
//# sourceMappingURL=scan-message-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-message-keys.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/scan-message-keys.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA+DH;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAaxD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAM1B"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regex-based static scan for `m.<key>(...)` call sites.
|
|
3
|
+
*
|
|
4
|
+
* Limitations (no AST): nested keys (`m.a.b()`), computed non-literal
|
|
5
|
+
* access, and matches inside strings/template literals are not handled
|
|
6
|
+
* precisely. Line/block comments are stripped before matching.
|
|
7
|
+
*/
|
|
8
|
+
const MEMBER_CALL = /\bm\s*(?:\?\s*\.\s*|\.\s*)([A-Za-z_$][\w$]*)\s*\(/g;
|
|
9
|
+
const BRACKET_CALL = /\bm\s*(?:\?\s*\.\s*)?\[\s*(['"])([^"'\\]+)\1\s*\]\s*\(/g;
|
|
10
|
+
/** Strips line/block comments; leaves string and template literals intact. */
|
|
11
|
+
function stripComments(source) {
|
|
12
|
+
let result = "";
|
|
13
|
+
let i = 0;
|
|
14
|
+
while (i < source.length) {
|
|
15
|
+
const c = source[i];
|
|
16
|
+
const next = source[i + 1];
|
|
17
|
+
if (c === '"' || c === "'" || c === "`") {
|
|
18
|
+
const quote = c;
|
|
19
|
+
result += c;
|
|
20
|
+
i += 1;
|
|
21
|
+
while (i < source.length) {
|
|
22
|
+
const ch = source[i];
|
|
23
|
+
result += ch;
|
|
24
|
+
if (ch === "\\" && i + 1 < source.length) {
|
|
25
|
+
result += source[i + 1];
|
|
26
|
+
i += 2;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
i += 1;
|
|
30
|
+
if (ch === quote)
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (c === "/" && next === "/") {
|
|
36
|
+
i += 2;
|
|
37
|
+
while (i < source.length && source[i] !== "\n") {
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (c === "/" && next === "*") {
|
|
43
|
+
i += 2;
|
|
44
|
+
while (i < source.length) {
|
|
45
|
+
if (source[i] === "*" && source[i + 1] === "/") {
|
|
46
|
+
i += 2;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (source[i] === "\n") {
|
|
50
|
+
result += "\n";
|
|
51
|
+
}
|
|
52
|
+
i += 1;
|
|
53
|
+
}
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
result += c;
|
|
57
|
+
i += 1;
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns unique message keys referenced via static `m` calls, sorted.
|
|
63
|
+
*/
|
|
64
|
+
export function scanMessageKeys(source) {
|
|
65
|
+
const code = stripComments(source);
|
|
66
|
+
const keys = new Set();
|
|
67
|
+
for (const match of code.matchAll(MEMBER_CALL)) {
|
|
68
|
+
keys.add(match[1]);
|
|
69
|
+
}
|
|
70
|
+
for (const match of code.matchAll(BRACKET_CALL)) {
|
|
71
|
+
keys.add(match[2]);
|
|
72
|
+
}
|
|
73
|
+
return [...keys].sort();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Scans each file independently; values are sorted unique keys per file id.
|
|
77
|
+
*/
|
|
78
|
+
export function scanMessageKeysFromFiles(files) {
|
|
79
|
+
const result = {};
|
|
80
|
+
for (const file of files) {
|
|
81
|
+
result[file.id] = scanMessageKeys(file.code);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=scan-message-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-message-keys.js","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/scan-message-keys.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,GAChB,oDAAoD,CAAC;AAEtD,MAAM,YAAY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AAK,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-message-keys.test.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/scan-message-keys.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { test, expect } from "vitest";
|
|
2
|
+
import { scanMessageKeys, scanMessageKeysFromFiles, } from "./scan-message-keys.js";
|
|
3
|
+
test("finds m.hello() and m.hello(inputs)", () => {
|
|
4
|
+
expect(scanMessageKeys("m.hello()")).toEqual(["hello"]);
|
|
5
|
+
expect(scanMessageKeys("m.hello(inputs)")).toEqual(["hello"]);
|
|
6
|
+
expect(scanMessageKeys("const t = m.hello({ name: 'a' });")).toEqual([
|
|
7
|
+
"hello",
|
|
8
|
+
]);
|
|
9
|
+
});
|
|
10
|
+
test("finds m['hello']() and m[\"hello\"]()", () => {
|
|
11
|
+
expect(scanMessageKeys("m['hello']()")).toEqual(["hello"]);
|
|
12
|
+
expect(scanMessageKeys('m["hello"]()')).toEqual(["hello"]);
|
|
13
|
+
});
|
|
14
|
+
test("finds optional chaining m?.hello()", () => {
|
|
15
|
+
expect(scanMessageKeys("m?.hello()")).toEqual(["hello"]);
|
|
16
|
+
expect(scanMessageKeys("m?.hello(inputs)")).toEqual(["hello"]);
|
|
17
|
+
});
|
|
18
|
+
test("ignores dynamic m[key]() and m[dynamic]()", () => {
|
|
19
|
+
expect(scanMessageKeys("m[key]()")).toEqual([]);
|
|
20
|
+
expect(scanMessageKeys("m[dynamic]()")).toEqual([]);
|
|
21
|
+
expect(scanMessageKeys("m[key](); m.hello();")).toEqual(["hello"]);
|
|
22
|
+
});
|
|
23
|
+
test("ignores comments containing m.foo(", () => {
|
|
24
|
+
expect(scanMessageKeys("// m.foo()\nm.bar()")).toEqual(["bar"]);
|
|
25
|
+
expect(scanMessageKeys("/* m.foo() */\nm.bar()")).toEqual(["bar"]);
|
|
26
|
+
expect(scanMessageKeys(`
|
|
27
|
+
// m.ignored(
|
|
28
|
+
m.real();
|
|
29
|
+
/* m.alsoIgnored( */
|
|
30
|
+
m.other();
|
|
31
|
+
`)).toEqual(["other", "real"]);
|
|
32
|
+
});
|
|
33
|
+
test("returns unique keys in stable sorted order", () => {
|
|
34
|
+
expect(scanMessageKeys(`
|
|
35
|
+
m.zebra();
|
|
36
|
+
m.apple();
|
|
37
|
+
m.zebra();
|
|
38
|
+
m['mango']();
|
|
39
|
+
m.apple(x);
|
|
40
|
+
`)).toEqual(["apple", "mango", "zebra"]);
|
|
41
|
+
});
|
|
42
|
+
test("scanMessageKeysFromFiles aggregates per file", () => {
|
|
43
|
+
expect(scanMessageKeysFromFiles([
|
|
44
|
+
{ id: "a.ts", code: "m.hello(); m.world();" },
|
|
45
|
+
{ id: "b.ts", code: "m.world(); m.apple();" },
|
|
46
|
+
{ id: "c.ts", code: "// m.noop()\nconst x = 1;" },
|
|
47
|
+
])).toEqual({
|
|
48
|
+
"a.ts": ["hello", "world"],
|
|
49
|
+
"b.ts": ["apple", "world"],
|
|
50
|
+
"c.ts": [],
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=scan-message-keys.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-message-keys.test.js","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/scan-message-keys.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACN,eAAe,EACf,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAChD,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC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AAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,MAAM,CACL,eAAe,CAAC;;;;;GAKf,CAAC,CACF,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4CAA4C,EAAE,GAAG,EAAE;IACvD,MAAM,CACL,eAAe,CAAC;;;;;;GAMf,CAAC,CACF,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8CAA8C,EAAE,GAAG,EAAE;IACzD,MAAM,CACL,wBAAwB,CAAC;QACxB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE;QAC7C,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE;QAC7C,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE;KACjD,CAAC,CACF,CAAC,OAAO,CAAC;QACT,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,MAAM,EAAE,EAAE;KACV,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR helpers for lazy message modules.
|
|
3
|
+
*
|
|
4
|
+
* Framework integrations (SvelteKit first) own the request lifecycle;
|
|
5
|
+
* Paraglide exposes prefetch + modulepreload helpers only.
|
|
6
|
+
*/
|
|
7
|
+
import type { LazyMessageManifest } from "../../compiler/lazy-modules/manifest.js";
|
|
8
|
+
/**
|
|
9
|
+
* Resolve message keys declared for a route in the manifest.
|
|
10
|
+
*/
|
|
11
|
+
export declare function keysForRoute(manifest: LazyMessageManifest, routeId: string): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Resolve message keys for a SvelteKit `route.id` (e.g. `/` or `/about`).
|
|
14
|
+
*
|
|
15
|
+
* Matches scanned files like `src/routes/+page.svelte` and
|
|
16
|
+
* `src/routes/about/+page.svelte` regardless of absolute/relative prefix.
|
|
17
|
+
*/
|
|
18
|
+
export declare function keysForSvelteKitRoute(manifest: LazyMessageManifest, routeId: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Build `<link rel="modulepreload">` tags for message module URLs.
|
|
21
|
+
*
|
|
22
|
+
* Only emits links when Vite has filled `entry.url` (hashed immutable
|
|
23
|
+
* chunk). Never falls back to compiler module paths — those are not
|
|
24
|
+
* public URLs and break SvelteKit prerender link crawling.
|
|
25
|
+
*/
|
|
26
|
+
export declare function modulepreloadLinks(args: {
|
|
27
|
+
manifest: LazyMessageManifest;
|
|
28
|
+
locale: string;
|
|
29
|
+
keys: string[];
|
|
30
|
+
}): string;
|
|
31
|
+
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/ssr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnF;;GAEG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,MAAM,GACb,MAAM,EAAE,CAEV;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,MAAM,GACb,MAAM,EAAE,CAcV;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACxC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,GAAG,MAAM,CAUT"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve message keys declared for a route in the manifest.
|
|
3
|
+
*/
|
|
4
|
+
export function keysForRoute(manifest, routeId) {
|
|
5
|
+
return manifest.routes[routeId] ?? [];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolve message keys for a SvelteKit `route.id` (e.g. `/` or `/about`).
|
|
9
|
+
*
|
|
10
|
+
* Matches scanned files like `src/routes/+page.svelte` and
|
|
11
|
+
* `src/routes/about/+page.svelte` regardless of absolute/relative prefix.
|
|
12
|
+
*/
|
|
13
|
+
export function keysForSvelteKitRoute(manifest, routeId) {
|
|
14
|
+
const suffix = routeId === "/"
|
|
15
|
+
? "routes/+page.svelte"
|
|
16
|
+
: `routes${routeId}/+page.svelte`;
|
|
17
|
+
for (const [file, keys] of Object.entries(manifest.routes)) {
|
|
18
|
+
const normalized = file.replace(/\\/g, "/");
|
|
19
|
+
if (normalized.endsWith(suffix)) {
|
|
20
|
+
return keys;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return keysForRoute(manifest, `src/routes${routeId === "/" ? "" : routeId}/+page.svelte`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build `<link rel="modulepreload">` tags for message module URLs.
|
|
27
|
+
*
|
|
28
|
+
* Only emits links when Vite has filled `entry.url` (hashed immutable
|
|
29
|
+
* chunk). Never falls back to compiler module paths — those are not
|
|
30
|
+
* public URLs and break SvelteKit prerender link crawling.
|
|
31
|
+
*/
|
|
32
|
+
export function modulepreloadLinks(args) {
|
|
33
|
+
const hrefs = [];
|
|
34
|
+
for (const key of args.keys) {
|
|
35
|
+
const entry = args.manifest.messages[key]?.[args.locale];
|
|
36
|
+
if (!entry?.url)
|
|
37
|
+
continue;
|
|
38
|
+
hrefs.push(`<link rel="modulepreload" href="${entry.url}" crossorigin="anonymous">`);
|
|
39
|
+
}
|
|
40
|
+
return hrefs.join("\n");
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ssr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.js","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/ssr.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,QAA6B,EAC7B,OAAe;IAEf,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACpC,QAA6B,EAC7B,OAAe;IAEf,MAAM,MAAM,GACX,OAAO,KAAK,GAAG;QACd,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,SAAS,OAAO,eAAe,CAAC;IAEpC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5C,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,YAAY,CAAC,QAAQ,EAAE,aAAa,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,eAAe,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAIlC;IACA,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,EAAE,GAAG;YAAE,SAAS;QAC1B,KAAK,CAAC,IAAI,CACT,mCAAmC,KAAK,CAAC,GAAG,4BAA4B,CACxE,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.test.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/ssr.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { test, expect } from "vitest";
|
|
2
|
+
import { keysForRoute, keysForSvelteKitRoute, modulepreloadLinks, } from "./ssr.js";
|
|
3
|
+
const manifest = {
|
|
4
|
+
version: 1,
|
|
5
|
+
catalogHash: "x",
|
|
6
|
+
locales: ["en", "se"],
|
|
7
|
+
baseLocale: "en",
|
|
8
|
+
messages: {
|
|
9
|
+
hello: {
|
|
10
|
+
en: {
|
|
11
|
+
module: "messages/en/hello.js",
|
|
12
|
+
hash: "a",
|
|
13
|
+
url: "/_app/immutable/chunks/paraglide-en-hello.js",
|
|
14
|
+
},
|
|
15
|
+
se: { module: "messages/se/hello.js", hash: "b" },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
routes: {
|
|
19
|
+
"src/routes/+page.svelte": ["hello"],
|
|
20
|
+
"src/routes/about/+page.svelte": ["about"],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
test("keysForRoute reads manifest.routes", () => {
|
|
24
|
+
expect(keysForRoute(manifest, "src/routes/+page.svelte")).toEqual(["hello"]);
|
|
25
|
+
expect(keysForRoute(manifest, "missing")).toEqual([]);
|
|
26
|
+
});
|
|
27
|
+
test("keysForSvelteKitRoute matches route.id to scanned files", () => {
|
|
28
|
+
expect(keysForSvelteKitRoute(manifest, "/")).toEqual(["hello"]);
|
|
29
|
+
expect(keysForSvelteKitRoute(manifest, "/about")).toEqual(["about"]);
|
|
30
|
+
});
|
|
31
|
+
test("modulepreloadLinks prefers Vite chunk urls", () => {
|
|
32
|
+
const html = modulepreloadLinks({
|
|
33
|
+
manifest,
|
|
34
|
+
locale: "en",
|
|
35
|
+
keys: ["hello"],
|
|
36
|
+
});
|
|
37
|
+
expect(html).toContain('href="/_app/immutable/chunks/paraglide-en-hello.js"');
|
|
38
|
+
expect(html).toContain('rel="modulepreload"');
|
|
39
|
+
});
|
|
40
|
+
test("modulepreloadLinks skips entries without Vite chunk urls", () => {
|
|
41
|
+
const html = modulepreloadLinks({
|
|
42
|
+
manifest,
|
|
43
|
+
locale: "se",
|
|
44
|
+
keys: ["hello"],
|
|
45
|
+
});
|
|
46
|
+
expect(html).toBe("");
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=ssr.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.test.js","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/ssr.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,GAClB,MAAM,UAAU,CAAC;AAGlB,MAAM,QAAQ,GAAwB;IACrC,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,GAAG;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE;QACT,KAAK,EAAE;YACN,EAAE,EAAE;gBACH,MAAM,EAAE,sBAAsB;gBAC9B,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,8CAA8C;aACnD;YACD,EAAE,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,GAAG,EAAE;SACjD;KACD;IACD,MAAM,EAAE;QACP,yBAAyB,EAAE,CAAC,OAAO,CAAC;QACpC,+BAA+B,EAAE,CAAC,OAA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|
+
export declare const VIRTUAL_PREFIX = "virtual:paraglide";
|
|
2
|
+
export declare const VIRTUAL_RESOLVED_PREFIX = "\0virtual:paraglide";
|
|
3
|
+
export declare function toVirtualId(subpath: string): string;
|
|
4
|
+
export declare function toResolvedVirtualId(subpath: string): string;
|
|
5
|
+
export declare function isParaglideVirtualId(id: string): boolean;
|
|
6
|
+
export declare function stripVirtualPrefix(id: string): string | undefined;
|
|
7
|
+
//# sourceMappingURL=virtual-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-ids.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/virtual-ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAClD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAOxD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcjE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const VIRTUAL_PREFIX = "virtual:paraglide";
|
|
2
|
+
export const VIRTUAL_RESOLVED_PREFIX = "\0virtual:paraglide";
|
|
3
|
+
export function toVirtualId(subpath) {
|
|
4
|
+
return `${VIRTUAL_PREFIX}/${subpath}`;
|
|
5
|
+
}
|
|
6
|
+
export function toResolvedVirtualId(subpath) {
|
|
7
|
+
return `${VIRTUAL_RESOLVED_PREFIX}/${subpath}`;
|
|
8
|
+
}
|
|
9
|
+
export function isParaglideVirtualId(id) {
|
|
10
|
+
return (id === VIRTUAL_PREFIX ||
|
|
11
|
+
id.startsWith(`${VIRTUAL_PREFIX}/`) ||
|
|
12
|
+
id === VIRTUAL_RESOLVED_PREFIX ||
|
|
13
|
+
id.startsWith(`${VIRTUAL_RESOLVED_PREFIX}/`));
|
|
14
|
+
}
|
|
15
|
+
export function stripVirtualPrefix(id) {
|
|
16
|
+
if (id === VIRTUAL_RESOLVED_PREFIX) {
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
if (id.startsWith(`${VIRTUAL_RESOLVED_PREFIX}/`)) {
|
|
20
|
+
return id.slice(VIRTUAL_RESOLVED_PREFIX.length + 1);
|
|
21
|
+
}
|
|
22
|
+
if (id === VIRTUAL_PREFIX) {
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
if (id.startsWith(`${VIRTUAL_PREFIX}/`)) {
|
|
26
|
+
return id.slice(VIRTUAL_PREFIX.length + 1);
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=virtual-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-ids.js","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/virtual-ids.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE7D,MAAM,UAAU,WAAW,CAAC,OAAe;IAC1C,OAAO,GAAG,cAAc,IAAI,OAAO,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAe;IAClD,OAAO,GAAG,uBAAuB,IAAI,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,EAAU;IAC9C,OAAO,CACN,EAAE,KAAK,cAAc;QACrB,EAAE,CAAC,UAAU,CAAC,GAAG,cAAc,GAAG,CAAC;QACnC,EAAE,KAAK,uBAAuB;QAC9B,EAAE,CAAC,UAAU,CAAC,GAAG,uBAAuB,GAAG,CAAC,CAC5C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC5C,IAAI,EAAE,KAAK,uBAAuB,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,uBAAuB,GAAG,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,EAAE,KAAK,cAAc,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,cAAc,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient module types for `virtual:paraglide`.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* /// <reference types="@inlang/paraglide-js/virtual" />
|
|
6
|
+
* ```
|
|
7
|
+
*/
|
|
8
|
+
declare module "virtual:paraglide" {
|
|
9
|
+
export const m: Record<
|
|
10
|
+
string,
|
|
11
|
+
(
|
|
12
|
+
inputs?: Record<string, unknown>,
|
|
13
|
+
options?: { locale?: string }
|
|
14
|
+
) => string
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export function prefetchMessages(args: {
|
|
18
|
+
locale: string;
|
|
19
|
+
keys: string[];
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
|
|
22
|
+
export function loadMessageModule(
|
|
23
|
+
locale: string,
|
|
24
|
+
key: string
|
|
25
|
+
): Promise<
|
|
26
|
+
| ((
|
|
27
|
+
inputs?: Record<string, unknown>,
|
|
28
|
+
options?: { locale?: string }
|
|
29
|
+
) => string)
|
|
30
|
+
| undefined
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export function getLocale(): string;
|
|
34
|
+
export function setLocale(
|
|
35
|
+
locale: string,
|
|
36
|
+
options?: { reload?: boolean }
|
|
37
|
+
): void | Promise<void>;
|
|
38
|
+
export function getTextDirection(locale?: string): "ltr" | "rtl";
|
|
39
|
+
export const baseLocale: string;
|
|
40
|
+
export const locales: readonly string[];
|
|
41
|
+
export function assertIsLocale(input: unknown): string;
|
|
42
|
+
export function isLocale(locale: unknown): boolean;
|
|
43
|
+
|
|
44
|
+
export function localizeHref(
|
|
45
|
+
href: string,
|
|
46
|
+
options?: { locale?: string }
|
|
47
|
+
): string;
|
|
48
|
+
export function deLocalizeHref(href: string): string;
|
|
49
|
+
export function localizeUrl(
|
|
50
|
+
url: string | URL,
|
|
51
|
+
options?: { locale?: string }
|
|
52
|
+
): URL;
|
|
53
|
+
export function deLocalizeUrl(url: string | URL): URL;
|
|
54
|
+
|
|
55
|
+
export function paraglideMiddleware(
|
|
56
|
+
request: Request,
|
|
57
|
+
resolve: (args: {
|
|
58
|
+
request: Request;
|
|
59
|
+
locale: string;
|
|
60
|
+
}) => Response | Promise<Response>,
|
|
61
|
+
options?: unknown
|
|
62
|
+
): Promise<Response>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare module "virtual:paraglide/manifest" {
|
|
66
|
+
const manifest: {
|
|
67
|
+
version: 1;
|
|
68
|
+
catalogHash: string;
|
|
69
|
+
locales: string[];
|
|
70
|
+
baseLocale: string;
|
|
71
|
+
messages: Record<
|
|
72
|
+
string,
|
|
73
|
+
Record<string, { module: string; hash: string; url?: string }>
|
|
74
|
+
>;
|
|
75
|
+
routes: Record<string, string[]>;
|
|
76
|
+
};
|
|
77
|
+
export default manifest;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare module "virtual:paraglide/runtime.js" {
|
|
81
|
+
export * from "virtual:paraglide";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare module "virtual:paraglide/server.js" {
|
|
85
|
+
export { paraglideMiddleware } from "virtual:paraglide";
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,QAAQ,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CACrB,MAAM,EACN,CACC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KACzB,MAAM,CACX,CAAC;IAEF,SAAgB,gBAAgB,CAAC,IAAI,EAAE;QACtC,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,CAAC;KACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElB,SAAgB,iBAAiB,CAChC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACT,OAAO,CACP,CAAC,CACD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KACxB,MAAM,CAAC,GACZ,SAAS,CACX,CAAC;IAEF,SAAgB,SAAS,IAAI,MAAM,CAAC;IACpC,SAAgB,SAAS,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC5B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,SAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAC1D,MAAM,UAAU,EAAE,MAAM,CAAC;IACzB,MAAM,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,SAAgB,cAAc,CAAC,KAAK,EAAE,OAA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}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
import { type CompilerOptions } from "../../compiler/compiler-options.js";
|
|
3
|
+
export type LazyModulesPluginOptions = Omit<CompilerOptions, "outputStructure" | "cleanOutdir"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Write thin re-exports + `messages.d.ts` for `$lib/paraglide` style
|
|
6
|
+
* imports. Runtime resolves through `virtual:paraglide`.
|
|
7
|
+
*/
|
|
8
|
+
outdir?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Vite plugin for lazy per-(locale, key) message modules.
|
|
12
|
+
*
|
|
13
|
+
* Message modules stay in the Rolldown module graph via dynamic `import()`s
|
|
14
|
+
* from the loader, so they emit as normal immutable chunks (e.g. SvelteKit
|
|
15
|
+
* `_app/immutable/chunks/`). No custom `/i18n/` asset tree.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createLazyModulesVitePlugin(options: LazyModulesPluginOptions): Plugin;
|
|
18
|
+
//# sourceMappingURL=vite-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/bundler-plugins/lazy-modules/vite-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAElD,OAAO,EAEN,KAAK,eAAe,EACpB,MAAM,oCAAoC,CAAC;AA0B5C,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAC1C,eAAe,EACf,iBAAiB,GAAG,aAAa,CACjC,GAAG;IACH;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAQF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,wBAAwB,GAC/B,MAAM,CAwRR"}
|