@lang-tag/cli 0.12.2 → 0.12.4
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/algorithms/index.cjs +1 -1
- package/algorithms/index.js +1 -1
- package/index.cjs +4 -2
- package/index.js +4 -2
- package/package.json +1 -1
package/algorithms/index.cjs
CHANGED
|
@@ -54,13 +54,13 @@ function pathBasedConfigGenerator(options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
return segment;
|
|
56
56
|
}).filter((seg) => seg !== null);
|
|
57
|
+
pathSegments = applyStructuredIgnore(pathSegments, ignoreStructured);
|
|
57
58
|
if (ignoreIncludesRootDirectories && langTagConfig.includes && pathSegments.length > 0) {
|
|
58
59
|
const extractedDirectories = extractRootDirectoriesFromIncludes(langTagConfig.includes);
|
|
59
60
|
if (extractedDirectories.includes(pathSegments[0])) {
|
|
60
61
|
pathSegments = pathSegments.slice(1);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
pathSegments = applyStructuredIgnore(pathSegments, ignoreStructured);
|
|
64
64
|
pathSegments = pathSegments.filter((seg) => !ignoreDirectories.includes(seg));
|
|
65
65
|
let namespace;
|
|
66
66
|
let path$1;
|
package/algorithms/index.js
CHANGED
|
@@ -35,13 +35,13 @@ function pathBasedConfigGenerator(options = {}) {
|
|
|
35
35
|
}
|
|
36
36
|
return segment;
|
|
37
37
|
}).filter((seg) => seg !== null);
|
|
38
|
+
pathSegments = applyStructuredIgnore(pathSegments, ignoreStructured);
|
|
38
39
|
if (ignoreIncludesRootDirectories && langTagConfig.includes && pathSegments.length > 0) {
|
|
39
40
|
const extractedDirectories = extractRootDirectoriesFromIncludes(langTagConfig.includes);
|
|
40
41
|
if (extractedDirectories.includes(pathSegments[0])) {
|
|
41
42
|
pathSegments = pathSegments.slice(1);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
pathSegments = applyStructuredIgnore(pathSegments, ignoreStructured);
|
|
45
45
|
pathSegments = pathSegments.filter((seg) => !ignoreDirectories.includes(seg));
|
|
46
46
|
let namespace;
|
|
47
47
|
let path;
|
package/index.cjs
CHANGED
|
@@ -484,7 +484,8 @@ async function checkAndRegenerateFileLangTags(config, logger, file, path$12) {
|
|
|
484
484
|
if (replacements.length) {
|
|
485
485
|
const newContent = processor.replaceTags(fileContent, replacements);
|
|
486
486
|
await promises.writeFile(file, newContent, "utf-8");
|
|
487
|
-
|
|
487
|
+
const encodedFile = encodeURI(file);
|
|
488
|
+
logger.info('Lang tag configurations written for file "{path}" (file://{file}:{line})', { path: path$12, file: encodedFile, line: lastUpdatedLine });
|
|
488
489
|
return true;
|
|
489
490
|
}
|
|
490
491
|
return false;
|
|
@@ -904,7 +905,8 @@ async function logTagConflictInfo(tagInfo, prefix, conflictPath, translationArgP
|
|
|
904
905
|
console.error("Failed to colorize config:", error);
|
|
905
906
|
}
|
|
906
907
|
}
|
|
907
|
-
|
|
908
|
+
const encodedPath = encodeURI(filePath);
|
|
909
|
+
console.log(`${ANSI.gray}${prefix}${ANSI.reset} ${ANSI.cyan}file://${encodedPath}${ANSI.reset}${ANSI.gray}:${lineNum}${ANSI.reset}`);
|
|
908
910
|
printLines(colorizedWhole.split("\n"), startLine, errorLines, condense);
|
|
909
911
|
} catch (error) {
|
|
910
912
|
console.error("Error displaying conflict:", error);
|
package/index.js
CHANGED
|
@@ -464,7 +464,8 @@ async function checkAndRegenerateFileLangTags(config, logger, file, path2) {
|
|
|
464
464
|
if (replacements.length) {
|
|
465
465
|
const newContent = processor.replaceTags(fileContent, replacements);
|
|
466
466
|
await writeFile(file, newContent, "utf-8");
|
|
467
|
-
|
|
467
|
+
const encodedFile = encodeURI(file);
|
|
468
|
+
logger.info('Lang tag configurations written for file "{path}" (file://{file}:{line})', { path: path2, file: encodedFile, line: lastUpdatedLine });
|
|
468
469
|
return true;
|
|
469
470
|
}
|
|
470
471
|
return false;
|
|
@@ -884,7 +885,8 @@ async function logTagConflictInfo(tagInfo, prefix, conflictPath, translationArgP
|
|
|
884
885
|
console.error("Failed to colorize config:", error);
|
|
885
886
|
}
|
|
886
887
|
}
|
|
887
|
-
|
|
888
|
+
const encodedPath = encodeURI(filePath);
|
|
889
|
+
console.log(`${ANSI.gray}${prefix}${ANSI.reset} ${ANSI.cyan}file://${encodedPath}${ANSI.reset}${ANSI.gray}:${lineNum}${ANSI.reset}`);
|
|
888
890
|
printLines(colorizedWhole.split("\n"), startLine, errorLines, condense);
|
|
889
891
|
} catch (error) {
|
|
890
892
|
console.error("Error displaying conflict:", error);
|