@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-annotation.js","sourceRoot":"","sources":["../../src/compiler/compile-annotation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACrC,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,cAAc;CACd,CAAC,CAAC;AAEH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,OAAO,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAChC,GAAW,EACX,MAAc,EACd,UAA8B;IAE9B,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACxC,2BAA2B,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,YAAY,UAAU,CAAC,IAAI,KAAK,MAAM,MAAM,GAAG,KAAK,cAA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KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import type {\n\tFunctionReference,\n\tLiteral,\n\tVariableReference,\n} from \"../messages/ast.js\";\nimport { compileInputAccess } from \"./variable-access.js\";\nimport { escapeForDoubleQuoteString } from \"../services/codegen/escape.js\";\n\n/**\n * The functions shipped in the generated registry.js file.\n *\n * @see createRegistry()\n */\nconst registryFunctionNames = new Set([\n\t\"plural\",\n\t\"number\",\n\t\"datetime\",\n\t\"relativetime\",\n]);\n\nexport function isRegistryFunction(name: string): boolean {\n\treturn registryFunctionNames.has(name);\n}\n\nexport function registryFunctionNamesForDisplay(): string {\n\treturn Array.from(registryFunctionNames).join(\", \");\n}\n\n/**\n * Wraps a compiled expression value in a `registry.*` call if an\n * annotation is present.\n *\n * @example\n * compileAnnotation(\"i?.count\", \"en\", { type: \"function-reference\", name: \"number\", options: [] })\n * >> 'registry.number(\"en\", i?.count, {})'\n */\nexport function compileAnnotation(\n\tstr: string,\n\tlocale: string,\n\tannotation?: FunctionReference\n): string {\n\tif (!annotation) {\n\t\treturn str;\n\t}\n\tif (annotation.name === \"relativetime\") {\n\t\tvalidateRelativeTimeOptions(annotation);\n\t}\n\treturn `registry.${annotation.name}(\"${locale}\", ${str}, ${compileOptions(annotation.name, annotation.options)})`;\n}\n\nfunction compileOptions(\n\tannotationName: string,\n\toptions: FunctionReference[\"options\"]\n): string {\n\tif (options.length === 0) {\n\t\treturn \"{}\";\n\t}\n\tconst entries: string[] = options.map(\n\t\t(option) =>\n\t\t\t`${option.name}: ${compileOptionLiteralOrVarRef(\n\t\t\t\tannotationName,\n\t\t\t\toption.name,\n\t\t\t\toption.value\n\t\t\t)}`\n\t);\n\tconst code = \"{ \" + entries.join(\", \") + \" }\";\n\n\treturn code;\n}\n\nconst numericOptionNamesByAnnotation: Record<string, ReadonlySet<string>> = {\n\tnumber: new Set([\n\t\t\"minimumIntegerDigits\",\n\t\t\"minimumFractionDigits\",\n\t\t\"maximumFractionDigits\",\n\t\t\"minimumSignificantDigits\",\n\t\t\"maximumSignificantDigits\",\n\t\t\"roundingIncrement\",\n\t]),\n\tplural: new Set([\n\t\t\"minimumIntegerDigits\",\n\t\t\"minimumFractionDigits\",\n\t\t\"maximumFractionDigits\",\n\t\t\"minimumSignificantDigits\",\n\t\t\"maximumSignificantDigits\",\n\t]),\n\tdatetime: new Set([\"fractionalSecondDigits\"]),\n};\n\nconst booleanOptionNamesByAnnotation: Record<string, ReadonlySet<string>> = {\n\tnumber: new Set([\"useGrouping\"]),\n\tdatetime: new Set([\"hour12\"]),\n};\n\nconst jsNonNegativeIntegerPattern = /^(?:0|[1-9]\\d*)$/;\n\nfunction compileOptionLiteralOrVarRef(\n\tannotationName: string,\n\toptionName: string,\n\tvalue: Literal | VariableReference\n): string {\n\tif (value.type === \"variable-reference\") {\n\t\tif (annotationName === \"relativetime\" && optionName === \"unit\") {\n\t\t\treturn `/** @type {import(\"../registry.js\").RelativeTimeFormatUnit} */ (${compileInputAccess(value.name)})`;\n\t\t}\n\t\treturn compileInputAccess(value.name);\n\t}\n\n\tif (\n\t\tannotationName === \"relativetime\" &&\n\t\toptionName === \"unit\" &&\n\t\tisDollarVariableReference(value.value)\n\t) {\n\t\treturn `/** @type {import(\"../registry.js\").RelativeTimeFormatUnit} */ (${compileInputAccess(value.value.slice(1))})`;\n\t}\n\n\tif (shouldEmitNumberLiteral(annotationName, optionName, value.value)) {\n\t\treturn value.value;\n\t}\n\n\tif (shouldEmitBooleanLiteral(annotationName, optionName, value.value)) {\n\t\treturn value.value;\n\t}\n\n\treturn `\"${escapeForDoubleQuoteString(value.value)}\"`;\n}\n\nfunction shouldEmitNumberLiteral(\n\tannotationName: string,\n\toptionName: string,\n\tliteral: string\n): boolean {\n\treturn (\n\t\tnumericOptionNamesByAnnotation[annotationName]?.has(optionName) === true &&\n\t\tjsNonNegativeIntegerPattern.test(literal)\n\t);\n}\n\nfunction shouldEmitBooleanLiteral(\n\tannotationName: string,\n\toptionName: string,\n\tliteral: string\n): boolean {\n\treturn (\n\t\tbooleanOptionNamesByAnnotation[annotationName]?.has(optionName) === true &&\n\t\t(literal === \"true\" || literal === \"false\")\n\t);\n}\n\nconst relativeTimeUnits = new Set([\n\t\"year\",\n\t\"years\",\n\t\"quarter\",\n\t\"quarters\",\n\t\"month\",\n\t\"months\",\n\t\"week\",\n\t\"weeks\",\n\t\"day\",\n\t\"days\",\n\t\"hour\",\n\t\"hours\",\n\t\"minute\",\n\t\"minutes\",\n\t\"second\",\n\t\"seconds\",\n]);\n\nfunction validateRelativeTimeOptions(annotation: FunctionReference): void {\n\tconst unitOptions = annotation.options.filter(\n\t\t(option) => option.name === \"unit\"\n\t);\n\n\tif (unitOptions.length === 0) {\n\t\tthrow new Error('The \"relativetime\" formatter requires a \"unit\" option.');\n\t}\n\n\tif (unitOptions.length > 1) {\n\t\tthrow new Error(\n\t\t\t'The \"relativetime\" formatter requires exactly one \"unit\" option.'\n\t\t);\n\t}\n\n\tconst [unitOption] = unitOptions;\n\tif (!unitOption || unitOption.value.type === \"variable-reference\") {\n\t\treturn;\n\t}\n\n\tif (isDollarVariableReference(unitOption.value.value)) {\n\t\treturn;\n\t}\n\n\tif (!relativeTimeUnits.has(unitOption.value.value)) {\n\t\tthrow new Error(\n\t\t\t`Invalid \"relativetime\" unit \"${unitOption.value.value}\". Expected one of: ${Array.from(\n\t\t\t\trelativeTimeUnits\n\t\t\t).join(\", \")}.`\n\t\t);\n\t}\n}\n\nfunction isDollarVariableReference(value: string): boolean {\n\treturn value.startsWith(\"$\") && value.length > 1;\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Bundle, BundleNested, Message, ParaglideSettings } from "../messages/ast.js";
|
|
2
|
+
import type { Compiled } from "./types.js";
|
|
3
|
+
import { type InputMatchTypes } from "./jsdoc-types.js";
|
|
4
|
+
import type { CompilerOptions } from "./compiler-options.js";
|
|
5
|
+
export type CompiledBundleWithMessages = {
|
|
6
|
+
/** The compilation result for the bundle index */
|
|
7
|
+
bundle: Compiled<Bundle>;
|
|
8
|
+
/** The compilation results for the languages */
|
|
9
|
+
messages: {
|
|
10
|
+
[locale: string]: Compiled<Message>;
|
|
11
|
+
};
|
|
12
|
+
/** Match literal types inferred from bundle variants */
|
|
13
|
+
matchTypes: InputMatchTypes;
|
|
14
|
+
/** Shared typedef name for bundle input types used across emitted JSDoc */
|
|
15
|
+
inputTypeAliasName?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Compiles all the messages in the bundle and returns an index-function + each compiled message
|
|
19
|
+
*/
|
|
20
|
+
export declare const compileBundle: (args: {
|
|
21
|
+
bundle: BundleNested;
|
|
22
|
+
fallbackMap: Record<string, string | undefined>;
|
|
23
|
+
messageReferenceExpression: (locale: string, bundleId: string) => string;
|
|
24
|
+
settings?: ParaglideSettings;
|
|
25
|
+
experimentalMiddlewareLocaleSplitting?: boolean;
|
|
26
|
+
experimentalStaticLocale?: CompilerOptions["experimentalStaticLocale"];
|
|
27
|
+
}) => CompiledBundleWithMessages;
|
|
28
|
+
export declare function toBundleInputTypeAliasName(safeBundleId: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-bundle.d.ts","sourceRoot":"","sources":["../../src/compiler/compile-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,MAAM,EACN,YAAY,EAGZ,OAAO,EACP,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAGN,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,MAAM,MAAM,0BAA0B,GAAG;IACxC,kDAAkD;IAClD,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,gDAAgD;IAChD,QAAQ,EAAE;QACT,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;KACpC,CAAC;IACF,wDAAwD;IACxD,UAAU,EAAE,eAAe,CAAC;IAC5B,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,SAAU;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,0BAA0B,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IACzE,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,wBAAwB,CAAC,EAAE,eAAe,CAAC,0BAA0B,CAAC,CAAC;CACvE,KAAG,0BAyCH,CAAC;AAmSF,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { compileMessage } from "./compile-message.js";
|
|
2
|
+
import { inputTypeForName, jsDocBundleFunctionTypes, } from "./jsdoc-types.js";
|
|
3
|
+
import { isValidIdentifier, quotePropertyKey } from "./variable-access.js";
|
|
4
|
+
import { toSafeModuleId } from "./safe-module-id.js";
|
|
5
|
+
import { escapeForDoubleQuoteString } from "../services/codegen/escape.js";
|
|
6
|
+
import { perLocaleBuildStaticLocaleExpression } from "./per-locale-build.js";
|
|
7
|
+
/**
|
|
8
|
+
* Compiles all the messages in the bundle and returns an index-function + each compiled message
|
|
9
|
+
*/
|
|
10
|
+
export const compileBundle = (args) => {
|
|
11
|
+
const compiledMessages = {};
|
|
12
|
+
const safeBundleId = toSafeModuleId(args.bundle.id);
|
|
13
|
+
const inputTypeAliasName = toBundleInputTypeAliasName(safeBundleId);
|
|
14
|
+
const matchTypes = collectInputMatchTypes(args.bundle);
|
|
15
|
+
const hasMarkup = bundleHasMarkup(args.bundle);
|
|
16
|
+
for (const message of args.bundle.messages) {
|
|
17
|
+
if (compiledMessages[message.locale]) {
|
|
18
|
+
throw new Error(`Duplicate locale: ${message.locale}`);
|
|
19
|
+
}
|
|
20
|
+
const compiledMessage = compileMessage(args.bundle.declarations, message, message.variants, matchTypes, inputTypeAliasName);
|
|
21
|
+
// set the pattern for the language tag
|
|
22
|
+
compiledMessages[message.locale] = compiledMessage;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
bundle: compileBundleFunction({
|
|
26
|
+
bundle: args.bundle,
|
|
27
|
+
availableLocales: Object.keys(args.fallbackMap),
|
|
28
|
+
messageReferenceExpression: args.messageReferenceExpression,
|
|
29
|
+
settings: args.settings,
|
|
30
|
+
matchTypes,
|
|
31
|
+
hasMarkup,
|
|
32
|
+
experimentalMiddlewareLocaleSplitting: args.experimentalMiddlewareLocaleSplitting ?? false,
|
|
33
|
+
experimentalStaticLocale: args.experimentalStaticLocale,
|
|
34
|
+
inputTypeAliasName,
|
|
35
|
+
}),
|
|
36
|
+
messages: compiledMessages,
|
|
37
|
+
matchTypes,
|
|
38
|
+
inputTypeAliasName,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const compileBundleFunction = (args) => {
|
|
42
|
+
const inputs = args.bundle.declarations.filter((decl) => decl.type === "input-variable");
|
|
43
|
+
const hasInputs = inputs.length > 0;
|
|
44
|
+
const safeBundleId = toSafeModuleId(args.bundle.id);
|
|
45
|
+
const isSafeBundleId = safeBundleId === args.bundle.id;
|
|
46
|
+
const isFullyTranslated = args.availableLocales.length === args.settings?.locales.length;
|
|
47
|
+
const baseLocale = args.settings?.baseLocale;
|
|
48
|
+
const dispatchLocales = baseLocale && args.availableLocales.includes(baseLocale)
|
|
49
|
+
? [
|
|
50
|
+
...args.availableLocales.filter((locale) => locale !== baseLocale),
|
|
51
|
+
baseLocale,
|
|
52
|
+
]
|
|
53
|
+
: args.availableLocales;
|
|
54
|
+
const inputType = args.inputTypeAliasName;
|
|
55
|
+
const localesUnion = args.availableLocales.length === 0
|
|
56
|
+
? "never"
|
|
57
|
+
: args.availableLocales.map((locale) => `"${locale}"`).join(" | ");
|
|
58
|
+
const optionsType = `{ locale?: ${localesUnion} }`;
|
|
59
|
+
const inputsParameterType = `${hasInputs ? "inputs" : "inputs?"}: ${inputType}`;
|
|
60
|
+
const bundleFunctionType = `(${inputsParameterType}, options?: ${optionsType}) => LocalizedString`;
|
|
61
|
+
const partsFunctionType = `(${inputsParameterType}, options?: ${optionsType}) => import('../runtime.js').MessagePart[]`;
|
|
62
|
+
const markupSchemaType = buildMarkupSchemaType(args.bundle, args.matchTypes);
|
|
63
|
+
const messageMetadataType = `import('../runtime.js').MessageMetadata<${inputType}, ${optionsType}, ${markupSchemaType}>`;
|
|
64
|
+
const compileLocaleReturnStatements = (mode, continuationIndent) => dispatchLocales
|
|
65
|
+
.map((locale, index) => {
|
|
66
|
+
const condition = !isFullyTranslated || index < dispatchLocales.length - 1
|
|
67
|
+
? `if (locale === "${locale}") `
|
|
68
|
+
: "";
|
|
69
|
+
const prefix = index > 0 ? continuationIndent : "";
|
|
70
|
+
const messageRef = args.messageReferenceExpression(locale, args.bundle.id);
|
|
71
|
+
if (mode === "string") {
|
|
72
|
+
return `${prefix}${condition}return ${messageRef}(inputs)`;
|
|
73
|
+
}
|
|
74
|
+
return `${prefix}${condition}return typeof ${messageRef}.parts === "function" ? ${messageRef}.parts(inputs) : [{ type: "text", value: ${messageRef}(inputs) }]`;
|
|
75
|
+
})
|
|
76
|
+
.join("\n");
|
|
77
|
+
const perLocaleBuild = args.experimentalStaticLocale === perLocaleBuildStaticLocaleExpression;
|
|
78
|
+
// A locale-specialized graph may ship source maps. Keeping the English
|
|
79
|
+
// pattern preview in the shared dispatcher would leak base-locale message
|
|
80
|
+
// text into every locale's map even after the English module is tree-shaken.
|
|
81
|
+
const englishMatchTableDoc = perLocaleBuild
|
|
82
|
+
? ""
|
|
83
|
+
: buildEnglishMatchTableDoc(args.bundle);
|
|
84
|
+
const commonJsDoc = `/**
|
|
85
|
+
${englishMatchTableDoc}${jsDocBundleFunctionTypes({
|
|
86
|
+
inputs,
|
|
87
|
+
locales: args.availableLocales,
|
|
88
|
+
matchTypes: args.matchTypes,
|
|
89
|
+
inputTypeOverride: args.inputTypeAliasName,
|
|
90
|
+
})}
|
|
91
|
+
*/`;
|
|
92
|
+
const clientMiddlewareGuard = (indent) => {
|
|
93
|
+
if (!args.experimentalMiddlewareLocaleSplitting) {
|
|
94
|
+
return "";
|
|
95
|
+
}
|
|
96
|
+
return `\n${indent}if (experimentalMiddlewareLocaleSplitting && isServer === false) {\n${indent}\treturn /** @type {any} */ (globalThis).__paraglide.ssr.${safeBundleId}(inputs)\n${indent}}`;
|
|
97
|
+
};
|
|
98
|
+
const clientPartsMiddlewareGuard = (indent) => {
|
|
99
|
+
if (!args.experimentalMiddlewareLocaleSplitting) {
|
|
100
|
+
return "";
|
|
101
|
+
}
|
|
102
|
+
return `\n${indent}if (experimentalMiddlewareLocaleSplitting && isServer === false) {\n${indent}\tconst serverMessage = /** @type {any} */ (globalThis).__paraglide.ssr.${safeBundleId}\n${indent}\tif (typeof serverMessage.parts === "function") {\n${indent}\t\treturn /** @type {import('../runtime.js').MessagePart[]} */ (serverMessage.parts(inputs))\n${indent}\t}\n${indent}\treturn /** @type {import('../runtime.js').MessagePart[]} */ ([{ type: "text", value: serverMessage(inputs) }])\n${indent}}`;
|
|
103
|
+
};
|
|
104
|
+
const maybeTrackMessageCall = (indent) => {
|
|
105
|
+
if (!args.experimentalMiddlewareLocaleSplitting) {
|
|
106
|
+
return "";
|
|
107
|
+
}
|
|
108
|
+
return `\n${indent}trackMessageCall("${safeBundleId}", locale)`;
|
|
109
|
+
};
|
|
110
|
+
const localeResolutionStatement = (indent) => {
|
|
111
|
+
const localeExpression = perLocaleBuild
|
|
112
|
+
? `${perLocaleBuildStaticLocaleExpression} ?? options.locale ?? getLocale()`
|
|
113
|
+
: "experimentalStaticLocale ?? options.locale ?? getLocale()";
|
|
114
|
+
const overrideWarning = perLocaleBuild
|
|
115
|
+
? `\n${indent}if (${perLocaleBuildStaticLocaleExpression} !== undefined && options.locale !== undefined && options.locale !== ${perLocaleBuildStaticLocaleExpression}) console.warn("Paraglide: options.locale cannot override a locale-specialized client bundle; use a full document navigation to switch locales.")`
|
|
116
|
+
: "";
|
|
117
|
+
if (isFullyTranslated &&
|
|
118
|
+
args.availableLocales.length === 1 &&
|
|
119
|
+
!args.experimentalMiddlewareLocaleSplitting) {
|
|
120
|
+
return `${indent}${localeExpression}${overrideWarning}`;
|
|
121
|
+
}
|
|
122
|
+
return `${indent}const locale = ${localeExpression}${overrideWarning}${maybeTrackMessageCall(indent)}`;
|
|
123
|
+
};
|
|
124
|
+
let code = "";
|
|
125
|
+
if (!args.hasMarkup) {
|
|
126
|
+
code = `${commonJsDoc}
|
|
127
|
+
${isSafeBundleId ? "export " : ""}const ${safeBundleId} = /** @type {(${bundleFunctionType}) & ${messageMetadataType}} */ ((inputs${hasInputs ? "" : " = {}"}, options = {}) => {${clientMiddlewareGuard("\t")}
|
|
128
|
+
${localeResolutionStatement("\t")}
|
|
129
|
+
${compileLocaleReturnStatements("string", "\t")}${!isFullyTranslated
|
|
130
|
+
? `\n return /** @type {LocalizedString} */ ("${args.bundle.id}")`
|
|
131
|
+
: ""}
|
|
132
|
+
});`;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
code = `${commonJsDoc}
|
|
136
|
+
${isSafeBundleId ? "export " : ""}const ${safeBundleId} = /** @type {(${bundleFunctionType}) & { parts: ${partsFunctionType} } & ${messageMetadataType}} */ (
|
|
137
|
+
/* @__PURE__ */ Object.assign(
|
|
138
|
+
/** @type {${bundleFunctionType}} */ ((inputs${hasInputs ? "" : " = {}"}, options = {}) => {${clientMiddlewareGuard("\t\t\t")}
|
|
139
|
+
${localeResolutionStatement("\t\t\t")}
|
|
140
|
+
${compileLocaleReturnStatements("string", "\t\t\t")}${!isFullyTranslated
|
|
141
|
+
? `\n return /** @type {LocalizedString} */ (${JSON.stringify(args.bundle.id)})`
|
|
142
|
+
: ""}
|
|
143
|
+
}),
|
|
144
|
+
{
|
|
145
|
+
parts: /** @type {${partsFunctionType}} */ ((inputs${hasInputs ? "" : " = {}"}, options = {}) => {${clientPartsMiddlewareGuard("\t\t\t\t")}
|
|
146
|
+
${localeResolutionStatement("\t\t\t\t")}
|
|
147
|
+
${compileLocaleReturnStatements("parts", "\t\t\t\t")}${!isFullyTranslated
|
|
148
|
+
? `\n return /** @type {import('../runtime.js').MessagePart[]} */ ([{ type: "text", value: ${JSON.stringify(args.bundle.id)} }])`
|
|
149
|
+
: ""}
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
);`;
|
|
154
|
+
}
|
|
155
|
+
if (isSafeBundleId === false) {
|
|
156
|
+
code += `\nexport { ${safeBundleId} as "${escapeForDoubleQuoteString(args.bundle.id)}" }`;
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
code,
|
|
160
|
+
node: args.bundle,
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
function buildEnglishMatchTableDoc(bundle) {
|
|
164
|
+
const message = selectEnglishMessage(bundle);
|
|
165
|
+
if (!message) {
|
|
166
|
+
return "";
|
|
167
|
+
}
|
|
168
|
+
const selectorKeys = collectSelectorKeys(message);
|
|
169
|
+
const headerCells = [...selectorKeys, "output"];
|
|
170
|
+
const lines = [
|
|
171
|
+
`* | ${headerCells.map(escapeTableCell).join(" | ")} |`,
|
|
172
|
+
`* | ${headerCells.map(() => "---").join(" | ")} |`,
|
|
173
|
+
];
|
|
174
|
+
for (const variant of message.variants) {
|
|
175
|
+
const rowValues = selectorKeys.map((key) => getMatchCellValue(variant, key));
|
|
176
|
+
const serializedOutput = serializePatternPreview(variant.pattern);
|
|
177
|
+
const outputValue = JSON.stringify(serializedOutput.length > 160
|
|
178
|
+
? `${serializedOutput.slice(0, 157)}...`
|
|
179
|
+
: serializedOutput);
|
|
180
|
+
lines.push(`* | ${[...rowValues, outputValue].map(escapeTableCell).join(" | ")} |`);
|
|
181
|
+
}
|
|
182
|
+
lines.push("*");
|
|
183
|
+
return lines.join("\n");
|
|
184
|
+
}
|
|
185
|
+
function selectEnglishMessage(bundle) {
|
|
186
|
+
return (bundle.messages.find((message) => message.locale === "en") ??
|
|
187
|
+
bundle.messages.find((message) => message.locale.startsWith("en-")));
|
|
188
|
+
}
|
|
189
|
+
function collectSelectorKeys(message) {
|
|
190
|
+
const keys = [];
|
|
191
|
+
const seen = new Set();
|
|
192
|
+
for (const variant of message.variants) {
|
|
193
|
+
for (const match of variant.matches ?? []) {
|
|
194
|
+
if (seen.has(match.key))
|
|
195
|
+
continue;
|
|
196
|
+
seen.add(match.key);
|
|
197
|
+
keys.push(match.key);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return keys;
|
|
201
|
+
}
|
|
202
|
+
function getMatchCellValue(variant, key) {
|
|
203
|
+
const match = (variant.matches ?? []).find((entry) => entry.key === key);
|
|
204
|
+
if (!match || match.type === "catchall-match") {
|
|
205
|
+
return "*";
|
|
206
|
+
}
|
|
207
|
+
return JSON.stringify(match.value);
|
|
208
|
+
}
|
|
209
|
+
function escapeTableCell(value) {
|
|
210
|
+
return value
|
|
211
|
+
.replace(/\|/g, "\\|")
|
|
212
|
+
.replace(/\r?\n/g, " ")
|
|
213
|
+
.replaceAll("*/", "*\\/");
|
|
214
|
+
}
|
|
215
|
+
export function toBundleInputTypeAliasName(safeBundleId) {
|
|
216
|
+
return `${toBundleTypeBaseName(safeBundleId)}Inputs`;
|
|
217
|
+
}
|
|
218
|
+
function toBundleTypeBaseName(safeBundleId) {
|
|
219
|
+
let baseName = "";
|
|
220
|
+
let capitalizeNext = true;
|
|
221
|
+
for (const character of safeBundleId) {
|
|
222
|
+
if (character === "_") {
|
|
223
|
+
baseName += "_";
|
|
224
|
+
capitalizeNext = true;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (character >= "a" && character <= "z") {
|
|
228
|
+
baseName += capitalizeNext ? character.toUpperCase() : character;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
baseName += character;
|
|
232
|
+
}
|
|
233
|
+
capitalizeNext = false;
|
|
234
|
+
}
|
|
235
|
+
if (!baseName) {
|
|
236
|
+
baseName = "Message";
|
|
237
|
+
}
|
|
238
|
+
if (!/^[A-Za-z_]/.test(baseName)) {
|
|
239
|
+
baseName = `Message${baseName}`;
|
|
240
|
+
}
|
|
241
|
+
return baseName;
|
|
242
|
+
}
|
|
243
|
+
function serializePatternPreview(pattern) {
|
|
244
|
+
let result = "";
|
|
245
|
+
for (const part of pattern) {
|
|
246
|
+
if (part.type === "text") {
|
|
247
|
+
result += part.value;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (part.type === "expression") {
|
|
251
|
+
if (part.arg.type === "literal") {
|
|
252
|
+
result += part.arg.value;
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
result += `{${part.arg.name}}`;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return result.replace(/\s+/g, " ").trim();
|
|
260
|
+
}
|
|
261
|
+
function buildMarkupSchemaType(bundle, matchTypes) {
|
|
262
|
+
const tagAccumulators = new Map();
|
|
263
|
+
const inputVariableNames = new Set(bundle.declarations
|
|
264
|
+
.filter((declaration) => declaration.type === "input-variable")
|
|
265
|
+
.map((declaration) => declaration.name));
|
|
266
|
+
for (const message of bundle.messages) {
|
|
267
|
+
for (const variant of message.variants) {
|
|
268
|
+
for (const part of variant.pattern) {
|
|
269
|
+
if (part.type !== "markup-start" && part.type !== "markup-standalone") {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
const tag = ensureMarkupTagAccumulator(tagAccumulators, part.name);
|
|
273
|
+
tag.occurrences += 1;
|
|
274
|
+
if (part.type === "markup-start") {
|
|
275
|
+
tag.childrenTrue = true;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
tag.childrenFalse = true;
|
|
279
|
+
}
|
|
280
|
+
collectMarkupOptions(tag, part, inputVariableNames, matchTypes);
|
|
281
|
+
collectMarkupAttributes(tag, part);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (tagAccumulators.size === 0) {
|
|
286
|
+
return "{}";
|
|
287
|
+
}
|
|
288
|
+
const tagEntries = Array.from(tagAccumulators.entries())
|
|
289
|
+
.sort(([leftName], [rightName]) => leftName.localeCompare(rightName))
|
|
290
|
+
.map(([tagName, tag]) => `${renderTypeObjectKey(tagName)}: ${renderMarkupTagType(tag)}`);
|
|
291
|
+
return `{ ${tagEntries.join("; ")} }`;
|
|
292
|
+
}
|
|
293
|
+
function ensureMarkupTagAccumulator(accumulators, tagName) {
|
|
294
|
+
const existing = accumulators.get(tagName);
|
|
295
|
+
if (existing) {
|
|
296
|
+
return existing;
|
|
297
|
+
}
|
|
298
|
+
const created = {
|
|
299
|
+
occurrences: 0,
|
|
300
|
+
childrenTrue: false,
|
|
301
|
+
childrenFalse: false,
|
|
302
|
+
options: new Map(),
|
|
303
|
+
attributes: new Map(),
|
|
304
|
+
};
|
|
305
|
+
accumulators.set(tagName, created);
|
|
306
|
+
return created;
|
|
307
|
+
}
|
|
308
|
+
function collectMarkupOptions(tag, part, inputVariableNames, matchTypes) {
|
|
309
|
+
const seenOptions = new Set();
|
|
310
|
+
for (const option of part.options ?? []) {
|
|
311
|
+
const optionAccumulator = ensureMarkupValueAccumulator(tag.options, option.name);
|
|
312
|
+
optionAccumulator.types.add(resolveMarkupOptionType(option.value, inputVariableNames, matchTypes));
|
|
313
|
+
if (!seenOptions.has(option.name)) {
|
|
314
|
+
optionAccumulator.count += 1;
|
|
315
|
+
seenOptions.add(option.name);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function collectMarkupAttributes(tag, part) {
|
|
320
|
+
const seenAttributes = new Set();
|
|
321
|
+
for (const attribute of part.attributes ?? []) {
|
|
322
|
+
const attributeAccumulator = ensureMarkupValueAccumulator(tag.attributes, attribute.name);
|
|
323
|
+
attributeAccumulator.types.add(attribute.value === true ? "true" : "string");
|
|
324
|
+
if (!seenAttributes.has(attribute.name)) {
|
|
325
|
+
attributeAccumulator.count += 1;
|
|
326
|
+
seenAttributes.add(attribute.name);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function resolveMarkupOptionType(value, inputVariableNames, matchTypes) {
|
|
331
|
+
if (value.type === "literal") {
|
|
332
|
+
return "string";
|
|
333
|
+
}
|
|
334
|
+
if (inputVariableNames.has(value.name)) {
|
|
335
|
+
return inputTypeForName(value.name, matchTypes);
|
|
336
|
+
}
|
|
337
|
+
return "NonNullable<unknown>";
|
|
338
|
+
}
|
|
339
|
+
function ensureMarkupValueAccumulator(values, name) {
|
|
340
|
+
const existing = values.get(name);
|
|
341
|
+
if (existing) {
|
|
342
|
+
return existing;
|
|
343
|
+
}
|
|
344
|
+
const created = { count: 0, types: new Set() };
|
|
345
|
+
values.set(name, created);
|
|
346
|
+
return created;
|
|
347
|
+
}
|
|
348
|
+
function renderMarkupTagType(tag) {
|
|
349
|
+
return `{ options: ${renderMarkupObjectType(tag.options, tag.occurrences)}; attributes: ${renderMarkupObjectType(tag.attributes, tag.occurrences)}; children: ${renderChildrenType(tag)} }`;
|
|
350
|
+
}
|
|
351
|
+
function renderMarkupObjectType(values, occurrenceCount) {
|
|
352
|
+
if (values.size === 0) {
|
|
353
|
+
return "{}";
|
|
354
|
+
}
|
|
355
|
+
const properties = Array.from(values.entries())
|
|
356
|
+
.sort(([leftName], [rightName]) => leftName.localeCompare(rightName))
|
|
357
|
+
.map(([name, value]) => {
|
|
358
|
+
const isOptional = value.count < occurrenceCount;
|
|
359
|
+
return `${renderTypeObjectKey(name)}${isOptional ? "?" : ""}: ${renderTypeUnion(value.types)}`;
|
|
360
|
+
});
|
|
361
|
+
return `{ ${properties.join("; ")} }`;
|
|
362
|
+
}
|
|
363
|
+
function renderChildrenType(tag) {
|
|
364
|
+
if (tag.childrenTrue && tag.childrenFalse) {
|
|
365
|
+
return "boolean";
|
|
366
|
+
}
|
|
367
|
+
if (tag.childrenTrue) {
|
|
368
|
+
return "true";
|
|
369
|
+
}
|
|
370
|
+
if (tag.childrenFalse) {
|
|
371
|
+
return "false";
|
|
372
|
+
}
|
|
373
|
+
return "boolean";
|
|
374
|
+
}
|
|
375
|
+
function renderTypeUnion(types) {
|
|
376
|
+
const sorted = Array.from(types).sort();
|
|
377
|
+
if (sorted.length === 0) {
|
|
378
|
+
return "never";
|
|
379
|
+
}
|
|
380
|
+
if (sorted.length === 1) {
|
|
381
|
+
return sorted[0] ?? "never";
|
|
382
|
+
}
|
|
383
|
+
return sorted.join(" | ");
|
|
384
|
+
}
|
|
385
|
+
function renderTypeObjectKey(name) {
|
|
386
|
+
return isValidIdentifier(name) ? name : quotePropertyKey(name);
|
|
387
|
+
}
|
|
388
|
+
function collectInputMatchTypes(bundle) {
|
|
389
|
+
const inputNames = new Set(bundle.declarations
|
|
390
|
+
?.filter((decl) => decl.type === "input-variable")
|
|
391
|
+
.map((decl) => decl.name) ?? []);
|
|
392
|
+
const matchTypes = new Map();
|
|
393
|
+
const ensureInfo = (name) => {
|
|
394
|
+
const existing = matchTypes.get(name);
|
|
395
|
+
if (existing)
|
|
396
|
+
return existing;
|
|
397
|
+
const created = { literals: new Set(), hasCatchAll: false };
|
|
398
|
+
matchTypes.set(name, created);
|
|
399
|
+
return created;
|
|
400
|
+
};
|
|
401
|
+
for (const message of bundle.messages) {
|
|
402
|
+
for (const variant of message.variants) {
|
|
403
|
+
if (!variant.matches || variant.matches.length === 0) {
|
|
404
|
+
for (const name of inputNames) {
|
|
405
|
+
const info = ensureInfo(name);
|
|
406
|
+
info.hasCatchAll = true;
|
|
407
|
+
}
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
for (const match of variant.matches ?? []) {
|
|
411
|
+
if (!inputNames.has(match.key))
|
|
412
|
+
continue;
|
|
413
|
+
const info = ensureInfo(match.key);
|
|
414
|
+
if (match.type === "catchall-match") {
|
|
415
|
+
info.hasCatchAll = true;
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
if (match.type === "literal-match") {
|
|
419
|
+
info.literals.add(match.value);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return matchTypes;
|
|
425
|
+
}
|
|
426
|
+
function bundleHasMarkup(bundle) {
|
|
427
|
+
return bundle.messages.some((message) => message.variants.some((variant) => variant.pattern.some((part) => part.type === "markup-start" ||
|
|
428
|
+
part.type === "markup-end" ||
|
|
429
|
+
part.type === "markup-standalone")));
|
|
430
|
+
}
|
|
431
|
+
//# sourceMappingURL=compile-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-bundle.js","sourceRoot":"","sources":["../../src/compiler/compile-bundle.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACN,gBAAgB,EAChB,wBAAwB,GAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAC;AAe7E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAO7B,EAA8B,EAAE;IAChC,MAAM,gBAAgB,GAAsC,EAAE,CAAC;IAC/D,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpD,MAAM,kBAAkB,GAAG,0BAA0B,CAAC,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,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,MAAoB;IAC5C,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACjC,OAAO,CAAC,OAAO,CAAC,IAAI,CACnB,CAAC,IAAI,EAAE,EAAE,CACR,IAAI,CAAC,IAAI,KAAK,cAAc;QAC5B,IAAI,CAAC,IAAI,KAAK,YAAY;QAC1B,IAAI,CAAC,IAAI,KAAK,mBAAmB,CAClC,CACD,CACD,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tBundle,\n\tBundleNested,\n\tMarkupStandalone,\n\tMarkupStart,\n\tMessage,\n\tParaglideSettings,\n} from \"../messages/ast.js\";\nimport { compileMessage } from \"./compile-message.js\";\nimport type { Compiled } from \"./types.js\";\nimport {\n\tinputTypeForName,\n\tjsDocBundleFunctionTypes,\n\ttype InputMatchTypes,\n} from \"./jsdoc-types.js\";\nimport { isValidIdentifier, quotePropertyKey } from \"./variable-access.js\";\nimport { toSafeModuleId } from \"./safe-module-id.js\";\nimport { escapeForDoubleQuoteString } from \"../services/codegen/escape.js\";\nimport type { CompilerOptions } from \"./compiler-options.js\";\nimport { perLocaleBuildStaticLocaleExpression } from \"./per-locale-build.js\";\n\nexport type CompiledBundleWithMessages = {\n\t/** The compilation result for the bundle index */\n\tbundle: Compiled<Bundle>;\n\t/** The compilation results for the languages */\n\tmessages: {\n\t\t[locale: string]: Compiled<Message>;\n\t};\n\t/** Match literal types inferred from bundle variants */\n\tmatchTypes: InputMatchTypes;\n\t/** Shared typedef name for bundle input types used across emitted JSDoc */\n\tinputTypeAliasName?: string;\n};\n\n/**\n * Compiles all the messages in the bundle and returns an index-function + each compiled message\n */\nexport const compileBundle = (args: {\n\tbundle: BundleNested;\n\tfallbackMap: Record<string, string | undefined>;\n\tmessageReferenceExpression: (locale: string, bundleId: string) => string;\n\tsettings?: ParaglideSettings;\n\texperimentalMiddlewareLocaleSplitting?: boolean;\n\texperimentalStaticLocale?: CompilerOptions[\"experimentalStaticLocale\"];\n}): CompiledBundleWithMessages => {\n\tconst compiledMessages: Record<string, Compiled<Message>> = {};\n\tconst safeBundleId = toSafeModuleId(args.bundle.id);\n\tconst inputTypeAliasName = toBundleInputTypeAliasName(safeBundleId);\n\tconst matchTypes = collectInputMatchTypes(args.bundle);\n\tconst hasMarkup = bundleHasMarkup(args.bundle);\n\n\tfor (const message of args.bundle.messages) {\n\t\tif (compiledMessages[message.locale]) {\n\t\t\tthrow new Error(`Duplicate locale: ${message.locale}`);\n\t\t}\n\n\t\tconst compiledMessage = compileMessage(\n\t\t\targs.bundle.declarations,\n\t\t\tmessage,\n\t\t\tmessage.variants,\n\t\t\tmatchTypes,\n\t\t\tinputTypeAliasName\n\t\t);\n\n\t\t// set the pattern for the language tag\n\t\tcompiledMessages[message.locale] = compiledMessage;\n\t}\n\n\treturn {\n\t\tbundle: compileBundleFunction({\n\t\t\tbundle: args.bundle,\n\t\t\tavailableLocales: Object.keys(args.fallbackMap),\n\t\t\tmessageReferenceExpression: args.messageReferenceExpression,\n\t\t\tsettings: args.settings,\n\t\t\tmatchTypes,\n\t\t\thasMarkup,\n\t\t\texperimentalMiddlewareLocaleSplitting:\n\t\t\t\targs.experimentalMiddlewareLocaleSplitting ?? false,\n\t\t\texperimentalStaticLocale: args.experimentalStaticLocale,\n\t\t\tinputTypeAliasName,\n\t\t}),\n\t\tmessages: compiledMessages,\n\t\tmatchTypes,\n\t\tinputTypeAliasName,\n\t};\n};\n\nconst compileBundleFunction = (args: {\n\t/**\n\t * The bundle to compile\n\t */\n\tbundle: BundleNested;\n\t/**\n\t * The language tags which are available\n\t */\n\tavailableLocales: string[];\n\t/**\n\t * The message reference expression\n\t */\n\tmessageReferenceExpression: (locale: string, bundleId: string) => string;\n\t/**\n\t * The project settings\n\t */\n\tsettings?: ParaglideSettings;\n\t/**\n\t * Match literal types inferred from bundle variants\n\t */\n\tmatchTypes: InputMatchTypes;\n\t/**\n\t * Whether at least one variant in this bundle contains markup.\n\t */\n\thasMarkup: boolean;\n\t/**\n\t * Whether middleware locale splitting runtime hooks should be emitted.\n\t */\n\texperimentalMiddlewareLocaleSplitting: boolean;\n\t/**\n\t * Static locale expression emitted inside the message function so a\n\t * bundler can tree-shake unselected locale modules.\n\t */\n\texperimentalStaticLocale?: CompilerOptions[\"experimentalStaticLocale\"];\n\t/**\n\t * Shared typedef name for bundle input types used across emitted JSDoc.\n\t */\n\tinputTypeAliasName: string;\n}): Compiled<Bundle> => {\n\tconst inputs = args.bundle.declarations.filter(\n\t\t(decl) => decl.type === \"input-variable\"\n\t);\n\tconst hasInputs = inputs.length > 0;\n\tconst safeBundleId = toSafeModuleId(args.bundle.id);\n\n\tconst isSafeBundleId = safeBundleId === args.bundle.id;\n\n\tconst isFullyTranslated =\n\t\targs.availableLocales.length === args.settings?.locales.length;\n\tconst baseLocale = args.settings?.baseLocale;\n\tconst dispatchLocales =\n\t\tbaseLocale && args.availableLocales.includes(baseLocale)\n\t\t\t? [\n\t\t\t\t\t...args.availableLocales.filter((locale) => locale !== baseLocale),\n\t\t\t\t\tbaseLocale,\n\t\t\t\t]\n\t\t\t: args.availableLocales;\n\n\tconst inputType = args.inputTypeAliasName;\n\tconst localesUnion =\n\t\targs.availableLocales.length === 0\n\t\t\t? \"never\"\n\t\t\t: args.availableLocales.map((locale) => `\"${locale}\"`).join(\" | \");\n\tconst optionsType = `{ locale?: ${localesUnion} }`;\n\tconst inputsParameterType = `${hasInputs ? \"inputs\" : \"inputs?\"}: ${inputType}`;\n\tconst bundleFunctionType = `(${inputsParameterType}, options?: ${optionsType}) => LocalizedString`;\n\tconst partsFunctionType = `(${inputsParameterType}, options?: ${optionsType}) => import('../runtime.js').MessagePart[]`;\n\tconst markupSchemaType = buildMarkupSchemaType(args.bundle, args.matchTypes);\n\tconst messageMetadataType = `import('../runtime.js').MessageMetadata<${inputType}, ${optionsType}, ${markupSchemaType}>`;\n\n\tconst compileLocaleReturnStatements = (\n\t\tmode: \"string\" | \"parts\",\n\t\tcontinuationIndent: string\n\t): string =>\n\t\tdispatchLocales\n\t\t\t.map((locale, index) => {\n\t\t\t\tconst condition =\n\t\t\t\t\t!isFullyTranslated || index < dispatchLocales.length - 1\n\t\t\t\t\t\t? `if (locale === \"${locale}\") `\n\t\t\t\t\t\t: \"\";\n\t\t\t\tconst prefix = index > 0 ? continuationIndent : \"\";\n\t\t\t\tconst messageRef = args.messageReferenceExpression(\n\t\t\t\t\tlocale,\n\t\t\t\t\targs.bundle.id\n\t\t\t\t);\n\n\t\t\t\tif (mode === \"string\") {\n\t\t\t\t\treturn `${prefix}${condition}return ${messageRef}(inputs)`;\n\t\t\t\t}\n\n\t\t\t\treturn `${prefix}${condition}return typeof ${messageRef}.parts === \"function\" ? ${messageRef}.parts(inputs) : [{ type: \"text\", value: ${messageRef}(inputs) }]`;\n\t\t\t})\n\t\t\t.join(\"\\n\");\n\n\tconst perLocaleBuild =\n\t\targs.experimentalStaticLocale === perLocaleBuildStaticLocaleExpression;\n\t// A locale-specialized graph may ship source maps. Keeping the English\n\t// pattern preview in the shared dispatcher would leak base-locale message\n\t// text into every locale's map even after the English module is tree-shaken.\n\tconst englishMatchTableDoc = perLocaleBuild\n\t\t? \"\"\n\t\t: buildEnglishMatchTableDoc(args.bundle);\n\n\tconst commonJsDoc = `/**\n${englishMatchTableDoc}${jsDocBundleFunctionTypes({\n\t\tinputs,\n\t\tlocales: args.availableLocales,\n\t\tmatchTypes: args.matchTypes,\n\t\tinputTypeOverride: args.inputTypeAliasName,\n\t})}\n*/`;\n\n\tconst clientMiddlewareGuard = (indent: string): string => {\n\t\tif (!args.experimentalMiddlewareLocaleSplitting) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn `\\n${indent}if (experimentalMiddlewareLocaleSplitting && isServer === false) {\\n${indent}\\treturn /** @type {any} */ (globalThis).__paraglide.ssr.${safeBundleId}(inputs)\\n${indent}}`;\n\t};\n\n\tconst clientPartsMiddlewareGuard = (indent: string): string => {\n\t\tif (!args.experimentalMiddlewareLocaleSplitting) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn `\\n${indent}if (experimentalMiddlewareLocaleSplitting && isServer === false) {\\n${indent}\\tconst serverMessage = /** @type {any} */ (globalThis).__paraglide.ssr.${safeBundleId}\\n${indent}\\tif (typeof serverMessage.parts === \"function\") {\\n${indent}\\t\\treturn /** @type {import('../runtime.js').MessagePart[]} */ (serverMessage.parts(inputs))\\n${indent}\\t}\\n${indent}\\treturn /** @type {import('../runtime.js').MessagePart[]} */ ([{ type: \"text\", value: serverMessage(inputs) }])\\n${indent}}`;\n\t};\n\n\tconst maybeTrackMessageCall = (indent: string): string => {\n\t\tif (!args.experimentalMiddlewareLocaleSplitting) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn `\\n${indent}trackMessageCall(\"${safeBundleId}\", locale)`;\n\t};\n\n\tconst localeResolutionStatement = (indent: string): string => {\n\t\tconst localeExpression = perLocaleBuild\n\t\t\t? `${perLocaleBuildStaticLocaleExpression} ?? options.locale ?? getLocale()`\n\t\t\t: \"experimentalStaticLocale ?? options.locale ?? getLocale()\";\n\t\tconst overrideWarning = perLocaleBuild\n\t\t\t? `\\n${indent}if (${perLocaleBuildStaticLocaleExpression} !== undefined && options.locale !== undefined && options.locale !== ${perLocaleBuildStaticLocaleExpression}) console.warn(\"Paraglide: options.locale cannot override a locale-specialized client bundle; use a full document navigation to switch locales.\")`\n\t\t\t: \"\";\n\n\t\tif (\n\t\t\tisFullyTranslated &&\n\t\t\targs.availableLocales.length === 1 &&\n\t\t\t!args.experimentalMiddlewareLocaleSplitting\n\t\t) {\n\t\t\treturn `${indent}${localeExpression}${overrideWarning}`;\n\t\t}\n\n\t\treturn `${indent}const locale = ${localeExpression}${overrideWarning}${maybeTrackMessageCall(\n\t\t\tindent\n\t\t)}`;\n\t};\n\n\tlet code = \"\";\n\n\tif (!args.hasMarkup) {\n\t\tcode = `${commonJsDoc}\n${isSafeBundleId ? \"export \" : \"\"}const ${safeBundleId} = /** @type {(${bundleFunctionType}) & ${messageMetadataType}} */ ((inputs${hasInputs ? \"\" : \" = {}\"}, options = {}) => {${clientMiddlewareGuard(\n\t\t\t\"\\t\"\n\t\t)}\n${localeResolutionStatement(\"\\t\")}\n\t${compileLocaleReturnStatements(\"string\", \"\\t\")}${\n\t\t!isFullyTranslated\n\t\t\t? `\\n\treturn /** @type {LocalizedString} */ (\"${args.bundle.id}\")`\n\t\t\t: \"\"\n\t}\n});`;\n\t} else {\n\t\tcode = `${commonJsDoc}\n${isSafeBundleId ? \"export \" : \"\"}const ${safeBundleId} = /** @type {(${bundleFunctionType}) & { parts: ${partsFunctionType} } & ${messageMetadataType}} */ (\n\t/* @__PURE__ */ Object.assign(\n\t\t/** @type {${bundleFunctionType}} */ ((inputs${hasInputs ? \"\" : \" = {}\"}, options = {}) => {${clientMiddlewareGuard(\n\t\t\t\"\\t\\t\\t\"\n\t\t)}\n${localeResolutionStatement(\"\\t\\t\\t\")}\n\t\t\t${compileLocaleReturnStatements(\"string\", \"\\t\\t\\t\")}${\n\t\t\t\t!isFullyTranslated\n\t\t\t\t\t? `\\n\t\t\treturn /** @type {LocalizedString} */ (${JSON.stringify(args.bundle.id)})`\n\t\t\t\t\t: \"\"\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tparts: /** @type {${partsFunctionType}} */ ((inputs${\n\t\t\t\thasInputs ? \"\" : \" = {}\"\n\t\t\t}, options = {}) => {${clientPartsMiddlewareGuard(\"\\t\\t\\t\\t\")}\n${localeResolutionStatement(\"\\t\\t\\t\\t\")}\n\t\t\t\t${compileLocaleReturnStatements(\"parts\", \"\\t\\t\\t\\t\")}${\n\t\t\t\t\t!isFullyTranslated\n\t\t\t\t\t\t? `\\n\t\t\t\treturn /** @type {import('../runtime.js').MessagePart[]} */ ([{ type: \"text\", value: ${JSON.stringify(args.bundle.id)} }])`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t)\n);`;\n\t}\n\n\tif (isSafeBundleId === false) {\n\t\tcode += `\\nexport { ${safeBundleId} as \"${escapeForDoubleQuoteString(args.bundle.id)}\" }`;\n\t}\n\n\treturn {\n\t\tcode,\n\t\tnode: args.bundle,\n\t};\n};\n\nfunction buildEnglishMatchTableDoc(bundle: BundleNested): string {\n\tconst message = selectEnglishMessage(bundle);\n\tif (!message) {\n\t\treturn \"\";\n\t}\n\n\tconst selectorKeys = collectSelectorKeys(message);\n\tconst headerCells = [...selectorKeys, \"output\"];\n\tconst lines = [\n\t\t`* | ${headerCells.map(escapeTableCell).join(\" | \")} |`,\n\t\t`* | ${headerCells.map(() => \"---\").join(\" | \")} |`,\n\t];\n\n\tfor (const variant of message.variants) {\n\t\tconst rowValues = selectorKeys.map((key) =>\n\t\t\tgetMatchCellValue(variant, key)\n\t\t);\n\t\tconst serializedOutput = serializePatternPreview(variant.pattern);\n\t\tconst outputValue = JSON.stringify(\n\t\t\tserializedOutput.length > 160\n\t\t\t\t? `${serializedOutput.slice(0, 157)}...`\n\t\t\t\t: serializedOutput\n\t\t);\n\t\tlines.push(\n\t\t\t`* | ${[...rowValues, outputValue].map(escapeTableCell).join(\" | \")} |`\n\t\t);\n\t}\n\n\tlines.push(\"*\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction selectEnglishMessage(\n\tbundle: BundleNested\n): BundleNested[\"messages\"][number] | undefined {\n\treturn (\n\t\tbundle.messages.find((message) => message.locale === \"en\") ??\n\t\tbundle.messages.find((message) => message.locale.startsWith(\"en-\"))\n\t);\n}\n\nfunction collectSelectorKeys(\n\tmessage: BundleNested[\"messages\"][number]\n): string[] {\n\tconst keys: string[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const variant of message.variants) {\n\t\tfor (const match of variant.matches ?? []) {\n\t\t\tif (seen.has(match.key)) continue;\n\t\t\tseen.add(match.key);\n\t\t\tkeys.push(match.key);\n\t\t}\n\t}\n\n\treturn keys;\n}\n\nfunction getMatchCellValue(\n\tvariant: BundleNested[\"messages\"][number][\"variants\"][number],\n\tkey: string\n): string {\n\tconst match = (variant.matches ?? []).find((entry) => entry.key === key);\n\tif (!match || match.type === \"catchall-match\") {\n\t\treturn \"*\";\n\t}\n\n\treturn JSON.stringify(match.value);\n}\n\nfunction escapeTableCell(value: string): string {\n\treturn value\n\t\t.replace(/\\|/g, \"\\\\|\")\n\t\t.replace(/\\r?\\n/g, \" \")\n\t\t.replaceAll(\"*/\", \"*\\\\/\");\n}\n\nexport function toBundleInputTypeAliasName(safeBundleId: string): string {\n\treturn `${toBundleTypeBaseName(safeBundleId)}Inputs`;\n}\n\nfunction toBundleTypeBaseName(safeBundleId: string): string {\n\tlet baseName = \"\";\n\tlet capitalizeNext = true;\n\n\tfor (const character of safeBundleId) {\n\t\tif (character === \"_\") {\n\t\t\tbaseName += \"_\";\n\t\t\tcapitalizeNext = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character >= \"a\" && character <= \"z\") {\n\t\t\tbaseName += capitalizeNext ? character.toUpperCase() : character;\n\t\t} else {\n\t\t\tbaseName += character;\n\t\t}\n\t\tcapitalizeNext = false;\n\t}\n\n\tif (!baseName) {\n\t\tbaseName = \"Message\";\n\t}\n\n\tif (!/^[A-Za-z_]/.test(baseName)) {\n\t\tbaseName = `Message${baseName}`;\n\t}\n\n\treturn baseName;\n}\n\nfunction serializePatternPreview(\n\tpattern: BundleNested[\"messages\"][number][\"variants\"][number][\"pattern\"]\n): string {\n\tlet result = \"\";\n\n\tfor (const part of pattern) {\n\t\tif (part.type === \"text\") {\n\t\t\tresult += part.value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (part.type === \"expression\") {\n\t\t\tif (part.arg.type === \"literal\") {\n\t\t\t\tresult += part.arg.value;\n\t\t\t} else {\n\t\t\t\tresult += `{${part.arg.name}}`;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result.replace(/\\s+/g, \" \").trim();\n}\n\ntype MarkupValueAccumulator = {\n\tcount: number;\n\ttypes: Set<string>;\n};\n\ntype MarkupTagAccumulator = {\n\toccurrences: number;\n\tchildrenTrue: boolean;\n\tchildrenFalse: boolean;\n\toptions: Map<string, MarkupValueAccumulator>;\n\tattributes: Map<string, MarkupValueAccumulator>;\n};\n\nfunction buildMarkupSchemaType(\n\tbundle: BundleNested,\n\tmatchTypes: InputMatchTypes\n): string {\n\tconst tagAccumulators = new Map<string, MarkupTagAccumulator>();\n\tconst inputVariableNames = new Set(\n\t\tbundle.declarations\n\t\t\t.filter((declaration) => declaration.type === \"input-variable\")\n\t\t\t.map((declaration) => declaration.name)\n\t);\n\n\tfor (const message of bundle.messages) {\n\t\tfor (const variant of message.variants) {\n\t\t\tfor (const part of variant.pattern) {\n\t\t\t\tif (part.type !== \"markup-start\" && part.type !== \"markup-standalone\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst tag = ensureMarkupTagAccumulator(tagAccumulators, part.name);\n\t\t\t\ttag.occurrences += 1;\n\t\t\t\tif (part.type === \"markup-start\") {\n\t\t\t\t\ttag.childrenTrue = true;\n\t\t\t\t} else {\n\t\t\t\t\ttag.childrenFalse = true;\n\t\t\t\t}\n\n\t\t\t\tcollectMarkupOptions(tag, part, inputVariableNames, matchTypes);\n\t\t\t\tcollectMarkupAttributes(tag, part);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tagAccumulators.size === 0) {\n\t\treturn \"{}\";\n\t}\n\n\tconst tagEntries = Array.from(tagAccumulators.entries())\n\t\t.sort(([leftName], [rightName]) => leftName.localeCompare(rightName))\n\t\t.map(\n\t\t\t([tagName, tag]) =>\n\t\t\t\t`${renderTypeObjectKey(tagName)}: ${renderMarkupTagType(tag)}`\n\t\t);\n\n\treturn `{ ${tagEntries.join(\"; \")} }`;\n}\n\nfunction ensureMarkupTagAccumulator(\n\taccumulators: Map<string, MarkupTagAccumulator>,\n\ttagName: string\n): MarkupTagAccumulator {\n\tconst existing = accumulators.get(tagName);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\tconst created: MarkupTagAccumulator = {\n\t\toccurrences: 0,\n\t\tchildrenTrue: false,\n\t\tchildrenFalse: false,\n\t\toptions: new Map(),\n\t\tattributes: new Map(),\n\t};\n\taccumulators.set(tagName, created);\n\treturn created;\n}\n\nfunction collectMarkupOptions(\n\ttag: MarkupTagAccumulator,\n\tpart: MarkupStart | MarkupStandalone,\n\tinputVariableNames: Set<string>,\n\tmatchTypes: InputMatchTypes\n): void {\n\tconst seenOptions = new Set<string>();\n\n\tfor (const option of part.options ?? []) {\n\t\tconst optionAccumulator = ensureMarkupValueAccumulator(\n\t\t\ttag.options,\n\t\t\toption.name\n\t\t);\n\t\toptionAccumulator.types.add(\n\t\t\tresolveMarkupOptionType(option.value, inputVariableNames, matchTypes)\n\t\t);\n\t\tif (!seenOptions.has(option.name)) {\n\t\t\toptionAccumulator.count += 1;\n\t\t\tseenOptions.add(option.name);\n\t\t}\n\t}\n}\n\nfunction collectMarkupAttributes(\n\ttag: MarkupTagAccumulator,\n\tpart: MarkupStart | MarkupStandalone\n): void {\n\tconst seenAttributes = new Set<string>();\n\n\tfor (const attribute of part.attributes ?? []) {\n\t\tconst attributeAccumulator = ensureMarkupValueAccumulator(\n\t\t\ttag.attributes,\n\t\t\tattribute.name\n\t\t);\n\t\tattributeAccumulator.types.add(\n\t\t\tattribute.value === true ? \"true\" : \"string\"\n\t\t);\n\t\tif (!seenAttributes.has(attribute.name)) {\n\t\t\tattributeAccumulator.count += 1;\n\t\t\tseenAttributes.add(attribute.name);\n\t\t}\n\t}\n}\n\nfunction resolveMarkupOptionType(\n\tvalue:\n\t\t| {\n\t\t\t\ttype: \"literal\";\n\t\t\t\tvalue: string;\n\t\t }\n\t\t| {\n\t\t\t\ttype: \"variable-reference\";\n\t\t\t\tname: string;\n\t\t },\n\tinputVariableNames: Set<string>,\n\tmatchTypes: InputMatchTypes\n): string {\n\tif (value.type === \"literal\") {\n\t\treturn \"string\";\n\t}\n\n\tif (inputVariableNames.has(value.name)) {\n\t\treturn inputTypeForName(value.name, matchTypes);\n\t}\n\n\treturn \"NonNullable<unknown>\";\n}\n\nfunction ensureMarkupValueAccumulator(\n\tvalues: Map<string, MarkupValueAccumulator>,\n\tname: string\n): MarkupValueAccumulator {\n\tconst existing = values.get(name);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\n\tconst created: MarkupValueAccumulator = { count: 0, types: new Set() };\n\tvalues.set(name, created);\n\treturn created;\n}\n\nfunction renderMarkupTagType(tag: MarkupTagAccumulator): string {\n\treturn `{ options: ${renderMarkupObjectType(tag.options, tag.occurrences)}; attributes: ${renderMarkupObjectType(tag.attributes, tag.occurrences)}; children: ${renderChildrenType(tag)} }`;\n}\n\nfunction renderMarkupObjectType(\n\tvalues: Map<string, MarkupValueAccumulator>,\n\toccurrenceCount: number\n): string {\n\tif (values.size === 0) {\n\t\treturn \"{}\";\n\t}\n\n\tconst properties = Array.from(values.entries())\n\t\t.sort(([leftName], [rightName]) => leftName.localeCompare(rightName))\n\t\t.map(([name, value]) => {\n\t\t\tconst isOptional = value.count < occurrenceCount;\n\t\t\treturn `${renderTypeObjectKey(name)}${isOptional ? \"?\" : \"\"}: ${renderTypeUnion(value.types)}`;\n\t\t});\n\n\treturn `{ ${properties.join(\"; \")} }`;\n}\n\nfunction renderChildrenType(tag: MarkupTagAccumulator): string {\n\tif (tag.childrenTrue && tag.childrenFalse) {\n\t\treturn \"boolean\";\n\t}\n\tif (tag.childrenTrue) {\n\t\treturn \"true\";\n\t}\n\tif (tag.childrenFalse) {\n\t\treturn \"false\";\n\t}\n\treturn \"boolean\";\n}\n\nfunction renderTypeUnion(types: Set<string>): string {\n\tconst sorted = Array.from(types).sort();\n\tif (sorted.length === 0) {\n\t\treturn \"never\";\n\t}\n\tif (sorted.length === 1) {\n\t\treturn sorted[0] ?? \"never\";\n\t}\n\treturn sorted.join(\" | \");\n}\n\nfunction renderTypeObjectKey(name: string): string {\n\treturn isValidIdentifier(name) ? name : quotePropertyKey(name);\n}\n\nfunction collectInputMatchTypes(bundle: BundleNested): InputMatchTypes {\n\tconst inputNames = new Set(\n\t\tbundle.declarations\n\t\t\t?.filter((decl) => decl.type === \"input-variable\")\n\t\t\t.map((decl) => decl.name) ?? []\n\t);\n\tconst matchTypes: InputMatchTypes = new Map();\n\n\tconst ensureInfo = (name: string) => {\n\t\tconst existing = matchTypes.get(name);\n\t\tif (existing) return existing;\n\t\tconst created = { literals: new Set<string>(), hasCatchAll: false };\n\t\tmatchTypes.set(name, created);\n\t\treturn created;\n\t};\n\n\tfor (const message of bundle.messages) {\n\t\tfor (const variant of message.variants) {\n\t\t\tif (!variant.matches || variant.matches.length === 0) {\n\t\t\t\tfor (const name of inputNames) {\n\t\t\t\t\tconst info = ensureInfo(name);\n\t\t\t\t\tinfo.hasCatchAll = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const match of variant.matches ?? []) {\n\t\t\t\tif (!inputNames.has(match.key)) continue;\n\t\t\t\tconst info = ensureInfo(match.key);\n\t\t\t\tif (match.type === \"catchall-match\") {\n\t\t\t\t\tinfo.hasCatchAll = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (match.type === \"literal-match\") {\n\t\t\t\t\tinfo.literals.add(match.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn matchTypes;\n}\n\nfunction bundleHasMarkup(bundle: BundleNested): boolean {\n\treturn bundle.messages.some((message) =>\n\t\tmessage.variants.some((variant) =>\n\t\t\tvariant.pattern.some(\n\t\t\t\t(part) =>\n\t\t\t\t\tpart.type === \"markup-start\" ||\n\t\t\t\t\tpart.type === \"markup-end\" ||\n\t\t\t\t\tpart.type === \"markup-standalone\"\n\t\t\t)\n\t\t)\n\t);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-bundle.test.d.ts","sourceRoot":"","sources":["../../src/compiler/compile-bundle.test.ts"],"names":[],"mappings":""}
|