Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-windows-path-separators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"lingo.dev": patch
---

Fix CLI tests failing on Windows due to path separator differences
4 changes: 2 additions & 2 deletions packages/cli/src/cli/utils/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ function expandPlaceholderedGlob(
const placeholderedPath = sourcePathChunks.join(path.sep);
return placeholderedPath;
});
// return the placeholdered paths
return placeholderedPaths;
// return the placeholdered paths (normalized to forward slashes for cross-platform compatibility)
return placeholderedPaths.map(p => p.replace(/\\/g, "/"));
Comment on lines 175 to +179
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normalization is performed after constructing paths with path.sep, which creates platform-specific separators only to immediately replace them. Consider normalizing earlier at line 175 by using sourcePathChunks.join('/') directly instead of path.sep, which would be more efficient and avoid the redundant mapping step.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Arrow function parameter lacks proper spacing around the arrow. Should be p => p.replace (with space before arrow) for consistency with project style. This is already done correctly in the codebase elsewhere.

Copilot uses AI. Check for mistakes.
}

function resolveBucketItem(bucketItem: string | BucketItem): BucketItem {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cli/utils/find-locale-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function findLocaleFilesForFilename(fileName: string) {

const localeFilesAndPatterns = localeFiles.map((file: string) => ({
file,
pattern: path.join(path.dirname(file), pattern),
pattern: path.join(path.dirname(file), pattern).replace(/\\/g, "/"),
}));
const grouppedFilesAndPatterns = _.groupBy(localeFilesAndPatterns, "pattern");
const patterns = Object.keys(grouppedFilesAndPatterns);
Expand Down