diff --git a/.changeset/mighty-brooms-leave.md b/.changeset/mighty-brooms-leave.md new file mode 100644 index 0000000000..2bf55b745b --- /dev/null +++ b/.changeset/mighty-brooms-leave.md @@ -0,0 +1,6 @@ +--- +"@inlang/paraglide-js-adapter-unplugin": patch +"@inlang/paraglide-js": patch +--- + +fix `openRepository` crash in non-git environments diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/README.md b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/README.md index 218b14518c..aa181bbd43 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/README.md +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/README.md @@ -313,6 +313,7 @@ export async function load({ depends }) { 1. Links in the same Layout Component as `` will not be translated. This will also log a warngin in development. 2. Messages are not reactive. Don't use them in server-side module scope. +3. Sideeffects triggered by `data` will run on language changes even if the data didn't change. If the data is language-dependent the sideeffect will run twice. ### Using messages in `+layout.svelte` diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-unplugin/src/index.ts b/inlang/source-code/paraglide/paraglide-js-adapter-unplugin/src/index.ts index 4ca1cba8c3..e576933b84 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-unplugin/src/index.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-unplugin/src/index.ts @@ -64,7 +64,7 @@ export const paraglide = createUnplugin((config: UserConfig) => { const repoRoot = await findRepoRoot({ nodeishFs: fs, path: projectPath }) - const repo = await openRepository(repoRoot || process.cwd(), { + const repo = await openRepository(repoRoot || "file://" + process.cwd(), { nodeishFs: fs, }) diff --git a/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init.ts b/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init.ts index 35b557da1c..20f9655bbc 100644 --- a/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init.ts +++ b/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init.ts @@ -44,7 +44,7 @@ export const initCommand = new Command() // We are risking that there is no git repo. As long as we only use FS features and no Git features // from the SDK we should be fine. // Basic operations like `loadProject` should always work without a repo since it's used in CI. - const repo = await openRepository(repoRoot ?? process.cwd(), { + const repo = await openRepository(repoRoot ?? "file://" + process.cwd(), { nodeishFs: nodeFsPromises, })