@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,43 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
export function getLocalAccount(args) {
|
|
4
|
+
try {
|
|
5
|
+
const accountPath = getAccountFilePath();
|
|
6
|
+
if (!args.fs.existsSync(accountPath)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
return JSON.parse(args.fs.readFileSync(accountPath, "utf8"));
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function saveLocalAccount(args) {
|
|
16
|
+
try {
|
|
17
|
+
const accountPath = getAccountFilePath();
|
|
18
|
+
args.fs.mkdirSync(path.dirname(accountPath), { recursive: true });
|
|
19
|
+
args.fs.writeFileSync(accountPath, JSON.stringify(args.account, null, 2));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// do nothing
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the path to the local account file.
|
|
27
|
+
*
|
|
28
|
+
* Based on the env-paths package https://github.com/sindresorhus/env-paths/blob/main/index.js
|
|
29
|
+
*/
|
|
30
|
+
export function getAccountFilePath() {
|
|
31
|
+
const homedir = os.homedir();
|
|
32
|
+
if (process.platform === "darwin") {
|
|
33
|
+
return path.join(homedir, "Library", "Application Support", "lix", "account.json");
|
|
34
|
+
}
|
|
35
|
+
else if (process.platform === "win32") {
|
|
36
|
+
return path.join(homedir, "AppData", "Roaming", "lix", "account.json");
|
|
37
|
+
}
|
|
38
|
+
// linux
|
|
39
|
+
else {
|
|
40
|
+
return path.join(homedir, ".local", "share", "lix", "account.json");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,MAAM,UAAU,eAAe,CAAC,IAE/B;IACA,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;QAEzC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACtC,OAAO;QACR,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO;IACR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAGhC;IACA,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACR,aAAa;IACd,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IACjC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAE7B,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,IAAI,CACf,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,KAAK,EACL,cAAc,CACd,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACxE,CAAC;IACD,QAAQ;SACH,CAAC;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACrE,CAAC;AACF,CAAC","sourcesContent":["import path from \"node:path\";\nimport os from \"node:os\";\nimport type { Account } from \"./types.js\";\n\nexport function getLocalAccount(args: {\n\tfs: typeof import(\"node:fs\");\n}): Account | undefined {\n\ttry {\n\t\tconst accountPath = getAccountFilePath();\n\n\t\tif (!args.fs.existsSync(accountPath)) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn JSON.parse(args.fs.readFileSync(accountPath, \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\n\nexport function saveLocalAccount(args: {\n\tfs: typeof import(\"node:fs\");\n\taccount: Account;\n}): void {\n\ttry {\n\t\tconst accountPath = getAccountFilePath();\n\t\targs.fs.mkdirSync(path.dirname(accountPath), { recursive: true });\n\t\targs.fs.writeFileSync(accountPath, JSON.stringify(args.account, null, 2));\n\t} catch {\n\t\t// do nothing\n\t}\n}\n\n/**\n * Returns the path to the local account file.\n *\n * Based on the env-paths package https://github.com/sindresorhus/env-paths/blob/main/index.js\n */\nexport function getAccountFilePath() {\n\tconst homedir = os.homedir();\n\n\tif (process.platform === \"darwin\") {\n\t\treturn path.join(\n\t\t\thomedir,\n\t\t\t\"Library\",\n\t\t\t\"Application Support\",\n\t\t\t\"lix\",\n\t\t\t\"account.json\"\n\t\t);\n\t} else if (process.platform === \"win32\") {\n\t\treturn path.join(homedir, \"AppData\", \"Roaming\", \"lix\", \"account.json\");\n\t}\n\t// linux\n\telse {\n\t\treturn path.join(homedir, \".local\", \"share\", \"lix\", \"account.json\");\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/account/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/account/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Account = {\n\tid: string;\n\tname: string;\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes some Text so that it can safely be used inside a template literal.
|
|
3
|
+
*/
|
|
4
|
+
export declare function escapeForTemplateLiteral(text: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Escapes some Text so that it can safely be used inside a single quote string.s
|
|
7
|
+
*/
|
|
8
|
+
export declare function escapeForSingleQuoteString(text: string): string;
|
|
9
|
+
export declare function escapeForDoubleQuoteString(text: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../../src/services/codegen/escape.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes some Text so that it can safely be used inside a template literal.
|
|
3
|
+
*/
|
|
4
|
+
export function escapeForTemplateLiteral(text) {
|
|
5
|
+
return text
|
|
6
|
+
.replace(/\\/g, "\\\\")
|
|
7
|
+
.replace(/`/g, "\\`")
|
|
8
|
+
.replace(/\${/g, "\\${");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Escapes some Text so that it can safely be used inside a single quote string.s
|
|
12
|
+
*/
|
|
13
|
+
export function escapeForSingleQuoteString(text) {
|
|
14
|
+
return text.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
15
|
+
}
|
|
16
|
+
export function escapeForDoubleQuoteString(text) {
|
|
17
|
+
return text.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=escape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../../src/services/codegen/escape.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACpD,OAAO,IAAI;SACT,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACtD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACtD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/**\n * Escapes some Text so that it can safely be used inside a template literal.\n */\nexport function escapeForTemplateLiteral(text: string): string {\n\treturn text\n\t\t.replace(/\\\\/g, \"\\\\\\\\\")\n\t\t.replace(/`/g, \"\\\\`\")\n\t\t.replace(/\\${/g, \"\\\\${\");\n}\n\n/**\n * Escapes some Text so that it can safely be used inside a single quote string.s\n */\nexport function escapeForSingleQuoteString(text: string): string {\n\treturn text.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\");\n}\n\nexport function escapeForDoubleQuoteString(text: string): string {\n\treturn text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"');\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../src/services/codegen/quotes.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,WAAW,QAAS,MAAM,WAAoC,CAAC;AAC5E,yCAAyC;AACzC,eAAO,MAAM,QAAQ,QAAS,MAAM,WAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../../src/services/codegen/quotes.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;AAC5E,yCAAyC;AACzC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC","sourcesContent":["/** Wrap the given string in double quotes */\nexport const doubleQuote = (str: string) => `\"${str.replace(/\"/g, '\\\\\"')}\"`;\n/** Wrap the given string in backticks */\nexport const backtick = (str: string) => `\\`${str}\\``;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-index-file.d.ts","sourceRoot":"","sources":["../../../src/services/env-variables/create-index-file.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This script writes public environment variables
|
|
3
|
+
* to an importable env file.
|
|
4
|
+
*
|
|
5
|
+
* - The SDK must bundle this file with the rest of the SDK
|
|
6
|
+
* - This scripts avoids the need for a bundler
|
|
7
|
+
* - Must be ran before building the SDK
|
|
8
|
+
*/
|
|
9
|
+
import fs from "node:fs/promises";
|
|
10
|
+
import url from "node:url";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
13
|
+
const packageJson = JSON.parse(await fs.readFile(path.resolve(dirname, "../../../package.json"), "utf-8"));
|
|
14
|
+
await fs.writeFile(dirname + "/index.ts", `
|
|
15
|
+
export const ENV_VARIABLES = {
|
|
16
|
+
PARJS_PACKAGE_VERSION: ${ifDefined(packageJson.version)},
|
|
17
|
+
}
|
|
18
|
+
`);
|
|
19
|
+
// console.log("✅ Created env variable index file.");
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param {string | undefined} value
|
|
23
|
+
* @returns {string | undefined}
|
|
24
|
+
*/
|
|
25
|
+
function ifDefined(value) {
|
|
26
|
+
return value ? `"${value}"` : undefined;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=create-index-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-index-file.js","sourceRoot":"","sources":["../../../src/services/env-variables/create-index-file.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC7B,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,uBAAuB,CAAC,EAAE,OAAO,CAAC,CAC1E,CAAC;AAEF,MAAM,EAAE,CAAC,SAAS,CACjB,OAAO,GAAG,WAAW,EACrB;;0BAEyB,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;CAEvD,CACA,CAAC;AAEF,qDAAqD;AAErD;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAK;IACvB,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACzC,CAAC","sourcesContent":["/**\n * This script writes public environment variables\n * to an importable env file.\n *\n * - The SDK must bundle this file with the rest of the SDK\n * - This scripts avoids the need for a bundler\n * - Must be ran before building the SDK\n */\n\nimport fs from \"node:fs/promises\";\nimport url from \"node:url\";\nimport path from \"node:path\";\n\nconst dirname = path.dirname(url.fileURLToPath(import.meta.url));\n\nconst packageJson = JSON.parse(\n\tawait fs.readFile(path.resolve(dirname, \"../../../package.json\"), \"utf-8\")\n);\n\nawait fs.writeFile(\n\tdirname + \"/index.ts\",\n\t`\nexport const ENV_VARIABLES = {\n\tPARJS_PACKAGE_VERSION: ${ifDefined(packageJson.version)},\n}\n`\n);\n\n// console.log(\"✅ Created env variable index file.\");\n\n/**\n *\n * @param {string | undefined} value\n * @returns {string | undefined}\n */\nfunction ifDefined(value) {\n\treturn value ? `\"${value}\"` : undefined;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/env-variables/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;IACzB,qBAAqB;CACrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/env-variables/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,qBAAqB,EAAE,OAAO;CAC9B,CAAA","sourcesContent":["\nexport const ENV_VARIABLES = {\n\tPARJS_PACKAGE_VERSION: \"0.1.0\",\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attempts to find the package.json file that's closest to the current working directory.
|
|
3
|
+
*
|
|
4
|
+
* @param fs The filesystem to use.
|
|
5
|
+
* @param cwd The current working directory.
|
|
6
|
+
* @returns The path to the package.json file, or undefined if none was found.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findPackageJson(fs: typeof import("node:fs/promises"), cwd: string): Promise<string | undefined>;
|
|
9
|
+
export declare function getPackageJson(fs: typeof import("node:fs/promises"), cwd: string): Promise<unknown | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../../src/services/environment/package.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,EAAE,EAAE,cAAc,kBAAkB,CAAC,EACrC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B;AAED,wBAAsB,cAAc,CACnC,EAAE,EAAE,cAAc,kBAAkB,CAAC,EACrC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAW9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathExists } from "../file-handling/exists.js";
|
|
3
|
+
/**
|
|
4
|
+
* Attempts to find the package.json file that's closest to the current working directory.
|
|
5
|
+
*
|
|
6
|
+
* @param fs The filesystem to use.
|
|
7
|
+
* @param cwd The current working directory.
|
|
8
|
+
* @returns The path to the package.json file, or undefined if none was found.
|
|
9
|
+
*/
|
|
10
|
+
export async function findPackageJson(fs, cwd) {
|
|
11
|
+
const potentialPackageJsonPath = path.resolve(cwd, "package.json");
|
|
12
|
+
const packageJsonExists = await pathExists(potentialPackageJsonPath, fs);
|
|
13
|
+
if (packageJsonExists)
|
|
14
|
+
return potentialPackageJsonPath;
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
export async function getPackageJson(fs, cwd) {
|
|
18
|
+
const packageJsonPath = await findPackageJson(fs, cwd);
|
|
19
|
+
if (!packageJsonPath)
|
|
20
|
+
return undefined;
|
|
21
|
+
try {
|
|
22
|
+
const packageJsonContents = await fs.readFile(packageJsonPath, {
|
|
23
|
+
encoding: "utf-8",
|
|
24
|
+
});
|
|
25
|
+
return JSON.parse(packageJsonContents);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../../src/services/environment/package.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,EAAqC,EACrC,GAAW;IAEX,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACnE,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACzE,IAAI,iBAAiB;QAAE,OAAO,wBAAwB,CAAC;IACvD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,EAAqC,EACrC,GAAW;IAEX,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACvD,IAAI,CAAC,eAAe;QAAE,OAAO,SAAS,CAAC;IACvC,IAAI,CAAC;QACJ,MAAM,mBAAmB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC9D,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC","sourcesContent":["import path from \"node:path\";\nimport { pathExists } from \"../file-handling/exists.js\";\n\n/**\n * Attempts to find the package.json file that's closest to the current working directory.\n *\n * @param fs The filesystem to use.\n * @param cwd The current working directory.\n * @returns The path to the package.json file, or undefined if none was found.\n */\nexport async function findPackageJson(\n\tfs: typeof import(\"node:fs/promises\"),\n\tcwd: string\n): Promise<string | undefined> {\n\tconst potentialPackageJsonPath = path.resolve(cwd, \"package.json\");\n\tconst packageJsonExists = await pathExists(potentialPackageJsonPath, fs);\n\tif (packageJsonExists) return potentialPackageJsonPath;\n\treturn undefined;\n}\n\nexport async function getPackageJson(\n\tfs: typeof import(\"node:fs/promises\"),\n\tcwd: string\n): Promise<unknown | undefined> {\n\tconst packageJsonPath = await findPackageJson(fs, cwd);\n\tif (!packageJsonPath) return undefined;\n\ttry {\n\t\tconst packageJsonContents = await fs.readFile(packageJsonPath, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t\treturn JSON.parse(packageJsonContents);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.test.d.ts","sourceRoot":"","sources":["../../../src/services/environment/package.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import memfs from "memfs";
|
|
3
|
+
import { findPackageJson } from "./package.js";
|
|
4
|
+
describe("findPackageJson", () => {
|
|
5
|
+
it("returns the path to the package.json file if it exists", async () => {
|
|
6
|
+
const fs = memfs.createFsFromVolume(memfs.Volume.fromNestedJSON({
|
|
7
|
+
"/package.json": JSON.stringify({
|
|
8
|
+
name: "test",
|
|
9
|
+
}),
|
|
10
|
+
})).promises;
|
|
11
|
+
const result = await findPackageJson(fs, "/");
|
|
12
|
+
expect(result).toBe("/package.json");
|
|
13
|
+
});
|
|
14
|
+
it("returns undefined if no package.json file exists", async () => {
|
|
15
|
+
const fs = memfs.createFsFromVolume(memfs.Volume.fromNestedJSON({}))
|
|
16
|
+
.promises;
|
|
17
|
+
const result = await findPackageJson(fs, "/");
|
|
18
|
+
expect(result).toBe(undefined);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=package.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.test.js","sourceRoot":"","sources":["../../../src/services/environment/package.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAClC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YAC3B,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC/B,IAAI,EAAE,MAAM;aACZ,CAAC;SACF,CAAC,CACF,CAAC,QAAwD,CAAC;QAC3D,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;aAClE,QAAwD,CAAC;QAE3D,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport memfs from \"memfs\";\nimport { findPackageJson } from \"./package.js\";\n\ndescribe(\"findPackageJson\", () => {\n\tit(\"returns the path to the package.json file if it exists\", async () => {\n\t\tconst fs = memfs.createFsFromVolume(\n\t\t\tmemfs.Volume.fromNestedJSON({\n\t\t\t\t\"/package.json\": JSON.stringify({\n\t\t\t\t\tname: \"test\",\n\t\t\t\t}),\n\t\t\t})\n\t\t).promises as unknown as typeof import(\"node:fs/promises\");\n\t\tconst result = await findPackageJson(fs, \"/\");\n\t\texpect(result).toBe(\"/package.json\");\n\t});\n\n\tit(\"returns undefined if no package.json file exists\", async () => {\n\t\tconst fs = memfs.createFsFromVolume(memfs.Volume.fromNestedJSON({}))\n\t\t\t.promises as unknown as typeof import(\"node:fs/promises\");\n\n\t\tconst result = await findPackageJson(fs, \"/\");\n\t\texpect(result).toBe(undefined);\n\t});\n});\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class PluginError extends Error {
|
|
2
|
+
plugin: string;
|
|
3
|
+
constructor(message: string, plugin: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function classifyProjectErrors(errors: readonly Error[]): {
|
|
6
|
+
fatalErrors: Error[];
|
|
7
|
+
nonFatalErrors: PluginError[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Splits an array into two arrays based on the predicate
|
|
11
|
+
*/
|
|
12
|
+
export declare function split<T, U extends T>(array: T[], predicate: (value: T) => value is U): [U[], T[]];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../src/services/error-handling.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;IACrC,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAI1C;CACD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE;;;EAiB7D;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,GACjC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAKZ"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class PluginError extends Error {
|
|
2
|
+
plugin;
|
|
3
|
+
constructor(message, plugin) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "PluginError";
|
|
6
|
+
this.plugin = plugin;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function classifyProjectErrors(errors) {
|
|
10
|
+
const isModuleError = (err) => err instanceof PluginError;
|
|
11
|
+
const [moduleErrors, otherErrors] = split(errors, isModuleError);
|
|
12
|
+
const isFatalModuleError = (err) => err.plugin.includes("plugin");
|
|
13
|
+
const [fatalModuleErrors, nonFatalModuleErrors] = split(moduleErrors, isFatalModuleError);
|
|
14
|
+
const fatalErrors = [...fatalModuleErrors, ...otherErrors];
|
|
15
|
+
const nonFatalErrors = [...nonFatalModuleErrors];
|
|
16
|
+
return { fatalErrors, nonFatalErrors };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Splits an array into two arrays based on the predicate
|
|
20
|
+
*/
|
|
21
|
+
export function split(array, predicate) {
|
|
22
|
+
const mask = array.map(predicate);
|
|
23
|
+
const result = array.filter((_, index) => mask[index]);
|
|
24
|
+
const rest = array.filter((_, index) => !mask[index]);
|
|
25
|
+
return [result, rest];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=error-handling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.js","sourceRoot":"","sources":["../../src/services/error-handling.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IACrC,MAAM,CAAS;IAEf,YAAY,OAAe,EAAE,MAAc;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAwB;IAC7D,MAAM,aAAa,GAAG,CAAC,GAAU,EAAsB,EAAE,CACxD,GAAG,YAAY,WAAW,CAAC;IAE5B,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,MAAiB,EAAE,aAAa,CAAC,CAAC;IAE5E,MAAM,kBAAkB,GAAG,CAAC,GAAgB,EAAsB,EAAE,CACnE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CACtD,YAAY,EACZ,kBAAkB,CAClB,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,GAAG,iBAAiB,EAAE,GAAG,WAAW,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC;IAEjD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CACpB,KAAU,EACV,SAAmC;IAEnC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAQ,CAAC;IAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAQ,CAAC;IAC7D,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACvB,CAAC","sourcesContent":["export class PluginError extends Error {\n\tplugin: string;\n\n\tconstructor(message: string, plugin: string) {\n\t\tsuper(message);\n\t\tthis.name = \"PluginError\";\n\t\tthis.plugin = plugin;\n\t}\n}\n\nexport function classifyProjectErrors(errors: readonly Error[]) {\n\tconst isModuleError = (err: Error): err is PluginError =>\n\t\terr instanceof PluginError;\n\n\tconst [moduleErrors, otherErrors] = split(errors as Error[], isModuleError);\n\n\tconst isFatalModuleError = (err: PluginError): err is PluginError =>\n\t\terr.plugin.includes(\"plugin\");\n\tconst [fatalModuleErrors, nonFatalModuleErrors] = split(\n\t\tmoduleErrors,\n\t\tisFatalModuleError\n\t);\n\n\tconst fatalErrors = [...fatalModuleErrors, ...otherErrors];\n\tconst nonFatalErrors = [...nonFatalModuleErrors];\n\n\treturn { fatalErrors, nonFatalErrors };\n}\n\n/**\n * Splits an array into two arrays based on the predicate\n */\nexport function split<T, U extends T>(\n\tarray: T[],\n\tpredicate: (value: T) => value is U\n): [U[], T[]] {\n\tconst mask = array.map(predicate);\n\tconst result = array.filter((_, index) => mask[index]) as U[];\n\tconst rest = array.filter((_, index) => !mask[index]) as T[];\n\treturn [result, rest];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.test.d.ts","sourceRoot":"","sources":["../../src/services/error-handling.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { it, expect } from "vitest";
|
|
2
|
+
import { split } from "./error-handling.js";
|
|
3
|
+
it("splits an array", () => {
|
|
4
|
+
const isEven = (n) => n % 2 === 0;
|
|
5
|
+
const arr = [1, 2, 3, 4, 5, 6];
|
|
6
|
+
const [even, odd] = split(arr, isEven);
|
|
7
|
+
expect(even).toEqual([2, 4, 6]);
|
|
8
|
+
expect(odd).toEqual([1, 3, 5]);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=error-handling.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.test.js","sourceRoot":"","sources":["../../src/services/error-handling.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAe,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAEvC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC","sourcesContent":["import { it, expect } from \"vitest\";\nimport { split } from \"./error-handling.js\";\n\nit(\"splits an array\", () => {\n\tconst isEven = (n: number): n is number => n % 2 === 0;\n\tconst arr = [1, 2, 3, 4, 5, 6];\n\tconst [even, odd] = split(arr, isEven);\n\n\texpect(even).toEqual([2, 4, 6]);\n\texpect(odd).toEqual([1, 3, 5]);\n});\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync content hash for change detection (not cryptographic use).
|
|
3
|
+
* SHA-1 is plenty for "did this output string change?" comparisons.
|
|
4
|
+
*/
|
|
5
|
+
export declare function hashContent(input: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Hash every output file in a sync loop (no per-file await).
|
|
8
|
+
*/
|
|
9
|
+
export declare function hashOutputContents(output: Record<string, string>, combine: (filePath: string, fileContent: string) => string): Record<string, string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Sync content hash for change detection (not cryptographic use).
|
|
4
|
+
* SHA-1 is plenty for "did this output string change?" comparisons.
|
|
5
|
+
*/
|
|
6
|
+
export function hashContent(input) {
|
|
7
|
+
return createHash("sha1").update(input).digest("hex");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hash every output file in a sync loop (no per-file await).
|
|
11
|
+
*/
|
|
12
|
+
export function hashOutputContents(output, combine) {
|
|
13
|
+
const hashes = {};
|
|
14
|
+
for (const [filePath, fileContent] of Object.entries(output)) {
|
|
15
|
+
hashes[filePath] = hashContent(combine(filePath, fileContent));
|
|
16
|
+
}
|
|
17
|
+
return hashes;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=content-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-hash.js","sourceRoot":"","sources":["../../../src/services/file-handling/content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAA8B,EAC9B,OAA0D;IAE1D,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\n\n/**\n * Sync content hash for change detection (not cryptographic use).\n * SHA-1 is plenty for \"did this output string change?\" comparisons.\n */\nexport function hashContent(input: string): string {\n\treturn createHash(\"sha1\").update(input).digest(\"hex\");\n}\n\n/**\n * Hash every output file in a sync loop (no per-file await).\n */\nexport function hashOutputContents(\n\toutput: Record<string, string>,\n\tcombine: (filePath: string, fileContent: string) => string\n): Record<string, string> {\n\tconst hashes: Record<string, string> = {};\n\tfor (const [filePath, fileContent] of Object.entries(output)) {\n\t\thashes[filePath] = hashContent(combine(filePath, fileContent));\n\t}\n\treturn hashes;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../src/services/file-handling/exists.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAsB,UAAU,CAC/B,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,cAAc,kBAAkB,CAAC,oBAerC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the path exists (file or directory), false otherwise.
|
|
3
|
+
*
|
|
4
|
+
* @param nodeishFs
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export async function pathExists(filePath, fs) {
|
|
8
|
+
try {
|
|
9
|
+
await fs.stat(filePath);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
//@ts-expect-error - error is Error
|
|
14
|
+
if (error.code === "ENOENT") {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
throw new Error(`Failed to check if path exists: ${error}`, {
|
|
19
|
+
cause: error,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=exists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.js","sourceRoot":"","sources":["../../../src/services/file-handling/exists.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,QAAgB,EAChB,EAAqC;IAErC,IAAI,CAAC;QACJ,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,mCAAmC;QACnC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACd,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,EAAE;gBAC3D,KAAK,EAAE,KAAK;aACZ,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/**\n * Returns true if the path exists (file or directory), false otherwise.\n *\n * @param nodeishFs\n * @returns\n */\nexport async function pathExists(\n\tfilePath: string,\n\tfs: typeof import(\"node:fs/promises\")\n) {\n\ttry {\n\t\tawait fs.stat(filePath);\n\t\treturn true;\n\t} catch (error) {\n\t\t//@ts-expect-error - error is Error\n\t\tif (error.code === \"ENOENT\") {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tthrow new Error(`Failed to check if path exists: ${error}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.test.d.ts","sourceRoot":"","sources":["../../../src/services/file-handling/exists.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { pathExists } from "./exists.js";
|
|
3
|
+
import memfs from "memfs";
|
|
4
|
+
describe("fileExists", () => {
|
|
5
|
+
it("returns true if the file does exist", async () => {
|
|
6
|
+
const fs = memfs.Volume.fromNestedJSON({
|
|
7
|
+
"/test.txt": "hello",
|
|
8
|
+
}).promises;
|
|
9
|
+
const result = await pathExists("/test.txt", fs);
|
|
10
|
+
expect(result).toBe(true);
|
|
11
|
+
});
|
|
12
|
+
it("returns false if the file does not exist", async () => {
|
|
13
|
+
const fs = memfs.Volume.fromNestedJSON({
|
|
14
|
+
"/test.txt": "hello",
|
|
15
|
+
}).promises;
|
|
16
|
+
const result = await pathExists("/does-not-exist.txt", fs);
|
|
17
|
+
expect(result).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
it("returns true if the path is a directory", async () => {
|
|
20
|
+
const fs = memfs.Volume.fromNestedJSON({
|
|
21
|
+
"/test/test.txt": "Hello",
|
|
22
|
+
}).promises;
|
|
23
|
+
const result = await pathExists("/test", fs);
|
|
24
|
+
expect(result).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=exists.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.test.js","sourceRoot":"","sources":["../../../src/services/file-handling/exists.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YACtC,WAAW,EAAE,OAAO;SACpB,CAAC,CAAC,QAAwD,CAAC;QAE5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YACtC,WAAW,EAAE,OAAO;SACpB,CAAC,CAAC,QAAwD,CAAC;QAE5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;QAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YACtC,gBAAgB,EAAE,OAAO;SACzB,CAAC,CAAC,QAAwD,CAAC;QAE5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { pathExists } from \"./exists.js\";\nimport memfs from \"memfs\";\n\ndescribe(\"fileExists\", () => {\n\tit(\"returns true if the file does exist\", async () => {\n\t\tconst fs = memfs.Volume.fromNestedJSON({\n\t\t\t\"/test.txt\": \"hello\",\n\t\t}).promises as unknown as typeof import(\"node:fs/promises\");\n\n\t\tconst result = await pathExists(\"/test.txt\", fs);\n\t\texpect(result).toBe(true);\n\t});\n\n\tit(\"returns false if the file does not exist\", async () => {\n\t\tconst fs = memfs.Volume.fromNestedJSON({\n\t\t\t\"/test.txt\": \"hello\",\n\t\t}).promises as unknown as typeof import(\"node:fs/promises\");\n\n\t\tconst result = await pathExists(\"/does-not-exist.txt\", fs);\n\t\texpect(result).toBe(false);\n\t});\n\n\tit(\"returns true if the path is a directory\", async () => {\n\t\tconst fs = memfs.Volume.fromNestedJSON({\n\t\t\t\"/test/test.txt\": \"Hello\",\n\t\t}).promises as unknown as typeof import(\"node:fs/promises\");\n\n\t\tconst result = await pathExists(\"/test\", fs);\n\t\texpect(result).toBe(true);\n\t});\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/file-handling/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/file-handling/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @deprecated Node fs can be used directly\n */\nexport type NodeishFilesystem = typeof import(\"node:fs/promises\");\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type nodeFs from "node:fs/promises";
|
|
2
|
+
export declare function writeOutput(args: {
|
|
3
|
+
directory: string;
|
|
4
|
+
output: Record<string, string>;
|
|
5
|
+
cleanDirectory?: boolean;
|
|
6
|
+
fs: typeof nodeFs;
|
|
7
|
+
previousOutputHashes?: Record<string, string>;
|
|
8
|
+
}): Promise<Record<string, string>>;
|
|
9
|
+
/**
|
|
10
|
+
* Walk an existing output directory and produce the same hash map that
|
|
11
|
+
* {@link writeOutput} would have returned on a previous compile.
|
|
12
|
+
*
|
|
13
|
+
* Used by the bundler plugins to seed `previousCompilation` on a fresh
|
|
14
|
+
* process so the first compile's diff against unchanged inputs is empty
|
|
15
|
+
* and `writeOutput` short-circuits — letting us avoid wiping the directory
|
|
16
|
+
* out from under concurrent SSR/prerender readers (#659).
|
|
17
|
+
*
|
|
18
|
+
* Returns `undefined` if the directory does not exist. Keys are
|
|
19
|
+
* forward-slash relative paths to match {@link hashOutput}.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hashDirectory(directory: string, fs: typeof nodeFs): Promise<Record<string, string> | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-output.d.ts","sourceRoot":"","sources":["../../../src/services/file-handling/write-output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,EAAE,EAAE,OAAO,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C,mCA+DA;AAgFD;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAClC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,OAAO,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAwC7C"}
|