lingo.dev 0.117.20 → 0.117.22
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/{chunk-HTMTB46P.cjs → chunk-EHIR4A2G.cjs} +2 -2
- package/build/{chunk-HTMTB46P.cjs.map → chunk-EHIR4A2G.cjs.map} +1 -1
- package/build/cli.cjs +213 -158
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +71 -16
- package/build/cli.mjs.map +1 -1
- package/build/compiler.cjs +1 -1
- package/build/locale-codes.cjs +1 -1
- package/build/react/client.cjs +1 -1
- package/build/react/react-router.cjs +1 -1
- package/build/react/rsc.cjs +1 -1
- package/build/react.cjs +1 -1
- package/build/sdk.cjs +1 -1
- package/build/spec.cjs +1 -1
- package/package.json +4 -4
package/build/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEHIR4A2Gcjs = require('./chunk-EHIR4A2G.cjs');
|
|
4
4
|
|
|
5
5
|
// src/cli/index.ts
|
|
6
6
|
var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);
|
|
@@ -1600,8 +1600,10 @@ function createLoader(lDefinition) {
|
|
|
1600
1600
|
const state = {
|
|
1601
1601
|
defaultLocale: void 0,
|
|
1602
1602
|
originalInput: void 0,
|
|
1603
|
-
pullInput
|
|
1604
|
-
|
|
1603
|
+
// Store pullInput and pullOutput per-locale to avoid race conditions
|
|
1604
|
+
// when multiple locales are processed concurrently
|
|
1605
|
+
pullInputByLocale: /* @__PURE__ */ new Map(),
|
|
1606
|
+
pullOutputByLocale: /* @__PURE__ */ new Map(),
|
|
1605
1607
|
initCtx: void 0
|
|
1606
1608
|
};
|
|
1607
1609
|
return {
|
|
@@ -1632,7 +1634,7 @@ function createLoader(lDefinition) {
|
|
|
1632
1634
|
if (locale === state.defaultLocale) {
|
|
1633
1635
|
state.originalInput = input2 || null;
|
|
1634
1636
|
}
|
|
1635
|
-
state.
|
|
1637
|
+
state.pullInputByLocale.set(locale, input2 || null);
|
|
1636
1638
|
const result = await lDefinition.pull(
|
|
1637
1639
|
locale,
|
|
1638
1640
|
input2,
|
|
@@ -1640,7 +1642,7 @@ function createLoader(lDefinition) {
|
|
|
1640
1642
|
state.defaultLocale,
|
|
1641
1643
|
state.originalInput
|
|
1642
1644
|
);
|
|
1643
|
-
state.
|
|
1645
|
+
state.pullOutputByLocale.set(locale, result);
|
|
1644
1646
|
return result;
|
|
1645
1647
|
},
|
|
1646
1648
|
async push(locale, data) {
|
|
@@ -1650,13 +1652,15 @@ function createLoader(lDefinition) {
|
|
|
1650
1652
|
if (state.originalInput === void 0) {
|
|
1651
1653
|
throw new Error("Cannot push data without pulling first");
|
|
1652
1654
|
}
|
|
1655
|
+
const pullInput = _nullishCoalesce(_nullishCoalesce(state.pullInputByLocale.get(locale), () => ( state.pullInputByLocale.get(state.defaultLocale))), () => ( null));
|
|
1656
|
+
const pullOutput = _nullishCoalesce(_nullishCoalesce(state.pullOutputByLocale.get(locale), () => ( state.pullOutputByLocale.get(state.defaultLocale))), () => ( null));
|
|
1653
1657
|
const pushResult = await lDefinition.push(
|
|
1654
1658
|
locale,
|
|
1655
1659
|
data,
|
|
1656
1660
|
state.originalInput,
|
|
1657
1661
|
state.defaultLocale,
|
|
1658
|
-
|
|
1659
|
-
|
|
1662
|
+
pullInput,
|
|
1663
|
+
pullOutput
|
|
1660
1664
|
);
|
|
1661
1665
|
return pushResult;
|
|
1662
1666
|
}
|
|
@@ -1714,6 +1718,7 @@ function extractCommentsFromJsonc(jsoncString) {
|
|
|
1714
1718
|
return {};
|
|
1715
1719
|
}
|
|
1716
1720
|
const contextStack = [];
|
|
1721
|
+
let arrayObjectCount = {};
|
|
1717
1722
|
for (let i = 0; i < lines.length; i++) {
|
|
1718
1723
|
const line = lines[i];
|
|
1719
1724
|
const trimmedLine = line.trim();
|
|
@@ -1725,11 +1730,11 @@ function extractCommentsFromJsonc(jsoncString) {
|
|
|
1725
1730
|
const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
|
|
1726
1731
|
if (keyMatch) {
|
|
1727
1732
|
const key = keyMatch[1];
|
|
1728
|
-
const path19 = contextStack.map((ctx) => ctx.key).filter(Boolean);
|
|
1733
|
+
const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
|
|
1729
1734
|
keyInfo = { key, path: path19 };
|
|
1730
1735
|
}
|
|
1731
1736
|
} else {
|
|
1732
|
-
keyInfo = findAssociatedKey(lines, commentData.lineIndex, contextStack);
|
|
1737
|
+
keyInfo = findAssociatedKey(lines, commentData.lineIndex, contextStack, arrayObjectCount);
|
|
1733
1738
|
}
|
|
1734
1739
|
if (keyInfo && keyInfo.key) {
|
|
1735
1740
|
setCommentAtPath(comments, keyInfo.path, keyInfo.key, commentData.hint);
|
|
@@ -1737,7 +1742,7 @@ function extractCommentsFromJsonc(jsoncString) {
|
|
|
1737
1742
|
i = commentData.endIndex;
|
|
1738
1743
|
continue;
|
|
1739
1744
|
}
|
|
1740
|
-
updateContext(contextStack, line, result);
|
|
1745
|
+
updateContext(contextStack, line, result, arrayObjectCount);
|
|
1741
1746
|
}
|
|
1742
1747
|
return comments;
|
|
1743
1748
|
}
|
|
@@ -1801,34 +1806,84 @@ function extractBlockComment(lines, startIndex) {
|
|
|
1801
1806
|
endIndex
|
|
1802
1807
|
};
|
|
1803
1808
|
}
|
|
1804
|
-
function findAssociatedKey(lines, commentLineIndex, contextStack) {
|
|
1809
|
+
function findAssociatedKey(lines, commentLineIndex, contextStack, arrayObjectCount) {
|
|
1805
1810
|
for (let i = commentLineIndex + 1; i < lines.length; i++) {
|
|
1806
1811
|
const line = lines[i].trim();
|
|
1807
|
-
if (!line || line.startsWith("//") || line.startsWith("/*")
|
|
1812
|
+
if (!line || line.startsWith("//") || line.startsWith("/*")) {
|
|
1813
|
+
continue;
|
|
1814
|
+
}
|
|
1815
|
+
if (line === "{" && contextStack.length > 0) {
|
|
1816
|
+
const parent = contextStack[contextStack.length - 1];
|
|
1817
|
+
if (parent.isArray) {
|
|
1818
|
+
const depth = contextStack.length - 1;
|
|
1819
|
+
const arrayIndex = arrayObjectCount[depth] || 0;
|
|
1820
|
+
for (let j = i + 1; j < lines.length; j++) {
|
|
1821
|
+
const innerLine = lines[j].trim();
|
|
1822
|
+
if (!innerLine || innerLine.startsWith("//") || innerLine.startsWith("/*")) continue;
|
|
1823
|
+
const keyMatch2 = innerLine.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
|
|
1824
|
+
if (keyMatch2) {
|
|
1825
|
+
const key = keyMatch2[1];
|
|
1826
|
+
const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
|
|
1827
|
+
path19.push(String(arrayIndex));
|
|
1828
|
+
return { key, path: path19 };
|
|
1829
|
+
}
|
|
1830
|
+
if (innerLine === "}") break;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
if (line === "{" || line === "}") {
|
|
1808
1835
|
continue;
|
|
1809
1836
|
}
|
|
1810
1837
|
const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
|
|
1811
1838
|
if (keyMatch) {
|
|
1812
1839
|
const key = keyMatch[1];
|
|
1813
|
-
const path19 = contextStack.map((ctx) => ctx.key).filter(Boolean);
|
|
1840
|
+
const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
|
|
1814
1841
|
return { key, path: path19 };
|
|
1815
1842
|
}
|
|
1816
1843
|
}
|
|
1817
1844
|
return { key: null, path: [] };
|
|
1818
1845
|
}
|
|
1819
|
-
function updateContext(contextStack, line, parsedJson) {
|
|
1846
|
+
function updateContext(contextStack, line, parsedJson, arrayObjectCount) {
|
|
1847
|
+
const trimmed = line.trim();
|
|
1848
|
+
const arrayMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:\s*\[/);
|
|
1849
|
+
if (arrayMatch) {
|
|
1850
|
+
const depth = contextStack.length;
|
|
1851
|
+
arrayObjectCount[depth] = 0;
|
|
1852
|
+
contextStack.push({ key: arrayMatch[1], isArray: true });
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1820
1855
|
const openBraces = (line.match(/\{/g) || []).length;
|
|
1821
1856
|
const closeBraces = (line.match(/\}/g) || []).length;
|
|
1822
1857
|
if (openBraces > closeBraces) {
|
|
1823
1858
|
const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:\s*\{/);
|
|
1824
1859
|
if (keyMatch) {
|
|
1825
1860
|
contextStack.push({ key: keyMatch[1], isArray: false });
|
|
1861
|
+
} else if (trimmed === "{" && contextStack.length > 0) {
|
|
1862
|
+
const parent = contextStack[contextStack.length - 1];
|
|
1863
|
+
if (parent.isArray) {
|
|
1864
|
+
const depth = contextStack.length - 1;
|
|
1865
|
+
const arrayIndex = arrayObjectCount[depth] || 0;
|
|
1866
|
+
contextStack.push({ key: "", isArray: false, arrayIndex });
|
|
1867
|
+
arrayObjectCount[depth]++;
|
|
1868
|
+
}
|
|
1826
1869
|
}
|
|
1827
|
-
}
|
|
1870
|
+
}
|
|
1871
|
+
const openBrackets = (line.match(/\[/g) || []).length;
|
|
1872
|
+
const closeBrackets = (line.match(/\]/g) || []).length;
|
|
1873
|
+
if (closeBraces > openBraces) {
|
|
1828
1874
|
for (let i = 0; i < closeBraces - openBraces; i++) {
|
|
1829
1875
|
contextStack.pop();
|
|
1830
1876
|
}
|
|
1831
1877
|
}
|
|
1878
|
+
if (closeBrackets > openBrackets) {
|
|
1879
|
+
for (let i = 0; i < closeBrackets - openBrackets; i++) {
|
|
1880
|
+
const popped = contextStack.pop();
|
|
1881
|
+
if (_optionalChain([popped, 'optionalAccess', _103 => _103.isArray])) {
|
|
1882
|
+
const depth = contextStack.length;
|
|
1883
|
+
delete arrayObjectCount[depth];
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1832
1887
|
}
|
|
1833
1888
|
function setCommentAtPath(comments, path19, key, hint) {
|
|
1834
1889
|
let current = comments;
|
|
@@ -1906,7 +1961,7 @@ function createDenormalizeLoader(options) {
|
|
|
1906
1961
|
const preservedObjects = {};
|
|
1907
1962
|
const nonPreservedInput = {};
|
|
1908
1963
|
for (const [key, value] of Object.entries(inputDenormalized)) {
|
|
1909
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1964
|
+
if (_optionalChain([options, 'optionalAccess', _104 => _104.shouldPreserveObject, 'optionalCall', _105 => _105(value)])) {
|
|
1910
1965
|
preservedObjects[key] = value;
|
|
1911
1966
|
} else {
|
|
1912
1967
|
nonPreservedInput[key] = value;
|
|
@@ -1939,7 +1994,7 @@ function createNormalizeLoader() {
|
|
|
1939
1994
|
return normalized;
|
|
1940
1995
|
},
|
|
1941
1996
|
push: async (locale, data, originalInput) => {
|
|
1942
|
-
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess',
|
|
1997
|
+
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _106 => _106.keysMap]), () => ( {}));
|
|
1943
1998
|
const input2 = mapDenormalizedKeys(data, keysMap);
|
|
1944
1999
|
const denormalized = _flat.unflatten.call(void 0, input2, {
|
|
1945
2000
|
delimiter: "/",
|
|
@@ -2073,8 +2128,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
|
|
|
2073
2128
|
if (!templateData) {
|
|
2074
2129
|
templateData = await readFileForLocale(pathPattern, originalLocale);
|
|
2075
2130
|
}
|
|
2076
|
-
if (_optionalChain([templateData, 'optionalAccess',
|
|
2077
|
-
const ending = _optionalChain([templateData, 'optionalAccess',
|
|
2131
|
+
if (_optionalChain([templateData, 'optionalAccess', _107 => _107.match, 'call', _108 => _108(/[\r\n]$/)])) {
|
|
2132
|
+
const ending = _optionalChain([templateData, 'optionalAccess', _109 => _109.includes, 'call', _110 => _110("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _111 => _111.includes, 'call', _112 => _112("\r")]) ? "\r" : "\n";
|
|
2078
2133
|
return ending;
|
|
2079
2134
|
}
|
|
2080
2135
|
return "";
|
|
@@ -2349,15 +2404,15 @@ function createAilLoader() {
|
|
|
2349
2404
|
}
|
|
2350
2405
|
const entries = dictionary.ENTRY || [];
|
|
2351
2406
|
for (const entry of entries) {
|
|
2352
|
-
const id = _optionalChain([entry, 'access',
|
|
2407
|
+
const id = _optionalChain([entry, 'access', _113 => _113.$, 'optionalAccess', _114 => _114.id]);
|
|
2353
2408
|
if (!id) {
|
|
2354
2409
|
continue;
|
|
2355
2410
|
}
|
|
2356
2411
|
const strings = entry.STRING || [];
|
|
2357
2412
|
const sourceString = strings.find(
|
|
2358
|
-
(s) => _optionalChain([s, 'access',
|
|
2413
|
+
(s) => _optionalChain([s, 'access', _115 => _115.$, 'optionalAccess', _116 => _116.lang]) === locale
|
|
2359
2414
|
);
|
|
2360
|
-
if (_optionalChain([sourceString, 'optionalAccess',
|
|
2415
|
+
if (_optionalChain([sourceString, 'optionalAccess', _117 => _117.$, 'access', _118 => _118.value])) {
|
|
2361
2416
|
result[id] = sourceString.$.value;
|
|
2362
2417
|
}
|
|
2363
2418
|
}
|
|
@@ -2399,7 +2454,7 @@ function createAilLoader() {
|
|
|
2399
2454
|
}
|
|
2400
2455
|
const entries = dictionary.ENTRY || [];
|
|
2401
2456
|
for (const [id, value] of Object.entries(data)) {
|
|
2402
|
-
let entry = entries.find((e) => _optionalChain([e, 'access',
|
|
2457
|
+
let entry = entries.find((e) => _optionalChain([e, 'access', _119 => _119.$, 'optionalAccess', _120 => _120.id]) === id);
|
|
2403
2458
|
if (!entry) {
|
|
2404
2459
|
entry = {
|
|
2405
2460
|
$: { id },
|
|
@@ -2411,7 +2466,7 @@ function createAilLoader() {
|
|
|
2411
2466
|
entry.STRING = [];
|
|
2412
2467
|
}
|
|
2413
2468
|
let targetString = entry.STRING.find(
|
|
2414
|
-
(s) => _optionalChain([s, 'access',
|
|
2469
|
+
(s) => _optionalChain([s, 'access', _121 => _121.$, 'optionalAccess', _122 => _122.lang]) === locale
|
|
2415
2470
|
);
|
|
2416
2471
|
if (targetString) {
|
|
2417
2472
|
targetString.$.value = value;
|
|
@@ -2438,7 +2493,7 @@ function createAilLoader() {
|
|
|
2438
2493
|
// src/cli/loaders/android.ts
|
|
2439
2494
|
var _module = require('module');
|
|
2440
2495
|
|
|
2441
|
-
var require2 = _module.createRequire.call(void 0,
|
|
2496
|
+
var require2 = _module.createRequire.call(void 0, _chunkEHIR4A2Gcjs.importMetaUrl);
|
|
2442
2497
|
var sax = require2("sax");
|
|
2443
2498
|
var defaultAndroidResourcesXml = `<?xml version="1.0" encoding="utf-8"?>
|
|
2444
2499
|
<resources>
|
|
@@ -2542,7 +2597,7 @@ async function parseAndroidDocument(input2) {
|
|
|
2542
2597
|
const resourceNodes = [];
|
|
2543
2598
|
let metaIndex = 0;
|
|
2544
2599
|
for (const child of resourcesNode.$$) {
|
|
2545
|
-
const elementName = _optionalChain([child, 'optionalAccess',
|
|
2600
|
+
const elementName = _optionalChain([child, 'optionalAccess', _123 => _123["#name"]]);
|
|
2546
2601
|
if (!isResourceElementName(elementName)) {
|
|
2547
2602
|
continue;
|
|
2548
2603
|
}
|
|
@@ -2550,11 +2605,11 @@ async function parseAndroidDocument(input2) {
|
|
|
2550
2605
|
if (!meta || meta.type !== elementName) {
|
|
2551
2606
|
continue;
|
|
2552
2607
|
}
|
|
2553
|
-
const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess',
|
|
2608
|
+
const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _124 => _124.$, 'optionalAccess', _125 => _125.name]), () => ( meta.name));
|
|
2554
2609
|
if (!name) {
|
|
2555
2610
|
continue;
|
|
2556
2611
|
}
|
|
2557
|
-
const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess',
|
|
2612
|
+
const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _126 => _126.$, 'optionalAccess', _127 => _127.translatable]), () => ( ""))).toLowerCase() !== "false";
|
|
2558
2613
|
switch (meta.type) {
|
|
2559
2614
|
case "string": {
|
|
2560
2615
|
resourceNodes.push({
|
|
@@ -2567,7 +2622,7 @@ async function parseAndroidDocument(input2) {
|
|
|
2567
2622
|
break;
|
|
2568
2623
|
}
|
|
2569
2624
|
case "string-array": {
|
|
2570
|
-
const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess',
|
|
2625
|
+
const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _128 => _128.item]), () => ( []));
|
|
2571
2626
|
const items = [];
|
|
2572
2627
|
const templateItems = meta.items;
|
|
2573
2628
|
for (let i = 0; i < Math.max(itemNodes.length, templateItems.length); i++) {
|
|
@@ -2591,7 +2646,7 @@ async function parseAndroidDocument(input2) {
|
|
|
2591
2646
|
break;
|
|
2592
2647
|
}
|
|
2593
2648
|
case "plurals": {
|
|
2594
|
-
const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess',
|
|
2649
|
+
const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _129 => _129.item]), () => ( []));
|
|
2595
2650
|
const templateItems = meta.items;
|
|
2596
2651
|
const items = [];
|
|
2597
2652
|
for (const templateItem of templateItems) {
|
|
@@ -2600,7 +2655,7 @@ async function parseAndroidDocument(input2) {
|
|
|
2600
2655
|
continue;
|
|
2601
2656
|
}
|
|
2602
2657
|
const nodeItem = itemNodes.find(
|
|
2603
|
-
(item) => _optionalChain([item, 'optionalAccess',
|
|
2658
|
+
(item) => _optionalChain([item, 'optionalAccess', _130 => _130.$, 'optionalAccess', _131 => _131.quantity]) === quantity
|
|
2604
2659
|
);
|
|
2605
2660
|
if (!nodeItem) {
|
|
2606
2661
|
continue;
|
|
@@ -2874,7 +2929,7 @@ function cloneResourceNode(resource) {
|
|
|
2874
2929
|
const nodeClone = deepClone(resource.node);
|
|
2875
2930
|
const itemNodes = _nullishCoalesce(nodeClone.item, () => ( []));
|
|
2876
2931
|
const items = itemNodes.map((itemNode, index) => {
|
|
2877
|
-
const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access',
|
|
2932
|
+
const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _132 => _132.items, 'access', _133 => _133[index], 'optionalAccess', _134 => _134.meta]), () => ( _optionalChain([resource, 'access', _135 => _135.items, 'access', _136 => _136[resource.items.length - 1], 'optionalAccess', _137 => _137.meta]))), () => ( makeTextMeta([])));
|
|
2878
2933
|
return {
|
|
2879
2934
|
node: itemNode,
|
|
2880
2935
|
meta: cloneTextMeta(templateMeta)
|
|
@@ -2894,7 +2949,7 @@ function cloneResourceNode(resource) {
|
|
|
2894
2949
|
const items = [];
|
|
2895
2950
|
for (const templateItem of resource.items) {
|
|
2896
2951
|
const cloneNode = itemNodes.find(
|
|
2897
|
-
(item) => _optionalChain([item, 'optionalAccess',
|
|
2952
|
+
(item) => _optionalChain([item, 'optionalAccess', _138 => _138.$, 'optionalAccess', _139 => _139.quantity]) === templateItem.quantity
|
|
2898
2953
|
);
|
|
2899
2954
|
if (!cloneNode) {
|
|
2900
2955
|
continue;
|
|
@@ -3150,8 +3205,8 @@ function cloneDocumentStructure(document) {
|
|
|
3150
3205
|
resourceNodes.map((r) => resourceLookupKey(r.type, r.name))
|
|
3151
3206
|
);
|
|
3152
3207
|
let filtered = resourcesClone.$$.filter((child) => {
|
|
3153
|
-
const elementName = _optionalChain([child, 'optionalAccess',
|
|
3154
|
-
const name = _optionalChain([child, 'optionalAccess',
|
|
3208
|
+
const elementName = _optionalChain([child, 'optionalAccess', _140 => _140["#name"]]);
|
|
3209
|
+
const name = _optionalChain([child, 'optionalAccess', _141 => _141.$, 'optionalAccess', _142 => _142.name]);
|
|
3155
3210
|
if (!isResourceElementName(elementName) || !name) {
|
|
3156
3211
|
return true;
|
|
3157
3212
|
}
|
|
@@ -3160,7 +3215,7 @@ function cloneDocumentStructure(document) {
|
|
|
3160
3215
|
const cleaned = [];
|
|
3161
3216
|
let lastWasWhitespace = false;
|
|
3162
3217
|
for (const child of filtered) {
|
|
3163
|
-
const isWhitespace = _optionalChain([child, 'optionalAccess',
|
|
3218
|
+
const isWhitespace = _optionalChain([child, 'optionalAccess', _143 => _143["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
|
|
3164
3219
|
if (isWhitespace) {
|
|
3165
3220
|
if (!lastWasWhitespace) {
|
|
3166
3221
|
cleaned.push(child);
|
|
@@ -3182,8 +3237,8 @@ function buildResourceLookup(resources) {
|
|
|
3182
3237
|
const lookup = /* @__PURE__ */ new Map();
|
|
3183
3238
|
const children = Array.isArray(resources.$$) ? resources.$$ : [];
|
|
3184
3239
|
for (const child of children) {
|
|
3185
|
-
const type = _optionalChain([child, 'optionalAccess',
|
|
3186
|
-
const name = _optionalChain([child, 'optionalAccess',
|
|
3240
|
+
const type = _optionalChain([child, 'optionalAccess', _144 => _144["#name"]]);
|
|
3241
|
+
const name = _optionalChain([child, 'optionalAccess', _145 => _145.$, 'optionalAccess', _146 => _146.name]);
|
|
3187
3242
|
if (!type || !name || !isResourceElementName(type)) {
|
|
3188
3243
|
continue;
|
|
3189
3244
|
}
|
|
@@ -3212,7 +3267,7 @@ function cloneResourceNodeFromLookup(resource, lookup) {
|
|
|
3212
3267
|
}
|
|
3213
3268
|
case "string-array": {
|
|
3214
3269
|
const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
|
|
3215
|
-
(child) => _optionalChain([child, 'optionalAccess',
|
|
3270
|
+
(child) => _optionalChain([child, 'optionalAccess', _147 => _147["#name"]]) === "item"
|
|
3216
3271
|
);
|
|
3217
3272
|
node.item = childItems;
|
|
3218
3273
|
if (childItems.length < resource.items.length) {
|
|
@@ -3241,12 +3296,12 @@ function cloneResourceNodeFromLookup(resource, lookup) {
|
|
|
3241
3296
|
}
|
|
3242
3297
|
case "plurals": {
|
|
3243
3298
|
const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
|
|
3244
|
-
(child) => _optionalChain([child, 'optionalAccess',
|
|
3299
|
+
(child) => _optionalChain([child, 'optionalAccess', _148 => _148["#name"]]) === "item"
|
|
3245
3300
|
);
|
|
3246
3301
|
node.item = childItems;
|
|
3247
3302
|
const itemMap = /* @__PURE__ */ new Map();
|
|
3248
3303
|
for (const item of childItems) {
|
|
3249
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
3304
|
+
if (_optionalChain([item, 'optionalAccess', _149 => _149.$, 'optionalAccess', _150 => _150.quantity])) {
|
|
3250
3305
|
itemMap.set(item.$.quantity, item);
|
|
3251
3306
|
}
|
|
3252
3307
|
}
|
|
@@ -3536,7 +3591,7 @@ var _sync3 = require('csv-stringify/sync');
|
|
|
3536
3591
|
|
|
3537
3592
|
function detectKeyColumnName(csvString) {
|
|
3538
3593
|
const row = _sync.parse.call(void 0, csvString)[0];
|
|
3539
|
-
const firstColumn = _optionalChain([row, 'optionalAccess',
|
|
3594
|
+
const firstColumn = _optionalChain([row, 'optionalAccess', _151 => _151[0], 'optionalAccess', _152 => _152.trim, 'call', _153 => _153()]);
|
|
3540
3595
|
return firstColumn || "KEY";
|
|
3541
3596
|
}
|
|
3542
3597
|
function createCsvLoader() {
|
|
@@ -3766,7 +3821,7 @@ function createHtmlLoader() {
|
|
|
3766
3821
|
const attrs = LOCALIZABLE_ATTRIBUTES2[tagName];
|
|
3767
3822
|
if (!attrs) return;
|
|
3768
3823
|
for (const attr of attrs) {
|
|
3769
|
-
const value = _optionalChain([element, 'access',
|
|
3824
|
+
const value = _optionalChain([element, 'access', _154 => _154.attribs, 'optionalAccess', _155 => _155[attr]]);
|
|
3770
3825
|
if (value && value.trim()) {
|
|
3771
3826
|
result[`${path19}#${attr}`] = value.trim();
|
|
3772
3827
|
}
|
|
@@ -3958,7 +4013,7 @@ function createMarkdownLoader() {
|
|
|
3958
4013
|
yaml: yamlEngine
|
|
3959
4014
|
}
|
|
3960
4015
|
});
|
|
3961
|
-
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess',
|
|
4016
|
+
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]), () => ( ""))).filter(Boolean);
|
|
3962
4017
|
return {
|
|
3963
4018
|
...Object.fromEntries(
|
|
3964
4019
|
sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
|
|
@@ -3977,7 +4032,7 @@ function createMarkdownLoader() {
|
|
|
3977
4032
|
);
|
|
3978
4033
|
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
|
|
3979
4034
|
([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
|
|
3980
|
-
).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
4035
|
+
).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]), () => ( ""))).filter(Boolean).join("\n\n");
|
|
3981
4036
|
if (Object.keys(frontmatter).length > 0) {
|
|
3982
4037
|
content = `
|
|
3983
4038
|
${content}`;
|
|
@@ -4002,7 +4057,7 @@ function createMarkdocLoader() {
|
|
|
4002
4057
|
const result = {};
|
|
4003
4058
|
const counters = {};
|
|
4004
4059
|
traverseAndExtract(ast, "", result, counters);
|
|
4005
|
-
if (_optionalChain([ast, 'access',
|
|
4060
|
+
if (_optionalChain([ast, 'access', _160 => _160.attributes, 'optionalAccess', _161 => _161.frontmatter])) {
|
|
4006
4061
|
const frontmatter = _yaml2.default.parse(ast.attributes.frontmatter);
|
|
4007
4062
|
Object.entries(frontmatter).forEach(([key, value]) => {
|
|
4008
4063
|
if (typeof value === "string") {
|
|
@@ -4048,7 +4103,7 @@ function traverseAndExtract(node, path19, result, counters, parentType) {
|
|
|
4048
4103
|
if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
|
|
4049
4104
|
semanticType = nodeSemanticType;
|
|
4050
4105
|
}
|
|
4051
|
-
if (node.type === "text" && _optionalChain([node, 'access',
|
|
4106
|
+
if (node.type === "text" && _optionalChain([node, 'access', _162 => _162.attributes, 'optionalAccess', _163 => _163.content])) {
|
|
4052
4107
|
const content = node.attributes.content;
|
|
4053
4108
|
if (typeof content === "string" && content.trim()) {
|
|
4054
4109
|
if (semanticType) {
|
|
@@ -4075,7 +4130,7 @@ function buildPathMap(node, path19, counters, pathMap, parentType) {
|
|
|
4075
4130
|
if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
|
|
4076
4131
|
semanticType = nodeSemanticType;
|
|
4077
4132
|
}
|
|
4078
|
-
if (node.type === "text" && _optionalChain([node, 'access',
|
|
4133
|
+
if (node.type === "text" && _optionalChain([node, 'access', _164 => _164.attributes, 'optionalAccess', _165 => _165.content])) {
|
|
4079
4134
|
const content = node.attributes.content;
|
|
4080
4135
|
if (typeof content === "string" && content.trim()) {
|
|
4081
4136
|
if (semanticType) {
|
|
@@ -4098,7 +4153,7 @@ function applyTranslations(node, path19, data, pathMap) {
|
|
|
4098
4153
|
if (!node || typeof node !== "object") {
|
|
4099
4154
|
return;
|
|
4100
4155
|
}
|
|
4101
|
-
if (node.type === "text" && _optionalChain([node, 'access',
|
|
4156
|
+
if (node.type === "text" && _optionalChain([node, 'access', _166 => _166.attributes, 'optionalAccess', _167 => _167.content])) {
|
|
4102
4157
|
const content = node.attributes.content;
|
|
4103
4158
|
if (typeof content === "string") {
|
|
4104
4159
|
const contentPath = path19 ? `${path19}/attributes/content` : "attributes/content";
|
|
@@ -4411,7 +4466,7 @@ function isSkippableLine(line) {
|
|
|
4411
4466
|
function parsePropertyLine(line) {
|
|
4412
4467
|
const [key, ...valueParts] = line.split("=");
|
|
4413
4468
|
return {
|
|
4414
|
-
key: _optionalChain([key, 'optionalAccess',
|
|
4469
|
+
key: _optionalChain([key, 'optionalAccess', _168 => _168.trim, 'call', _169 => _169()]) || "",
|
|
4415
4470
|
value: valueParts.join("=").trim()
|
|
4416
4471
|
};
|
|
4417
4472
|
}
|
|
@@ -4703,7 +4758,7 @@ var Parser3 = class {
|
|
|
4703
4758
|
}
|
|
4704
4759
|
}
|
|
4705
4760
|
expect(type) {
|
|
4706
|
-
if (_optionalChain([this, 'access',
|
|
4761
|
+
if (_optionalChain([this, 'access', _170 => _170.current, 'call', _171 => _171(), 'optionalAccess', _172 => _172.type]) === type) {
|
|
4707
4762
|
this.advance();
|
|
4708
4763
|
return true;
|
|
4709
4764
|
}
|
|
@@ -4780,7 +4835,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
4780
4835
|
if (rootTranslationEntity.shouldTranslate === false) {
|
|
4781
4836
|
continue;
|
|
4782
4837
|
}
|
|
4783
|
-
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess',
|
|
4838
|
+
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _173 => _173.localizations, 'optionalAccess', _174 => _174[locale]]);
|
|
4784
4839
|
if (langTranslationEntity) {
|
|
4785
4840
|
if ("stringUnit" in langTranslationEntity) {
|
|
4786
4841
|
resultData[translationKey] = langTranslationEntity.stringUnit.value;
|
|
@@ -4794,7 +4849,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
4794
4849
|
resultData[translationKey] = {};
|
|
4795
4850
|
const pluralForms = langTranslationEntity.variations.plural;
|
|
4796
4851
|
for (const form in pluralForms) {
|
|
4797
|
-
if (_optionalChain([pluralForms, 'access',
|
|
4852
|
+
if (_optionalChain([pluralForms, 'access', _175 => _175[form], 'optionalAccess', _176 => _176.stringUnit, 'optionalAccess', _177 => _177.value])) {
|
|
4798
4853
|
resultData[translationKey][form] = pluralForms[form].stringUnit.value;
|
|
4799
4854
|
}
|
|
4800
4855
|
}
|
|
@@ -4820,7 +4875,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
4820
4875
|
const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
|
|
4821
4876
|
if (typeof value === "string") {
|
|
4822
4877
|
langDataToMerge.strings[key] = {
|
|
4823
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
4878
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _178 => _178.strings, 'optionalAccess', _179 => _179[key], 'optionalAccess', _180 => _180.extractionState]),
|
|
4824
4879
|
localizations: {
|
|
4825
4880
|
[locale]: {
|
|
4826
4881
|
stringUnit: {
|
|
@@ -4835,7 +4890,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
4835
4890
|
}
|
|
4836
4891
|
} else if (Array.isArray(value)) {
|
|
4837
4892
|
langDataToMerge.strings[key] = {
|
|
4838
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
4893
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _181 => _181.strings, 'optionalAccess', _182 => _182[key], 'optionalAccess', _183 => _183.extractionState]),
|
|
4839
4894
|
localizations: {
|
|
4840
4895
|
[locale]: {
|
|
4841
4896
|
stringSet: {
|
|
@@ -4893,7 +4948,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
4893
4948
|
for (const [locale, localization] of Object.entries(
|
|
4894
4949
|
entity.localizations
|
|
4895
4950
|
)) {
|
|
4896
|
-
if (_optionalChain([localization, 'access',
|
|
4951
|
+
if (_optionalChain([localization, 'access', _184 => _184.variations, 'optionalAccess', _185 => _185.plural])) {
|
|
4897
4952
|
const pluralForms = localization.variations.plural;
|
|
4898
4953
|
for (const form in pluralForms) {
|
|
4899
4954
|
const pluralKey = `${translationKey}/${form}`;
|
|
@@ -4913,7 +4968,7 @@ function _removeLocale(input2, locale) {
|
|
|
4913
4968
|
const { strings } = input2;
|
|
4914
4969
|
const newStrings = _lodash2.default.cloneDeep(strings);
|
|
4915
4970
|
for (const [key, value] of Object.entries(newStrings)) {
|
|
4916
|
-
if (_optionalChain([value, 'access',
|
|
4971
|
+
if (_optionalChain([value, 'access', _186 => _186.localizations, 'optionalAccess', _187 => _187[locale]])) {
|
|
4917
4972
|
delete value.localizations[locale];
|
|
4918
4973
|
}
|
|
4919
4974
|
}
|
|
@@ -5044,7 +5099,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
|
|
|
5044
5099
|
if (rootTranslationEntity.shouldTranslate === false) {
|
|
5045
5100
|
continue;
|
|
5046
5101
|
}
|
|
5047
|
-
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess',
|
|
5102
|
+
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _188 => _188.localizations, 'optionalAccess', _189 => _189[locale]]);
|
|
5048
5103
|
if (langTranslationEntity) {
|
|
5049
5104
|
if (!resultData[translationKey]) {
|
|
5050
5105
|
resultData[translationKey] = {};
|
|
@@ -5056,7 +5111,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
|
|
|
5056
5111
|
for (const [subName, subData] of Object.entries(
|
|
5057
5112
|
langTranslationEntity.substitutions
|
|
5058
5113
|
)) {
|
|
5059
|
-
const pluralForms = _optionalChain([subData, 'access',
|
|
5114
|
+
const pluralForms = _optionalChain([subData, 'access', _190 => _190.variations, 'optionalAccess', _191 => _191.plural]);
|
|
5060
5115
|
if (pluralForms) {
|
|
5061
5116
|
const forms = {};
|
|
5062
5117
|
for (const [form, formData] of Object.entries(pluralForms)) {
|
|
@@ -5081,7 +5136,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
|
|
|
5081
5136
|
const pluralForms = langTranslationEntity.variations.plural;
|
|
5082
5137
|
const forms = {};
|
|
5083
5138
|
for (const [form, formData] of Object.entries(pluralForms)) {
|
|
5084
|
-
if (_optionalChain([formData, 'optionalAccess',
|
|
5139
|
+
if (_optionalChain([formData, 'optionalAccess', _192 => _192.stringUnit, 'optionalAccess', _193 => _193.value])) {
|
|
5085
5140
|
forms[form] = formData.stringUnit.value;
|
|
5086
5141
|
}
|
|
5087
5142
|
}
|
|
@@ -5124,7 +5179,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
|
|
|
5124
5179
|
for (const [subName, subData] of Object.entries(
|
|
5125
5180
|
keyData.substitutions
|
|
5126
5181
|
)) {
|
|
5127
|
-
const pluralValue = _optionalChain([subData, 'optionalAccess',
|
|
5182
|
+
const pluralValue = _optionalChain([subData, 'optionalAccess', _194 => _194.variations, 'optionalAccess', _195 => _195.plural]);
|
|
5128
5183
|
if (pluralValue && isIcuPluralString(pluralValue)) {
|
|
5129
5184
|
try {
|
|
5130
5185
|
const pluralForms = parseIcuPluralString(pluralValue, locale);
|
|
@@ -5137,8 +5192,8 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
|
|
|
5137
5192
|
}
|
|
5138
5193
|
};
|
|
5139
5194
|
}
|
|
5140
|
-
const sourceLocale = _optionalChain([originalInput, 'optionalAccess',
|
|
5141
|
-
const origFormatSpec = _optionalChain([originalInput, 'optionalAccess',
|
|
5195
|
+
const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _196 => _196.sourceLanguage]) || "en";
|
|
5196
|
+
const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _197 => _197.strings, 'optionalAccess', _198 => _198[baseKey], 'optionalAccess', _199 => _199.localizations, 'optionalAccess', _200 => _200[sourceLocale], 'optionalAccess', _201 => _201.substitutions, 'optionalAccess', _202 => _202[subName], 'optionalAccess', _203 => _203.formatSpecifier]) || subName;
|
|
5142
5197
|
subs[subName] = {
|
|
5143
5198
|
formatSpecifier: origFormatSpec,
|
|
5144
5199
|
variations: {
|
|
@@ -5163,7 +5218,7 @@ ${error instanceof Error ? error.message : String(error)}`
|
|
|
5163
5218
|
values: keyData.stringSet
|
|
5164
5219
|
};
|
|
5165
5220
|
}
|
|
5166
|
-
if ("variations" in keyData && _optionalChain([keyData, 'access',
|
|
5221
|
+
if ("variations" in keyData && _optionalChain([keyData, 'access', _204 => _204.variations, 'optionalAccess', _205 => _205.plural])) {
|
|
5167
5222
|
const pluralValue = keyData.variations.plural;
|
|
5168
5223
|
if (isIcuPluralString(pluralValue)) {
|
|
5169
5224
|
try {
|
|
@@ -5190,7 +5245,7 @@ ${error instanceof Error ? error.message : String(error)}`
|
|
|
5190
5245
|
}
|
|
5191
5246
|
if (Object.keys(localizationData).length > 0) {
|
|
5192
5247
|
langDataToMerge.strings[baseKey] = {
|
|
5193
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
5248
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _206 => _206.strings, 'optionalAccess', _207 => _207[baseKey], 'optionalAccess', _208 => _208.extractionState]),
|
|
5194
5249
|
localizations: {
|
|
5195
5250
|
[locale]: localizationData
|
|
5196
5251
|
}
|
|
@@ -5413,8 +5468,8 @@ async function formatDataWithBiome(data, filePath, options) {
|
|
|
5413
5468
|
});
|
|
5414
5469
|
return formatted.content;
|
|
5415
5470
|
} catch (error) {
|
|
5416
|
-
const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access',
|
|
5417
|
-
if (_optionalChain([errorMessage, 'optionalAccess',
|
|
5471
|
+
const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _209 => _209.stackTrace, 'optionalAccess', _210 => _210.toString, 'call', _211 => _211(), 'access', _212 => _212.split, 'call', _213 => _213("\n"), 'access', _214 => _214[0]]) : "";
|
|
5472
|
+
if (_optionalChain([errorMessage, 'optionalAccess', _215 => _215.includes, 'call', _216 => _216("does not exist in the workspace")])) {
|
|
5418
5473
|
} else {
|
|
5419
5474
|
console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
|
|
5420
5475
|
if (errorMessage) {
|
|
@@ -5461,7 +5516,7 @@ function createPoDataLoader(params) {
|
|
|
5461
5516
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
5462
5517
|
if (msgid && entry.msgid) {
|
|
5463
5518
|
const context = entry.msgctxt || "";
|
|
5464
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
5519
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _217 => _217.translations, 'access', _218 => _218[context], 'optionalAccess', _219 => _219[msgid]]);
|
|
5465
5520
|
if (fullEntry) {
|
|
5466
5521
|
result[msgid] = fullEntry;
|
|
5467
5522
|
}
|
|
@@ -5471,8 +5526,8 @@ function createPoDataLoader(params) {
|
|
|
5471
5526
|
return result;
|
|
5472
5527
|
},
|
|
5473
5528
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
5474
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
5475
|
-
const originalSections = _optionalChain([originalInput, 'optionalAccess',
|
|
5529
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _220 => _220.split, 'call', _221 => _221("\n\n"), 'access', _222 => _222.filter, 'call', _223 => _223(Boolean)]) || [];
|
|
5530
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _224 => _224.split, 'call', _225 => _225("\n\n"), 'access', _226 => _226.filter, 'call', _227 => _227(Boolean)]) || [];
|
|
5476
5531
|
const result = originalSections.map((section) => {
|
|
5477
5532
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
5478
5533
|
if (Object.keys(sectionPo.translations).length === 0) {
|
|
@@ -5543,8 +5598,8 @@ function createPoContentLoader() {
|
|
|
5543
5598
|
{
|
|
5544
5599
|
...entry,
|
|
5545
5600
|
msgstr: [
|
|
5546
|
-
_optionalChain([data, 'access',
|
|
5547
|
-
_optionalChain([data, 'access',
|
|
5601
|
+
_optionalChain([data, 'access', _228 => _228[entry.msgid], 'optionalAccess', _229 => _229.singular]),
|
|
5602
|
+
_optionalChain([data, 'access', _230 => _230[entry.msgid], 'optionalAccess', _231 => _231.plural]) || null
|
|
5548
5603
|
].filter(Boolean)
|
|
5549
5604
|
}
|
|
5550
5605
|
]).fromPairs().value();
|
|
@@ -5666,7 +5721,7 @@ function pullV1(xliffElement, locale, originalLocale) {
|
|
|
5666
5721
|
let key = getTransUnitKey(unit);
|
|
5667
5722
|
if (!key) return;
|
|
5668
5723
|
if (seenKeys.has(key)) {
|
|
5669
|
-
const id = _optionalChain([unit, 'access',
|
|
5724
|
+
const id = _optionalChain([unit, 'access', _232 => _232.getAttribute, 'call', _233 => _233("id"), 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
|
|
5670
5725
|
if (id) {
|
|
5671
5726
|
key = `${key}#${id}`;
|
|
5672
5727
|
} else {
|
|
@@ -5714,7 +5769,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
5714
5769
|
let key = getTransUnitKey(unit);
|
|
5715
5770
|
if (!key) return;
|
|
5716
5771
|
if (seenKeys.has(key)) {
|
|
5717
|
-
const id = _optionalChain([unit, 'access',
|
|
5772
|
+
const id = _optionalChain([unit, 'access', _236 => _236.getAttribute, 'call', _237 => _237("id"), 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
|
|
5718
5773
|
if (id) {
|
|
5719
5774
|
key = `${key}#${id}`;
|
|
5720
5775
|
} else {
|
|
@@ -5756,7 +5811,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
5756
5811
|
const translationKeys = new Set(Object.keys(translations));
|
|
5757
5812
|
existingUnits.forEach((unit, key) => {
|
|
5758
5813
|
if (!translationKeys.has(key)) {
|
|
5759
|
-
_optionalChain([unit, 'access',
|
|
5814
|
+
_optionalChain([unit, 'access', _240 => _240.parentNode, 'optionalAccess', _241 => _241.removeChild, 'call', _242 => _242(unit)]);
|
|
5760
5815
|
}
|
|
5761
5816
|
});
|
|
5762
5817
|
return serializeWithDeclaration(
|
|
@@ -5799,18 +5854,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
|
|
|
5799
5854
|
Array.from(container.children).forEach((child) => {
|
|
5800
5855
|
const tagName = child.tagName;
|
|
5801
5856
|
if (tagName === "unit") {
|
|
5802
|
-
const unitId = _optionalChain([child, 'access',
|
|
5857
|
+
const unitId = _optionalChain([child, 'access', _243 => _243.getAttribute, 'call', _244 => _244("id"), 'optionalAccess', _245 => _245.trim, 'call', _246 => _246()]);
|
|
5803
5858
|
if (!unitId) return;
|
|
5804
5859
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
5805
5860
|
const segment = child.querySelector("segment");
|
|
5806
|
-
const source = _optionalChain([segment, 'optionalAccess',
|
|
5861
|
+
const source = _optionalChain([segment, 'optionalAccess', _247 => _247.querySelector, 'call', _248 => _248("source")]);
|
|
5807
5862
|
if (source) {
|
|
5808
5863
|
result[key] = extractTextContent(source);
|
|
5809
5864
|
} else {
|
|
5810
5865
|
result[key] = unitId;
|
|
5811
5866
|
}
|
|
5812
5867
|
} else if (tagName === "group") {
|
|
5813
|
-
const groupId = _optionalChain([child, 'access',
|
|
5868
|
+
const groupId = _optionalChain([child, 'access', _249 => _249.getAttribute, 'call', _250 => _250("id"), 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]);
|
|
5814
5869
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
5815
5870
|
traverseUnitsV2(child, fileId, newPath, result);
|
|
5816
5871
|
}
|
|
@@ -5846,12 +5901,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
|
|
|
5846
5901
|
Array.from(container.children).forEach((child) => {
|
|
5847
5902
|
const tagName = child.tagName;
|
|
5848
5903
|
if (tagName === "unit") {
|
|
5849
|
-
const unitId = _optionalChain([child, 'access',
|
|
5904
|
+
const unitId = _optionalChain([child, 'access', _253 => _253.getAttribute, 'call', _254 => _254("id"), 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
|
|
5850
5905
|
if (!unitId) return;
|
|
5851
5906
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
5852
5907
|
index.set(key, child);
|
|
5853
5908
|
} else if (tagName === "group") {
|
|
5854
|
-
const groupId = _optionalChain([child, 'access',
|
|
5909
|
+
const groupId = _optionalChain([child, 'access', _257 => _257.getAttribute, 'call', _258 => _258("id"), 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()]);
|
|
5855
5910
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
5856
5911
|
indexUnitsV2(child, fileId, newPath, index);
|
|
5857
5912
|
}
|
|
@@ -5872,9 +5927,9 @@ function updateUnitV2(unit, value) {
|
|
|
5872
5927
|
setTextContent(source, value);
|
|
5873
5928
|
}
|
|
5874
5929
|
function getTransUnitKey(transUnit) {
|
|
5875
|
-
const resname = _optionalChain([transUnit, 'access',
|
|
5930
|
+
const resname = _optionalChain([transUnit, 'access', _261 => _261.getAttribute, 'call', _262 => _262("resname"), 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]);
|
|
5876
5931
|
if (resname) return resname;
|
|
5877
|
-
const id = _optionalChain([transUnit, 'access',
|
|
5932
|
+
const id = _optionalChain([transUnit, 'access', _265 => _265.getAttribute, 'call', _266 => _266("id"), 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
|
|
5878
5933
|
if (id) return id;
|
|
5879
5934
|
const sourceElement = transUnit.querySelector("source");
|
|
5880
5935
|
if (sourceElement) {
|
|
@@ -5931,7 +5986,7 @@ function formatXml(xml) {
|
|
|
5931
5986
|
if (cdataNode) {
|
|
5932
5987
|
return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
|
|
5933
5988
|
}
|
|
5934
|
-
const textContent3 = _optionalChain([element, 'access',
|
|
5989
|
+
const textContent3 = _optionalChain([element, 'access', _269 => _269.textContent, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]) || "";
|
|
5935
5990
|
const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
|
|
5936
5991
|
if (hasOnlyText && textContent3) {
|
|
5937
5992
|
return `${indent2}${openTag}${textContent3}</${tagName}>`;
|
|
@@ -6224,7 +6279,7 @@ function createDatoClient(params) {
|
|
|
6224
6279
|
ids: !records.length ? void 0 : records.join(",")
|
|
6225
6280
|
}
|
|
6226
6281
|
}).catch(
|
|
6227
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
6282
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _272 => _272.response, 'optionalAccess', _273 => _273.body, 'optionalAccess', _274 => _274.data, 'optionalAccess', _275 => _275[0]]) || error)
|
|
6228
6283
|
);
|
|
6229
6284
|
},
|
|
6230
6285
|
findRecordsForModel: async (modelId, records) => {
|
|
@@ -6235,10 +6290,10 @@ function createDatoClient(params) {
|
|
|
6235
6290
|
filter: {
|
|
6236
6291
|
type: modelId,
|
|
6237
6292
|
only_valid: "true",
|
|
6238
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
6293
|
+
ids: !_optionalChain([records, 'optionalAccess', _276 => _276.length]) ? void 0 : records.join(",")
|
|
6239
6294
|
}
|
|
6240
6295
|
}).catch(
|
|
6241
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
6296
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _277 => _277.response, 'optionalAccess', _278 => _278.body, 'optionalAccess', _279 => _279.data, 'optionalAccess', _280 => _280[0]]) || error)
|
|
6242
6297
|
);
|
|
6243
6298
|
return result;
|
|
6244
6299
|
} catch (_error) {
|
|
@@ -6254,10 +6309,10 @@ function createDatoClient(params) {
|
|
|
6254
6309
|
updateRecord: async (id, payload) => {
|
|
6255
6310
|
try {
|
|
6256
6311
|
await dato.items.update(id, payload).catch(
|
|
6257
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
6312
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _281 => _281.response, 'optionalAccess', _282 => _282.body, 'optionalAccess', _283 => _283.data, 'optionalAccess', _284 => _284[0]]) || error)
|
|
6258
6313
|
);
|
|
6259
6314
|
} catch (_error) {
|
|
6260
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
6315
|
+
if (_optionalChain([_error, 'optionalAccess', _285 => _285.attributes, 'optionalAccess', _286 => _286.details, 'optionalAccess', _287 => _287.message])) {
|
|
6261
6316
|
throw new Error(
|
|
6262
6317
|
[
|
|
6263
6318
|
`${_error.attributes.details.message}`,
|
|
@@ -6279,10 +6334,10 @@ function createDatoClient(params) {
|
|
|
6279
6334
|
enableFieldLocalization: async (args) => {
|
|
6280
6335
|
try {
|
|
6281
6336
|
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
|
|
6282
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
6337
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _288 => _288.response, 'optionalAccess', _289 => _289.body, 'optionalAccess', _290 => _290.data, 'optionalAccess', _291 => _291[0]]) || error)
|
|
6283
6338
|
);
|
|
6284
6339
|
} catch (_error) {
|
|
6285
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
6340
|
+
if (_optionalChain([_error, 'optionalAccess', _292 => _292.attributes, 'optionalAccess', _293 => _293.code]) === "NOT_FOUND") {
|
|
6286
6341
|
throw new Error(
|
|
6287
6342
|
[
|
|
6288
6343
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -6290,7 +6345,7 @@ function createDatoClient(params) {
|
|
|
6290
6345
|
].join("\n\n")
|
|
6291
6346
|
);
|
|
6292
6347
|
}
|
|
6293
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
6348
|
+
if (_optionalChain([_error, 'optionalAccess', _294 => _294.attributes, 'optionalAccess', _295 => _295.details, 'optionalAccess', _296 => _296.message])) {
|
|
6294
6349
|
throw new Error(
|
|
6295
6350
|
[
|
|
6296
6351
|
`${_error.attributes.details.message}`,
|
|
@@ -6368,7 +6423,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
6368
6423
|
const records = await dato.findRecordsForModel(modelId);
|
|
6369
6424
|
const recordChoices = createRecordChoices(
|
|
6370
6425
|
records,
|
|
6371
|
-
_optionalChain([config, 'access',
|
|
6426
|
+
_optionalChain([config, 'access', _297 => _297.models, 'access', _298 => _298[modelId], 'optionalAccess', _299 => _299.records]) || [],
|
|
6372
6427
|
project
|
|
6373
6428
|
);
|
|
6374
6429
|
const selectedRecords = await promptRecordSelection(
|
|
@@ -6387,14 +6442,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
6387
6442
|
},
|
|
6388
6443
|
async pull(locale, input2, initCtx) {
|
|
6389
6444
|
const result = {};
|
|
6390
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
6391
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
6445
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _300 => _300.models]) || {})) {
|
|
6446
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _301 => _301.models, 'access', _302 => _302[modelId], 'access', _303 => _303.records]) || [];
|
|
6392
6447
|
const recordIds = records.map((record) => record.id);
|
|
6393
6448
|
records = await dato.findRecords(recordIds);
|
|
6394
6449
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
6395
6450
|
if (records.length > 0) {
|
|
6396
6451
|
result[modelId] = {
|
|
6397
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
6452
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _304 => _304.models, 'optionalAccess', _305 => _305[modelId], 'optionalAccess', _306 => _306.fields]) || [],
|
|
6398
6453
|
records
|
|
6399
6454
|
};
|
|
6400
6455
|
}
|
|
@@ -6457,7 +6512,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
6457
6512
|
return records.map((record) => ({
|
|
6458
6513
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
6459
6514
|
value: record.id,
|
|
6460
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
6515
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _307 => _307.includes, 'call', _308 => _308(record.id)])
|
|
6461
6516
|
}));
|
|
6462
6517
|
}
|
|
6463
6518
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -6776,7 +6831,7 @@ function createVttLoader() {
|
|
|
6776
6831
|
if (!input2) {
|
|
6777
6832
|
return "";
|
|
6778
6833
|
}
|
|
6779
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
6834
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _309 => _309.parse, 'call', _310 => _310(input2), 'optionalAccess', _311 => _311.cues]);
|
|
6780
6835
|
if (Object.keys(vtt).length === 0) {
|
|
6781
6836
|
return {};
|
|
6782
6837
|
} else {
|
|
@@ -6830,7 +6885,7 @@ function variableExtractLoader(params) {
|
|
|
6830
6885
|
for (let i = 0; i < matches.length; i++) {
|
|
6831
6886
|
const match2 = matches[i];
|
|
6832
6887
|
const currentValue = result[key].value;
|
|
6833
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
6888
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _312 => _312.replace, 'call', _313 => _313(match2, `{variable:${i}}`)]);
|
|
6834
6889
|
result[key].value = newValue;
|
|
6835
6890
|
result[key].variables[i] = match2;
|
|
6836
6891
|
}
|
|
@@ -6845,7 +6900,7 @@ function variableExtractLoader(params) {
|
|
|
6845
6900
|
const variable = valueObj.variables[i];
|
|
6846
6901
|
const currentValue = result[key];
|
|
6847
6902
|
if (typeof currentValue === "string") {
|
|
6848
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
6903
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _314 => _314.replaceAll, 'call', _315 => _315(
|
|
6849
6904
|
`{variable:${i}}`,
|
|
6850
6905
|
variable
|
|
6851
6906
|
)]);
|
|
@@ -7049,7 +7104,7 @@ function createVueJsonLoader() {
|
|
|
7049
7104
|
return createLoader({
|
|
7050
7105
|
pull: async (locale, input2, ctx) => {
|
|
7051
7106
|
const parsed = parseVueFile(input2);
|
|
7052
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
7107
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _316 => _316.i18n, 'optionalAccess', _317 => _317[locale]]), () => ( {}));
|
|
7053
7108
|
},
|
|
7054
7109
|
push: async (locale, data, originalInput) => {
|
|
7055
7110
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -7234,7 +7289,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
7234
7289
|
objectExpression.properties.forEach((prop) => {
|
|
7235
7290
|
if (!t.isObjectProperty(prop)) return;
|
|
7236
7291
|
const key = getPropertyKey(prop);
|
|
7237
|
-
const incomingVal = _optionalChain([data, 'optionalAccess',
|
|
7292
|
+
const incomingVal = _optionalChain([data, 'optionalAccess', _318 => _318[key]]);
|
|
7238
7293
|
if (incomingVal === void 0) {
|
|
7239
7294
|
return;
|
|
7240
7295
|
}
|
|
@@ -7270,7 +7325,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
7270
7325
|
let modified = false;
|
|
7271
7326
|
arrayExpression.elements.forEach((element, index) => {
|
|
7272
7327
|
if (!element) return;
|
|
7273
|
-
const incomingVal = _optionalChain([incoming, 'optionalAccess',
|
|
7328
|
+
const incomingVal = _optionalChain([incoming, 'optionalAccess', _319 => _319[index]]);
|
|
7274
7329
|
if (incomingVal === void 0) return;
|
|
7275
7330
|
if (t.isStringLiteral(element) && typeof incomingVal === "string") {
|
|
7276
7331
|
if (element.value !== incomingVal) {
|
|
@@ -7764,7 +7819,7 @@ var AST = class _AST {
|
|
|
7764
7819
|
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
7765
7820
|
if (this.isStart() && !this.type)
|
|
7766
7821
|
ret.unshift([]);
|
|
7767
|
-
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
7822
|
+
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _320 => _320.#parent, 'optionalAccess', _321 => _321.type]) === "!")) {
|
|
7768
7823
|
ret.push({});
|
|
7769
7824
|
}
|
|
7770
7825
|
return ret;
|
|
@@ -7772,7 +7827,7 @@ var AST = class _AST {
|
|
|
7772
7827
|
isStart() {
|
|
7773
7828
|
if (this.#root === this)
|
|
7774
7829
|
return true;
|
|
7775
|
-
if (!_optionalChain([this, 'access',
|
|
7830
|
+
if (!_optionalChain([this, 'access', _322 => _322.#parent, 'optionalAccess', _323 => _323.isStart, 'call', _324 => _324()]))
|
|
7776
7831
|
return false;
|
|
7777
7832
|
if (this.#parentIndex === 0)
|
|
7778
7833
|
return true;
|
|
@@ -7788,12 +7843,12 @@ var AST = class _AST {
|
|
|
7788
7843
|
isEnd() {
|
|
7789
7844
|
if (this.#root === this)
|
|
7790
7845
|
return true;
|
|
7791
|
-
if (_optionalChain([this, 'access',
|
|
7846
|
+
if (_optionalChain([this, 'access', _325 => _325.#parent, 'optionalAccess', _326 => _326.type]) === "!")
|
|
7792
7847
|
return true;
|
|
7793
|
-
if (!_optionalChain([this, 'access',
|
|
7848
|
+
if (!_optionalChain([this, 'access', _327 => _327.#parent, 'optionalAccess', _328 => _328.isEnd, 'call', _329 => _329()]))
|
|
7794
7849
|
return false;
|
|
7795
7850
|
if (!this.type)
|
|
7796
|
-
return _optionalChain([this, 'access',
|
|
7851
|
+
return _optionalChain([this, 'access', _330 => _330.#parent, 'optionalAccess', _331 => _331.isEnd, 'call', _332 => _332()]);
|
|
7797
7852
|
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
7798
7853
|
return this.#parentIndex === pl - 1;
|
|
7799
7854
|
}
|
|
@@ -8038,7 +8093,7 @@ var AST = class _AST {
|
|
|
8038
8093
|
}
|
|
8039
8094
|
}
|
|
8040
8095
|
let end = "";
|
|
8041
|
-
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
8096
|
+
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _333 => _333.#parent, 'optionalAccess', _334 => _334.type]) === "!") {
|
|
8042
8097
|
end = "(?:$|\\/)";
|
|
8043
8098
|
}
|
|
8044
8099
|
const final2 = start2 + src + end;
|
|
@@ -8211,7 +8266,7 @@ var path13 = {
|
|
|
8211
8266
|
};
|
|
8212
8267
|
var sep = defaultPlatform === "win32" ? path13.win32.sep : path13.posix.sep;
|
|
8213
8268
|
minimatch.sep = sep;
|
|
8214
|
-
var GLOBSTAR = Symbol("globstar **");
|
|
8269
|
+
var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
8215
8270
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
8216
8271
|
var qmark2 = "[^/]";
|
|
8217
8272
|
var star2 = qmark2 + "*?";
|
|
@@ -9139,7 +9194,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
9139
9194
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
9140
9195
|
const result = {
|
|
9141
9196
|
frontmatter: data.frontmatter,
|
|
9142
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
9197
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _335 => _335.codePlaceholders]) || {},
|
|
9143
9198
|
content
|
|
9144
9199
|
};
|
|
9145
9200
|
return result;
|
|
@@ -9534,7 +9589,7 @@ function createTwigLoader() {
|
|
|
9534
9589
|
const attrs = LOCALIZABLE_ATTRIBUTES2[tagName];
|
|
9535
9590
|
if (!attrs) return;
|
|
9536
9591
|
for (const attr of attrs) {
|
|
9537
|
-
const value = _optionalChain([element, 'access',
|
|
9592
|
+
const value = _optionalChain([element, 'access', _336 => _336.attribs, 'optionalAccess', _337 => _337[attr]]);
|
|
9538
9593
|
if (value && value.trim()) {
|
|
9539
9594
|
const restoredValue = postprocessTwig(value.trim(), twigBlocks);
|
|
9540
9595
|
result[`${path19}#${attr}`] = restoredValue;
|
|
@@ -10637,7 +10692,7 @@ function createBasicTranslator(model, systemPrompt, settings = {}) {
|
|
|
10637
10692
|
]
|
|
10638
10693
|
});
|
|
10639
10694
|
const result = JSON.parse(response.text);
|
|
10640
|
-
return _optionalChain([result, 'optionalAccess',
|
|
10695
|
+
return _optionalChain([result, 'optionalAccess', _338 => _338.data]) || {};
|
|
10641
10696
|
}
|
|
10642
10697
|
}
|
|
10643
10698
|
function extractPayloadChunks(payload) {
|
|
@@ -10720,7 +10775,7 @@ function getPureModelProvider(provider) {
|
|
|
10720
10775
|
|
|
10721
10776
|
${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
|
|
10722
10777
|
`;
|
|
10723
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
10778
|
+
switch (_optionalChain([provider, 'optionalAccess', _339 => _339.id])) {
|
|
10724
10779
|
case "openai": {
|
|
10725
10780
|
if (!process.env.OPENAI_API_KEY) {
|
|
10726
10781
|
throw new Error(
|
|
@@ -10778,7 +10833,7 @@ function getPureModelProvider(provider) {
|
|
|
10778
10833
|
})(provider.model);
|
|
10779
10834
|
}
|
|
10780
10835
|
default: {
|
|
10781
|
-
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess',
|
|
10836
|
+
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _340 => _340.id])));
|
|
10782
10837
|
}
|
|
10783
10838
|
}
|
|
10784
10839
|
}
|
|
@@ -10857,7 +10912,7 @@ function parseGitUrl(url) {
|
|
|
10857
10912
|
}
|
|
10858
10913
|
const sshMatch = cleanUrl.match(/[@:]([^:/@]+\/[^:/@]+)$/);
|
|
10859
10914
|
const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
|
|
10860
|
-
const repoPath = _optionalChain([sshMatch, 'optionalAccess',
|
|
10915
|
+
const repoPath = _optionalChain([sshMatch, 'optionalAccess', _341 => _341[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _342 => _342[1]]);
|
|
10861
10916
|
if (!repoPath) return null;
|
|
10862
10917
|
if (platform) {
|
|
10863
10918
|
return `${platform}:${repoPath}`;
|
|
@@ -11166,7 +11221,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11166
11221
|
validateParams(i18nConfig, flags);
|
|
11167
11222
|
ora.succeed("Localization configuration is valid");
|
|
11168
11223
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
11169
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
11224
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _343 => _343.provider]);
|
|
11170
11225
|
if (isByokMode) {
|
|
11171
11226
|
authId = null;
|
|
11172
11227
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -11180,16 +11235,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11180
11235
|
flags
|
|
11181
11236
|
});
|
|
11182
11237
|
let buckets = getBuckets(i18nConfig);
|
|
11183
|
-
if (_optionalChain([flags, 'access',
|
|
11238
|
+
if (_optionalChain([flags, 'access', _344 => _344.bucket, 'optionalAccess', _345 => _345.length])) {
|
|
11184
11239
|
buckets = buckets.filter(
|
|
11185
11240
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
11186
11241
|
);
|
|
11187
11242
|
}
|
|
11188
11243
|
ora.succeed("Buckets retrieved");
|
|
11189
|
-
if (_optionalChain([flags, 'access',
|
|
11244
|
+
if (_optionalChain([flags, 'access', _346 => _346.file, 'optionalAccess', _347 => _347.length])) {
|
|
11190
11245
|
buckets = buckets.map((bucket) => {
|
|
11191
11246
|
const paths = bucket.paths.filter(
|
|
11192
|
-
(path19) => flags.file.find((file) => _optionalChain([path19, 'access',
|
|
11247
|
+
(path19) => flags.file.find((file) => _optionalChain([path19, 'access', _348 => _348.pathPattern, 'optionalAccess', _349 => _349.includes, 'call', _350 => _350(file)]))
|
|
11193
11248
|
);
|
|
11194
11249
|
return { ...bucket, paths };
|
|
11195
11250
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -11210,7 +11265,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11210
11265
|
});
|
|
11211
11266
|
}
|
|
11212
11267
|
}
|
|
11213
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
11268
|
+
const targetLocales = _optionalChain([flags, 'access', _351 => _351.locale, 'optionalAccess', _352 => _352.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
11214
11269
|
ora.start("Setting up localization cache...");
|
|
11215
11270
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
11216
11271
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -11495,7 +11550,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11495
11550
|
}
|
|
11496
11551
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
11497
11552
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
11498
|
-
if (!_optionalChain([flags, 'access',
|
|
11553
|
+
if (!_optionalChain([flags, 'access', _353 => _353.locale, 'optionalAccess', _354 => _354.length])) {
|
|
11499
11554
|
await deltaProcessor.saveChecksums(checksums);
|
|
11500
11555
|
}
|
|
11501
11556
|
}
|
|
@@ -11622,12 +11677,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
11622
11677
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
11623
11678
|
docUrl: "bucketNotFound"
|
|
11624
11679
|
});
|
|
11625
|
-
} else if (_optionalChain([flags, 'access',
|
|
11680
|
+
} else if (_optionalChain([flags, 'access', _355 => _355.locale, 'optionalAccess', _356 => _356.some, 'call', _357 => _357((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
11626
11681
|
throw new ValidationError({
|
|
11627
11682
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
11628
11683
|
docUrl: "localeTargetNotFound"
|
|
11629
11684
|
});
|
|
11630
|
-
} else if (_optionalChain([flags, 'access',
|
|
11685
|
+
} else if (_optionalChain([flags, 'access', _358 => _358.bucket, 'optionalAccess', _359 => _359.some, 'call', _360 => _360(
|
|
11631
11686
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
11632
11687
|
)])) {
|
|
11633
11688
|
throw new ValidationError({
|
|
@@ -12161,7 +12216,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
12161
12216
|
const response = await engine.whoami();
|
|
12162
12217
|
return {
|
|
12163
12218
|
authenticated: !!response,
|
|
12164
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
12219
|
+
username: _optionalChain([response, 'optionalAccess', _361 => _361.email])
|
|
12165
12220
|
};
|
|
12166
12221
|
} catch (error) {
|
|
12167
12222
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -12277,7 +12332,7 @@ function createExplicitLocalizer(provider) {
|
|
|
12277
12332
|
}
|
|
12278
12333
|
function createAiSdkLocalizer(params) {
|
|
12279
12334
|
const skipAuth = params.skipAuth === true;
|
|
12280
|
-
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
12335
|
+
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _362 => _362.apiKeyName]), () => ( ""))];
|
|
12281
12336
|
if (!skipAuth && !apiKey || !params.apiKeyName) {
|
|
12282
12337
|
throw new Error(
|
|
12283
12338
|
_dedent2.default`
|
|
@@ -12411,8 +12466,8 @@ async function setup(input2) {
|
|
|
12411
12466
|
throw new Error(
|
|
12412
12467
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
12413
12468
|
);
|
|
12414
|
-
} else if (_optionalChain([ctx, 'access',
|
|
12415
|
-
(bucket) => !_optionalChain([ctx, 'access',
|
|
12469
|
+
} else if (_optionalChain([ctx, 'access', _363 => _363.flags, 'access', _364 => _364.bucket, 'optionalAccess', _365 => _365.some, 'call', _366 => _366(
|
|
12470
|
+
(bucket) => !_optionalChain([ctx, 'access', _367 => _367.config, 'optionalAccess', _368 => _368.buckets, 'access', _369 => _369[bucket]])
|
|
12416
12471
|
)])) {
|
|
12417
12472
|
throw new Error(
|
|
12418
12473
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -12425,7 +12480,7 @@ async function setup(input2) {
|
|
|
12425
12480
|
title: "Selecting localization provider",
|
|
12426
12481
|
task: async (ctx, task) => {
|
|
12427
12482
|
ctx.localizer = createLocalizer(
|
|
12428
|
-
_optionalChain([ctx, 'access',
|
|
12483
|
+
_optionalChain([ctx, 'access', _370 => _370.config, 'optionalAccess', _371 => _371.provider]),
|
|
12429
12484
|
ctx.flags.apiKey
|
|
12430
12485
|
);
|
|
12431
12486
|
if (!ctx.localizer) {
|
|
@@ -12438,7 +12493,7 @@ async function setup(input2) {
|
|
|
12438
12493
|
},
|
|
12439
12494
|
{
|
|
12440
12495
|
title: "Checking authentication",
|
|
12441
|
-
enabled: (ctx) => _optionalChain([ctx, 'access',
|
|
12496
|
+
enabled: (ctx) => _optionalChain([ctx, 'access', _372 => _372.localizer, 'optionalAccess', _373 => _373.id]) === "Lingo.dev",
|
|
12442
12497
|
task: async (ctx, task) => {
|
|
12443
12498
|
const authStatus = await ctx.localizer.checkAuth();
|
|
12444
12499
|
if (!authStatus.authenticated) {
|
|
@@ -12451,7 +12506,7 @@ async function setup(input2) {
|
|
|
12451
12506
|
},
|
|
12452
12507
|
{
|
|
12453
12508
|
title: "Validating configuration",
|
|
12454
|
-
enabled: (ctx) => _optionalChain([ctx, 'access',
|
|
12509
|
+
enabled: (ctx) => _optionalChain([ctx, 'access', _374 => _374.localizer, 'optionalAccess', _375 => _375.id]) !== "Lingo.dev",
|
|
12455
12510
|
task: async (ctx, task) => {
|
|
12456
12511
|
const validationStatus = await ctx.localizer.validateSettings();
|
|
12457
12512
|
if (!validationStatus.valid) {
|
|
@@ -12782,7 +12837,7 @@ function createWorkerTask(args) {
|
|
|
12782
12837
|
const processableData = _lodash2.default.chain(sourceData).entries().filter(
|
|
12783
12838
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
12784
12839
|
).filter(
|
|
12785
|
-
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access',
|
|
12840
|
+
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _376 => _376.onlyKeys, 'optionalAccess', _377 => _377.some, 'call', _378 => _378(
|
|
12786
12841
|
(pattern) => minimatch(key, pattern)
|
|
12787
12842
|
)])
|
|
12788
12843
|
).fromPairs().value();
|
|
@@ -12850,7 +12905,7 @@ function createWorkerTask(args) {
|
|
|
12850
12905
|
finalRenamedTargetData
|
|
12851
12906
|
);
|
|
12852
12907
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
12853
|
-
if (!_optionalChain([args, 'access',
|
|
12908
|
+
if (!_optionalChain([args, 'access', _379 => _379.ctx, 'access', _380 => _380.flags, 'access', _381 => _381.targetLocale, 'optionalAccess', _382 => _382.length])) {
|
|
12854
12909
|
await deltaProcessor.saveChecksums(checksums);
|
|
12855
12910
|
}
|
|
12856
12911
|
});
|
|
@@ -13055,10 +13110,10 @@ var flagsSchema2 = _zod.z.object({
|
|
|
13055
13110
|
async function frozen(input2) {
|
|
13056
13111
|
console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
|
|
13057
13112
|
let buckets = getBuckets(input2.config);
|
|
13058
|
-
if (_optionalChain([input2, 'access',
|
|
13113
|
+
if (_optionalChain([input2, 'access', _383 => _383.flags, 'access', _384 => _384.bucket, 'optionalAccess', _385 => _385.length])) {
|
|
13059
13114
|
buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
|
|
13060
13115
|
}
|
|
13061
|
-
if (_optionalChain([input2, 'access',
|
|
13116
|
+
if (_optionalChain([input2, 'access', _386 => _386.flags, 'access', _387 => _387.file, 'optionalAccess', _388 => _388.length])) {
|
|
13062
13117
|
buckets = buckets.map((bucket) => {
|
|
13063
13118
|
const paths = bucket.paths.filter(
|
|
13064
13119
|
(p) => input2.flags.file.some(
|
|
@@ -13195,13 +13250,13 @@ async function frozen(input2) {
|
|
|
13195
13250
|
|
|
13196
13251
|
// src/cli/cmd/run/_utils.ts
|
|
13197
13252
|
async function determineAuthId(ctx) {
|
|
13198
|
-
const isByokMode = !!_optionalChain([ctx, 'access',
|
|
13253
|
+
const isByokMode = !!_optionalChain([ctx, 'access', _389 => _389.config, 'optionalAccess', _390 => _390.provider]);
|
|
13199
13254
|
if (isByokMode) {
|
|
13200
13255
|
return null;
|
|
13201
13256
|
} else {
|
|
13202
13257
|
try {
|
|
13203
|
-
const authStatus = await _optionalChain([ctx, 'access',
|
|
13204
|
-
return _optionalChain([authStatus, 'optionalAccess',
|
|
13258
|
+
const authStatus = await _optionalChain([ctx, 'access', _391 => _391.localizer, 'optionalAccess', _392 => _392.checkAuth, 'call', _393 => _393()]);
|
|
13259
|
+
return _optionalChain([authStatus, 'optionalAccess', _394 => _394.username]) || null;
|
|
13205
13260
|
} catch (e4) {
|
|
13206
13261
|
return null;
|
|
13207
13262
|
}
|
|
@@ -13209,7 +13264,7 @@ async function determineAuthId(ctx) {
|
|
|
13209
13264
|
}
|
|
13210
13265
|
|
|
13211
13266
|
// src/cli/cmd/run/index.ts
|
|
13212
|
-
var __dirname = path14.default.dirname(_url.fileURLToPath.call(void 0,
|
|
13267
|
+
var __dirname = path14.default.dirname(_url.fileURLToPath.call(void 0, _chunkEHIR4A2Gcjs.importMetaUrl));
|
|
13213
13268
|
function playSound(type) {
|
|
13214
13269
|
const platform = _os2.default.platform();
|
|
13215
13270
|
return new Promise((resolve) => {
|
|
@@ -13401,7 +13456,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13401
13456
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
13402
13457
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
13403
13458
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
13404
|
-
_optionalChain([this, 'access',
|
|
13459
|
+
_optionalChain([this, 'access', _395 => _395.platformKit, 'optionalAccess', _396 => _396.gitConfig, 'call', _397 => _397()]);
|
|
13405
13460
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
13406
13461
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
13407
13462
|
if (!processOwnCommits) {
|
|
@@ -13433,7 +13488,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13433
13488
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
13434
13489
|
var PullRequestFlow = class extends InBranchFlow {
|
|
13435
13490
|
async preRun() {
|
|
13436
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
13491
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _398 => _398()]);
|
|
13437
13492
|
if (!canContinue) {
|
|
13438
13493
|
return false;
|
|
13439
13494
|
}
|
|
@@ -13700,10 +13755,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
13700
13755
|
repo_slug: this.platformConfig.repositoryName,
|
|
13701
13756
|
state: "OPEN"
|
|
13702
13757
|
}).then(({ data: { values } }) => {
|
|
13703
|
-
return _optionalChain([values, 'optionalAccess',
|
|
13704
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
13758
|
+
return _optionalChain([values, 'optionalAccess', _399 => _399.find, 'call', _400 => _400(
|
|
13759
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _401 => _401.branch, 'optionalAccess', _402 => _402.name]) === branch && _optionalChain([destination, 'optionalAccess', _403 => _403.branch, 'optionalAccess', _404 => _404.name]) === this.platformConfig.baseBranchName
|
|
13705
13760
|
)]);
|
|
13706
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
13761
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _405 => _405.id]));
|
|
13707
13762
|
}
|
|
13708
13763
|
async closePullRequest({ pullRequestNumber }) {
|
|
13709
13764
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -13799,7 +13854,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
13799
13854
|
repo: this.platformConfig.repositoryName,
|
|
13800
13855
|
base: this.platformConfig.baseBranchName,
|
|
13801
13856
|
state: "open"
|
|
13802
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
13857
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _406 => _406.number]));
|
|
13803
13858
|
}
|
|
13804
13859
|
async closePullRequest({ pullRequestNumber }) {
|
|
13805
13860
|
await this.octokit.rest.pulls.update({
|
|
@@ -13926,7 +13981,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
13926
13981
|
sourceBranch: branch,
|
|
13927
13982
|
state: "opened"
|
|
13928
13983
|
});
|
|
13929
|
-
return _optionalChain([mergeRequests, 'access',
|
|
13984
|
+
return _optionalChain([mergeRequests, 'access', _407 => _407[0], 'optionalAccess', _408 => _408.iid]);
|
|
13930
13985
|
}
|
|
13931
13986
|
async closePullRequest({
|
|
13932
13987
|
pullRequestNumber
|
|
@@ -14038,7 +14093,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
14038
14093
|
}
|
|
14039
14094
|
const env = {
|
|
14040
14095
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
14041
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
14096
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _409 => _409.pullRequest, 'optionalAccess', _410 => _410.toString, 'call', _411 => _411()]) || "false",
|
|
14042
14097
|
...options.commitMessage && {
|
|
14043
14098
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
14044
14099
|
},
|
|
@@ -14064,7 +14119,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
14064
14119
|
const { isPullRequestMode } = platformKit.config;
|
|
14065
14120
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
14066
14121
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
14067
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
14122
|
+
const canRun = await _optionalChain([flow, 'access', _412 => _412.preRun, 'optionalCall', _413 => _413()]);
|
|
14068
14123
|
if (canRun === false) {
|
|
14069
14124
|
return;
|
|
14070
14125
|
}
|
|
@@ -14074,7 +14129,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
14074
14129
|
if (!hasChanges) {
|
|
14075
14130
|
return;
|
|
14076
14131
|
}
|
|
14077
|
-
await _optionalChain([flow, 'access',
|
|
14132
|
+
await _optionalChain([flow, 'access', _414 => _414.postRun, 'optionalCall', _415 => _415()]);
|
|
14078
14133
|
});
|
|
14079
14134
|
function parseBooleanArg(val) {
|
|
14080
14135
|
if (val === true) return true;
|
|
@@ -14111,8 +14166,8 @@ function exitGracefully(elapsedMs = 0) {
|
|
|
14111
14166
|
}
|
|
14112
14167
|
}
|
|
14113
14168
|
function checkForPendingOperations() {
|
|
14114
|
-
const activeHandles = _optionalChain([process, 'access',
|
|
14115
|
-
const activeRequests = _optionalChain([process, 'access',
|
|
14169
|
+
const activeHandles = _optionalChain([process, 'access', _416 => _416._getActiveHandles, 'optionalCall', _417 => _417()]) || [];
|
|
14170
|
+
const activeRequests = _optionalChain([process, 'access', _418 => _418._getActiveRequests, 'optionalCall', _419 => _419()]) || [];
|
|
14116
14171
|
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
14117
14172
|
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
14118
14173
|
return false;
|
|
@@ -14181,17 +14236,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14181
14236
|
flags
|
|
14182
14237
|
});
|
|
14183
14238
|
let buckets = getBuckets(i18nConfig);
|
|
14184
|
-
if (_optionalChain([flags, 'access',
|
|
14239
|
+
if (_optionalChain([flags, 'access', _420 => _420.bucket, 'optionalAccess', _421 => _421.length])) {
|
|
14185
14240
|
buckets = buckets.filter(
|
|
14186
14241
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
14187
14242
|
);
|
|
14188
14243
|
}
|
|
14189
14244
|
ora.succeed("Buckets retrieved");
|
|
14190
|
-
if (_optionalChain([flags, 'access',
|
|
14245
|
+
if (_optionalChain([flags, 'access', _422 => _422.file, 'optionalAccess', _423 => _423.length])) {
|
|
14191
14246
|
buckets = buckets.map((bucket) => {
|
|
14192
14247
|
const paths = bucket.paths.filter(
|
|
14193
14248
|
(path19) => flags.file.find(
|
|
14194
|
-
(file) => _optionalChain([path19, 'access',
|
|
14249
|
+
(file) => _optionalChain([path19, 'access', _424 => _424.pathPattern, 'optionalAccess', _425 => _425.includes, 'call', _426 => _426(file)]) || _optionalChain([path19, 'access', _427 => _427.pathPattern, 'optionalAccess', _428 => _428.match, 'call', _429 => _429(file)]) || minimatch(path19.pathPattern, file)
|
|
14195
14250
|
)
|
|
14196
14251
|
);
|
|
14197
14252
|
return { ...bucket, paths };
|
|
@@ -14211,7 +14266,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14211
14266
|
});
|
|
14212
14267
|
}
|
|
14213
14268
|
}
|
|
14214
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
14269
|
+
const targetLocales = _optionalChain([flags, 'access', _430 => _430.locale, 'optionalAccess', _431 => _431.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
14215
14270
|
let totalSourceKeyCount = 0;
|
|
14216
14271
|
let uniqueKeysToTranslate = 0;
|
|
14217
14272
|
let totalExistingTranslations = 0;
|
|
@@ -14621,12 +14676,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
14621
14676
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
14622
14677
|
docUrl: "bucketNotFound"
|
|
14623
14678
|
});
|
|
14624
|
-
} else if (_optionalChain([flags, 'access',
|
|
14679
|
+
} else if (_optionalChain([flags, 'access', _432 => _432.locale, 'optionalAccess', _433 => _433.some, 'call', _434 => _434((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
14625
14680
|
throw new CLIError({
|
|
14626
14681
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
14627
14682
|
docUrl: "localeTargetNotFound"
|
|
14628
14683
|
});
|
|
14629
|
-
} else if (_optionalChain([flags, 'access',
|
|
14684
|
+
} else if (_optionalChain([flags, 'access', _435 => _435.bucket, 'optionalAccess', _436 => _436.some, 'call', _437 => _437(
|
|
14630
14685
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
14631
14686
|
)])) {
|
|
14632
14687
|
throw new CLIError({
|
|
@@ -14718,7 +14773,7 @@ async function renderHero2() {
|
|
|
14718
14773
|
// package.json
|
|
14719
14774
|
var package_default = {
|
|
14720
14775
|
name: "lingo.dev",
|
|
14721
|
-
version: "0.117.
|
|
14776
|
+
version: "0.117.22",
|
|
14722
14777
|
description: "Lingo.dev CLI",
|
|
14723
14778
|
private: false,
|
|
14724
14779
|
repository: {
|
|
@@ -15020,7 +15075,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
|
|
|
15020
15075
|
if (options.file && options.file.length) {
|
|
15021
15076
|
buckets = buckets.map((bucket) => {
|
|
15022
15077
|
const paths = bucket.paths.filter(
|
|
15023
|
-
(bucketPath) => _optionalChain([options, 'access',
|
|
15078
|
+
(bucketPath) => _optionalChain([options, 'access', _438 => _438.file, 'optionalAccess', _439 => _439.some, 'call', _440 => _440((f) => bucketPath.pathPattern.includes(f))])
|
|
15024
15079
|
);
|
|
15025
15080
|
return { ...bucket, paths };
|
|
15026
15081
|
}).filter((bucket) => bucket.paths.length > 0);
|