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 +11 -7
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +11 -7
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.mjs
CHANGED
|
@@ -1596,8 +1596,10 @@ function createLoader(lDefinition) {
|
|
|
1596
1596
|
const state = {
|
|
1597
1597
|
defaultLocale: void 0,
|
|
1598
1598
|
originalInput: void 0,
|
|
1599
|
-
pullInput
|
|
1600
|
-
|
|
1599
|
+
// Store pullInput and pullOutput per-locale to avoid race conditions
|
|
1600
|
+
// when multiple locales are processed concurrently
|
|
1601
|
+
pullInputByLocale: /* @__PURE__ */ new Map(),
|
|
1602
|
+
pullOutputByLocale: /* @__PURE__ */ new Map(),
|
|
1601
1603
|
initCtx: void 0
|
|
1602
1604
|
};
|
|
1603
1605
|
return {
|
|
@@ -1628,7 +1630,7 @@ function createLoader(lDefinition) {
|
|
|
1628
1630
|
if (locale === state.defaultLocale) {
|
|
1629
1631
|
state.originalInput = input2 || null;
|
|
1630
1632
|
}
|
|
1631
|
-
state.
|
|
1633
|
+
state.pullInputByLocale.set(locale, input2 || null);
|
|
1632
1634
|
const result = await lDefinition.pull(
|
|
1633
1635
|
locale,
|
|
1634
1636
|
input2,
|
|
@@ -1636,7 +1638,7 @@ function createLoader(lDefinition) {
|
|
|
1636
1638
|
state.defaultLocale,
|
|
1637
1639
|
state.originalInput
|
|
1638
1640
|
);
|
|
1639
|
-
state.
|
|
1641
|
+
state.pullOutputByLocale.set(locale, result);
|
|
1640
1642
|
return result;
|
|
1641
1643
|
},
|
|
1642
1644
|
async push(locale, data) {
|
|
@@ -1646,13 +1648,15 @@ function createLoader(lDefinition) {
|
|
|
1646
1648
|
if (state.originalInput === void 0) {
|
|
1647
1649
|
throw new Error("Cannot push data without pulling first");
|
|
1648
1650
|
}
|
|
1651
|
+
const pullInput = state.pullInputByLocale.get(locale) ?? state.pullInputByLocale.get(state.defaultLocale) ?? null;
|
|
1652
|
+
const pullOutput = state.pullOutputByLocale.get(locale) ?? state.pullOutputByLocale.get(state.defaultLocale) ?? null;
|
|
1649
1653
|
const pushResult = await lDefinition.push(
|
|
1650
1654
|
locale,
|
|
1651
1655
|
data,
|
|
1652
1656
|
state.originalInput,
|
|
1653
1657
|
state.defaultLocale,
|
|
1654
|
-
|
|
1655
|
-
|
|
1658
|
+
pullInput,
|
|
1659
|
+
pullOutput
|
|
1656
1660
|
);
|
|
1657
1661
|
return pushResult;
|
|
1658
1662
|
}
|
|
@@ -14714,7 +14718,7 @@ async function renderHero2() {
|
|
|
14714
14718
|
// package.json
|
|
14715
14719
|
var package_default = {
|
|
14716
14720
|
name: "lingo.dev",
|
|
14717
|
-
version: "0.117.
|
|
14721
|
+
version: "0.117.21",
|
|
14718
14722
|
description: "Lingo.dev CLI",
|
|
14719
14723
|
private: false,
|
|
14720
14724
|
repository: {
|