@lingo.dev/_spec 0.40.2 → 0.40.3
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/i18n.schema.json +8 -0
- package/build/index.cjs +21 -2
- package/build/index.d.cts +109 -13
- package/build/index.d.ts +109 -13
- package/build/index.mjs +20 -1
- package/package.json +1 -1
package/build/i18n.schema.json
CHANGED
@@ -199,6 +199,14 @@
|
|
199
199
|
],
|
200
200
|
"additionalProperties": false,
|
201
201
|
"description": "Configuration for the machine-translation provider."
|
202
|
+
},
|
203
|
+
"formatter": {
|
204
|
+
"type": "string",
|
205
|
+
"enum": [
|
206
|
+
"prettier",
|
207
|
+
"biome"
|
208
|
+
],
|
209
|
+
"description": "Code formatter to use for all buckets. Defaults to 'prettier' if not specified and a prettier config is found."
|
202
210
|
}
|
203
211
|
},
|
204
212
|
"required": [
|
package/build/index.cjs
CHANGED
@@ -654,7 +654,25 @@ var configV1_8Definition = extendConfigDefinition(
|
|
654
654
|
})
|
655
655
|
}
|
656
656
|
);
|
657
|
-
var
|
657
|
+
var configV1_9Definition = extendConfigDefinition(
|
658
|
+
configV1_8Definition,
|
659
|
+
{
|
660
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
661
|
+
formatter: _zod2.default.enum(["prettier", "biome"]).optional().describe(
|
662
|
+
"Code formatter to use for all buckets. Defaults to 'prettier' if not specified and a prettier config is found."
|
663
|
+
)
|
664
|
+
}),
|
665
|
+
createDefaultValue: (baseDefaultValue) => ({
|
666
|
+
...baseDefaultValue,
|
667
|
+
version: 1.9
|
668
|
+
}),
|
669
|
+
createUpgrader: (oldConfig) => ({
|
670
|
+
...oldConfig,
|
671
|
+
version: 1.9
|
672
|
+
})
|
673
|
+
}
|
674
|
+
);
|
675
|
+
var LATEST_CONFIG_DEFINITION = configV1_9Definition;
|
658
676
|
function parseI18nConfig(rawConfig) {
|
659
677
|
try {
|
660
678
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -696,4 +714,5 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
696
714
|
|
697
715
|
|
698
716
|
|
699
|
-
|
717
|
+
|
718
|
+
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_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
@@ -129,14 +129,14 @@ declare const localeSchema: Z.ZodObject<{
|
|
129
129
|
source: string;
|
130
130
|
targets: string[];
|
131
131
|
}>;
|
132
|
-
type ConfigDefinition<T extends Z.ZodRawShape,
|
132
|
+
type ConfigDefinition<T extends Z.ZodRawShape, _P extends Z.ZodRawShape = any> = {
|
133
133
|
schema: Z.ZodObject<T>;
|
134
134
|
defaultValue: Z.infer<Z.ZodObject<T>>;
|
135
135
|
parse: (rawConfig: unknown) => Z.infer<Z.ZodObject<T>>;
|
136
136
|
};
|
137
137
|
declare const configV0Definition: ConfigDefinition<{
|
138
138
|
version: Z.ZodDefault<Z.ZodNumber>;
|
139
|
-
},
|
139
|
+
}, any>;
|
140
140
|
declare const configV1Definition: ConfigDefinition<{
|
141
141
|
version: Z.ZodDefault<Z.ZodNumber>;
|
142
142
|
} & {
|
@@ -151,7 +151,7 @@ declare const configV1Definition: ConfigDefinition<{
|
|
151
151
|
targets: string[];
|
152
152
|
}>;
|
153
153
|
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>>>>;
|
154
|
-
},
|
154
|
+
}, any>;
|
155
155
|
declare const configV1_1Definition: ConfigDefinition<{
|
156
156
|
version: Z.ZodDefault<Z.ZodNumber>;
|
157
157
|
locale: Z.ZodObject<{
|
@@ -175,7 +175,7 @@ declare const configV1_1Definition: ConfigDefinition<{
|
|
175
175
|
exclude?: string[] | undefined;
|
176
176
|
include?: string[] | undefined;
|
177
177
|
}>>>;
|
178
|
-
},
|
178
|
+
}, any>;
|
179
179
|
declare const configV1_2Definition: ConfigDefinition<{
|
180
180
|
version: Z.ZodDefault<Z.ZodNumber>;
|
181
181
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>, Z.ZodObject<{
|
@@ -203,7 +203,7 @@ declare const configV1_2Definition: ConfigDefinition<{
|
|
203
203
|
targets: string[];
|
204
204
|
extraSource?: string | undefined;
|
205
205
|
}>;
|
206
|
-
},
|
206
|
+
}, any>;
|
207
207
|
declare const bucketItemSchema: Z.ZodObject<{
|
208
208
|
path: Z.ZodString;
|
209
209
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -318,7 +318,7 @@ declare const configV1_3Definition: ConfigDefinition<{
|
|
318
318
|
})[] | undefined;
|
319
319
|
injectLocale?: string[] | undefined;
|
320
320
|
}>>>;
|
321
|
-
},
|
321
|
+
}, any>;
|
322
322
|
declare const configV1_4Definition: ConfigDefinition<{
|
323
323
|
version: Z.ZodDefault<Z.ZodNumber>;
|
324
324
|
locale: Z.ZodObject<{
|
@@ -381,7 +381,7 @@ declare const configV1_4Definition: ConfigDefinition<{
|
|
381
381
|
}>>>;
|
382
382
|
} & {
|
383
383
|
$schema: Z.ZodDefault<Z.ZodString>;
|
384
|
-
},
|
384
|
+
}, any>;
|
385
385
|
declare const configV1_5Definition: ConfigDefinition<{
|
386
386
|
version: Z.ZodDefault<Z.ZodNumber>;
|
387
387
|
locale: Z.ZodObject<{
|
@@ -461,7 +461,7 @@ declare const configV1_5Definition: ConfigDefinition<{
|
|
461
461
|
prompt: string;
|
462
462
|
baseUrl?: string | undefined;
|
463
463
|
}>>;
|
464
|
-
},
|
464
|
+
}, any>;
|
465
465
|
declare const bucketValueSchemaV1_6: Z.ZodObject<{
|
466
466
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
467
467
|
path: Z.ZodString;
|
@@ -590,7 +590,7 @@ declare const configV1_6Definition: ConfigDefinition<{
|
|
590
590
|
injectLocale?: string[] | undefined;
|
591
591
|
lockedKeys?: string[] | undefined;
|
592
592
|
}>>>;
|
593
|
-
},
|
593
|
+
}, any>;
|
594
594
|
declare const bucketValueSchemaV1_7: Z.ZodObject<{
|
595
595
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
596
596
|
path: Z.ZodString;
|
@@ -727,7 +727,7 @@ declare const configV1_7Definition: ConfigDefinition<{
|
|
727
727
|
lockedKeys?: string[] | undefined;
|
728
728
|
lockedPatterns?: string[] | undefined;
|
729
729
|
}>>>;
|
730
|
-
},
|
730
|
+
}, any>;
|
731
731
|
declare const bucketValueSchemaV1_8: Z.ZodObject<{
|
732
732
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
733
733
|
path: Z.ZodString;
|
@@ -872,7 +872,99 @@ declare const configV1_8Definition: ConfigDefinition<{
|
|
872
872
|
lockedPatterns?: string[] | undefined;
|
873
873
|
ignoredKeys?: string[] | undefined;
|
874
874
|
}>>>;
|
875
|
-
},
|
875
|
+
}, any>;
|
876
|
+
declare const configV1_9Definition: ConfigDefinition<{
|
877
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
878
|
+
locale: Z.ZodObject<{
|
879
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
880
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
881
|
+
} & {
|
882
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
883
|
+
}, "strip", Z.ZodTypeAny, {
|
884
|
+
source: string;
|
885
|
+
targets: string[];
|
886
|
+
extraSource?: string | undefined;
|
887
|
+
}, {
|
888
|
+
source: string;
|
889
|
+
targets: string[];
|
890
|
+
extraSource?: string | undefined;
|
891
|
+
}>;
|
892
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
893
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
894
|
+
id: Z.ZodEnum<["openai", "anthropic", "google", "ollama", "openrouter", "mistral"]>;
|
895
|
+
model: Z.ZodString;
|
896
|
+
prompt: Z.ZodString;
|
897
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
898
|
+
}, "strip", Z.ZodTypeAny, {
|
899
|
+
id: "openai" | "anthropic" | "google" | "ollama" | "openrouter" | "mistral";
|
900
|
+
model: string;
|
901
|
+
prompt: string;
|
902
|
+
baseUrl?: string | undefined;
|
903
|
+
}, {
|
904
|
+
id: "openai" | "anthropic" | "google" | "ollama" | "openrouter" | "mistral";
|
905
|
+
model: string;
|
906
|
+
prompt: string;
|
907
|
+
baseUrl?: string | undefined;
|
908
|
+
}>>;
|
909
|
+
} & {
|
910
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>, Z.ZodObject<{
|
911
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
912
|
+
path: Z.ZodString;
|
913
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
914
|
+
}, "strip", Z.ZodTypeAny, {
|
915
|
+
path: string;
|
916
|
+
delimiter?: "-" | "_" | null | undefined;
|
917
|
+
}, {
|
918
|
+
path: string;
|
919
|
+
delimiter?: "-" | "_" | null | undefined;
|
920
|
+
}>]>, "many">>;
|
921
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
922
|
+
path: Z.ZodString;
|
923
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
924
|
+
}, "strip", Z.ZodTypeAny, {
|
925
|
+
path: string;
|
926
|
+
delimiter?: "-" | "_" | null | undefined;
|
927
|
+
}, {
|
928
|
+
path: string;
|
929
|
+
delimiter?: "-" | "_" | null | undefined;
|
930
|
+
}>]>, "many">>>;
|
931
|
+
injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
|
932
|
+
} & {
|
933
|
+
lockedKeys: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
934
|
+
} & {
|
935
|
+
lockedPatterns: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
936
|
+
} & {
|
937
|
+
ignoredKeys: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
938
|
+
}, "strip", Z.ZodTypeAny, {
|
939
|
+
include: (string | {
|
940
|
+
path: string;
|
941
|
+
delimiter?: "-" | "_" | null | undefined;
|
942
|
+
})[];
|
943
|
+
exclude?: (string | {
|
944
|
+
path: string;
|
945
|
+
delimiter?: "-" | "_" | null | undefined;
|
946
|
+
})[] | undefined;
|
947
|
+
injectLocale?: string[] | undefined;
|
948
|
+
lockedKeys?: string[] | undefined;
|
949
|
+
lockedPatterns?: string[] | undefined;
|
950
|
+
ignoredKeys?: string[] | undefined;
|
951
|
+
}, {
|
952
|
+
exclude?: (string | {
|
953
|
+
path: string;
|
954
|
+
delimiter?: "-" | "_" | null | undefined;
|
955
|
+
})[] | undefined;
|
956
|
+
include?: (string | {
|
957
|
+
path: string;
|
958
|
+
delimiter?: "-" | "_" | null | undefined;
|
959
|
+
})[] | undefined;
|
960
|
+
injectLocale?: string[] | undefined;
|
961
|
+
lockedKeys?: string[] | undefined;
|
962
|
+
lockedPatterns?: string[] | undefined;
|
963
|
+
ignoredKeys?: string[] | undefined;
|
964
|
+
}>>>;
|
965
|
+
} & {
|
966
|
+
formatter: Z.ZodOptional<Z.ZodEnum<["prettier", "biome"]>>;
|
967
|
+
}, any>;
|
876
968
|
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
|
877
969
|
version: Z.ZodDefault<Z.ZodNumber>;
|
878
970
|
locale: Z.ZodObject<{
|
@@ -962,7 +1054,9 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
|
|
962
1054
|
lockedPatterns?: string[] | undefined;
|
963
1055
|
ignoredKeys?: string[] | undefined;
|
964
1056
|
}>>>;
|
965
|
-
}
|
1057
|
+
} & {
|
1058
|
+
formatter: Z.ZodOptional<Z.ZodEnum<["prettier", "biome"]>>;
|
1059
|
+
}, any>;
|
966
1060
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
967
1061
|
declare function parseI18nConfig(rawConfig: unknown): {
|
968
1062
|
version: number;
|
@@ -992,6 +1086,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
992
1086
|
prompt: string;
|
993
1087
|
baseUrl?: string | undefined;
|
994
1088
|
} | undefined;
|
1089
|
+
formatter?: "prettier" | "biome" | undefined;
|
995
1090
|
};
|
996
1091
|
declare const defaultConfig: {
|
997
1092
|
version: number;
|
@@ -1021,6 +1116,7 @@ declare const defaultConfig: {
|
|
1021
1116
|
prompt: string;
|
1022
1117
|
baseUrl?: string | undefined;
|
1023
1118
|
} | undefined;
|
1119
|
+
formatter?: "prettier" | "biome" | undefined;
|
1024
1120
|
};
|
1025
1121
|
|
1026
|
-
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_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
1122
|
+
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_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
@@ -129,14 +129,14 @@ declare const localeSchema: Z.ZodObject<{
|
|
129
129
|
source: string;
|
130
130
|
targets: string[];
|
131
131
|
}>;
|
132
|
-
type ConfigDefinition<T extends Z.ZodRawShape,
|
132
|
+
type ConfigDefinition<T extends Z.ZodRawShape, _P extends Z.ZodRawShape = any> = {
|
133
133
|
schema: Z.ZodObject<T>;
|
134
134
|
defaultValue: Z.infer<Z.ZodObject<T>>;
|
135
135
|
parse: (rawConfig: unknown) => Z.infer<Z.ZodObject<T>>;
|
136
136
|
};
|
137
137
|
declare const configV0Definition: ConfigDefinition<{
|
138
138
|
version: Z.ZodDefault<Z.ZodNumber>;
|
139
|
-
},
|
139
|
+
}, any>;
|
140
140
|
declare const configV1Definition: ConfigDefinition<{
|
141
141
|
version: Z.ZodDefault<Z.ZodNumber>;
|
142
142
|
} & {
|
@@ -151,7 +151,7 @@ declare const configV1Definition: ConfigDefinition<{
|
|
151
151
|
targets: string[];
|
152
152
|
}>;
|
153
153
|
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>>>>;
|
154
|
-
},
|
154
|
+
}, any>;
|
155
155
|
declare const configV1_1Definition: ConfigDefinition<{
|
156
156
|
version: Z.ZodDefault<Z.ZodNumber>;
|
157
157
|
locale: Z.ZodObject<{
|
@@ -175,7 +175,7 @@ declare const configV1_1Definition: ConfigDefinition<{
|
|
175
175
|
exclude?: string[] | undefined;
|
176
176
|
include?: string[] | undefined;
|
177
177
|
}>>>;
|
178
|
-
},
|
178
|
+
}, any>;
|
179
179
|
declare const configV1_2Definition: ConfigDefinition<{
|
180
180
|
version: Z.ZodDefault<Z.ZodNumber>;
|
181
181
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>, Z.ZodObject<{
|
@@ -203,7 +203,7 @@ declare const configV1_2Definition: ConfigDefinition<{
|
|
203
203
|
targets: string[];
|
204
204
|
extraSource?: string | undefined;
|
205
205
|
}>;
|
206
|
-
},
|
206
|
+
}, any>;
|
207
207
|
declare const bucketItemSchema: Z.ZodObject<{
|
208
208
|
path: Z.ZodString;
|
209
209
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -318,7 +318,7 @@ declare const configV1_3Definition: ConfigDefinition<{
|
|
318
318
|
})[] | undefined;
|
319
319
|
injectLocale?: string[] | undefined;
|
320
320
|
}>>>;
|
321
|
-
},
|
321
|
+
}, any>;
|
322
322
|
declare const configV1_4Definition: ConfigDefinition<{
|
323
323
|
version: Z.ZodDefault<Z.ZodNumber>;
|
324
324
|
locale: Z.ZodObject<{
|
@@ -381,7 +381,7 @@ declare const configV1_4Definition: ConfigDefinition<{
|
|
381
381
|
}>>>;
|
382
382
|
} & {
|
383
383
|
$schema: Z.ZodDefault<Z.ZodString>;
|
384
|
-
},
|
384
|
+
}, any>;
|
385
385
|
declare const configV1_5Definition: ConfigDefinition<{
|
386
386
|
version: Z.ZodDefault<Z.ZodNumber>;
|
387
387
|
locale: Z.ZodObject<{
|
@@ -461,7 +461,7 @@ declare const configV1_5Definition: ConfigDefinition<{
|
|
461
461
|
prompt: string;
|
462
462
|
baseUrl?: string | undefined;
|
463
463
|
}>>;
|
464
|
-
},
|
464
|
+
}, any>;
|
465
465
|
declare const bucketValueSchemaV1_6: Z.ZodObject<{
|
466
466
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
467
467
|
path: Z.ZodString;
|
@@ -590,7 +590,7 @@ declare const configV1_6Definition: ConfigDefinition<{
|
|
590
590
|
injectLocale?: string[] | undefined;
|
591
591
|
lockedKeys?: string[] | undefined;
|
592
592
|
}>>>;
|
593
|
-
},
|
593
|
+
}, any>;
|
594
594
|
declare const bucketValueSchemaV1_7: Z.ZodObject<{
|
595
595
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
596
596
|
path: Z.ZodString;
|
@@ -727,7 +727,7 @@ declare const configV1_7Definition: ConfigDefinition<{
|
|
727
727
|
lockedKeys?: string[] | undefined;
|
728
728
|
lockedPatterns?: string[] | undefined;
|
729
729
|
}>>>;
|
730
|
-
},
|
730
|
+
}, any>;
|
731
731
|
declare const bucketValueSchemaV1_8: Z.ZodObject<{
|
732
732
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
733
733
|
path: Z.ZodString;
|
@@ -872,7 +872,99 @@ declare const configV1_8Definition: ConfigDefinition<{
|
|
872
872
|
lockedPatterns?: string[] | undefined;
|
873
873
|
ignoredKeys?: string[] | undefined;
|
874
874
|
}>>>;
|
875
|
-
},
|
875
|
+
}, any>;
|
876
|
+
declare const configV1_9Definition: ConfigDefinition<{
|
877
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
878
|
+
locale: Z.ZodObject<{
|
879
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
880
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
881
|
+
} & {
|
882
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
883
|
+
}, "strip", Z.ZodTypeAny, {
|
884
|
+
source: string;
|
885
|
+
targets: string[];
|
886
|
+
extraSource?: string | undefined;
|
887
|
+
}, {
|
888
|
+
source: string;
|
889
|
+
targets: string[];
|
890
|
+
extraSource?: string | undefined;
|
891
|
+
}>;
|
892
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
893
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
894
|
+
id: Z.ZodEnum<["openai", "anthropic", "google", "ollama", "openrouter", "mistral"]>;
|
895
|
+
model: Z.ZodString;
|
896
|
+
prompt: Z.ZodString;
|
897
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
898
|
+
}, "strip", Z.ZodTypeAny, {
|
899
|
+
id: "openai" | "anthropic" | "google" | "ollama" | "openrouter" | "mistral";
|
900
|
+
model: string;
|
901
|
+
prompt: string;
|
902
|
+
baseUrl?: string | undefined;
|
903
|
+
}, {
|
904
|
+
id: "openai" | "anthropic" | "google" | "ollama" | "openrouter" | "mistral";
|
905
|
+
model: string;
|
906
|
+
prompt: string;
|
907
|
+
baseUrl?: string | undefined;
|
908
|
+
}>>;
|
909
|
+
} & {
|
910
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "ejs", "flutter", "html", "json", "json5", "jsonc", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript", "txt", "json-dictionary"]>, Z.ZodObject<{
|
911
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
912
|
+
path: Z.ZodString;
|
913
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
914
|
+
}, "strip", Z.ZodTypeAny, {
|
915
|
+
path: string;
|
916
|
+
delimiter?: "-" | "_" | null | undefined;
|
917
|
+
}, {
|
918
|
+
path: string;
|
919
|
+
delimiter?: "-" | "_" | null | undefined;
|
920
|
+
}>]>, "many">>;
|
921
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
922
|
+
path: Z.ZodString;
|
923
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
924
|
+
}, "strip", Z.ZodTypeAny, {
|
925
|
+
path: string;
|
926
|
+
delimiter?: "-" | "_" | null | undefined;
|
927
|
+
}, {
|
928
|
+
path: string;
|
929
|
+
delimiter?: "-" | "_" | null | undefined;
|
930
|
+
}>]>, "many">>>;
|
931
|
+
injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
|
932
|
+
} & {
|
933
|
+
lockedKeys: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
934
|
+
} & {
|
935
|
+
lockedPatterns: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
936
|
+
} & {
|
937
|
+
ignoredKeys: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
938
|
+
}, "strip", Z.ZodTypeAny, {
|
939
|
+
include: (string | {
|
940
|
+
path: string;
|
941
|
+
delimiter?: "-" | "_" | null | undefined;
|
942
|
+
})[];
|
943
|
+
exclude?: (string | {
|
944
|
+
path: string;
|
945
|
+
delimiter?: "-" | "_" | null | undefined;
|
946
|
+
})[] | undefined;
|
947
|
+
injectLocale?: string[] | undefined;
|
948
|
+
lockedKeys?: string[] | undefined;
|
949
|
+
lockedPatterns?: string[] | undefined;
|
950
|
+
ignoredKeys?: string[] | undefined;
|
951
|
+
}, {
|
952
|
+
exclude?: (string | {
|
953
|
+
path: string;
|
954
|
+
delimiter?: "-" | "_" | null | undefined;
|
955
|
+
})[] | undefined;
|
956
|
+
include?: (string | {
|
957
|
+
path: string;
|
958
|
+
delimiter?: "-" | "_" | null | undefined;
|
959
|
+
})[] | undefined;
|
960
|
+
injectLocale?: string[] | undefined;
|
961
|
+
lockedKeys?: string[] | undefined;
|
962
|
+
lockedPatterns?: string[] | undefined;
|
963
|
+
ignoredKeys?: string[] | undefined;
|
964
|
+
}>>>;
|
965
|
+
} & {
|
966
|
+
formatter: Z.ZodOptional<Z.ZodEnum<["prettier", "biome"]>>;
|
967
|
+
}, any>;
|
876
968
|
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
|
877
969
|
version: Z.ZodDefault<Z.ZodNumber>;
|
878
970
|
locale: Z.ZodObject<{
|
@@ -962,7 +1054,9 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<{
|
|
962
1054
|
lockedPatterns?: string[] | undefined;
|
963
1055
|
ignoredKeys?: string[] | undefined;
|
964
1056
|
}>>>;
|
965
|
-
}
|
1057
|
+
} & {
|
1058
|
+
formatter: Z.ZodOptional<Z.ZodEnum<["prettier", "biome"]>>;
|
1059
|
+
}, any>;
|
966
1060
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
967
1061
|
declare function parseI18nConfig(rawConfig: unknown): {
|
968
1062
|
version: number;
|
@@ -992,6 +1086,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
992
1086
|
prompt: string;
|
993
1087
|
baseUrl?: string | undefined;
|
994
1088
|
} | undefined;
|
1089
|
+
formatter?: "prettier" | "biome" | undefined;
|
995
1090
|
};
|
996
1091
|
declare const defaultConfig: {
|
997
1092
|
version: number;
|
@@ -1021,6 +1116,7 @@ declare const defaultConfig: {
|
|
1021
1116
|
prompt: string;
|
1022
1117
|
baseUrl?: string | undefined;
|
1023
1118
|
} | undefined;
|
1119
|
+
formatter?: "prettier" | "biome" | undefined;
|
1024
1120
|
};
|
1025
1121
|
|
1026
|
-
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_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, configV1_6Definition, configV1_7Definition, configV1_8Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
1122
|
+
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_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
@@ -654,7 +654,25 @@ var configV1_8Definition = extendConfigDefinition(
|
|
654
654
|
})
|
655
655
|
}
|
656
656
|
);
|
657
|
-
var
|
657
|
+
var configV1_9Definition = extendConfigDefinition(
|
658
|
+
configV1_8Definition,
|
659
|
+
{
|
660
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
661
|
+
formatter: Z3.enum(["prettier", "biome"]).optional().describe(
|
662
|
+
"Code formatter to use for all buckets. Defaults to 'prettier' if not specified and a prettier config is found."
|
663
|
+
)
|
664
|
+
}),
|
665
|
+
createDefaultValue: (baseDefaultValue) => ({
|
666
|
+
...baseDefaultValue,
|
667
|
+
version: 1.9
|
668
|
+
}),
|
669
|
+
createUpgrader: (oldConfig) => ({
|
670
|
+
...oldConfig,
|
671
|
+
version: 1.9
|
672
|
+
})
|
673
|
+
}
|
674
|
+
);
|
675
|
+
var LATEST_CONFIG_DEFINITION = configV1_9Definition;
|
658
676
|
function parseI18nConfig(rawConfig) {
|
659
677
|
try {
|
660
678
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -683,6 +701,7 @@ export {
|
|
683
701
|
configV1_6Definition,
|
684
702
|
configV1_7Definition,
|
685
703
|
configV1_8Definition,
|
704
|
+
configV1_9Definition,
|
686
705
|
defaultConfig,
|
687
706
|
getLocaleCodeDelimiter,
|
688
707
|
localeCodeSchema,
|