lingo.dev 0.87.1 → 0.87.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.cjs +105 -87
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +60 -42
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.cjs
CHANGED
|
@@ -26,9 +26,9 @@ function getSettings(explicitApiKey) {
|
|
|
26
26
|
_envVarsInfo();
|
|
27
27
|
return {
|
|
28
28
|
auth: {
|
|
29
|
-
apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access',
|
|
30
|
-
apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access',
|
|
31
|
-
webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access',
|
|
29
|
+
apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _27 => _27.auth, 'optionalAccess', _28 => _28.apiKey]) || defaults.auth.apiKey,
|
|
30
|
+
apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _29 => _29.auth, 'optionalAccess', _30 => _30.apiUrl]) || defaults.auth.apiUrl,
|
|
31
|
+
webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _31 => _31.auth, 'optionalAccess', _32 => _32.webUrl]) || defaults.auth.webUrl
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
@@ -99,7 +99,7 @@ Please use LINGODOTDEV_API_KEY instead.
|
|
|
99
99
|
function _envVarsInfo() {
|
|
100
100
|
const env = _loadEnv();
|
|
101
101
|
const systemFile = _loadSystemFile();
|
|
102
|
-
if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access',
|
|
102
|
+
if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access', _33 => _33.auth, 'optionalAccess', _34 => _34.apiKey])) {
|
|
103
103
|
console.info(
|
|
104
104
|
"\x1B[36m%s\x1B[0m",
|
|
105
105
|
`\u2139\uFE0F Using LINGODOTDEV_API_KEY env var instead of credentials from login flow (saved in .lingodotdevrc)`
|
|
@@ -154,7 +154,7 @@ function createAuthenticator(params) {
|
|
|
154
154
|
});
|
|
155
155
|
if (res.ok) {
|
|
156
156
|
const payload = await res.json();
|
|
157
|
-
if (!_optionalChain([payload, 'optionalAccess',
|
|
157
|
+
if (!_optionalChain([payload, 'optionalAccess', _35 => _35.email])) {
|
|
158
158
|
return null;
|
|
159
159
|
}
|
|
160
160
|
return {
|
|
@@ -774,7 +774,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
|
|
|
774
774
|
});
|
|
775
775
|
const auth2 = await newAuthenticator.whoami();
|
|
776
776
|
if (auth2) {
|
|
777
|
-
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess',
|
|
777
|
+
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _36 => _36.email])}`);
|
|
778
778
|
} else {
|
|
779
779
|
_ora2.default.call(void 0, ).fail("Authentication failed.");
|
|
780
780
|
}
|
|
@@ -854,7 +854,7 @@ var locale_default = new (0, _interactivecommander.Command)().command("locale").
|
|
|
854
854
|
function getBuckets(i18nConfig) {
|
|
855
855
|
const result = Object.entries(i18nConfig.buckets).map(([bucketType, bucketEntry]) => {
|
|
856
856
|
const includeItems = bucketEntry.include.map((item) => resolveBucketItem(item));
|
|
857
|
-
const excludeItems = _optionalChain([bucketEntry, 'access',
|
|
857
|
+
const excludeItems = _optionalChain([bucketEntry, 'access', _37 => _37.exclude, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((item) => resolveBucketItem(item))]);
|
|
858
858
|
const config = {
|
|
859
859
|
type: bucketType,
|
|
860
860
|
paths: extractPathPatterns(i18nConfig.locale.source, includeItems, excludeItems)
|
|
@@ -878,7 +878,7 @@ function extractPathPatterns(sourceLocale, include, exclude) {
|
|
|
878
878
|
})
|
|
879
879
|
)
|
|
880
880
|
);
|
|
881
|
-
const excludedPatterns = _optionalChain([exclude, 'optionalAccess',
|
|
881
|
+
const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _40 => _40.flatMap, 'call', _41 => _41(
|
|
882
882
|
(pattern) => expandPlaceholderedGlob(pattern.path, __spec.resolveOverriddenLocale.call(void 0, sourceLocale, pattern.delimiter)).map(
|
|
883
883
|
(pathPattern) => ({
|
|
884
884
|
pathPattern,
|
|
@@ -1007,12 +1007,12 @@ function composeLoaders(...loaders) {
|
|
|
1007
1007
|
return {
|
|
1008
1008
|
init: async () => {
|
|
1009
1009
|
for (const loader of loaders) {
|
|
1010
|
-
await _optionalChain([loader, 'access',
|
|
1010
|
+
await _optionalChain([loader, 'access', _42 => _42.init, 'optionalCall', _43 => _43()]);
|
|
1011
1011
|
}
|
|
1012
1012
|
},
|
|
1013
1013
|
setDefaultLocale(locale) {
|
|
1014
1014
|
for (const loader of loaders) {
|
|
1015
|
-
_optionalChain([loader, 'access',
|
|
1015
|
+
_optionalChain([loader, 'access', _44 => _44.setDefaultLocale, 'optionalCall', _45 => _45(locale)]);
|
|
1016
1016
|
}
|
|
1017
1017
|
return this;
|
|
1018
1018
|
},
|
|
@@ -1045,7 +1045,7 @@ function createLoader(lDefinition) {
|
|
|
1045
1045
|
if (state.initCtx) {
|
|
1046
1046
|
return state.initCtx;
|
|
1047
1047
|
}
|
|
1048
|
-
state.initCtx = await _optionalChain([lDefinition, 'access',
|
|
1048
|
+
state.initCtx = await _optionalChain([lDefinition, 'access', _46 => _46.init, 'optionalCall', _47 => _47()]);
|
|
1049
1049
|
return state.initCtx;
|
|
1050
1050
|
},
|
|
1051
1051
|
setDefaultLocale(locale) {
|
|
@@ -1144,7 +1144,7 @@ function createNormalizeLoader() {
|
|
|
1144
1144
|
return normalized;
|
|
1145
1145
|
},
|
|
1146
1146
|
push: async (locale, data, originalInput) => {
|
|
1147
|
-
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess',
|
|
1147
|
+
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _48 => _48.keysMap]), () => ( {}));
|
|
1148
1148
|
const input2 = mapDenormalizedKeys(data, keysMap);
|
|
1149
1149
|
const denormalized = _flat.unflatten.call(void 0, input2, {
|
|
1150
1150
|
delimiter: "/",
|
|
@@ -1218,7 +1218,7 @@ function createTextFileLoader(pathPattern) {
|
|
|
1218
1218
|
const trimmedResult = result.trim();
|
|
1219
1219
|
return trimmedResult;
|
|
1220
1220
|
},
|
|
1221
|
-
async push(locale, data,
|
|
1221
|
+
async push(locale, data, _26, originalLocale) {
|
|
1222
1222
|
const draftPath = pathPattern.replaceAll("[locale]", locale);
|
|
1223
1223
|
const finalPath = path14.default.resolve(draftPath);
|
|
1224
1224
|
const dirPath = path14.default.dirname(finalPath);
|
|
@@ -1247,8 +1247,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
|
|
|
1247
1247
|
if (!templateData) {
|
|
1248
1248
|
templateData = await readFileForLocale(pathPattern, originalLocale);
|
|
1249
1249
|
}
|
|
1250
|
-
if (_optionalChain([templateData, 'optionalAccess',
|
|
1251
|
-
const ending = _optionalChain([templateData, 'optionalAccess',
|
|
1250
|
+
if (_optionalChain([templateData, 'optionalAccess', _49 => _49.match, 'call', _50 => _50(/[\r\n]$/)])) {
|
|
1251
|
+
const ending = _optionalChain([templateData, 'optionalAccess', _51 => _51.includes, 'call', _52 => _52("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _53 => _53.includes, 'call', _54 => _54("\r")]) ? "\r" : "\n";
|
|
1252
1252
|
return ending;
|
|
1253
1253
|
}
|
|
1254
1254
|
return "";
|
|
@@ -1502,7 +1502,7 @@ function createHtmlLoader() {
|
|
|
1502
1502
|
break;
|
|
1503
1503
|
}
|
|
1504
1504
|
const siblings = Array.from(parent.childNodes).filter(
|
|
1505
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1505
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _55 => _55.textContent, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()])
|
|
1506
1506
|
);
|
|
1507
1507
|
const index = siblings.indexOf(current);
|
|
1508
1508
|
if (index !== -1) {
|
|
@@ -1537,11 +1537,11 @@ function createHtmlLoader() {
|
|
|
1537
1537
|
result[getPath(element, attr)] = value;
|
|
1538
1538
|
}
|
|
1539
1539
|
});
|
|
1540
|
-
Array.from(element.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1540
|
+
Array.from(element.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _58 => _58.textContent, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()])).forEach(processNode);
|
|
1541
1541
|
}
|
|
1542
1542
|
};
|
|
1543
|
-
Array.from(document.head.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1544
|
-
Array.from(document.body.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1543
|
+
Array.from(document.head.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _61 => _61.textContent, 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()])).forEach(processNode);
|
|
1544
|
+
Array.from(document.body.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _64 => _64.textContent, 'optionalAccess', _65 => _65.trim, 'call', _66 => _66()])).forEach(processNode);
|
|
1545
1545
|
return result;
|
|
1546
1546
|
},
|
|
1547
1547
|
async push(locale, data, originalInput) {
|
|
@@ -1563,7 +1563,7 @@ function createHtmlLoader() {
|
|
|
1563
1563
|
for (let i = 0; i < indices.length; i++) {
|
|
1564
1564
|
const index = parseInt(indices[i]);
|
|
1565
1565
|
const siblings = Array.from(parent.childNodes).filter(
|
|
1566
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1566
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _67 => _67.textContent, 'optionalAccess', _68 => _68.trim, 'call', _69 => _69()])
|
|
1567
1567
|
);
|
|
1568
1568
|
if (index >= siblings.length) {
|
|
1569
1569
|
if (i === indices.length - 1) {
|
|
@@ -1614,7 +1614,7 @@ function createMarkdownLoader() {
|
|
|
1614
1614
|
yaml: yamlEngine
|
|
1615
1615
|
}
|
|
1616
1616
|
});
|
|
1617
|
-
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess',
|
|
1617
|
+
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()]), () => ( ""))).filter(Boolean);
|
|
1618
1618
|
return {
|
|
1619
1619
|
...Object.fromEntries(
|
|
1620
1620
|
sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
|
|
@@ -1626,7 +1626,7 @@ function createMarkdownLoader() {
|
|
|
1626
1626
|
const frontmatter = Object.fromEntries(
|
|
1627
1627
|
Object.entries(data).filter(([key]) => key.startsWith(FM_ATTR_PREFIX)).map(([key, value]) => [key.replace(FM_ATTR_PREFIX, ""), value])
|
|
1628
1628
|
);
|
|
1629
|
-
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
1629
|
+
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]), () => ( ""))).filter(Boolean).join("\n\n");
|
|
1630
1630
|
if (Object.keys(frontmatter).length > 0) {
|
|
1631
1631
|
content = `
|
|
1632
1632
|
${content}`;
|
|
@@ -1659,7 +1659,7 @@ function createPropertiesLoader() {
|
|
|
1659
1659
|
return result;
|
|
1660
1660
|
},
|
|
1661
1661
|
async push(locale, payload) {
|
|
1662
|
-
const result = Object.entries(payload).filter(([
|
|
1662
|
+
const result = Object.entries(payload).filter(([_26, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
|
|
1663
1663
|
return result;
|
|
1664
1664
|
}
|
|
1665
1665
|
});
|
|
@@ -1670,7 +1670,7 @@ function isSkippableLine(line) {
|
|
|
1670
1670
|
function parsePropertyLine(line) {
|
|
1671
1671
|
const [key, ...valueParts] = line.split("=");
|
|
1672
1672
|
return {
|
|
1673
|
-
key: _optionalChain([key, 'optionalAccess',
|
|
1673
|
+
key: _optionalChain([key, 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()]) || "",
|
|
1674
1674
|
value: valueParts.join("=").trim()
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
@@ -1756,7 +1756,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1756
1756
|
if (rootTranslationEntity.shouldTranslate === false) {
|
|
1757
1757
|
continue;
|
|
1758
1758
|
}
|
|
1759
|
-
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess',
|
|
1759
|
+
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _76 => _76.localizations, 'optionalAccess', _77 => _77[locale]]);
|
|
1760
1760
|
if (langTranslationEntity) {
|
|
1761
1761
|
if ("stringUnit" in langTranslationEntity) {
|
|
1762
1762
|
resultData[translationKey] = langTranslationEntity.stringUnit.value;
|
|
@@ -1765,7 +1765,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1765
1765
|
resultData[translationKey] = {};
|
|
1766
1766
|
const pluralForms = langTranslationEntity.variations.plural;
|
|
1767
1767
|
for (const form in pluralForms) {
|
|
1768
|
-
if (_optionalChain([pluralForms, 'access',
|
|
1768
|
+
if (_optionalChain([pluralForms, 'access', _78 => _78[form], 'optionalAccess', _79 => _79.stringUnit, 'optionalAccess', _80 => _80.value])) {
|
|
1769
1769
|
resultData[translationKey][form] = pluralForms[form].stringUnit.value;
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
@@ -1788,7 +1788,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1788
1788
|
const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
|
|
1789
1789
|
if (typeof value === "string") {
|
|
1790
1790
|
langDataToMerge.strings[key] = {
|
|
1791
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
1791
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _81 => _81.strings, 'optionalAccess', _82 => _82[key], 'optionalAccess', _83 => _83.extractionState]),
|
|
1792
1792
|
localizations: {
|
|
1793
1793
|
[locale]: {
|
|
1794
1794
|
stringUnit: {
|
|
@@ -1926,10 +1926,10 @@ function createUnlocalizableLoader(isCacheRestore = false, returnUnlocalizedKeys
|
|
|
1926
1926
|
}
|
|
1927
1927
|
}
|
|
1928
1928
|
return false;
|
|
1929
|
-
}).map(([key,
|
|
1930
|
-
const result = _lodash2.default.omitBy(input2, (
|
|
1929
|
+
}).map(([key, _26]) => key);
|
|
1930
|
+
const result = _lodash2.default.omitBy(input2, (_26, key) => passthroughKeys.includes(key));
|
|
1931
1931
|
if (returnUnlocalizedKeys) {
|
|
1932
|
-
result.unlocalizable = _lodash2.default.omitBy(input2, (
|
|
1932
|
+
result.unlocalizable = _lodash2.default.omitBy(input2, (_26, key) => !passthroughKeys.includes(key));
|
|
1933
1933
|
}
|
|
1934
1934
|
return result;
|
|
1935
1935
|
},
|
|
@@ -1968,7 +1968,7 @@ function createPoDataLoader(params) {
|
|
|
1968
1968
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
1969
1969
|
if (msgid && entry.msgid) {
|
|
1970
1970
|
const context = entry.msgctxt || "";
|
|
1971
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
1971
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _84 => _84.translations, 'access', _85 => _85[context], 'optionalAccess', _86 => _86[msgid]]);
|
|
1972
1972
|
if (fullEntry) {
|
|
1973
1973
|
result[msgid] = fullEntry;
|
|
1974
1974
|
}
|
|
@@ -1978,8 +1978,8 @@ function createPoDataLoader(params) {
|
|
|
1978
1978
|
return result;
|
|
1979
1979
|
},
|
|
1980
1980
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
1981
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
1982
|
-
const originalSections = _optionalChain([originalInput, 'optionalAccess',
|
|
1981
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _87 => _87.split, 'call', _88 => _88("\n\n"), 'access', _89 => _89.filter, 'call', _90 => _90(Boolean)]) || [];
|
|
1982
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _91 => _91.split, 'call', _92 => _92("\n\n"), 'access', _93 => _93.filter, 'call', _94 => _94(Boolean)]) || [];
|
|
1983
1983
|
const result = originalSections.map((section) => {
|
|
1984
1984
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
1985
1985
|
const contextKey = _lodash2.default.keys(sectionPo.translations)[0];
|
|
@@ -2033,7 +2033,7 @@ function createPoContentLoader() {
|
|
|
2033
2033
|
entry.msgid,
|
|
2034
2034
|
{
|
|
2035
2035
|
...entry,
|
|
2036
|
-
msgstr: [_optionalChain([data, 'access',
|
|
2036
|
+
msgstr: [_optionalChain([data, 'access', _95 => _95[entry.msgid], 'optionalAccess', _96 => _96.singular]), _optionalChain([data, 'access', _97 => _97[entry.msgid], 'optionalAccess', _98 => _98.plural]) || null].filter(Boolean)
|
|
2037
2037
|
}
|
|
2038
2038
|
]).fromPairs().value();
|
|
2039
2039
|
return result;
|
|
@@ -2279,7 +2279,7 @@ function createDatoClient(params) {
|
|
|
2279
2279
|
only_valid: "true",
|
|
2280
2280
|
ids: !records.length ? void 0 : records.join(",")
|
|
2281
2281
|
}
|
|
2282
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2282
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _99 => _99.response, 'optionalAccess', _100 => _100.body, 'optionalAccess', _101 => _101.data, 'optionalAccess', _102 => _102[0]]) || error));
|
|
2283
2283
|
},
|
|
2284
2284
|
findRecordsForModel: async (modelId, records) => {
|
|
2285
2285
|
try {
|
|
@@ -2289,9 +2289,9 @@ function createDatoClient(params) {
|
|
|
2289
2289
|
filter: {
|
|
2290
2290
|
type: modelId,
|
|
2291
2291
|
only_valid: "true",
|
|
2292
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
2292
|
+
ids: !_optionalChain([records, 'optionalAccess', _103 => _103.length]) ? void 0 : records.join(",")
|
|
2293
2293
|
}
|
|
2294
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2294
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _104 => _104.response, 'optionalAccess', _105 => _105.body, 'optionalAccess', _106 => _106.data, 'optionalAccess', _107 => _107[0]]) || error));
|
|
2295
2295
|
return result;
|
|
2296
2296
|
} catch (_error) {
|
|
2297
2297
|
throw new Error(
|
|
@@ -2305,9 +2305,9 @@ function createDatoClient(params) {
|
|
|
2305
2305
|
},
|
|
2306
2306
|
updateRecord: async (id, payload) => {
|
|
2307
2307
|
try {
|
|
2308
|
-
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2308
|
+
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _108 => _108.response, 'optionalAccess', _109 => _109.body, 'optionalAccess', _110 => _110.data, 'optionalAccess', _111 => _111[0]]) || error));
|
|
2309
2309
|
} catch (_error) {
|
|
2310
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2310
|
+
if (_optionalChain([_error, 'optionalAccess', _112 => _112.attributes, 'optionalAccess', _113 => _113.details, 'optionalAccess', _114 => _114.message])) {
|
|
2311
2311
|
throw new Error(
|
|
2312
2312
|
[
|
|
2313
2313
|
`${_error.attributes.details.message}`,
|
|
@@ -2328,9 +2328,9 @@ function createDatoClient(params) {
|
|
|
2328
2328
|
},
|
|
2329
2329
|
enableFieldLocalization: async (args) => {
|
|
2330
2330
|
try {
|
|
2331
|
-
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2331
|
+
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _115 => _115.response, 'optionalAccess', _116 => _116.body, 'optionalAccess', _117 => _117.data, 'optionalAccess', _118 => _118[0]]) || error));
|
|
2332
2332
|
} catch (_error) {
|
|
2333
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2333
|
+
if (_optionalChain([_error, 'optionalAccess', _119 => _119.attributes, 'optionalAccess', _120 => _120.code]) === "NOT_FOUND") {
|
|
2334
2334
|
throw new Error(
|
|
2335
2335
|
[
|
|
2336
2336
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -2338,7 +2338,7 @@ function createDatoClient(params) {
|
|
|
2338
2338
|
].join("\n\n")
|
|
2339
2339
|
);
|
|
2340
2340
|
}
|
|
2341
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2341
|
+
if (_optionalChain([_error, 'optionalAccess', _121 => _121.attributes, 'optionalAccess', _122 => _122.details, 'optionalAccess', _123 => _123.message])) {
|
|
2342
2342
|
throw new Error(
|
|
2343
2343
|
[`${_error.attributes.details.message}`, `Error: ${JSON.stringify(_error, null, 2)}`].join("\n\n")
|
|
2344
2344
|
);
|
|
@@ -2404,7 +2404,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2404
2404
|
}
|
|
2405
2405
|
}
|
|
2406
2406
|
const records = await dato.findRecordsForModel(modelId);
|
|
2407
|
-
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access',
|
|
2407
|
+
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access', _124 => _124.models, 'access', _125 => _125[modelId], 'optionalAccess', _126 => _126.records]) || [], project);
|
|
2408
2408
|
const selectedRecords = await promptRecordSelection(modelName, recordChoices);
|
|
2409
2409
|
result.models[modelId].records = records.filter((record) => selectedRecords.includes(record.id));
|
|
2410
2410
|
updatedConfig.models[modelId].records = selectedRecords;
|
|
@@ -2416,14 +2416,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2416
2416
|
},
|
|
2417
2417
|
async pull(locale, input2, initCtx) {
|
|
2418
2418
|
const result = {};
|
|
2419
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
2420
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
2419
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _127 => _127.models]) || {})) {
|
|
2420
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _128 => _128.models, 'access', _129 => _129[modelId], 'access', _130 => _130.records]) || [];
|
|
2421
2421
|
const recordIds = records.map((record) => record.id);
|
|
2422
2422
|
records = await dato.findRecords(recordIds);
|
|
2423
2423
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
2424
2424
|
if (records.length > 0) {
|
|
2425
2425
|
result[modelId] = {
|
|
2426
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
2426
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _131 => _131.models, 'optionalAccess', _132 => _132[modelId], 'optionalAccess', _133 => _133.fields]) || [],
|
|
2427
2427
|
records
|
|
2428
2428
|
};
|
|
2429
2429
|
}
|
|
@@ -2482,7 +2482,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
2482
2482
|
return records.map((record) => ({
|
|
2483
2483
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
2484
2484
|
value: record.id,
|
|
2485
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
2485
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _134 => _134.includes, 'call', _135 => _135(record.id)])
|
|
2486
2486
|
}));
|
|
2487
2487
|
}
|
|
2488
2488
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -2749,7 +2749,7 @@ var _nodewebvtt = require('node-webvtt'); var _nodewebvtt2 = _interopRequireDefa
|
|
|
2749
2749
|
function createVttLoader() {
|
|
2750
2750
|
return createLoader({
|
|
2751
2751
|
async pull(locale, input2) {
|
|
2752
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
2752
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _136 => _136.parse, 'call', _137 => _137(input2), 'optionalAccess', _138 => _138.cues]);
|
|
2753
2753
|
if (Object.keys(vtt).length === 0) {
|
|
2754
2754
|
return {};
|
|
2755
2755
|
} else {
|
|
@@ -2802,7 +2802,7 @@ function variableExtractLoader(params) {
|
|
|
2802
2802
|
for (let i = 0; i < matches.length; i++) {
|
|
2803
2803
|
const match = matches[i];
|
|
2804
2804
|
const currentValue = result[key].value;
|
|
2805
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
2805
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _139 => _139.replace, 'call', _140 => _140(match, `{variable:${i}}`)]);
|
|
2806
2806
|
result[key].value = newValue;
|
|
2807
2807
|
result[key].variables[i] = match;
|
|
2808
2808
|
}
|
|
@@ -2816,7 +2816,7 @@ function variableExtractLoader(params) {
|
|
|
2816
2816
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
2817
2817
|
const variable = valueObj.variables[i];
|
|
2818
2818
|
const currentValue = result[key];
|
|
2819
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
2819
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _141 => _141.replace, 'call', _142 => _142(`{variable:${i}}`, variable)]);
|
|
2820
2820
|
result[key] = newValue;
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
@@ -2997,7 +2997,7 @@ function createVueJsonLoader() {
|
|
|
2997
2997
|
return createLoader({
|
|
2998
2998
|
pull: async (locale, input2, ctx) => {
|
|
2999
2999
|
const parsed = parseVueFile(input2);
|
|
3000
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
3000
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _143 => _143.i18n, 'optionalAccess', _144 => _144[locale]]), () => ( {}));
|
|
3001
3001
|
},
|
|
3002
3002
|
push: async (locale, data, originalInput) => {
|
|
3003
3003
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -3098,16 +3098,34 @@ function md5(input2) {
|
|
|
3098
3098
|
}
|
|
3099
3099
|
|
|
3100
3100
|
// src/cli/loaders/mdx2/code-placeholder.ts
|
|
3101
|
-
|
|
3102
|
-
var
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3101
|
+
|
|
3102
|
+
var fenceRegex = /```([\s\S]*?)```/g;
|
|
3103
|
+
function ensureTrailingFenceNewline(_content) {
|
|
3104
|
+
let found = false;
|
|
3105
|
+
let content = _content;
|
|
3106
|
+
let workingContent = content;
|
|
3107
|
+
do {
|
|
3108
|
+
found = false;
|
|
3109
|
+
const matches = workingContent.match(fenceRegex);
|
|
3110
|
+
if (matches) {
|
|
3111
|
+
const match = matches[0];
|
|
3112
|
+
content = content.replace(match, `
|
|
3113
|
+
|
|
3114
|
+
${match}
|
|
3115
|
+
|
|
3116
|
+
`);
|
|
3117
|
+
workingContent = workingContent.replace(match, "");
|
|
3118
|
+
found = true;
|
|
3119
|
+
}
|
|
3120
|
+
} while (found);
|
|
3121
|
+
content = _lodash2.default.chain(content).split("\n\n").map((section) => section.trim()).filter(Boolean).join("\n\n").value();
|
|
3122
|
+
return content;
|
|
3123
|
+
}
|
|
3106
3124
|
function extractCodePlaceholders(content) {
|
|
3107
3125
|
let finalContent = content;
|
|
3126
|
+
finalContent = ensureTrailingFenceNewline(finalContent);
|
|
3108
3127
|
const codePlaceholders = {};
|
|
3109
|
-
const
|
|
3110
|
-
const codeBlockMatches = finalContent.matchAll(codeBlockRegex);
|
|
3128
|
+
const codeBlockMatches = finalContent.matchAll(fenceRegex);
|
|
3111
3129
|
for (const match of codeBlockMatches) {
|
|
3112
3130
|
const codeBlock = match[0];
|
|
3113
3131
|
const codeBlockHash = md5(codeBlock);
|
|
@@ -3174,7 +3192,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
3174
3192
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
3175
3193
|
const result = {
|
|
3176
3194
|
frontmatter: data.frontmatter,
|
|
3177
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
3195
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _145 => _145.codePlaceholders]) || {},
|
|
3178
3196
|
content
|
|
3179
3197
|
};
|
|
3180
3198
|
return result;
|
|
@@ -3520,7 +3538,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
3520
3538
|
]
|
|
3521
3539
|
});
|
|
3522
3540
|
const result = JSON.parse(response.text);
|
|
3523
|
-
return _optionalChain([result, 'optionalAccess',
|
|
3541
|
+
return _optionalChain([result, 'optionalAccess', _146 => _146.data]) || {};
|
|
3524
3542
|
};
|
|
3525
3543
|
}
|
|
3526
3544
|
|
|
@@ -3538,7 +3556,7 @@ function createProcessor(provider, params) {
|
|
|
3538
3556
|
}
|
|
3539
3557
|
}
|
|
3540
3558
|
function getPureModelProvider(provider) {
|
|
3541
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
3559
|
+
switch (_optionalChain([provider, 'optionalAccess', _147 => _147.id])) {
|
|
3542
3560
|
case "openai":
|
|
3543
3561
|
if (!process.env.OPENAI_API_KEY) {
|
|
3544
3562
|
throw new Error("OPENAI_API_KEY is not set.");
|
|
@@ -3555,7 +3573,7 @@ function getPureModelProvider(provider) {
|
|
|
3555
3573
|
apiKey: process.env.ANTHROPIC_API_KEY
|
|
3556
3574
|
})(provider.model);
|
|
3557
3575
|
default:
|
|
3558
|
-
throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess',
|
|
3576
|
+
throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess', _148 => _148.id])}`);
|
|
3559
3577
|
}
|
|
3560
3578
|
}
|
|
3561
3579
|
|
|
@@ -3782,16 +3800,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
3782
3800
|
flags
|
|
3783
3801
|
});
|
|
3784
3802
|
let buckets = getBuckets(i18nConfig);
|
|
3785
|
-
if (_optionalChain([flags, 'access',
|
|
3803
|
+
if (_optionalChain([flags, 'access', _149 => _149.bucket, 'optionalAccess', _150 => _150.length])) {
|
|
3786
3804
|
buckets = buckets.filter(
|
|
3787
3805
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
3788
3806
|
);
|
|
3789
3807
|
}
|
|
3790
3808
|
ora.succeed("Buckets retrieved");
|
|
3791
|
-
if (_optionalChain([flags, 'access',
|
|
3809
|
+
if (_optionalChain([flags, 'access', _151 => _151.file, 'optionalAccess', _152 => _152.length])) {
|
|
3792
3810
|
buckets = buckets.map((bucket) => {
|
|
3793
3811
|
const paths = bucket.paths.filter(
|
|
3794
|
-
(path17) => flags.file.find((file) => _optionalChain([path17, 'access',
|
|
3812
|
+
(path17) => flags.file.find((file) => _optionalChain([path17, 'access', _153 => _153.pathPattern, 'optionalAccess', _154 => _154.includes, 'call', _155 => _155(file)]))
|
|
3795
3813
|
);
|
|
3796
3814
|
return { ...bucket, paths };
|
|
3797
3815
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -3810,7 +3828,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
3810
3828
|
});
|
|
3811
3829
|
}
|
|
3812
3830
|
}
|
|
3813
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
3831
|
+
const targetLocales = _optionalChain([flags, 'access', _156 => _156.locale, 'optionalAccess', _157 => _157.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
3814
3832
|
ora.start("Setting up localization cache...");
|
|
3815
3833
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
3816
3834
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -4047,7 +4065,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
4047
4065
|
if (flags.key) {
|
|
4048
4066
|
processableData = _lodash2.default.pickBy(
|
|
4049
4067
|
processableData,
|
|
4050
|
-
(
|
|
4068
|
+
(_26, key) => key === flags.key
|
|
4051
4069
|
);
|
|
4052
4070
|
}
|
|
4053
4071
|
if (flags.verbose) {
|
|
@@ -4213,12 +4231,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
4213
4231
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
4214
4232
|
docUrl: "bucketNotFound"
|
|
4215
4233
|
});
|
|
4216
|
-
} else if (_optionalChain([flags, 'access',
|
|
4234
|
+
} else if (_optionalChain([flags, 'access', _158 => _158.locale, 'optionalAccess', _159 => _159.some, 'call', _160 => _160((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
4217
4235
|
throw new CLIError({
|
|
4218
4236
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
4219
4237
|
docUrl: "localeTargetNotFound"
|
|
4220
4238
|
});
|
|
4221
|
-
} else if (_optionalChain([flags, 'access',
|
|
4239
|
+
} else if (_optionalChain([flags, 'access', _161 => _161.bucket, 'optionalAccess', _162 => _162.some, 'call', _163 => _163(
|
|
4222
4240
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
4223
4241
|
)])) {
|
|
4224
4242
|
throw new CLIError({
|
|
@@ -4546,7 +4564,7 @@ var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
|
4546
4564
|
var _mcpjs = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
4547
4565
|
|
|
4548
4566
|
|
|
4549
|
-
var mcp_default = new (0, _interactivecommander.Command)().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (
|
|
4567
|
+
var mcp_default = new (0, _interactivecommander.Command)().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_26, program) => {
|
|
4550
4568
|
const apiKey = program.args[0];
|
|
4551
4569
|
const settings = getSettings(apiKey);
|
|
4552
4570
|
if (!settings.auth.apiKey) {
|
|
@@ -4669,7 +4687,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
4669
4687
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
4670
4688
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
4671
4689
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
4672
|
-
_optionalChain([this, 'access',
|
|
4690
|
+
_optionalChain([this, 'access', _164 => _164.platformKit, 'optionalAccess', _165 => _165.gitConfig, 'call', _166 => _166()]);
|
|
4673
4691
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
4674
4692
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
4675
4693
|
if (!processOwnCommits) {
|
|
@@ -4694,7 +4712,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
4694
4712
|
// ../../action/src/flows/pull-request.ts
|
|
4695
4713
|
var PullRequestFlow = class extends InBranchFlow {
|
|
4696
4714
|
async preRun() {
|
|
4697
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
4715
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _167 => _167()]);
|
|
4698
4716
|
if (!canContinue) {
|
|
4699
4717
|
return false;
|
|
4700
4718
|
}
|
|
@@ -4912,10 +4930,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
4912
4930
|
repo_slug: this.platformConfig.repositoryName,
|
|
4913
4931
|
state: "OPEN"
|
|
4914
4932
|
}).then(({ data: { values } }) => {
|
|
4915
|
-
return _optionalChain([values, 'optionalAccess',
|
|
4916
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
4933
|
+
return _optionalChain([values, 'optionalAccess', _168 => _168.find, 'call', _169 => _169(
|
|
4934
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _170 => _170.branch, 'optionalAccess', _171 => _171.name]) === branch && _optionalChain([destination, 'optionalAccess', _172 => _172.branch, 'optionalAccess', _173 => _173.name]) === this.platformConfig.baseBranchName
|
|
4917
4935
|
)]);
|
|
4918
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
4936
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _174 => _174.id]));
|
|
4919
4937
|
}
|
|
4920
4938
|
async closePullRequest({ pullRequestNumber }) {
|
|
4921
4939
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -5001,7 +5019,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
5001
5019
|
repo: this.platformConfig.repositoryName,
|
|
5002
5020
|
base: this.platformConfig.baseBranchName,
|
|
5003
5021
|
state: "open"
|
|
5004
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
5022
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _175 => _175.number]));
|
|
5005
5023
|
}
|
|
5006
5024
|
async closePullRequest({ pullRequestNumber }) {
|
|
5007
5025
|
await this.octokit.rest.pulls.update({
|
|
@@ -5114,7 +5132,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
5114
5132
|
sourceBranch: branch,
|
|
5115
5133
|
state: "opened"
|
|
5116
5134
|
});
|
|
5117
|
-
return _optionalChain([mergeRequests, 'access',
|
|
5135
|
+
return _optionalChain([mergeRequests, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.iid]);
|
|
5118
5136
|
}
|
|
5119
5137
|
async closePullRequest({ pullRequestNumber }) {
|
|
5120
5138
|
await this.gitlab.MergeRequests.edit(this.platformConfig.gitlabProjectId, pullRequestNumber, {
|
|
@@ -5167,7 +5185,7 @@ async function main() {
|
|
|
5167
5185
|
const { isPullRequestMode } = platformKit.config;
|
|
5168
5186
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
5169
5187
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
5170
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
5188
|
+
const canRun = await _optionalChain([flow, 'access', _178 => _178.preRun, 'optionalCall', _179 => _179()]);
|
|
5171
5189
|
if (canRun === false) {
|
|
5172
5190
|
return;
|
|
5173
5191
|
}
|
|
@@ -5175,7 +5193,7 @@ async function main() {
|
|
|
5175
5193
|
if (!hasChanges) {
|
|
5176
5194
|
return;
|
|
5177
5195
|
}
|
|
5178
|
-
await _optionalChain([flow, 'access',
|
|
5196
|
+
await _optionalChain([flow, 'access', _180 => _180.postRun, 'optionalCall', _181 => _181()]);
|
|
5179
5197
|
}
|
|
5180
5198
|
|
|
5181
5199
|
// src/cli/cmd/ci.ts
|
|
@@ -5197,7 +5215,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5197
5215
|
}
|
|
5198
5216
|
const env = {
|
|
5199
5217
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
5200
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
5218
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _182 => _182.pullRequest, 'optionalAccess', _183 => _183.toString, 'call', _184 => _184()]) || "false",
|
|
5201
5219
|
...options.commitMessage && { LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage },
|
|
5202
5220
|
...options.pullRequestTitle && { LINGODOTDEV_PULL_REQUEST_TITLE: options.pullRequestTitle },
|
|
5203
5221
|
...options.workingDirectory && { LINGODOTDEV_WORKING_DIRECTORY: options.workingDirectory },
|
|
@@ -5248,13 +5266,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5248
5266
|
flags
|
|
5249
5267
|
});
|
|
5250
5268
|
let buckets = getBuckets(i18nConfig);
|
|
5251
|
-
if (_optionalChain([flags, 'access',
|
|
5269
|
+
if (_optionalChain([flags, 'access', _185 => _185.bucket, 'optionalAccess', _186 => _186.length])) {
|
|
5252
5270
|
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
5253
5271
|
}
|
|
5254
5272
|
ora.succeed("Buckets retrieved");
|
|
5255
|
-
if (_optionalChain([flags, 'access',
|
|
5273
|
+
if (_optionalChain([flags, 'access', _187 => _187.file, 'optionalAccess', _188 => _188.length])) {
|
|
5256
5274
|
buckets = buckets.map((bucket) => {
|
|
5257
|
-
const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access',
|
|
5275
|
+
const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access', _189 => _189.pathPattern, 'optionalAccess', _190 => _190.match, 'call', _191 => _191(file)])));
|
|
5258
5276
|
return { ...bucket, paths };
|
|
5259
5277
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
5260
5278
|
if (buckets.length === 0) {
|
|
@@ -5270,7 +5288,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5270
5288
|
});
|
|
5271
5289
|
}
|
|
5272
5290
|
}
|
|
5273
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
5291
|
+
const targetLocales = _optionalChain([flags, 'access', _192 => _192.locale, 'optionalAccess', _193 => _193.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
5274
5292
|
let totalSourceKeyCount = 0;
|
|
5275
5293
|
let uniqueKeysToTranslate = 0;
|
|
5276
5294
|
let totalExistingTranslations = 0;
|
|
@@ -5611,12 +5629,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
5611
5629
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
5612
5630
|
docUrl: "bucketNotFound"
|
|
5613
5631
|
});
|
|
5614
|
-
} else if (_optionalChain([flags, 'access',
|
|
5632
|
+
} else if (_optionalChain([flags, 'access', _194 => _194.locale, 'optionalAccess', _195 => _195.some, 'call', _196 => _196((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
5615
5633
|
throw new CLIError({
|
|
5616
5634
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
5617
5635
|
docUrl: "localeTargetNotFound"
|
|
5618
5636
|
});
|
|
5619
|
-
} else if (_optionalChain([flags, 'access',
|
|
5637
|
+
} else if (_optionalChain([flags, 'access', _197 => _197.bucket, 'optionalAccess', _198 => _198.some, 'call', _199 => _199((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
5620
5638
|
throw new CLIError({
|
|
5621
5639
|
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
5622
5640
|
docUrl: "bucketNotFound"
|
|
@@ -5627,7 +5645,7 @@ function validateParams2(i18nConfig, flags) {
|
|
|
5627
5645
|
// package.json
|
|
5628
5646
|
var package_default = {
|
|
5629
5647
|
name: "lingo.dev",
|
|
5630
|
-
version: "0.87.
|
|
5648
|
+
version: "0.87.3",
|
|
5631
5649
|
description: "Lingo.dev CLI",
|
|
5632
5650
|
private: false,
|
|
5633
5651
|
publishConfig: {
|