lingo.dev 0.117.19 → 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
  }
@@ -11128,9 +11132,6 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11128
11132
  "Stop immediately on first error instead of continuing to process remaining buckets and locales (fail-fast mode)"
11129
11133
  ).action(async function(options) {
11130
11134
  updateGitignore();
11131
- await trackEvent(null, "cmd.i18n.start", {
11132
- rawOptions: options
11133
- });
11134
11135
  const ora = _ora2.default.call(void 0, );
11135
11136
  let flags;
11136
11137
  try {
@@ -11178,6 +11179,10 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11178
11179
  authId = auth.id;
11179
11180
  ora.succeed(`Authenticated as ${auth.email}`);
11180
11181
  }
11182
+ await trackEvent(authId, "cmd.i18n.start", {
11183
+ i18nConfig,
11184
+ flags
11185
+ });
11181
11186
  let buckets = getBuckets(i18nConfig);
11182
11187
  if (_optionalChain([flags, 'access', _343 => _343.bucket, 'optionalAccess', _344 => _344.length])) {
11183
11188
  buckets = buckets.filter(
@@ -14717,7 +14722,7 @@ async function renderHero2() {
14717
14722
  // package.json
14718
14723
  var package_default = {
14719
14724
  name: "lingo.dev",
14720
- version: "0.117.19",
14725
+ version: "0.117.21",
14721
14726
  description: "Lingo.dev CLI",
14722
14727
  private: false,
14723
14728
  repository: {