lingo.dev 0.92.16 → 0.92.17

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.mjs CHANGED
@@ -29,33 +29,62 @@ function getSettings(explicitApiKey) {
29
29
  apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || systemFile.auth?.apiKey || defaults.auth.apiKey,
30
30
  apiUrl: env.LINGODOTDEV_API_URL || systemFile.auth?.apiUrl || defaults.auth.apiUrl,
31
31
  webUrl: env.LINGODOTDEV_WEB_URL || systemFile.auth?.webUrl || defaults.auth.webUrl
32
+ },
33
+ llm: {
34
+ openaiApiKey: env.OPENAI_API_KEY || systemFile.llm?.openaiApiKey,
35
+ anthropicApiKey: env.ANTHROPIC_API_KEY || systemFile.llm?.anthropicApiKey,
36
+ groqApiKey: env.GROQ_API_KEY || systemFile.llm?.groqApiKey
32
37
  }
33
38
  };
34
39
  }
35
40
  function saveSettings(settings) {
36
41
  _saveSystemFile(settings);
37
42
  }
43
+ function loadSystemSettings() {
44
+ return _loadSystemFile();
45
+ }
46
+ var flattenZodObject = (schema, prefix = "") => {
47
+ return Object.entries(schema.shape).flatMap(([key, value]) => {
48
+ const newPrefix = prefix ? `${prefix}.${key}` : key;
49
+ if (value instanceof Z.ZodObject) {
50
+ return flattenZodObject(value, newPrefix);
51
+ }
52
+ return [newPrefix];
53
+ });
54
+ };
38
55
  var SettingsSchema = Z.object({
39
56
  auth: Z.object({
40
57
  apiKey: Z.string(),
41
58
  apiUrl: Z.string(),
42
59
  webUrl: Z.string()
60
+ }),
61
+ llm: Z.object({
62
+ openaiApiKey: Z.string().optional(),
63
+ anthropicApiKey: Z.string().optional(),
64
+ groqApiKey: Z.string().optional()
43
65
  })
44
66
  });
67
+ var SETTINGS_KEYS = flattenZodObject(
68
+ SettingsSchema
69
+ );
45
70
  function _loadDefaults() {
46
71
  return {
47
72
  auth: {
48
73
  apiKey: "",
49
74
  apiUrl: "https://engine.lingo.dev",
50
75
  webUrl: "https://lingo.dev"
51
- }
76
+ },
77
+ llm: {}
52
78
  };
53
79
  }
54
80
  function _loadEnv() {
55
81
  return Z.object({
56
82
  LINGODOTDEV_API_KEY: Z.string().optional(),
57
83
  LINGODOTDEV_API_URL: Z.string().optional(),
58
- LINGODOTDEV_WEB_URL: Z.string().optional()
84
+ LINGODOTDEV_WEB_URL: Z.string().optional(),
85
+ OPENAI_API_KEY: Z.string().optional(),
86
+ ANTHROPIC_API_KEY: Z.string().optional(),
87
+ GROQ_API_KEY: Z.string().optional()
59
88
  }).passthrough().parse(process.env);
60
89
  }
61
90
  function _loadSystemFile() {
@@ -67,6 +96,11 @@ function _loadSystemFile() {
67
96
  apiKey: Z.string().optional(),
68
97
  apiUrl: Z.string().optional(),
69
98
  webUrl: Z.string().optional()
99
+ }).optional(),
100
+ llm: Z.object({
101
+ openaiApiKey: Z.string().optional(),
102
+ anthropicApiKey: Z.string().optional(),
103
+ groqApiKey: Z.string().optional()
70
104
  }).optional()
71
105
  }).passthrough().parse(data);
72
106
  }
@@ -102,14 +136,38 @@ function _envVarsInfo() {
102
136
  if (env.LINGODOTDEV_API_KEY && systemFile.auth?.apiKey) {
103
137
  console.info(
104
138
  "\x1B[36m%s\x1B[0m",
105
- `\u2139\uFE0F Using LINGODOTDEV_API_KEY env var instead of credentials from login flow (saved in .lingodotdevrc)`
139
+ `\u2139\uFE0F Using LINGODOTDEV_API_KEY env var instead of credentials from user config`
140
+ );
141
+ }
142
+ if (env.OPENAI_API_KEY && systemFile.llm?.openaiApiKey) {
143
+ console.info(
144
+ "\x1B[36m%s\x1B[0m",
145
+ `\u2139\uFE0F Using OPENAI_API_KEY env var instead of key from user config.`
146
+ );
147
+ }
148
+ if (env.ANTHROPIC_API_KEY && systemFile.llm?.anthropicApiKey) {
149
+ console.info(
150
+ "\x1B[36m%s\x1B[0m",
151
+ `\u2139\uFE0F Using ANTHROPIC_API_KEY env var instead of key from user config`
152
+ );
153
+ }
154
+ if (env.GROQ_API_KEY && systemFile.llm?.groqApiKey) {
155
+ console.info(
156
+ "\x1B[36m%s\x1B[0m",
157
+ `\u2139\uFE0F Using GROQ_API_KEY env var instead of key from user config`
106
158
  );
107
159
  }
108
160
  if (env.LINGODOTDEV_API_URL) {
109
- console.info("\x1B[36m%s\x1B[0m", `\u2139\uFE0F Using LINGODOTDEV_API_URL: ${env.LINGODOTDEV_API_URL}`);
161
+ console.info(
162
+ "\x1B[36m%s\x1B[0m",
163
+ `\u2139\uFE0F Using LINGODOTDEV_API_URL: ${env.LINGODOTDEV_API_URL}`
164
+ );
110
165
  }
111
166
  if (env.LINGODOTDEV_WEB_URL) {
112
- console.info("\x1B[36m%s\x1B[0m", `\u2139\uFE0F Using LINGODOTDEV_WEB_URL: ${env.LINGODOTDEV_WEB_URL}`);
167
+ console.info(
168
+ "\x1B[36m%s\x1B[0m",
169
+ `\u2139\uFE0F Using LINGODOTDEV_WEB_URL: ${env.LINGODOTDEV_WEB_URL}`
170
+ );
113
171
  }
114
172
  }
115
173
 
@@ -1017,15 +1075,132 @@ var files_default = new Command4().command("files").description("Print out the l
1017
1075
  // src/cli/cmd/show/index.ts
1018
1076
  var show_default = new Command5().command("show").description("Prints out the current configuration").helpOption("-h, --help", "Show help").addCommand(config_default).addCommand(locale_default).addCommand(files_default);
1019
1077
 
1078
+ // src/cli/cmd/config/index.ts
1079
+ import { Command as Command9 } from "interactive-commander";
1080
+
1081
+ // src/cli/cmd/config/set.ts
1082
+ import { Command as Command6 } from "interactive-commander";
1083
+ import chalk from "chalk";
1084
+ import dedent from "dedent";
1085
+ import _6 from "lodash";
1086
+ var set_default = new Command6().name("set").description("Set a configuration key to a value").addHelpText("afterAll", `
1087
+ Available keys:
1088
+ ${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key to set").argument("<value>", "New value").helpOption("-h, --help", "Show help").action(async (key, value) => {
1089
+ if (!SETTINGS_KEYS.includes(key)) {
1090
+ console.error(
1091
+ dedent`
1092
+ ${chalk.red("\u2716")} Unknown configuration key: ${chalk.bold(key)}
1093
+ Run ${chalk.dim("lingo.dev config set --help")} to see available keys.
1094
+ `
1095
+ );
1096
+ process.exitCode = 1;
1097
+ return;
1098
+ }
1099
+ const current = loadSystemSettings();
1100
+ const updated = _6.cloneDeep(current);
1101
+ _6.set(updated, key, value);
1102
+ try {
1103
+ saveSettings(updated);
1104
+ console.log(`${chalk.green("\u2714")} Set ${chalk.bold(key)}`);
1105
+ } catch (err) {
1106
+ console.error(
1107
+ chalk.red(
1108
+ `\u2716 Failed to save configuration: ${chalk.dim(
1109
+ err instanceof Error ? err.message : String(err)
1110
+ )}`
1111
+ )
1112
+ );
1113
+ process.exitCode = 1;
1114
+ }
1115
+ });
1116
+
1117
+ // src/cli/cmd/config/unset.ts
1118
+ import { Command as Command7 } from "interactive-commander";
1119
+ import chalk2 from "chalk";
1120
+ import dedent2 from "dedent";
1121
+ import _7 from "lodash";
1122
+ var unset_default = new Command7().name("unset").description("Remove a configuration key").addHelpText("afterAll", `
1123
+ Available keys:
1124
+ ${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key to remove").helpOption("-h, --help", "Show help").action(async (key) => {
1125
+ if (!SETTINGS_KEYS.includes(key)) {
1126
+ console.error(
1127
+ dedent2`
1128
+ ${chalk2.red("\u2716")} Unknown configuration key: ${chalk2.bold(key)}
1129
+ Run ${chalk2.dim("lingo.dev config unset --help")} to see available keys.
1130
+ `
1131
+ );
1132
+ process.exitCode = 1;
1133
+ return;
1134
+ }
1135
+ const settings = loadSystemSettings();
1136
+ const currentValue = _7.get(settings, key);
1137
+ if (!_7.trim(String(currentValue || ""))) {
1138
+ console.log(`${chalk2.cyan("\u2139")} ${chalk2.bold(key)} is not set.`);
1139
+ return;
1140
+ } else {
1141
+ const updated = _7.cloneDeep(settings);
1142
+ _7.unset(updated, key);
1143
+ try {
1144
+ saveSettings(updated);
1145
+ console.log(
1146
+ `${chalk2.green("\u2714")} Removed configuration key ${chalk2.bold(key)}`
1147
+ );
1148
+ } catch (err) {
1149
+ console.error(
1150
+ chalk2.red(
1151
+ `\u2716 Failed to save configuration: ${chalk2.dim(
1152
+ err instanceof Error ? err.message : String(err)
1153
+ )}`
1154
+ )
1155
+ );
1156
+ process.exitCode = 1;
1157
+ }
1158
+ }
1159
+ });
1160
+
1161
+ // src/cli/cmd/config/get.ts
1162
+ import { Command as Command8 } from "interactive-commander";
1163
+ import chalk3 from "chalk";
1164
+ import _8 from "lodash";
1165
+ import dedent3 from "dedent";
1166
+ var get_default = new Command8().name("get").description("Get the value of a configuration key").addHelpText("afterAll", `
1167
+ Available keys:
1168
+ ${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key").helpOption("-h, --help", "Show help").action(async (key) => {
1169
+ if (!SETTINGS_KEYS.includes(key)) {
1170
+ console.error(
1171
+ dedent3`
1172
+ ${chalk3.red("\u2716")} Unknown configuration key: ${chalk3.bold(key)}
1173
+ Run ${chalk3.dim("lingo.dev config get --help")} to see available keys.
1174
+ `
1175
+ );
1176
+ process.exitCode = 1;
1177
+ return;
1178
+ }
1179
+ const settings = loadSystemSettings();
1180
+ const value = _8.get(settings, key);
1181
+ if (!value) {
1182
+ console.log(`${chalk3.cyan("\u2139")} ${chalk3.bold(key)} is not set.`);
1183
+ return;
1184
+ }
1185
+ if (typeof value === "object") {
1186
+ console.log(JSON.stringify(value, null, 2));
1187
+ } else {
1188
+ console.log(value);
1189
+ }
1190
+ });
1191
+
1192
+ // src/cli/cmd/config/index.ts
1193
+ var config_default2 = new Command9().command("config").description("Manage Lingo.dev CLI configuration").helpOption("-h, --help", "Show help").addCommand(set_default).addCommand(unset_default).addCommand(get_default);
1194
+
1020
1195
  // src/cli/cmd/i18n.ts
1021
1196
  import {
1022
1197
  bucketTypeSchema,
1023
1198
  localeCodeSchema,
1024
1199
  resolveOverriddenLocale as resolveOverriddenLocale3
1025
1200
  } from "@lingo.dev/_spec";
1026
- import { Command as Command6 } from "interactive-commander";
1201
+ import { Command as Command10 } from "interactive-commander";
1027
1202
  import Z3 from "zod";
1028
- import _26 from "lodash";
1203
+ import _29 from "lodash";
1029
1204
  import Ora5 from "ora";
1030
1205
 
1031
1206
  // src/cli/loaders/_utils.ts
@@ -1145,7 +1320,7 @@ function createJsonLoader() {
1145
1320
 
1146
1321
  // src/cli/loaders/flat.ts
1147
1322
  import { flatten, unflatten } from "flat";
1148
- import _6 from "lodash";
1323
+ import _9 from "lodash";
1149
1324
  var OBJECT_NUMERIC_KEY_PREFIX = "__lingodotdev__obj__";
1150
1325
  function createFlatLoader() {
1151
1326
  return composeLoaders(createDenormalizeLoader(), createNormalizeLoader());
@@ -1212,12 +1387,12 @@ function mapDenormalizedKeys(obj, denormalizedKeysMap) {
1212
1387
  );
1213
1388
  }
1214
1389
  function denormalizeObjectKeys(obj) {
1215
- if (_6.isObject(obj) && !_6.isArray(obj)) {
1216
- return _6.transform(
1390
+ if (_9.isObject(obj) && !_9.isArray(obj)) {
1391
+ return _9.transform(
1217
1392
  obj,
1218
1393
  (result, value, key) => {
1219
1394
  const newKey = !isNaN(Number(key)) ? `${OBJECT_NUMERIC_KEY_PREFIX}${key}` : key;
1220
- result[newKey] = _6.isObject(value) && !_6.isDate(value) ? denormalizeObjectKeys(value) : value;
1395
+ result[newKey] = _9.isObject(value) && !_9.isDate(value) ? denormalizeObjectKeys(value) : value;
1221
1396
  },
1222
1397
  {}
1223
1398
  );
@@ -1226,12 +1401,12 @@ function denormalizeObjectKeys(obj) {
1226
1401
  }
1227
1402
  }
1228
1403
  function normalizeObjectKeys(obj) {
1229
- if (_6.isObject(obj) && !_6.isArray(obj)) {
1230
- return _6.transform(
1404
+ if (_9.isObject(obj) && !_9.isArray(obj)) {
1405
+ return _9.transform(
1231
1406
  obj,
1232
1407
  (result, value, key) => {
1233
1408
  const newKey = `${key}`.replace(OBJECT_NUMERIC_KEY_PREFIX, "");
1234
- result[newKey] = _6.isObject(value) && !_6.isDate(value) ? normalizeObjectKeys(value) : value;
1409
+ result[newKey] = _9.isObject(value) && !_9.isDate(value) ? normalizeObjectKeys(value) : value;
1235
1410
  },
1236
1411
  {}
1237
1412
  );
@@ -1250,7 +1425,7 @@ function createTextFileLoader(pathPattern) {
1250
1425
  const trimmedResult = result.trim();
1251
1426
  return trimmedResult;
1252
1427
  },
1253
- async push(locale, data, _30, originalLocale) {
1428
+ async push(locale, data, _33, originalLocale) {
1254
1429
  const draftPath = pathPattern.replaceAll("[locale]", locale);
1255
1430
  const finalPath = path10.resolve(draftPath);
1256
1431
  const dirPath = path10.dirname(finalPath);
@@ -1346,15 +1521,15 @@ function createRootKeyLoader(replaceAll = false) {
1346
1521
  }
1347
1522
 
1348
1523
  // src/cli/loaders/flutter.ts
1349
- import _7 from "lodash";
1524
+ import _10 from "lodash";
1350
1525
  function createFlutterLoader() {
1351
1526
  return createLoader({
1352
1527
  async pull(locale, input2) {
1353
- const result = _7.pickBy(input2, (value, key) => !key.startsWith("@"));
1528
+ const result = _10.pickBy(input2, (value, key) => !key.startsWith("@"));
1354
1529
  return result;
1355
1530
  },
1356
1531
  async push(locale, data, originalInput) {
1357
- const result = _7.merge({}, originalInput, { "@@locale": locale }, data);
1532
+ const result = _10.merge({}, originalInput, { "@@locale": locale }, data);
1358
1533
  return result;
1359
1534
  }
1360
1535
  });
@@ -1541,7 +1716,7 @@ function createAndroidLoader() {
1541
1716
  // src/cli/loaders/csv.ts
1542
1717
  import { parse } from "csv-parse/sync";
1543
1718
  import { stringify } from "csv-stringify/sync";
1544
- import _8 from "lodash";
1719
+ import _11 from "lodash";
1545
1720
  function createCsvLoader() {
1546
1721
  return createLoader({
1547
1722
  async pull(locale, _input) {
@@ -1550,7 +1725,7 @@ function createCsvLoader() {
1550
1725
  skip_empty_lines: true
1551
1726
  });
1552
1727
  const result = {};
1553
- _8.forEach(input2, (row) => {
1728
+ _11.forEach(input2, (row) => {
1554
1729
  const key = row.id;
1555
1730
  if (key && row[locale] && row[locale].trim() !== "") {
1556
1731
  result[key] = row[locale];
@@ -1779,7 +1954,7 @@ function createPropertiesLoader() {
1779
1954
  return result;
1780
1955
  },
1781
1956
  async push(locale, payload) {
1782
- const result = Object.entries(payload).filter(([_30, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
1957
+ const result = Object.entries(payload).filter(([_33, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
1783
1958
  return result;
1784
1959
  }
1785
1960
  });
@@ -1865,7 +2040,7 @@ function createXcodeStringsdictLoader() {
1865
2040
  }
1866
2041
 
1867
2042
  // src/cli/loaders/xcode-xcstrings.ts
1868
- import _9 from "lodash";
2043
+ import _12 from "lodash";
1869
2044
  function createXcodeXcstringsLoader(defaultLocale) {
1870
2045
  return createLoader({
1871
2046
  async pull(locale, input2, initCtx) {
@@ -1900,7 +2075,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
1900
2075
  async push(locale, payload, originalInput) {
1901
2076
  const langDataToMerge = {};
1902
2077
  langDataToMerge.strings = {};
1903
- const input2 = _9.cloneDeep(originalInput) || { sourceLanguage: locale, strings: {} };
2078
+ const input2 = _12.cloneDeep(originalInput) || { sourceLanguage: locale, strings: {} };
1904
2079
  for (const [key, value] of Object.entries(payload)) {
1905
2080
  if (value === null || value === void 0) {
1906
2081
  continue;
@@ -1946,7 +2121,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
1946
2121
  }
1947
2122
  }
1948
2123
  }
1949
- const result = _9.merge({}, originalInput, langDataToMerge);
2124
+ const result = _12.merge({}, originalInput, langDataToMerge);
1950
2125
  return result;
1951
2126
  }
1952
2127
  });
@@ -2025,17 +2200,17 @@ async function formatDataWithPrettier(data, filePath, options) {
2025
2200
  }
2026
2201
 
2027
2202
  // src/cli/loaders/unlocalizable.ts
2028
- import _10 from "lodash";
2203
+ import _13 from "lodash";
2029
2204
  import _isUrl from "is-url";
2030
2205
  import { isValid, parseISO } from "date-fns";
2031
2206
  function createUnlocalizableLoader(isCacheRestore = false, returnUnlocalizedKeys = false) {
2032
2207
  const rules = {
2033
- isEmpty: (v) => _10.isEmpty(v),
2208
+ isEmpty: (v) => _13.isEmpty(v),
2034
2209
  isNumber: (v) => typeof v === "number" || /^[0-9]+$/.test(v),
2035
- isBoolean: (v) => _10.isBoolean(v),
2036
- isIsoDate: (v) => _10.isString(v) && _isIsoDate(v),
2037
- isSystemId: (v) => _10.isString(v) && _isSystemId(v),
2038
- isUrl: (v) => _10.isString(v) && _isUrl(v)
2210
+ isBoolean: (v) => _13.isBoolean(v),
2211
+ isIsoDate: (v) => _13.isString(v) && _isIsoDate(v),
2212
+ isSystemId: (v) => _13.isString(v) && _isSystemId(v),
2213
+ isUrl: (v) => _13.isString(v) && _isUrl(v)
2039
2214
  };
2040
2215
  return createLoader({
2041
2216
  async pull(locale, input2) {
@@ -2046,18 +2221,18 @@ function createUnlocalizableLoader(isCacheRestore = false, returnUnlocalizedKeys
2046
2221
  }
2047
2222
  }
2048
2223
  return false;
2049
- }).map(([key, _30]) => key);
2050
- const result = _10.omitBy(input2, (_30, key) => passthroughKeys.includes(key));
2224
+ }).map(([key, _33]) => key);
2225
+ const result = _13.omitBy(input2, (_33, key) => passthroughKeys.includes(key));
2051
2226
  if (returnUnlocalizedKeys) {
2052
- result.unlocalizable = _10.omitBy(input2, (_30, key) => !passthroughKeys.includes(key));
2227
+ result.unlocalizable = _13.omitBy(input2, (_33, key) => !passthroughKeys.includes(key));
2053
2228
  }
2054
2229
  return result;
2055
2230
  },
2056
2231
  async push(locale, data, originalInput) {
2057
2232
  if (isCacheRestore) {
2058
- return _10.merge({}, data);
2233
+ return _13.merge({}, data);
2059
2234
  }
2060
- const result = _10.merge({}, originalInput, data);
2235
+ const result = _13.merge({}, originalInput, data);
2061
2236
  return result;
2062
2237
  }
2063
2238
  });
@@ -2070,7 +2245,7 @@ function _isIsoDate(v) {
2070
2245
  }
2071
2246
 
2072
2247
  // src/cli/loaders/po/index.ts
2073
- import _11 from "lodash";
2248
+ import _14 from "lodash";
2074
2249
  import gettextParser from "gettext-parser";
2075
2250
  function createPoLoader(params = { multiline: false }) {
2076
2251
  return composeLoaders(createPoDataLoader(params), createPoContentLoader());
@@ -2083,7 +2258,7 @@ function createPoDataLoader(params) {
2083
2258
  const sections = input2.split("\n\n").filter(Boolean);
2084
2259
  for (const section of sections) {
2085
2260
  const sectionPo = gettextParser.po.parse(section);
2086
- const contextKey = _11.keys(sectionPo.translations)[0];
2261
+ const contextKey = _14.keys(sectionPo.translations)[0];
2087
2262
  const entries = sectionPo.translations[contextKey];
2088
2263
  Object.entries(entries).forEach(([msgid, entry]) => {
2089
2264
  if (msgid && entry.msgid) {
@@ -2102,13 +2277,13 @@ function createPoDataLoader(params) {
2102
2277
  const originalSections = originalInput?.split("\n\n").filter(Boolean) || [];
2103
2278
  const result = originalSections.map((section) => {
2104
2279
  const sectionPo = gettextParser.po.parse(section);
2105
- const contextKey = _11.keys(sectionPo.translations)[0];
2280
+ const contextKey = _14.keys(sectionPo.translations)[0];
2106
2281
  const entries = sectionPo.translations[contextKey];
2107
2282
  const msgid = Object.keys(entries).find((key) => entries[key].msgid);
2108
2283
  if (!msgid) {
2109
2284
  const currentSection = currentSections.find((cs) => {
2110
2285
  const csPo = gettextParser.po.parse(cs);
2111
- const csContextKey = _11.keys(csPo.translations)[0];
2286
+ const csContextKey = _14.keys(csPo.translations)[0];
2112
2287
  const csEntries = csPo.translations[csContextKey];
2113
2288
  const csMsgid = Object.keys(csEntries).find(
2114
2289
  (key) => csEntries[key].msgid
@@ -2121,7 +2296,7 @@ function createPoDataLoader(params) {
2121
2296
  return section;
2122
2297
  }
2123
2298
  if (data[msgid]) {
2124
- const updatedPo = _11.merge({}, sectionPo, {
2299
+ const updatedPo = _14.merge({}, sectionPo, {
2125
2300
  translations: {
2126
2301
  [contextKey]: {
2127
2302
  [msgid]: {
@@ -2144,7 +2319,7 @@ function createPoDataLoader(params) {
2144
2319
  function createPoContentLoader() {
2145
2320
  return createLoader({
2146
2321
  async pull(locale, input2, initCtx, originalLocale) {
2147
- const result = _11.chain(input2).entries().filter(([, entry]) => !!entry.msgid).map(([, entry]) => {
2322
+ const result = _14.chain(input2).entries().filter(([, entry]) => !!entry.msgid).map(([, entry]) => {
2148
2323
  const singularFallback = locale === originalLocale ? entry.msgid : null;
2149
2324
  const pluralFallback = locale === originalLocale ? entry.msgid_plural || entry.msgid : null;
2150
2325
  const hasPlural = entry.msgstr.length > 1;
@@ -2159,7 +2334,7 @@ function createPoContentLoader() {
2159
2334
  return result;
2160
2335
  },
2161
2336
  async push(locale, data, originalInput) {
2162
- const result = _11.chain(originalInput).entries().map(([, entry]) => [
2337
+ const result = _14.chain(originalInput).entries().map(([, entry]) => [
2163
2338
  entry.msgid,
2164
2339
  {
2165
2340
  ...entry,
@@ -2285,34 +2460,34 @@ var datoSettingsSchema = Z2.object({
2285
2460
  });
2286
2461
 
2287
2462
  // src/cli/loaders/dato/filter.ts
2288
- import _12 from "lodash";
2463
+ import _15 from "lodash";
2289
2464
  function createDatoFilterLoader() {
2290
2465
  return createLoader({
2291
2466
  async pull(locale, input2) {
2292
2467
  const result = {};
2293
- for (const [modelId, modelInfo] of _12.entries(input2)) {
2468
+ for (const [modelId, modelInfo] of _15.entries(input2)) {
2294
2469
  result[modelId] = {};
2295
2470
  for (const record of modelInfo.records) {
2296
- result[modelId][record.id] = _12.chain(modelInfo.fields).mapKeys((field) => field.api_key).mapValues((field) => _12.get(record, [field.api_key, locale])).value();
2471
+ result[modelId][record.id] = _15.chain(modelInfo.fields).mapKeys((field) => field.api_key).mapValues((field) => _15.get(record, [field.api_key, locale])).value();
2297
2472
  }
2298
2473
  }
2299
2474
  return result;
2300
2475
  },
2301
2476
  async push(locale, data, originalInput, originalLocale) {
2302
- const result = _12.cloneDeep(originalInput || {});
2303
- for (const [modelId, modelInfo] of _12.entries(result)) {
2477
+ const result = _15.cloneDeep(originalInput || {});
2478
+ for (const [modelId, modelInfo] of _15.entries(result)) {
2304
2479
  for (const record of modelInfo.records) {
2305
- for (const [fieldId, fieldValue] of _12.entries(record)) {
2480
+ for (const [fieldId, fieldValue] of _15.entries(record)) {
2306
2481
  const fieldInfo = modelInfo.fields.find((field) => field.api_key === fieldId);
2307
2482
  if (fieldInfo) {
2308
- const sourceFieldValue = _12.get(fieldValue, [originalLocale]);
2309
- const targetFieldValue = _12.get(data, [modelId, record.id, fieldId]);
2483
+ const sourceFieldValue = _15.get(fieldValue, [originalLocale]);
2484
+ const targetFieldValue = _15.get(data, [modelId, record.id, fieldId]);
2310
2485
  if (targetFieldValue) {
2311
- _12.set(record, [fieldId, locale], targetFieldValue);
2486
+ _15.set(record, [fieldId, locale], targetFieldValue);
2312
2487
  } else {
2313
- _12.set(record, [fieldId, locale], sourceFieldValue);
2488
+ _15.set(record, [fieldId, locale], sourceFieldValue);
2314
2489
  }
2315
- _12.chain(fieldValue).keys().reject((loc) => loc === locale || loc === originalLocale).filter((loc) => _12.isEmpty(_12.get(fieldValue, [loc]))).forEach((loc) => _12.set(record, [fieldId, loc], sourceFieldValue)).value();
2490
+ _15.chain(fieldValue).keys().reject((loc) => loc === locale || loc === originalLocale).filter((loc) => _15.isEmpty(_15.get(fieldValue, [loc]))).forEach((loc) => _15.set(record, [fieldId, loc], sourceFieldValue)).value();
2316
2491
  }
2317
2492
  }
2318
2493
  }
@@ -2323,10 +2498,10 @@ function createDatoFilterLoader() {
2323
2498
  }
2324
2499
 
2325
2500
  // src/cli/loaders/dato/api.ts
2326
- import _14 from "lodash";
2501
+ import _17 from "lodash";
2327
2502
 
2328
2503
  // src/cli/loaders/dato/_utils.ts
2329
- import _13 from "lodash";
2504
+ import _16 from "lodash";
2330
2505
  import { buildClient } from "@datocms/cma-client-node";
2331
2506
  function createDatoClient(params) {
2332
2507
  if (!params.apiKey) {
@@ -2501,7 +2676,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2501
2676
  const result = {
2502
2677
  models: {}
2503
2678
  };
2504
- const updatedConfig = _14.cloneDeep(config);
2679
+ const updatedConfig = _17.cloneDeep(config);
2505
2680
  console.log(`Initializing DatoCMS loader...`);
2506
2681
  const project = await dato.findProject();
2507
2682
  const modelChoices = await getModelChoices(dato, config);
@@ -2519,7 +2694,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2519
2694
  delete updatedConfig.models[modelId];
2520
2695
  }
2521
2696
  }
2522
- for (const modelId of _14.keys(updatedConfig.models)) {
2697
+ for (const modelId of _17.keys(updatedConfig.models)) {
2523
2698
  const { modelName, fields } = await getModelFields(dato, modelId);
2524
2699
  if (fields.length > 0) {
2525
2700
  result.models[modelId] = { fields: [], records: [] };
@@ -2530,7 +2705,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2530
2705
  const isLocalized = await updateFieldLocalization(dato, fieldInfo, selectedFields.includes(fieldInfo.id));
2531
2706
  if (isLocalized) {
2532
2707
  result.models[modelId].fields.push(fieldInfo);
2533
- updatedConfig.models[modelId].fields = _14.uniq([
2708
+ updatedConfig.models[modelId].fields = _17.uniq([
2534
2709
  ...updatedConfig.models[modelId].fields || [],
2535
2710
  fieldInfo.api_key
2536
2711
  ]);
@@ -2549,7 +2724,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2549
2724
  },
2550
2725
  async pull(locale, input2, initCtx) {
2551
2726
  const result = {};
2552
- for (const modelId of _14.keys(initCtx?.models || {})) {
2727
+ for (const modelId of _17.keys(initCtx?.models || {})) {
2553
2728
  let records = initCtx?.models[modelId].records || [];
2554
2729
  const recordIds = records.map((record) => record.id);
2555
2730
  records = await dato.findRecords(recordIds);
@@ -2564,7 +2739,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2564
2739
  return result;
2565
2740
  },
2566
2741
  async push(locale, data, originalInput) {
2567
- for (const modelId of _14.keys(data)) {
2742
+ for (const modelId of _17.keys(data)) {
2568
2743
  for (let i = 0; i < data[modelId].records.length; i++) {
2569
2744
  const record = data[modelId].records[i];
2570
2745
  console.log(`Updating record ${i + 1}/${data[modelId].records.length} for model ${modelId}...`);
@@ -2578,7 +2753,7 @@ async function getModelFields(dato, modelId) {
2578
2753
  const modelInfo = await dato.findModel(modelId);
2579
2754
  return {
2580
2755
  modelName: modelInfo.name,
2581
- fields: _14.filter(modelInfo.fields, (field) => field.type === "field")
2756
+ fields: _17.filter(modelInfo.fields, (field) => field.type === "field")
2582
2757
  };
2583
2758
  }
2584
2759
  async function getFieldDetails(dato, fields) {
@@ -2656,17 +2831,17 @@ async function promptModelSelection(choices) {
2656
2831
  }
2657
2832
 
2658
2833
  // src/cli/loaders/dato/extract.ts
2659
- import _15 from "lodash";
2834
+ import _18 from "lodash";
2660
2835
  function createDatoExtractLoader() {
2661
2836
  return createLoader({
2662
2837
  async pull(locale, input2) {
2663
2838
  const result = {};
2664
- for (const [modelId, modelInfo] of _15.entries(input2)) {
2665
- for (const [recordId, record] of _15.entries(modelInfo)) {
2666
- for (const [fieldName, fieldValue] of _15.entries(record)) {
2839
+ for (const [modelId, modelInfo] of _18.entries(input2)) {
2840
+ for (const [recordId, record] of _18.entries(modelInfo)) {
2841
+ for (const [fieldName, fieldValue] of _18.entries(record)) {
2667
2842
  const parsedValue = createParsedDatoValue(fieldValue);
2668
2843
  if (parsedValue) {
2669
- _15.set(result, [modelId, `_${recordId}`, fieldName], parsedValue);
2844
+ _18.set(result, [modelId, `_${recordId}`, fieldName], parsedValue);
2670
2845
  }
2671
2846
  }
2672
2847
  }
@@ -2674,14 +2849,14 @@ function createDatoExtractLoader() {
2674
2849
  return result;
2675
2850
  },
2676
2851
  async push(locale, data, originalInput) {
2677
- const result = _15.cloneDeep(originalInput || {});
2678
- for (const [modelId, modelInfo] of _15.entries(data)) {
2679
- for (const [virtualRecordId, record] of _15.entries(modelInfo)) {
2680
- for (const [fieldName, fieldValue] of _15.entries(record)) {
2852
+ const result = _18.cloneDeep(originalInput || {});
2853
+ for (const [modelId, modelInfo] of _18.entries(data)) {
2854
+ for (const [virtualRecordId, record] of _18.entries(modelInfo)) {
2855
+ for (const [fieldName, fieldValue] of _18.entries(record)) {
2681
2856
  const [, recordId] = virtualRecordId.split("_");
2682
- const originalFieldValue = _15.get(originalInput, [modelId, recordId, fieldName]);
2857
+ const originalFieldValue = _18.get(originalInput, [modelId, recordId, fieldName]);
2683
2858
  const rawValue = createRawDatoValue(fieldValue, originalFieldValue, true);
2684
- _15.set(result, [modelId, recordId, fieldName], rawValue || originalFieldValue);
2859
+ _18.set(result, [modelId, recordId, fieldName], rawValue || originalFieldValue);
2685
2860
  }
2686
2861
  }
2687
2862
  }
@@ -2690,25 +2865,25 @@ function createDatoExtractLoader() {
2690
2865
  });
2691
2866
  }
2692
2867
  function detectDatoFieldType(rawDatoValue) {
2693
- if (_15.has(rawDatoValue, "document") && _15.get(rawDatoValue, "schema") === "dast") {
2868
+ if (_18.has(rawDatoValue, "document") && _18.get(rawDatoValue, "schema") === "dast") {
2694
2869
  return "structured_text";
2695
- } else if (_15.has(rawDatoValue, "no_index") || _15.has(rawDatoValue, "twitter_card")) {
2870
+ } else if (_18.has(rawDatoValue, "no_index") || _18.has(rawDatoValue, "twitter_card")) {
2696
2871
  return "seo";
2697
- } else if (_15.get(rawDatoValue, "type") === "item") {
2872
+ } else if (_18.get(rawDatoValue, "type") === "item") {
2698
2873
  return "single_block";
2699
- } else if (_15.isArray(rawDatoValue) && _15.every(rawDatoValue, (item) => _15.get(item, "type") === "item")) {
2874
+ } else if (_18.isArray(rawDatoValue) && _18.every(rawDatoValue, (item) => _18.get(item, "type") === "item")) {
2700
2875
  return "rich_text";
2701
2876
  } else if (_isFile(rawDatoValue)) {
2702
2877
  return "file";
2703
- } else if (_15.isArray(rawDatoValue) && _15.every(rawDatoValue, (item) => _isFile(item))) {
2878
+ } else if (_18.isArray(rawDatoValue) && _18.every(rawDatoValue, (item) => _isFile(item))) {
2704
2879
  return "gallery";
2705
2880
  } else if (_isJson(rawDatoValue)) {
2706
2881
  return "json";
2707
- } else if (_15.isString(rawDatoValue)) {
2882
+ } else if (_18.isString(rawDatoValue)) {
2708
2883
  return "string";
2709
2884
  } else if (_isVideo(rawDatoValue)) {
2710
2885
  return "video";
2711
- } else if (_15.isArray(rawDatoValue) && _15.every(rawDatoValue, (item) => _15.isString(item))) {
2886
+ } else if (_18.isArray(rawDatoValue) && _18.every(rawDatoValue, (item) => _18.isString(item))) {
2712
2887
  return "ref_list";
2713
2888
  } else {
2714
2889
  return null;
@@ -2770,9 +2945,9 @@ function serializeStructuredText(rawStructuredText) {
2770
2945
  if ("document" in node) {
2771
2946
  return serializeStructuredTextNode(node.document, [...path16, "document"], acc);
2772
2947
  }
2773
- if (!_15.isNil(node.value)) {
2948
+ if (!_18.isNil(node.value)) {
2774
2949
  acc[[...path16, "value"].join(".")] = node.value;
2775
- } else if (_15.get(node, "type") === "block") {
2950
+ } else if (_18.get(node, "type") === "block") {
2776
2951
  acc[[...path16, "item"].join(".")] = serializeBlock(node.item);
2777
2952
  }
2778
2953
  if (node.children) {
@@ -2784,44 +2959,44 @@ function serializeStructuredText(rawStructuredText) {
2784
2959
  }
2785
2960
  }
2786
2961
  function serializeSeo(rawSeo) {
2787
- return _15.chain(rawSeo).pick(["title", "description"]).value();
2962
+ return _18.chain(rawSeo).pick(["title", "description"]).value();
2788
2963
  }
2789
2964
  function serializeBlock(rawBlock) {
2790
- if (_15.get(rawBlock, "type") === "item" && _15.has(rawBlock, "id")) {
2965
+ if (_18.get(rawBlock, "type") === "item" && _18.has(rawBlock, "id")) {
2791
2966
  return serializeBlock(rawBlock.attributes);
2792
2967
  }
2793
2968
  const result = {};
2794
- for (const [attributeName, attributeValue] of _15.entries(rawBlock)) {
2969
+ for (const [attributeName, attributeValue] of _18.entries(rawBlock)) {
2795
2970
  result[attributeName] = createParsedDatoValue(attributeValue);
2796
2971
  }
2797
2972
  return result;
2798
2973
  }
2799
2974
  function serializeBlockList(rawBlockList) {
2800
- return _15.chain(rawBlockList).map((block) => serializeBlock(block)).value();
2975
+ return _18.chain(rawBlockList).map((block) => serializeBlock(block)).value();
2801
2976
  }
2802
2977
  function serializeVideo(rawVideo) {
2803
- return _15.chain(rawVideo).pick(["title"]).value();
2978
+ return _18.chain(rawVideo).pick(["title"]).value();
2804
2979
  }
2805
2980
  function serializeFile(rawFile) {
2806
- return _15.chain(rawFile).pick(["alt", "title"]).value();
2981
+ return _18.chain(rawFile).pick(["alt", "title"]).value();
2807
2982
  }
2808
2983
  function serializeGallery(rawGallery) {
2809
- return _15.chain(rawGallery).map((item) => serializeFile(item)).value();
2984
+ return _18.chain(rawGallery).map((item) => serializeFile(item)).value();
2810
2985
  }
2811
2986
  function deserializeFile(parsedFile, originalRawFile) {
2812
- return _15.chain(parsedFile).defaults(originalRawFile).value();
2987
+ return _18.chain(parsedFile).defaults(originalRawFile).value();
2813
2988
  }
2814
2989
  function deserializeGallery(parsedGallery, originalRawGallery) {
2815
- return _15.chain(parsedGallery).map((item, i) => deserializeFile(item, originalRawGallery[i])).value();
2990
+ return _18.chain(parsedGallery).map((item, i) => deserializeFile(item, originalRawGallery[i])).value();
2816
2991
  }
2817
2992
  function deserializeVideo(parsedVideo, originalRawVideo) {
2818
- return _15.chain(parsedVideo).defaults(originalRawVideo).value();
2993
+ return _18.chain(parsedVideo).defaults(originalRawVideo).value();
2819
2994
  }
2820
2995
  function deserializeBlock(payload, rawNode, isClean = false) {
2821
- const result = _15.cloneDeep(rawNode);
2822
- for (const [attributeName, attributeValue] of _15.entries(rawNode.attributes)) {
2996
+ const result = _18.cloneDeep(rawNode);
2997
+ for (const [attributeName, attributeValue] of _18.entries(rawNode.attributes)) {
2823
2998
  const rawValue = createRawDatoValue(payload[attributeName], attributeValue, isClean);
2824
- _15.set(result, ["attributes", attributeName], rawValue);
2999
+ _18.set(result, ["attributes", attributeName], rawValue);
2825
3000
  }
2826
3001
  if (isClean) {
2827
3002
  delete result["id"];
@@ -2829,33 +3004,33 @@ function deserializeBlock(payload, rawNode, isClean = false) {
2829
3004
  return result;
2830
3005
  }
2831
3006
  function deserializeSeo(parsedSeo, originalRawSeo) {
2832
- return _15.chain(parsedSeo).pick(["title", "description"]).defaults(originalRawSeo).value();
3007
+ return _18.chain(parsedSeo).pick(["title", "description"]).defaults(originalRawSeo).value();
2833
3008
  }
2834
3009
  function deserializeBlockList(parsedBlockList, originalRawBlockList, isClean = false) {
2835
- return _15.chain(parsedBlockList).map((block, i) => deserializeBlock(block, originalRawBlockList[i], isClean)).value();
3010
+ return _18.chain(parsedBlockList).map((block, i) => deserializeBlock(block, originalRawBlockList[i], isClean)).value();
2836
3011
  }
2837
3012
  function deserializeStructuredText(parsedStructuredText, originalRawStructuredText) {
2838
- const result = _15.cloneDeep(originalRawStructuredText);
2839
- for (const [path16, value] of _15.entries(parsedStructuredText)) {
2840
- const realPath = _15.chain(path16.split(".")).flatMap((s) => !_15.isNaN(_15.toNumber(s)) ? ["children", s] : s).value();
2841
- const deserializedValue = createRawDatoValue(value, _15.get(originalRawStructuredText, realPath), true);
2842
- _15.set(result, realPath, deserializedValue);
3013
+ const result = _18.cloneDeep(originalRawStructuredText);
3014
+ for (const [path16, value] of _18.entries(parsedStructuredText)) {
3015
+ const realPath = _18.chain(path16.split(".")).flatMap((s) => !_18.isNaN(_18.toNumber(s)) ? ["children", s] : s).value();
3016
+ const deserializedValue = createRawDatoValue(value, _18.get(originalRawStructuredText, realPath), true);
3017
+ _18.set(result, realPath, deserializedValue);
2843
3018
  }
2844
3019
  return result;
2845
3020
  }
2846
3021
  function _isJson(rawDatoValue) {
2847
3022
  try {
2848
- return _15.isString(rawDatoValue) && rawDatoValue.startsWith("{") && rawDatoValue.endsWith("}") && !!JSON.parse(rawDatoValue);
3023
+ return _18.isString(rawDatoValue) && rawDatoValue.startsWith("{") && rawDatoValue.endsWith("}") && !!JSON.parse(rawDatoValue);
2849
3024
  } catch (e) {
2850
3025
  return false;
2851
3026
  }
2852
3027
  }
2853
3028
  function _isFile(rawDatoValue) {
2854
- return _15.isObject(rawDatoValue) && ["alt", "title", "custom_data", "focal_point", "upload_id"].every((key) => _15.has(rawDatoValue, key));
3029
+ return _18.isObject(rawDatoValue) && ["alt", "title", "custom_data", "focal_point", "upload_id"].every((key) => _18.has(rawDatoValue, key));
2855
3030
  }
2856
3031
  function _isVideo(rawDatoValue) {
2857
- return _15.isObject(rawDatoValue) && ["url", "title", "width", "height", "provider", "provider_uid", "thumbnail_url"].every(
2858
- (key) => _15.has(rawDatoValue, key)
3032
+ return _18.isObject(rawDatoValue) && ["url", "title", "width", "height", "provider", "provider_uid", "thumbnail_url"].every(
3033
+ (key) => _18.has(rawDatoValue, key)
2859
3034
  );
2860
3035
  }
2861
3036
 
@@ -2916,7 +3091,7 @@ function createVttLoader() {
2916
3091
  }
2917
3092
 
2918
3093
  // src/cli/loaders/variable/index.ts
2919
- import _16 from "lodash";
3094
+ import _19 from "lodash";
2920
3095
  function createVariableLoader(params) {
2921
3096
  return composeLoaders(variableExtractLoader(params), variableContentLoader());
2922
3097
  }
@@ -2925,7 +3100,7 @@ function variableExtractLoader(params) {
2925
3100
  return createLoader({
2926
3101
  pull: async (locale, input2, initXtx, originalLocale, originalInput) => {
2927
3102
  const result = {};
2928
- const inputValues = _16.omitBy(input2, _16.isEmpty);
3103
+ const inputValues = _19.omitBy(input2, _19.isEmpty);
2929
3104
  for (const [key, value] of Object.entries(inputValues)) {
2930
3105
  const originalValue = originalInput[key];
2931
3106
  const matches = originalValue.match(specifierPattern) || [];
@@ -2961,11 +3136,11 @@ function variableExtractLoader(params) {
2961
3136
  function variableContentLoader() {
2962
3137
  return createLoader({
2963
3138
  pull: async (locale, input2) => {
2964
- const result = _16.mapValues(input2, (payload) => payload.value);
3139
+ const result = _19.mapValues(input2, (payload) => payload.value);
2965
3140
  return result;
2966
3141
  },
2967
3142
  push: async (locale, data, originalInput, defaultLocale, pullInput) => {
2968
- const result = _16.cloneDeep(
3143
+ const result = _19.cloneDeep(
2969
3144
  originalInput || {}
2970
3145
  );
2971
3146
  for (const [key, originalValueObj] of Object.entries(result)) {
@@ -2990,20 +3165,20 @@ function getFormatSpecifierPattern(type) {
2990
3165
  }
2991
3166
 
2992
3167
  // src/cli/loaders/sync.ts
2993
- import _17 from "lodash";
3168
+ import _20 from "lodash";
2994
3169
  function createSyncLoader() {
2995
3170
  return createLoader({
2996
3171
  async pull(locale, input2, initCtx, originalLocale, originalInput) {
2997
3172
  if (!originalInput) {
2998
3173
  return input2;
2999
3174
  }
3000
- return _17.chain(originalInput).mapValues((value, key) => input2[key]).value();
3175
+ return _20.chain(originalInput).mapValues((value, key) => input2[key]).value();
3001
3176
  },
3002
3177
  async push(locale, data, originalInput) {
3003
3178
  if (!originalInput) {
3004
3179
  return data;
3005
3180
  }
3006
- return _17.chain(originalInput || {}).mapValues((value, key) => data[key]).value();
3181
+ return _20.chain(originalInput || {}).mapValues((value, key) => data[key]).value();
3007
3182
  }
3008
3183
  });
3009
3184
  }
@@ -3164,7 +3339,7 @@ function parseVueFile(input2) {
3164
3339
 
3165
3340
  // src/cli/loaders/typescript/index.ts
3166
3341
  import { parse as parse2 } from "@babel/parser";
3167
- import _18 from "lodash";
3342
+ import _21 from "lodash";
3168
3343
  import babelTraverseModule from "@babel/traverse";
3169
3344
  import * as t from "@babel/types";
3170
3345
  import babelGenerateModule from "@babel/generator";
@@ -3200,7 +3375,7 @@ function createTypescriptLoader() {
3200
3375
  },
3201
3376
  push: async (locale, data, originalInput, defaultLocale, pullInput, pullOutput) => {
3202
3377
  const ast = parseTypeScript(originalInput || "");
3203
- const finalData = _18.merge({}, pullOutput, data);
3378
+ const finalData = _21.merge({}, pullOutput, data);
3204
3379
  updateStringsInDefaultExport(ast, finalData);
3205
3380
  const { code } = generate(ast, {
3206
3381
  jsescOption: {
@@ -3401,7 +3576,7 @@ function getPropertyKey(prop) {
3401
3576
  }
3402
3577
 
3403
3578
  // src/cli/loaders/inject-locale.ts
3404
- import _19 from "lodash";
3579
+ import _22 from "lodash";
3405
3580
  function createInjectLocaleLoader(injectLocaleKeys) {
3406
3581
  return createLoader({
3407
3582
  async pull(locale, data) {
@@ -3409,19 +3584,19 @@ function createInjectLocaleLoader(injectLocaleKeys) {
3409
3584
  return data;
3410
3585
  }
3411
3586
  const omitKeys = injectLocaleKeys.filter((key) => {
3412
- return _19.get(data, key) === locale;
3587
+ return _22.get(data, key) === locale;
3413
3588
  });
3414
- const result = _19.omit(data, omitKeys);
3589
+ const result = _22.omit(data, omitKeys);
3415
3590
  return result;
3416
3591
  },
3417
3592
  async push(locale, data, originalInput, originalLocale) {
3418
3593
  if (!injectLocaleKeys) {
3419
3594
  return data;
3420
3595
  }
3421
- const mergedData = _19.merge({}, originalInput, data);
3596
+ const mergedData = _22.merge({}, originalInput, data);
3422
3597
  injectLocaleKeys.forEach((key) => {
3423
- if (_19.get(mergedData, key) === originalLocale) {
3424
- _19.set(mergedData, key, locale);
3598
+ if (_22.get(mergedData, key) === originalLocale) {
3599
+ _22.set(mergedData, key, locale);
3425
3600
  }
3426
3601
  });
3427
3602
  return mergedData;
@@ -3430,16 +3605,16 @@ function createInjectLocaleLoader(injectLocaleKeys) {
3430
3605
  }
3431
3606
 
3432
3607
  // src/cli/loaders/locked-keys.ts
3433
- import _20 from "lodash";
3608
+ import _23 from "lodash";
3434
3609
  function createLockedKeysLoader(lockedKeys, isCacheRestore = false) {
3435
3610
  return createLoader({
3436
- pull: async (locale, data) => _20.chain(data).pickBy((value, key) => !lockedKeys.some((lockedKey) => key.startsWith(lockedKey))).value(),
3611
+ pull: async (locale, data) => _23.chain(data).pickBy((value, key) => !lockedKeys.some((lockedKey) => key.startsWith(lockedKey))).value(),
3437
3612
  push: async (locale, data, originalInput) => {
3438
- const lockedSubObject = _20.chain(originalInput).pickBy((value, key) => lockedKeys.some((lockedKey) => key.startsWith(lockedKey))).value();
3613
+ const lockedSubObject = _23.chain(originalInput).pickBy((value, key) => lockedKeys.some((lockedKey) => key.startsWith(lockedKey))).value();
3439
3614
  if (isCacheRestore) {
3440
- return _20.merge({}, data, lockedSubObject);
3615
+ return _23.merge({}, data, lockedSubObject);
3441
3616
  } else {
3442
- return _20.merge({}, originalInput, data, lockedSubObject);
3617
+ return _23.merge({}, originalInput, data, lockedSubObject);
3443
3618
  }
3444
3619
  }
3445
3620
  });
@@ -3492,7 +3667,7 @@ function md5(input2) {
3492
3667
  }
3493
3668
 
3494
3669
  // src/cli/loaders/mdx2/code-placeholder.ts
3495
- import _21 from "lodash";
3670
+ import _24 from "lodash";
3496
3671
  var fenceRegex = /([ \t]*)(^>\s*)?```([\s\S]*?)```/gm;
3497
3672
  var inlineCodeRegex = /(?<!`)`([^`\r\n]+?)`(?!`)/g;
3498
3673
  var imageRegex = /([ \t]*)(^>\s*)?!\[[^\]]*?\]\(([^()]*(\([^()]*\)[^()]*)*)\)/gm;
@@ -3515,7 +3690,7 @@ ${match}
3515
3690
  found = true;
3516
3691
  }
3517
3692
  } while (found);
3518
- content = _21.chain(content).split("\n\n").map((section) => _21.trim(section, "\n")).filter(Boolean).join("\n\n").value();
3693
+ content = _24.chain(content).split("\n\n").map((section) => _24.trim(section, "\n")).filter(Boolean).join("\n\n").value();
3519
3694
  return content;
3520
3695
  }
3521
3696
  function ensureTrailingFenceNewline(_content) {
@@ -3537,7 +3712,7 @@ ${match}
3537
3712
  found = true;
3538
3713
  }
3539
3714
  } while (found);
3540
- content = _21.chain(content).split("\n\n").map((section) => _21.trim(section, "\n")).filter(Boolean).join("\n\n").value();
3715
+ content = _24.chain(content).split("\n\n").map((section) => _24.trim(section, "\n")).filter(Boolean).join("\n\n").value();
3541
3716
  return content;
3542
3717
  }
3543
3718
  function extractCodePlaceholders(content) {
@@ -3577,13 +3752,13 @@ function createMdxCodePlaceholderLoader() {
3577
3752
  async push(locale, data, originalInput, originalLocale, pullInput) {
3578
3753
  const sourceInfo = extractCodePlaceholders(originalInput ?? "");
3579
3754
  const currentInfo = extractCodePlaceholders(pullInput ?? "");
3580
- const codePlaceholders = _21.merge(
3755
+ const codePlaceholders = _24.merge(
3581
3756
  sourceInfo.codePlaceholders,
3582
3757
  currentInfo.codePlaceholders
3583
3758
  );
3584
3759
  let result = data;
3585
3760
  for (const [placeholder, original] of Object.entries(codePlaceholders)) {
3586
- const replacement = original.startsWith(">") ? _21.trimStart(original, "> ") : original;
3761
+ const replacement = original.startsWith(">") ? _24.trimStart(original, "> ") : original;
3587
3762
  result = result.replaceAll(placeholder, replacement);
3588
3763
  }
3589
3764
  return result;
@@ -3611,11 +3786,11 @@ function createLocalizableMdxDocumentLoader() {
3611
3786
  }
3612
3787
 
3613
3788
  // src/cli/loaders/mdx2/sections-split-2.ts
3614
- import _22 from "lodash";
3789
+ import _25 from "lodash";
3615
3790
  function createMdxSectionsSplit2Loader() {
3616
3791
  return createLoader({
3617
3792
  async pull(locale, input2) {
3618
- const sections = _22.chain(input2.content).split("\n\n").filter(Boolean).map((section, index) => [index, section]).fromPairs().value();
3793
+ const sections = _25.chain(input2.content).split("\n\n").filter(Boolean).map((section, index) => [index, section]).fromPairs().value();
3619
3794
  const result = {
3620
3795
  frontmatter: input2.frontmatter,
3621
3796
  sections
@@ -3623,7 +3798,7 @@ function createMdxSectionsSplit2Loader() {
3623
3798
  return result;
3624
3799
  },
3625
3800
  async push(locale, data, originalInput, _originalLocale, pullInput) {
3626
- const content = _22.chain(data.sections).values().join("\n\n").value();
3801
+ const content = _25.chain(data.sections).values().join("\n\n").value();
3627
3802
  const result = {
3628
3803
  frontmatter: data.frontmatter,
3629
3804
  codePlaceholders: pullInput?.codePlaceholders || {},
@@ -3684,15 +3859,15 @@ function createMdxLockedPatternsLoader(defaultPatterns) {
3684
3859
  }
3685
3860
 
3686
3861
  // src/cli/loaders/ignored-keys.ts
3687
- import _23 from "lodash";
3862
+ import _26 from "lodash";
3688
3863
  function createIgnoredKeysLoader(ignoredKeys) {
3689
3864
  return createLoader({
3690
3865
  pull: async (locale, data) => {
3691
- const result = _23.chain(data).omit(ignoredKeys).value();
3866
+ const result = _26.chain(data).omit(ignoredKeys).value();
3692
3867
  return result;
3693
3868
  },
3694
3869
  push: async (locale, data, originalInput, originalLocale, pullInput) => {
3695
- const result = _23.merge({}, data, _23.pick(pullInput, ignoredKeys));
3870
+ const result = _26.merge({}, data, _26.pick(pullInput, ignoredKeys));
3696
3871
  return result;
3697
3872
  }
3698
3873
  });
@@ -3969,14 +4144,14 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
3969
4144
  }
3970
4145
 
3971
4146
  // src/cli/cmd/i18n.ts
3972
- import chalk2 from "chalk";
4147
+ import chalk5 from "chalk";
3973
4148
  import { createTwoFilesPatch } from "diff";
3974
4149
  import inquirer2 from "inquirer";
3975
4150
  import externalEditor from "external-editor";
3976
4151
 
3977
4152
  // src/cli/processor/index.ts
3978
- import chalk from "chalk";
3979
- import dedent from "dedent";
4153
+ import chalk4 from "chalk";
4154
+ import dedent4 from "dedent";
3980
4155
 
3981
4156
  // src/cli/processor/lingo.ts
3982
4157
  import { LingoDotDevEngine } from "@lingo.dev/_sdk";
@@ -4007,7 +4182,7 @@ function createLingoLocalizer(params) {
4007
4182
 
4008
4183
  // src/cli/processor/basic.ts
4009
4184
  import { generateText } from "ai";
4010
- import _24 from "lodash";
4185
+ import _27 from "lodash";
4011
4186
  function createBasicTranslator(model, systemPrompt) {
4012
4187
  return async (input2, onProgress) => {
4013
4188
  const chunks = extractPayloadChunks(input2.processableData);
@@ -4021,7 +4196,7 @@ function createBasicTranslator(model, systemPrompt) {
4021
4196
  subResults.push(result2);
4022
4197
  onProgress(i / chunks.length * 100, chunk, result2);
4023
4198
  }
4024
- const result = _24.merge({}, ...subResults);
4199
+ const result = _27.merge({}, ...subResults);
4025
4200
  return result;
4026
4201
  };
4027
4202
  async function doJob(input2) {
@@ -4133,23 +4308,23 @@ function createProcessor(provider, params) {
4133
4308
  }
4134
4309
  }
4135
4310
  function getPureModelProvider(provider) {
4136
- const createMissingKeyErrorMessage = (providerId, envVar) => dedent`
4137
- You're trying to use raw ${chalk.dim(providerId)} API for translation, however, ${chalk.dim(envVar)} environment variable is not set.
4311
+ const createMissingKeyErrorMessage = (providerId, envVar) => dedent4`
4312
+ You're trying to use raw ${chalk4.dim(providerId)} API for translation, however, ${chalk4.dim(envVar)} environment variable is not set.
4138
4313
 
4139
4314
  To fix this issue:
4140
- 1. Set ${chalk.dim(envVar)} in your environment variables, or
4141
- 2. Remove the ${chalk.italic("provider")} node from your i18n.json configuration to switch to ${chalk.hex(colors.green)("Lingo.dev")}
4315
+ 1. Set ${chalk4.dim(envVar)} in your environment variables, or
4316
+ 2. Remove the ${chalk4.italic("provider")} node from your i18n.json configuration to switch to ${chalk4.hex(colors.green)("Lingo.dev")}
4142
4317
 
4143
- ${chalk.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
4318
+ ${chalk4.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
4144
4319
  `;
4145
- const createUnsupportedProviderErrorMessage = (providerId) => dedent`
4146
- You're trying to use unsupported provider: ${chalk.dim(providerId)}.
4320
+ const createUnsupportedProviderErrorMessage = (providerId) => dedent4`
4321
+ You're trying to use unsupported provider: ${chalk4.dim(providerId)}.
4147
4322
 
4148
4323
  To fix this issue:
4149
4324
  1. Switch to one of the supported providers, or
4150
- 2. Remove the ${chalk.italic("provider")} node from your i18n.json configuration to switch to ${chalk.hex(colors.green)("Lingo.dev")}
4325
+ 2. Remove the ${chalk4.italic("provider")} node from your i18n.json configuration to switch to ${chalk4.hex(colors.green)("Lingo.dev")}
4151
4326
 
4152
- ${chalk.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
4327
+ ${chalk4.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
4153
4328
  `;
4154
4329
  switch (provider?.id) {
4155
4330
  case "openai":
@@ -4230,7 +4405,7 @@ async function trackEvent(distinctId, event, properties) {
4230
4405
  }
4231
4406
 
4232
4407
  // src/cli/utils/delta.ts
4233
- import _25 from "lodash";
4408
+ import _28 from "lodash";
4234
4409
  import z from "zod";
4235
4410
 
4236
4411
  // src/cli/utils/fs.ts
@@ -4279,9 +4454,9 @@ function createDeltaProcessor(fileKey) {
4279
4454
  return checkIfFileExists(lockfilePath);
4280
4455
  },
4281
4456
  async calculateDelta(params) {
4282
- let added = _25.difference(Object.keys(params.sourceData), Object.keys(params.targetData));
4283
- let removed = _25.difference(Object.keys(params.targetData), Object.keys(params.sourceData));
4284
- const updated = _25.filter(Object.keys(params.sourceData), (key) => {
4457
+ let added = _28.difference(Object.keys(params.sourceData), Object.keys(params.targetData));
4458
+ let removed = _28.difference(Object.keys(params.targetData), Object.keys(params.sourceData));
4459
+ const updated = _28.filter(Object.keys(params.sourceData), (key) => {
4285
4460
  return md5(params.sourceData[key]) !== params.checksums[key] && params.checksums[key];
4286
4461
  });
4287
4462
  const renamed = [];
@@ -4330,14 +4505,14 @@ function createDeltaProcessor(fileKey) {
4330
4505
  await this.saveLock(lockfileData);
4331
4506
  },
4332
4507
  async createChecksums(sourceData) {
4333
- const checksums = _25.mapValues(sourceData, (value) => md5(value));
4508
+ const checksums = _28.mapValues(sourceData, (value) => md5(value));
4334
4509
  return checksums;
4335
4510
  }
4336
4511
  };
4337
4512
  }
4338
4513
 
4339
4514
  // src/cli/cmd/i18n.ts
4340
- var i18n_default = new Command6().command("i18n").description("Run Localization engine").helpOption("-h, --help", "Show help").option(
4515
+ var i18n_default = new Command10().command("i18n").description("Run Localization engine").helpOption("-h, --help", "Show help").option(
4341
4516
  "--locale <locale>",
4342
4517
  "Locale to process",
4343
4518
  (val, prev) => prev ? [...prev, val] : [val]
@@ -4502,7 +4677,7 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
4502
4677
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
4503
4678
  const sourceChecksums = await deltaProcessor.createChecksums(sourceData);
4504
4679
  const savedChecksums = await deltaProcessor.loadChecksums();
4505
- const updatedSourceData = _26.pickBy(
4680
+ const updatedSourceData = _29.pickBy(
4506
4681
  sourceData,
4507
4682
  (value, key) => sourceChecksums[key] !== savedChecksums[key]
4508
4683
  );
@@ -4516,15 +4691,15 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
4516
4691
  bucketPath.delimiter
4517
4692
  );
4518
4693
  const { unlocalizable: targetUnlocalizable, ...targetData } = await bucketLoader.pull(targetLocale);
4519
- const missingKeys = _26.difference(
4694
+ const missingKeys = _29.difference(
4520
4695
  Object.keys(sourceData),
4521
4696
  Object.keys(targetData)
4522
4697
  );
4523
- const extraKeys = _26.difference(
4698
+ const extraKeys = _29.difference(
4524
4699
  Object.keys(targetData),
4525
4700
  Object.keys(sourceData)
4526
4701
  );
4527
- const unlocalizableDataDiff = !_26.isEqual(
4702
+ const unlocalizableDataDiff = !_29.isEqual(
4528
4703
  sourceUnlocalizable,
4529
4704
  targetUnlocalizable
4530
4705
  );
@@ -4606,13 +4781,13 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
4606
4781
  targetData,
4607
4782
  checksums: checksums2
4608
4783
  });
4609
- let processableData = _26.chain(sourceData).entries().filter(
4784
+ let processableData = _29.chain(sourceData).entries().filter(
4610
4785
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!flags.force
4611
4786
  ).fromPairs().value();
4612
4787
  if (flags.key) {
4613
- processableData = _26.pickBy(
4788
+ processableData = _29.pickBy(
4614
4789
  processableData,
4615
- (_30, key) => key === flags.key
4790
+ (_33, key) => key === flags.key
4616
4791
  );
4617
4792
  }
4618
4793
  if (flags.verbose) {
@@ -4645,13 +4820,13 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
4645
4820
  if (flags.verbose) {
4646
4821
  bucketOra.info(JSON.stringify(processedTargetData, null, 2));
4647
4822
  }
4648
- let finalTargetData = _26.merge(
4823
+ let finalTargetData = _29.merge(
4649
4824
  {},
4650
4825
  sourceData,
4651
4826
  targetData,
4652
4827
  processedTargetData
4653
4828
  );
4654
- finalTargetData = _26.chain(finalTargetData).entries().map(([key, value]) => {
4829
+ finalTargetData = _29.chain(finalTargetData).entries().map(([key, value]) => {
4655
4830
  const renaming = delta.renamed.find(
4656
4831
  ([oldKey, newKey]) => oldKey === key
4657
4832
  );
@@ -4675,7 +4850,7 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
4675
4850
  `Applying changes to ${bucketPath} (${targetLocale})`
4676
4851
  );
4677
4852
  }
4678
- const finalDiffSize = _26.chain(finalTargetData).omitBy((value, key) => value === targetData[key]).size().value();
4853
+ const finalDiffSize = _29.chain(finalTargetData).omitBy((value, key) => value === targetData[key]).size().value();
4679
4854
  await bucketLoader.push(targetLocale, finalTargetData);
4680
4855
  if (finalDiffSize > 0 || flags.force) {
4681
4856
  bucketOra.succeed(
@@ -4802,7 +4977,7 @@ async function reviewChanges(args) {
4802
4977
  if (currentStr === proposedStr && !args.force) {
4803
4978
  console.log(
4804
4979
  `
4805
- ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.targetLocale)}): ${chalk2.gray("No changes to review")}`
4980
+ ${chalk5.blue(args.pathPattern)} (${chalk5.yellow(args.targetLocale)}): ${chalk5.gray("No changes to review")}`
4806
4981
  );
4807
4982
  return args.proposedData;
4808
4983
  }
@@ -4816,14 +4991,14 @@ ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.targetLocale)}): ${chalk2
4816
4991
  { context: 3 }
4817
4992
  );
4818
4993
  const coloredDiff = patch.split("\n").map((line) => {
4819
- if (line.startsWith("+")) return chalk2.green(line);
4820
- if (line.startsWith("-")) return chalk2.red(line);
4821
- if (line.startsWith("@")) return chalk2.cyan(line);
4994
+ if (line.startsWith("+")) return chalk5.green(line);
4995
+ if (line.startsWith("-")) return chalk5.red(line);
4996
+ if (line.startsWith("@")) return chalk5.cyan(line);
4822
4997
  return line;
4823
4998
  }).join("\n");
4824
4999
  console.log(
4825
5000
  `
4826
- Reviewing changes for ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.targetLocale)}):`
5001
+ Reviewing changes for ${chalk5.blue(args.pathPattern)} (${chalk5.yellow(args.targetLocale)}):`
4827
5002
  );
4828
5003
  console.log(coloredDiff);
4829
5004
  const { action } = await inquirer2.prompt([
@@ -4846,7 +5021,7 @@ Reviewing changes for ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.tar
4846
5021
  return args.currentData;
4847
5022
  }
4848
5023
  const customData = { ...args.currentData };
4849
- const changes = _26.reduce(
5024
+ const changes = _29.reduce(
4850
5025
  args.proposedData,
4851
5026
  (result, value, key) => {
4852
5027
  if (args.currentData[key] !== value) {
@@ -4858,32 +5033,32 @@ Reviewing changes for ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.tar
4858
5033
  );
4859
5034
  for (const key of changes) {
4860
5035
  console.log(`
4861
- Editing value for: ${chalk2.cyan(key)}`);
4862
- console.log(chalk2.gray("Source text:"), chalk2.blue(args.sourceData[key]));
5036
+ Editing value for: ${chalk5.cyan(key)}`);
5037
+ console.log(chalk5.gray("Source text:"), chalk5.blue(args.sourceData[key]));
4863
5038
  console.log(
4864
- chalk2.gray("Current value:"),
4865
- chalk2.red(args.currentData[key] || "(empty)")
5039
+ chalk5.gray("Current value:"),
5040
+ chalk5.red(args.currentData[key] || "(empty)")
4866
5041
  );
4867
5042
  console.log(
4868
- chalk2.gray("Suggested value:"),
4869
- chalk2.green(args.proposedData[key])
5043
+ chalk5.gray("Suggested value:"),
5044
+ chalk5.green(args.proposedData[key])
4870
5045
  );
4871
5046
  console.log(
4872
- chalk2.gray(
5047
+ chalk5.gray(
4873
5048
  "\nYour editor will open. Edit the text and save to continue."
4874
5049
  )
4875
5050
  );
4876
- console.log(chalk2.gray("------------"));
5051
+ console.log(chalk5.gray("------------"));
4877
5052
  try {
4878
5053
  const editorContent = [
4879
5054
  "# Edit the translation below.",
4880
5055
  "# Lines starting with # will be ignored.",
4881
5056
  "# Save and exit the editor to continue.",
4882
5057
  "#",
4883
- `# Source text (${chalk2.blue("English")}):`,
5058
+ `# Source text (${chalk5.blue("English")}):`,
4884
5059
  `# ${args.sourceData[key]}`,
4885
5060
  "#",
4886
- `# Current value (${chalk2.red(args.targetLocale)}):`,
5061
+ `# Current value (${chalk5.red(args.targetLocale)}):`,
4887
5062
  `# ${args.currentData[key] || "(empty)"}`,
4888
5063
  "#",
4889
5064
  args.proposedData[key]
@@ -4894,13 +5069,13 @@ Editing value for: ${chalk2.cyan(key)}`);
4894
5069
  customData[key] = customValue;
4895
5070
  } else {
4896
5071
  console.log(
4897
- chalk2.yellow("Empty value provided, keeping the current value.")
5072
+ chalk5.yellow("Empty value provided, keeping the current value.")
4898
5073
  );
4899
5074
  customData[key] = args.currentData[key] || args.proposedData[key];
4900
5075
  }
4901
5076
  } catch (error) {
4902
5077
  console.log(
4903
- chalk2.red("Error while editing, keeping the suggested value.")
5078
+ chalk5.red("Error while editing, keeping the suggested value.")
4904
5079
  );
4905
5080
  customData[key] = args.proposedData[key];
4906
5081
  }
@@ -4909,7 +5084,7 @@ Editing value for: ${chalk2.cyan(key)}`);
4909
5084
  }
4910
5085
 
4911
5086
  // src/cli/cmd/lockfile.ts
4912
- import { Command as Command7 } from "interactive-commander";
5087
+ import { Command as Command11 } from "interactive-commander";
4913
5088
  import Z5 from "zod";
4914
5089
  import Ora6 from "ora";
4915
5090
 
@@ -4919,7 +5094,7 @@ import path14 from "path";
4919
5094
  import Z4 from "zod";
4920
5095
  import YAML5 from "yaml";
4921
5096
  import { MD5 as MD52 } from "object-hash";
4922
- import _27 from "lodash";
5097
+ import _30 from "lodash";
4923
5098
  function createLockfileHelper() {
4924
5099
  return {
4925
5100
  isLockfileExists: () => {
@@ -4929,23 +5104,23 @@ function createLockfileHelper() {
4929
5104
  registerSourceData: (pathPattern, sourceData) => {
4930
5105
  const lockfile = _loadLockfile();
4931
5106
  const sectionKey = MD52(pathPattern);
4932
- const sectionChecksums = _27.mapValues(sourceData, (value) => MD52(value));
5107
+ const sectionChecksums = _30.mapValues(sourceData, (value) => MD52(value));
4933
5108
  lockfile.checksums[sectionKey] = sectionChecksums;
4934
5109
  _saveLockfile(lockfile);
4935
5110
  },
4936
5111
  registerPartialSourceData: (pathPattern, partialSourceData) => {
4937
5112
  const lockfile = _loadLockfile();
4938
5113
  const sectionKey = MD52(pathPattern);
4939
- const sectionChecksums = _27.mapValues(partialSourceData, (value) => MD52(value));
4940
- lockfile.checksums[sectionKey] = _27.merge({}, lockfile.checksums[sectionKey] ?? {}, sectionChecksums);
5114
+ const sectionChecksums = _30.mapValues(partialSourceData, (value) => MD52(value));
5115
+ lockfile.checksums[sectionKey] = _30.merge({}, lockfile.checksums[sectionKey] ?? {}, sectionChecksums);
4941
5116
  _saveLockfile(lockfile);
4942
5117
  },
4943
5118
  extractUpdatedData: (pathPattern, sourceData) => {
4944
5119
  const lockfile = _loadLockfile();
4945
5120
  const sectionKey = MD52(pathPattern);
4946
- const currentChecksums = _27.mapValues(sourceData, (value) => MD52(value));
5121
+ const currentChecksums = _30.mapValues(sourceData, (value) => MD52(value));
4947
5122
  const savedChecksums = lockfile.checksums[sectionKey] || {};
4948
- const updatedData = _27.pickBy(sourceData, (value, key) => savedChecksums[key] !== currentChecksums[key]);
5123
+ const updatedData = _30.pickBy(sourceData, (value, key) => savedChecksums[key] !== currentChecksums[key]);
4949
5124
  return updatedData;
4950
5125
  }
4951
5126
  };
@@ -4984,7 +5159,7 @@ var LockfileSchema = Z4.object({
4984
5159
 
4985
5160
  // src/cli/cmd/lockfile.ts
4986
5161
  import { resolveOverriddenLocale as resolveOverriddenLocale4 } from "@lingo.dev/_spec";
4987
- var lockfile_default = new Command7().command("lockfile").description("Create a lockfile if it does not exist").helpOption("-h, --help", "Show help").option("-f, --force", "Force create a lockfile").action(async (options) => {
5162
+ var lockfile_default = new Command11().command("lockfile").description("Create a lockfile if it does not exist").helpOption("-h, --help", "Show help").option("-f, --force", "Force create a lockfile").action(async (options) => {
4988
5163
  const flags = flagsSchema.parse(options);
4989
5164
  const ora = Ora6();
4990
5165
  const lockfileHelper = createLockfileHelper();
@@ -5014,10 +5189,10 @@ var flagsSchema = Z5.object({
5014
5189
 
5015
5190
  // src/cli/cmd/cleanup.ts
5016
5191
  import { resolveOverriddenLocale as resolveOverriddenLocale5 } from "@lingo.dev/_spec";
5017
- import { Command as Command8 } from "interactive-commander";
5018
- import _28 from "lodash";
5192
+ import { Command as Command12 } from "interactive-commander";
5193
+ import _31 from "lodash";
5019
5194
  import Ora7 from "ora";
5020
- var cleanup_default = new Command8().command("cleanup").description("Remove keys from target files that do not exist in the source file").helpOption("-h, --help", "Show help").option("--locale <locale>", "Specific locale to cleanup").option("--bucket <bucket>", "Specific bucket to cleanup").option("--dry-run", "Show what would be removed without making changes").option(
5195
+ var cleanup_default = new Command12().command("cleanup").description("Remove keys from target files that do not exist in the source file").helpOption("-h, --help", "Show help").option("--locale <locale>", "Specific locale to cleanup").option("--bucket <bucket>", "Specific bucket to cleanup").option("--dry-run", "Show what would be removed without making changes").option(
5021
5196
  "--verbose",
5022
5197
  "Show detailed output including:\n - List of keys that would be removed.\n - Processing steps."
5023
5198
  ).action(async function(options) {
@@ -5051,7 +5226,7 @@ var cleanup_default = new Command8().command("cleanup").description("Remove keys
5051
5226
  try {
5052
5227
  const targetData = await bucketLoader.pull(targetLocale);
5053
5228
  const targetKeys = Object.keys(targetData);
5054
- const keysToRemove = _28.difference(targetKeys, sourceKeys);
5229
+ const keysToRemove = _31.difference(targetKeys, sourceKeys);
5055
5230
  if (keysToRemove.length === 0) {
5056
5231
  bucketOra.succeed(`[${targetLocale}] No keys to remove`);
5057
5232
  continue;
@@ -5060,7 +5235,7 @@ var cleanup_default = new Command8().command("cleanup").description("Remove keys
5060
5235
  bucketOra.info(`[${targetLocale}] Keys to remove: ${JSON.stringify(keysToRemove, null, 2)}`);
5061
5236
  }
5062
5237
  if (!options.dryRun) {
5063
- const cleanedData = _28.pick(targetData, sourceKeys);
5238
+ const cleanedData = _31.pick(targetData, sourceKeys);
5064
5239
  await bucketLoader.push(targetLocale, cleanedData);
5065
5240
  bucketOra.succeed(`[${targetLocale}] Removed ${keysToRemove.length} keys`);
5066
5241
  } else {
@@ -5110,12 +5285,12 @@ function displaySummary(results) {
5110
5285
  }
5111
5286
 
5112
5287
  // src/cli/cmd/mcp.ts
5113
- import { Command as Command9 } from "interactive-commander";
5288
+ import { Command as Command13 } from "interactive-commander";
5114
5289
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5115
5290
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5116
5291
  import Z6 from "zod";
5117
5292
  import { ReplexicaEngine } from "@lingo.dev/_sdk";
5118
- var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_30, program) => {
5293
+ var mcp_default = new Command13().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_33, program) => {
5119
5294
  const apiKey = program.args[0];
5120
5295
  const settings = getSettings(apiKey);
5121
5296
  if (!settings.auth.apiKey) {
@@ -5163,7 +5338,7 @@ var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model
5163
5338
  });
5164
5339
 
5165
5340
  // src/cli/cmd/ci/index.ts
5166
- import { Command as Command10 } from "interactive-commander";
5341
+ import { Command as Command14 } from "interactive-commander";
5167
5342
  import createOra from "ora";
5168
5343
 
5169
5344
  // src/cli/cmd/ci/flows/pull-request.ts
@@ -5826,7 +6001,7 @@ var getPlatformKit = () => {
5826
6001
  };
5827
6002
 
5828
6003
  // src/cli/cmd/ci/index.ts
5829
- var ci_default = new Command10().command("ci").description("Run Lingo.dev CI/CD action").helpOption("-h, --help", "Show help").option("--api-key <key>", "API key").option("--pull-request [boolean]", "Create a pull request with the changes").option("--commit-message <message>", "Commit message").option("--pull-request-title <title>", "Pull request title").option("--working-directory <dir>", "Working directory").option(
6004
+ var ci_default = new Command14().command("ci").description("Run Lingo.dev CI/CD action").helpOption("-h, --help", "Show help").option("--api-key <key>", "API key").option("--pull-request [boolean]", "Create a pull request with the changes").option("--commit-message <message>", "Commit message").option("--pull-request-title <title>", "Pull request title").option("--working-directory <dir>", "Working directory").option(
5830
6005
  "--process-own-commits [boolean]",
5831
6006
  "Process commits made by this action"
5832
6007
  ).action(async (options) => {
@@ -5879,12 +6054,12 @@ var ci_default = new Command10().command("ci").description("Run Lingo.dev CI/CD
5879
6054
 
5880
6055
  // src/cli/cmd/status.ts
5881
6056
  import { bucketTypeSchema as bucketTypeSchema3, localeCodeSchema as localeCodeSchema2, resolveOverriddenLocale as resolveOverriddenLocale6 } from "@lingo.dev/_spec";
5882
- import { Command as Command11 } from "interactive-commander";
6057
+ import { Command as Command15 } from "interactive-commander";
5883
6058
  import Z11 from "zod";
5884
6059
  import Ora8 from "ora";
5885
- import chalk3 from "chalk";
6060
+ import chalk6 from "chalk";
5886
6061
  import Table from "cli-table3";
5887
- var status_default = new Command11().command("status").description("Show the status of the localization process").helpOption("-h, --help", "Show help").option("--locale <locale>", "Locale to process", (val, prev) => prev ? [...prev, val] : [val]).option("--bucket <bucket>", "Bucket to process", (val, prev) => prev ? [...prev, val] : [val]).option(
6062
+ var status_default = new Command15().command("status").description("Show the status of the localization process").helpOption("-h, --help", "Show help").option("--locale <locale>", "Locale to process", (val, prev) => prev ? [...prev, val] : [val]).option("--bucket <bucket>", "Bucket to process", (val, prev) => prev ? [...prev, val] : [val]).option(
5888
6063
  "--file [files...]",
5889
6064
  "File to process. Process only a specific path, may contain asterisk * to match multiple files."
5890
6065
  ).option("--force", "Ignore lockfile and process all keys, useful for estimating full re-translation").option("--verbose", "Show detailed output including key-level word counts").option("--api-key <api-key>", "Explicitly set the API key to use, override the default API key from settings").action(async function(options) {
@@ -6025,7 +6200,7 @@ var status_default = new Command11().command("status").description("Show the sta
6025
6200
  languageStats[targetLocale].words += sourceWordCount;
6026
6201
  totalWordCount.set(targetLocale, (totalWordCount.get(targetLocale) || 0) + sourceWordCount);
6027
6202
  bucketOra.succeed(
6028
- `[${sourceLocale} -> ${targetLocale}] ${chalk3.red(`0% complete`)} (0/${sourceKeys.length} keys) - file not found`
6203
+ `[${sourceLocale} -> ${targetLocale}] ${chalk6.red(`0% complete`)} (0/${sourceKeys.length} keys) - file not found`
6029
6204
  );
6030
6205
  continue;
6031
6206
  }
@@ -6061,20 +6236,20 @@ var status_default = new Command11().command("status").description("Show the sta
6061
6236
  const completionPercent = (completeKeys.length / totalKeysInFile * 100).toFixed(1);
6062
6237
  if (missingKeys.length === 0 && updatedKeys.length === 0) {
6063
6238
  bucketOra.succeed(
6064
- `[${sourceLocale} -> ${targetLocale}] ${chalk3.green(`100% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`
6239
+ `[${sourceLocale} -> ${targetLocale}] ${chalk6.green(`100% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`
6065
6240
  );
6066
6241
  } else {
6067
- const message = `[${sourceLocale} -> ${targetLocale}] ${parseFloat(completionPercent) > 50 ? chalk3.yellow(`${completionPercent}% complete`) : chalk3.red(`${completionPercent}% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`;
6242
+ const message = `[${sourceLocale} -> ${targetLocale}] ${parseFloat(completionPercent) > 50 ? chalk6.yellow(`${completionPercent}% complete`) : chalk6.red(`${completionPercent}% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`;
6068
6243
  bucketOra.succeed(message);
6069
6244
  if (flags.verbose) {
6070
6245
  if (missingKeys.length > 0) {
6071
- console.log(` ${chalk3.red(`Missing:`)} ${missingKeys.length} keys, ~${wordsToTranslate} words`);
6246
+ console.log(` ${chalk6.red(`Missing:`)} ${missingKeys.length} keys, ~${wordsToTranslate} words`);
6072
6247
  console.log(
6073
- ` ${chalk3.dim(`Example missing: ${missingKeys.slice(0, 2).join(", ")}${missingKeys.length > 2 ? "..." : ""}`)}`
6248
+ ` ${chalk6.dim(`Example missing: ${missingKeys.slice(0, 2).join(", ")}${missingKeys.length > 2 ? "..." : ""}`)}`
6074
6249
  );
6075
6250
  }
6076
6251
  if (updatedKeys.length > 0) {
6077
- console.log(` ${chalk3.yellow(`Updated:`)} ${updatedKeys.length} keys that changed in source`);
6252
+ console.log(` ${chalk6.yellow(`Updated:`)} ${updatedKeys.length} keys that changed in source`);
6078
6253
  }
6079
6254
  }
6080
6255
  }
@@ -6089,16 +6264,16 @@ var status_default = new Command11().command("status").description("Show the sta
6089
6264
  }, 0);
6090
6265
  const totalCompletedKeys = totalSourceKeyCount - totalKeysNeedingTranslation / targetLocales.length;
6091
6266
  console.log();
6092
- ora.succeed(chalk3.green(`Localization status completed.`));
6093
- console.log(chalk3.bold.cyan(`
6267
+ ora.succeed(chalk6.green(`Localization status completed.`));
6268
+ console.log(chalk6.bold.cyan(`
6094
6269
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`));
6095
- console.log(chalk3.bold.cyan(`\u2551 LOCALIZATION STATUS REPORT \u2551`));
6096
- console.log(chalk3.bold.cyan(`\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
6097
- console.log(chalk3.bold(`
6270
+ console.log(chalk6.bold.cyan(`\u2551 LOCALIZATION STATUS REPORT \u2551`));
6271
+ console.log(chalk6.bold.cyan(`\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
6272
+ console.log(chalk6.bold(`
6098
6273
  \u{1F4DD} SOURCE CONTENT:`));
6099
- console.log(`\u2022 Source language: ${chalk3.green(i18nConfig.locale.source)}`);
6100
- console.log(`\u2022 Source keys: ${chalk3.yellow(totalSourceKeyCount.toString())} keys across all files`);
6101
- console.log(chalk3.bold(`
6274
+ console.log(`\u2022 Source language: ${chalk6.green(i18nConfig.locale.source)}`);
6275
+ console.log(`\u2022 Source keys: ${chalk6.yellow(totalSourceKeyCount.toString())} keys across all files`);
6276
+ console.log(chalk6.bold(`
6102
6277
  \u{1F310} LANGUAGE BY LANGUAGE BREAKDOWN:`));
6103
6278
  const table = new Table({
6104
6279
  head: ["Language", "Status", "Complete", "Missing", "Updated", "Total Keys", "Words to Translate"],
@@ -6120,19 +6295,19 @@ var status_default = new Command11().command("status").description("Show the sta
6120
6295
  let statusColor;
6121
6296
  if (stats.missing === totalSourceKeyCount) {
6122
6297
  statusText = "\u{1F534} Not started";
6123
- statusColor = chalk3.red;
6298
+ statusColor = chalk6.red;
6124
6299
  } else if (stats.missing === 0 && stats.updated === 0) {
6125
6300
  statusText = "\u2705 Complete";
6126
- statusColor = chalk3.green;
6301
+ statusColor = chalk6.green;
6127
6302
  } else if (parseFloat(percentComplete) > 80) {
6128
6303
  statusText = "\u{1F7E1} Almost done";
6129
- statusColor = chalk3.yellow;
6304
+ statusColor = chalk6.yellow;
6130
6305
  } else if (parseFloat(percentComplete) > 0) {
6131
6306
  statusText = "\u{1F7E0} In progress";
6132
- statusColor = chalk3.yellow;
6307
+ statusColor = chalk6.yellow;
6133
6308
  } else {
6134
6309
  statusText = "\u{1F534} Not started";
6135
- statusColor = chalk3.red;
6310
+ statusColor = chalk6.red;
6136
6311
  }
6137
6312
  const words = totalWordCount.get(locale) || 0;
6138
6313
  totalWordsToTranslate += words;
@@ -6140,17 +6315,17 @@ var status_default = new Command11().command("status").description("Show the sta
6140
6315
  locale,
6141
6316
  statusColor(statusText),
6142
6317
  `${stats.complete}/${totalSourceKeyCount} (${percentComplete}%)`,
6143
- stats.missing > 0 ? chalk3.red(stats.missing.toString()) : "0",
6144
- stats.updated > 0 ? chalk3.yellow(stats.updated.toString()) : "0",
6145
- totalNeeded > 0 ? chalk3.magenta(totalNeeded.toString()) : "0",
6318
+ stats.missing > 0 ? chalk6.red(stats.missing.toString()) : "0",
6319
+ stats.updated > 0 ? chalk6.yellow(stats.updated.toString()) : "0",
6320
+ totalNeeded > 0 ? chalk6.magenta(totalNeeded.toString()) : "0",
6146
6321
  words > 0 ? `~${words.toLocaleString()}` : "0"
6147
6322
  ]);
6148
6323
  }
6149
6324
  console.log(table.toString());
6150
- console.log(chalk3.bold(`
6325
+ console.log(chalk6.bold(`
6151
6326
  \u{1F4CA} USAGE ESTIMATE:`));
6152
6327
  console.log(
6153
- `\u2022 WORDS TO BE CONSUMED: ~${chalk3.yellow.bold(totalWordsToTranslate.toLocaleString())} words across all languages`
6328
+ `\u2022 WORDS TO BE CONSUMED: ~${chalk6.yellow.bold(totalWordsToTranslate.toLocaleString())} words across all languages`
6154
6329
  );
6155
6330
  console.log(` (Words are counted from source language for keys that need translation in target languages)`);
6156
6331
  if (targetLocales.length > 1) {
@@ -6162,11 +6337,11 @@ var status_default = new Command11().command("status").description("Show the sta
6162
6337
  }
6163
6338
  }
6164
6339
  if (flags.confirm && Object.keys(fileStats).length > 0) {
6165
- console.log(chalk3.bold(`
6340
+ console.log(chalk6.bold(`
6166
6341
  \u{1F4D1} BREAKDOWN BY FILE:`));
6167
6342
  Object.entries(fileStats).sort((a, b) => b[1].wordCount - a[1].wordCount).forEach(([path16, stats]) => {
6168
6343
  if (stats.sourceKeys === 0) return;
6169
- console.log(chalk3.bold(`
6344
+ console.log(chalk6.bold(`
6170
6345
  \u2022 ${path16}:`));
6171
6346
  console.log(` ${stats.sourceKeys} source keys, ~${stats.wordCount.toLocaleString()} source words`);
6172
6347
  const fileTable = new Table({
@@ -6184,13 +6359,13 @@ var status_default = new Command11().command("status").description("Show the sta
6184
6359
  const total = stats.sourceKeys;
6185
6360
  const completion = (complete / total * 100).toFixed(1);
6186
6361
  let status = "\u2705 Complete";
6187
- let statusColor = chalk3.green;
6362
+ let statusColor = chalk6.green;
6188
6363
  if (langStats.missing === total) {
6189
6364
  status = "\u274C Not started";
6190
- statusColor = chalk3.red;
6365
+ statusColor = chalk6.red;
6191
6366
  } else if (langStats.missing > 0 || langStats.updated > 0) {
6192
6367
  status = `\u26A0\uFE0F ${completion}% complete`;
6193
- statusColor = chalk3.yellow;
6368
+ statusColor = chalk6.yellow;
6194
6369
  }
6195
6370
  let details = "";
6196
6371
  if (langStats.missing > 0 || langStats.updated > 0) {
@@ -6210,16 +6385,16 @@ var status_default = new Command11().command("status").description("Show the sta
6210
6385
  (locale) => languageStats[locale].missing === 0 && languageStats[locale].updated === 0
6211
6386
  );
6212
6387
  const missingLanguages = targetLocales.filter((locale) => languageStats[locale].complete === 0);
6213
- console.log(chalk3.bold.green(`
6388
+ console.log(chalk6.bold.green(`
6214
6389
  \u{1F4A1} OPTIMIZATION TIPS:`));
6215
6390
  if (missingLanguages.length > 0) {
6216
6391
  console.log(
6217
- `\u2022 ${chalk3.yellow(missingLanguages.join(", "))} ${missingLanguages.length === 1 ? "has" : "have"} no translations yet`
6392
+ `\u2022 ${chalk6.yellow(missingLanguages.join(", "))} ${missingLanguages.length === 1 ? "has" : "have"} no translations yet`
6218
6393
  );
6219
6394
  }
6220
6395
  if (completeLanguages.length > 0) {
6221
6396
  console.log(
6222
- `\u2022 ${chalk3.green(completeLanguages.join(", "))} ${completeLanguages.length === 1 ? "is" : "are"} completely translated`
6397
+ `\u2022 ${chalk6.green(completeLanguages.join(", "))} ${completeLanguages.length === 1 ? "is" : "are"} completely translated`
6223
6398
  );
6224
6399
  }
6225
6400
  if (targetLocales.length > 1) {
@@ -6295,10 +6470,10 @@ function validateParams2(i18nConfig, flags) {
6295
6470
  }
6296
6471
 
6297
6472
  // src/cli/cmd/may-the-fourth.ts
6298
- import { Command as Command12 } from "interactive-commander";
6473
+ import { Command as Command16 } from "interactive-commander";
6299
6474
  import * as cp from "node:child_process";
6300
6475
  import figlet from "figlet";
6301
- import chalk4 from "chalk";
6476
+ import chalk7 from "chalk";
6302
6477
  import { vice } from "gradient-string";
6303
6478
  var colors2 = {
6304
6479
  orange: "#ff6600",
@@ -6308,11 +6483,11 @@ var colors2 = {
6308
6483
  grey: "#808080",
6309
6484
  red: "#ff0000"
6310
6485
  };
6311
- var may_the_fourth_default = new Command12().command("may-the-fourth").description("May the Fourth be with you").helpOption("-h, --help", "Show help").action(async () => {
6486
+ var may_the_fourth_default = new Command16().command("may-the-fourth").description("May the Fourth be with you").helpOption("-h, --help", "Show help").action(async () => {
6312
6487
  await renderClear();
6313
6488
  await renderBanner();
6314
6489
  await renderSpacer();
6315
- console.log(chalk4.hex(colors2.yellow)("Loading the Star Wars movie..."));
6490
+ console.log(chalk7.hex(colors2.yellow)("Loading the Star Wars movie..."));
6316
6491
  await renderSpacer();
6317
6492
  await new Promise((resolve, reject) => {
6318
6493
  const ssh = cp.spawn("ssh", ["starwarstel.net"], {
@@ -6331,10 +6506,10 @@ var may_the_fourth_default = new Command12().command("may-the-fourth").descripti
6331
6506
  });
6332
6507
  await renderSpacer();
6333
6508
  console.log(
6334
- `${chalk4.hex(colors2.green)("We hope you enjoyed it! :)")} ${chalk4.hex(colors2.blue)("May the Fourth be with you! \u{1F680}")}`
6509
+ `${chalk7.hex(colors2.green)("We hope you enjoyed it! :)")} ${chalk7.hex(colors2.blue)("May the Fourth be with you! \u{1F680}")}`
6335
6510
  );
6336
6511
  await renderSpacer();
6337
- console.log(chalk4.dim(`---`));
6512
+ console.log(chalk7.dim(`---`));
6338
6513
  await renderSpacer();
6339
6514
  await renderHero();
6340
6515
  });
@@ -6357,19 +6532,19 @@ async function renderBanner() {
6357
6532
  }
6358
6533
  async function renderHero() {
6359
6534
  console.log(
6360
- `\u26A1\uFE0F ${chalk4.hex(colors2.green)("Lingo.dev")} - open-source, AI-powered i18n CLI for web & mobile localization.`
6535
+ `\u26A1\uFE0F ${chalk7.hex(colors2.green)("Lingo.dev")} - open-source, AI-powered i18n CLI for web & mobile localization.`
6361
6536
  );
6362
6537
  console.log(" ");
6363
6538
  console.log(
6364
- chalk4.hex(colors2.blue)("\u2B50 GitHub Repo: https://lingo.dev/go/gh")
6539
+ chalk7.hex(colors2.blue)("\u2B50 GitHub Repo: https://lingo.dev/go/gh")
6365
6540
  );
6366
- console.log(chalk4.hex(colors2.blue)("\u{1F4AC} 24/7 Support: hi@lingo.dev"));
6541
+ console.log(chalk7.hex(colors2.blue)("\u{1F4AC} 24/7 Support: hi@lingo.dev"));
6367
6542
  }
6368
6543
 
6369
6544
  // package.json
6370
6545
  var package_default = {
6371
6546
  name: "lingo.dev",
6372
- version: "0.92.16",
6547
+ version: "0.92.17",
6373
6548
  description: "Lingo.dev CLI",
6374
6549
  private: false,
6375
6550
  publishConfig: {
@@ -6537,39 +6712,39 @@ var package_default = {
6537
6712
  };
6538
6713
 
6539
6714
  // src/cli/cmd/run/index.ts
6540
- import { Command as Command13 } from "interactive-commander";
6715
+ import { Command as Command17 } from "interactive-commander";
6541
6716
 
6542
6717
  // src/cli/cmd/run/setup.ts
6543
- import chalk8 from "chalk";
6718
+ import chalk11 from "chalk";
6544
6719
  import { Listr } from "listr2";
6545
6720
 
6546
6721
  // src/cli/cmd/run/_const.ts
6547
- import chalk5 from "chalk";
6722
+ import chalk8 from "chalk";
6548
6723
  import { ListrDefaultRendererLogLevels } from "listr2";
6549
6724
  var commonTaskRendererOptions = {
6550
6725
  color: {
6551
- [ListrDefaultRendererLogLevels.COMPLETED]: (msg) => msg ? chalk5.hex(colors.green)(msg) : chalk5.hex(colors.green)("")
6726
+ [ListrDefaultRendererLogLevels.COMPLETED]: (msg) => msg ? chalk8.hex(colors.green)(msg) : chalk8.hex(colors.green)("")
6552
6727
  },
6553
6728
  icon: {
6554
- [ListrDefaultRendererLogLevels.COMPLETED]: chalk5.hex(colors.green)("\u2713")
6729
+ [ListrDefaultRendererLogLevels.COMPLETED]: chalk8.hex(colors.green)("\u2713")
6555
6730
  }
6556
6731
  };
6557
6732
 
6558
6733
  // src/cli/localizer/lingodotdev.ts
6559
- import dedent2 from "dedent";
6560
- import chalk6 from "chalk";
6734
+ import dedent5 from "dedent";
6735
+ import chalk9 from "chalk";
6561
6736
  import { LingoDotDevEngine as LingoDotDevEngine2 } from "@lingo.dev/_sdk";
6562
6737
  function createLingoDotDevLocalizer(explicitApiKey) {
6563
6738
  const { auth } = getSettings(explicitApiKey);
6564
6739
  if (!auth) {
6565
6740
  throw new Error(
6566
- dedent2`
6567
- You're trying to use ${chalk6.hex(colors.green)("Lingo.dev")} provider, however, you are not authenticated.
6741
+ dedent5`
6742
+ You're trying to use ${chalk9.hex(colors.green)("Lingo.dev")} provider, however, you are not authenticated.
6568
6743
 
6569
6744
  To fix this issue:
6570
- 1. Run ${chalk6.dim("lingo.dev login")} to authenticate, or
6571
- 2. Use the ${chalk6.dim("--api-key")} flag to provide an API key.
6572
- 3. Set ${chalk6.dim("LINGODOTDEV_API_KEY")} environment variable.
6745
+ 1. Run ${chalk9.dim("lingo.dev login")} to authenticate, or
6746
+ 2. Use the ${chalk9.dim("--api-key")} flag to provide an API key.
6747
+ 3. Set ${chalk9.dim("LINGODOTDEV_API_KEY")} environment variable.
6573
6748
  `
6574
6749
  );
6575
6750
  }
@@ -6614,22 +6789,22 @@ function createLingoDotDevLocalizer(explicitApiKey) {
6614
6789
  // src/cli/localizer/explicit.ts
6615
6790
  import { createAnthropic as createAnthropic2 } from "@ai-sdk/anthropic";
6616
6791
  import { createOpenAI as createOpenAI2 } from "@ai-sdk/openai";
6617
- import chalk7 from "chalk";
6618
- import dedent3 from "dedent";
6792
+ import chalk10 from "chalk";
6793
+ import dedent6 from "dedent";
6619
6794
  import { generateText as generateText2 } from "ai";
6620
6795
  import { jsonrepair as jsonrepair3 } from "jsonrepair";
6621
6796
  function createExplicitLocalizer(provider) {
6622
6797
  switch (provider.id) {
6623
6798
  default:
6624
6799
  throw new Error(
6625
- dedent3`
6626
- You're trying to use unsupported provider: ${chalk7.dim(provider.id)}.
6800
+ dedent6`
6801
+ You're trying to use unsupported provider: ${chalk10.dim(provider.id)}.
6627
6802
 
6628
6803
  To fix this issue:
6629
6804
  1. Switch to one of the supported providers, or
6630
- 2. Remove the ${chalk7.italic("provider")} node from your i18n.json configuration to switch to ${chalk7.hex(colors.green)("Lingo.dev")}
6805
+ 2. Remove the ${chalk10.italic("provider")} node from your i18n.json configuration to switch to ${chalk10.hex(colors.green)("Lingo.dev")}
6631
6806
 
6632
- ${chalk7.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
6807
+ ${chalk10.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
6633
6808
  `
6634
6809
  );
6635
6810
  case "openai":
@@ -6654,14 +6829,14 @@ function createAiSdkLocalizer(params) {
6654
6829
  const apiKey = process.env[params.apiKeyName];
6655
6830
  if (!apiKey) {
6656
6831
  throw new Error(
6657
- dedent3`
6658
- You're trying to use raw ${chalk7.dim(params.id)} API for translation, however, ${chalk7.dim(params.apiKeyName)} environment variable is not set.
6832
+ dedent6`
6833
+ You're trying to use raw ${chalk10.dim(params.id)} API for translation, however, ${chalk10.dim(params.apiKeyName)} environment variable is not set.
6659
6834
 
6660
6835
  To fix this issue:
6661
- 1. Set ${chalk7.dim(params.apiKeyName)} in your environment variables, or
6662
- 2. Remove the ${chalk7.italic("provider")} node from your i18n.json configuration to switch to ${chalk7.hex(colors.green)("Lingo.dev")}
6836
+ 1. Set ${chalk10.dim(params.apiKeyName)} in your environment variables, or
6837
+ 2. Remove the ${chalk10.italic("provider")} node from your i18n.json configuration to switch to ${chalk10.hex(colors.green)("Lingo.dev")}
6663
6838
 
6664
- ${chalk7.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
6839
+ ${chalk10.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
6665
6840
  `
6666
6841
  );
6667
6842
  }
@@ -6748,7 +6923,7 @@ function createLocalizer(provider) {
6748
6923
 
6749
6924
  // src/cli/cmd/run/setup.ts
6750
6925
  async function setup(input2) {
6751
- console.log(chalk8.hex(colors.orange)("[Setup]"));
6926
+ console.log(chalk11.hex(colors.orange)("[Setup]"));
6752
6927
  return new Listr(
6753
6928
  [
6754
6929
  {
@@ -6794,7 +6969,7 @@ async function setup(input2) {
6794
6969
  "Could not create localization provider. Please check your i18n.json configuration."
6795
6970
  );
6796
6971
  }
6797
- task.title = ctx.localizer.id === "Lingo.dev" ? `Using ${chalk8.hex(colors.green)(ctx.localizer.id)} provider` : `Using raw ${chalk8.hex(colors.yellow)(ctx.localizer.id)} API`;
6972
+ task.title = ctx.localizer.id === "Lingo.dev" ? `Using ${chalk11.hex(colors.green)(ctx.localizer.id)} provider` : `Using raw ${chalk11.hex(colors.yellow)(ctx.localizer.id)} API`;
6798
6973
  }
6799
6974
  },
6800
6975
  {
@@ -6803,10 +6978,10 @@ async function setup(input2) {
6803
6978
  const authStatus = await ctx.localizer.checkAuth();
6804
6979
  if (!authStatus.authenticated) {
6805
6980
  throw new Error(
6806
- `Failed to authenticate with ${chalk8.hex(colors.yellow)(ctx.localizer.id)} provider. Please check your API key and try again.`
6981
+ `Failed to authenticate with ${chalk11.hex(colors.yellow)(ctx.localizer.id)} provider. Please check your API key and try again.`
6807
6982
  );
6808
6983
  }
6809
- task.title = `Authenticated as ${chalk8.hex(colors.yellow)(authStatus.username)}`;
6984
+ task.title = `Authenticated as ${chalk11.hex(colors.yellow)(authStatus.username)}`;
6810
6985
  }
6811
6986
  },
6812
6987
  {
@@ -6840,11 +7015,11 @@ async function setup(input2) {
6840
7015
  }
6841
7016
 
6842
7017
  // src/cli/cmd/run/plan.ts
6843
- import chalk9 from "chalk";
7018
+ import chalk12 from "chalk";
6844
7019
  import { Listr as Listr2 } from "listr2";
6845
7020
  import { resolveOverriddenLocale as resolveOverriddenLocale7 } from "@lingo.dev/_spec";
6846
7021
  async function plan(input2) {
6847
- console.log(chalk9.hex(colors.orange)("[Planning]"));
7022
+ console.log(chalk12.hex(colors.orange)("[Planning]"));
6848
7023
  let buckets = getBuckets(input2.config);
6849
7024
  if (input2.flags.bucket) {
6850
7025
  buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
@@ -6859,8 +7034,8 @@ async function plan(input2) {
6859
7034
  title: "Locating content buckets",
6860
7035
  task: async (ctx, task) => {
6861
7036
  const bucketCount = buckets.length;
6862
- const bucketFilter = input2.flags.bucket ? ` ${chalk9.dim(`(filtered by: ${chalk9.hex(colors.yellow)(input2.flags.bucket.join(", "))})`)}` : "";
6863
- task.title = `Found ${chalk9.hex(colors.yellow)(bucketCount.toString())} bucket(s)${bucketFilter}`;
7037
+ const bucketFilter = input2.flags.bucket ? ` ${chalk12.dim(`(filtered by: ${chalk12.hex(colors.yellow)(input2.flags.bucket.join(", "))})`)}` : "";
7038
+ task.title = `Found ${chalk12.hex(colors.yellow)(bucketCount.toString())} bucket(s)${bucketFilter}`;
6864
7039
  }
6865
7040
  },
6866
7041
  {
@@ -6871,8 +7046,8 @@ async function plan(input2) {
6871
7046
  `No target locales found in config. Please add locales to your i18n.json config file.`
6872
7047
  );
6873
7048
  }
6874
- const localeFilter = input2.flags.locale ? ` ${chalk9.dim(`(filtered by: ${chalk9.hex(colors.yellow)(input2.flags.locale.join(", "))})`)}` : "";
6875
- task.title = `Found ${chalk9.hex(colors.yellow)(locales.length.toString())} target locale(s)${localeFilter}`;
7049
+ const localeFilter = input2.flags.locale ? ` ${chalk12.dim(`(filtered by: ${chalk12.hex(colors.yellow)(input2.flags.locale.join(", "))})`)}` : "";
7050
+ task.title = `Found ${chalk12.hex(colors.yellow)(locales.length.toString())} target locale(s)${localeFilter}`;
6876
7051
  }
6877
7052
  },
6878
7053
  {
@@ -6891,8 +7066,8 @@ async function plan(input2) {
6891
7066
  patterns.push(bucketPath.pathPattern);
6892
7067
  }
6893
7068
  }
6894
- const fileFilter = input2.flags.file ? ` ${chalk9.dim(`(filtered by: ${chalk9.hex(colors.yellow)(input2.flags.file.join(", "))})`)}` : "";
6895
- task.title = `Found ${chalk9.hex(colors.yellow)(patterns.length.toString())} path pattern(s)${fileFilter}`;
7069
+ const fileFilter = input2.flags.file ? ` ${chalk12.dim(`(filtered by: ${chalk12.hex(colors.yellow)(input2.flags.file.join(", "))})`)}` : "";
7070
+ task.title = `Found ${chalk12.hex(colors.yellow)(patterns.length.toString())} path pattern(s)${fileFilter}`;
6896
7071
  }
6897
7072
  },
6898
7073
  {
@@ -6929,7 +7104,7 @@ async function plan(input2) {
6929
7104
  }
6930
7105
  }
6931
7106
  }
6932
- task.title = `Prepared ${chalk9.hex(colors.green)(ctx.tasks.length.toString())} translation task(s)`;
7107
+ task.title = `Prepared ${chalk12.hex(colors.green)(ctx.tasks.length.toString())} translation task(s)`;
6933
7108
  }
6934
7109
  }
6935
7110
  ],
@@ -6940,10 +7115,10 @@ async function plan(input2) {
6940
7115
  }
6941
7116
 
6942
7117
  // src/cli/cmd/run/execute.ts
6943
- import chalk10 from "chalk";
7118
+ import chalk13 from "chalk";
6944
7119
  import { Listr as Listr3 } from "listr2";
6945
7120
  import pLimit from "p-limit";
6946
- import _29 from "lodash";
7121
+ import _32 from "lodash";
6947
7122
  var MAX_WORKER_COUNT = 10;
6948
7123
  async function execute(input2) {
6949
7124
  const effectiveConcurrency = Math.min(
@@ -6951,17 +7126,17 @@ async function execute(input2) {
6951
7126
  input2.tasks.length,
6952
7127
  MAX_WORKER_COUNT
6953
7128
  );
6954
- console.log(chalk10.hex(colors.orange)(`[Localization]`));
7129
+ console.log(chalk13.hex(colors.orange)(`[Localization]`));
6955
7130
  return new Listr3(
6956
7131
  [
6957
7132
  {
6958
7133
  title: "Initializing localization engine",
6959
7134
  task: async (ctx, task) => {
6960
- task.title = `Localization engine ${chalk10.hex(colors.green)("ready")} (${ctx.localizer.id})`;
7135
+ task.title = `Localization engine ${chalk13.hex(colors.green)("ready")} (${ctx.localizer.id})`;
6961
7136
  }
6962
7137
  },
6963
7138
  {
6964
- title: `Processing localization tasks ${chalk10.dim(`(tasks: ${input2.tasks.length}, concurrency: ${effectiveConcurrency})`)}`,
7139
+ title: `Processing localization tasks ${chalk13.dim(`(tasks: ${input2.tasks.length}, concurrency: ${effectiveConcurrency})`)}`,
6965
7140
  task: (ctx, task) => {
6966
7141
  if (input2.tasks.length < 1) {
6967
7142
  task.title = `Skipping, nothing to localize.`;
@@ -6974,7 +7149,7 @@ async function execute(input2) {
6974
7149
  const workerTasks = [];
6975
7150
  for (let i = 0; i < workersCount; i++) {
6976
7151
  const assignedTasks = ctx.tasks.filter(
6977
- (_30, idx) => idx % workersCount === i
7152
+ (_33, idx) => idx % workersCount === i
6978
7153
  );
6979
7154
  workerTasks.push(
6980
7155
  createWorkerTask({
@@ -7010,9 +7185,9 @@ function createWorkerStatusMessage(args) {
7010
7185
  "[locale]",
7011
7186
  args.assignedTask.targetLocale
7012
7187
  );
7013
- return `[${chalk10.hex(colors.yellow)(`${args.percentage}%`)}] Processing: ${chalk10.dim(
7188
+ return `[${chalk13.hex(colors.yellow)(`${args.percentage}%`)}] Processing: ${chalk13.dim(
7014
7189
  displayPath
7015
- )} (${chalk10.hex(colors.yellow)(args.assignedTask.sourceLocale)} -> ${chalk10.hex(
7190
+ )} (${chalk13.hex(colors.yellow)(args.assignedTask.sourceLocale)} -> ${chalk13.hex(
7016
7191
  colors.yellow
7017
7192
  )(args.assignedTask.targetLocale)})`;
7018
7193
  }
@@ -7029,7 +7204,7 @@ function createExecutionProgressMessage(ctx) {
7029
7204
  ctx,
7030
7205
  (_t, result) => result.status === "skipped"
7031
7206
  );
7032
- return `Processed ${chalk10.green(succeededTasksCount)}/${ctx.tasks.length}, Failed ${chalk10.red(failedTasksCount)}, Skipped ${chalk10.dim(skippedTasksCount)}`;
7207
+ return `Processed ${chalk13.green(succeededTasksCount)}/${ctx.tasks.length}, Failed ${chalk13.red(failedTasksCount)}, Skipped ${chalk13.dim(skippedTasksCount)}`;
7033
7208
  }
7034
7209
  function createLoaderForTask(assignedTask) {
7035
7210
  const bucketLoader = createBucketLoader(
@@ -7073,7 +7248,7 @@ function createWorkerTask(args) {
7073
7248
  targetData,
7074
7249
  checksums
7075
7250
  });
7076
- const processableData = _29.chain(sourceData).entries().filter(
7251
+ const processableData = _32.chain(sourceData).entries().filter(
7077
7252
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
7078
7253
  ).fromPairs().value();
7079
7254
  if (!Object.keys(processableData).length) {
@@ -7094,13 +7269,13 @@ function createWorkerTask(args) {
7094
7269
  });
7095
7270
  }
7096
7271
  );
7097
- let finalTargetData = _29.merge(
7272
+ let finalTargetData = _32.merge(
7098
7273
  {},
7099
7274
  sourceData,
7100
7275
  targetData,
7101
7276
  processedTargetData
7102
7277
  );
7103
- finalTargetData = _29.chain(finalTargetData).entries().map(([key, value]) => {
7278
+ finalTargetData = _32.chain(finalTargetData).entries().map(([key, value]) => {
7104
7279
  const renaming = delta.renamed.find(
7105
7280
  ([oldKey]) => oldKey === key
7106
7281
  );
@@ -7160,7 +7335,7 @@ var flagsSchema2 = z2.object({
7160
7335
  });
7161
7336
 
7162
7337
  // src/cli/cmd/run/_render.ts
7163
- import chalk11 from "chalk";
7338
+ import chalk14 from "chalk";
7164
7339
  import figlet2 from "figlet";
7165
7340
  import { vice as vice2 } from "gradient-string";
7166
7341
  import readline2 from "readline";
@@ -7183,7 +7358,7 @@ async function renderBanner2() {
7183
7358
  }
7184
7359
  async function renderHero2() {
7185
7360
  console.log(
7186
- `\u26A1\uFE0F ${chalk11.hex(colors.green)("Lingo.dev")} - open-source, AI-powered i18n CLI for web & mobile localization.`
7361
+ `\u26A1\uFE0F ${chalk14.hex(colors.green)("Lingo.dev")} - open-source, AI-powered i18n CLI for web & mobile localization.`
7187
7362
  );
7188
7363
  console.log("");
7189
7364
  const label1 = "\u2B50 GitHub Repo:";
@@ -7191,13 +7366,13 @@ async function renderHero2() {
7191
7366
  const label3 = "\u{1F4AC} 24/7 Support:";
7192
7367
  const maxLabelWidth = 17;
7193
7368
  console.log(
7194
- `${chalk11.hex(colors.blue)(label1.padEnd(maxLabelWidth))} ${chalk11.hex(colors.blue)("https://lingo.dev/go/gh")}`
7369
+ `${chalk14.hex(colors.blue)(label1.padEnd(maxLabelWidth))} ${chalk14.hex(colors.blue)("https://lingo.dev/go/gh")}`
7195
7370
  );
7196
7371
  console.log(
7197
- `${chalk11.hex(colors.blue)(label2.padEnd(maxLabelWidth + 1))} ${chalk11.hex(colors.blue)("https://lingo.dev/go/docs")}`
7372
+ `${chalk14.hex(colors.blue)(label2.padEnd(maxLabelWidth + 1))} ${chalk14.hex(colors.blue)("https://lingo.dev/go/docs")}`
7198
7373
  );
7199
7374
  console.log(
7200
- `${chalk11.hex(colors.blue)(label3.padEnd(maxLabelWidth + 1))} ${chalk11.hex(colors.blue)("hi@lingo.dev")}`
7375
+ `${chalk14.hex(colors.blue)(label3.padEnd(maxLabelWidth + 1))} ${chalk14.hex(colors.blue)("hi@lingo.dev")}`
7201
7376
  );
7202
7377
  }
7203
7378
  async function pauseIfDebug(debug) {
@@ -7211,7 +7386,7 @@ async function waitForUserPrompt(message) {
7211
7386
  output: process.stdout
7212
7387
  });
7213
7388
  return new Promise((resolve) => {
7214
- rl.question(chalk11.dim(`[${message}]
7389
+ rl.question(chalk14.dim(`[${message}]
7215
7390
  `), () => {
7216
7391
  rl.close();
7217
7392
  resolve();
@@ -7219,23 +7394,23 @@ async function waitForUserPrompt(message) {
7219
7394
  });
7220
7395
  }
7221
7396
  async function renderSummary(ctx) {
7222
- console.log(chalk11.hex(colors.green)("[Done]"));
7397
+ console.log(chalk14.hex(colors.green)("[Done]"));
7223
7398
  const skippedTasksCount = Array.from(ctx.results.values()).filter(
7224
7399
  (r) => r.status === "skipped"
7225
7400
  ).length;
7226
- console.log(`\u2022 ${chalk11.hex(colors.yellow)(skippedTasksCount)} from cache`);
7401
+ console.log(`\u2022 ${chalk14.hex(colors.yellow)(skippedTasksCount)} from cache`);
7227
7402
  const succeededTasksCount = Array.from(ctx.results.values()).filter(
7228
7403
  (r) => r.status === "success"
7229
7404
  ).length;
7230
- console.log(`\u2022 ${chalk11.hex(colors.yellow)(succeededTasksCount)} processed`);
7405
+ console.log(`\u2022 ${chalk14.hex(colors.yellow)(succeededTasksCount)} processed`);
7231
7406
  const failedTasksCount = Array.from(ctx.results.values()).filter(
7232
7407
  (r) => r.status === "error"
7233
7408
  ).length;
7234
- console.log(`\u2022 ${chalk11.hex(colors.yellow)(failedTasksCount)} failed`);
7409
+ console.log(`\u2022 ${chalk14.hex(colors.yellow)(failedTasksCount)} failed`);
7235
7410
  }
7236
7411
 
7237
7412
  // src/cli/cmd/run/index.ts
7238
- var run_default = new Command13().command("run").description("Run Lingo.dev localization engine").helpOption("-h, --help", "Show help").option(
7413
+ var run_default = new Command17().command("run").description("Run Lingo.dev localization engine").helpOption("-h, --help", "Show help").option(
7239
7414
  "--locale <locale>",
7240
7415
  "Locale to process",
7241
7416
  (val, prev) => prev ? [...prev, val] : [val]
@@ -7309,7 +7484,7 @@ ${vice3(
7309
7484
 
7310
7485
  Star the the repo :) https://github.com/LingoDotDev/lingo.dev
7311
7486
  `
7312
- ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).addCommand(may_the_fourth_default, { hidden: true }).addCommand(run_default, { hidden: true }).exitOverride((err) => {
7487
+ ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(config_default2).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).addCommand(may_the_fourth_default, { hidden: true }).addCommand(run_default, { hidden: true }).exitOverride((err) => {
7313
7488
  if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
7314
7489
  process.exit(0);
7315
7490
  }