lingo.dev 0.107.3 → 0.107.4

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 CHANGED
@@ -6547,16 +6547,31 @@ function createTxtLoader() {
6547
6547
 
6548
6548
  // src/cli/loaders/json-dictionary.ts
6549
6549
 
6550
+ var TOP_LEVEL_KEY = "--content--";
6550
6551
  function createJsonDictionaryLoader() {
6551
6552
  return createLoader({
6552
6553
  pull: async (locale, input2) => {
6553
- return extractTranslatables(input2, locale);
6554
+ const result = extractTranslatables(input2, locale);
6555
+ if (typeof result === "string") {
6556
+ return { [TOP_LEVEL_KEY]: result };
6557
+ }
6558
+ return result;
6554
6559
  },
6555
6560
  push: async (locale, data, originalInput, originalLocale) => {
6556
6561
  if (!originalInput) {
6557
6562
  throw new Error("Error while parsing json-dictionary bucket");
6558
6563
  }
6559
6564
  const input2 = _lodash2.default.cloneDeep(originalInput);
6565
+ if (Object.keys(data).length === 1 && Object.keys(data)[0] === TOP_LEVEL_KEY) {
6566
+ setNestedLocale(
6567
+ { [TOP_LEVEL_KEY]: input2 },
6568
+ [TOP_LEVEL_KEY],
6569
+ locale,
6570
+ data[TOP_LEVEL_KEY],
6571
+ originalLocale
6572
+ );
6573
+ return input2;
6574
+ }
6560
6575
  function walk(obj, dataNode, path17 = []) {
6561
6576
  if (Array.isArray(obj) && Array.isArray(dataNode)) {
6562
6577
  obj.forEach(
@@ -6572,7 +6587,7 @@ function createJsonDictionaryLoader() {
6572
6587
  setNestedLocale(input2, path17, locale, dataNode, originalLocale);
6573
6588
  }
6574
6589
  }
6575
- walk(originalInput, data);
6590
+ walk(input2, data);
6576
6591
  return input2;
6577
6592
  }
6578
6593
  });
@@ -10462,7 +10477,7 @@ async function renderHero2() {
10462
10477
  // package.json
10463
10478
  var package_default = {
10464
10479
  name: "lingo.dev",
10465
- version: "0.107.3",
10480
+ version: "0.107.4",
10466
10481
  description: "Lingo.dev CLI",
10467
10482
  private: false,
10468
10483
  publishConfig: {