@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":"add-vite-plugin.js","sourceRoot":"","sources":["../../../src/cli/steps/add-vite-plugin.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAWtB,KAAK,EAAE,GAAG,EAAE,EAAE;IACjB,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE;YACzD,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,gBAAgB,CAAC;YAC/B,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;SAClB,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACvD,GAAG,CAAC,MAAM,EAAE,OAAO,CAClB,0DAA0D,CAC1D,CAAC;QACH,CAAC;aAAM,CAAC;YACP,MAAM,GAAG,GAAG;gBACX,iEAAiE;gBACjE,UAAU,GAAG,MAAM,CAAC,MAAM;gBAC1B,EAAE;gBACF,iCAAiC;aACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YACtB,OAAO,GAAG,CAAC;QACZ,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,GAAG,CAAC,MAAM,EAAE,KAAK,CAChB,mDAAmD,GAAG,CAAC,UAAU,GAAG,CACpE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAcF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAMhC;IACA,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC;QACpD,OAAO;YACN,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,iBAAiB;SACzB,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC1C,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO;YACN,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,kCAAkC;SAC1C,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,aAAa,GAClB,gEAAgE;QAChE,MAAM;QACN,oCAAoC,IAAI,CAAC,QAAQ,eAAe,cAAc,kBAAkB,IAAI,CAAC,UAAU,eAAe,IAAI,CAAC,MAAM,OAAO;QAChJ,KAAK,CAAC;IAEP,OAAO;QACN,EAAE,EAAE,IAAI;QACR,OAAO,EAAE,aAAa;KACtB,CAAC;AACH,CAAC","sourcesContent":["import type { Logger } from \"../../services/logger/index.js\";\nimport type { CliStep } from \"../utils.js\";\n\nexport const addVitePlugin: CliStep<\n\t{\n\t\tfs: typeof import(\"node:fs/promises\");\n\t\tmessages: string;\n\t\tlocales: string[];\n\t\tbaseLocale: string;\n\t\toutdir: string;\n\t\tlogger?: Logger;\n\t\tconfigPath: string;\n\t},\n\tunknown\n> = async (ctx) => {\n\ttry {\n\t\tconst fileContent = await ctx.fs.readFile(ctx.configPath, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\n\t\tconst result = updateViteConfig({\n\t\t\tconfig: fileContent,\n\t\t\tmessages: ctx.messages,\n\t\t\tlocales: ctx.locales,\n\t\t\tbaseLocale: ctx.baseLocale,\n\t\t\toutdir: ctx.outdir,\n\t\t});\n\t\tif (result.ok) {\n\t\t\tawait ctx.fs.writeFile(ctx.configPath, result.updated);\n\t\t\tctx.logger?.success(\n\t\t\t\t\"Added the paraglide-lite vite plugin to the vite config.\"\n\t\t\t);\n\t\t} else {\n\t\t\tconst msg = [\n\t\t\t\t\"Failed to add the paraglide-lite vite plugin in vite.config.js.\",\n\t\t\t\t\"Reason: \" + result.reason,\n\t\t\t\t\"\",\n\t\t\t\t\"Please add the plugin manually.\",\n\t\t\t].join(\"\\n\");\n\n\t\t\tctx.logger?.warn(msg);\n\t\t\treturn ctx;\n\t\t}\n\t} catch {\n\t\tctx.logger?.error(\n\t\t\t`Failed to add the paraglide-lite vite plugin to ${ctx.configPath}.`\n\t\t);\n\t\tprocess.exit(1);\n\t}\n\n\treturn ctx;\n};\n\ntype UpdateResult =\n\t| {\n\t\t\tok: true;\n\t\t\tupdated: string;\n\t\t\treason?: undefined;\n\t }\n\t| {\n\t\t\tok: false;\n\t\t\treason: string;\n\t\t\tupdated?: undefined;\n\t };\n\n/**\n * @private Only exported for testings\n */\nexport function updateViteConfig(args: {\n\tconfig: string;\n\tmessages: string;\n\tlocales: string[];\n\tbaseLocale: string;\n\toutdir: string;\n}): UpdateResult {\n\tif (args.config.includes(\"@sebbro/paraglide-lite\")) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"Already present\",\n\t\t};\n\t}\n\n\tconst PLUGINS_REGEX = /plugins\\s*:\\s*\\[/g;\n\tconst match = PLUGINS_REGEX.exec(args.config);\n\n\tif (!match) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"Could not find the plugins array\",\n\t\t};\n\t}\n\n\tconst endIndex = match.index + match[0].length;\n\tconst before = args.config.slice(0, endIndex);\n\tconst after = args.config.slice(endIndex);\n\n\tconst localesLiteral = JSON.stringify(args.locales);\n\tconst updatedConfig =\n\t\t\"import { paraglideVitePlugin } from '@sebbro/paraglide-lite'\\n\" +\n\t\tbefore +\n\t\t`paraglideVitePlugin({ messages: '${args.messages}', locales: ${localesLiteral}, baseLocale: '${args.baseLocale}', outdir: '${args.outdir}' }),` +\n\t\tafter;\n\n\treturn {\n\t\tok: true,\n\t\tupdated: updatedConfig,\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-vite-plugin.test.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/add-vite-plugin.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
import { addVitePlugin, updateViteConfig } from "./add-vite-plugin.js";
|
|
3
|
+
import { memfs } from "memfs";
|
|
4
|
+
const pluginArgs = {
|
|
5
|
+
messages: "./messages/{locale}.json",
|
|
6
|
+
locales: ["en", "de"],
|
|
7
|
+
baseLocale: "en",
|
|
8
|
+
outdir: "./src/paraglide",
|
|
9
|
+
};
|
|
10
|
+
test("updates a vite.config.ts", async () => {
|
|
11
|
+
const config = `import { sveltekit } from "@sveltejs/kit/vite"
|
|
12
|
+
import { defineConfig } from "vite"
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [sveltekit()],
|
|
16
|
+
})
|
|
17
|
+
`;
|
|
18
|
+
const fs = memfs({
|
|
19
|
+
"/vite.config.ts": config,
|
|
20
|
+
}).fs;
|
|
21
|
+
await addVitePlugin({
|
|
22
|
+
fs: fs.promises,
|
|
23
|
+
configPath: "/vite.config.ts",
|
|
24
|
+
...pluginArgs,
|
|
25
|
+
});
|
|
26
|
+
const updatedConfig = await fs.promises.readFile("/vite.config.ts", {
|
|
27
|
+
encoding: "utf-8",
|
|
28
|
+
});
|
|
29
|
+
expect(updatedConfig).toContain(`paraglideVitePlugin({ messages: './messages/{locale}.json', locales: ["en","de"], baseLocale: 'en', outdir: './src/paraglide' })`);
|
|
30
|
+
});
|
|
31
|
+
test("updateViteConfig returns already present when plugin exists", () => {
|
|
32
|
+
const result = updateViteConfig({
|
|
33
|
+
config: `import { paraglideVitePlugin } from '@sebbro/paraglide-lite'\nexport default { plugins: [paraglideVitePlugin({})] }`,
|
|
34
|
+
...pluginArgs,
|
|
35
|
+
});
|
|
36
|
+
expect(result.ok).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
test("doesn't update configs where the paraglide plugin is already present", async () => {
|
|
39
|
+
const config = `
|
|
40
|
+
import { sveltekit } from "@sveltejs/kit/vite"
|
|
41
|
+
import { paraglideVitePlugin } from "@sebbro/paraglide-lite"
|
|
42
|
+
import { visualizer } from "rollup-plugin-visualizer"
|
|
43
|
+
import { defineConfig } from "vite"
|
|
44
|
+
|
|
45
|
+
export default defineConfig({
|
|
46
|
+
plugins: [
|
|
47
|
+
paraglideVitePlugin({
|
|
48
|
+
messages: "./messages/{locale}.json",
|
|
49
|
+
locales: ["en", "de"],
|
|
50
|
+
baseLocale: "en",
|
|
51
|
+
outdir: "./src/paraglide",
|
|
52
|
+
}),
|
|
53
|
+
sveltekit(),
|
|
54
|
+
visualizer({
|
|
55
|
+
filename: "stats.html",
|
|
56
|
+
emitFile: true,
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
`;
|
|
61
|
+
const fs = memfs({
|
|
62
|
+
"/vite.config.ts": config,
|
|
63
|
+
}).fs;
|
|
64
|
+
await addVitePlugin({
|
|
65
|
+
fs: fs.promises,
|
|
66
|
+
configPath: "/vite.config.ts",
|
|
67
|
+
...pluginArgs,
|
|
68
|
+
});
|
|
69
|
+
const updatedConfig = await fs.promises.readFile("/vite.config.ts", {
|
|
70
|
+
encoding: "utf-8",
|
|
71
|
+
});
|
|
72
|
+
expect(updatedConfig).toMatch(config);
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=add-vite-plugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-vite-plugin.test.js","sourceRoot":"","sources":["../../../src/cli/steps/add-vite-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,UAAU,GAAG;IAClB,QAAQ,EAAE,0BAA0B;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,iBAAiB;CACzB,CAAC;AAEF,IAAI,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;IAC3C,MAAM,MAAM,GAAG;;;;;;CAMf,CAAC;IAED,MAAM,EAAE,GAAG,KAAK,CAAC;QAChB,iBAAiB,EAAE,MAAM;KACzB,CAAC,CAAC,EAAyC,CAAC;IAE7C,MAAM,aAAa,CAAC;QACnB,EAAE,EAAE,EAAE,CAAC,QAAQ;QACf,UAAU,EAAE,iBAAiB;QAC7B,GAAG,UAAU;KACb,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QACnE,QAAQ,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAC9B,kIAAkI,CAClI,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6DAA6D,EAAE,GAAG,EAAE;IACxE,MAAM,MAAM,GAAG,gBAAgB,CAAC;QAC/B,MAAM,EAAE,qHAAqH;QAC7H,GAAG,UAAU;KACb,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;IACvF,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBf,CAAC;IACD,MAAM,EAAE,GAAG,KAAK,CAAC;QAChB,iBAAiB,EAAE,MAAM;KACzB,CAAC,CAAC,EAAyC,CAAC;IAC7C,MAAM,aAAa,CAAC;QACnB,EAAE,EAAE,EAAE,CAAC,QAAQ;QACf,UAAU,EAAE,iBAAiB;QAC7B,GAAG,UAAU;KACb,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QACnE,QAAQ,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test } from \"vitest\";\nimport { addVitePlugin, updateViteConfig } from \"./add-vite-plugin.js\";\nimport { memfs } from \"memfs\";\n\nconst pluginArgs = {\n\tmessages: \"./messages/{locale}.json\",\n\tlocales: [\"en\", \"de\"],\n\tbaseLocale: \"en\",\n\toutdir: \"./src/paraglide\",\n};\n\ntest(\"updates a vite.config.ts\", async () => {\n\tconst config = `import { sveltekit } from \"@sveltejs/kit/vite\"\nimport { defineConfig } from \"vite\"\n\nexport default defineConfig({\n\tplugins: [sveltekit()],\n})\n`;\n\n\tconst fs = memfs({\n\t\t\"/vite.config.ts\": config,\n\t}).fs as unknown as typeof import(\"node:fs\");\n\n\tawait addVitePlugin({\n\t\tfs: fs.promises,\n\t\tconfigPath: \"/vite.config.ts\",\n\t\t...pluginArgs,\n\t});\n\n\tconst updatedConfig = await fs.promises.readFile(\"/vite.config.ts\", {\n\t\tencoding: \"utf-8\",\n\t});\n\n\texpect(updatedConfig).toContain(\n\t\t`paraglideVitePlugin({ messages: './messages/{locale}.json', locales: [\"en\",\"de\"], baseLocale: 'en', outdir: './src/paraglide' })`\n\t);\n});\n\ntest(\"updateViteConfig returns already present when plugin exists\", () => {\n\tconst result = updateViteConfig({\n\t\tconfig: `import { paraglideVitePlugin } from '@sebbro/paraglide-lite'\\nexport default { plugins: [paraglideVitePlugin({})] }`,\n\t\t...pluginArgs,\n\t});\n\texpect(result.ok).toBe(false);\n});\n\ntest(\"doesn't update configs where the paraglide plugin is already present\", async () => {\n\tconst config = `\n import { sveltekit } from \"@sveltejs/kit/vite\"\n import { paraglideVitePlugin } from \"@sebbro/paraglide-lite\"\n import { visualizer } from \"rollup-plugin-visualizer\"\n import { defineConfig } from \"vite\"\n \n export default defineConfig({\n plugins: [\n paraglideVitePlugin({\n messages: \"./messages/{locale}.json\",\n locales: [\"en\", \"de\"],\n baseLocale: \"en\",\n outdir: \"./src/paraglide\",\n }),\n sveltekit(),\n visualizer({\n filename: \"stats.html\",\n emitFile: true,\n }),\n ],\n }) \n`;\n\tconst fs = memfs({\n\t\t\"/vite.config.ts\": config,\n\t}).fs as unknown as typeof import(\"node:fs\");\n\tawait addVitePlugin({\n\t\tfs: fs.promises,\n\t\tconfigPath: \"/vite.config.ts\",\n\t\t...pluginArgs,\n\t});\n\n\tconst updatedConfig = await fs.promises.readFile(\"/vite.config.ts\", {\n\t\tencoding: \"utf-8\",\n\t});\n\n\texpect(updatedConfig).toMatch(config);\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-for-uncomitted-changes.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/check-for-uncomitted-changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAC/C;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAClB,OAAO,CAuBP,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { prompt } from "../utils.js";
|
|
2
|
+
import childProcess from "node:child_process";
|
|
3
|
+
export const checkForUncommittedChanges = async (ctx) => {
|
|
4
|
+
try {
|
|
5
|
+
if ((await execAsync("git status --porcelain")).toString().length === 0) {
|
|
6
|
+
return ctx;
|
|
7
|
+
}
|
|
8
|
+
ctx.logger.info(`You have uncommitted changes.\n\nCommitting outstanding changes ensures that you don't lose any work, and see the changes the paraglide-lite init command introduces.`);
|
|
9
|
+
const response = await prompt("Continue without committing?", {
|
|
10
|
+
type: "confirm",
|
|
11
|
+
initial: false,
|
|
12
|
+
});
|
|
13
|
+
if (response === true) {
|
|
14
|
+
return ctx;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// git cli is not installed
|
|
22
|
+
return ctx;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function execAsync(command) {
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
childProcess.exec(command, (error, stdout) => {
|
|
28
|
+
if (error) {
|
|
29
|
+
reject(error);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
resolve(stdout);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=check-for-uncomitted-changes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-for-uncomitted-changes.js","sourceRoot":"","sources":["../../../src/cli/steps/check-for-uncomitted-changes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAGnC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjB,IAAI,CAAC;QACJ,IAAI,CAAC,MAAM,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzE,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,GAAG,CAAC,MAAM,CAAC,IAAI,CACd,uKAAuK,CACvK,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,8BAA8B,EAAE;YAC7D,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,GAAG,CAAC;QACZ,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,2BAA2B;QAC3B,OAAO,GAAG,CAAC;IACZ,CAAC;AACF,CAAC,CAAC;AAEF,SAAS,SAAS,CAAC,OAAe;IACjC,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC9C,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC5C,IAAI,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { Logger } from \"../../services/logger/index.js\";\nimport type { CliStep } from \"../utils.js\";\nimport { prompt } from \"../utils.js\";\nimport childProcess from \"node:child_process\";\n\nexport const checkForUncommittedChanges: CliStep<\n\t{ logger: Logger },\n\tunknown\n> = async (ctx) => {\n\ttry {\n\t\tif ((await execAsync(\"git status --porcelain\")).toString().length === 0) {\n\t\t\treturn ctx;\n\t\t}\n\n\t\tctx.logger.info(\n\t\t\t`You have uncommitted changes.\\n\\nCommitting outstanding changes ensures that you don't lose any work, and see the changes the paraglide-lite init command introduces.`\n\t\t);\n\t\tconst response = await prompt(\"Continue without committing?\", {\n\t\t\ttype: \"confirm\",\n\t\t\tinitial: false,\n\t\t});\n\t\tif (response === true) {\n\t\t\treturn ctx;\n\t\t} else {\n\t\t\tprocess.exit(0);\n\t\t}\n\t} catch {\n\t\t// git cli is not installed\n\t\treturn ctx;\n\t}\n};\n\nfunction execAsync(command: string) {\n\treturn new Promise<string>((resolve, reject) => {\n\t\tchildProcess.exec(command, (error, stdout) => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tresolve(stdout);\n\t\t\t}\n\t\t});\n\t});\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-bundler.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/detect-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,aAAa,EAAE,OAAO,CAClC;IAAE,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAA;CAAE,EACvC;IACA,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACA,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CAClB,CA0BH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const detectBundler = async (ctx) => {
|
|
2
|
+
const potentialViteConfigPaths = ["./vite.config.js", "./vite.config.ts"];
|
|
3
|
+
const viteConfigPath = await Promise.all(potentialViteConfigPaths.map(async (path) => ({
|
|
4
|
+
path,
|
|
5
|
+
exists: await ctx.fs
|
|
6
|
+
.access(path)
|
|
7
|
+
.then(() => true)
|
|
8
|
+
.catch(() => false),
|
|
9
|
+
}))).then((results) => results.find((result) => result.exists)?.path);
|
|
10
|
+
if (!viteConfigPath) {
|
|
11
|
+
return {
|
|
12
|
+
...ctx,
|
|
13
|
+
bundler: undefined,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
...ctx,
|
|
18
|
+
bundler: "vite",
|
|
19
|
+
configPath: viteConfigPath,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=detect-bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-bundler.js","sourceRoot":"","sources":["../../../src/cli/steps/detect-bundler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAUtB,KAAK,EAAE,GAAG,EAAE,EAAE;IACjB,MAAM,wBAAwB,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAE1E,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,GAAG,CACvC,wBAAwB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7C,IAAI;QACJ,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE;aAClB,MAAM,CAAC,IAAI,CAAC;aACZ,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;KACpB,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAEnE,IAAI,CAAC,cAAc,EAAE,CAAC;QACrB,OAAO;YACN,GAAG,GAAG;YACN,OAAO,EAAE,SAAS;SAClB,CAAC;IACH,CAAC;IAED,OAAO;QACN,GAAG,GAAG;QACN,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,cAAc;KAC1B,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { CliStep } from \"../utils.js\";\n\nexport const detectBundler: CliStep<\n\t{ fs: typeof import(\"node:fs/promises\") },\n\t| {\n\t\t\tbundler?: undefined;\n\t\t\tconfigPath?: undefined;\n\t }\n\t| {\n\t\t\tbundler: \"vite\";\n\t\t\tconfigPath: string;\n\t }\n> = async (ctx) => {\n\tconst potentialViteConfigPaths = [\"./vite.config.js\", \"./vite.config.ts\"];\n\n\tconst viteConfigPath = await Promise.all(\n\t\tpotentialViteConfigPaths.map(async (path) => ({\n\t\t\tpath,\n\t\t\texists: await ctx.fs\n\t\t\t\t.access(path)\n\t\t\t\t.then(() => true)\n\t\t\t\t.catch(() => false),\n\t\t}))\n\t).then((results) => results.find((result) => result.exists)?.path);\n\n\tif (!viteConfigPath) {\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tbundler: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\t...ctx,\n\t\tbundler: \"vite\",\n\t\tconfigPath: viteConfigPath,\n\t};\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-bundler.test.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/detect-bundler.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
import { memfs } from "memfs";
|
|
3
|
+
import { describe } from "node:test";
|
|
4
|
+
import { detectBundler } from "./detect-bundler.js";
|
|
5
|
+
describe("vite", async () => {
|
|
6
|
+
test("detects vite.config.js ", async () => {
|
|
7
|
+
const fs = memfs({
|
|
8
|
+
"/vite.config.js": "mock",
|
|
9
|
+
}).fs;
|
|
10
|
+
process.cwd = () => "/";
|
|
11
|
+
const result = await detectBundler({
|
|
12
|
+
fs: fs.promises,
|
|
13
|
+
});
|
|
14
|
+
expect(result.bundler).toBe("vite");
|
|
15
|
+
expect(result.configPath).toBe("./vite.config.js");
|
|
16
|
+
});
|
|
17
|
+
test("detects vite.config.ts ", async () => {
|
|
18
|
+
const fs = memfs({
|
|
19
|
+
"/vite.config.ts": "mock",
|
|
20
|
+
}).fs;
|
|
21
|
+
process.cwd = () => "/";
|
|
22
|
+
const result = await detectBundler({
|
|
23
|
+
fs: fs.promises,
|
|
24
|
+
});
|
|
25
|
+
expect(result.bundler).toBe("vite");
|
|
26
|
+
expect(result.configPath).toBe("./vite.config.ts");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=detect-bundler.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-bundler.test.js","sourceRoot":"","sources":["../../../src/cli/steps/detect-bundler.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,QAAQ,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;IAC3B,IAAI,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,EAAE,GAAG,KAAK,CAAC;YAChB,iBAAiB,EAAE,MAAM;SACzB,CAAC,CAAC,EAAyC,CAAC;QAE7C,OAAO,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;QAExB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;YAClC,EAAE,EAAE,EAAE,CAAC,QAAQ;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,EAAE,GAAG,KAAK,CAAC;YAChB,iBAAiB,EAAE,MAAM;SACzB,CAAC,CAAC,EAAyC,CAAC;QAE7C,OAAO,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;QAExB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;YAClC,EAAE,EAAE,EAAE,CAAC,QAAQ;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test } from \"vitest\";\nimport { memfs } from \"memfs\";\nimport { describe } from \"node:test\";\nimport { detectBundler } from \"./detect-bundler.js\";\n\ndescribe(\"vite\", async () => {\n\ttest(\"detects vite.config.js \", async () => {\n\t\tconst fs = memfs({\n\t\t\t\"/vite.config.js\": \"mock\",\n\t\t}).fs as unknown as typeof import(\"node:fs\");\n\n\t\tprocess.cwd = () => \"/\";\n\n\t\tconst result = await detectBundler({\n\t\t\tfs: fs.promises,\n\t\t});\n\n\t\texpect(result.bundler).toBe(\"vite\");\n\t\texpect(result.configPath).toBe(\"./vite.config.js\");\n\t});\n\n\ttest(\"detects vite.config.ts \", async () => {\n\t\tconst fs = memfs({\n\t\t\t\"/vite.config.ts\": \"mock\",\n\t\t}).fs as unknown as typeof import(\"node:fs\");\n\n\t\tprocess.cwd = () => \"/\";\n\n\t\tconst result = await detectBundler({\n\t\t\tfs: fs.promises,\n\t\t});\n\n\t\texpect(result.bundler).toBe(\"vite\");\n\t\texpect(result.configPath).toBe(\"./vite.config.ts\");\n\t});\n});\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Logger } from "../../services/logger/index.js";
|
|
2
|
+
import type { CliStep } from "../utils.js";
|
|
3
|
+
export declare const initializeMessages: CliStep<{
|
|
4
|
+
fs: typeof import("node:fs/promises");
|
|
5
|
+
logger: Logger;
|
|
6
|
+
root: string;
|
|
7
|
+
}, {
|
|
8
|
+
messages: string;
|
|
9
|
+
locales: string[];
|
|
10
|
+
baseLocale: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize-messages.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/initialize-messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAO3C,eAAO,MAAM,kBAAkB,EAAE,OAAO,CACvC;IACC,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb,EACD;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACnB,CA8CD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import nodePath from "node:path";
|
|
2
|
+
import { DEFAULT_BASE_LOCALE, DEFAULT_LOCALES, DEFAULT_MESSAGES, } from "../defaults.js";
|
|
3
|
+
export const initializeMessages = async (ctx) => {
|
|
4
|
+
const messages = DEFAULT_MESSAGES;
|
|
5
|
+
const locales = [...DEFAULT_LOCALES];
|
|
6
|
+
const baseLocale = DEFAULT_BASE_LOCALE;
|
|
7
|
+
const messageDir = nodePath.resolve(process.cwd(), nodePath.dirname(messages.replace("{locale}", baseLocale)));
|
|
8
|
+
await ctx.fs.mkdir(messageDir, { recursive: true });
|
|
9
|
+
await Promise.all(locales.map(async (locale) => {
|
|
10
|
+
const languageFile = nodePath.resolve(messageDir, `${locale}.json`);
|
|
11
|
+
const exists = await ctx.fs
|
|
12
|
+
.access(languageFile)
|
|
13
|
+
.then(() => true)
|
|
14
|
+
.catch(() => false);
|
|
15
|
+
if (exists)
|
|
16
|
+
return;
|
|
17
|
+
await ctx.fs.writeFile(languageFile, JSON.stringify({
|
|
18
|
+
example_message: locale === baseLocale
|
|
19
|
+
? "Hello world {username}"
|
|
20
|
+
: "Guten Tag {username}",
|
|
21
|
+
}, null, 2) + "\n");
|
|
22
|
+
}));
|
|
23
|
+
ctx.logger.success(`Created message files in ${nodePath.relative(process.cwd(), messageDir)}/`);
|
|
24
|
+
return {
|
|
25
|
+
...ctx,
|
|
26
|
+
messages,
|
|
27
|
+
locales,
|
|
28
|
+
baseLocale,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=initialize-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize-messages.js","sourceRoot":"","sources":["../../../src/cli/steps/initialize-messages.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,gBAAgB,GAChB,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAW3B,KAAK,EAAE,GAAG,EAAE,EAAE;IACjB,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IAClC,MAAM,OAAO,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,mBAAmB,CAAC;IAEvC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAClC,OAAO,CAAC,GAAG,EAAE,EACb,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAC1D,CAAC;IAEF,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpD,MAAM,OAAO,CAAC,GAAG,CAChB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5B,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE;aACzB,MAAM,CAAC,YAAY,CAAC;aACpB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,MAAM;YAAE,OAAO;QAEnB,MAAM,GAAG,CAAC,EAAE,CAAC,SAAS,CACrB,YAAY,EACZ,IAAI,CAAC,SAAS,CACb;YACC,eAAe,EACd,MAAM,KAAK,UAAU;gBACpB,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC,sBAAsB;SAC1B,EACD,IAAI,EACJ,CAAC,CACD,GAAG,IAAI,CACR,CAAC;IACH,CAAC,CAAC,CACF,CAAC;IAEF,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhG,OAAO;QACN,GAAG,GAAG;QACN,QAAQ;QACR,OAAO;QACP,UAAU;KACV,CAAC;AACH,CAAC,CAAC","sourcesContent":["import nodePath from \"node:path\";\nimport type { Logger } from \"../../services/logger/index.js\";\nimport type { CliStep } from \"../utils.js\";\nimport {\n\tDEFAULT_BASE_LOCALE,\n\tDEFAULT_LOCALES,\n\tDEFAULT_MESSAGES,\n} from \"../defaults.js\";\n\nexport const initializeMessages: CliStep<\n\t{\n\t\tfs: typeof import(\"node:fs/promises\");\n\t\tlogger: Logger;\n\t\troot: string;\n\t},\n\t{\n\t\tmessages: string;\n\t\tlocales: string[];\n\t\tbaseLocale: string;\n\t}\n> = async (ctx) => {\n\tconst messages = DEFAULT_MESSAGES;\n\tconst locales = [...DEFAULT_LOCALES];\n\tconst baseLocale = DEFAULT_BASE_LOCALE;\n\n\tconst messageDir = nodePath.resolve(\n\t\tprocess.cwd(),\n\t\tnodePath.dirname(messages.replace(\"{locale}\", baseLocale))\n\t);\n\n\tawait ctx.fs.mkdir(messageDir, { recursive: true });\n\n\tawait Promise.all(\n\t\tlocales.map(async (locale) => {\n\t\t\tconst languageFile = nodePath.resolve(messageDir, `${locale}.json`);\n\t\t\tconst exists = await ctx.fs\n\t\t\t\t.access(languageFile)\n\t\t\t\t.then(() => true)\n\t\t\t\t.catch(() => false);\n\t\t\tif (exists) return;\n\n\t\t\tawait ctx.fs.writeFile(\n\t\t\t\tlanguageFile,\n\t\t\t\tJSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\texample_message:\n\t\t\t\t\t\t\tlocale === baseLocale\n\t\t\t\t\t\t\t\t? \"Hello world {username}\"\n\t\t\t\t\t\t\t\t: \"Guten Tag {username}\",\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2\n\t\t\t\t) + \"\\n\"\n\t\t\t);\n\t\t})\n\t);\n\n\tctx.logger.success(`Created message files in ${nodePath.relative(process.cwd(), messageDir)}/`);\n\n\treturn {\n\t\t...ctx,\n\t\tmessages,\n\t\tlocales,\n\t\tbaseLocale,\n\t};\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-for-outdir.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/prompt-for-outdir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,eAAe,EAAE,OAAO,CACpC;IACC,MAAM,EAAE,MAAM,CAAC;CACf,EACD;IACC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;CACf,CAwBD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DEFAULT_OUTDIR } from "../defaults.js";
|
|
2
|
+
import { prompt } from "../utils.js";
|
|
3
|
+
export const promptForOutdir = async (ctx) => {
|
|
4
|
+
const response = await prompt("Which outdir should paraglide-lite write generated files to?", {
|
|
5
|
+
type: "text",
|
|
6
|
+
initial: DEFAULT_OUTDIR,
|
|
7
|
+
default: DEFAULT_OUTDIR,
|
|
8
|
+
placeholder: "Relative path from the package root to the desired compiler output directory",
|
|
9
|
+
});
|
|
10
|
+
if (!response.startsWith("./")) {
|
|
11
|
+
ctx.logger.warn("You must enter a valid relative path starting from the package root.");
|
|
12
|
+
return await promptForOutdir(ctx);
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
...ctx,
|
|
16
|
+
outdir: response,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=prompt-for-outdir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-for-outdir.js","sourceRoot":"","sources":["../../../src/cli/steps/prompt-for-outdir.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,CAAC,MAAM,eAAe,GAQxB,KAAK,EAAE,GAAG,EAAE,EAAE;IACjB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAC5B,8DAA8D,EAC9D;QACC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;QACvB,WAAW,EACV,8EAA8E;KAC/E,CACD,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,GAAG,CAAC,MAAM,CAAC,IAAI,CACd,sEAAsE,CACtE,CAAC;QACF,OAAO,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,OAAO;QACN,GAAG,GAAG;QACN,MAAM,EAAE,QAAQ;KAChB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { Logger } from \"../../services/logger/index.js\";\nimport { DEFAULT_OUTDIR } from \"../defaults.js\";\nimport { prompt } from \"../utils.js\";\nimport type { CliStep } from \"../utils.js\";\n\nexport const promptForOutdir: CliStep<\n\t{\n\t\tlogger: Logger;\n\t},\n\t{\n\t\t/** Relative path to the output directory */\n\t\toutdir: string;\n\t}\n> = async (ctx) => {\n\tconst response = await prompt(\n\t\t\"Which outdir should paraglide-lite write generated files to?\",\n\t\t{\n\t\t\ttype: \"text\",\n\t\t\tinitial: DEFAULT_OUTDIR,\n\t\t\tdefault: DEFAULT_OUTDIR,\n\t\t\tplaceholder:\n\t\t\t\t\"Relative path from the package root to the desired compiler output directory\",\n\t\t}\n\t);\n\n\tif (!response.startsWith(\"./\")) {\n\t\tctx.logger.warn(\n\t\t\t\"You must enter a valid relative path starting from the package root.\"\n\t\t);\n\t\treturn await promptForOutdir(ctx);\n\t}\n\n\treturn {\n\t\t...ctx,\n\t\toutdir: response,\n\t};\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Logger } from "../../services/logger/index.js";
|
|
2
|
+
import type { CliStep } from "../utils.js";
|
|
3
|
+
export declare function updatePackageJson(opt: {
|
|
4
|
+
dependencies?: (deps: Record<string, string>) => Promise<Record<string, string>>;
|
|
5
|
+
devDependencies?: (devDeps: Record<string, string>) => Promise<Record<string, string>>;
|
|
6
|
+
scripts?: (scripts: Record<string, string>) => Promise<Record<string, string>>;
|
|
7
|
+
}): CliStep<{
|
|
8
|
+
packageJsonPath: string;
|
|
9
|
+
fs: typeof import("node:fs/promises");
|
|
10
|
+
logger: Logger;
|
|
11
|
+
}, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package-json.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/update-package-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE;IACtC,YAAY,CAAC,EAAE,CACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,CACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,CACT,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrC,GAAG,OAAO,CACV;IACC,eAAe,EAAE,MAAM,CAAC;IACxB,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;CACf,EACD,OAAO,CACP,CAmCA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { detectJsonFormatting } from "../../utilities/detect-json-formatting.js";
|
|
2
|
+
export function updatePackageJson(opt) {
|
|
3
|
+
return async (ctx) => {
|
|
4
|
+
const file = await ctx.fs.readFile(ctx.packageJsonPath, {
|
|
5
|
+
encoding: "utf-8",
|
|
6
|
+
});
|
|
7
|
+
const stringify = detectJsonFormatting(file);
|
|
8
|
+
let pkg;
|
|
9
|
+
try {
|
|
10
|
+
pkg = JSON.parse(file);
|
|
11
|
+
if (typeof pkg !== "object" || pkg === null) {
|
|
12
|
+
throw new Error();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
ctx.logger.error(`Your ./package.json does not contain valid JSON. Please fix it and try again.`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
if (opt.dependencies)
|
|
21
|
+
pkg.dependencies = await opt.dependencies(pkg.dependencies || {});
|
|
22
|
+
if (opt.devDependencies)
|
|
23
|
+
pkg.devDependencies = await opt.devDependencies(pkg.devDependencies || {});
|
|
24
|
+
if (opt.scripts)
|
|
25
|
+
pkg.scripts = await opt.scripts(pkg.scripts || {});
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return ctx;
|
|
29
|
+
}
|
|
30
|
+
await ctx.fs.writeFile("./package.json", stringify(pkg));
|
|
31
|
+
return ctx;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=update-package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package-json.js","sourceRoot":"","sources":["../../../src/cli/steps/update-package-json.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,UAAU,iBAAiB,CAAC,GAUjC;IAQA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE;QACpB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE;YACvD,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,GAAG,CAAC;QACR,IAAI,CAAC;YACJ,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACvB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;gBAC7C,MAAM,IAAI,KAAK,EAAE,CAAC;YACnB,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,GAAG,CAAC,MAAM,CAAC,KAAK,CACf,+EAA+E,CAC/E,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QAED,IAAI,CAAC;YACJ,IAAI,GAAG,CAAC,YAAY;gBACnB,GAAG,CAAC,YAAY,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;YACnE,IAAI,GAAG,CAAC,eAAe;gBACtB,GAAG,CAAC,eAAe,GAAG,MAAM,GAAG,CAAC,eAAe,CAC9C,GAAG,CAAC,eAAe,IAAI,EAAE,CACzB,CAAC;YACH,IAAI,GAAG,CAAC,OAAO;gBAAE,GAAG,CAAC,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACrE,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type { Logger } from \"../../services/logger/index.js\";\nimport type { CliStep } from \"../utils.js\";\nimport { detectJsonFormatting } from \"../../utilities/detect-json-formatting.js\";\n\nexport function updatePackageJson(opt: {\n\tdependencies?: (\n\t\tdeps: Record<string, string>\n\t) => Promise<Record<string, string>>;\n\tdevDependencies?: (\n\t\tdevDeps: Record<string, string>\n\t) => Promise<Record<string, string>>;\n\tscripts?: (\n\t\tscripts: Record<string, string>\n\t) => Promise<Record<string, string>>;\n}): CliStep<\n\t{\n\t\tpackageJsonPath: string;\n\t\tfs: typeof import(\"node:fs/promises\");\n\t\tlogger: Logger;\n\t},\n\tunknown\n> {\n\treturn async (ctx) => {\n\t\tconst file = await ctx.fs.readFile(ctx.packageJsonPath, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\n\t\tconst stringify = detectJsonFormatting(file);\n\n\t\tlet pkg;\n\t\ttry {\n\t\t\tpkg = JSON.parse(file);\n\t\t\tif (typeof pkg !== \"object\" || pkg === null) {\n\t\t\t\tthrow new Error();\n\t\t\t}\n\t\t} catch {\n\t\t\tctx.logger.error(\n\t\t\t\t`Your ./package.json does not contain valid JSON. Please fix it and try again.`\n\t\t\t);\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\ttry {\n\t\t\tif (opt.dependencies)\n\t\t\t\tpkg.dependencies = await opt.dependencies(pkg.dependencies || {});\n\t\t\tif (opt.devDependencies)\n\t\t\t\tpkg.devDependencies = await opt.devDependencies(\n\t\t\t\t\tpkg.devDependencies || {}\n\t\t\t\t);\n\t\t\tif (opt.scripts) pkg.scripts = await opt.scripts(pkg.scripts || {});\n\t\t} catch {\n\t\t\treturn ctx;\n\t\t}\n\t\tawait ctx.fs.writeFile(\"./package.json\", stringify(pkg));\n\t\treturn ctx;\n\t};\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CliStep } from "../utils.js";
|
|
2
|
+
import type { Logger } from "../../services/logger/index.js";
|
|
3
|
+
export declare const maybeUpdateTsConfig: CliStep<{
|
|
4
|
+
fs: typeof import("node:fs/promises");
|
|
5
|
+
logger: Logger;
|
|
6
|
+
}, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Paraligde JS compiles to JS with JSDoc comments. TypeScript doesn't allow JS files by default.
|
|
9
|
+
*/
|
|
10
|
+
export declare const maybeUpdateTsConfigAllowJs: CliStep<{
|
|
11
|
+
fs: typeof import("node:fs/promises");
|
|
12
|
+
logger: Logger;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Recursively checks whether allowJs is enabled in the provided tsconfig or any
|
|
16
|
+
* referenced configuration files.
|
|
17
|
+
*
|
|
18
|
+
* @param tsconfigPath The path to the tsconfig to inspect.
|
|
19
|
+
* @param fs The file system used to read the configs.
|
|
20
|
+
* @param visited A set of already inspected files to avoid circular lookups.
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* await hasAllowJsEnabled("./tsconfig.json", fs);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const hasAllowJsEnabled: (tsconfigPath: string, fs: typeof import("node:fs/promises"), visited?: Set<string>) => Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-ts-config.d.ts","sourceRoot":"","sources":["../../../src/cli/steps/update-ts-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAS7D,eAAO,MAAM,mBAAmB,EAAE,OAAO,CACxC;IAAE,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACzD,OAAO,CAKP,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAC/C;IAAE,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACzD,OAAO,CA6CP,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,iBACf,MAAM,MAChB,cAAc,kBAAkB,CAAC,YAC5B,GAAG,CAAC,MAAM,CAAC,KAClB,OAAO,CAAC,OAAO,CA4CjB,CAAC"}
|