@lingo.dev/_spec 0.25.0 → 0.25.2
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 +123 -0
- package/build/index.cjs +22 -3
- package/build/index.d.cts +103 -15
- package/build/index.d.ts +103 -15
- package/build/index.mjs +21 -2
- package/package.json +6 -3
@@ -0,0 +1,123 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"version": {
|
5
|
+
"type": "number",
|
6
|
+
"default": 0
|
7
|
+
},
|
8
|
+
"locale": {
|
9
|
+
"type": "object",
|
10
|
+
"properties": {
|
11
|
+
"source": {
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"targets": {
|
15
|
+
"type": "array",
|
16
|
+
"items": {
|
17
|
+
"$ref": "#/properties/locale/properties/source"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"extraSource": {
|
21
|
+
"$ref": "#/properties/locale/properties/source"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"required": [
|
25
|
+
"source",
|
26
|
+
"targets"
|
27
|
+
],
|
28
|
+
"additionalProperties": false
|
29
|
+
},
|
30
|
+
"buckets": {
|
31
|
+
"type": "object",
|
32
|
+
"additionalProperties": {
|
33
|
+
"type": "object",
|
34
|
+
"properties": {
|
35
|
+
"include": {
|
36
|
+
"type": "array",
|
37
|
+
"items": {
|
38
|
+
"anyOf": [
|
39
|
+
{
|
40
|
+
"type": "string"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"type": "object",
|
44
|
+
"properties": {
|
45
|
+
"path": {
|
46
|
+
"type": "string"
|
47
|
+
},
|
48
|
+
"delimiter": {
|
49
|
+
"type": [
|
50
|
+
"string",
|
51
|
+
"null"
|
52
|
+
],
|
53
|
+
"enum": [
|
54
|
+
"-",
|
55
|
+
"_",
|
56
|
+
null
|
57
|
+
]
|
58
|
+
}
|
59
|
+
},
|
60
|
+
"required": [
|
61
|
+
"path"
|
62
|
+
],
|
63
|
+
"additionalProperties": false
|
64
|
+
}
|
65
|
+
]
|
66
|
+
},
|
67
|
+
"default": []
|
68
|
+
},
|
69
|
+
"exclude": {
|
70
|
+
"type": "array",
|
71
|
+
"items": {
|
72
|
+
"anyOf": [
|
73
|
+
{
|
74
|
+
"type": "string"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"$ref": "#/properties/buckets/additionalProperties/properties/include/items/anyOf/1"
|
78
|
+
}
|
79
|
+
]
|
80
|
+
},
|
81
|
+
"default": []
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"additionalProperties": false
|
85
|
+
},
|
86
|
+
"propertyNames": {
|
87
|
+
"enum": [
|
88
|
+
"android",
|
89
|
+
"csv",
|
90
|
+
"flutter",
|
91
|
+
"html",
|
92
|
+
"json",
|
93
|
+
"markdown",
|
94
|
+
"xcode-strings",
|
95
|
+
"xcode-stringsdict",
|
96
|
+
"xcode-xcstrings",
|
97
|
+
"yaml",
|
98
|
+
"yaml-root-key",
|
99
|
+
"properties",
|
100
|
+
"po",
|
101
|
+
"xliff",
|
102
|
+
"xml",
|
103
|
+
"srt",
|
104
|
+
"dato",
|
105
|
+
"compiler",
|
106
|
+
"vtt",
|
107
|
+
"php",
|
108
|
+
"po"
|
109
|
+
]
|
110
|
+
},
|
111
|
+
"default": {}
|
112
|
+
},
|
113
|
+
"$schema": {
|
114
|
+
"type": "string",
|
115
|
+
"default": "https://lingo.dev/schema/i18n.json"
|
116
|
+
}
|
117
|
+
},
|
118
|
+
"required": [
|
119
|
+
"locale"
|
120
|
+
],
|
121
|
+
"additionalProperties": false,
|
122
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
123
|
+
}
|
package/build/index.cjs
CHANGED
@@ -318,7 +318,8 @@ var bucketTypes = [
|
|
318
318
|
"dato",
|
319
319
|
"compiler",
|
320
320
|
"vtt",
|
321
|
-
"php"
|
321
|
+
"php",
|
322
|
+
"po"
|
322
323
|
];
|
323
324
|
var bucketTypeSchema = _zod2.default.enum(bucketTypes);
|
324
325
|
|
@@ -469,7 +470,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
469
470
|
version: 1.3
|
470
471
|
})
|
471
472
|
});
|
472
|
-
var
|
473
|
+
var configSchema = "https://lingo.dev/schema/i18n.json";
|
474
|
+
var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
475
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
476
|
+
$schema: _zod2.default.string().default(configSchema)
|
477
|
+
}),
|
478
|
+
createDefaultValue: (baseDefaultValue) => ({
|
479
|
+
...baseDefaultValue,
|
480
|
+
version: 1.4,
|
481
|
+
$schema: configSchema
|
482
|
+
}),
|
483
|
+
createUpgrader: (oldConfig) => ({
|
484
|
+
...oldConfig,
|
485
|
+
version: 1.4,
|
486
|
+
$schema: configSchema
|
487
|
+
})
|
488
|
+
});
|
489
|
+
var LATEST_CONFIG_DEFINITION = configV1_4Definition;
|
473
490
|
function parseI18nConfig(rawConfig) {
|
474
491
|
try {
|
475
492
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -501,4 +518,6 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
501
518
|
|
502
519
|
|
503
520
|
|
504
|
-
|
521
|
+
|
522
|
+
|
523
|
+
exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; 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.defaultConfig = defaultConfig; exports.getAlternativeLocaleCodes = getAlternativeLocaleCodes; 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.parseI18nConfig = parseI18nConfig; exports.resolveLocaleCode = resolveLocaleCode; exports.resolveOverridenLocale = resolveOverridenLocale;
|
package/build/index.d.cts
CHANGED
@@ -77,8 +77,8 @@ declare const getAlternativeLocaleCodes: (locale: string) => string[];
|
|
77
77
|
declare const getLocaleCodeDelimiter: (locale: string) => string | null;
|
78
78
|
declare const resolveOverridenLocale: (locale: string, delimiter?: "-" | "_" | null) => string;
|
79
79
|
|
80
|
-
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"];
|
81
|
-
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>;
|
80
|
+
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"];
|
81
|
+
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>;
|
82
82
|
|
83
83
|
declare const localeSchema: Z.ZodObject<{
|
84
84
|
source: Z.ZodEffects<Z.ZodString, string, string>;
|
@@ -111,7 +111,7 @@ declare const configV1Definition: ConfigDefinition<Z.objectUtil.extendShape<{
|
|
111
111
|
source: string;
|
112
112
|
targets: string[];
|
113
113
|
}>;
|
114
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
114
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
115
115
|
}>, Z.ZodRawShape>;
|
116
116
|
declare const configV1_1Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
117
117
|
version: Z.ZodDefault<Z.ZodNumber>;
|
@@ -126,9 +126,9 @@ declare const configV1_1Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
126
126
|
source: string;
|
127
127
|
targets: string[];
|
128
128
|
}>;
|
129
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
129
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
130
130
|
}>, {
|
131
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
131
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
132
132
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
133
133
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
134
134
|
}, "strip", Z.ZodTypeAny, {
|
@@ -152,9 +152,9 @@ declare const configV1_2Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
152
152
|
source: string;
|
153
153
|
targets: string[];
|
154
154
|
}>;
|
155
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
155
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
156
156
|
}>, {
|
157
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
157
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
158
158
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
159
159
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
160
160
|
}, "strip", Z.ZodTypeAny, {
|
@@ -204,9 +204,9 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
204
204
|
source: string;
|
205
205
|
targets: string[];
|
206
206
|
}>;
|
207
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
207
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
208
208
|
}>, {
|
209
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
209
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
210
210
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
211
211
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
212
212
|
}, "strip", Z.ZodTypeAny, {
|
@@ -232,7 +232,7 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
232
232
|
extraSource?: string | undefined;
|
233
233
|
}>;
|
234
234
|
}>, {
|
235
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
235
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
236
236
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
237
237
|
path: Z.ZodString;
|
238
238
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -273,7 +273,7 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
273
273
|
})[] | undefined;
|
274
274
|
}>>>;
|
275
275
|
}>, Z.ZodRawShape>;
|
276
|
-
declare const
|
276
|
+
declare const configV1_4Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
277
277
|
version: Z.ZodDefault<Z.ZodNumber>;
|
278
278
|
}, {
|
279
279
|
locale: Z.ZodObject<{
|
@@ -286,9 +286,9 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
286
286
|
source: string;
|
287
287
|
targets: string[];
|
288
288
|
}>;
|
289
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
289
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
290
290
|
}>, {
|
291
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
291
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
292
292
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
293
293
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
294
294
|
}, "strip", Z.ZodTypeAny, {
|
@@ -314,7 +314,7 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
314
314
|
extraSource?: string | undefined;
|
315
315
|
}>;
|
316
316
|
}>, {
|
317
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
317
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
318
318
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
319
319
|
path: Z.ZodString;
|
320
320
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -354,6 +354,92 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
354
354
|
delimiter?: "-" | "_" | null | undefined;
|
355
355
|
})[] | undefined;
|
356
356
|
}>>>;
|
357
|
+
}>, {
|
358
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
359
|
+
}>, Z.ZodRawShape>;
|
360
|
+
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
361
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
362
|
+
}, {
|
363
|
+
locale: Z.ZodObject<{
|
364
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
365
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
366
|
+
}, "strip", Z.ZodTypeAny, {
|
367
|
+
source: string;
|
368
|
+
targets: string[];
|
369
|
+
}, {
|
370
|
+
source: string;
|
371
|
+
targets: string[];
|
372
|
+
}>;
|
373
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
374
|
+
}>, {
|
375
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
376
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
377
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
378
|
+
}, "strip", Z.ZodTypeAny, {
|
379
|
+
include: string[];
|
380
|
+
exclude?: string[] | undefined;
|
381
|
+
}, {
|
382
|
+
exclude?: string[] | undefined;
|
383
|
+
include?: string[] | undefined;
|
384
|
+
}>>>;
|
385
|
+
}>, {
|
386
|
+
locale: Z.ZodObject<Z.objectUtil.extendShape<{
|
387
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
388
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
389
|
+
}, {
|
390
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
391
|
+
}>, "strip", Z.ZodTypeAny, {
|
392
|
+
source: string;
|
393
|
+
targets: string[];
|
394
|
+
extraSource?: string | undefined;
|
395
|
+
}, {
|
396
|
+
source: string;
|
397
|
+
targets: string[];
|
398
|
+
extraSource?: string | undefined;
|
399
|
+
}>;
|
400
|
+
}>, {
|
401
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
402
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
403
|
+
path: Z.ZodString;
|
404
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
405
|
+
}, "strip", Z.ZodTypeAny, {
|
406
|
+
path: string;
|
407
|
+
delimiter?: "-" | "_" | null | undefined;
|
408
|
+
}, {
|
409
|
+
path: string;
|
410
|
+
delimiter?: "-" | "_" | null | undefined;
|
411
|
+
}>]>, "many">>;
|
412
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
413
|
+
path: Z.ZodString;
|
414
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
415
|
+
}, "strip", Z.ZodTypeAny, {
|
416
|
+
path: string;
|
417
|
+
delimiter?: "-" | "_" | null | undefined;
|
418
|
+
}, {
|
419
|
+
path: string;
|
420
|
+
delimiter?: "-" | "_" | null | undefined;
|
421
|
+
}>]>, "many">>>;
|
422
|
+
}, "strip", Z.ZodTypeAny, {
|
423
|
+
include: (string | {
|
424
|
+
path: string;
|
425
|
+
delimiter?: "-" | "_" | null | undefined;
|
426
|
+
})[];
|
427
|
+
exclude?: (string | {
|
428
|
+
path: string;
|
429
|
+
delimiter?: "-" | "_" | null | undefined;
|
430
|
+
})[] | undefined;
|
431
|
+
}, {
|
432
|
+
exclude?: (string | {
|
433
|
+
path: string;
|
434
|
+
delimiter?: "-" | "_" | null | undefined;
|
435
|
+
})[] | undefined;
|
436
|
+
include?: (string | {
|
437
|
+
path: string;
|
438
|
+
delimiter?: "-" | "_" | null | undefined;
|
439
|
+
})[] | undefined;
|
440
|
+
}>>>;
|
441
|
+
}>, {
|
442
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
357
443
|
}>, Z.ZodRawShape>;
|
358
444
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
359
445
|
declare function parseI18nConfig(rawConfig: unknown): {
|
@@ -373,6 +459,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
373
459
|
delimiter?: "-" | "_" | null | undefined;
|
374
460
|
})[] | undefined;
|
375
461
|
}>>;
|
462
|
+
$schema: string;
|
376
463
|
};
|
377
464
|
declare const defaultConfig: {
|
378
465
|
version: number;
|
@@ -391,6 +478,7 @@ declare const defaultConfig: {
|
|
391
478
|
delimiter?: "-" | "_" | null | undefined;
|
392
479
|
})[] | undefined;
|
393
480
|
}>>;
|
481
|
+
$schema: string;
|
394
482
|
};
|
395
483
|
|
396
|
-
export { type BucketItem, type I18nConfig, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, defaultConfig, getAlternativeLocaleCodes, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
484
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getAlternativeLocaleCodes, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
package/build/index.d.ts
CHANGED
@@ -77,8 +77,8 @@ declare const getAlternativeLocaleCodes: (locale: string) => string[];
|
|
77
77
|
declare const getLocaleCodeDelimiter: (locale: string) => string | null;
|
78
78
|
declare const resolveOverridenLocale: (locale: string, delimiter?: "-" | "_" | null) => string;
|
79
79
|
|
80
|
-
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"];
|
81
|
-
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>;
|
80
|
+
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"];
|
81
|
+
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>;
|
82
82
|
|
83
83
|
declare const localeSchema: Z.ZodObject<{
|
84
84
|
source: Z.ZodEffects<Z.ZodString, string, string>;
|
@@ -111,7 +111,7 @@ declare const configV1Definition: ConfigDefinition<Z.objectUtil.extendShape<{
|
|
111
111
|
source: string;
|
112
112
|
targets: string[];
|
113
113
|
}>;
|
114
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
114
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
115
115
|
}>, Z.ZodRawShape>;
|
116
116
|
declare const configV1_1Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
117
117
|
version: Z.ZodDefault<Z.ZodNumber>;
|
@@ -126,9 +126,9 @@ declare const configV1_1Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
126
126
|
source: string;
|
127
127
|
targets: string[];
|
128
128
|
}>;
|
129
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
129
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
130
130
|
}>, {
|
131
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
131
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
132
132
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
133
133
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
134
134
|
}, "strip", Z.ZodTypeAny, {
|
@@ -152,9 +152,9 @@ declare const configV1_2Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
152
152
|
source: string;
|
153
153
|
targets: string[];
|
154
154
|
}>;
|
155
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
155
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
156
156
|
}>, {
|
157
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
157
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
158
158
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
159
159
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
160
160
|
}, "strip", Z.ZodTypeAny, {
|
@@ -204,9 +204,9 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
204
204
|
source: string;
|
205
205
|
targets: string[];
|
206
206
|
}>;
|
207
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
207
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
208
208
|
}>, {
|
209
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
209
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
210
210
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
211
211
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
212
212
|
}, "strip", Z.ZodTypeAny, {
|
@@ -232,7 +232,7 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
232
232
|
extraSource?: string | undefined;
|
233
233
|
}>;
|
234
234
|
}>, {
|
235
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
235
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
236
236
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
237
237
|
path: Z.ZodString;
|
238
238
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -273,7 +273,7 @@ declare const configV1_3Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
273
273
|
})[] | undefined;
|
274
274
|
}>>>;
|
275
275
|
}>, Z.ZodRawShape>;
|
276
|
-
declare const
|
276
|
+
declare const configV1_4Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
277
277
|
version: Z.ZodDefault<Z.ZodNumber>;
|
278
278
|
}, {
|
279
279
|
locale: Z.ZodObject<{
|
@@ -286,9 +286,9 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
286
286
|
source: string;
|
287
287
|
targets: string[];
|
288
288
|
}>;
|
289
|
-
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>>>>;
|
289
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
290
290
|
}>, {
|
291
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
291
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
292
292
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
293
293
|
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
294
294
|
}, "strip", Z.ZodTypeAny, {
|
@@ -314,7 +314,7 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
314
314
|
extraSource?: string | undefined;
|
315
315
|
}>;
|
316
316
|
}>, {
|
317
|
-
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php"]>, Z.ZodObject<{
|
317
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
318
318
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
319
319
|
path: Z.ZodString;
|
320
320
|
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
@@ -354,6 +354,92 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
354
354
|
delimiter?: "-" | "_" | null | undefined;
|
355
355
|
})[] | undefined;
|
356
356
|
}>>>;
|
357
|
+
}>, {
|
358
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
359
|
+
}>, Z.ZodRawShape>;
|
360
|
+
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
361
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
362
|
+
}, {
|
363
|
+
locale: Z.ZodObject<{
|
364
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
365
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
366
|
+
}, "strip", Z.ZodTypeAny, {
|
367
|
+
source: string;
|
368
|
+
targets: string[];
|
369
|
+
}, {
|
370
|
+
source: string;
|
371
|
+
targets: string[];
|
372
|
+
}>;
|
373
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>>>>;
|
374
|
+
}>, {
|
375
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
376
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
377
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
378
|
+
}, "strip", Z.ZodTypeAny, {
|
379
|
+
include: string[];
|
380
|
+
exclude?: string[] | undefined;
|
381
|
+
}, {
|
382
|
+
exclude?: string[] | undefined;
|
383
|
+
include?: string[] | undefined;
|
384
|
+
}>>>;
|
385
|
+
}>, {
|
386
|
+
locale: Z.ZodObject<Z.objectUtil.extendShape<{
|
387
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
388
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
389
|
+
}, {
|
390
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
391
|
+
}>, "strip", Z.ZodTypeAny, {
|
392
|
+
source: string;
|
393
|
+
targets: string[];
|
394
|
+
extraSource?: string | undefined;
|
395
|
+
}, {
|
396
|
+
source: string;
|
397
|
+
targets: string[];
|
398
|
+
extraSource?: string | undefined;
|
399
|
+
}>;
|
400
|
+
}>, {
|
401
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po"]>, Z.ZodObject<{
|
402
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
403
|
+
path: Z.ZodString;
|
404
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
405
|
+
}, "strip", Z.ZodTypeAny, {
|
406
|
+
path: string;
|
407
|
+
delimiter?: "-" | "_" | null | undefined;
|
408
|
+
}, {
|
409
|
+
path: string;
|
410
|
+
delimiter?: "-" | "_" | null | undefined;
|
411
|
+
}>]>, "many">>;
|
412
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
413
|
+
path: Z.ZodString;
|
414
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
415
|
+
}, "strip", Z.ZodTypeAny, {
|
416
|
+
path: string;
|
417
|
+
delimiter?: "-" | "_" | null | undefined;
|
418
|
+
}, {
|
419
|
+
path: string;
|
420
|
+
delimiter?: "-" | "_" | null | undefined;
|
421
|
+
}>]>, "many">>>;
|
422
|
+
}, "strip", Z.ZodTypeAny, {
|
423
|
+
include: (string | {
|
424
|
+
path: string;
|
425
|
+
delimiter?: "-" | "_" | null | undefined;
|
426
|
+
})[];
|
427
|
+
exclude?: (string | {
|
428
|
+
path: string;
|
429
|
+
delimiter?: "-" | "_" | null | undefined;
|
430
|
+
})[] | undefined;
|
431
|
+
}, {
|
432
|
+
exclude?: (string | {
|
433
|
+
path: string;
|
434
|
+
delimiter?: "-" | "_" | null | undefined;
|
435
|
+
})[] | undefined;
|
436
|
+
include?: (string | {
|
437
|
+
path: string;
|
438
|
+
delimiter?: "-" | "_" | null | undefined;
|
439
|
+
})[] | undefined;
|
440
|
+
}>>>;
|
441
|
+
}>, {
|
442
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
357
443
|
}>, Z.ZodRawShape>;
|
358
444
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
359
445
|
declare function parseI18nConfig(rawConfig: unknown): {
|
@@ -373,6 +459,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
373
459
|
delimiter?: "-" | "_" | null | undefined;
|
374
460
|
})[] | undefined;
|
375
461
|
}>>;
|
462
|
+
$schema: string;
|
376
463
|
};
|
377
464
|
declare const defaultConfig: {
|
378
465
|
version: number;
|
@@ -391,6 +478,7 @@ declare const defaultConfig: {
|
|
391
478
|
delimiter?: "-" | "_" | null | undefined;
|
392
479
|
})[] | undefined;
|
393
480
|
}>>;
|
481
|
+
$schema: string;
|
394
482
|
};
|
395
483
|
|
396
|
-
export { type BucketItem, type I18nConfig, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, defaultConfig, getAlternativeLocaleCodes, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
484
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getAlternativeLocaleCodes, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
package/build/index.mjs
CHANGED
@@ -318,7 +318,8 @@ var bucketTypes = [
|
|
318
318
|
"dato",
|
319
319
|
"compiler",
|
320
320
|
"vtt",
|
321
|
-
"php"
|
321
|
+
"php",
|
322
|
+
"po"
|
322
323
|
];
|
323
324
|
var bucketTypeSchema = Z2.enum(bucketTypes);
|
324
325
|
|
@@ -469,7 +470,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
469
470
|
version: 1.3
|
470
471
|
})
|
471
472
|
});
|
472
|
-
var
|
473
|
+
var configSchema = "https://lingo.dev/schema/i18n.json";
|
474
|
+
var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
475
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
476
|
+
$schema: Z3.string().default(configSchema)
|
477
|
+
}),
|
478
|
+
createDefaultValue: (baseDefaultValue) => ({
|
479
|
+
...baseDefaultValue,
|
480
|
+
version: 1.4,
|
481
|
+
$schema: configSchema
|
482
|
+
}),
|
483
|
+
createUpgrader: (oldConfig) => ({
|
484
|
+
...oldConfig,
|
485
|
+
version: 1.4,
|
486
|
+
$schema: configSchema
|
487
|
+
})
|
488
|
+
});
|
489
|
+
var LATEST_CONFIG_DEFINITION = configV1_4Definition;
|
473
490
|
function parseI18nConfig(rawConfig) {
|
474
491
|
try {
|
475
492
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -480,6 +497,7 @@ function parseI18nConfig(rawConfig) {
|
|
480
497
|
}
|
481
498
|
var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
482
499
|
export {
|
500
|
+
LATEST_CONFIG_DEFINITION,
|
483
501
|
bucketItemSchema,
|
484
502
|
bucketTypeSchema,
|
485
503
|
bucketTypes,
|
@@ -488,6 +506,7 @@ export {
|
|
488
506
|
configV1_1Definition,
|
489
507
|
configV1_2Definition,
|
490
508
|
configV1_3Definition,
|
509
|
+
configV1_4Definition,
|
491
510
|
defaultConfig,
|
492
511
|
getAlternativeLocaleCodes,
|
493
512
|
getLocaleCodeDelimiter,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lingo.dev/_spec",
|
3
|
-
"version": "0.25.
|
3
|
+
"version": "0.25.2",
|
4
4
|
"description": "Lingo.dev open specification",
|
5
5
|
"private": false,
|
6
6
|
"publishConfig": {
|
@@ -20,14 +20,17 @@
|
|
20
20
|
"dependencies": {
|
21
21
|
"typescript": "^5.7.2",
|
22
22
|
"vitest": "^2.1.8",
|
23
|
-
"zod": "^3.24.1"
|
23
|
+
"zod": "^3.24.1",
|
24
|
+
"zod-to-json-schema": "^3.24.3"
|
24
25
|
},
|
25
26
|
"devDependencies": {
|
27
|
+
"@types/node": "^22.13.5",
|
26
28
|
"tsup": "^8.3.5"
|
27
29
|
},
|
28
30
|
"scripts": {
|
29
31
|
"dev": "tsup --watch",
|
30
32
|
"build": "tsc --noEmit && tsup",
|
31
|
-
"test": "vitest run"
|
33
|
+
"test": "vitest run",
|
34
|
+
"test:watch": "vitest"
|
32
35
|
}
|
33
36
|
}
|