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.mjs
CHANGED
|
@@ -2874,20 +2874,27 @@ import { jsonrepair as jsonrepair2 } from "jsonrepair";
|
|
|
2874
2874
|
function createVueJsonLoader() {
|
|
2875
2875
|
return createLoader({
|
|
2876
2876
|
pull: async (locale, input2, ctx) => {
|
|
2877
|
-
const
|
|
2878
|
-
return i18n[locale] ?? {};
|
|
2877
|
+
const parsed = parseVueFile(input2);
|
|
2878
|
+
return parsed?.i18n?.[locale] ?? {};
|
|
2879
2879
|
},
|
|
2880
2880
|
push: async (locale, data, originalInput) => {
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2881
|
+
const parsed = parseVueFile(originalInput ?? "");
|
|
2882
|
+
if (!parsed) {
|
|
2883
|
+
return 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);
|
|
@@ -3830,7 +3837,7 @@ var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model
|
|
|
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: {
|