lingo.dev 0.102.4 → 0.103.0

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
@@ -4564,6 +4564,28 @@ function reorderKeys(data, originalInput) {
4564
4564
  return orderedData;
4565
4565
  }
4566
4566
 
4567
+ // src/cli/loaders/txt.ts
4568
+ function createTxtLoader() {
4569
+ return createLoader({
4570
+ async pull(locale, input2) {
4571
+ const result = {};
4572
+ if (input2 !== void 0 && input2 !== null && input2 !== "") {
4573
+ const lines = input2.split("\n");
4574
+ lines.forEach((line, index) => {
4575
+ result[String(index + 1)] = line;
4576
+ });
4577
+ }
4578
+ return result;
4579
+ },
4580
+ async push(locale, payload) {
4581
+ const sortedEntries = Object.entries(payload).sort(
4582
+ ([a], [b]) => parseInt(a) - parseInt(b)
4583
+ );
4584
+ return sortedEntries.map(([_34, value]) => value).join("\n");
4585
+ }
4586
+ });
4587
+ }
4588
+
4567
4589
  // src/cli/loaders/index.ts
4568
4590
  function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys, lockedPatterns, ignoredKeys) {
4569
4591
  switch (bucketType) {
@@ -4788,6 +4810,13 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
4788
4810
  createIgnoredKeysLoader(ignoredKeys || []),
4789
4811
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
4790
4812
  );
4813
+ case "txt":
4814
+ return composeLoaders(
4815
+ createTextFileLoader(bucketPathPattern),
4816
+ createTxtLoader(),
4817
+ createSyncLoader(),
4818
+ createUnlocalizableLoader(options.returnUnlocalizedKeys)
4819
+ );
4791
4820
  }
4792
4821
  }
4793
4822
 
@@ -9917,7 +9946,7 @@ async function renderHero2() {
9917
9946
  // package.json
9918
9947
  var package_default = {
9919
9948
  name: "lingo.dev",
9920
- version: "0.102.4",
9949
+ version: "0.103.0",
9921
9950
  description: "Lingo.dev CLI",
9922
9951
  private: false,
9923
9952
  publishConfig: {