lingo.dev 0.78.2 → 0.78.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.cjs +20 -13
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +16 -9
- package/build/cli.mjs.map +1 -1
- package/package.json +1 -1
package/build/cli.cjs
CHANGED
|
@@ -2874,20 +2874,27 @@ function escapePhpString(str) {
|
|
|
2874
2874
|
function createVueJsonLoader() {
|
|
2875
2875
|
return createLoader({
|
|
2876
2876
|
pull: async (locale, input2, ctx) => {
|
|
2877
|
-
const
|
|
2878
|
-
return _nullishCoalesce(i18n[locale], () => ( {}));
|
|
2877
|
+
const parsed = parseVueFile(input2);
|
|
2878
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _128 => _128.i18n, 'optionalAccess', _129 => _129[locale]]), () => ( {}));
|
|
2879
2879
|
},
|
|
2880
2880
|
push: async (locale, data, originalInput) => {
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2881
|
+
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
2882
|
+
if (!parsed) {
|
|
2883
|
+
return _nullishCoalesce(originalInput, () => ( ""));
|
|
2884
|
+
}
|
|
2885
|
+
parsed.i18n[locale] = data;
|
|
2886
|
+
return `${parsed.before}<i18n>
|
|
2887
|
+
${JSON.stringify(parsed.i18n, null, 2)}
|
|
2888
|
+
</i18n>${parsed.after}`;
|
|
2886
2889
|
}
|
|
2887
2890
|
});
|
|
2888
2891
|
}
|
|
2889
2892
|
function parseVueFile(input2) {
|
|
2890
|
-
const
|
|
2893
|
+
const match = input2.match(/^([\s\S]*)<i18n>([\s\S]*)<\/i18n>([\s\S]*)$/);
|
|
2894
|
+
if (!match) {
|
|
2895
|
+
return null;
|
|
2896
|
+
}
|
|
2897
|
+
const [, before, jsonString = "{}", after] = match;
|
|
2891
2898
|
let i18n;
|
|
2892
2899
|
try {
|
|
2893
2900
|
i18n = JSON.parse(jsonString);
|
|
@@ -3239,11 +3246,11 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
3239
3246
|
const auth = await validateAuth(settings);
|
|
3240
3247
|
ora.succeed(`Authenticated as ${auth.email}`);
|
|
3241
3248
|
let buckets = getBuckets(i18nConfig);
|
|
3242
|
-
if (_optionalChain([flags, 'access',
|
|
3249
|
+
if (_optionalChain([flags, 'access', _130 => _130.bucket, 'optionalAccess', _131 => _131.length])) {
|
|
3243
3250
|
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
3244
3251
|
}
|
|
3245
3252
|
ora.succeed("Buckets retrieved");
|
|
3246
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
3253
|
+
const targetLocales = _optionalChain([flags, 'access', _132 => _132.locale, 'optionalAccess', _133 => _133.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
3247
3254
|
const lockfileHelper = createLockfileHelper();
|
|
3248
3255
|
ora.start("Ensuring i18n.lock exists...");
|
|
3249
3256
|
if (!lockfileHelper.isLockfileExists()) {
|
|
@@ -3545,12 +3552,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
3545
3552
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
3546
3553
|
docUrl: "bucketNotFound"
|
|
3547
3554
|
});
|
|
3548
|
-
} else if (_optionalChain([flags, 'access',
|
|
3555
|
+
} else if (_optionalChain([flags, 'access', _134 => _134.locale, 'optionalAccess', _135 => _135.some, 'call', _136 => _136((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
3549
3556
|
throw new CLIError({
|
|
3550
3557
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
3551
3558
|
docUrl: "localeTargetNotFound"
|
|
3552
3559
|
});
|
|
3553
|
-
} else if (_optionalChain([flags, 'access',
|
|
3560
|
+
} else if (_optionalChain([flags, 'access', _137 => _137.bucket, 'optionalAccess', _138 => _138.some, 'call', _139 => _139((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
3554
3561
|
throw new CLIError({
|
|
3555
3562
|
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
3556
3563
|
docUrl: "bucketNotFound"
|
|
@@ -3830,7 +3837,7 @@ var mcp_default = new (0, _interactivecommander.Command)().command("mcp").descri
|
|
|
3830
3837
|
// package.json
|
|
3831
3838
|
var package_default = {
|
|
3832
3839
|
name: "lingo.dev",
|
|
3833
|
-
version: "0.78.
|
|
3840
|
+
version: "0.78.3",
|
|
3834
3841
|
description: "Lingo.dev CLI",
|
|
3835
3842
|
private: false,
|
|
3836
3843
|
publishConfig: {
|