@lingo.dev/_spec 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -196,6 +196,20 @@
196
196
  "items": {
197
197
  "type": "string"
198
198
  }
199
+ },
200
+ "preservedKeys": {
201
+ "description": "Keys that are added to targets using source values as placeholders, but once present, are never overwritten by the CLI.",
202
+ "type": "array",
203
+ "items": {
204
+ "type": "string"
205
+ }
206
+ },
207
+ "localizableKeys": {
208
+ "description": "Keys whose values should always be sent for translation, even if they would normally be skipped as untranslatable (e.g. pure numbers, URLs, dates). Use this to force-translate values that have custom glossary rules.",
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string"
212
+ }
199
213
  }
200
214
  },
201
215
  "required": [
package/build/index.cjs CHANGED
@@ -753,7 +753,55 @@ var configV1_11Definition = extendConfigDefinition(
753
753
  })
754
754
  }
755
755
  );
756
- var LATEST_CONFIG_DEFINITION = configV1_11Definition;
756
+ var bucketValueSchemaV1_12 = bucketValueSchemaV1_8.extend({
757
+ preservedKeys: _zod2.default.array(_zod2.default.string()).optional().describe(
758
+ "Keys that are added to targets using source values as placeholders, but once present, are never overwritten by the CLI."
759
+ )
760
+ });
761
+ var configV1_12Definition = extendConfigDefinition(
762
+ configV1_11Definition,
763
+ {
764
+ createSchema: (baseSchema) => baseSchema.extend({
765
+ buckets: _zod2.default.partialRecord(
766
+ bucketTypeSchema,
767
+ bucketValueSchemaV1_12
768
+ ).default({})
769
+ }),
770
+ createDefaultValue: (baseDefaultValue) => ({
771
+ ...baseDefaultValue,
772
+ version: "1.12"
773
+ }),
774
+ createUpgrader: (oldConfig) => ({
775
+ ...oldConfig,
776
+ version: "1.12"
777
+ })
778
+ }
779
+ );
780
+ var bucketValueSchemaV1_13 = bucketValueSchemaV1_12.extend({
781
+ localizableKeys: _zod2.default.array(_zod2.default.string()).optional().describe(
782
+ "Keys whose values should always be sent for translation, even if they would normally be skipped as untranslatable (e.g. pure numbers, URLs, dates). Use this to force-translate values that have custom glossary rules."
783
+ )
784
+ });
785
+ var configV1_13Definition = extendConfigDefinition(
786
+ configV1_12Definition,
787
+ {
788
+ createSchema: (baseSchema) => baseSchema.extend({
789
+ buckets: _zod2.default.partialRecord(
790
+ bucketTypeSchema,
791
+ bucketValueSchemaV1_13
792
+ ).default({})
793
+ }),
794
+ createDefaultValue: (baseDefaultValue) => ({
795
+ ...baseDefaultValue,
796
+ version: "1.13"
797
+ }),
798
+ createUpgrader: (oldConfig) => ({
799
+ ...oldConfig,
800
+ version: "1.13"
801
+ })
802
+ }
803
+ );
804
+ var LATEST_CONFIG_DEFINITION = configV1_13Definition;
757
805
  function parseI18nConfig(rawConfig) {
758
806
  try {
759
807
  const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
@@ -798,4 +846,8 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
798
846
 
799
847
 
800
848
 
801
- exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; exports.bucketValueSchemaV1_3 = bucketValueSchemaV1_3; exports.bucketValueSchemaV1_6 = bucketValueSchemaV1_6; exports.bucketValueSchemaV1_7 = bucketValueSchemaV1_7; exports.bucketValueSchemaV1_8 = bucketValueSchemaV1_8; exports.configV0Definition = configV0Definition; exports.configV1Definition = configV1Definition; exports.configV1_10Definition = configV1_10Definition; exports.configV1_11Definition = configV1_11Definition; exports.configV1_1Definition = configV1_1Definition; exports.configV1_2Definition = configV1_2Definition; exports.configV1_3Definition = configV1_3Definition; exports.configV1_4Definition = configV1_4Definition; exports.configV1_5Definition = configV1_5Definition; exports.configV1_6Definition = configV1_6Definition; exports.configV1_7Definition = configV1_7Definition; exports.configV1_8Definition = configV1_8Definition; exports.configV1_9Definition = configV1_9Definition; exports.defaultConfig = defaultConfig; exports.getLocaleCodeDelimiter = getLocaleCodeDelimiter; exports.localeCodeSchema = localeCodeSchema; exports.localeCodes = localeCodes; exports.localeCodesFull = localeCodesFull; exports.localeCodesFullExplicitRegion = localeCodesFullExplicitRegion; exports.localeCodesFullUnderscore = localeCodesFullUnderscore; exports.localeCodesShort = localeCodesShort; exports.localeSchema = localeSchema; exports.normalizeLocale = normalizeLocale; exports.parseI18nConfig = parseI18nConfig; exports.resolveLocaleCode = resolveLocaleCode; exports.resolveOverriddenLocale = resolveOverriddenLocale;
849
+
850
+
851
+
852
+
853
+ exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; exports.bucketValueSchemaV1_12 = bucketValueSchemaV1_12; exports.bucketValueSchemaV1_13 = bucketValueSchemaV1_13; exports.bucketValueSchemaV1_3 = bucketValueSchemaV1_3; exports.bucketValueSchemaV1_6 = bucketValueSchemaV1_6; exports.bucketValueSchemaV1_7 = bucketValueSchemaV1_7; exports.bucketValueSchemaV1_8 = bucketValueSchemaV1_8; exports.configV0Definition = configV0Definition; exports.configV1Definition = configV1Definition; exports.configV1_10Definition = configV1_10Definition; exports.configV1_11Definition = configV1_11Definition; exports.configV1_12Definition = configV1_12Definition; exports.configV1_13Definition = configV1_13Definition; exports.configV1_1Definition = configV1_1Definition; exports.configV1_2Definition = configV1_2Definition; exports.configV1_3Definition = configV1_3Definition; exports.configV1_4Definition = configV1_4Definition; exports.configV1_5Definition = configV1_5Definition; exports.configV1_6Definition = configV1_6Definition; exports.configV1_7Definition = configV1_7Definition; exports.configV1_8Definition = configV1_8Definition; exports.configV1_9Definition = configV1_9Definition; exports.defaultConfig = defaultConfig; exports.getLocaleCodeDelimiter = getLocaleCodeDelimiter; exports.localeCodeSchema = localeCodeSchema; exports.localeCodes = localeCodes; exports.localeCodesFull = localeCodesFull; exports.localeCodesFullExplicitRegion = localeCodesFullExplicitRegion; exports.localeCodesFullUnderscore = localeCodesFullUnderscore; exports.localeCodesShort = localeCodesShort; exports.localeSchema = localeSchema; exports.normalizeLocale = normalizeLocale; exports.parseI18nConfig = parseI18nConfig; exports.resolveLocaleCode = resolveLocaleCode; exports.resolveOverriddenLocale = resolveOverriddenLocale;
package/build/index.d.cts CHANGED
@@ -979,7 +979,118 @@ declare const configV1_11Definition: ConfigDefinition<{
979
979
  }, Z.core.$strip>>;
980
980
  vNext: Z.ZodOptional<Z.ZodString>;
981
981
  }, any>;
982
- declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
982
+ declare const bucketValueSchemaV1_12: Z.ZodObject<{
983
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
984
+ path: Z.ZodString;
985
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
986
+ }, Z.core.$strip>]>>>;
987
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
988
+ path: Z.ZodString;
989
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
990
+ }, Z.core.$strip>]>>>;
991
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
992
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
993
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
994
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
995
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
996
+ }, Z.core.$strip>;
997
+ declare const configV1_12Definition: ConfigDefinition<{
998
+ version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
999
+ locale: Z.ZodObject<{
1000
+ source: Z.ZodString;
1001
+ targets: Z.ZodArray<Z.ZodString>;
1002
+ extraSource: Z.ZodOptional<Z.ZodString>;
1003
+ }, Z.core.$strip>;
1004
+ $schema: Z.ZodDefault<Z.ZodString>;
1005
+ formatter: Z.ZodOptional<Z.ZodEnum<{
1006
+ prettier: "prettier";
1007
+ biome: "biome";
1008
+ }>>;
1009
+ provider: Z.ZodOptional<Z.ZodObject<{
1010
+ id: Z.ZodEnum<{
1011
+ openai: "openai";
1012
+ anthropic: "anthropic";
1013
+ google: "google";
1014
+ ollama: "ollama";
1015
+ openrouter: "openrouter";
1016
+ mistral: "mistral";
1017
+ }>;
1018
+ model: Z.ZodString;
1019
+ prompt: Z.ZodString;
1020
+ baseUrl: Z.ZodOptional<Z.ZodString>;
1021
+ settings: Z.ZodOptional<Z.ZodObject<{
1022
+ temperature: Z.ZodOptional<Z.ZodNumber>;
1023
+ }, Z.core.$strip>>;
1024
+ }, Z.core.$strip>>;
1025
+ vNext: Z.ZodOptional<Z.ZodString>;
1026
+ buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
1027
+ ail: "ail";
1028
+ android: "android";
1029
+ csv: "csv";
1030
+ ejs: "ejs";
1031
+ flutter: "flutter";
1032
+ html: "html";
1033
+ json: "json";
1034
+ json5: "json5";
1035
+ jsonc: "jsonc";
1036
+ markdown: "markdown";
1037
+ markdoc: "markdoc";
1038
+ mdx: "mdx";
1039
+ mjml: "mjml";
1040
+ twig: "twig";
1041
+ "xcode-strings": "xcode-strings";
1042
+ "xcode-stringsdict": "xcode-stringsdict";
1043
+ "xcode-xcstrings": "xcode-xcstrings";
1044
+ "xcode-xcstrings-v2": "xcode-xcstrings-v2";
1045
+ yaml: "yaml";
1046
+ "yaml-root-key": "yaml-root-key";
1047
+ properties: "properties";
1048
+ po: "po";
1049
+ xliff: "xliff";
1050
+ xml: "xml";
1051
+ srt: "srt";
1052
+ dato: "dato";
1053
+ compiler: "compiler";
1054
+ vtt: "vtt";
1055
+ php: "php";
1056
+ "vue-json": "vue-json";
1057
+ typescript: "typescript";
1058
+ txt: "txt";
1059
+ "json-dictionary": "json-dictionary";
1060
+ "csv-per-locale": "csv-per-locale";
1061
+ }> & Z.core.$partial, Z.ZodObject<{
1062
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1063
+ path: Z.ZodString;
1064
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1065
+ }, Z.core.$strip>]>>>;
1066
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1067
+ path: Z.ZodString;
1068
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1069
+ }, Z.core.$strip>]>>>;
1070
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1071
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1072
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1073
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1074
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1075
+ }, Z.core.$strip>>>;
1076
+ }, any>;
1077
+ declare const bucketValueSchemaV1_13: Z.ZodObject<{
1078
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1079
+ path: Z.ZodString;
1080
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1081
+ }, Z.core.$strip>]>>>;
1082
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1083
+ path: Z.ZodString;
1084
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1085
+ }, Z.core.$strip>]>>>;
1086
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1087
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1088
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1089
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1090
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1091
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1092
+ }, Z.core.$strip>;
1093
+ declare const configV1_13Definition: ConfigDefinition<{
983
1094
  version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
984
1095
  locale: Z.ZodObject<{
985
1096
  source: Z.ZodString;
@@ -987,6 +1098,27 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
987
1098
  extraSource: Z.ZodOptional<Z.ZodString>;
988
1099
  }, Z.core.$strip>;
989
1100
  $schema: Z.ZodDefault<Z.ZodString>;
1101
+ formatter: Z.ZodOptional<Z.ZodEnum<{
1102
+ prettier: "prettier";
1103
+ biome: "biome";
1104
+ }>>;
1105
+ provider: Z.ZodOptional<Z.ZodObject<{
1106
+ id: Z.ZodEnum<{
1107
+ openai: "openai";
1108
+ anthropic: "anthropic";
1109
+ google: "google";
1110
+ ollama: "ollama";
1111
+ openrouter: "openrouter";
1112
+ mistral: "mistral";
1113
+ }>;
1114
+ model: Z.ZodString;
1115
+ prompt: Z.ZodString;
1116
+ baseUrl: Z.ZodOptional<Z.ZodString>;
1117
+ settings: Z.ZodOptional<Z.ZodObject<{
1118
+ temperature: Z.ZodOptional<Z.ZodNumber>;
1119
+ }, Z.core.$strip>>;
1120
+ }, Z.core.$strip>>;
1121
+ vNext: Z.ZodOptional<Z.ZodString>;
990
1122
  buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
991
1123
  ail: "ail";
992
1124
  android: "android";
@@ -1035,7 +1167,18 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1035
1167
  lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1036
1168
  lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1037
1169
  ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1170
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1171
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1038
1172
  }, Z.core.$strip>>>;
1173
+ }, any>;
1174
+ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1175
+ version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
1176
+ locale: Z.ZodObject<{
1177
+ source: Z.ZodString;
1178
+ targets: Z.ZodArray<Z.ZodString>;
1179
+ extraSource: Z.ZodOptional<Z.ZodString>;
1180
+ }, Z.core.$strip>;
1181
+ $schema: Z.ZodDefault<Z.ZodString>;
1039
1182
  formatter: Z.ZodOptional<Z.ZodEnum<{
1040
1183
  prettier: "prettier";
1041
1184
  biome: "biome";
@@ -1057,6 +1200,57 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1057
1200
  }, Z.core.$strip>>;
1058
1201
  }, Z.core.$strip>>;
1059
1202
  vNext: Z.ZodOptional<Z.ZodString>;
1203
+ buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
1204
+ ail: "ail";
1205
+ android: "android";
1206
+ csv: "csv";
1207
+ ejs: "ejs";
1208
+ flutter: "flutter";
1209
+ html: "html";
1210
+ json: "json";
1211
+ json5: "json5";
1212
+ jsonc: "jsonc";
1213
+ markdown: "markdown";
1214
+ markdoc: "markdoc";
1215
+ mdx: "mdx";
1216
+ mjml: "mjml";
1217
+ twig: "twig";
1218
+ "xcode-strings": "xcode-strings";
1219
+ "xcode-stringsdict": "xcode-stringsdict";
1220
+ "xcode-xcstrings": "xcode-xcstrings";
1221
+ "xcode-xcstrings-v2": "xcode-xcstrings-v2";
1222
+ yaml: "yaml";
1223
+ "yaml-root-key": "yaml-root-key";
1224
+ properties: "properties";
1225
+ po: "po";
1226
+ xliff: "xliff";
1227
+ xml: "xml";
1228
+ srt: "srt";
1229
+ dato: "dato";
1230
+ compiler: "compiler";
1231
+ vtt: "vtt";
1232
+ php: "php";
1233
+ "vue-json": "vue-json";
1234
+ typescript: "typescript";
1235
+ txt: "txt";
1236
+ "json-dictionary": "json-dictionary";
1237
+ "csv-per-locale": "csv-per-locale";
1238
+ }> & Z.core.$partial, Z.ZodObject<{
1239
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1240
+ path: Z.ZodString;
1241
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1242
+ }, Z.core.$strip>]>>>;
1243
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1244
+ path: Z.ZodString;
1245
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1246
+ }, Z.core.$strip>]>>>;
1247
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1248
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1249
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1250
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1251
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1252
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1253
+ }, Z.core.$strip>>>;
1060
1254
  }, any>;
1061
1255
  type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
1062
1256
  declare function parseI18nConfig(rawConfig: unknown): {
@@ -1080,6 +1274,8 @@ declare function parseI18nConfig(rawConfig: unknown): {
1080
1274
  lockedKeys?: string[] | undefined;
1081
1275
  lockedPatterns?: string[] | undefined;
1082
1276
  ignoredKeys?: string[] | undefined;
1277
+ preservedKeys?: string[] | undefined;
1278
+ localizableKeys?: string[] | undefined;
1083
1279
  }>>;
1084
1280
  formatter?: "prettier" | "biome" | undefined;
1085
1281
  provider?: {
@@ -1114,6 +1310,8 @@ declare const defaultConfig: {
1114
1310
  lockedKeys?: string[] | undefined;
1115
1311
  lockedPatterns?: string[] | undefined;
1116
1312
  ignoredKeys?: string[] | undefined;
1313
+ preservedKeys?: string[] | undefined;
1314
+ localizableKeys?: string[] | undefined;
1117
1315
  }>>;
1118
1316
  formatter?: "prettier" | "biome" | undefined;
1119
1317
  provider?: {
@@ -1128,4 +1326,4 @@ declare const defaultConfig: {
1128
1326
  vNext?: string | undefined;
1129
1327
  };
1130
1328
 
1131
- export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, bucketValueSchemaV1_3, bucketValueSchemaV1_6, bucketValueSchemaV1_7, bucketValueSchemaV1_8, configV0Definition, configV1Definition, configV1_10Definition, configV1_11Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, configV1_9Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
1329
+ export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, bucketValueSchemaV1_12, bucketValueSchemaV1_13, bucketValueSchemaV1_3, bucketValueSchemaV1_6, bucketValueSchemaV1_7, bucketValueSchemaV1_8, configV0Definition, configV1Definition, configV1_10Definition, configV1_11Definition, configV1_12Definition, configV1_13Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, configV1_9Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
package/build/index.d.ts CHANGED
@@ -979,7 +979,118 @@ declare const configV1_11Definition: ConfigDefinition<{
979
979
  }, Z.core.$strip>>;
980
980
  vNext: Z.ZodOptional<Z.ZodString>;
981
981
  }, any>;
982
- declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
982
+ declare const bucketValueSchemaV1_12: Z.ZodObject<{
983
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
984
+ path: Z.ZodString;
985
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
986
+ }, Z.core.$strip>]>>>;
987
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
988
+ path: Z.ZodString;
989
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
990
+ }, Z.core.$strip>]>>>;
991
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
992
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
993
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
994
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
995
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
996
+ }, Z.core.$strip>;
997
+ declare const configV1_12Definition: ConfigDefinition<{
998
+ version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
999
+ locale: Z.ZodObject<{
1000
+ source: Z.ZodString;
1001
+ targets: Z.ZodArray<Z.ZodString>;
1002
+ extraSource: Z.ZodOptional<Z.ZodString>;
1003
+ }, Z.core.$strip>;
1004
+ $schema: Z.ZodDefault<Z.ZodString>;
1005
+ formatter: Z.ZodOptional<Z.ZodEnum<{
1006
+ prettier: "prettier";
1007
+ biome: "biome";
1008
+ }>>;
1009
+ provider: Z.ZodOptional<Z.ZodObject<{
1010
+ id: Z.ZodEnum<{
1011
+ openai: "openai";
1012
+ anthropic: "anthropic";
1013
+ google: "google";
1014
+ ollama: "ollama";
1015
+ openrouter: "openrouter";
1016
+ mistral: "mistral";
1017
+ }>;
1018
+ model: Z.ZodString;
1019
+ prompt: Z.ZodString;
1020
+ baseUrl: Z.ZodOptional<Z.ZodString>;
1021
+ settings: Z.ZodOptional<Z.ZodObject<{
1022
+ temperature: Z.ZodOptional<Z.ZodNumber>;
1023
+ }, Z.core.$strip>>;
1024
+ }, Z.core.$strip>>;
1025
+ vNext: Z.ZodOptional<Z.ZodString>;
1026
+ buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
1027
+ ail: "ail";
1028
+ android: "android";
1029
+ csv: "csv";
1030
+ ejs: "ejs";
1031
+ flutter: "flutter";
1032
+ html: "html";
1033
+ json: "json";
1034
+ json5: "json5";
1035
+ jsonc: "jsonc";
1036
+ markdown: "markdown";
1037
+ markdoc: "markdoc";
1038
+ mdx: "mdx";
1039
+ mjml: "mjml";
1040
+ twig: "twig";
1041
+ "xcode-strings": "xcode-strings";
1042
+ "xcode-stringsdict": "xcode-stringsdict";
1043
+ "xcode-xcstrings": "xcode-xcstrings";
1044
+ "xcode-xcstrings-v2": "xcode-xcstrings-v2";
1045
+ yaml: "yaml";
1046
+ "yaml-root-key": "yaml-root-key";
1047
+ properties: "properties";
1048
+ po: "po";
1049
+ xliff: "xliff";
1050
+ xml: "xml";
1051
+ srt: "srt";
1052
+ dato: "dato";
1053
+ compiler: "compiler";
1054
+ vtt: "vtt";
1055
+ php: "php";
1056
+ "vue-json": "vue-json";
1057
+ typescript: "typescript";
1058
+ txt: "txt";
1059
+ "json-dictionary": "json-dictionary";
1060
+ "csv-per-locale": "csv-per-locale";
1061
+ }> & Z.core.$partial, Z.ZodObject<{
1062
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1063
+ path: Z.ZodString;
1064
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1065
+ }, Z.core.$strip>]>>>;
1066
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1067
+ path: Z.ZodString;
1068
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1069
+ }, Z.core.$strip>]>>>;
1070
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1071
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1072
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1073
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1074
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1075
+ }, Z.core.$strip>>>;
1076
+ }, any>;
1077
+ declare const bucketValueSchemaV1_13: Z.ZodObject<{
1078
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1079
+ path: Z.ZodString;
1080
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1081
+ }, Z.core.$strip>]>>>;
1082
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1083
+ path: Z.ZodString;
1084
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1085
+ }, Z.core.$strip>]>>>;
1086
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1087
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1088
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1089
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1090
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1091
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1092
+ }, Z.core.$strip>;
1093
+ declare const configV1_13Definition: ConfigDefinition<{
983
1094
  version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
984
1095
  locale: Z.ZodObject<{
985
1096
  source: Z.ZodString;
@@ -987,6 +1098,27 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
987
1098
  extraSource: Z.ZodOptional<Z.ZodString>;
988
1099
  }, Z.core.$strip>;
989
1100
  $schema: Z.ZodDefault<Z.ZodString>;
1101
+ formatter: Z.ZodOptional<Z.ZodEnum<{
1102
+ prettier: "prettier";
1103
+ biome: "biome";
1104
+ }>>;
1105
+ provider: Z.ZodOptional<Z.ZodObject<{
1106
+ id: Z.ZodEnum<{
1107
+ openai: "openai";
1108
+ anthropic: "anthropic";
1109
+ google: "google";
1110
+ ollama: "ollama";
1111
+ openrouter: "openrouter";
1112
+ mistral: "mistral";
1113
+ }>;
1114
+ model: Z.ZodString;
1115
+ prompt: Z.ZodString;
1116
+ baseUrl: Z.ZodOptional<Z.ZodString>;
1117
+ settings: Z.ZodOptional<Z.ZodObject<{
1118
+ temperature: Z.ZodOptional<Z.ZodNumber>;
1119
+ }, Z.core.$strip>>;
1120
+ }, Z.core.$strip>>;
1121
+ vNext: Z.ZodOptional<Z.ZodString>;
990
1122
  buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
991
1123
  ail: "ail";
992
1124
  android: "android";
@@ -1035,7 +1167,18 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1035
1167
  lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1036
1168
  lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1037
1169
  ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1170
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1171
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1038
1172
  }, Z.core.$strip>>>;
1173
+ }, any>;
1174
+ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1175
+ version: Z.ZodDefault<Z.ZodUnion<readonly [Z.ZodNumber, Z.ZodString]>>;
1176
+ locale: Z.ZodObject<{
1177
+ source: Z.ZodString;
1178
+ targets: Z.ZodArray<Z.ZodString>;
1179
+ extraSource: Z.ZodOptional<Z.ZodString>;
1180
+ }, Z.core.$strip>;
1181
+ $schema: Z.ZodDefault<Z.ZodString>;
1039
1182
  formatter: Z.ZodOptional<Z.ZodEnum<{
1040
1183
  prettier: "prettier";
1041
1184
  biome: "biome";
@@ -1057,6 +1200,57 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
1057
1200
  }, Z.core.$strip>>;
1058
1201
  }, Z.core.$strip>>;
1059
1202
  vNext: Z.ZodOptional<Z.ZodString>;
1203
+ buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<{
1204
+ ail: "ail";
1205
+ android: "android";
1206
+ csv: "csv";
1207
+ ejs: "ejs";
1208
+ flutter: "flutter";
1209
+ html: "html";
1210
+ json: "json";
1211
+ json5: "json5";
1212
+ jsonc: "jsonc";
1213
+ markdown: "markdown";
1214
+ markdoc: "markdoc";
1215
+ mdx: "mdx";
1216
+ mjml: "mjml";
1217
+ twig: "twig";
1218
+ "xcode-strings": "xcode-strings";
1219
+ "xcode-stringsdict": "xcode-stringsdict";
1220
+ "xcode-xcstrings": "xcode-xcstrings";
1221
+ "xcode-xcstrings-v2": "xcode-xcstrings-v2";
1222
+ yaml: "yaml";
1223
+ "yaml-root-key": "yaml-root-key";
1224
+ properties: "properties";
1225
+ po: "po";
1226
+ xliff: "xliff";
1227
+ xml: "xml";
1228
+ srt: "srt";
1229
+ dato: "dato";
1230
+ compiler: "compiler";
1231
+ vtt: "vtt";
1232
+ php: "php";
1233
+ "vue-json": "vue-json";
1234
+ typescript: "typescript";
1235
+ txt: "txt";
1236
+ "json-dictionary": "json-dictionary";
1237
+ "csv-per-locale": "csv-per-locale";
1238
+ }> & Z.core.$partial, Z.ZodObject<{
1239
+ include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1240
+ path: Z.ZodString;
1241
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1242
+ }, Z.core.$strip>]>>>;
1243
+ exclude: Z.ZodOptional<Z.ZodArray<Z.ZodUnion<readonly [Z.ZodString, Z.ZodObject<{
1244
+ path: Z.ZodString;
1245
+ delimiter: Z.ZodOptional<Z.ZodUnion<readonly [Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
1246
+ }, Z.core.$strip>]>>>;
1247
+ injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1248
+ lockedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1249
+ lockedPatterns: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1250
+ ignoredKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1251
+ preservedKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1252
+ localizableKeys: Z.ZodOptional<Z.ZodArray<Z.ZodString>>;
1253
+ }, Z.core.$strip>>>;
1060
1254
  }, any>;
1061
1255
  type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
1062
1256
  declare function parseI18nConfig(rawConfig: unknown): {
@@ -1080,6 +1274,8 @@ declare function parseI18nConfig(rawConfig: unknown): {
1080
1274
  lockedKeys?: string[] | undefined;
1081
1275
  lockedPatterns?: string[] | undefined;
1082
1276
  ignoredKeys?: string[] | undefined;
1277
+ preservedKeys?: string[] | undefined;
1278
+ localizableKeys?: string[] | undefined;
1083
1279
  }>>;
1084
1280
  formatter?: "prettier" | "biome" | undefined;
1085
1281
  provider?: {
@@ -1114,6 +1310,8 @@ declare const defaultConfig: {
1114
1310
  lockedKeys?: string[] | undefined;
1115
1311
  lockedPatterns?: string[] | undefined;
1116
1312
  ignoredKeys?: string[] | undefined;
1313
+ preservedKeys?: string[] | undefined;
1314
+ localizableKeys?: string[] | undefined;
1117
1315
  }>>;
1118
1316
  formatter?: "prettier" | "biome" | undefined;
1119
1317
  provider?: {
@@ -1128,4 +1326,4 @@ declare const defaultConfig: {
1128
1326
  vNext?: string | undefined;
1129
1327
  };
1130
1328
 
1131
- export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, bucketValueSchemaV1_3, bucketValueSchemaV1_6, bucketValueSchemaV1_7, bucketValueSchemaV1_8, configV0Definition, configV1Definition, configV1_10Definition, configV1_11Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, configV1_9Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
1329
+ export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, bucketValueSchemaV1_12, bucketValueSchemaV1_13, bucketValueSchemaV1_3, bucketValueSchemaV1_6, bucketValueSchemaV1_7, bucketValueSchemaV1_8, configV0Definition, configV1Definition, configV1_10Definition, configV1_11Definition, configV1_12Definition, configV1_13Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, configV1_9Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
package/build/index.mjs CHANGED
@@ -753,7 +753,55 @@ var configV1_11Definition = extendConfigDefinition(
753
753
  })
754
754
  }
755
755
  );
756
- var LATEST_CONFIG_DEFINITION = configV1_11Definition;
756
+ var bucketValueSchemaV1_12 = bucketValueSchemaV1_8.extend({
757
+ preservedKeys: Z3.array(Z3.string()).optional().describe(
758
+ "Keys that are added to targets using source values as placeholders, but once present, are never overwritten by the CLI."
759
+ )
760
+ });
761
+ var configV1_12Definition = extendConfigDefinition(
762
+ configV1_11Definition,
763
+ {
764
+ createSchema: (baseSchema) => baseSchema.extend({
765
+ buckets: Z3.partialRecord(
766
+ bucketTypeSchema,
767
+ bucketValueSchemaV1_12
768
+ ).default({})
769
+ }),
770
+ createDefaultValue: (baseDefaultValue) => ({
771
+ ...baseDefaultValue,
772
+ version: "1.12"
773
+ }),
774
+ createUpgrader: (oldConfig) => ({
775
+ ...oldConfig,
776
+ version: "1.12"
777
+ })
778
+ }
779
+ );
780
+ var bucketValueSchemaV1_13 = bucketValueSchemaV1_12.extend({
781
+ localizableKeys: Z3.array(Z3.string()).optional().describe(
782
+ "Keys whose values should always be sent for translation, even if they would normally be skipped as untranslatable (e.g. pure numbers, URLs, dates). Use this to force-translate values that have custom glossary rules."
783
+ )
784
+ });
785
+ var configV1_13Definition = extendConfigDefinition(
786
+ configV1_12Definition,
787
+ {
788
+ createSchema: (baseSchema) => baseSchema.extend({
789
+ buckets: Z3.partialRecord(
790
+ bucketTypeSchema,
791
+ bucketValueSchemaV1_13
792
+ ).default({})
793
+ }),
794
+ createDefaultValue: (baseDefaultValue) => ({
795
+ ...baseDefaultValue,
796
+ version: "1.13"
797
+ }),
798
+ createUpgrader: (oldConfig) => ({
799
+ ...oldConfig,
800
+ version: "1.13"
801
+ })
802
+ }
803
+ );
804
+ var LATEST_CONFIG_DEFINITION = configV1_13Definition;
757
805
  function parseI18nConfig(rawConfig) {
758
806
  try {
759
807
  const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
@@ -768,6 +816,8 @@ export {
768
816
  bucketItemSchema,
769
817
  bucketTypeSchema,
770
818
  bucketTypes,
819
+ bucketValueSchemaV1_12,
820
+ bucketValueSchemaV1_13,
771
821
  bucketValueSchemaV1_3,
772
822
  bucketValueSchemaV1_6,
773
823
  bucketValueSchemaV1_7,
@@ -776,6 +826,8 @@ export {
776
826
  configV1Definition,
777
827
  configV1_10Definition,
778
828
  configV1_11Definition,
829
+ configV1_12Definition,
830
+ configV1_13Definition,
779
831
  configV1_1Definition,
780
832
  configV1_2Definition,
781
833
  configV1_3Definition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_spec",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "description": "Lingo.dev open specification",
5
5
  "private": false,
6
6
  "repository": {