lingo.dev 0.85.5 → 0.85.7
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 +77 -50
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +35 -8
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.cjs
CHANGED
|
@@ -1032,6 +1032,8 @@ function createLoader(lDefinition) {
|
|
|
1032
1032
|
const state = {
|
|
1033
1033
|
defaultLocale: void 0,
|
|
1034
1034
|
originalInput: void 0,
|
|
1035
|
+
pullInput: void 0,
|
|
1036
|
+
pullOutput: void 0,
|
|
1035
1037
|
initCtx: void 0
|
|
1036
1038
|
};
|
|
1037
1039
|
return {
|
|
@@ -1059,7 +1061,10 @@ function createLoader(lDefinition) {
|
|
|
1059
1061
|
if (locale === state.defaultLocale) {
|
|
1060
1062
|
state.originalInput = input2 || null;
|
|
1061
1063
|
}
|
|
1062
|
-
|
|
1064
|
+
state.pullInput = input2;
|
|
1065
|
+
const result = await lDefinition.pull(locale, input2, state.initCtx);
|
|
1066
|
+
state.pullOutput = result;
|
|
1067
|
+
return result;
|
|
1063
1068
|
},
|
|
1064
1069
|
async push(locale, data) {
|
|
1065
1070
|
if (!state.defaultLocale) {
|
|
@@ -1068,7 +1073,14 @@ function createLoader(lDefinition) {
|
|
|
1068
1073
|
if (state.originalInput === void 0) {
|
|
1069
1074
|
throw new Error("Cannot push data without pulling first");
|
|
1070
1075
|
}
|
|
1071
|
-
const pushResult = await lDefinition.push(
|
|
1076
|
+
const pushResult = await lDefinition.push(
|
|
1077
|
+
locale,
|
|
1078
|
+
data,
|
|
1079
|
+
state.originalInput,
|
|
1080
|
+
state.defaultLocale,
|
|
1081
|
+
state.pullInput,
|
|
1082
|
+
state.pullOutput
|
|
1083
|
+
);
|
|
1072
1084
|
return pushResult;
|
|
1073
1085
|
}
|
|
1074
1086
|
};
|
|
@@ -1996,14 +2008,27 @@ function createPoDataLoader(params) {
|
|
|
1996
2008
|
}
|
|
1997
2009
|
return result;
|
|
1998
2010
|
},
|
|
1999
|
-
async push(locale, data, originalInput) {
|
|
2000
|
-
const
|
|
2001
|
-
const
|
|
2011
|
+
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
2012
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _86 => _86.split, 'call', _87 => _87("\n\n"), 'access', _88 => _88.filter, 'call', _89 => _89(Boolean)]) || [];
|
|
2013
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _90 => _90.split, 'call', _91 => _91("\n\n"), 'access', _92 => _92.filter, 'call', _93 => _93(Boolean)]) || [];
|
|
2014
|
+
const result = originalSections.map((section) => {
|
|
2002
2015
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
2003
2016
|
const contextKey = _lodash2.default.keys(sectionPo.translations)[0];
|
|
2004
2017
|
const entries = sectionPo.translations[contextKey];
|
|
2005
2018
|
const msgid = Object.keys(entries).find((key) => entries[key].msgid);
|
|
2006
|
-
if (!msgid)
|
|
2019
|
+
if (!msgid) {
|
|
2020
|
+
const currentSection = currentSections.find((cs) => {
|
|
2021
|
+
const csPo = _gettextparser2.default.po.parse(cs);
|
|
2022
|
+
const csContextKey = _lodash2.default.keys(csPo.translations)[0];
|
|
2023
|
+
const csEntries = csPo.translations[csContextKey];
|
|
2024
|
+
const csMsgid = Object.keys(csEntries).find((key) => csEntries[key].msgid);
|
|
2025
|
+
return csMsgid === msgid;
|
|
2026
|
+
});
|
|
2027
|
+
if (currentSection) {
|
|
2028
|
+
return currentSection;
|
|
2029
|
+
}
|
|
2030
|
+
return section;
|
|
2031
|
+
}
|
|
2007
2032
|
if (data[msgid]) {
|
|
2008
2033
|
const updatedPo = _lodash2.default.merge({}, sectionPo, {
|
|
2009
2034
|
translations: {
|
|
@@ -2039,7 +2064,7 @@ function createPoContentLoader() {
|
|
|
2039
2064
|
entry.msgid,
|
|
2040
2065
|
{
|
|
2041
2066
|
...entry,
|
|
2042
|
-
msgstr: [_optionalChain([data, 'access',
|
|
2067
|
+
msgstr: [_optionalChain([data, 'access', _94 => _94[entry.msgid], 'optionalAccess', _95 => _95.singular]), _optionalChain([data, 'access', _96 => _96[entry.msgid], 'optionalAccess', _97 => _97.plural]) || null].filter(Boolean)
|
|
2043
2068
|
}
|
|
2044
2069
|
]).fromPairs().value();
|
|
2045
2070
|
return result;
|
|
@@ -2285,7 +2310,7 @@ function createDatoClient(params) {
|
|
|
2285
2310
|
only_valid: "true",
|
|
2286
2311
|
ids: !records.length ? void 0 : records.join(",")
|
|
2287
2312
|
}
|
|
2288
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2313
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _98 => _98.response, 'optionalAccess', _99 => _99.body, 'optionalAccess', _100 => _100.data, 'optionalAccess', _101 => _101[0]]) || error));
|
|
2289
2314
|
},
|
|
2290
2315
|
findRecordsForModel: async (modelId, records) => {
|
|
2291
2316
|
try {
|
|
@@ -2295,9 +2320,9 @@ function createDatoClient(params) {
|
|
|
2295
2320
|
filter: {
|
|
2296
2321
|
type: modelId,
|
|
2297
2322
|
only_valid: "true",
|
|
2298
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
2323
|
+
ids: !_optionalChain([records, 'optionalAccess', _102 => _102.length]) ? void 0 : records.join(",")
|
|
2299
2324
|
}
|
|
2300
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2325
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _103 => _103.response, 'optionalAccess', _104 => _104.body, 'optionalAccess', _105 => _105.data, 'optionalAccess', _106 => _106[0]]) || error));
|
|
2301
2326
|
return result;
|
|
2302
2327
|
} catch (_error) {
|
|
2303
2328
|
throw new Error(
|
|
@@ -2311,9 +2336,9 @@ function createDatoClient(params) {
|
|
|
2311
2336
|
},
|
|
2312
2337
|
updateRecord: async (id, payload) => {
|
|
2313
2338
|
try {
|
|
2314
|
-
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2339
|
+
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _107 => _107.response, 'optionalAccess', _108 => _108.body, 'optionalAccess', _109 => _109.data, 'optionalAccess', _110 => _110[0]]) || error));
|
|
2315
2340
|
} catch (_error) {
|
|
2316
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2341
|
+
if (_optionalChain([_error, 'optionalAccess', _111 => _111.attributes, 'optionalAccess', _112 => _112.details, 'optionalAccess', _113 => _113.message])) {
|
|
2317
2342
|
throw new Error(
|
|
2318
2343
|
[
|
|
2319
2344
|
`${_error.attributes.details.message}`,
|
|
@@ -2334,9 +2359,9 @@ function createDatoClient(params) {
|
|
|
2334
2359
|
},
|
|
2335
2360
|
enableFieldLocalization: async (args) => {
|
|
2336
2361
|
try {
|
|
2337
|
-
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2362
|
+
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _114 => _114.response, 'optionalAccess', _115 => _115.body, 'optionalAccess', _116 => _116.data, 'optionalAccess', _117 => _117[0]]) || error));
|
|
2338
2363
|
} catch (_error) {
|
|
2339
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2364
|
+
if (_optionalChain([_error, 'optionalAccess', _118 => _118.attributes, 'optionalAccess', _119 => _119.code]) === "NOT_FOUND") {
|
|
2340
2365
|
throw new Error(
|
|
2341
2366
|
[
|
|
2342
2367
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -2344,7 +2369,7 @@ function createDatoClient(params) {
|
|
|
2344
2369
|
].join("\n\n")
|
|
2345
2370
|
);
|
|
2346
2371
|
}
|
|
2347
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2372
|
+
if (_optionalChain([_error, 'optionalAccess', _120 => _120.attributes, 'optionalAccess', _121 => _121.details, 'optionalAccess', _122 => _122.message])) {
|
|
2348
2373
|
throw new Error(
|
|
2349
2374
|
[`${_error.attributes.details.message}`, `Error: ${JSON.stringify(_error, null, 2)}`].join("\n\n")
|
|
2350
2375
|
);
|
|
@@ -2410,7 +2435,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2410
2435
|
}
|
|
2411
2436
|
}
|
|
2412
2437
|
const records = await dato.findRecordsForModel(modelId);
|
|
2413
|
-
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access',
|
|
2438
|
+
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access', _123 => _123.models, 'access', _124 => _124[modelId], 'optionalAccess', _125 => _125.records]) || [], project);
|
|
2414
2439
|
const selectedRecords = await promptRecordSelection(modelName, recordChoices);
|
|
2415
2440
|
result.models[modelId].records = records.filter((record) => selectedRecords.includes(record.id));
|
|
2416
2441
|
updatedConfig.models[modelId].records = selectedRecords;
|
|
@@ -2422,14 +2447,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2422
2447
|
},
|
|
2423
2448
|
async pull(locale, input2, initCtx) {
|
|
2424
2449
|
const result = {};
|
|
2425
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
2426
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
2450
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _126 => _126.models]) || {})) {
|
|
2451
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _127 => _127.models, 'access', _128 => _128[modelId], 'access', _129 => _129.records]) || [];
|
|
2427
2452
|
const recordIds = records.map((record) => record.id);
|
|
2428
2453
|
records = await dato.findRecords(recordIds);
|
|
2429
2454
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
2430
2455
|
if (records.length > 0) {
|
|
2431
2456
|
result[modelId] = {
|
|
2432
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
2457
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _130 => _130.models, 'optionalAccess', _131 => _131[modelId], 'optionalAccess', _132 => _132.fields]) || [],
|
|
2433
2458
|
records
|
|
2434
2459
|
};
|
|
2435
2460
|
}
|
|
@@ -2488,7 +2513,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
2488
2513
|
return records.map((record) => ({
|
|
2489
2514
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
2490
2515
|
value: record.id,
|
|
2491
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
2516
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _133 => _133.includes, 'call', _134 => _134(record.id)])
|
|
2492
2517
|
}));
|
|
2493
2518
|
}
|
|
2494
2519
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -2755,7 +2780,7 @@ var _nodewebvtt = require('node-webvtt'); var _nodewebvtt2 = _interopRequireDefa
|
|
|
2755
2780
|
function createVttLoader() {
|
|
2756
2781
|
return createLoader({
|
|
2757
2782
|
async pull(locale, input2) {
|
|
2758
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
2783
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _135 => _135.parse, 'call', _136 => _136(input2), 'optionalAccess', _137 => _137.cues]);
|
|
2759
2784
|
if (Object.keys(vtt).length === 0) {
|
|
2760
2785
|
return {};
|
|
2761
2786
|
} else {
|
|
@@ -2808,7 +2833,7 @@ function variableExtractLoader(params) {
|
|
|
2808
2833
|
for (let i = 0; i < matches.length; i++) {
|
|
2809
2834
|
const match = matches[i];
|
|
2810
2835
|
const currentValue = result[key].value;
|
|
2811
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
2836
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _138 => _138.replace, 'call', _139 => _139(match, `{variable:${i}}`)]);
|
|
2812
2837
|
result[key].value = newValue;
|
|
2813
2838
|
result[key].variables[i] = match;
|
|
2814
2839
|
}
|
|
@@ -2822,7 +2847,7 @@ function variableExtractLoader(params) {
|
|
|
2822
2847
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
2823
2848
|
const variable = valueObj.variables[i];
|
|
2824
2849
|
const currentValue = result[key];
|
|
2825
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
2850
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _140 => _140.replace, 'call', _141 => _141(`{variable:${i}}`, variable)]);
|
|
2826
2851
|
result[key] = newValue;
|
|
2827
2852
|
}
|
|
2828
2853
|
}
|
|
@@ -3003,7 +3028,7 @@ function createVueJsonLoader() {
|
|
|
3003
3028
|
return createLoader({
|
|
3004
3029
|
pull: async (locale, input2, ctx) => {
|
|
3005
3030
|
const parsed = parseVueFile(input2);
|
|
3006
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
3031
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _142 => _142.i18n, 'optionalAccess', _143 => _143[locale]]), () => ( {}));
|
|
3007
3032
|
},
|
|
3008
3033
|
push: async (locale, data, originalInput) => {
|
|
3009
3034
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -3415,7 +3440,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
3415
3440
|
]
|
|
3416
3441
|
});
|
|
3417
3442
|
const result = JSON.parse(response.text);
|
|
3418
|
-
return _optionalChain([result, 'optionalAccess',
|
|
3443
|
+
return _optionalChain([result, 'optionalAccess', _144 => _144.data]) || {};
|
|
3419
3444
|
};
|
|
3420
3445
|
}
|
|
3421
3446
|
|
|
@@ -3433,7 +3458,7 @@ function createProcessor(provider, params) {
|
|
|
3433
3458
|
}
|
|
3434
3459
|
}
|
|
3435
3460
|
function getPureModelProvider(provider) {
|
|
3436
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
3461
|
+
switch (_optionalChain([provider, 'optionalAccess', _145 => _145.id])) {
|
|
3437
3462
|
case "openai":
|
|
3438
3463
|
if (!process.env.OPENAI_API_KEY) {
|
|
3439
3464
|
throw new Error("OPENAI_API_KEY is not set.");
|
|
@@ -3450,7 +3475,7 @@ function getPureModelProvider(provider) {
|
|
|
3450
3475
|
apiKey: process.env.ANTHROPIC_API_KEY
|
|
3451
3476
|
})(provider.model);
|
|
3452
3477
|
default:
|
|
3453
|
-
throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess',
|
|
3478
|
+
throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess', _146 => _146.id])}`);
|
|
3454
3479
|
}
|
|
3455
3480
|
}
|
|
3456
3481
|
|
|
@@ -3652,13 +3677,15 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
3652
3677
|
flags
|
|
3653
3678
|
});
|
|
3654
3679
|
let buckets = getBuckets(i18nConfig);
|
|
3655
|
-
if (_optionalChain([flags, 'access',
|
|
3680
|
+
if (_optionalChain([flags, 'access', _147 => _147.bucket, 'optionalAccess', _148 => _148.length])) {
|
|
3656
3681
|
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
3657
3682
|
}
|
|
3658
3683
|
ora.succeed("Buckets retrieved");
|
|
3659
|
-
if (_optionalChain([flags, 'access',
|
|
3684
|
+
if (_optionalChain([flags, 'access', _149 => _149.file, 'optionalAccess', _150 => _150.length])) {
|
|
3660
3685
|
buckets = buckets.map((bucket) => {
|
|
3661
|
-
const paths = bucket.paths.filter(
|
|
3686
|
+
const paths = bucket.paths.filter(
|
|
3687
|
+
(path18) => flags.file.find((file) => _optionalChain([path18, 'access', _151 => _151.pathPattern, 'optionalAccess', _152 => _152.includes, 'call', _153 => _153(file)]))
|
|
3688
|
+
);
|
|
3662
3689
|
return { ...bucket, paths };
|
|
3663
3690
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
3664
3691
|
if (buckets.length === 0) {
|
|
@@ -3674,7 +3701,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
3674
3701
|
});
|
|
3675
3702
|
}
|
|
3676
3703
|
}
|
|
3677
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
3704
|
+
const targetLocales = _optionalChain([flags, 'access', _154 => _154.locale, 'optionalAccess', _155 => _155.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
3678
3705
|
ora.start("Setting up localization cache...");
|
|
3679
3706
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
3680
3707
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -4062,12 +4089,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
4062
4089
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
4063
4090
|
docUrl: "bucketNotFound"
|
|
4064
4091
|
});
|
|
4065
|
-
} else if (_optionalChain([flags, 'access',
|
|
4092
|
+
} else if (_optionalChain([flags, 'access', _156 => _156.locale, 'optionalAccess', _157 => _157.some, 'call', _158 => _158((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
4066
4093
|
throw new CLIError({
|
|
4067
4094
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
4068
4095
|
docUrl: "localeTargetNotFound"
|
|
4069
4096
|
});
|
|
4070
|
-
} else if (_optionalChain([flags, 'access',
|
|
4097
|
+
} else if (_optionalChain([flags, 'access', _159 => _159.bucket, 'optionalAccess', _160 => _160.some, 'call', _161 => _161((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
4071
4098
|
throw new CLIError({
|
|
4072
4099
|
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
4073
4100
|
docUrl: "bucketNotFound"
|
|
@@ -4500,7 +4527,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
4500
4527
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
4501
4528
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
4502
4529
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
4503
|
-
_optionalChain([this, 'access',
|
|
4530
|
+
_optionalChain([this, 'access', _162 => _162.platformKit, 'optionalAccess', _163 => _163.gitConfig, 'call', _164 => _164()]);
|
|
4504
4531
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
4505
4532
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
4506
4533
|
if (!processOwnCommits) {
|
|
@@ -4525,7 +4552,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
4525
4552
|
// ../../action/src/flows/pull-request.ts
|
|
4526
4553
|
var PullRequestFlow = class extends InBranchFlow {
|
|
4527
4554
|
async preRun() {
|
|
4528
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
4555
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _165 => _165()]);
|
|
4529
4556
|
if (!canContinue) {
|
|
4530
4557
|
return false;
|
|
4531
4558
|
}
|
|
@@ -4743,10 +4770,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
4743
4770
|
repo_slug: this.platformConfig.repositoryName,
|
|
4744
4771
|
state: "OPEN"
|
|
4745
4772
|
}).then(({ data: { values } }) => {
|
|
4746
|
-
return _optionalChain([values, 'optionalAccess',
|
|
4747
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
4773
|
+
return _optionalChain([values, 'optionalAccess', _166 => _166.find, 'call', _167 => _167(
|
|
4774
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _168 => _168.branch, 'optionalAccess', _169 => _169.name]) === branch && _optionalChain([destination, 'optionalAccess', _170 => _170.branch, 'optionalAccess', _171 => _171.name]) === this.platformConfig.baseBranchName
|
|
4748
4775
|
)]);
|
|
4749
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
4776
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _172 => _172.id]));
|
|
4750
4777
|
}
|
|
4751
4778
|
async closePullRequest({ pullRequestNumber }) {
|
|
4752
4779
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -4832,7 +4859,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
4832
4859
|
repo: this.platformConfig.repositoryName,
|
|
4833
4860
|
base: this.platformConfig.baseBranchName,
|
|
4834
4861
|
state: "open"
|
|
4835
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
4862
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _173 => _173.number]));
|
|
4836
4863
|
}
|
|
4837
4864
|
async closePullRequest({ pullRequestNumber }) {
|
|
4838
4865
|
await this.octokit.rest.pulls.update({
|
|
@@ -4945,7 +4972,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
4945
4972
|
sourceBranch: branch,
|
|
4946
4973
|
state: "opened"
|
|
4947
4974
|
});
|
|
4948
|
-
return _optionalChain([mergeRequests, 'access',
|
|
4975
|
+
return _optionalChain([mergeRequests, 'access', _174 => _174[0], 'optionalAccess', _175 => _175.iid]);
|
|
4949
4976
|
}
|
|
4950
4977
|
async closePullRequest({ pullRequestNumber }) {
|
|
4951
4978
|
await this.gitlab.MergeRequests.edit(this.platformConfig.gitlabProjectId, pullRequestNumber, {
|
|
@@ -4998,7 +5025,7 @@ async function main() {
|
|
|
4998
5025
|
const { isPullRequestMode } = platformKit.config;
|
|
4999
5026
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
5000
5027
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
5001
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
5028
|
+
const canRun = await _optionalChain([flow, 'access', _176 => _176.preRun, 'optionalCall', _177 => _177()]);
|
|
5002
5029
|
if (canRun === false) {
|
|
5003
5030
|
return;
|
|
5004
5031
|
}
|
|
@@ -5006,7 +5033,7 @@ async function main() {
|
|
|
5006
5033
|
if (!hasChanges) {
|
|
5007
5034
|
return;
|
|
5008
5035
|
}
|
|
5009
|
-
await _optionalChain([flow, 'access',
|
|
5036
|
+
await _optionalChain([flow, 'access', _178 => _178.postRun, 'optionalCall', _179 => _179()]);
|
|
5010
5037
|
}
|
|
5011
5038
|
|
|
5012
5039
|
// src/cli/cmd/ci.ts
|
|
@@ -5028,7 +5055,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5028
5055
|
}
|
|
5029
5056
|
const env = {
|
|
5030
5057
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
5031
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
5058
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _180 => _180.pullRequest, 'optionalAccess', _181 => _181.toString, 'call', _182 => _182()]) || "false",
|
|
5032
5059
|
...options.commitMessage && { LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage },
|
|
5033
5060
|
...options.pullRequestTitle && { LINGODOTDEV_PULL_REQUEST_TITLE: options.pullRequestTitle },
|
|
5034
5061
|
...options.workingDirectory && { LINGODOTDEV_WORKING_DIRECTORY: options.workingDirectory },
|
|
@@ -5079,13 +5106,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5079
5106
|
flags
|
|
5080
5107
|
});
|
|
5081
5108
|
let buckets = getBuckets(i18nConfig);
|
|
5082
|
-
if (_optionalChain([flags, 'access',
|
|
5109
|
+
if (_optionalChain([flags, 'access', _183 => _183.bucket, 'optionalAccess', _184 => _184.length])) {
|
|
5083
5110
|
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
5084
5111
|
}
|
|
5085
5112
|
ora.succeed("Buckets retrieved");
|
|
5086
|
-
if (_optionalChain([flags, 'access',
|
|
5113
|
+
if (_optionalChain([flags, 'access', _185 => _185.file, 'optionalAccess', _186 => _186.length])) {
|
|
5087
5114
|
buckets = buckets.map((bucket) => {
|
|
5088
|
-
const paths = bucket.paths.filter((path18) => flags.file.find((file) => _optionalChain([path18, 'access',
|
|
5115
|
+
const paths = bucket.paths.filter((path18) => flags.file.find((file) => _optionalChain([path18, 'access', _187 => _187.pathPattern, 'optionalAccess', _188 => _188.match, 'call', _189 => _189(file)])));
|
|
5089
5116
|
return { ...bucket, paths };
|
|
5090
5117
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
5091
5118
|
if (buckets.length === 0) {
|
|
@@ -5101,7 +5128,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5101
5128
|
});
|
|
5102
5129
|
}
|
|
5103
5130
|
}
|
|
5104
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
5131
|
+
const targetLocales = _optionalChain([flags, 'access', _190 => _190.locale, 'optionalAccess', _191 => _191.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
5105
5132
|
let totalSourceKeyCount = 0;
|
|
5106
5133
|
let uniqueKeysToTranslate = 0;
|
|
5107
5134
|
let totalExistingTranslations = 0;
|
|
@@ -5442,12 +5469,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
5442
5469
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
5443
5470
|
docUrl: "bucketNotFound"
|
|
5444
5471
|
});
|
|
5445
|
-
} else if (_optionalChain([flags, 'access',
|
|
5472
|
+
} else if (_optionalChain([flags, 'access', _192 => _192.locale, 'optionalAccess', _193 => _193.some, 'call', _194 => _194((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
5446
5473
|
throw new CLIError({
|
|
5447
5474
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
5448
5475
|
docUrl: "localeTargetNotFound"
|
|
5449
5476
|
});
|
|
5450
|
-
} else if (_optionalChain([flags, 'access',
|
|
5477
|
+
} else if (_optionalChain([flags, 'access', _195 => _195.bucket, 'optionalAccess', _196 => _196.some, 'call', _197 => _197((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
5451
5478
|
throw new CLIError({
|
|
5452
5479
|
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
5453
5480
|
docUrl: "bucketNotFound"
|
|
@@ -5458,7 +5485,7 @@ function validateParams2(i18nConfig, flags) {
|
|
|
5458
5485
|
// package.json
|
|
5459
5486
|
var package_default = {
|
|
5460
5487
|
name: "lingo.dev",
|
|
5461
|
-
version: "0.85.
|
|
5488
|
+
version: "0.85.7",
|
|
5462
5489
|
description: "Lingo.dev CLI",
|
|
5463
5490
|
private: false,
|
|
5464
5491
|
publishConfig: {
|