lingo.dev 0.111.11 → 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 +109 -91
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +27 -9
- package/build/cli.mjs.map +1 -1
- package/package.json +5 -5
package/build/cli.cjs
CHANGED
|
@@ -3091,26 +3091,44 @@ async function findBiomeConfig(startPath) {
|
|
|
3091
3091
|
return null;
|
|
3092
3092
|
}
|
|
3093
3093
|
async function formatDataWithBiome(data, filePath, options) {
|
|
3094
|
+
let configPath = null;
|
|
3094
3095
|
try {
|
|
3095
3096
|
const biome = await _jsapi.Biome.create({
|
|
3096
3097
|
distribution: _jsapi.Distribution.NODE
|
|
3097
3098
|
});
|
|
3098
|
-
const
|
|
3099
|
+
const openResult = biome.openProject(".");
|
|
3100
|
+
const projectKey = openResult.projectKey;
|
|
3101
|
+
configPath = await findBiomeConfig(filePath);
|
|
3099
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
|
+
);
|
|
3100
3107
|
return data;
|
|
3101
3108
|
}
|
|
3102
3109
|
if (configPath) {
|
|
3103
3110
|
const configContent = await _promises4.default.readFile(configPath, "utf-8");
|
|
3104
|
-
|
|
3111
|
+
try {
|
|
3112
|
+
const config = JSON.parse(configContent);
|
|
3113
|
+
biome.applyConfiguration(projectKey, config);
|
|
3114
|
+
} catch (parseError) {
|
|
3115
|
+
throw new Error(
|
|
3116
|
+
`Invalid Biome configuration in ${configPath}: ${parseError instanceof Error ? parseError.message : "JSON parse error"}`
|
|
3117
|
+
);
|
|
3118
|
+
}
|
|
3105
3119
|
}
|
|
3106
|
-
const formatted = biome.formatContent(data, {
|
|
3120
|
+
const formatted = biome.formatContent(projectKey, data, {
|
|
3107
3121
|
filePath
|
|
3108
3122
|
});
|
|
3109
3123
|
return formatted.content;
|
|
3110
3124
|
} catch (error) {
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
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
|
+
}
|
|
3114
3132
|
}
|
|
3115
3133
|
return data;
|
|
3116
3134
|
}
|
|
@@ -3152,7 +3170,7 @@ function createPoDataLoader(params) {
|
|
|
3152
3170
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
3153
3171
|
if (msgid && entry.msgid) {
|
|
3154
3172
|
const context = entry.msgctxt || "";
|
|
3155
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
3173
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _141 => _141.translations, 'access', _142 => _142[context], 'optionalAccess', _143 => _143[msgid]]);
|
|
3156
3174
|
if (fullEntry) {
|
|
3157
3175
|
result[msgid] = fullEntry;
|
|
3158
3176
|
}
|
|
@@ -3162,8 +3180,8 @@ function createPoDataLoader(params) {
|
|
|
3162
3180
|
return result;
|
|
3163
3181
|
},
|
|
3164
3182
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
3165
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
3166
|
-
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)]) || [];
|
|
3167
3185
|
const result = originalSections.map((section) => {
|
|
3168
3186
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
3169
3187
|
if (Object.keys(sectionPo.translations).length === 0) {
|
|
@@ -3232,8 +3250,8 @@ function createPoContentLoader() {
|
|
|
3232
3250
|
{
|
|
3233
3251
|
...entry,
|
|
3234
3252
|
msgstr: [
|
|
3235
|
-
_optionalChain([data, 'access',
|
|
3236
|
-
_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
|
|
3237
3255
|
].filter(Boolean)
|
|
3238
3256
|
}
|
|
3239
3257
|
]).fromPairs().value();
|
|
@@ -3355,7 +3373,7 @@ function pullV1(xliffElement, locale, originalLocale) {
|
|
|
3355
3373
|
let key = getTransUnitKey(unit);
|
|
3356
3374
|
if (!key) return;
|
|
3357
3375
|
if (seenKeys.has(key)) {
|
|
3358
|
-
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()]);
|
|
3359
3377
|
if (id) {
|
|
3360
3378
|
key = `${key}#${id}`;
|
|
3361
3379
|
} else {
|
|
@@ -3403,7 +3421,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3403
3421
|
let key = getTransUnitKey(unit);
|
|
3404
3422
|
if (!key) return;
|
|
3405
3423
|
if (seenKeys.has(key)) {
|
|
3406
|
-
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()]);
|
|
3407
3425
|
if (id) {
|
|
3408
3426
|
key = `${key}#${id}`;
|
|
3409
3427
|
} else {
|
|
@@ -3445,7 +3463,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
|
|
|
3445
3463
|
const translationKeys = new Set(Object.keys(translations));
|
|
3446
3464
|
existingUnits.forEach((unit, key) => {
|
|
3447
3465
|
if (!translationKeys.has(key)) {
|
|
3448
|
-
_optionalChain([unit, 'access',
|
|
3466
|
+
_optionalChain([unit, 'access', _164 => _164.parentNode, 'optionalAccess', _165 => _165.removeChild, 'call', _166 => _166(unit)]);
|
|
3449
3467
|
}
|
|
3450
3468
|
});
|
|
3451
3469
|
return serializeWithDeclaration(
|
|
@@ -3488,18 +3506,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
|
|
|
3488
3506
|
Array.from(container.children).forEach((child) => {
|
|
3489
3507
|
const tagName = child.tagName;
|
|
3490
3508
|
if (tagName === "unit") {
|
|
3491
|
-
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()]);
|
|
3492
3510
|
if (!unitId) return;
|
|
3493
3511
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3494
3512
|
const segment = child.querySelector("segment");
|
|
3495
|
-
const source = _optionalChain([segment, 'optionalAccess',
|
|
3513
|
+
const source = _optionalChain([segment, 'optionalAccess', _171 => _171.querySelector, 'call', _172 => _172("source")]);
|
|
3496
3514
|
if (source) {
|
|
3497
3515
|
result[key] = extractTextContent(source);
|
|
3498
3516
|
} else {
|
|
3499
3517
|
result[key] = unitId;
|
|
3500
3518
|
}
|
|
3501
3519
|
} else if (tagName === "group") {
|
|
3502
|
-
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()]);
|
|
3503
3521
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3504
3522
|
traverseUnitsV2(child, fileId, newPath, result);
|
|
3505
3523
|
}
|
|
@@ -3535,12 +3553,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
|
|
|
3535
3553
|
Array.from(container.children).forEach((child) => {
|
|
3536
3554
|
const tagName = child.tagName;
|
|
3537
3555
|
if (tagName === "unit") {
|
|
3538
|
-
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()]);
|
|
3539
3557
|
if (!unitId) return;
|
|
3540
3558
|
const key = `resources/${fileId}/${currentPath}${unitId}/source`;
|
|
3541
3559
|
index.set(key, child);
|
|
3542
3560
|
} else if (tagName === "group") {
|
|
3543
|
-
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()]);
|
|
3544
3562
|
const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
|
|
3545
3563
|
indexUnitsV2(child, fileId, newPath, index);
|
|
3546
3564
|
}
|
|
@@ -3561,9 +3579,9 @@ function updateUnitV2(unit, value) {
|
|
|
3561
3579
|
setTextContent(source, value);
|
|
3562
3580
|
}
|
|
3563
3581
|
function getTransUnitKey(transUnit) {
|
|
3564
|
-
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()]);
|
|
3565
3583
|
if (resname) return resname;
|
|
3566
|
-
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()]);
|
|
3567
3585
|
if (id) return id;
|
|
3568
3586
|
const sourceElement = transUnit.querySelector("source");
|
|
3569
3587
|
if (sourceElement) {
|
|
@@ -3620,7 +3638,7 @@ function formatXml(xml) {
|
|
|
3620
3638
|
if (cdataNode) {
|
|
3621
3639
|
return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
|
|
3622
3640
|
}
|
|
3623
|
-
const textContent = _optionalChain([element, 'access',
|
|
3641
|
+
const textContent = _optionalChain([element, 'access', _193 => _193.textContent, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]) || "";
|
|
3624
3642
|
const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
|
|
3625
3643
|
if (hasOnlyText && textContent) {
|
|
3626
3644
|
return `${indent2}${openTag}${textContent}</${tagName}>`;
|
|
@@ -3913,7 +3931,7 @@ function createDatoClient(params) {
|
|
|
3913
3931
|
ids: !records.length ? void 0 : records.join(",")
|
|
3914
3932
|
}
|
|
3915
3933
|
}).catch(
|
|
3916
|
-
(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)
|
|
3917
3935
|
);
|
|
3918
3936
|
},
|
|
3919
3937
|
findRecordsForModel: async (modelId, records) => {
|
|
@@ -3924,10 +3942,10 @@ function createDatoClient(params) {
|
|
|
3924
3942
|
filter: {
|
|
3925
3943
|
type: modelId,
|
|
3926
3944
|
only_valid: "true",
|
|
3927
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
3945
|
+
ids: !_optionalChain([records, 'optionalAccess', _200 => _200.length]) ? void 0 : records.join(",")
|
|
3928
3946
|
}
|
|
3929
3947
|
}).catch(
|
|
3930
|
-
(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)
|
|
3931
3949
|
);
|
|
3932
3950
|
return result;
|
|
3933
3951
|
} catch (_error) {
|
|
@@ -3943,10 +3961,10 @@ function createDatoClient(params) {
|
|
|
3943
3961
|
updateRecord: async (id, payload) => {
|
|
3944
3962
|
try {
|
|
3945
3963
|
await dato.items.update(id, payload).catch(
|
|
3946
|
-
(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)
|
|
3947
3965
|
);
|
|
3948
3966
|
} catch (_error) {
|
|
3949
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
3967
|
+
if (_optionalChain([_error, 'optionalAccess', _209 => _209.attributes, 'optionalAccess', _210 => _210.details, 'optionalAccess', _211 => _211.message])) {
|
|
3950
3968
|
throw new Error(
|
|
3951
3969
|
[
|
|
3952
3970
|
`${_error.attributes.details.message}`,
|
|
@@ -3968,10 +3986,10 @@ function createDatoClient(params) {
|
|
|
3968
3986
|
enableFieldLocalization: async (args) => {
|
|
3969
3987
|
try {
|
|
3970
3988
|
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
|
|
3971
|
-
(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)
|
|
3972
3990
|
);
|
|
3973
3991
|
} catch (_error) {
|
|
3974
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
3992
|
+
if (_optionalChain([_error, 'optionalAccess', _216 => _216.attributes, 'optionalAccess', _217 => _217.code]) === "NOT_FOUND") {
|
|
3975
3993
|
throw new Error(
|
|
3976
3994
|
[
|
|
3977
3995
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -3979,7 +3997,7 @@ function createDatoClient(params) {
|
|
|
3979
3997
|
].join("\n\n")
|
|
3980
3998
|
);
|
|
3981
3999
|
}
|
|
3982
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
4000
|
+
if (_optionalChain([_error, 'optionalAccess', _218 => _218.attributes, 'optionalAccess', _219 => _219.details, 'optionalAccess', _220 => _220.message])) {
|
|
3983
4001
|
throw new Error(
|
|
3984
4002
|
[
|
|
3985
4003
|
`${_error.attributes.details.message}`,
|
|
@@ -4057,7 +4075,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4057
4075
|
const records = await dato.findRecordsForModel(modelId);
|
|
4058
4076
|
const recordChoices = createRecordChoices(
|
|
4059
4077
|
records,
|
|
4060
|
-
_optionalChain([config, 'access',
|
|
4078
|
+
_optionalChain([config, 'access', _221 => _221.models, 'access', _222 => _222[modelId], 'optionalAccess', _223 => _223.records]) || [],
|
|
4061
4079
|
project
|
|
4062
4080
|
);
|
|
4063
4081
|
const selectedRecords = await promptRecordSelection(
|
|
@@ -4076,14 +4094,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
4076
4094
|
},
|
|
4077
4095
|
async pull(locale, input2, initCtx) {
|
|
4078
4096
|
const result = {};
|
|
4079
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
4080
|
-
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]) || [];
|
|
4081
4099
|
const recordIds = records.map((record) => record.id);
|
|
4082
4100
|
records = await dato.findRecords(recordIds);
|
|
4083
4101
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
4084
4102
|
if (records.length > 0) {
|
|
4085
4103
|
result[modelId] = {
|
|
4086
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
4104
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _228 => _228.models, 'optionalAccess', _229 => _229[modelId], 'optionalAccess', _230 => _230.fields]) || [],
|
|
4087
4105
|
records
|
|
4088
4106
|
};
|
|
4089
4107
|
}
|
|
@@ -4146,7 +4164,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
4146
4164
|
return records.map((record) => ({
|
|
4147
4165
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
4148
4166
|
value: record.id,
|
|
4149
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
4167
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _231 => _231.includes, 'call', _232 => _232(record.id)])
|
|
4150
4168
|
}));
|
|
4151
4169
|
}
|
|
4152
4170
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -4465,7 +4483,7 @@ function createVttLoader() {
|
|
|
4465
4483
|
if (!input2) {
|
|
4466
4484
|
return "";
|
|
4467
4485
|
}
|
|
4468
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
4486
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _233 => _233.parse, 'call', _234 => _234(input2), 'optionalAccess', _235 => _235.cues]);
|
|
4469
4487
|
if (Object.keys(vtt).length === 0) {
|
|
4470
4488
|
return {};
|
|
4471
4489
|
} else {
|
|
@@ -4519,7 +4537,7 @@ function variableExtractLoader(params) {
|
|
|
4519
4537
|
for (let i = 0; i < matches.length; i++) {
|
|
4520
4538
|
const match2 = matches[i];
|
|
4521
4539
|
const currentValue = result[key].value;
|
|
4522
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4540
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _236 => _236.replace, 'call', _237 => _237(match2, `{variable:${i}}`)]);
|
|
4523
4541
|
result[key].value = newValue;
|
|
4524
4542
|
result[key].variables[i] = match2;
|
|
4525
4543
|
}
|
|
@@ -4533,7 +4551,7 @@ function variableExtractLoader(params) {
|
|
|
4533
4551
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
4534
4552
|
const variable = valueObj.variables[i];
|
|
4535
4553
|
const currentValue = result[key];
|
|
4536
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
4554
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _238 => _238.replace, 'call', _239 => _239(`{variable:${i}}`, variable)]);
|
|
4537
4555
|
result[key] = newValue;
|
|
4538
4556
|
}
|
|
4539
4557
|
}
|
|
@@ -4733,7 +4751,7 @@ function createVueJsonLoader() {
|
|
|
4733
4751
|
return createLoader({
|
|
4734
4752
|
pull: async (locale, input2, ctx) => {
|
|
4735
4753
|
const parsed = parseVueFile(input2);
|
|
4736
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
4754
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _240 => _240.i18n, 'optionalAccess', _241 => _241[locale]]), () => ( {}));
|
|
4737
4755
|
},
|
|
4738
4756
|
push: async (locale, data, originalInput) => {
|
|
4739
4757
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -4918,7 +4936,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
4918
4936
|
objectExpression.properties.forEach((prop) => {
|
|
4919
4937
|
if (!t.isObjectProperty(prop)) return;
|
|
4920
4938
|
const key = getPropertyKey(prop);
|
|
4921
|
-
const incomingVal = _optionalChain([data, 'optionalAccess',
|
|
4939
|
+
const incomingVal = _optionalChain([data, 'optionalAccess', _242 => _242[key]]);
|
|
4922
4940
|
if (incomingVal === void 0) {
|
|
4923
4941
|
return;
|
|
4924
4942
|
}
|
|
@@ -4954,7 +4972,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
4954
4972
|
let modified = false;
|
|
4955
4973
|
arrayExpression.elements.forEach((element, index) => {
|
|
4956
4974
|
if (!element) return;
|
|
4957
|
-
const incomingVal = _optionalChain([incoming, 'optionalAccess',
|
|
4975
|
+
const incomingVal = _optionalChain([incoming, 'optionalAccess', _243 => _243[index]]);
|
|
4958
4976
|
if (incomingVal === void 0) return;
|
|
4959
4977
|
if (t.isStringLiteral(element) && typeof incomingVal === "string") {
|
|
4960
4978
|
if (element.value !== incomingVal) {
|
|
@@ -5445,7 +5463,7 @@ var AST = class _AST {
|
|
|
5445
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())];
|
|
5446
5464
|
if (this.isStart() && !this.type)
|
|
5447
5465
|
ret.unshift([]);
|
|
5448
|
-
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]) === "!")) {
|
|
5449
5467
|
ret.push({});
|
|
5450
5468
|
}
|
|
5451
5469
|
return ret;
|
|
@@ -5453,7 +5471,7 @@ var AST = class _AST {
|
|
|
5453
5471
|
isStart() {
|
|
5454
5472
|
if (this.#root === this)
|
|
5455
5473
|
return true;
|
|
5456
|
-
if (!_optionalChain([this, 'access',
|
|
5474
|
+
if (!_optionalChain([this, 'access', _246 => _246.#parent, 'optionalAccess', _247 => _247.isStart, 'call', _248 => _248()]))
|
|
5457
5475
|
return false;
|
|
5458
5476
|
if (this.#parentIndex === 0)
|
|
5459
5477
|
return true;
|
|
@@ -5469,12 +5487,12 @@ var AST = class _AST {
|
|
|
5469
5487
|
isEnd() {
|
|
5470
5488
|
if (this.#root === this)
|
|
5471
5489
|
return true;
|
|
5472
|
-
if (_optionalChain([this, 'access',
|
|
5490
|
+
if (_optionalChain([this, 'access', _249 => _249.#parent, 'optionalAccess', _250 => _250.type]) === "!")
|
|
5473
5491
|
return true;
|
|
5474
|
-
if (!_optionalChain([this, 'access',
|
|
5492
|
+
if (!_optionalChain([this, 'access', _251 => _251.#parent, 'optionalAccess', _252 => _252.isEnd, 'call', _253 => _253()]))
|
|
5475
5493
|
return false;
|
|
5476
5494
|
if (!this.type)
|
|
5477
|
-
return _optionalChain([this, 'access',
|
|
5495
|
+
return _optionalChain([this, 'access', _254 => _254.#parent, 'optionalAccess', _255 => _255.isEnd, 'call', _256 => _256()]);
|
|
5478
5496
|
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
5479
5497
|
return this.#parentIndex === pl - 1;
|
|
5480
5498
|
}
|
|
@@ -5719,7 +5737,7 @@ var AST = class _AST {
|
|
|
5719
5737
|
}
|
|
5720
5738
|
}
|
|
5721
5739
|
let end = "";
|
|
5722
|
-
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]) === "!") {
|
|
5723
5741
|
end = "(?:$|\\/)";
|
|
5724
5742
|
}
|
|
5725
5743
|
const final2 = start2 + src + end;
|
|
@@ -6796,7 +6814,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
6796
6814
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
6797
6815
|
const result = {
|
|
6798
6816
|
frontmatter: data.frontmatter,
|
|
6799
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
6817
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _259 => _259.codePlaceholders]) || {},
|
|
6800
6818
|
content
|
|
6801
6819
|
};
|
|
6802
6820
|
return result;
|
|
@@ -7535,7 +7553,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
7535
7553
|
]
|
|
7536
7554
|
});
|
|
7537
7555
|
const result = JSON.parse(response.text);
|
|
7538
|
-
return _optionalChain([result, 'optionalAccess',
|
|
7556
|
+
return _optionalChain([result, 'optionalAccess', _260 => _260.data]) || {};
|
|
7539
7557
|
}
|
|
7540
7558
|
}
|
|
7541
7559
|
function extractPayloadChunks(payload) {
|
|
@@ -7617,7 +7635,7 @@ function getPureModelProvider(provider) {
|
|
|
7617
7635
|
|
|
7618
7636
|
${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
|
|
7619
7637
|
`;
|
|
7620
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
7638
|
+
switch (_optionalChain([provider, 'optionalAccess', _261 => _261.id])) {
|
|
7621
7639
|
case "openai": {
|
|
7622
7640
|
if (!process.env.OPENAI_API_KEY) {
|
|
7623
7641
|
throw new Error(
|
|
@@ -7675,7 +7693,7 @@ function getPureModelProvider(provider) {
|
|
|
7675
7693
|
})(provider.model);
|
|
7676
7694
|
}
|
|
7677
7695
|
default: {
|
|
7678
|
-
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess',
|
|
7696
|
+
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _262 => _262.id])));
|
|
7679
7697
|
}
|
|
7680
7698
|
}
|
|
7681
7699
|
}
|
|
@@ -7960,7 +7978,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7960
7978
|
validateParams(i18nConfig, flags);
|
|
7961
7979
|
ora.succeed("Localization configuration is valid");
|
|
7962
7980
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
7963
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
7981
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _263 => _263.provider]);
|
|
7964
7982
|
if (isByokMode) {
|
|
7965
7983
|
authId = null;
|
|
7966
7984
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -7974,16 +7992,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
7974
7992
|
flags
|
|
7975
7993
|
});
|
|
7976
7994
|
let buckets = getBuckets(i18nConfig);
|
|
7977
|
-
if (_optionalChain([flags, 'access',
|
|
7995
|
+
if (_optionalChain([flags, 'access', _264 => _264.bucket, 'optionalAccess', _265 => _265.length])) {
|
|
7978
7996
|
buckets = buckets.filter(
|
|
7979
7997
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
7980
7998
|
);
|
|
7981
7999
|
}
|
|
7982
8000
|
ora.succeed("Buckets retrieved");
|
|
7983
|
-
if (_optionalChain([flags, 'access',
|
|
8001
|
+
if (_optionalChain([flags, 'access', _266 => _266.file, 'optionalAccess', _267 => _267.length])) {
|
|
7984
8002
|
buckets = buckets.map((bucket) => {
|
|
7985
8003
|
const paths = bucket.paths.filter(
|
|
7986
|
-
(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)]))
|
|
7987
8005
|
);
|
|
7988
8006
|
return { ...bucket, paths };
|
|
7989
8007
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -8004,7 +8022,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8004
8022
|
});
|
|
8005
8023
|
}
|
|
8006
8024
|
}
|
|
8007
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
8025
|
+
const targetLocales = _optionalChain([flags, 'access', _271 => _271.locale, 'optionalAccess', _272 => _272.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
8008
8026
|
ora.start("Setting up localization cache...");
|
|
8009
8027
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
8010
8028
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -8281,7 +8299,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
8281
8299
|
}
|
|
8282
8300
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
8283
8301
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
8284
|
-
if (!_optionalChain([flags, 'access',
|
|
8302
|
+
if (!_optionalChain([flags, 'access', _273 => _273.locale, 'optionalAccess', _274 => _274.length])) {
|
|
8285
8303
|
await deltaProcessor.saveChecksums(checksums);
|
|
8286
8304
|
}
|
|
8287
8305
|
}
|
|
@@ -8405,12 +8423,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
8405
8423
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
8406
8424
|
docUrl: "bucketNotFound"
|
|
8407
8425
|
});
|
|
8408
|
-
} 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))])) {
|
|
8409
8427
|
throw new ValidationError({
|
|
8410
8428
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
8411
8429
|
docUrl: "localeTargetNotFound"
|
|
8412
8430
|
});
|
|
8413
|
-
} else if (_optionalChain([flags, 'access',
|
|
8431
|
+
} else if (_optionalChain([flags, 'access', _278 => _278.bucket, 'optionalAccess', _279 => _279.some, 'call', _280 => _280(
|
|
8414
8432
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
8415
8433
|
)])) {
|
|
8416
8434
|
throw new ValidationError({
|
|
@@ -8936,7 +8954,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
8936
8954
|
const response = await engine.whoami();
|
|
8937
8955
|
return {
|
|
8938
8956
|
authenticated: !!response,
|
|
8939
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
8957
|
+
username: _optionalChain([response, 'optionalAccess', _281 => _281.email])
|
|
8940
8958
|
};
|
|
8941
8959
|
} catch (e3) {
|
|
8942
8960
|
return { authenticated: false };
|
|
@@ -9044,7 +9062,7 @@ function createExplicitLocalizer(provider) {
|
|
|
9044
9062
|
}
|
|
9045
9063
|
function createAiSdkLocalizer(params) {
|
|
9046
9064
|
const skipAuth = params.skipAuth === true;
|
|
9047
|
-
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
9065
|
+
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _282 => _282.apiKeyName]), () => ( ""))];
|
|
9048
9066
|
if (!skipAuth && !apiKey || !params.apiKeyName) {
|
|
9049
9067
|
throw new Error(
|
|
9050
9068
|
_dedent2.default`
|
|
@@ -9169,8 +9187,8 @@ async function setup(input2) {
|
|
|
9169
9187
|
throw new Error(
|
|
9170
9188
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
9171
9189
|
);
|
|
9172
|
-
} else if (_optionalChain([ctx, 'access',
|
|
9173
|
-
(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]])
|
|
9174
9192
|
)])) {
|
|
9175
9193
|
throw new Error(
|
|
9176
9194
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -9183,7 +9201,7 @@ async function setup(input2) {
|
|
|
9183
9201
|
title: "Selecting localization provider",
|
|
9184
9202
|
task: async (ctx, task) => {
|
|
9185
9203
|
ctx.localizer = createLocalizer(
|
|
9186
|
-
_optionalChain([ctx, 'access',
|
|
9204
|
+
_optionalChain([ctx, 'access', _290 => _290.config, 'optionalAccess', _291 => _291.provider]),
|
|
9187
9205
|
ctx.flags.apiKey
|
|
9188
9206
|
);
|
|
9189
9207
|
if (!ctx.localizer) {
|
|
@@ -9504,7 +9522,7 @@ function createWorkerTask(args) {
|
|
|
9504
9522
|
const processableData = _lodash2.default.chain(sourceData).entries().filter(
|
|
9505
9523
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
9506
9524
|
).filter(
|
|
9507
|
-
([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(
|
|
9508
9526
|
(pattern) => minimatch(key, pattern)
|
|
9509
9527
|
)])
|
|
9510
9528
|
).fromPairs().value();
|
|
@@ -9567,7 +9585,7 @@ function createWorkerTask(args) {
|
|
|
9567
9585
|
finalRenamedTargetData
|
|
9568
9586
|
);
|
|
9569
9587
|
const checksums2 = await deltaProcessor.createChecksums(sourceData);
|
|
9570
|
-
if (!_optionalChain([args, 'access',
|
|
9588
|
+
if (!_optionalChain([args, 'access', _295 => _295.ctx, 'access', _296 => _296.flags, 'access', _297 => _297.targetLocale, 'optionalAccess', _298 => _298.length])) {
|
|
9571
9589
|
await deltaProcessor.saveChecksums(checksums2);
|
|
9572
9590
|
}
|
|
9573
9591
|
});
|
|
@@ -9758,13 +9776,13 @@ var flagsSchema2 = _zod.z.object({
|
|
|
9758
9776
|
|
|
9759
9777
|
// src/cli/cmd/run/_utils.ts
|
|
9760
9778
|
async function determineAuthId(ctx) {
|
|
9761
|
-
const isByokMode = !!_optionalChain([ctx, 'access',
|
|
9779
|
+
const isByokMode = !!_optionalChain([ctx, 'access', _299 => _299.config, 'optionalAccess', _300 => _300.provider]);
|
|
9762
9780
|
if (isByokMode) {
|
|
9763
9781
|
return null;
|
|
9764
9782
|
} else {
|
|
9765
9783
|
try {
|
|
9766
|
-
const authStatus = await _optionalChain([ctx, 'access',
|
|
9767
|
-
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;
|
|
9768
9786
|
} catch (e4) {
|
|
9769
9787
|
return null;
|
|
9770
9788
|
}
|
|
@@ -9956,7 +9974,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
9956
9974
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
9957
9975
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
9958
9976
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
9959
|
-
_optionalChain([this, 'access',
|
|
9977
|
+
_optionalChain([this, 'access', _305 => _305.platformKit, 'optionalAccess', _306 => _306.gitConfig, 'call', _307 => _307()]);
|
|
9960
9978
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
9961
9979
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
9962
9980
|
if (!processOwnCommits) {
|
|
@@ -9988,7 +10006,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
9988
10006
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
9989
10007
|
var PullRequestFlow = class extends InBranchFlow {
|
|
9990
10008
|
async preRun() {
|
|
9991
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
10009
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _308 => _308()]);
|
|
9992
10010
|
if (!canContinue) {
|
|
9993
10011
|
return false;
|
|
9994
10012
|
}
|
|
@@ -10251,10 +10269,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
10251
10269
|
repo_slug: this.platformConfig.repositoryName,
|
|
10252
10270
|
state: "OPEN"
|
|
10253
10271
|
}).then(({ data: { values } }) => {
|
|
10254
|
-
return _optionalChain([values, 'optionalAccess',
|
|
10255
|
-
({ 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
|
|
10256
10274
|
)]);
|
|
10257
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10275
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _315 => _315.id]));
|
|
10258
10276
|
}
|
|
10259
10277
|
async closePullRequest({ pullRequestNumber }) {
|
|
10260
10278
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -10350,7 +10368,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
10350
10368
|
repo: this.platformConfig.repositoryName,
|
|
10351
10369
|
base: this.platformConfig.baseBranchName,
|
|
10352
10370
|
state: "open"
|
|
10353
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
10371
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _316 => _316.number]));
|
|
10354
10372
|
}
|
|
10355
10373
|
async closePullRequest({ pullRequestNumber }) {
|
|
10356
10374
|
await this.octokit.rest.pulls.update({
|
|
@@ -10477,7 +10495,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
10477
10495
|
sourceBranch: branch,
|
|
10478
10496
|
state: "opened"
|
|
10479
10497
|
});
|
|
10480
|
-
return _optionalChain([mergeRequests, 'access',
|
|
10498
|
+
return _optionalChain([mergeRequests, 'access', _317 => _317[0], 'optionalAccess', _318 => _318.iid]);
|
|
10481
10499
|
}
|
|
10482
10500
|
async closePullRequest({
|
|
10483
10501
|
pullRequestNumber
|
|
@@ -10583,7 +10601,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10583
10601
|
}
|
|
10584
10602
|
const env = {
|
|
10585
10603
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
10586
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
10604
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _319 => _319.pullRequest, 'optionalAccess', _320 => _320.toString, 'call', _321 => _321()]) || "false",
|
|
10587
10605
|
...options.commitMessage && {
|
|
10588
10606
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
10589
10607
|
},
|
|
@@ -10603,7 +10621,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10603
10621
|
const { isPullRequestMode } = platformKit.config;
|
|
10604
10622
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
10605
10623
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
10606
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
10624
|
+
const canRun = await _optionalChain([flow, 'access', _322 => _322.preRun, 'optionalCall', _323 => _323()]);
|
|
10607
10625
|
if (canRun === false) {
|
|
10608
10626
|
return;
|
|
10609
10627
|
}
|
|
@@ -10613,7 +10631,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
10613
10631
|
if (!hasChanges) {
|
|
10614
10632
|
return;
|
|
10615
10633
|
}
|
|
10616
|
-
await _optionalChain([flow, 'access',
|
|
10634
|
+
await _optionalChain([flow, 'access', _324 => _324.postRun, 'optionalCall', _325 => _325()]);
|
|
10617
10635
|
});
|
|
10618
10636
|
function parseBooleanArg(val) {
|
|
10619
10637
|
if (val === true) return true;
|
|
@@ -10650,8 +10668,8 @@ function exitGracefully(elapsedMs = 0) {
|
|
|
10650
10668
|
}
|
|
10651
10669
|
}
|
|
10652
10670
|
function checkForPendingOperations() {
|
|
10653
|
-
const activeHandles = _optionalChain([process, 'access',
|
|
10654
|
-
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()]) || [];
|
|
10655
10673
|
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
10656
10674
|
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
10657
10675
|
return false;
|
|
@@ -10720,17 +10738,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10720
10738
|
flags
|
|
10721
10739
|
});
|
|
10722
10740
|
let buckets = getBuckets(i18nConfig);
|
|
10723
|
-
if (_optionalChain([flags, 'access',
|
|
10741
|
+
if (_optionalChain([flags, 'access', _330 => _330.bucket, 'optionalAccess', _331 => _331.length])) {
|
|
10724
10742
|
buckets = buckets.filter(
|
|
10725
10743
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
10726
10744
|
);
|
|
10727
10745
|
}
|
|
10728
10746
|
ora.succeed("Buckets retrieved");
|
|
10729
|
-
if (_optionalChain([flags, 'access',
|
|
10747
|
+
if (_optionalChain([flags, 'access', _332 => _332.file, 'optionalAccess', _333 => _333.length])) {
|
|
10730
10748
|
buckets = buckets.map((bucket) => {
|
|
10731
10749
|
const paths = bucket.paths.filter(
|
|
10732
10750
|
(path19) => flags.file.find(
|
|
10733
|
-
(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)
|
|
10734
10752
|
)
|
|
10735
10753
|
);
|
|
10736
10754
|
return { ...bucket, paths };
|
|
@@ -10750,7 +10768,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
10750
10768
|
});
|
|
10751
10769
|
}
|
|
10752
10770
|
}
|
|
10753
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
10771
|
+
const targetLocales = _optionalChain([flags, 'access', _340 => _340.locale, 'optionalAccess', _341 => _341.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
10754
10772
|
let totalSourceKeyCount = 0;
|
|
10755
10773
|
let uniqueKeysToTranslate = 0;
|
|
10756
10774
|
let totalExistingTranslations = 0;
|
|
@@ -11156,12 +11174,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
11156
11174
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
11157
11175
|
docUrl: "bucketNotFound"
|
|
11158
11176
|
});
|
|
11159
|
-
} 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))])) {
|
|
11160
11178
|
throw new CLIError({
|
|
11161
11179
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
11162
11180
|
docUrl: "localeTargetNotFound"
|
|
11163
11181
|
});
|
|
11164
|
-
} else if (_optionalChain([flags, 'access',
|
|
11182
|
+
} else if (_optionalChain([flags, 'access', _345 => _345.bucket, 'optionalAccess', _346 => _346.some, 'call', _347 => _347(
|
|
11165
11183
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
11166
11184
|
)])) {
|
|
11167
11185
|
throw new CLIError({
|
|
@@ -11253,7 +11271,7 @@ async function renderHero2() {
|
|
|
11253
11271
|
// package.json
|
|
11254
11272
|
var package_default = {
|
|
11255
11273
|
name: "lingo.dev",
|
|
11256
|
-
version: "0.111.
|
|
11274
|
+
version: "0.111.13",
|
|
11257
11275
|
description: "Lingo.dev CLI",
|
|
11258
11276
|
private: false,
|
|
11259
11277
|
publishConfig: {
|
|
@@ -11383,8 +11401,8 @@ var package_default = {
|
|
|
11383
11401
|
"@babel/parser": "^7.27.1",
|
|
11384
11402
|
"@babel/traverse": "^7.27.4",
|
|
11385
11403
|
"@babel/types": "^7.27.1",
|
|
11386
|
-
"@biomejs/js-api": "^0.
|
|
11387
|
-
"@biomejs/wasm-nodejs": "^
|
|
11404
|
+
"@biomejs/js-api": "^3.0.0",
|
|
11405
|
+
"@biomejs/wasm-nodejs": "^2.2.4",
|
|
11388
11406
|
"@datocms/cma-client-node": "^4.0.1",
|
|
11389
11407
|
"@gitbeaker/rest": "^39.34.3",
|
|
11390
11408
|
"@inkjs/ui": "^2.0.0",
|
|
@@ -11542,7 +11560,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
|
|
|
11542
11560
|
if (options.file && options.file.length) {
|
|
11543
11561
|
buckets = buckets.map((bucket) => {
|
|
11544
11562
|
const paths = bucket.paths.filter(
|
|
11545
|
-
(bucketPath) => _optionalChain([options, 'access',
|
|
11563
|
+
(bucketPath) => _optionalChain([options, 'access', _348 => _348.file, 'optionalAccess', _349 => _349.some, 'call', _350 => _350((f) => bucketPath.pathPattern.includes(f))])
|
|
11546
11564
|
);
|
|
11547
11565
|
return { ...bucket, paths };
|
|
11548
11566
|
}).filter((bucket) => bucket.paths.length > 0);
|