lingo.dev 0.102.0 → 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 +23 -5
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +23 -5
- package/build/cli.mjs.map +1 -1
- package/package.json +1 -1
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 =
|
|
1223
|
-
|
|
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
|
|
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
|
|
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];
|
|
@@ -8258,6 +8273,9 @@ function createWorkerTask(args) {
|
|
|
8258
8273
|
)])
|
|
8259
8274
|
).fromPairs().value();
|
|
8260
8275
|
if (!Object.keys(processableData).length) {
|
|
8276
|
+
await args.ioLimiter(async () => {
|
|
8277
|
+
await bucketLoader.push(assignedTask.targetLocale, targetData);
|
|
8278
|
+
});
|
|
8261
8279
|
return { status: "skipped" };
|
|
8262
8280
|
}
|
|
8263
8281
|
const processedTargetData = await args.ctx.localizer.localize(
|
|
@@ -9899,7 +9917,7 @@ async function renderHero2() {
|
|
|
9899
9917
|
// package.json
|
|
9900
9918
|
var package_default = {
|
|
9901
9919
|
name: "lingo.dev",
|
|
9902
|
-
version: "0.102.
|
|
9920
|
+
version: "0.102.2",
|
|
9903
9921
|
description: "Lingo.dev CLI",
|
|
9904
9922
|
private: false,
|
|
9905
9923
|
publishConfig: {
|