lingo.dev 0.92.5 → 0.92.6

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.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
@@ -6291,7 +6311,7 @@ async function renderHero() {
6291
6311
  // package.json
6292
6312
  var package_default = {
6293
6313
  name: "lingo.dev",
6294
- version: "0.92.5",
6314
+ version: "0.92.6",
6295
6315
  description: "Lingo.dev CLI",
6296
6316
  private: false,
6297
6317
  publishConfig: {