@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,87 @@
|
|
|
1
|
+
import memfs from "memfs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { expect, test } from "vitest";
|
|
4
|
+
import { createTrackedFs, getWatchTargets, isPathWithinDirectories, } from "./tracked-fs.js";
|
|
5
|
+
import { nodeNormalizePath } from "../../utilities/node-normalize-path.js";
|
|
6
|
+
test("tracks readFile and promises.readFile calls", async () => {
|
|
7
|
+
const baseDir = "/";
|
|
8
|
+
const memFs = memfs.createFsFromVolume(memfs.Volume.fromJSON({
|
|
9
|
+
"/messages.json": "test",
|
|
10
|
+
}));
|
|
11
|
+
const tracked = createTrackedFs({ baseDir, fs: memFs });
|
|
12
|
+
await new Promise((resolvePromise, rejectPromise) => {
|
|
13
|
+
tracked.fs.readFile("/messages.json", null, (error, data) => {
|
|
14
|
+
if (error) {
|
|
15
|
+
rejectPromise(error);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
expect(data.toString()).toBe("test");
|
|
19
|
+
resolvePromise();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
await tracked.fs.promises.readFile("/messages.json");
|
|
23
|
+
const normalizedPath = nodeNormalizePath(path.resolve(baseDir, "messages.json"));
|
|
24
|
+
expect(tracked.readFiles.has(normalizedPath)).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
test("tracks readFileSync and clears tracked files", async () => {
|
|
27
|
+
const baseDir = "/";
|
|
28
|
+
const memFs = memfs.createFsFromVolume(memfs.Volume.fromJSON({
|
|
29
|
+
"/sync.json": "sync",
|
|
30
|
+
}));
|
|
31
|
+
const tracked = createTrackedFs({ baseDir, fs: memFs });
|
|
32
|
+
const contents = tracked.fs.readFileSync("/sync.json");
|
|
33
|
+
expect(contents.toString()).toBe("sync");
|
|
34
|
+
expect(tracked.readFiles.size).toBe(1);
|
|
35
|
+
tracked.clearReadFiles();
|
|
36
|
+
expect(tracked.readFiles.size).toBe(0);
|
|
37
|
+
});
|
|
38
|
+
test("getWatchTargets filters cache files and collects directories", () => {
|
|
39
|
+
const files = new Set([
|
|
40
|
+
"/project/messages/en.json",
|
|
41
|
+
"/project/cache/tmp.json",
|
|
42
|
+
]);
|
|
43
|
+
const targets = getWatchTargets(files);
|
|
44
|
+
expect(targets.files).toEqual(new Set([nodeNormalizePath("/project/messages/en.json")]));
|
|
45
|
+
expect(targets.directories).toEqual(new Set([nodeNormalizePath("/project/messages")]));
|
|
46
|
+
});
|
|
47
|
+
test("getWatchTargets ignores outdir and descendants", () => {
|
|
48
|
+
const files = new Set([
|
|
49
|
+
"/project/src/paraglide/index.js",
|
|
50
|
+
"/project/messages/en.json",
|
|
51
|
+
]);
|
|
52
|
+
const targets = getWatchTargets(files, {
|
|
53
|
+
baseDir: "/project",
|
|
54
|
+
outdir: "src/paraglide",
|
|
55
|
+
});
|
|
56
|
+
expect(targets.files.has(nodeNormalizePath("/project/src/paraglide/index.js"))).toBe(false);
|
|
57
|
+
expect(targets.files.has(nodeNormalizePath("/project/messages/en.json"))).toBe(true);
|
|
58
|
+
expect(targets.isIgnoredPath("/project/src/paraglide/new.js")).toBe(true);
|
|
59
|
+
expect(targets.directories).toEqual(new Set([nodeNormalizePath("/project/messages")]));
|
|
60
|
+
});
|
|
61
|
+
test("getWatchTargets can keep cache files when ignoreCache is false", () => {
|
|
62
|
+
const files = new Set(["/project/cache/keep.json"]);
|
|
63
|
+
const targets = getWatchTargets(files, { ignoreCache: false });
|
|
64
|
+
expect(targets.files.has(nodeNormalizePath("/project/cache/keep.json"))).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
test("getWatchTargets respects ignorePath predicate", () => {
|
|
67
|
+
const files = new Set([
|
|
68
|
+
"/project/messages/en.json",
|
|
69
|
+
"/project/extra.txt",
|
|
70
|
+
]);
|
|
71
|
+
const targets = getWatchTargets(files, {
|
|
72
|
+
ignorePath: (path) => path.endsWith("extra.txt"),
|
|
73
|
+
});
|
|
74
|
+
expect(targets.files.has(nodeNormalizePath("/project/extra.txt"))).toBe(false);
|
|
75
|
+
expect(targets.directories).toEqual(new Set([nodeNormalizePath("/project/messages")]));
|
|
76
|
+
});
|
|
77
|
+
test("getWatchTargets can omit directories", () => {
|
|
78
|
+
const files = new Set(["/project/messages/en.json"]);
|
|
79
|
+
const targets = getWatchTargets(files, { includeDirectories: false });
|
|
80
|
+
expect(targets.directories.size).toBe(0);
|
|
81
|
+
});
|
|
82
|
+
test("isPathWithinDirectories matches nested paths", () => {
|
|
83
|
+
const directories = new Set(["/project/messages", "/project/other"]);
|
|
84
|
+
expect(isPathWithinDirectories("/project/messages/nested/file.json", directories)).toBe(true);
|
|
85
|
+
expect(isPathWithinDirectories("/project/unknown/file.json", directories)).toBe(false);
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=tracked-fs.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracked-fs.test.js","sourceRoot":"","sources":["../../../src/services/file-watching/tracked-fs.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACN,eAAe,EACf,eAAe,EACf,uBAAuB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,IAAI,CAAC,6CAA6C,EAAE,K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AG,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CACtE,KAAK,CACL,CAAC;IACF,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAClC,IAAI,GAAG,CAAC,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACjD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACjD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;IAEtE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8CAA8C,EAAE,GAAG,EAAE;IACzD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE7E,MAAM,CACL,uBAAuB,CAAC,oCAAoC,EAAE,WAAW,CAAC,CAC1E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CACL,uBAAuB,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAClE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACf,CAAC,CAAC,CAAC","sourcesContent":["import memfs from \"memfs\";\nimport path from \"node:path\";\nimport type fs from \"node:fs\";\nimport { expect, test } from \"vitest\";\nimport {\n\tcreateTrackedFs,\n\tgetWatchTargets,\n\tisPathWithinDirectories,\n} from \"./tracked-fs.js\";\nimport { nodeNormalizePath } from \"../../utilities/node-normalize-path.js\";\n\ntest(\"tracks readFile and promises.readFile calls\", async () => {\n\tconst baseDir = \"/\";\n\tconst memFs = memfs.createFsFromVolume(\n\t\tmemfs.Volume.fromJSON({\n\t\t\t\"/messages.json\": \"test\",\n\t\t})\n\t) as unknown as typeof fs;\n\tconst tracked = createTrackedFs({ baseDir, fs: memFs });\n\n\tawait new Promise<void>((resolvePromise, rejectPromise) => {\n\t\ttracked.fs.readFile(\"/messages.json\", null, (error, data) => {\n\t\t\tif (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\texpect(data.toString()).toBe(\"test\");\n\t\t\tresolvePromise();\n\t\t});\n\t});\n\n\tawait tracked.fs.promises.readFile(\"/messages.json\");\n\n\tconst normalizedPath = nodeNormalizePath(\n\t\tpath.resolve(baseDir, \"messages.json\")\n\t);\n\texpect(tracked.readFiles.has(normalizedPath)).toBe(true);\n});\n\ntest(\"tracks readFileSync and clears tracked files\", async () => {\n\tconst baseDir = \"/\";\n\tconst memFs = memfs.createFsFromVolume(\n\t\tmemfs.Volume.fromJSON({\n\t\t\t\"/sync.json\": \"sync\",\n\t\t})\n\t) as unknown as typeof fs;\n\tconst tracked = createTrackedFs({ baseDir, fs: memFs });\n\n\tconst contents = tracked.fs.readFileSync(\"/sync.json\");\n\texpect(contents.toString()).toBe(\"sync\");\n\n\texpect(tracked.readFiles.size).toBe(1);\n\ttracked.clearReadFiles();\n\texpect(tracked.readFiles.size).toBe(0);\n});\n\ntest(\"getWatchTargets filters cache files and collects directories\", () => {\n\tconst files = new Set<string>([\n\t\t\"/project/messages/en.json\",\n\t\t\"/project/cache/tmp.json\",\n\t]);\n\tconst targets = getWatchTargets(files);\n\n\texpect(targets.files).toEqual(\n\t\tnew Set([nodeNormalizePath(\"/project/messages/en.json\")])\n\t);\n\texpect(targets.directories).toEqual(\n\t\tnew Set([nodeNormalizePath(\"/project/messages\")])\n\t);\n});\n\ntest(\"getWatchTargets ignores outdir and descendants\", () => {\n\tconst files = new Set<string>([\n\t\t\"/project/src/paraglide/index.js\",\n\t\t\"/project/messages/en.json\",\n\t]);\n\tconst targets = getWatchTargets(files, {\n\t\tbaseDir: \"/project\",\n\t\toutdir: \"src/paraglide\",\n\t});\n\n\texpect(\n\t\ttargets.files.has(nodeNormalizePath(\"/project/src/paraglide/index.js\"))\n\t).toBe(false);\n\texpect(\n\t\ttargets.files.has(nodeNormalizePath(\"/project/messages/en.json\"))\n\t).toBe(true);\n\texpect(targets.isIgnoredPath(\"/project/src/paraglide/new.js\")).toBe(true);\n\texpect(targets.directories).toEqual(\n\t\tnew Set([nodeNormalizePath(\"/project/messages\")])\n\t);\n});\n\ntest(\"getWatchTargets can keep cache files when ignoreCache is false\", () => {\n\tconst files = new Set<string>([\"/project/cache/keep.json\"]);\n\tconst targets = getWatchTargets(files, { ignoreCache: false });\n\n\texpect(targets.files.has(nodeNormalizePath(\"/project/cache/keep.json\"))).toBe(\n\t\ttrue\n\t);\n});\n\ntest(\"getWatchTargets respects ignorePath predicate\", () => {\n\tconst files = new Set<string>([\n\t\t\"/project/messages/en.json\",\n\t\t\"/project/extra.txt\",\n\t]);\n\tconst targets = getWatchTargets(files, {\n\t\tignorePath: (path) => path.endsWith(\"extra.txt\"),\n\t});\n\n\texpect(targets.files.has(nodeNormalizePath(\"/project/extra.txt\"))).toBe(\n\t\tfalse\n\t);\n\texpect(targets.directories).toEqual(\n\t\tnew Set([nodeNormalizePath(\"/project/messages\")])\n\t);\n});\n\ntest(\"getWatchTargets can omit directories\", () => {\n\tconst files = new Set<string>([\"/project/messages/en.json\"]);\n\tconst targets = getWatchTargets(files, { includeDirectories: false });\n\n\texpect(targets.directories.size).toBe(0);\n});\n\ntest(\"isPathWithinDirectories matches nested paths\", () => {\n\tconst directories = new Set<string>([\"/project/messages\", \"/project/other\"]);\n\n\texpect(\n\t\tisPathWithinDirectories(\"/project/messages/nested/file.json\", directories)\n\t).toBe(true);\n\texpect(\n\t\tisPathWithinDirectories(\"/project/unknown/file.json\", directories)\n\t).toBe(false);\n});\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type LoggerOptions = {
|
|
2
|
+
silent: boolean;
|
|
3
|
+
/**
|
|
4
|
+
* If the [paraglide] prefix should be printed before each log message.
|
|
5
|
+
*/
|
|
6
|
+
prefix: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class Logger {
|
|
9
|
+
private options;
|
|
10
|
+
constructor(options?: LoggerOptions);
|
|
11
|
+
log(message: string): Logger;
|
|
12
|
+
info(message: string): Logger;
|
|
13
|
+
success(message: string): Logger;
|
|
14
|
+
warn(message: any, ...args: any[]): Logger;
|
|
15
|
+
error(message: any, ...args: any[]): Logger;
|
|
16
|
+
box(message: any, ...args: any[]): Logger;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/logger/index.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,qBAAa,MAAM;IAEjB,OAAO,CAAC,OAAO;IADhB,YACS,OAAO,GAAE,aAA+C,EAC7D;IAEG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKlC;IAEM,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOnC;IAEM,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOtC;IAEM,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAMhD;IAEM,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAMjD;IAEM,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAI/C;CACD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { colors } from "consola/utils";
|
|
2
|
+
import consola from "consola";
|
|
3
|
+
consola.options = {
|
|
4
|
+
...consola.options,
|
|
5
|
+
formatOptions: { date: false },
|
|
6
|
+
};
|
|
7
|
+
export class Logger {
|
|
8
|
+
options;
|
|
9
|
+
constructor(options = { silent: false, prefix: true }) {
|
|
10
|
+
this.options = options;
|
|
11
|
+
}
|
|
12
|
+
log(message) {
|
|
13
|
+
if (this.options.silent)
|
|
14
|
+
return this;
|
|
15
|
+
const prefix = this.options.prefix ? colors.bold("[paraglide-lite] ") : "";
|
|
16
|
+
consola.log(prefix + message);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
info(message) {
|
|
20
|
+
if (this.options.silent)
|
|
21
|
+
return this;
|
|
22
|
+
const prefix = this.options.prefix
|
|
23
|
+
? colors.bold(colors.blue("[paraglide-lite] "))
|
|
24
|
+
: "";
|
|
25
|
+
consola.info(prefix + message);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
success(message) {
|
|
29
|
+
if (this.options.silent)
|
|
30
|
+
return this;
|
|
31
|
+
const prefix = this.options.prefix
|
|
32
|
+
? colors.bold(colors.green("[paraglide-lite] "))
|
|
33
|
+
: "";
|
|
34
|
+
consola.success(prefix + message);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
warn(message, ...args) {
|
|
38
|
+
const prefix = this.options.prefix
|
|
39
|
+
? colors.bold(colors.yellow("[paraglide-lite] "))
|
|
40
|
+
: "";
|
|
41
|
+
consola.warn(prefix + message, ...args);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
error(message, ...args) {
|
|
45
|
+
const prefix = this.options.prefix
|
|
46
|
+
? colors.bold(colors.red("[paraglide-lite] "))
|
|
47
|
+
: "";
|
|
48
|
+
consola.error(prefix + message, ...args);
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
box(message, ...args) {
|
|
52
|
+
if (this.options.silent)
|
|
53
|
+
return this;
|
|
54
|
+
consola.box(message, ...args);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58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,OAAO,IAAI,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM;YACjC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QACN,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,IAAI,CAAC,OAAY,EAAE,GAAG,IAAW;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM;YACjC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;YACjD,CAAC,CAAC,EAAE,CAAC;QACN,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,OAAY,EAAE,GAAG,IAAW;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM;YACjC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YAC9C,CAAC,CAAC,EAAE,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,GAAG,CAAC,OAAY,EAAE,GAAG,IAAW;QACtC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["import { colors } from \"consola/utils\";\nimport consola from \"consola\";\n\nconsola.options = {\n\t...consola.options,\n\tformatOptions: { date: false },\n};\n\nexport type LoggerOptions = {\n\tsilent: boolean;\n\n\t/**\n\t * If the [paraglide] prefix should be printed before each log message.\n\t */\n\tprefix: boolean;\n};\n\nexport class Logger {\n\tconstructor(\n\t\tprivate options: LoggerOptions = { silent: false, prefix: true }\n\t) {}\n\n\tpublic log(message: string): Logger {\n\t\tif (this.options.silent) return this;\n\t\tconst prefix = this.options.prefix ? colors.bold(\"[paraglide-lite] \") : \"\";\n\t\tconsola.log(prefix + message);\n\t\treturn this;\n\t}\n\n\tpublic info(message: string): Logger {\n\t\tif (this.options.silent) return this;\n\t\tconst prefix = this.options.prefix\n\t\t\t? colors.bold(colors.blue(\"[paraglide-lite] \"))\n\t\t\t: \"\";\n\t\tconsola.info(prefix + message);\n\t\treturn this;\n\t}\n\n\tpublic success(message: string): Logger {\n\t\tif (this.options.silent) return this;\n\t\tconst prefix = this.options.prefix\n\t\t\t? colors.bold(colors.green(\"[paraglide-lite] \"))\n\t\t\t: \"\";\n\t\tconsola.success(prefix + message);\n\t\treturn this;\n\t}\n\n\tpublic warn(message: any, ...args: any[]): Logger {\n\t\tconst prefix = this.options.prefix\n\t\t\t? colors.bold(colors.yellow(\"[paraglide-lite] \"))\n\t\t\t: \"\";\n\t\tconsola.warn(prefix + message, ...args);\n\t\treturn this;\n\t}\n\n\tpublic error(message: any, ...args: any[]): Logger {\n\t\tconst prefix = this.options.prefix\n\t\t\t? colors.bold(colors.red(\"[paraglide-lite] \"))\n\t\t\t: \"\";\n\t\tconsola.error(prefix + message, ...args);\n\t\treturn this;\n\t}\n\n\tpublic box(message: any, ...args: any[]): Logger {\n\t\tif (this.options.silent) return this;\n\t\tconsola.box(message, ...args);\n\t\treturn this;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type LookupOptions = {
|
|
2
|
+
locales: string[];
|
|
3
|
+
baseLocale: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Performs a lookup for the given language tag, among the available language tags,
|
|
7
|
+
* according to the IETF BCP 47 spec.
|
|
8
|
+
*
|
|
9
|
+
* It **does not support Wildcards** at the moment.
|
|
10
|
+
*
|
|
11
|
+
* @see https://datatracker.ietf.org/doc/html/rfc4647#section-3.4
|
|
12
|
+
*/
|
|
13
|
+
export declare function lookup(locale: string, options: LookupOptions): string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/services/lookup.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAerE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a lookup for the given language tag, among the available language tags,
|
|
3
|
+
* according to the IETF BCP 47 spec.
|
|
4
|
+
*
|
|
5
|
+
* It **does not support Wildcards** at the moment.
|
|
6
|
+
*
|
|
7
|
+
* @see https://datatracker.ietf.org/doc/html/rfc4647#section-3.4
|
|
8
|
+
*/
|
|
9
|
+
export function lookup(locale, options) {
|
|
10
|
+
const fallbackLanguages = [];
|
|
11
|
+
const languageTagParts = locale.split("-").filter(Boolean);
|
|
12
|
+
for (let i = languageTagParts.length; i > 0; i--) {
|
|
13
|
+
//Skip the x separator
|
|
14
|
+
if (languageTagParts[i - 1] === "x")
|
|
15
|
+
continue;
|
|
16
|
+
//Stringify the language tag parts
|
|
17
|
+
const fallbackLanguageTag = languageTagParts.slice(0, i).join("-");
|
|
18
|
+
if (!options.locales.includes(fallbackLanguageTag))
|
|
19
|
+
continue;
|
|
20
|
+
fallbackLanguages.push(fallbackLanguageTag);
|
|
21
|
+
}
|
|
22
|
+
return fallbackLanguages[0] ?? options.baseLocale;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../src/services/lookup.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,OAAsB;IAC5D,MAAM,iBAAiB,GAAa,EAAE,CAAC;IAEvC,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3D,KAAK,IAAI,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAClD,sBAAsB;QACtB,IAAI,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG;YAAE,SAAS;QAE9C,kCAAkC;QAClC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAAE,SAAS;QAC7D,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC;AACnD,CAAC","sourcesContent":["type LookupOptions = {\n\tlocales: string[];\n\tbaseLocale: string;\n};\n\n/**\n * Performs a lookup for the given language tag, among the available language tags,\n * according to the IETF BCP 47 spec.\n *\n * It **does not support Wildcards** at the moment.\n *\n * @see https://datatracker.ietf.org/doc/html/rfc4647#section-3.4\n */\nexport function lookup(locale: string, options: LookupOptions): string {\n\tconst fallbackLanguages: string[] = [];\n\n\tconst languageTagParts = locale.split(\"-\").filter(Boolean);\n\tfor (let i = languageTagParts.length; i > 0; i--) {\n\t\t//Skip the x separator\n\t\tif (languageTagParts[i - 1] === \"x\") continue;\n\n\t\t//Stringify the language tag parts\n\t\tconst fallbackLanguageTag = languageTagParts.slice(0, i).join(\"-\");\n\t\tif (!options.locales.includes(fallbackLanguageTag)) continue;\n\t\tfallbackLanguages.push(fallbackLanguageTag);\n\t}\n\n\treturn fallbackLanguages[0] ?? options.baseLocale;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/urlpattern-polyfill/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/urlpattern-polyfill/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects the formatting of a JSON file and returns a function
|
|
3
|
+
* that can be used to stringify JSON with the same formatting.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const file = await fs.readFile("./messages.json", { encoding: "utf-8" })
|
|
7
|
+
* const stringify = detectJsonFormatting(file)
|
|
8
|
+
* const newFile = stringify(json)
|
|
9
|
+
*/
|
|
10
|
+
export declare const detectJsonFormatting: (file: string) => ((value: Parameters<typeof JSON.stringify>[0], replacer?: Parameters<typeof JSON.stringify>[1]) => string);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-json-formatting.d.ts","sourceRoot":"","sources":["../../src/utilities/detect-json-formatting.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,SAC1B,MAAM,KACV,CAAC,CACH,KAAK,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC3C,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAE3C,MAAM,CAOV,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects the formatting of a JSON file and returns a function
|
|
3
|
+
* that can be used to stringify JSON with the same formatting.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const file = await fs.readFile("./messages.json", { encoding: "utf-8" })
|
|
7
|
+
* const stringify = detectJsonFormatting(file)
|
|
8
|
+
* const newFile = stringify(json)
|
|
9
|
+
*/
|
|
10
|
+
export const detectJsonFormatting = (file) => {
|
|
11
|
+
const endsWithNewLine = file.endsWith("\n");
|
|
12
|
+
const spacing = guessJsonIndent(file);
|
|
13
|
+
return (value, replacer) => JSON.stringify(value, replacer, spacing) +
|
|
14
|
+
(endsWithNewLine ? "\n" : "");
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* vendored from https://github.com/ehmicky/guess-json-indent
|
|
18
|
+
*/
|
|
19
|
+
// Guess the indentation of a JSON string
|
|
20
|
+
const guessJsonIndent = (jsonString) => {
|
|
21
|
+
const firstIndex = skipWhitespaces(jsonString, 0);
|
|
22
|
+
if (firstIndex === undefined ||
|
|
23
|
+
!isJsonObjectOrArray(jsonString[firstIndex])) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const secondIndex = skipWhitespaces(jsonString, firstIndex + 1);
|
|
27
|
+
if (secondIndex === undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
return getIndent(jsonString, firstIndex, secondIndex);
|
|
31
|
+
};
|
|
32
|
+
// Whitespaces are ignored before|between|after tokens in JSON.
|
|
33
|
+
// Uses imperative logic for performance.
|
|
34
|
+
const skipWhitespaces = (jsonString, startIndex) => {
|
|
35
|
+
for (let index = startIndex; index < jsonString.length; index += 1) {
|
|
36
|
+
const character = jsonString[index];
|
|
37
|
+
if (!isJsonWhitespace(character)) {
|
|
38
|
+
return index;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
};
|
|
43
|
+
// JSON defines only those are valid whitespaces
|
|
44
|
+
const isJsonWhitespace = (character) => character === " " ||
|
|
45
|
+
character === "\t" ||
|
|
46
|
+
character === "\n" ||
|
|
47
|
+
character === "\r";
|
|
48
|
+
// If the top-level value is another type than an object or an array, there is
|
|
49
|
+
// no possible indentation
|
|
50
|
+
const isJsonObjectOrArray = (character) => character === "{" || character === "[";
|
|
51
|
+
// Uses imperative logic for performance
|
|
52
|
+
// @ts-expect-error - not all code paths return a value
|
|
53
|
+
const getIndent = (jsonString, firstIndex, secondIndex) => {
|
|
54
|
+
let indent;
|
|
55
|
+
for (let index = secondIndex - 1; index > firstIndex; index -= 1) {
|
|
56
|
+
const character = jsonString[index];
|
|
57
|
+
if (character === "\r") {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (character === "\n") {
|
|
61
|
+
return normalizeIndent(indent);
|
|
62
|
+
}
|
|
63
|
+
if (indent === undefined) {
|
|
64
|
+
indent = character;
|
|
65
|
+
}
|
|
66
|
+
else if (indent[0] === character) {
|
|
67
|
+
indent += character;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const normalizeIndent = (indent) => {
|
|
75
|
+
if (indent === undefined) {
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
return indent[0] === " " ? indent.length : indent;
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=detect-json-formatting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-json-formatting.js","sourceRoot":"","sources":["../../src/utilities/detect-json-formatting.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CACnC,IAAY,EAKA,EAAE;IACd,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;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used to stringify JSON with the same formatting.\n *\n * @example\n * const file = await fs.readFile(\"./messages.json\", { encoding: \"utf-8\" })\n * const stringify = detectJsonFormatting(file)\n * const newFile = stringify(json)\n */\nexport const detectJsonFormatting = (\n\tfile: string\n): ((\n\tvalue: Parameters<typeof JSON.stringify>[0],\n\treplacer?: Parameters<typeof JSON.stringify>[1]\n\t// space is provided by the function\n) => string) => {\n\tconst endsWithNewLine = file.endsWith(\"\\n\");\n\tconst spacing = guessJsonIndent(file);\n\n\treturn (value, replacer) =>\n\t\tJSON.stringify(value, replacer, spacing as any) +\n\t\t(endsWithNewLine ? \"\\n\" : \"\");\n};\n\n/**\n * vendored from https://github.com/ehmicky/guess-json-indent\n */\n// Guess the indentation of a JSON string\nconst guessJsonIndent = (jsonString: string) => {\n\tconst firstIndex = skipWhitespaces(jsonString, 0);\n\n\tif (\n\t\tfirstIndex === undefined ||\n\t\t!isJsonObjectOrArray(jsonString[firstIndex])\n\t) {\n\t\treturn;\n\t}\n\n\tconst secondIndex = skipWhitespaces(jsonString, firstIndex + 1);\n\n\tif (secondIndex === undefined) {\n\t\treturn;\n\t}\n\n\treturn getIndent(jsonString, firstIndex, secondIndex);\n};\n\n// Whitespaces are ignored before|between|after tokens in JSON.\n// Uses imperative logic for performance.\nconst skipWhitespaces = (jsonString: string | any[], startIndex: number) => {\n\tfor (let index = startIndex; index < jsonString.length; index += 1) {\n\t\tconst character = jsonString[index];\n\n\t\tif (!isJsonWhitespace(character)) {\n\t\t\treturn index;\n\t\t}\n\t}\n\treturn;\n};\n\n// JSON defines only those are valid whitespaces\nconst isJsonWhitespace = (character: string) =>\n\tcharacter === \" \" ||\n\tcharacter === \"\\t\" ||\n\tcharacter === \"\\n\" ||\n\tcharacter === \"\\r\";\n\n// If the top-level value is another type than an object or an array, there is\n// no possible indentation\nconst isJsonObjectOrArray = (character: string | undefined) =>\n\tcharacter === \"{\" || character === \"[\";\n\n// Uses imperative logic for performance\n// @ts-expect-error - not all code paths return a value\nconst getIndent = (\n\tjsonString: string | any[],\n\tfirstIndex: number,\n\tsecondIndex: number\n) => {\n\tlet indent;\n\n\tfor (let index = secondIndex - 1; index > firstIndex; index -= 1) {\n\t\tconst character = jsonString[index];\n\n\t\tif (character === \"\\r\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif (character === \"\\n\") {\n\t\t\treturn normalizeIndent(indent);\n\t\t}\n\n\t\tif (indent === undefined) {\n\t\t\tindent = character;\n\t\t} else if (indent[0] === character) {\n\t\t\tindent += character;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n};\n\nconst normalizeIndent = (indent: string | any[] | undefined) => {\n\tif (indent === undefined) {\n\t\treturn 0;\n\t}\n\n\treturn indent[0] === \" \" ? indent.length : indent;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nodeNormalizePath(id: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-normalize-path.d.ts","sourceRoot":"","sources":["../../src/utilities/node-normalize-path.ts"],"names":[],"mappings":"AAUA,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,UAE3C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
const windowsSlashRE = /\\/g;
|
|
3
|
+
function slash(p) {
|
|
4
|
+
return p.replace(windowsSlashRE, "/");
|
|
5
|
+
}
|
|
6
|
+
const isWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
7
|
+
export function nodeNormalizePath(id) {
|
|
8
|
+
return path.posix.normalize(isWindows ? slash(id) : id);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=node-normalize-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-normalize-path.js","sourceRoot":"","sources":["../../src/utilities/node-normalize-path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,SAAS,KAAK,CAAC,CAAS;IACvB,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,SAAS,GACd,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAEhE,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import path from \"node:path\";\n\nconst windowsSlashRE = /\\\\/g;\nfunction slash(p: string): string {\n\treturn p.replace(windowsSlashRE, \"/\");\n}\n\nconst isWindows =\n\ttypeof process !== \"undefined\" && process.platform === \"win32\";\n\nexport function nodeNormalizePath(id: string) {\n\treturn path.posix.normalize(isWindows ? slash(id) : id);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sebbro/paraglide-lite",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"tag": "latest"
|
|
9
|
+
},
|
|
10
|
+
"author": "Sebastian Broman <sebastian@broman.tv>",
|
|
11
|
+
"homepage": "https://github.com/SebbeBroman/paraglide-js",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/SebbeBroman/paraglide-js"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"paraglide-lite": "./bin/run.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"./dist",
|
|
21
|
+
"./bin"
|
|
22
|
+
],
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "tsc --watch",
|
|
29
|
+
"bench": "vitest bench --run",
|
|
30
|
+
"build:examples": "pnpm -r --filter \"./examples/**\" --if-present --workspace-concurrency=1 build",
|
|
31
|
+
"build": "npm run env-variables && tsc --build",
|
|
32
|
+
"test:examples": "pnpm -r --filter \"./examples/**\" --if-present test",
|
|
33
|
+
"test": "npm run env-variables && tsc --noEmit && vitest run --coverage ./src/**/*",
|
|
34
|
+
"ci": "pnpm run build && pnpm run build:examples && pnpm run test && pnpm run test:examples",
|
|
35
|
+
"test:watch": "npm run env-variables && vitest --watch ./src/**/*",
|
|
36
|
+
"env-variables": "node ./src/services/env-variables/create-index-file.js",
|
|
37
|
+
"lint": "oxlint --config .oxlintrc.json --fix",
|
|
38
|
+
"format": "prettier ./src --write",
|
|
39
|
+
"clean": "rm -rf ./dist ./node_modules"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"commander": "15.0.0",
|
|
43
|
+
"consola": "3.4.2",
|
|
44
|
+
"json5": "2.2.3",
|
|
45
|
+
"unplugin": "^3.3.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"typescript": ">=5.6",
|
|
49
|
+
"vite": ">=5.0.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"typescript": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"vite": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@inlang/paraglide-js-baseline": "npm:@inlang/paraglide-js@2.23.2",
|
|
61
|
+
"@inlang/plugin-message-format": "^4.4.1",
|
|
62
|
+
"@rollup/plugin-virtual": "3.0.2",
|
|
63
|
+
"@ts-morph/bootstrap": "0.29.0",
|
|
64
|
+
"@types/node": "^22.20.1",
|
|
65
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
66
|
+
"memfs": "4.68.0",
|
|
67
|
+
"oxlint": "^1.77.0",
|
|
68
|
+
"prettier": "^3.9.6",
|
|
69
|
+
"rolldown": "1.2.3",
|
|
70
|
+
"typescript": "5.9.3",
|
|
71
|
+
"typescript-go": "npm:typescript@7.0.2",
|
|
72
|
+
"vite": "8.2.1",
|
|
73
|
+
"vitest": "4.1.10"
|
|
74
|
+
},
|
|
75
|
+
"keywords": [
|
|
76
|
+
"i18n",
|
|
77
|
+
"l10n",
|
|
78
|
+
"internationalization",
|
|
79
|
+
"localization",
|
|
80
|
+
"translation",
|
|
81
|
+
"compiler",
|
|
82
|
+
"vite",
|
|
83
|
+
"vite-plugin",
|
|
84
|
+
"sveltekit",
|
|
85
|
+
"paraglide-lite"
|
|
86
|
+
]
|
|
87
|
+
}
|