lingo.dev 0.102.1 → 0.102.2

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/build/cli.cjs CHANGED
@@ -1217,10 +1217,16 @@ function extractPathPatterns(sourceLocale, include, exclude) {
1217
1217
  );
1218
1218
  return result;
1219
1219
  }
1220
+ function normalizePath(filepath) {
1221
+ const normalized = path12.default.normalize(filepath);
1222
+ return process.platform === "win32" ? normalized.toLowerCase() : normalized;
1223
+ }
1220
1224
  function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
1221
1225
  const absolutePathPattern = path12.default.resolve(_pathPattern);
1222
- const pathPattern = path12.default.relative(process.cwd(), absolutePathPattern);
1223
- if (path12.default.relative(process.cwd(), pathPattern).startsWith("..")) {
1226
+ const pathPattern = normalizePath(
1227
+ path12.default.relative(process.cwd(), absolutePathPattern)
1228
+ );
1229
+ if (pathPattern.startsWith("..")) {
1224
1230
  throw new CLIError({
1225
1231
  message: `Invalid path pattern: ${pathPattern}. Path pattern must be within the current working directory.`,
1226
1232
  docUrl: "invalidPathPattern"
@@ -1243,9 +1249,18 @@ function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
1243
1249
  []
1244
1250
  );
1245
1251
  const sourcePathPattern = pathPattern.replaceAll(/\[locale\]/g, sourceLocale);
1246
- const sourcePaths = _glob2.glob.sync(sourcePathPattern, { follow: true, withFileTypes: true }).filter((file) => file.isFile() || file.isSymbolicLink()).map((file) => file.fullpath()).map((fullpath) => path12.default.relative(process.cwd(), fullpath));
1252
+ const unixStylePattern = sourcePathPattern.replace(/\\/g, "/");
1253
+ const sourcePaths = _glob2.glob.sync(unixStylePattern, {
1254
+ follow: true,
1255
+ withFileTypes: true,
1256
+ windowsPathsNoEscape: true
1257
+ // Windows path support
1258
+ }).filter((file) => file.isFile() || file.isSymbolicLink()).map((file) => file.fullpath()).map((fullpath) => normalizePath(path12.default.relative(process.cwd(), fullpath)));
1247
1259
  const placeholderedPaths = sourcePaths.map((sourcePath) => {
1248
- const sourcePathChunks = sourcePath.split(path12.default.sep);
1260
+ const normalizedSourcePath = normalizePath(
1261
+ sourcePath.replace(/\//g, path12.default.sep)
1262
+ );
1263
+ const sourcePathChunks = normalizedSourcePath.split(path12.default.sep);
1249
1264
  localeSegmentIndexes.forEach((localeSegmentIndex) => {
1250
1265
  const pathPatternChunk = pathPatternChunks[localeSegmentIndex];
1251
1266
  const sourcePathChunk = sourcePathChunks[localeSegmentIndex];
@@ -9902,7 +9917,7 @@ async function renderHero2() {
9902
9917
  // package.json
9903
9918
  var package_default = {
9904
9919
  name: "lingo.dev",
9905
- version: "0.102.1",
9920
+ version: "0.102.2",
9906
9921
  description: "Lingo.dev CLI",
9907
9922
  private: false,
9908
9923
  publishConfig: {