lingo.dev 0.111.12 → 0.111.13
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 +93 -93
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +11 -11
- package/build/cli.mjs.map +1 -1
- package/package.json +4 -4
package/build/cli.cjs
CHANGED
|
@@ -3067,7 +3067,6 @@ async function formatDataWithPrettier(data, filePath, options) {
|
|
|
3067
3067
|
|
|
3068
3068
|
|
|
3069
3069
|
var _jsapi = require('@biomejs/js-api');
|
|
3070
|
-
var shownWarnings = /* @__PURE__ */ new Set();
|
|
3071
3070
|
function createBiomeLoader(options) {
|
|
3072
3071
|
return createBaseFormatterLoader(options, async (data, filePath) => {
|
|
3073
3072
|
return await formatDataWithBiome(data, filePath, options);
|
|
@@ -3101,6 +3100,10 @@ async function formatDataWithBiome(data, filePath, options) {
|
|
|
3101
3100
|
const projectKey = openResult.projectKey;
|
|
3102
3101
|
configPath = await findBiomeConfig(filePath);
|
|
3103
3102
|
if (!configPath && !options.alwaysFormat) {
|
|
3103
|
+
console.log();
|
|
3104
|
+
console.log(
|
|
3105
|
+
`\u26A0\uFE0F Biome config not found for ${path14.default.basename(filePath)} - skipping formatting`
|
|
3106
|
+
);
|
|
3104
3107
|
return data;
|
|
3105
3108
|
}
|
|
3106
3109
|
if (configPath) {
|
|
@@ -3119,15 +3122,12 @@ async function formatDataWithBiome(data, filePath, options) {
|
|
|
3119
3122
|
});
|
|
3120
3123
|
return formatted.content;
|
|
3121
3124
|
} catch (error) {
|
|
3122
|
-
const
|
|
3123
|
-
if (
|
|
3124
|
-
|
|
3125
|
-
console.log();
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
);
|
|
3129
|
-
if (error instanceof Error && error.message) {
|
|
3130
|
-
console.log(` ${error.message}`);
|
|
3125
|
+
const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _133 => _133.stackTrace, 'optionalAccess', _134 => _134.toString, 'call', _135 => _135(), 'access', _136 => _136.split, 'call', _137 => _137("\n"), 'access', _138 => _138[0]]) : "";
|
|
3126
|
+
if (_optionalChain([errorMessage, 'optionalAccess', _139 => _139.includes, 'call', _140 => _140("does not exist in the workspace")])) {
|
|
3127
|
+
} else {
|
|
3128
|
+
console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
|
|
3129
|
+
if (errorMessage) {
|
|
3130
|
+
console.log(` ${errorMessage}`);
|
|
3131
3131
|
}
|
|
3132
3132
|
}
|
|
3133
3133
|
return data;
|
|
@@ -3170,7 +3170,7 @@ function createPoDataLoader(params) {
|
|
|
3170
3170
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
3171
3171
|
if (msgid && entry.msgid) {
|
|
3172
3172
|
const context = entry.msgctxt || "";
|
|
3173
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
3173
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _141 => _141.translations, 'access', _142 => _142[context], 'optionalAccess', _143 => _143[msgid]]);
|
|
3174
3174
|
if (fullEntry) {
|
|
3175
3175
|
result[msgid] = fullEntry;
|
|
3176
3176
|
}
|
|
@@ -3180,8 +3180,8 @@ function createPoDataLoader(params) {
|
|
|
3180
3180
|
return result;
|
|
3181
3181
|
},
|
|
3182
3182
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
3183
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
3184
|
-
const originalSections = _optionalChain([originalInput, 'optionalAccess',
|
|
3183
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _144 => _144.split, 'call', _145 => _145("\n\n"), 'access', _146 => _146.filter, 'call', _147 => _147(Boolean)]) || [];
|
|
3184
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _148 => _148.split, 'call', _149 => _149("\n\n"), 'access', _150 => _150.filter, 'call', _151 => _151(Boolean)]) || [];
|
|
3185
3185
|
const result = originalSections.map((section) => {
|
|
3186
3186
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
3187
3187
|
if (Object.keys(sectionPo.translations).length === 0) {
|
|
@@ -3250,8 +3250,8 @@ function createPoContentLoader() {
|
|
|
3250
3250
|
{
|
|
3251
3251
|
...entry,
|
|
3252
3252
|
msgstr: [
|
|
3253
|
-
_optionalChain([data, 'access',
|
|
3254
|
-
_optionalChain([data, 'access',
|
|
3253
|
+
_optionalChain([data, 'access', _152 => _152[entry.msgid], 'optionalAccess', _153 => _153.singular]),
|
|
3254
|
+
_optionalChain([data, 'access', _154 => _154[entry.msgid], 'optionalAccess', _155 => _155.plural]) || null
|
|
3255
3255
|
].filter(Boolean)
|
|
3256
3256
|
}
|
|
3257
3257
|
]).fromPairs().value();
|
|
@@ -3373,7 +3373,7 @@ function pullV1(xliffElement, locale, originalLocale) {
|
|
|
3373
3373
|
let key = getTransUnitKey(unit);
|
|
3374
3374
|
if (!key) return;
|
|
3375
3375
|
if (seenKeys.has(key)) {
|
|
3376
|
-
const id = _optionalChain([unit, 'access',
|
|
3376
|
+
const id = _optionalChain([unit, 'access', _156 => _156.getAttribute, 'call', _157 => _157("id"), 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]);
|
|
3377
3377
|
if (id) {
|
|
3378
3378
|
key = `${key}#${id}`;
|
|
3379
3379
|
} else {
|
|
@@ -3421,7 +3421,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3421
3421
|
let key = getTransUnitKey(unit);
|
|
3422
3422
|
if (!key) return;
|
|
3423
3423
|
if (seenKeys.has(key)) {
|
|
3424
|
-
const id = _optionalChain([unit, 'access',
|
|
3424
|
+
const id = _optionalChain([unit, 'access', _160 => _160.getAttribute, 'call', _161 => _161("id"), 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()]);
|
|
3425
3425
|
if (id) {
|
|
3426
3426
|
key = `${key}#${id}`;
|
|
3427
3427
|
} else {
|
|
@@ -3463,7 +3463,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3463
3463
|
const translationKeys = new Set(Object.keys(translations));
|
|
3464
3464
|
existingUnits.forEach((unit, key) => {
|
|
3465
3465
|
if (!translationKeys.has(key)) {
|
|
3466
|
-
_optionalChain([unit, 'access',
|
|
3466
|
+
_optionalChain([unit, 'access', _164 => _164.parentNode, 'optionalAccess', _165 => _165.removeChild, 'call', _166 => _166(unit)]);
|
|
3467
3467
|
}
|
|
3468
3468
|
});
|
|
3469
3469
|
return serializeWithDeclaration(
|
|
@@ -3506,18 +3506,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
|
|
|
3506
3506
|
Array.from(container.children).forEach((child) => {
|
|
3507
3507
|
const tagName = child.tagName;
|
|
3508
3508
|
if (tagName === "unit") {
|
|
3509
|
-
const unitId = _optionalChain([child, 'access',
|
|
3509
|
+
const unitId = _optionalChain([child, 'access', _167 => _167.getAttribute, 'call', _168 => _168("id"), 'optionalAccess', _169 => _169.trim, 'call', _170 => _170()]);
|
|
3510
3510
|
if (!unitId) return;
|
|
3511
3511
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3512
3512
|
const segment = child.querySelector("segment");
|
|
3513
|
-
const source = _optionalChain([segment, 'optionalAccess',
|
|
3513
|
+
const source = _optionalChain([segment, 'optionalAccess', _171 => _171.querySelector, 'call', _172 => _172("source")]);
|
|
3514
3514
|
if (source) {
|
|
3515
3515
|
result[key] = extractTextContent(source);
|
|
3516
3516
|
} else {
|
|
3517
3517
|
result[key] = unitId;
|
|
3518
3518
|
}
|
|
3519
3519
|
} else if (tagName === "group") {
|
|
3520
|
-
const groupId = _optionalChain([child, 'access',
|
|
3520
|
+
const groupId = _optionalChain([child, 'access', _173 => _173.getAttribute, 'call', _174 => _174("id"), 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()]);
|
|
3521
3521
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3522
3522
|
traverseUnitsV2(child, fileId, newPath, result);
|
|
3523
3523
|
}
|
|
@@ -3553,12 +3553,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
|
|
|
3553
3553
|
Array.from(container.children).forEach((child) => {
|
|
3554
3554
|
const tagName = child.tagName;
|
|
3555
3555
|
if (tagName === "unit") {
|
|
3556
|
-
const unitId = _optionalChain([child, 'access',
|
|
3556
|
+
const unitId = _optionalChain([child, 'access', _177 => _177.getAttribute, 'call', _178 => _178("id"), 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()]);
|
|
3557
3557
|
if (!unitId) return;
|
|
3558
3558
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3559
3559
|
index.set(key, child);
|
|
3560
3560
|
} else if (tagName === "group") {
|
|
3561
|
-
const groupId = _optionalChain([child, 'access',
|
|
3561
|
+
const groupId = _optionalChain([child, 'access', _181 => _181.getAttribute, 'call', _182 => _182("id"), 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()]);
|
|
3562
3562
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3563
3563
|
indexUnitsV2(child, fileId, newPath, index);
|
|
3564
3564
|
}
|
|
@@ -3579,9 +3579,9 @@ function updateUnitV2(unit, value) {
|
|
|
3579
3579
|
setTextContent(source, value);
|
|
3580
3580
|
}
|
|
3581
3581
|
function getTransUnitKey(transUnit) {
|
|
3582
|
-
const resname = _optionalChain([transUnit, 'access',
|
|
3582
|
+
const resname = _optionalChain([transUnit, 'access', _185 => _185.getAttribute, 'call', _186 => _186("resname"), 'optionalAccess', _187 => _187.trim, 'call', _188 => _188()]);
|
|
3583
3583
|
if (resname) return resname;
|
|
3584
|
-
const id = _optionalChain([transUnit, 'access',
|
|
3584
|
+
const id = _optionalChain([transUnit, 'access', _189 => _189.getAttribute, 'call', _190 => _190("id"), 'optionalAccess', _191 => _191.trim, 'call', _192 => _192()]);
|
|
3585
3585
|
if (id) return id;
|
|
3586
3586
|
const sourceElement = transUnit.querySelector("source");
|
|
3587
3587
|
if (sourceElement) {
|
|
@@ -3638,7 +3638,7 @@ function formatXml(xml) {
|
|
|
3638
3638
|
if (cdataNode) {
|
|
3639
3639
|
return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
|
|
3640
3640
|
}
|
|
3641
|
-
const textContent = _optionalChain([element, 'access',
|
|
3641
|
+
const textContent = _optionalChain([element, 'access', _193 => _193.textContent, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]) || "";
|
|
3642
3642
|
const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
|
|
3643
3643
|
if (hasOnlyText && textContent) {
|
|
3644
3644
|
return `${indent2}${openTag}${textContent}</${tagName}>`;
|
|
@@ -3931,7 +3931,7 @@ function createDatoClient(params) {
|
|
|
3931
3931
|
ids: !records.length ? void 0 : records.join(",")
|
|
3932
3932
|
}
|
|
3933
3933
|
}).catch(
|
|
3934
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3934
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _196 => _196.response, 'optionalAccess', _197 => _197.body, 'optionalAccess', _198 => _198.data, 'optionalAccess', _199 => _199[0]]) || error)
|
|
3935
3935
|
);
|
|
3936
3936
|
},
|
|
3937
3937
|
findRecordsForModel: async (modelId, records) => {
|
|
@@ -3942,10 +3942,10 @@ function createDatoClient(params) {
|
|
|
3942
3942
|
filter: {
|
|
3943
3943
|
type: modelId,
|
|
3944
3944
|
only_valid: "true",
|
|
3945
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
3945
|
+
ids: !_optionalChain([records, 'optionalAccess', _200 => _200.length]) ? void 0 : records.join(",")
|
|
3946
3946
|
}
|
|
3947
3947
|
}).catch(
|
|
3948
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3948
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _201 => _201.response, 'optionalAccess', _202 => _202.body, 'optionalAccess', _203 => _203.data, 'optionalAccess', _204 => _204[0]]) || error)
|
|
3949
3949
|
);
|
|
3950
3950
|
return result;
|
|
3951
3951
|
} catch (_error) {
|
|
@@ -3961,10 +3961,10 @@ function createDatoClient(params) {
|
|
|
3961
3961
|
updateRecord: async (id, payload) => {
|
|
3962
3962
|
try {
|
|
3963
3963
|
await dato.items.update(id, payload).catch(
|
|
3964
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3964
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _205 => _205.response, 'optionalAccess', _206 => _206.body, 'optionalAccess', _207 => _207.data, 'optionalAccess', _208 => _208[0]]) || error)
|
|
3965
3965
|
);
|
|
3966
3966
|
} catch (_error) {
|
|
3967
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
3967
|
+
if (_optionalChain([_error, 'optionalAccess', _209 => _209.attributes, 'optionalAccess', _210 => _210.details, 'optionalAccess', _211 => _211.message])) {
|
|
3968
3968
|
throw new Error(
|
|
3969
3969
|
[
|
|
3970
3970
|
`${_error.attributes.details.message}`,
|
|
@@ -3986,10 +3986,10 @@ function createDatoClient(params) {
|
|
|
3986
3986
|
enableFieldLocalization: async (args) => {
|
|
3987
3987
|
try {
|
|
3988
3988
|
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
|
|
3989
|
-
(error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
3989
|
+
(error) => Promise.reject(_optionalChain([error, 'optionalAccess', _212 => _212.response, 'optionalAccess', _213 => _213.body, 'optionalAccess', _214 => _214.data, 'optionalAccess', _215 => _215[0]]) || error)
|
|
3990
3990
|
);
|
|
3991
3991
|
} catch (_error) {
|
|
3992
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
3992
|
+
if (_optionalChain([_error, 'optionalAccess', _216 => _216.attributes, 'optionalAccess', _217 => _217.code]) === "NOT_FOUND") {
|
|
3993
3993
|
throw new Error(
|
|
3994
3994
|
[
|
|
3995
3995
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -3997,7 +3997,7 @@ function createDatoClient(params) {
|
|
|
3997
3997
|
].join("\n\n")
|
|
3998
3998
|
);
|
|
3999
3999
|
}
|
|
4000
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
4000
|
+
if (_optionalChain([_error, 'optionalAccess', _218 => _218.attributes, 'optionalAccess', _219 => _219.details, 'optionalAccess', _220 => _220.message])) {
|
|
4001
4001
|
throw new Error(
|
|
4002
4002
|
[
|
|
4003
4003
|
`${_error.attributes.details.message}`,
|
|
@@ -4075,7 +4075,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4075
4075
|
const records = await dato.findRecordsForModel(modelId);
|
|
4076
4076
|
const recordChoices = createRecordChoices(
|
|
4077
4077
|
records,
|
|
4078
|
-
_optionalChain([config, 'access',
|
|
4078
|
+
_optionalChain([config, 'access', _221 => _221.models, 'access', _222 => _222[modelId], 'optionalAccess', _223 => _223.records]) || [],
|
|
4079
4079
|
project
|
|
4080
4080
|
);
|
|
4081
4081
|
const selectedRecords = await promptRecordSelection(
|
|
@@ -4094,14 +4094,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4094
4094
|
},
|
|
4095
4095
|
async pull(locale, input2, initCtx) {
|
|
4096
4096
|
const result = {};
|
|
4097
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
4098
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
4097
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _224 => _224.models]) || {})) {
|
|
4098
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _225 => _225.models, 'access', _226 => _226[modelId], 'access', _227 => _227.records]) || [];
|
|
4099
4099
|
const recordIds = records.map((record) => record.id);
|
|
4100
4100
|
records = await dato.findRecords(recordIds);
|
|
4101
4101
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
4102
4102
|
if (records.length > 0) {
|
|
4103
4103
|
result[modelId] = {
|
|
4104
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
4104
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _228 => _228.models, 'optionalAccess', _229 => _229[modelId], 'optionalAccess', _230 => _230.fields]) || [],
|
|
4105
4105
|
records
|
|
4106
4106
|
};
|
|
4107
4107
|
}
|
|
@@ -4164,7 +4164,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
4164
4164
|
return records.map((record) => ({
|
|
4165
4165
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
4166
4166
|
value: record.id,
|
|
4167
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
4167
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _231 => _231.includes, 'call', _232 => _232(record.id)])
|
|
4168
4168
|
}));
|
|
4169
4169
|
}
|
|
4170
4170
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -4483,7 +4483,7 @@ function createVttLoader() {
|
|
|
4483
4483
|
if (!input2) {
|
|
4484
4484
|
return "";
|
|
4485
4485
|
}
|
|
4486
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
4486
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _233 => _233.parse, 'call', _234 => _234(input2), 'optionalAccess', _235 => _235.cues]);
|
|
4487
4487
|
if (Object.keys(vtt).length === 0) {
|
|
4488
4488
|
return {};
|
|
4489
4489
|
} else {
|
|
@@ -4537,7 +4537,7 @@ function variableExtractLoader(params) {
|
|
|
4537
4537
|
for (let i = 0; i < matches.length; i++) {
|
|
4538
4538
|
const match2 = matches[i];
|
|
4539
4539
|
const currentValue = result[key].value;
|
|
4540
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4540
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _236 => _236.replace, 'call', _237 => _237(match2, `{variable:${i}}`)]);
|
|
4541
4541
|
result[key].value = newValue;
|
|
4542
4542
|
result[key].variables[i] = match2;
|
|
4543
4543
|
}
|
|
@@ -4551,7 +4551,7 @@ function variableExtractLoader(params) {
|
|
|
4551
4551
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
4552
4552
|
const variable = valueObj.variables[i];
|
|
4553
4553
|
const currentValue = result[key];
|
|
4554
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4554
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _238 => _238.replace, 'call', _239 => _239(`{variable:${i}}`, variable)]);
|
|
4555
4555
|
result[key] = newValue;
|
|
4556
4556
|
}
|
|
4557
4557
|
}
|
|
@@ -4751,7 +4751,7 @@ function createVueJsonLoader() {
|
|
|
4751
4751
|
return createLoader({
|
|
4752
4752
|
pull: async (locale, input2, ctx) => {
|
|
4753
4753
|
const parsed = parseVueFile(input2);
|
|
4754
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
4754
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _240 => _240.i18n, 'optionalAccess', _241 => _241[locale]]), () => ( {}));
|
|
4755
4755
|
},
|
|
4756
4756
|
push: async (locale, data, originalInput) => {
|
|
4757
4757
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -4936,7 +4936,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
4936
4936
|
objectExpression.properties.forEach((prop) => {
|
|
4937
4937
|
if (!t.isObjectProperty(prop)) return;
|
|
4938
4938
|
const key = getPropertyKey(prop);
|
|
4939
|
-
const incomingVal = _optionalChain([data, 'optionalAccess',
|
|
4939
|
+
const incomingVal = _optionalChain([data, 'optionalAccess', _242 => _242[key]]);
|
|
4940
4940
|
if (incomingVal === void 0) {
|
|
4941
4941
|
return;
|
|
4942
4942
|
}
|
|
@@ -4972,7 +4972,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
4972
4972
|
let modified = false;
|
|
4973
4973
|
arrayExpression.elements.forEach((element, index) => {
|
|
4974
4974
|
if (!element) return;
|
|
4975
|
-
const incomingVal = _optionalChain([incoming, 'optionalAccess',
|
|
4975
|
+
const incomingVal = _optionalChain([incoming, 'optionalAccess', _243 => _243[index]]);
|
|
4976
4976
|
if (incomingVal === void 0) return;
|
|
4977
4977
|
if (t.isStringLiteral(element) && typeof incomingVal === "string") {
|
|
4978
4978
|
if (element.value !== incomingVal) {
|
|
@@ -5463,7 +5463,7 @@ var AST = class _AST {
|
|
|
5463
5463
|
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
5464
5464
|
if (this.isStart() && !this.type)
|
|
5465
5465
|
ret.unshift([]);
|
|
5466
|
-
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
5466
|
+
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _244 => _244.#parent, 'optionalAccess', _245 => _245.type]) === "!")) {
|
|
5467
5467
|
ret.push({});
|
|
5468
5468
|
}
|
|
5469
5469
|
return ret;
|
|
@@ -5471,7 +5471,7 @@ var AST = class _AST {
|
|
|
5471
5471
|
isStart() {
|
|
5472
5472
|
if (this.#root === this)
|
|
5473
5473
|
return true;
|
|
5474
|
-
if (!_optionalChain([this, 'access',
|
|
5474
|
+
if (!_optionalChain([this, 'access', _246 => _246.#parent, 'optionalAccess', _247 => _247.isStart, 'call', _248 => _248()]))
|
|
5475
5475
|
return false;
|
|
5476
5476
|
if (this.#parentIndex === 0)
|
|
5477
5477
|
return true;
|
|
@@ -5487,12 +5487,12 @@ var AST = class _AST {
|
|
|
5487
5487
|
isEnd() {
|
|
5488
5488
|
if (this.#root === this)
|
|
5489
5489
|
return true;
|
|
5490
|
-
if (_optionalChain([this, 'access',
|
|
5490
|
+
if (_optionalChain([this, 'access', _249 => _249.#parent, 'optionalAccess', _250 => _250.type]) === "!")
|
|
5491
5491
|
return true;
|
|
5492
|
-
if (!_optionalChain([this, 'access',
|
|
5492
|
+
if (!_optionalChain([this, 'access', _251 => _251.#parent, 'optionalAccess', _252 => _252.isEnd, 'call', _253 => _253()]))
|
|
5493
5493
|
return false;
|
|
5494
5494
|
if (!this.type)
|
|
5495
|
-
return _optionalChain([this, 'access',
|
|
5495
|
+
return _optionalChain([this, 'access', _254 => _254.#parent, 'optionalAccess', _255 => _255.isEnd, 'call', _256 => _256()]);
|
|
5496
5496
|
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
5497
5497
|
return this.#parentIndex === pl - 1;
|
|
5498
5498
|
}
|
|
@@ -5737,7 +5737,7 @@ var AST = class _AST {
|
|
|
5737
5737
|
}
|
|
5738
5738
|
}
|
|
5739
5739
|
let end = "";
|
|
5740
|
-
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access',
|
|
5740
|
+
if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _257 => _257.#parent, 'optionalAccess', _258 => _258.type]) === "!") {
|
|
5741
5741
|
end = "(?:$|\\/)";
|
|
5742
5742
|
}
|
|
5743
5743
|
const final2 = start2 + src + end;
|
|
@@ -6814,7 +6814,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
6814
6814
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
6815
6815
|
const result = {
|
|
6816
6816
|
frontmatter: data.frontmatter,
|
|
6817
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
6817
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _259 => _259.codePlaceholders]) || {},
|
|
6818
6818
|
content
|
|
6819
6819
|
};
|
|
6820
6820
|
return result;
|
|
@@ -7553,7 +7553,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
7553
7553
|
]
|
|
7554
7554
|
});
|
|
7555
7555
|
const result = JSON.parse(response.text);
|
|
7556
|
-
return _optionalChain([result, 'optionalAccess',
|
|
7556
|
+
return _optionalChain([result, 'optionalAccess', _260 => _260.data]) || {};
|
|
7557
7557
|
}
|
|
7558
7558
|
}
|
|
7559
7559
|
function extractPayloadChunks(payload) {
|
|
@@ -7635,7 +7635,7 @@ function getPureModelProvider(provider) {
|
|
|
7635
7635
|
|
|
7636
7636
|
${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
|
|
7637
7637
|
`;
|
|
7638
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
7638
|
+
switch (_optionalChain([provider, 'optionalAccess', _261 => _261.id])) {
|
|
7639
7639
|
case "openai": {
|
|
7640
7640
|
if (!process.env.OPENAI_API_KEY) {
|
|
7641
7641
|
throw new Error(
|
|
@@ -7693,7 +7693,7 @@ function getPureModelProvider(provider) {
|
|
|
7693
7693
|
})(provider.model);
|
|
7694
7694
|
}
|
|
7695
7695
|
default: {
|
|
7696
|
-
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess',
|
|
7696
|
+
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _262 => _262.id])));
|
|
7697
7697
|
}
|
|
7698
7698
|
}
|
|
7699
7699
|
}
|
|
@@ -7978,7 +7978,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7978
7978
|
validateParams(i18nConfig, flags);
|
|
7979
7979
|
ora.succeed("Localization configuration is valid");
|
|
7980
7980
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
7981
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
7981
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _263 => _263.provider]);
|
|
7982
7982
|
if (isByokMode) {
|
|
7983
7983
|
authId = null;
|
|
7984
7984
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -7992,16 +7992,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7992
7992
|
flags
|
|
7993
7993
|
});
|
|
7994
7994
|
let buckets = getBuckets(i18nConfig);
|
|
7995
|
-
if (_optionalChain([flags, 'access',
|
|
7995
|
+
if (_optionalChain([flags, 'access', _264 => _264.bucket, 'optionalAccess', _265 => _265.length])) {
|
|
7996
7996
|
buckets = buckets.filter(
|
|
7997
7997
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
7998
7998
|
);
|
|
7999
7999
|
}
|
|
8000
8000
|
ora.succeed("Buckets retrieved");
|
|
8001
|
-
if (_optionalChain([flags, 'access',
|
|
8001
|
+
if (_optionalChain([flags, 'access', _266 => _266.file, 'optionalAccess', _267 => _267.length])) {
|
|
8002
8002
|
buckets = buckets.map((bucket) => {
|
|
8003
8003
|
const paths = bucket.paths.filter(
|
|
8004
|
-
(path19) => flags.file.find((file) => _optionalChain([path19, 'access',
|
|
8004
|
+
(path19) => flags.file.find((file) => _optionalChain([path19, 'access', _268 => _268.pathPattern, 'optionalAccess', _269 => _269.includes, 'call', _270 => _270(file)]))
|
|
8005
8005
|
);
|
|
8006
8006
|
return { ...bucket, paths };
|
|
8007
8007
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -8022,7 +8022,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8022
8022
|
});
|
|
8023
8023
|
}
|
|
8024
8024
|
}
|
|
8025
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
8025
|
+
const targetLocales = _optionalChain([flags, 'access', _271 => _271.locale, 'optionalAccess', _272 => _272.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
8026
8026
|
ora.start("Setting up localization cache...");
|
|
8027
8027
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
8028
8028
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -8299,7 +8299,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8299
8299
|
}
|
|
8300
8300
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
8301
8301
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
8302
|
-
if (!_optionalChain([flags, 'access',
|
|
8302
|
+
if (!_optionalChain([flags, 'access', _273 => _273.locale, 'optionalAccess', _274 => _274.length])) {
|
|
8303
8303
|
await deltaProcessor.saveChecksums(checksums);
|
|
8304
8304
|
}
|
|
8305
8305
|
}
|
|
@@ -8423,12 +8423,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
8423
8423
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
8424
8424
|
docUrl: "bucketNotFound"
|
|
8425
8425
|
});
|
|
8426
|
-
} else if (_optionalChain([flags, 'access',
|
|
8426
|
+
} else if (_optionalChain([flags, 'access', _275 => _275.locale, 'optionalAccess', _276 => _276.some, 'call', _277 => _277((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
8427
8427
|
throw new ValidationError({
|
|
8428
8428
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
8429
8429
|
docUrl: "localeTargetNotFound"
|
|
8430
8430
|
});
|
|
8431
|
-
} else if (_optionalChain([flags, 'access',
|
|
8431
|
+
} else if (_optionalChain([flags, 'access', _278 => _278.bucket, 'optionalAccess', _279 => _279.some, 'call', _280 => _280(
|
|
8432
8432
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
8433
8433
|
)])) {
|
|
8434
8434
|
throw new ValidationError({
|
|
@@ -8954,7 +8954,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
8954
8954
|
const response = await engine.whoami();
|
|
8955
8955
|
return {
|
|
8956
8956
|
authenticated: !!response,
|
|
8957
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
8957
|
+
username: _optionalChain([response, 'optionalAccess', _281 => _281.email])
|
|
8958
8958
|
};
|
|
8959
8959
|
} catch (e3) {
|
|
8960
8960
|
return { authenticated: false };
|
|
@@ -9062,7 +9062,7 @@ function createExplicitLocalizer(provider) {
|
|
|
9062
9062
|
}
|
|
9063
9063
|
function createAiSdkLocalizer(params) {
|
|
9064
9064
|
const skipAuth = params.skipAuth === true;
|
|
9065
|
-
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
9065
|
+
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _282 => _282.apiKeyName]), () => ( ""))];
|
|
9066
9066
|
if (!skipAuth && !apiKey || !params.apiKeyName) {
|
|
9067
9067
|
throw new Error(
|
|
9068
9068
|
_dedent2.default`
|
|
@@ -9187,8 +9187,8 @@ async function setup(input2) {
|
|
|
9187
9187
|
throw new Error(
|
|
9188
9188
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
9189
9189
|
);
|
|
9190
|
-
} else if (_optionalChain([ctx, 'access',
|
|
9191
|
-
(bucket) => !_optionalChain([ctx, 'access',
|
|
9190
|
+
} else if (_optionalChain([ctx, 'access', _283 => _283.flags, 'access', _284 => _284.bucket, 'optionalAccess', _285 => _285.some, 'call', _286 => _286(
|
|
9191
|
+
(bucket) => !_optionalChain([ctx, 'access', _287 => _287.config, 'optionalAccess', _288 => _288.buckets, 'access', _289 => _289[bucket]])
|
|
9192
9192
|
)])) {
|
|
9193
9193
|
throw new Error(
|
|
9194
9194
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -9201,7 +9201,7 @@ async function setup(input2) {
|
|
|
9201
9201
|
title: "Selecting localization provider",
|
|
9202
9202
|
task: async (ctx, task) => {
|
|
9203
9203
|
ctx.localizer = createLocalizer(
|
|
9204
|
-
_optionalChain([ctx, 'access',
|
|
9204
|
+
_optionalChain([ctx, 'access', _290 => _290.config, 'optionalAccess', _291 => _291.provider]),
|
|
9205
9205
|
ctx.flags.apiKey
|
|
9206
9206
|
);
|
|
9207
9207
|
if (!ctx.localizer) {
|
|
@@ -9522,7 +9522,7 @@ function createWorkerTask(args) {
|
|
|
9522
9522
|
const processableData = _lodash2.default.chain(sourceData).entries().filter(
|
|
9523
9523
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
9524
9524
|
).filter(
|
|
9525
|
-
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access',
|
|
9525
|
+
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _292 => _292.onlyKeys, 'optionalAccess', _293 => _293.some, 'call', _294 => _294(
|
|
9526
9526
|
(pattern) => minimatch(key, pattern)
|
|
9527
9527
|
)])
|
|
9528
9528
|
).fromPairs().value();
|
|
@@ -9585,7 +9585,7 @@ function createWorkerTask(args) {
|
|
|
9585
9585
|
finalRenamedTargetData
|
|
9586
9586
|
);
|
|
9587
9587
|
const checksums2 = await deltaProcessor.createChecksums(sourceData);
|
|
9588
|
-
if (!_optionalChain([args, 'access',
|
|
9588
|
+
if (!_optionalChain([args, 'access', _295 => _295.ctx, 'access', _296 => _296.flags, 'access', _297 => _297.targetLocale, 'optionalAccess', _298 => _298.length])) {
|
|
9589
9589
|
await deltaProcessor.saveChecksums(checksums2);
|
|
9590
9590
|
}
|
|
9591
9591
|
});
|
|
@@ -9776,13 +9776,13 @@ var flagsSchema2 = _zod.z.object({
|
|
|
9776
9776
|
|
|
9777
9777
|
// src/cli/cmd/run/_utils.ts
|
|
9778
9778
|
async function determineAuthId(ctx) {
|
|
9779
|
-
const isByokMode = !!_optionalChain([ctx, 'access',
|
|
9779
|
+
const isByokMode = !!_optionalChain([ctx, 'access', _299 => _299.config, 'optionalAccess', _300 => _300.provider]);
|
|
9780
9780
|
if (isByokMode) {
|
|
9781
9781
|
return null;
|
|
9782
9782
|
} else {
|
|
9783
9783
|
try {
|
|
9784
|
-
const authStatus = await _optionalChain([ctx, 'access',
|
|
9785
|
-
return _optionalChain([authStatus, 'optionalAccess',
|
|
9784
|
+
const authStatus = await _optionalChain([ctx, 'access', _301 => _301.localizer, 'optionalAccess', _302 => _302.checkAuth, 'call', _303 => _303()]);
|
|
9785
|
+
return _optionalChain([authStatus, 'optionalAccess', _304 => _304.username]) || null;
|
|
9786
9786
|
} catch (e4) {
|
|
9787
9787
|
return null;
|
|
9788
9788
|
}
|
|
@@ -9974,7 +9974,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
9974
9974
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
9975
9975
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
9976
9976
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
9977
|
-
_optionalChain([this, 'access',
|
|
9977
|
+
_optionalChain([this, 'access', _305 => _305.platformKit, 'optionalAccess', _306 => _306.gitConfig, 'call', _307 => _307()]);
|
|
9978
9978
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
9979
9979
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
9980
9980
|
if (!processOwnCommits) {
|
|
@@ -10006,7 +10006,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
10006
10006
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
10007
10007
|
var PullRequestFlow = class extends InBranchFlow {
|
|
10008
10008
|
async preRun() {
|
|
10009
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
10009
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _308 => _308()]);
|
|
10010
10010
|
if (!canContinue) {
|
|
10011
10011
|
return false;
|
|
10012
10012
|
}
|
|
@@ -10269,10 +10269,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
10269
10269
|
repo_slug: this.platformConfig.repositoryName,
|
|
10270
10270
|
state: "OPEN"
|
|
10271
10271
|
}).then(({ data: { values } }) => {
|
|
10272
|
-
return _optionalChain([values, 'optionalAccess',
|
|
10273
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
10272
|
+
return _optionalChain([values, 'optionalAccess', _309 => _309.find, 'call', _310 => _310(
|
|
10273
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _311 => _311.branch, 'optionalAccess', _312 => _312.name]) === branch && _optionalChain([destination, 'optionalAccess', _313 => _313.branch, 'optionalAccess', _314 => _314.name]) === this.platformConfig.baseBranchName
|
|
10274
10274
|
)]);
|
|
10275
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10275
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _315 => _315.id]));
|
|
10276
10276
|
}
|
|
10277
10277
|
async closePullRequest({ pullRequestNumber }) {
|
|
10278
10278
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -10368,7 +10368,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
10368
10368
|
repo: this.platformConfig.repositoryName,
|
|
10369
10369
|
base: this.platformConfig.baseBranchName,
|
|
10370
10370
|
state: "open"
|
|
10371
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10371
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _316 => _316.number]));
|
|
10372
10372
|
}
|
|
10373
10373
|
async closePullRequest({ pullRequestNumber }) {
|
|
10374
10374
|
await this.octokit.rest.pulls.update({
|
|
@@ -10495,7 +10495,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
10495
10495
|
sourceBranch: branch,
|
|
10496
10496
|
state: "opened"
|
|
10497
10497
|
});
|
|
10498
|
-
return _optionalChain([mergeRequests, 'access',
|
|
10498
|
+
return _optionalChain([mergeRequests, 'access', _317 => _317[0], 'optionalAccess', _318 => _318.iid]);
|
|
10499
10499
|
}
|
|
10500
10500
|
async closePullRequest({
|
|
10501
10501
|
pullRequestNumber
|
|
@@ -10601,7 +10601,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10601
10601
|
}
|
|
10602
10602
|
const env = {
|
|
10603
10603
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
10604
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
10604
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _319 => _319.pullRequest, 'optionalAccess', _320 => _320.toString, 'call', _321 => _321()]) || "false",
|
|
10605
10605
|
...options.commitMessage && {
|
|
10606
10606
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
10607
10607
|
},
|
|
@@ -10621,7 +10621,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10621
10621
|
const { isPullRequestMode } = platformKit.config;
|
|
10622
10622
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
10623
10623
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
10624
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
10624
|
+
const canRun = await _optionalChain([flow, 'access', _322 => _322.preRun, 'optionalCall', _323 => _323()]);
|
|
10625
10625
|
if (canRun === false) {
|
|
10626
10626
|
return;
|
|
10627
10627
|
}
|
|
@@ -10631,7 +10631,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10631
10631
|
if (!hasChanges) {
|
|
10632
10632
|
return;
|
|
10633
10633
|
}
|
|
10634
|
-
await _optionalChain([flow, 'access',
|
|
10634
|
+
await _optionalChain([flow, 'access', _324 => _324.postRun, 'optionalCall', _325 => _325()]);
|
|
10635
10635
|
});
|
|
10636
10636
|
function parseBooleanArg(val) {
|
|
10637
10637
|
if (val === true) return true;
|
|
@@ -10668,8 +10668,8 @@ function exitGracefully(elapsedMs = 0) {
|
|
|
10668
10668
|
}
|
|
10669
10669
|
}
|
|
10670
10670
|
function checkForPendingOperations() {
|
|
10671
|
-
const activeHandles = _optionalChain([process, 'access',
|
|
10672
|
-
const activeRequests = _optionalChain([process, 'access',
|
|
10671
|
+
const activeHandles = _optionalChain([process, 'access', _326 => _326._getActiveHandles, 'optionalCall', _327 => _327()]) || [];
|
|
10672
|
+
const activeRequests = _optionalChain([process, 'access', _328 => _328._getActiveRequests, 'optionalCall', _329 => _329()]) || [];
|
|
10673
10673
|
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
10674
10674
|
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
10675
10675
|
return false;
|
|
@@ -10738,17 +10738,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10738
10738
|
flags
|
|
10739
10739
|
});
|
|
10740
10740
|
let buckets = getBuckets(i18nConfig);
|
|
10741
|
-
if (_optionalChain([flags, 'access',
|
|
10741
|
+
if (_optionalChain([flags, 'access', _330 => _330.bucket, 'optionalAccess', _331 => _331.length])) {
|
|
10742
10742
|
buckets = buckets.filter(
|
|
10743
10743
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
10744
10744
|
);
|
|
10745
10745
|
}
|
|
10746
10746
|
ora.succeed("Buckets retrieved");
|
|
10747
|
-
if (_optionalChain([flags, 'access',
|
|
10747
|
+
if (_optionalChain([flags, 'access', _332 => _332.file, 'optionalAccess', _333 => _333.length])) {
|
|
10748
10748
|
buckets = buckets.map((bucket) => {
|
|
10749
10749
|
const paths = bucket.paths.filter(
|
|
10750
10750
|
(path19) => flags.file.find(
|
|
10751
|
-
(file) => _optionalChain([path19, 'access',
|
|
10751
|
+
(file) => _optionalChain([path19, 'access', _334 => _334.pathPattern, 'optionalAccess', _335 => _335.includes, 'call', _336 => _336(file)]) || _optionalChain([path19, 'access', _337 => _337.pathPattern, 'optionalAccess', _338 => _338.match, 'call', _339 => _339(file)]) || minimatch(path19.pathPattern, file)
|
|
10752
10752
|
)
|
|
10753
10753
|
);
|
|
10754
10754
|
return { ...bucket, paths };
|
|
@@ -10768,7 +10768,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10768
10768
|
});
|
|
10769
10769
|
}
|
|
10770
10770
|
}
|
|
10771
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
10771
|
+
const targetLocales = _optionalChain([flags, 'access', _340 => _340.locale, 'optionalAccess', _341 => _341.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
10772
10772
|
let totalSourceKeyCount = 0;
|
|
10773
10773
|
let uniqueKeysToTranslate = 0;
|
|
10774
10774
|
let totalExistingTranslations = 0;
|
|
@@ -11174,12 +11174,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
11174
11174
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
11175
11175
|
docUrl: "bucketNotFound"
|
|
11176
11176
|
});
|
|
11177
|
-
} else if (_optionalChain([flags, 'access',
|
|
11177
|
+
} else if (_optionalChain([flags, 'access', _342 => _342.locale, 'optionalAccess', _343 => _343.some, 'call', _344 => _344((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
11178
11178
|
throw new CLIError({
|
|
11179
11179
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
11180
11180
|
docUrl: "localeTargetNotFound"
|
|
11181
11181
|
});
|
|
11182
|
-
} else if (_optionalChain([flags, 'access',
|
|
11182
|
+
} else if (_optionalChain([flags, 'access', _345 => _345.bucket, 'optionalAccess', _346 => _346.some, 'call', _347 => _347(
|
|
11183
11183
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
11184
11184
|
)])) {
|
|
11185
11185
|
throw new CLIError({
|
|
@@ -11271,7 +11271,7 @@ async function renderHero2() {
|
|
|
11271
11271
|
// package.json
|
|
11272
11272
|
var package_default = {
|
|
11273
11273
|
name: "lingo.dev",
|
|
11274
|
-
version: "0.111.
|
|
11274
|
+
version: "0.111.13",
|
|
11275
11275
|
description: "Lingo.dev CLI",
|
|
11276
11276
|
private: false,
|
|
11277
11277
|
publishConfig: {
|
|
@@ -11560,7 +11560,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
|
|
|
11560
11560
|
if (options.file && options.file.length) {
|
|
11561
11561
|
buckets = buckets.map((bucket) => {
|
|
11562
11562
|
const paths = bucket.paths.filter(
|
|
11563
|
-
(bucketPath) => _optionalChain([options, 'access',
|
|
11563
|
+
(bucketPath) => _optionalChain([options, 'access', _348 => _348.file, 'optionalAccess', _349 => _349.some, 'call', _350 => _350((f) => bucketPath.pathPattern.includes(f))])
|
|
11564
11564
|
);
|
|
11565
11565
|
return { ...bucket, paths };
|
|
11566
11566
|
}).filter((bucket) => bucket.paths.length > 0);
|