lingo.dev 0.92.5 → 0.92.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 +26 -15
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +26 -15
- package/build/cli.mjs.map +1 -1
- package/package.json +1 -1
package/build/cli.mjs
CHANGED
|
@@ -3227,6 +3227,8 @@ function objectExpressionToObject(objectExpression) {
|
|
|
3227
3227
|
const key = getPropertyKey(prop);
|
|
3228
3228
|
if (t.isStringLiteral(prop.value)) {
|
|
3229
3229
|
obj[key] = prop.value.value;
|
|
3230
|
+
} else if (t.isTemplateLiteral(prop.value) && prop.value.expressions.length === 0) {
|
|
3231
|
+
obj[key] = prop.value.quasis[0].value.cooked ?? "";
|
|
3230
3232
|
} else if (t.isObjectExpression(prop.value)) {
|
|
3231
3233
|
const nested = objectExpressionToObject(prop.value);
|
|
3232
3234
|
if (Object.keys(nested).length > 0) {
|
|
@@ -3247,6 +3249,8 @@ function arrayExpressionToArray(arrayExpression) {
|
|
|
3247
3249
|
if (!element) return;
|
|
3248
3250
|
if (t.isStringLiteral(element)) {
|
|
3249
3251
|
arr.push(element.value);
|
|
3252
|
+
} else if (t.isTemplateLiteral(element) && element.expressions.length === 0) {
|
|
3253
|
+
arr.push(element.quasis[0].value.cooked ?? "");
|
|
3250
3254
|
} else if (t.isObjectExpression(element)) {
|
|
3251
3255
|
const nestedObj = objectExpressionToObject(element);
|
|
3252
3256
|
arr.push(nestedObj);
|
|
@@ -3289,6 +3293,13 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
3289
3293
|
prop.value.value = incomingVal;
|
|
3290
3294
|
modified = true;
|
|
3291
3295
|
}
|
|
3296
|
+
} else if (t.isTemplateLiteral(prop.value) && prop.value.expressions.length === 0 && typeof incomingVal === "string") {
|
|
3297
|
+
const currentVal = prop.value.quasis[0].value.cooked ?? "";
|
|
3298
|
+
if (currentVal !== incomingVal) {
|
|
3299
|
+
prop.value.quasis[0].value.raw = incomingVal;
|
|
3300
|
+
prop.value.quasis[0].value.cooked = incomingVal;
|
|
3301
|
+
modified = true;
|
|
3302
|
+
}
|
|
3292
3303
|
} else if (t.isObjectExpression(prop.value) && typeof incomingVal === "object" && !Array.isArray(incomingVal)) {
|
|
3293
3304
|
const subModified = updateStringsInObjectExpression(
|
|
3294
3305
|
prop.value,
|
|
@@ -3316,6 +3327,13 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
3316
3327
|
element.value = incomingVal;
|
|
3317
3328
|
modified = true;
|
|
3318
3329
|
}
|
|
3330
|
+
} else if (t.isTemplateLiteral(element) && element.expressions.length === 0 && typeof incomingVal === "string") {
|
|
3331
|
+
const currentVal = element.quasis[0].value.cooked ?? "";
|
|
3332
|
+
if (currentVal !== incomingVal) {
|
|
3333
|
+
element.quasis[0].value.raw = incomingVal;
|
|
3334
|
+
element.quasis[0].value.cooked = incomingVal;
|
|
3335
|
+
modified = true;
|
|
3336
|
+
}
|
|
3319
3337
|
} else if (t.isObjectExpression(element) && typeof incomingVal === "object" && !Array.isArray(incomingVal)) {
|
|
3320
3338
|
const subModified = updateStringsInObjectExpression(element, incomingVal);
|
|
3321
3339
|
modified = subModified || modified;
|
|
@@ -3346,6 +3364,8 @@ function getPropertyKey(prop) {
|
|
|
3346
3364
|
return prop.key.name;
|
|
3347
3365
|
} else if (t.isStringLiteral(prop.key)) {
|
|
3348
3366
|
return prop.key.value;
|
|
3367
|
+
} else if (t.isNumericLiteral(prop.key)) {
|
|
3368
|
+
return String(prop.key.value);
|
|
3349
3369
|
}
|
|
3350
3370
|
return String(prop.key);
|
|
3351
3371
|
}
|
|
@@ -3891,8 +3911,8 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
|
|
|
3891
3911
|
createTextFileLoader(bucketPathPattern),
|
|
3892
3912
|
createPrettierLoader({ parser: "typescript", bucketPathPattern }),
|
|
3893
3913
|
createTypescriptLoader(),
|
|
3894
|
-
createSyncLoader(),
|
|
3895
3914
|
createFlatLoader(),
|
|
3915
|
+
createSyncLoader(),
|
|
3896
3916
|
createUnlocalizableLoader(
|
|
3897
3917
|
options.isCacheRestore,
|
|
3898
3918
|
options.returnUnlocalizedKeys
|
|
@@ -4050,18 +4070,6 @@ async function trackEvent(distinctId, event, properties) {
|
|
|
4050
4070
|
try {
|
|
4051
4071
|
const actualId = distinctId || `device-${machineIdSync()}`;
|
|
4052
4072
|
const { PostHog } = await import("posthog-node");
|
|
4053
|
-
const safeProperties = properties ? JSON.parse(
|
|
4054
|
-
JSON.stringify(properties, (key, value) => {
|
|
4055
|
-
if (value instanceof Error) {
|
|
4056
|
-
return {
|
|
4057
|
-
name: value.name,
|
|
4058
|
-
message: value.message,
|
|
4059
|
-
stack: value.stack
|
|
4060
|
-
};
|
|
4061
|
-
}
|
|
4062
|
-
return value;
|
|
4063
|
-
})
|
|
4064
|
-
) : {};
|
|
4065
4073
|
const posthog = new PostHog(
|
|
4066
4074
|
"phc_eR0iSoQufBxNY36k0f0T15UvHJdTfHlh8rJcxsfhfXk",
|
|
4067
4075
|
{
|
|
@@ -4074,7 +4082,7 @@ async function trackEvent(distinctId, event, properties) {
|
|
|
4074
4082
|
distinctId: actualId,
|
|
4075
4083
|
event,
|
|
4076
4084
|
properties: {
|
|
4077
|
-
...
|
|
4085
|
+
...properties,
|
|
4078
4086
|
meta: {
|
|
4079
4087
|
version: process.env.npm_package_version,
|
|
4080
4088
|
isCi: process.env.CI === "true"
|
|
@@ -4648,6 +4656,9 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4648
4656
|
});
|
|
4649
4657
|
} else {
|
|
4650
4658
|
ora.warn("Localization completed with errors.");
|
|
4659
|
+
trackEvent(authId || "unknown", "cmd.i18n.error", {
|
|
4660
|
+
flags
|
|
4661
|
+
});
|
|
4651
4662
|
}
|
|
4652
4663
|
} catch (error) {
|
|
4653
4664
|
ora.fail(error.message);
|
|
@@ -6291,7 +6302,7 @@ async function renderHero() {
|
|
|
6291
6302
|
// package.json
|
|
6292
6303
|
var package_default = {
|
|
6293
6304
|
name: "lingo.dev",
|
|
6294
|
-
version: "0.92.
|
|
6305
|
+
version: "0.92.7",
|
|
6295
6306
|
description: "Lingo.dev CLI",
|
|
6296
6307
|
private: false,
|
|
6297
6308
|
publishConfig: {
|