lingo.dev 0.111.15 → 0.111.16
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/README.md +7 -1
- package/build/cli.cjs +180 -134
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +71 -25
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.cjs
CHANGED
|
@@ -569,26 +569,49 @@ async function pauseIfDebug(debug) {
|
|
|
569
569
|
}
|
|
570
570
|
async function renderSummary(results) {
|
|
571
571
|
console.log(_chalk2.default.hex(colors.green)("[Done]"));
|
|
572
|
-
const
|
|
572
|
+
const skippedResults = Array.from(results.values()).filter(
|
|
573
573
|
(r) => r.status === "skipped"
|
|
574
|
-
)
|
|
575
|
-
|
|
576
|
-
const succeededTasksCount = Array.from(results.values()).filter(
|
|
574
|
+
);
|
|
575
|
+
const succeededResults = Array.from(results.values()).filter(
|
|
577
576
|
(r) => r.status === "success"
|
|
578
|
-
)
|
|
579
|
-
|
|
580
|
-
const failedTasksCount = Array.from(results.values()).filter(
|
|
577
|
+
);
|
|
578
|
+
const failedResults = Array.from(results.values()).filter(
|
|
581
579
|
(r) => r.status === "error"
|
|
582
|
-
)
|
|
583
|
-
console.log(
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
580
|
+
);
|
|
581
|
+
console.log(
|
|
582
|
+
`\u2022 ${_chalk2.default.hex(colors.yellow)(skippedResults.length)} from cache`
|
|
583
|
+
);
|
|
584
|
+
console.log(
|
|
585
|
+
`\u2022 ${_chalk2.default.hex(colors.yellow)(succeededResults.length)} processed`
|
|
586
|
+
);
|
|
587
|
+
console.log(`\u2022 ${_chalk2.default.hex(colors.yellow)(failedResults.length)} failed`);
|
|
588
|
+
if (succeededResults.length > 0) {
|
|
589
|
+
console.log(_chalk2.default.hex(colors.green)("\n[Processed Files]"));
|
|
590
|
+
for (const result of succeededResults) {
|
|
591
|
+
const displayPath = _optionalChain([result, 'access', _73 => _73.pathPattern, 'optionalAccess', _74 => _74.replace, 'call', _75 => _75("[locale]", result.targetLocale)]) || "unknown";
|
|
589
592
|
console.log(
|
|
590
|
-
|
|
591
|
-
|
|
593
|
+
` \u2713 ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (skippedResults.length > 0) {
|
|
598
|
+
console.log(_chalk2.default.hex(colors.blue)("\n[Cached Files]"));
|
|
599
|
+
for (const result of skippedResults) {
|
|
600
|
+
const displayPath = _optionalChain([result, 'access', _76 => _76.pathPattern, 'optionalAccess', _77 => _77.replace, 'call', _78 => _78("[locale]", result.targetLocale)]) || "unknown";
|
|
601
|
+
console.log(
|
|
602
|
+
` \u26A1 ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (failedResults.length > 0) {
|
|
607
|
+
console.log(_chalk2.default.hex(colors.orange)("\n[Failed Files]"));
|
|
608
|
+
for (const result of failedResults) {
|
|
609
|
+
const displayPath = _optionalChain([result, 'access', _79 => _79.pathPattern, 'optionalAccess', _80 => _80.replace, 'call', _81 => _81("[locale]", result.targetLocale)]) || "unknown";
|
|
610
|
+
console.log(
|
|
611
|
+
` \u274C ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
|
|
612
|
+
);
|
|
613
|
+
console.log(
|
|
614
|
+
` ${_chalk2.default.hex(colors.white)(String(_optionalChain([result, 'access', _82 => _82.error, 'optionalAccess', _83 => _83.message]) || "Unknown error"))}`
|
|
592
615
|
);
|
|
593
616
|
}
|
|
594
617
|
}
|
|
@@ -1234,7 +1257,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
|
|
|
1234
1257
|
});
|
|
1235
1258
|
const auth2 = await newAuthenticator.whoami();
|
|
1236
1259
|
if (auth2) {
|
|
1237
|
-
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess',
|
|
1260
|
+
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _84 => _84.email])}`);
|
|
1238
1261
|
} else {
|
|
1239
1262
|
_ora2.default.call(void 0, ).fail("Authentication failed.");
|
|
1240
1263
|
}
|
|
@@ -1324,7 +1347,7 @@ function getBuckets(i18nConfig) {
|
|
|
1324
1347
|
const includeItems = bucketEntry.include.map(
|
|
1325
1348
|
(item) => resolveBucketItem(item)
|
|
1326
1349
|
);
|
|
1327
|
-
const excludeItems = _optionalChain([bucketEntry, 'access',
|
|
1350
|
+
const excludeItems = _optionalChain([bucketEntry, 'access', _85 => _85.exclude, 'optionalAccess', _86 => _86.map, 'call', _87 => _87(
|
|
1328
1351
|
(item) => resolveBucketItem(item)
|
|
1329
1352
|
)]);
|
|
1330
1353
|
const config = {
|
|
@@ -1362,7 +1385,7 @@ function extractPathPatterns(sourceLocale, include, exclude) {
|
|
|
1362
1385
|
delimiter: pattern.delimiter
|
|
1363
1386
|
}))
|
|
1364
1387
|
);
|
|
1365
|
-
const excludedPatterns = _optionalChain([exclude, 'optionalAccess',
|
|
1388
|
+
const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _88 => _88.flatMap, 'call', _89 => _89(
|
|
1366
1389
|
(pattern) => expandPlaceholderedGlob(
|
|
1367
1390
|
pattern.path,
|
|
1368
1391
|
__spec.resolveOverriddenLocale.call(void 0, sourceLocale, pattern.delimiter)
|
|
@@ -1665,12 +1688,12 @@ function composeLoaders(...loaders) {
|
|
|
1665
1688
|
return {
|
|
1666
1689
|
init: async () => {
|
|
1667
1690
|
for (const loader of loaders) {
|
|
1668
|
-
await _optionalChain([loader, 'access',
|
|
1691
|
+
await _optionalChain([loader, 'access', _90 => _90.init, 'optionalCall', _91 => _91()]);
|
|
1669
1692
|
}
|
|
1670
1693
|
},
|
|
1671
1694
|
setDefaultLocale(locale) {
|
|
1672
1695
|
for (const loader of loaders) {
|
|
1673
|
-
_optionalChain([loader, 'access',
|
|
1696
|
+
_optionalChain([loader, 'access', _92 => _92.setDefaultLocale, 'optionalCall', _93 => _93(locale)]);
|
|
1674
1697
|
}
|
|
1675
1698
|
return this;
|
|
1676
1699
|
},
|
|
@@ -1691,7 +1714,7 @@ function composeLoaders(...loaders) {
|
|
|
1691
1714
|
pullHints: async (originalInput) => {
|
|
1692
1715
|
let result = originalInput;
|
|
1693
1716
|
for (let i = 0; i < loaders.length; i++) {
|
|
1694
|
-
const subResult = await _optionalChain([loaders, 'access',
|
|
1717
|
+
const subResult = await _optionalChain([loaders, 'access', _94 => _94[i], 'access', _95 => _95.pullHints, 'optionalCall', _96 => _96(result)]);
|
|
1695
1718
|
if (subResult) {
|
|
1696
1719
|
result = subResult;
|
|
1697
1720
|
}
|
|
@@ -1713,7 +1736,7 @@ function createLoader(lDefinition) {
|
|
|
1713
1736
|
if (state.initCtx) {
|
|
1714
1737
|
return state.initCtx;
|
|
1715
1738
|
}
|
|
1716
|
-
state.initCtx = await _optionalChain([lDefinition, 'access',
|
|
1739
|
+
state.initCtx = await _optionalChain([lDefinition, 'access', _97 => _97.init, 'optionalCall', _98 => _98()]);
|
|
1717
1740
|
return state.initCtx;
|
|
1718
1741
|
},
|
|
1719
1742
|
setDefaultLocale(locale) {
|
|
@@ -1724,7 +1747,7 @@ function createLoader(lDefinition) {
|
|
|
1724
1747
|
return this;
|
|
1725
1748
|
},
|
|
1726
1749
|
async pullHints() {
|
|
1727
|
-
return _optionalChain([lDefinition, 'access',
|
|
1750
|
+
return _optionalChain([lDefinition, 'access', _99 => _99.pullHints, 'optionalCall', _100 => _100(state.originalInput)]);
|
|
1728
1751
|
},
|
|
1729
1752
|
async pull(locale, input2) {
|
|
1730
1753
|
if (!state.defaultLocale) {
|
|
@@ -2029,7 +2052,7 @@ function createNormalizeLoader() {
|
|
|
2029
2052
|
return normalized;
|
|
2030
2053
|
},
|
|
2031
2054
|
push: async (locale, data, originalInput) => {
|
|
2032
|
-
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess',
|
|
2055
|
+
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _101 => _101.keysMap]), () => ( {}));
|
|
2033
2056
|
const input2 = mapDenormalizedKeys(data, keysMap);
|
|
2034
2057
|
const denormalized = _flat.unflatten.call(void 0, input2, {
|
|
2035
2058
|
delimiter: "/",
|
|
@@ -2163,8 +2186,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
|
|
|
2163
2186
|
if (!templateData) {
|
|
2164
2187
|
templateData = await readFileForLocale(pathPattern, originalLocale);
|
|
2165
2188
|
}
|
|
2166
|
-
if (_optionalChain([templateData, 'optionalAccess',
|
|
2167
|
-
const ending = _optionalChain([templateData, 'optionalAccess',
|
|
2189
|
+
if (_optionalChain([templateData, 'optionalAccess', _102 => _102.match, 'call', _103 => _103(/[\r\n]$/)])) {
|
|
2190
|
+
const ending = _optionalChain([templateData, 'optionalAccess', _104 => _104.includes, 'call', _105 => _105("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _106 => _106.includes, 'call', _107 => _107("\r")]) ? "\r" : "\n";
|
|
2168
2191
|
return ending;
|
|
2169
2192
|
}
|
|
2170
2193
|
return "";
|
|
@@ -2435,7 +2458,7 @@ var _sync3 = require('csv-stringify/sync');
|
|
|
2435
2458
|
|
|
2436
2459
|
function detectKeyColumnName(csvString) {
|
|
2437
2460
|
const row = _sync.parse.call(void 0, csvString)[0];
|
|
2438
|
-
const firstColumn = _optionalChain([row, 'optionalAccess',
|
|
2461
|
+
const firstColumn = _optionalChain([row, 'optionalAccess', _108 => _108[0], 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]);
|
|
2439
2462
|
return firstColumn || "KEY";
|
|
2440
2463
|
}
|
|
2441
2464
|
function createCsvLoader() {
|
|
@@ -2537,7 +2560,7 @@ function createHtmlLoader() {
|
|
|
2537
2560
|
break;
|
|
2538
2561
|
}
|
|
2539
2562
|
const siblings = Array.from(parent.childNodes).filter(
|
|
2540
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
2563
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _111 => _111.textContent, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()])
|
|
2541
2564
|
);
|
|
2542
2565
|
const index = siblings.indexOf(current);
|
|
2543
2566
|
if (index !== -1) {
|
|
@@ -2573,15 +2596,15 @@ function createHtmlLoader() {
|
|
|
2573
2596
|
}
|
|
2574
2597
|
});
|
|
2575
2598
|
Array.from(element.childNodes).filter(
|
|
2576
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
2599
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _114 => _114.textContent, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()])
|
|
2577
2600
|
).forEach(processNode);
|
|
2578
2601
|
}
|
|
2579
2602
|
};
|
|
2580
2603
|
Array.from(document.head.childNodes).filter(
|
|
2581
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
2604
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _117 => _117.textContent, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()])
|
|
2582
2605
|
).forEach(processNode);
|
|
2583
2606
|
Array.from(document.body.childNodes).filter(
|
|
2584
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
2607
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _120 => _120.textContent, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()])
|
|
2585
2608
|
).forEach(processNode);
|
|
2586
2609
|
return result;
|
|
2587
2610
|
},
|
|
@@ -2606,7 +2629,7 @@ function createHtmlLoader() {
|
|
|
2606
2629
|
for (let i = 0; i < indices.length; i++) {
|
|
2607
2630
|
const index = parseInt(indices[i]);
|
|
2608
2631
|
const siblings = Array.from(parent.childNodes).filter(
|
|
2609
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
2632
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _123 => _123.textContent, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()])
|
|
2610
2633
|
);
|
|
2611
2634
|
if (index >= siblings.length) {
|
|
2612
2635
|
if (i === indices.length - 1) {
|
|
@@ -2657,7 +2680,7 @@ function createMarkdownLoader() {
|
|
|
2657
2680
|
yaml: yamlEngine
|
|
2658
2681
|
}
|
|
2659
2682
|
});
|
|
2660
|
-
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess',
|
|
2683
|
+
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]), () => ( ""))).filter(Boolean);
|
|
2661
2684
|
return {
|
|
2662
2685
|
...Object.fromEntries(
|
|
2663
2686
|
sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
|
|
@@ -2676,7 +2699,7 @@ function createMarkdownLoader() {
|
|
|
2676
2699
|
);
|
|
2677
2700
|
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
|
|
2678
2701
|
([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
|
|
2679
|
-
).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
2702
|
+
).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _128 => _128.trim, 'call', _129 => _129()]), () => ( ""))).filter(Boolean).join("\n\n");
|
|
2680
2703
|
if (Object.keys(frontmatter).length > 0) {
|
|
2681
2704
|
content = `
|
|
2682
2705
|
${content}`;
|
|
@@ -2720,7 +2743,7 @@ function isSkippableLine(line) {
|
|
|
2720
2743
|
function parsePropertyLine(line) {
|
|
2721
2744
|
const [key, ...valueParts] = line.split("=");
|
|
2722
2745
|
return {
|
|
2723
|
-
key: _optionalChain([key, 'optionalAccess',
|
|
2746
|
+
key: _optionalChain([key, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()]) || "",
|
|
2724
2747
|
value: valueParts.join("=").trim()
|
|
2725
2748
|
};
|
|
2726
2749
|
}
|
|
@@ -2808,7 +2831,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
2808
2831
|
if (rootTranslationEntity.shouldTranslate === false) {
|
|
2809
2832
|
continue;
|
|
2810
2833
|
}
|
|
2811
|
-
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess',
|
|
2834
|
+
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _132 => _132.localizations, 'optionalAccess', _133 => _133[locale]]);
|
|
2812
2835
|
if (langTranslationEntity) {
|
|
2813
2836
|
if ("stringUnit" in langTranslationEntity) {
|
|
2814
2837
|
resultData[translationKey] = langTranslationEntity.stringUnit.value;
|
|
@@ -2817,7 +2840,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
2817
2840
|
resultData[translationKey] = {};
|
|
2818
2841
|
const pluralForms = langTranslationEntity.variations.plural;
|
|
2819
2842
|
for (const form in pluralForms) {
|
|
2820
|
-
if (_optionalChain([pluralForms, 'access',
|
|
2843
|
+
if (_optionalChain([pluralForms, 'access', _134 => _134[form], 'optionalAccess', _135 => _135.stringUnit, 'optionalAccess', _136 => _136.value])) {
|
|
2821
2844
|
resultData[translationKey][form] = pluralForms[form].stringUnit.value;
|
|
2822
2845
|
}
|
|
2823
2846
|
}
|
|
@@ -2843,7 +2866,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
2843
2866
|
const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
|
|
2844
2867
|
if (typeof value === "string") {
|
|
2845
2868
|
langDataToMerge.strings[key] = {
|
|
2846
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
2869
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _137 => _137.strings, 'optionalAccess', _138 => _138[key], 'optionalAccess', _139 => _139.extractionState]),
|
|
2847
2870
|
localizations: {
|
|
2848
2871
|
[locale]: {
|
|
2849
2872
|
stringUnit: {
|
|
@@ -2901,7 +2924,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
2901
2924
|
for (const [locale, localization] of Object.entries(
|
|
2902
2925
|
entity.localizations
|
|
2903
2926
|
)) {
|
|
2904
|
-
if (_optionalChain([localization, 'access',
|
|
2927
|
+
if (_optionalChain([localization, 'access', _140 => _140.variations, 'optionalAccess', _141 => _141.plural])) {
|
|
2905
2928
|
const pluralForms = localization.variations.plural;
|
|
2906
2929
|
for (const form in pluralForms) {
|
|
2907
2930
|
const pluralKey = `${translationKey}/${form}`;
|
|
@@ -2921,7 +2944,7 @@ function _removeLocale(input2, locale) {
|
|
|
2921
2944
|
const { strings } = input2;
|
|
2922
2945
|
const newStrings = _lodash2.default.cloneDeep(strings);
|
|
2923
2946
|
for (const [key, value] of Object.entries(newStrings)) {
|
|
2924
|
-
if (_optionalChain([value, 'access',
|
|
2947
|
+
if (_optionalChain([value, 'access', _142 => _142.localizations, 'optionalAccess', _143 => _143[locale]])) {
|
|
2925
2948
|
delete value.localizations[locale];
|
|
2926
2949
|
}
|
|
2927
2950
|
}
|
|
@@ -3124,8 +3147,8 @@ async function formatDataWithBiome(data, filePath, options) {
|
|
|
3124
3147
|
});
|
|
3125
3148
|
return formatted.content;
|
|
3126
3149
|
} catch (error) {
|
|
3127
|
-
const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access',
|
|
3128
|
-
if (_optionalChain([errorMessage, 'optionalAccess',
|
|
3150
|
+
const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _144 => _144.stackTrace, 'optionalAccess', _145 => _145.toString, 'call', _146 => _146(), 'access', _147 => _147.split, 'call', _148 => _148("\n"), 'access', _149 => _149[0]]) : "";
|
|
3151
|
+
if (_optionalChain([errorMessage, 'optionalAccess', _150 => _150.includes, 'call', _151 => _151("does not exist in the workspace")])) {
|
|
3129
3152
|
} else {
|
|
3130
3153
|
console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
|
|
3131
3154
|
if (errorMessage) {
|
|
@@ -3172,7 +3195,7 @@ function createPoDataLoader(params) {
|
|
|
3172
3195
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
3173
3196
|
if (msgid && entry.msgid) {
|
|
3174
3197
|
const context = entry.msgctxt || "";
|
|
3175
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
3198
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _152 => _152.translations, 'access', _153 => _153[context], 'optionalAccess', _154 => _154[msgid]]);
|
|
3176
3199
|
if (fullEntry) {
|
|
3177
3200
|
result[msgid] = fullEntry;
|
|
3178
3201
|
}
|
|
@@ -3182,8 +3205,8 @@ function createPoDataLoader(params) {
|
|
|
3182
3205
|
return result;
|
|
3183
3206
|
},
|
|
3184
3207
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
3185
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
3186
|
-
const originalSections = _optionalChain([originalInput, 'optionalAccess',
|
|
3208
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _155 => _155.split, 'call', _156 => _156("\n\n"), 'access', _157 => _157.filter, 'call', _158 => _158(Boolean)]) || [];
|
|
3209
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _159 => _159.split, 'call', _160 => _160("\n\n"), 'access', _161 => _161.filter, 'call', _162 => _162(Boolean)]) || [];
|
|
3187
3210
|
const result = originalSections.map((section) => {
|
|
3188
3211
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
3189
3212
|
if (Object.keys(sectionPo.translations).length === 0) {
|
|
@@ -3252,8 +3275,8 @@ function createPoContentLoader() {
|
|
|
3252
3275
|
{
|
|
3253
3276
|
...entry,
|
|
3254
3277
|
msgstr: [
|
|
3255
|
-
_optionalChain([data, 'access',
|
|
3256
|
-
_optionalChain([data, 'access',
|
|
3278
|
+
_optionalChain([data, 'access', _163 => _163[entry.msgid], 'optionalAccess', _164 => _164.singular]),
|
|
3279
|
+
_optionalChain([data, 'access', _165 => _165[entry.msgid], 'optionalAccess', _166 => _166.plural]) || null
|
|
3257
3280
|
].filter(Boolean)
|
|
3258
3281
|
}
|
|
3259
3282
|
]).fromPairs().value();
|
|
@@ -3375,7 +3398,7 @@ function pullV1(xliffElement, locale, originalLocale) {
|
|
|
3375
3398
|
let key = getTransUnitKey(unit);
|
|
3376
3399
|
if (!key) return;
|
|
3377
3400
|
if (seenKeys.has(key)) {
|
|
3378
|
-
const id = _optionalChain([unit, 'access',
|
|
3401
|
+
const id = _optionalChain([unit, 'access', _167 => _167.getAttribute, 'call', _168 => _168("id"), 'optionalAccess', _169 => _169.trim, 'call', _170 => _170()]);
|
|
3379
3402
|
if (id) {
|
|
3380
3403
|
key = `${key}#${id}`;
|
|
3381
3404
|
} else {
|
|
@@ -3423,7 +3446,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3423
3446
|
let key = getTransUnitKey(unit);
|
|
3424
3447
|
if (!key) return;
|
|
3425
3448
|
if (seenKeys.has(key)) {
|
|
3426
|
-
const id = _optionalChain([unit, 'access',
|
|
3449
|
+
const id = _optionalChain([unit, 'access', _171 => _171.getAttribute, 'call', _172 => _172("id"), 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()]);
|
|
3427
3450
|
if (id) {
|
|
3428
3451
|
key = `${key}#${id}`;
|
|
3429
3452
|
} else {
|
|
@@ -3465,7 +3488,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3465
3488
|
const translationKeys = new Set(Object.keys(translations));
|
|
3466
3489
|
existingUnits.forEach((unit, key) => {
|
|
3467
3490
|
if (!translationKeys.has(key)) {
|
|
3468
|
-
_optionalChain([unit, 'access',
|
|
3491
|
+
_optionalChain([unit, 'access', _175 => _175.parentNode, 'optionalAccess', _176 => _176.removeChild, 'call', _177 => _177(unit)]);
|
|
3469
3492
|
}
|
|
3470
3493
|
});
|
|
3471
3494
|
return serializeWithDeclaration(
|
|
@@ -3508,18 +3531,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
|
|
|
3508
3531
|
Array.from(container.children).forEach((child) => {
|
|
3509
3532
|
const tagName = child.tagName;
|
|
3510
3533
|
if (tagName === "unit") {
|
|
3511
|
-
const unitId = _optionalChain([child, 'access',
|
|
3534
|
+
const unitId = _optionalChain([child, 'access', _178 => _178.getAttribute, 'call', _179 => _179("id"), 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()]);
|
|
3512
3535
|
if (!unitId) return;
|
|
3513
3536
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3514
3537
|
const segment = child.querySelector("segment");
|
|
3515
|
-
const source = _optionalChain([segment, 'optionalAccess',
|
|
3538
|
+
const source = _optionalChain([segment, 'optionalAccess', _182 => _182.querySelector, 'call', _183 => _183("source")]);
|
|
3516
3539
|
if (source) {
|
|
3517
3540
|
result[key] = extractTextContent(source);
|
|
3518
3541
|
} else {
|
|
3519
3542
|
result[key] = unitId;
|
|
3520
3543
|
}
|
|
3521
3544
|
} else if (tagName === "group") {
|
|
3522
|
-
const groupId = _optionalChain([child, 'access',
|
|
3545
|
+
const groupId = _optionalChain([child, 'access', _184 => _184.getAttribute, 'call', _185 => _185("id"), 'optionalAccess', _186 => _186.trim, 'call', _187 => _187()]);
|
|
3523
3546
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3524
3547
|
traverseUnitsV2(child, fileId, newPath, result);
|
|
3525
3548
|
}
|
|
@@ -3555,12 +3578,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
|
|
|
3555
3578
|
Array.from(container.children).forEach((child) => {
|
|
3556
3579
|
const tagName = child.tagName;
|
|
3557
3580
|
if (tagName === "unit") {
|
|
3558
|
-
const unitId = _optionalChain([child, 'access',
|
|
3581
|
+
const unitId = _optionalChain([child, 'access', _188 => _188.getAttribute, 'call', _189 => _189("id"), 'optionalAccess', _190 => _190.trim, 'call', _191 => _191()]);
|
|
3559
3582
|
if (!unitId) return;
|
|
3560
3583
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3561
3584
|
index.set(key, child);
|
|
3562
3585
|
} else if (tagName === "group") {
|
|
3563
|
-
const groupId = _optionalChain([child, 'access',
|
|
3586
|
+
const groupId = _optionalChain([child, 'access', _192 => _192.getAttribute, 'call', _193 => _193("id"), 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]);
|
|
3564
3587
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3565
3588
|
indexUnitsV2(child, fileId, newPath, index);
|
|
3566
3589
|
}
|
|
@@ -3581,9 +3604,9 @@ function updateUnitV2(unit, value) {
|
|
|
3581
3604
|
setTextContent(source, value);
|
|
3582
3605
|
}
|
|
3583
3606
|
function getTransUnitKey(transUnit) {
|
|
3584
|
-
const resname = _optionalChain([transUnit, 'access',
|
|
3607
|
+
const resname = _optionalChain([transUnit, 'access', _196 => _196.getAttribute, 'call', _197 => _197("resname"), 'optionalAccess', _198 => _198.trim, 'call', _199 => _199()]);
|
|
3585
3608
|
if (resname) return resname;
|
|
3586
|
-
const id = _optionalChain([transUnit, 'access',
|
|
3609
|
+
const id = _optionalChain([transUnit, 'access', _200 => _200.getAttribute, 'call', _201 => _201("id"), 'optionalAccess', _202 => _202.trim, 'call', _203 => _203()]);
|
|
3587
3610
|
if (id) return id;
|
|
3588
3611
|
const sourceElement = transUnit.querySelector("source");
|
|
3589
3612
|
if (sourceElement) {
|
|
@@ -3640,7 +3663,7 @@ function formatXml(xml) {
|
|
|
3640
3663
|
if (cdataNode) {
|
|
3641
3664
|
return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
|
|
3642
3665
|
}
|
|
3643
|
-
const textContent = _optionalChain([element, 'access',
|
|
3666
|
+
const textContent = _optionalChain([element, 'access', _204 => _204.textContent, 'optionalAccess', _205 => _205.trim, 'call', _206 => _206()]) || "";
|
|
3644
3667
|
const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
|
|
3645
3668
|
if (hasOnlyText && textContent) {
|
|
3646
3669
|
return `${indent2}${openTag}${textContent}</${tagName}>`;
|
|
@@ -3933,7 +3956,7 @@ function createDatoClient(params) {
|
|
|
3933
3956
|
ids: !records.length ? void 0 : records.join(",")
|
|
3934
3957
|
}
|
|
3935
3958
|
}).catch(
|
|
3936
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3959
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _207 => _207.response, 'optionalAccess', _208 => _208.body, 'optionalAccess', _209 => _209.data, 'optionalAccess', _210 => _210[0]]) || error)
|
|
3937
3960
|
);
|
|
3938
3961
|
},
|
|
3939
3962
|
findRecordsForModel: async (modelId, records) => {
|
|
@@ -3944,10 +3967,10 @@ function createDatoClient(params) {
|
|
|
3944
3967
|
filter: {
|
|
3945
3968
|
type: modelId,
|
|
3946
3969
|
only_valid: "true",
|
|
3947
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
3970
|
+
ids: !_optionalChain([records, 'optionalAccess', _211 => _211.length]) ? void 0 : records.join(",")
|
|
3948
3971
|
}
|
|
3949
3972
|
}).catch(
|
|
3950
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3973
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _212 => _212.response, 'optionalAccess', _213 => _213.body, 'optionalAccess', _214 => _214.data, 'optionalAccess', _215 => _215[0]]) || error)
|
|
3951
3974
|
);
|
|
3952
3975
|
return result;
|
|
3953
3976
|
} catch (_error) {
|
|
@@ -3963,10 +3986,10 @@ function createDatoClient(params) {
|
|
|
3963
3986
|
updateRecord: async (id, payload) => {
|
|
3964
3987
|
try {
|
|
3965
3988
|
await dato.items.update(id, payload).catch(
|
|
3966
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3989
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _216 => _216.response, 'optionalAccess', _217 => _217.body, 'optionalAccess', _218 => _218.data, 'optionalAccess', _219 => _219[0]]) || error)
|
|
3967
3990
|
);
|
|
3968
3991
|
} catch (_error) {
|
|
3969
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
3992
|
+
if (_optionalChain([_error, 'optionalAccess', _220 => _220.attributes, 'optionalAccess', _221 => _221.details, 'optionalAccess', _222 => _222.message])) {
|
|
3970
3993
|
throw new Error(
|
|
3971
3994
|
[
|
|
3972
3995
|
`${_error.attributes.details.message}`,
|
|
@@ -3988,10 +4011,10 @@ function createDatoClient(params) {
|
|
|
3988
4011
|
enableFieldLocalization: async (args) => {
|
|
3989
4012
|
try {
|
|
3990
4013
|
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
|
|
3991
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
4014
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _223 => _223.response, 'optionalAccess', _224 => _224.body, 'optionalAccess', _225 => _225.data, 'optionalAccess', _226 => _226[0]]) || error)
|
|
3992
4015
|
);
|
|
3993
4016
|
} catch (_error) {
|
|
3994
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
4017
|
+
if (_optionalChain([_error, 'optionalAccess', _227 => _227.attributes, 'optionalAccess', _228 => _228.code]) === "NOT_FOUND") {
|
|
3995
4018
|
throw new Error(
|
|
3996
4019
|
[
|
|
3997
4020
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -3999,7 +4022,7 @@ function createDatoClient(params) {
|
|
|
3999
4022
|
].join("\n\n")
|
|
4000
4023
|
);
|
|
4001
4024
|
}
|
|
4002
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
4025
|
+
if (_optionalChain([_error, 'optionalAccess', _229 => _229.attributes, 'optionalAccess', _230 => _230.details, 'optionalAccess', _231 => _231.message])) {
|
|
4003
4026
|
throw new Error(
|
|
4004
4027
|
[
|
|
4005
4028
|
`${_error.attributes.details.message}`,
|
|
@@ -4077,7 +4100,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4077
4100
|
const records = await dato.findRecordsForModel(modelId);
|
|
4078
4101
|
const recordChoices = createRecordChoices(
|
|
4079
4102
|
records,
|
|
4080
|
-
_optionalChain([config, 'access',
|
|
4103
|
+
_optionalChain([config, 'access', _232 => _232.models, 'access', _233 => _233[modelId], 'optionalAccess', _234 => _234.records]) || [],
|
|
4081
4104
|
project
|
|
4082
4105
|
);
|
|
4083
4106
|
const selectedRecords = await promptRecordSelection(
|
|
@@ -4096,14 +4119,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4096
4119
|
},
|
|
4097
4120
|
async pull(locale, input2, initCtx) {
|
|
4098
4121
|
const result = {};
|
|
4099
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
4100
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
4122
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _235 => _235.models]) || {})) {
|
|
4123
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _236 => _236.models, 'access', _237 => _237[modelId], 'access', _238 => _238.records]) || [];
|
|
4101
4124
|
const recordIds = records.map((record) => record.id);
|
|
4102
4125
|
records = await dato.findRecords(recordIds);
|
|
4103
4126
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
4104
4127
|
if (records.length > 0) {
|
|
4105
4128
|
result[modelId] = {
|
|
4106
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
4129
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _239 => _239.models, 'optionalAccess', _240 => _240[modelId], 'optionalAccess', _241 => _241.fields]) || [],
|
|
4107
4130
|
records
|
|
4108
4131
|
};
|
|
4109
4132
|
}
|
|
@@ -4166,7 +4189,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
4166
4189
|
return records.map((record) => ({
|
|
4167
4190
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
4168
4191
|
value: record.id,
|
|
4169
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
4192
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _242 => _242.includes, 'call', _243 => _243(record.id)])
|
|
4170
4193
|
}));
|
|
4171
4194
|
}
|
|
4172
4195
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -4485,7 +4508,7 @@ function createVttLoader() {
|
|
|
4485
4508
|
if (!input2) {
|
|
4486
4509
|
return "";
|
|
4487
4510
|
}
|
|
4488
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
4511
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _244 => _244.parse, 'call', _245 => _245(input2), 'optionalAccess', _246 => _246.cues]);
|
|
4489
4512
|
if (Object.keys(vtt).length === 0) {
|
|
4490
4513
|
return {};
|
|
4491
4514
|
} else {
|
|
@@ -4539,7 +4562,7 @@ function variableExtractLoader(params) {
|
|
|
4539
4562
|
for (let i = 0; i < matches.length; i++) {
|
|
4540
4563
|
const match2 = matches[i];
|
|
4541
4564
|
const currentValue = result[key].value;
|
|
4542
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4565
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _247 => _247.replace, 'call', _248 => _248(match2, `{variable:${i}}`)]);
|
|
4543
4566
|
result[key].value = newValue;
|
|
4544
4567
|
result[key].variables[i] = match2;
|
|
4545
4568
|
}
|
|
@@ -4553,7 +4576,7 @@ function variableExtractLoader(params) {
|
|
|
4553
4576
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
4554
4577
|
const variable = valueObj.variables[i];
|
|
4555
4578
|
const currentValue = result[key];
|
|
4556
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4579
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _249 => _249.replace, 'call', _250 => _250(`{variable:${i}}`, variable)]);
|
|
4557
4580
|
result[key] = newValue;
|
|
4558
4581
|
}
|
|
4559
4582
|
}
|
|
@@ -4753,7 +4776,7 @@ function createVueJsonLoader() {
|
|
|
4753
4776
|
return createLoader({
|
|
4754
4777
|
pull: async (locale, input2, ctx) => {
|
|
4755
4778
|
const parsed = parseVueFile(input2);
|
|
4756
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
4779
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _251 => _251.i18n, 'optionalAccess', _252 => _252[locale]]), () => ( {}));
|
|
4757
4780
|
},
|
|
4758
4781
|
push: async (locale, data, originalInput) => {
|
|
4759
4782
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -4938,7 +4961,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
4938
4961
|
objectExpression.properties.forEach((prop) => {
|
|
4939
4962
|
if (!t.isObjectProperty(prop)) return;
|
|
4940
4963
|
const key = getPropertyKey(prop);
|
|
4941
|
-
const incomingVal = _optionalChain([data, 'optionalAccess',
|
|
4964
|
+
const incomingVal = _optionalChain([data, 'optionalAccess', _253 => _253[key]]);
|
|
4942
4965
|
if (incomingVal === void 0) {
|
|
4943
4966
|
return;
|
|
4944
4967
|
}
|
|
@@ -4974,7 +4997,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
4974
4997
|
let modified = false;
|
|
4975
4998
|
arrayExpression.elements.forEach((element, index) => {
|
|
4976
4999
|
if (!element) return;
|
|
4977
|
-
const incomingVal = _optionalChain([incoming, 'optionalAccess',
|
|
5000
|
+
const incomingVal = _optionalChain([incoming, 'optionalAccess', _254 => _254[index]]);
|
|
4978
5001
|
if (incomingVal === void 0) return;
|
|
4979
5002
|
if (t.isStringLiteral(element) && typeof incomingVal === "string") {
|
|
4980
5003
|
if (element.value !== incomingVal) {
|
|
@@ -5465,7 +5488,7 @@ var AST = class _AST {
|
|
|
5465
5488
|
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
5466
5489
|
if (this.isStart() && !this.type)
|
|
5467
5490
|
ret.unshift([]);
|
|
5468
|
-
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
5491
|
+
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _255 => _255.#parent, 'optionalAccess', _256 => _256.type]) === "!")) {
|
|
5469
5492
|
ret.push({});
|
|
5470
5493
|
}
|
|
5471
5494
|
return ret;
|
|
@@ -5473,7 +5496,7 @@ var AST = class _AST {
|
|
|
5473
5496
|
isStart() {
|
|
5474
5497
|
if (this.#root === this)
|
|
5475
5498
|
return true;
|
|
5476
|
-
if (!_optionalChain([this, 'access',
|
|
5499
|
+
if (!_optionalChain([this, 'access', _257 => _257.#parent, 'optionalAccess', _258 => _258.isStart, 'call', _259 => _259()]))
|
|
5477
5500
|
return false;
|
|
5478
5501
|
if (this.#parentIndex === 0)
|
|
5479
5502
|
return true;
|
|
@@ -5489,12 +5512,12 @@ var AST = class _AST {
|
|
|
5489
5512
|
isEnd() {
|
|
5490
5513
|
if (this.#root === this)
|
|
5491
5514
|
return true;
|
|
5492
|
-
if (_optionalChain([this, 'access',
|
|
5515
|
+
if (_optionalChain([this, 'access', _260 => _260.#parent, 'optionalAccess', _261 => _261.type]) === "!")
|
|
5493
5516
|
return true;
|
|
5494
|
-
if (!_optionalChain([this, 'access',
|
|
5517
|
+
if (!_optionalChain([this, 'access', _262 => _262.#parent, 'optionalAccess', _263 => _263.isEnd, 'call', _264 => _264()]))
|
|
5495
5518
|
return false;
|
|
5496
5519
|
if (!this.type)
|
|
5497
|
-
return _optionalChain([this, 'access',
|
|
5520
|
+
return _optionalChain([this, 'access', _265 => _265.#parent, 'optionalAccess', _266 => _266.isEnd, 'call', _267 => _267()]);
|
|
5498
5521
|
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
5499
5522
|
return this.#parentIndex === pl - 1;
|
|
5500
5523
|
}
|
|
@@ -5739,7 +5762,7 @@ var AST = class _AST {
|
|
|
5739
5762
|
}
|
|
5740
5763
|
}
|
|
5741
5764
|
let end = "";
|
|
5742
|
-
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
5765
|
+
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _268 => _268.#parent, 'optionalAccess', _269 => _269.type]) === "!") {
|
|
5743
5766
|
end = "(?:$|\\/)";
|
|
5744
5767
|
}
|
|
5745
5768
|
const final2 = start2 + src + end;
|
|
@@ -6816,7 +6839,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
6816
6839
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
6817
6840
|
const result = {
|
|
6818
6841
|
frontmatter: data.frontmatter,
|
|
6819
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
6842
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _270 => _270.codePlaceholders]) || {},
|
|
6820
6843
|
content
|
|
6821
6844
|
};
|
|
6822
6845
|
return result;
|
|
@@ -7555,7 +7578,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
7555
7578
|
]
|
|
7556
7579
|
});
|
|
7557
7580
|
const result = JSON.parse(response.text);
|
|
7558
|
-
return _optionalChain([result, 'optionalAccess',
|
|
7581
|
+
return _optionalChain([result, 'optionalAccess', _271 => _271.data]) || {};
|
|
7559
7582
|
}
|
|
7560
7583
|
}
|
|
7561
7584
|
function extractPayloadChunks(payload) {
|
|
@@ -7637,7 +7660,7 @@ function getPureModelProvider(provider) {
|
|
|
7637
7660
|
|
|
7638
7661
|
${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
|
|
7639
7662
|
`;
|
|
7640
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
7663
|
+
switch (_optionalChain([provider, 'optionalAccess', _272 => _272.id])) {
|
|
7641
7664
|
case "openai": {
|
|
7642
7665
|
if (!process.env.OPENAI_API_KEY) {
|
|
7643
7666
|
throw new Error(
|
|
@@ -7695,7 +7718,7 @@ function getPureModelProvider(provider) {
|
|
|
7695
7718
|
})(provider.model);
|
|
7696
7719
|
}
|
|
7697
7720
|
default: {
|
|
7698
|
-
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess',
|
|
7721
|
+
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _273 => _273.id])));
|
|
7699
7722
|
}
|
|
7700
7723
|
}
|
|
7701
7724
|
}
|
|
@@ -7980,7 +8003,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7980
8003
|
validateParams(i18nConfig, flags);
|
|
7981
8004
|
ora.succeed("Localization configuration is valid");
|
|
7982
8005
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
7983
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
8006
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _274 => _274.provider]);
|
|
7984
8007
|
if (isByokMode) {
|
|
7985
8008
|
authId = null;
|
|
7986
8009
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -7994,16 +8017,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7994
8017
|
flags
|
|
7995
8018
|
});
|
|
7996
8019
|
let buckets = getBuckets(i18nConfig);
|
|
7997
|
-
if (_optionalChain([flags, 'access',
|
|
8020
|
+
if (_optionalChain([flags, 'access', _275 => _275.bucket, 'optionalAccess', _276 => _276.length])) {
|
|
7998
8021
|
buckets = buckets.filter(
|
|
7999
8022
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
8000
8023
|
);
|
|
8001
8024
|
}
|
|
8002
8025
|
ora.succeed("Buckets retrieved");
|
|
8003
|
-
if (_optionalChain([flags, 'access',
|
|
8026
|
+
if (_optionalChain([flags, 'access', _277 => _277.file, 'optionalAccess', _278 => _278.length])) {
|
|
8004
8027
|
buckets = buckets.map((bucket) => {
|
|
8005
8028
|
const paths = bucket.paths.filter(
|
|
8006
|
-
(path19) => flags.file.find((file) => _optionalChain([path19, 'access',
|
|
8029
|
+
(path19) => flags.file.find((file) => _optionalChain([path19, 'access', _279 => _279.pathPattern, 'optionalAccess', _280 => _280.includes, 'call', _281 => _281(file)]))
|
|
8007
8030
|
);
|
|
8008
8031
|
return { ...bucket, paths };
|
|
8009
8032
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -8024,7 +8047,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8024
8047
|
});
|
|
8025
8048
|
}
|
|
8026
8049
|
}
|
|
8027
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
8050
|
+
const targetLocales = _optionalChain([flags, 'access', _282 => _282.locale, 'optionalAccess', _283 => _283.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
8028
8051
|
ora.start("Setting up localization cache...");
|
|
8029
8052
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
8030
8053
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -8301,7 +8324,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8301
8324
|
}
|
|
8302
8325
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
8303
8326
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
8304
|
-
if (!_optionalChain([flags, 'access',
|
|
8327
|
+
if (!_optionalChain([flags, 'access', _284 => _284.locale, 'optionalAccess', _285 => _285.length])) {
|
|
8305
8328
|
await deltaProcessor.saveChecksums(checksums);
|
|
8306
8329
|
}
|
|
8307
8330
|
}
|
|
@@ -8425,12 +8448,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
8425
8448
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
8426
8449
|
docUrl: "bucketNotFound"
|
|
8427
8450
|
});
|
|
8428
|
-
} else if (_optionalChain([flags, 'access',
|
|
8451
|
+
} else if (_optionalChain([flags, 'access', _286 => _286.locale, 'optionalAccess', _287 => _287.some, 'call', _288 => _288((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
8429
8452
|
throw new ValidationError({
|
|
8430
8453
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
8431
8454
|
docUrl: "localeTargetNotFound"
|
|
8432
8455
|
});
|
|
8433
|
-
} else if (_optionalChain([flags, 'access',
|
|
8456
|
+
} else if (_optionalChain([flags, 'access', _289 => _289.bucket, 'optionalAccess', _290 => _290.some, 'call', _291 => _291(
|
|
8434
8457
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
8435
8458
|
)])) {
|
|
8436
8459
|
throw new ValidationError({
|
|
@@ -8956,7 +8979,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
8956
8979
|
const response = await engine.whoami();
|
|
8957
8980
|
return {
|
|
8958
8981
|
authenticated: !!response,
|
|
8959
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
8982
|
+
username: _optionalChain([response, 'optionalAccess', _292 => _292.email])
|
|
8960
8983
|
};
|
|
8961
8984
|
} catch (e3) {
|
|
8962
8985
|
return { authenticated: false };
|
|
@@ -9064,7 +9087,7 @@ function createExplicitLocalizer(provider) {
|
|
|
9064
9087
|
}
|
|
9065
9088
|
function createAiSdkLocalizer(params) {
|
|
9066
9089
|
const skipAuth = params.skipAuth === true;
|
|
9067
|
-
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
9090
|
+
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _293 => _293.apiKeyName]), () => ( ""))];
|
|
9068
9091
|
if (!skipAuth && !apiKey || !params.apiKeyName) {
|
|
9069
9092
|
throw new Error(
|
|
9070
9093
|
_dedent2.default`
|
|
@@ -9189,8 +9212,8 @@ async function setup(input2) {
|
|
|
9189
9212
|
throw new Error(
|
|
9190
9213
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
9191
9214
|
);
|
|
9192
|
-
} else if (_optionalChain([ctx, 'access',
|
|
9193
|
-
(bucket) => !_optionalChain([ctx, 'access',
|
|
9215
|
+
} else if (_optionalChain([ctx, 'access', _294 => _294.flags, 'access', _295 => _295.bucket, 'optionalAccess', _296 => _296.some, 'call', _297 => _297(
|
|
9216
|
+
(bucket) => !_optionalChain([ctx, 'access', _298 => _298.config, 'optionalAccess', _299 => _299.buckets, 'access', _300 => _300[bucket]])
|
|
9194
9217
|
)])) {
|
|
9195
9218
|
throw new Error(
|
|
9196
9219
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -9203,7 +9226,7 @@ async function setup(input2) {
|
|
|
9203
9226
|
title: "Selecting localization provider",
|
|
9204
9227
|
task: async (ctx, task) => {
|
|
9205
9228
|
ctx.localizer = createLocalizer(
|
|
9206
|
-
_optionalChain([ctx, 'access',
|
|
9229
|
+
_optionalChain([ctx, 'access', _301 => _301.config, 'optionalAccess', _302 => _302.provider]),
|
|
9207
9230
|
ctx.flags.apiKey
|
|
9208
9231
|
);
|
|
9209
9232
|
if (!ctx.localizer) {
|
|
@@ -9407,12 +9430,21 @@ async function execute(input2) {
|
|
|
9407
9430
|
title: `Processing localization tasks ${_chalk2.default.dim(
|
|
9408
9431
|
`(tasks: ${input2.tasks.length}, concurrency: ${effectiveConcurrency})`
|
|
9409
9432
|
)}`,
|
|
9410
|
-
task: (ctx, task) => {
|
|
9433
|
+
task: async (ctx, task) => {
|
|
9411
9434
|
if (input2.tasks.length < 1) {
|
|
9412
9435
|
task.title = `Skipping, nothing to localize.`;
|
|
9413
9436
|
task.skip();
|
|
9414
9437
|
return;
|
|
9415
9438
|
}
|
|
9439
|
+
const initialChecksumsMap = /* @__PURE__ */ new Map();
|
|
9440
|
+
const uniqueBucketPatterns = _lodash2.default.uniq(
|
|
9441
|
+
ctx.tasks.map((t2) => t2.bucketPathPattern)
|
|
9442
|
+
);
|
|
9443
|
+
for (const bucketPathPattern of uniqueBucketPatterns) {
|
|
9444
|
+
const deltaProcessor = createDeltaProcessor(bucketPathPattern);
|
|
9445
|
+
const checksums = await deltaProcessor.loadChecksums();
|
|
9446
|
+
initialChecksumsMap.set(bucketPathPattern, checksums);
|
|
9447
|
+
}
|
|
9416
9448
|
const i18nLimiter = _plimit2.default.call(void 0, effectiveConcurrency);
|
|
9417
9449
|
const ioLimiter = _plimit2.default.call(void 0, 1);
|
|
9418
9450
|
const workersCount = effectiveConcurrency;
|
|
@@ -9427,6 +9459,7 @@ async function execute(input2) {
|
|
|
9427
9459
|
assignedTasks,
|
|
9428
9460
|
ioLimiter,
|
|
9429
9461
|
i18nLimiter,
|
|
9462
|
+
initialChecksumsMap,
|
|
9430
9463
|
onDone() {
|
|
9431
9464
|
task.title = createExecutionProgressMessage(ctx);
|
|
9432
9465
|
}
|
|
@@ -9506,6 +9539,7 @@ function createWorkerTask(args) {
|
|
|
9506
9539
|
const deltaProcessor = createDeltaProcessor(
|
|
9507
9540
|
assignedTask.bucketPathPattern
|
|
9508
9541
|
);
|
|
9542
|
+
const initialChecksums = args.initialChecksumsMap.get(assignedTask.bucketPathPattern) || {};
|
|
9509
9543
|
const taskResult = await args.i18nLimiter(async () => {
|
|
9510
9544
|
try {
|
|
9511
9545
|
const sourceData = await bucketLoader.pull(
|
|
@@ -9515,16 +9549,15 @@ function createWorkerTask(args) {
|
|
|
9515
9549
|
const targetData = await bucketLoader.pull(
|
|
9516
9550
|
assignedTask.targetLocale
|
|
9517
9551
|
);
|
|
9518
|
-
const checksums = await deltaProcessor.loadChecksums();
|
|
9519
9552
|
const delta = await deltaProcessor.calculateDelta({
|
|
9520
9553
|
sourceData,
|
|
9521
9554
|
targetData,
|
|
9522
|
-
checksums
|
|
9555
|
+
checksums: initialChecksums
|
|
9523
9556
|
});
|
|
9524
9557
|
const processableData = _lodash2.default.chain(sourceData).entries().filter(
|
|
9525
9558
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
9526
9559
|
).filter(
|
|
9527
|
-
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access',
|
|
9560
|
+
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _303 => _303.onlyKeys, 'optionalAccess', _304 => _304.some, 'call', _305 => _305(
|
|
9528
9561
|
(pattern) => minimatch(key, pattern)
|
|
9529
9562
|
)])
|
|
9530
9563
|
).fromPairs().value();
|
|
@@ -9532,7 +9565,12 @@ function createWorkerTask(args) {
|
|
|
9532
9565
|
await args.ioLimiter(async () => {
|
|
9533
9566
|
await bucketLoader.push(assignedTask.targetLocale, targetData);
|
|
9534
9567
|
});
|
|
9535
|
-
return {
|
|
9568
|
+
return {
|
|
9569
|
+
status: "skipped",
|
|
9570
|
+
pathPattern: assignedTask.bucketPathPattern,
|
|
9571
|
+
sourceLocale: assignedTask.sourceLocale,
|
|
9572
|
+
targetLocale: assignedTask.targetLocale
|
|
9573
|
+
};
|
|
9536
9574
|
}
|
|
9537
9575
|
const relevantHints = _lodash2.default.pick(hints, Object.keys(processableData));
|
|
9538
9576
|
const processedTargetData = await args.ctx.localizer.localize(
|
|
@@ -9586,16 +9624,24 @@ function createWorkerTask(args) {
|
|
|
9586
9624
|
assignedTask.targetLocale,
|
|
9587
9625
|
finalRenamedTargetData
|
|
9588
9626
|
);
|
|
9589
|
-
const
|
|
9590
|
-
if (!_optionalChain([args, 'access',
|
|
9591
|
-
await deltaProcessor.saveChecksums(
|
|
9627
|
+
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
9628
|
+
if (!_optionalChain([args, 'access', _306 => _306.ctx, 'access', _307 => _307.flags, 'access', _308 => _308.targetLocale, 'optionalAccess', _309 => _309.length])) {
|
|
9629
|
+
await deltaProcessor.saveChecksums(checksums);
|
|
9592
9630
|
}
|
|
9593
9631
|
});
|
|
9594
|
-
return {
|
|
9632
|
+
return {
|
|
9633
|
+
status: "success",
|
|
9634
|
+
pathPattern: assignedTask.bucketPathPattern,
|
|
9635
|
+
sourceLocale: assignedTask.sourceLocale,
|
|
9636
|
+
targetLocale: assignedTask.targetLocale
|
|
9637
|
+
};
|
|
9595
9638
|
} catch (error) {
|
|
9596
9639
|
return {
|
|
9597
9640
|
status: "error",
|
|
9598
|
-
error
|
|
9641
|
+
error,
|
|
9642
|
+
pathPattern: assignedTask.bucketPathPattern,
|
|
9643
|
+
sourceLocale: assignedTask.sourceLocale,
|
|
9644
|
+
targetLocale: assignedTask.targetLocale
|
|
9599
9645
|
};
|
|
9600
9646
|
}
|
|
9601
9647
|
});
|
|
@@ -9778,13 +9824,13 @@ var flagsSchema2 = _zod.z.object({
|
|
|
9778
9824
|
|
|
9779
9825
|
// src/cli/cmd/run/_utils.ts
|
|
9780
9826
|
async function determineAuthId(ctx) {
|
|
9781
|
-
const isByokMode = !!_optionalChain([ctx, 'access',
|
|
9827
|
+
const isByokMode = !!_optionalChain([ctx, 'access', _310 => _310.config, 'optionalAccess', _311 => _311.provider]);
|
|
9782
9828
|
if (isByokMode) {
|
|
9783
9829
|
return null;
|
|
9784
9830
|
} else {
|
|
9785
9831
|
try {
|
|
9786
|
-
const authStatus = await _optionalChain([ctx, 'access',
|
|
9787
|
-
return _optionalChain([authStatus, 'optionalAccess',
|
|
9832
|
+
const authStatus = await _optionalChain([ctx, 'access', _312 => _312.localizer, 'optionalAccess', _313 => _313.checkAuth, 'call', _314 => _314()]);
|
|
9833
|
+
return _optionalChain([authStatus, 'optionalAccess', _315 => _315.username]) || null;
|
|
9788
9834
|
} catch (e4) {
|
|
9789
9835
|
return null;
|
|
9790
9836
|
}
|
|
@@ -9976,7 +10022,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
9976
10022
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
9977
10023
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
9978
10024
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
9979
|
-
_optionalChain([this, 'access',
|
|
10025
|
+
_optionalChain([this, 'access', _316 => _316.platformKit, 'optionalAccess', _317 => _317.gitConfig, 'call', _318 => _318()]);
|
|
9980
10026
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
9981
10027
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
9982
10028
|
if (!processOwnCommits) {
|
|
@@ -10008,7 +10054,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
10008
10054
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
10009
10055
|
var PullRequestFlow = class extends InBranchFlow {
|
|
10010
10056
|
async preRun() {
|
|
10011
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
10057
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _319 => _319()]);
|
|
10012
10058
|
if (!canContinue) {
|
|
10013
10059
|
return false;
|
|
10014
10060
|
}
|
|
@@ -10271,10 +10317,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
10271
10317
|
repo_slug: this.platformConfig.repositoryName,
|
|
10272
10318
|
state: "OPEN"
|
|
10273
10319
|
}).then(({ data: { values } }) => {
|
|
10274
|
-
return _optionalChain([values, 'optionalAccess',
|
|
10275
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
10320
|
+
return _optionalChain([values, 'optionalAccess', _320 => _320.find, 'call', _321 => _321(
|
|
10321
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _322 => _322.branch, 'optionalAccess', _323 => _323.name]) === branch && _optionalChain([destination, 'optionalAccess', _324 => _324.branch, 'optionalAccess', _325 => _325.name]) === this.platformConfig.baseBranchName
|
|
10276
10322
|
)]);
|
|
10277
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10323
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _326 => _326.id]));
|
|
10278
10324
|
}
|
|
10279
10325
|
async closePullRequest({ pullRequestNumber }) {
|
|
10280
10326
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -10370,7 +10416,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
10370
10416
|
repo: this.platformConfig.repositoryName,
|
|
10371
10417
|
base: this.platformConfig.baseBranchName,
|
|
10372
10418
|
state: "open"
|
|
10373
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10419
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _327 => _327.number]));
|
|
10374
10420
|
}
|
|
10375
10421
|
async closePullRequest({ pullRequestNumber }) {
|
|
10376
10422
|
await this.octokit.rest.pulls.update({
|
|
@@ -10497,7 +10543,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
10497
10543
|
sourceBranch: branch,
|
|
10498
10544
|
state: "opened"
|
|
10499
10545
|
});
|
|
10500
|
-
return _optionalChain([mergeRequests, 'access',
|
|
10546
|
+
return _optionalChain([mergeRequests, 'access', _328 => _328[0], 'optionalAccess', _329 => _329.iid]);
|
|
10501
10547
|
}
|
|
10502
10548
|
async closePullRequest({
|
|
10503
10549
|
pullRequestNumber
|
|
@@ -10603,7 +10649,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10603
10649
|
}
|
|
10604
10650
|
const env = {
|
|
10605
10651
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
10606
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
10652
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _330 => _330.pullRequest, 'optionalAccess', _331 => _331.toString, 'call', _332 => _332()]) || "false",
|
|
10607
10653
|
...options.commitMessage && {
|
|
10608
10654
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
10609
10655
|
},
|
|
@@ -10623,7 +10669,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10623
10669
|
const { isPullRequestMode } = platformKit.config;
|
|
10624
10670
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
10625
10671
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
10626
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
10672
|
+
const canRun = await _optionalChain([flow, 'access', _333 => _333.preRun, 'optionalCall', _334 => _334()]);
|
|
10627
10673
|
if (canRun === false) {
|
|
10628
10674
|
return;
|
|
10629
10675
|
}
|
|
@@ -10633,7 +10679,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10633
10679
|
if (!hasChanges) {
|
|
10634
10680
|
return;
|
|
10635
10681
|
}
|
|
10636
|
-
await _optionalChain([flow, 'access',
|
|
10682
|
+
await _optionalChain([flow, 'access', _335 => _335.postRun, 'optionalCall', _336 => _336()]);
|
|
10637
10683
|
});
|
|
10638
10684
|
function parseBooleanArg(val) {
|
|
10639
10685
|
if (val === true) return true;
|
|
@@ -10670,8 +10716,8 @@ function exitGracefully(elapsedMs = 0) {
|
|
|
10670
10716
|
}
|
|
10671
10717
|
}
|
|
10672
10718
|
function checkForPendingOperations() {
|
|
10673
|
-
const activeHandles = _optionalChain([process, 'access',
|
|
10674
|
-
const activeRequests = _optionalChain([process, 'access',
|
|
10719
|
+
const activeHandles = _optionalChain([process, 'access', _337 => _337._getActiveHandles, 'optionalCall', _338 => _338()]) || [];
|
|
10720
|
+
const activeRequests = _optionalChain([process, 'access', _339 => _339._getActiveRequests, 'optionalCall', _340 => _340()]) || [];
|
|
10675
10721
|
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
10676
10722
|
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
10677
10723
|
return false;
|
|
@@ -10740,17 +10786,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10740
10786
|
flags
|
|
10741
10787
|
});
|
|
10742
10788
|
let buckets = getBuckets(i18nConfig);
|
|
10743
|
-
if (_optionalChain([flags, 'access',
|
|
10789
|
+
if (_optionalChain([flags, 'access', _341 => _341.bucket, 'optionalAccess', _342 => _342.length])) {
|
|
10744
10790
|
buckets = buckets.filter(
|
|
10745
10791
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
10746
10792
|
);
|
|
10747
10793
|
}
|
|
10748
10794
|
ora.succeed("Buckets retrieved");
|
|
10749
|
-
if (_optionalChain([flags, 'access',
|
|
10795
|
+
if (_optionalChain([flags, 'access', _343 => _343.file, 'optionalAccess', _344 => _344.length])) {
|
|
10750
10796
|
buckets = buckets.map((bucket) => {
|
|
10751
10797
|
const paths = bucket.paths.filter(
|
|
10752
10798
|
(path19) => flags.file.find(
|
|
10753
|
-
(file) => _optionalChain([path19, 'access',
|
|
10799
|
+
(file) => _optionalChain([path19, 'access', _345 => _345.pathPattern, 'optionalAccess', _346 => _346.includes, 'call', _347 => _347(file)]) || _optionalChain([path19, 'access', _348 => _348.pathPattern, 'optionalAccess', _349 => _349.match, 'call', _350 => _350(file)]) || minimatch(path19.pathPattern, file)
|
|
10754
10800
|
)
|
|
10755
10801
|
);
|
|
10756
10802
|
return { ...bucket, paths };
|
|
@@ -10770,7 +10816,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10770
10816
|
});
|
|
10771
10817
|
}
|
|
10772
10818
|
}
|
|
10773
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
10819
|
+
const targetLocales = _optionalChain([flags, 'access', _351 => _351.locale, 'optionalAccess', _352 => _352.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
10774
10820
|
let totalSourceKeyCount = 0;
|
|
10775
10821
|
let uniqueKeysToTranslate = 0;
|
|
10776
10822
|
let totalExistingTranslations = 0;
|
|
@@ -11176,12 +11222,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
11176
11222
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
11177
11223
|
docUrl: "bucketNotFound"
|
|
11178
11224
|
});
|
|
11179
|
-
} else if (_optionalChain([flags, 'access',
|
|
11225
|
+
} else if (_optionalChain([flags, 'access', _353 => _353.locale, 'optionalAccess', _354 => _354.some, 'call', _355 => _355((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
11180
11226
|
throw new CLIError({
|
|
11181
11227
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
11182
11228
|
docUrl: "localeTargetNotFound"
|
|
11183
11229
|
});
|
|
11184
|
-
} else if (_optionalChain([flags, 'access',
|
|
11230
|
+
} else if (_optionalChain([flags, 'access', _356 => _356.bucket, 'optionalAccess', _357 => _357.some, 'call', _358 => _358(
|
|
11185
11231
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
11186
11232
|
)])) {
|
|
11187
11233
|
throw new CLIError({
|
|
@@ -11273,7 +11319,7 @@ async function renderHero2() {
|
|
|
11273
11319
|
// package.json
|
|
11274
11320
|
var package_default = {
|
|
11275
11321
|
name: "lingo.dev",
|
|
11276
|
-
version: "0.111.
|
|
11322
|
+
version: "0.111.16",
|
|
11277
11323
|
description: "Lingo.dev CLI",
|
|
11278
11324
|
private: false,
|
|
11279
11325
|
publishConfig: {
|
|
@@ -11562,7 +11608,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
|
|
|
11562
11608
|
if (options.file && options.file.length) {
|
|
11563
11609
|
buckets = buckets.map((bucket) => {
|
|
11564
11610
|
const paths = bucket.paths.filter(
|
|
11565
|
-
(bucketPath) => _optionalChain([options, 'access',
|
|
11611
|
+
(bucketPath) => _optionalChain([options, 'access', _359 => _359.file, 'optionalAccess', _360 => _360.some, 'call', _361 => _361((f) => bucketPath.pathPattern.includes(f))])
|
|
11566
11612
|
);
|
|
11567
11613
|
return { ...bucket, paths };
|
|
11568
11614
|
}).filter((bucket) => bucket.paths.length > 0);
|