lingo.dev 0.117.20 → 0.117.21

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
@@ -1600,8 +1600,10 @@ function createLoader(lDefinition) {
1600
1600
  const state = {
1601
1601
  defaultLocale: void 0,
1602
1602
  originalInput: void 0,
1603
- pullInput: void 0,
1604
- pullOutput: void 0,
1603
+ // Store pullInput and pullOutput per-locale to avoid race conditions
1604
+ // when multiple locales are processed concurrently
1605
+ pullInputByLocale: /* @__PURE__ */ new Map(),
1606
+ pullOutputByLocale: /* @__PURE__ */ new Map(),
1605
1607
  initCtx: void 0
1606
1608
  };
1607
1609
  return {
@@ -1632,7 +1634,7 @@ function createLoader(lDefinition) {
1632
1634
  if (locale === state.defaultLocale) {
1633
1635
  state.originalInput = input2 || null;
1634
1636
  }
1635
- state.pullInput = input2;
1637
+ state.pullInputByLocale.set(locale, input2 || null);
1636
1638
  const result = await lDefinition.pull(
1637
1639
  locale,
1638
1640
  input2,
@@ -1640,7 +1642,7 @@ function createLoader(lDefinition) {
1640
1642
  state.defaultLocale,
1641
1643
  state.originalInput
1642
1644
  );
1643
- state.pullOutput = result;
1645
+ state.pullOutputByLocale.set(locale, result);
1644
1646
  return result;
1645
1647
  },
1646
1648
  async push(locale, data) {
@@ -1650,13 +1652,15 @@ function createLoader(lDefinition) {
1650
1652
  if (state.originalInput === void 0) {
1651
1653
  throw new Error("Cannot push data without pulling first");
1652
1654
  }
1655
+ const pullInput = _nullishCoalesce(_nullishCoalesce(state.pullInputByLocale.get(locale), () => ( state.pullInputByLocale.get(state.defaultLocale))), () => ( null));
1656
+ const pullOutput = _nullishCoalesce(_nullishCoalesce(state.pullOutputByLocale.get(locale), () => ( state.pullOutputByLocale.get(state.defaultLocale))), () => ( null));
1653
1657
  const pushResult = await lDefinition.push(
1654
1658
  locale,
1655
1659
  data,
1656
1660
  state.originalInput,
1657
1661
  state.defaultLocale,
1658
- state.pullInput,
1659
- state.pullOutput
1662
+ pullInput,
1663
+ pullOutput
1660
1664
  );
1661
1665
  return pushResult;
1662
1666
  }
@@ -14718,7 +14722,7 @@ async function renderHero2() {
14718
14722
  // package.json
14719
14723
  var package_default = {
14720
14724
  name: "lingo.dev",
14721
- version: "0.117.20",
14725
+ version: "0.117.21",
14722
14726
  description: "Lingo.dev CLI",
14723
14727
  private: false,
14724
14728
  repository: {