@lingo.dev/_spec 0.25.1 → 0.25.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 +124 -0
- package/build/index.cjs +22 -3
- package/build/index.d.cts +105 -17
- package/build/index.d.ts +105 -17
- package/build/index.mjs +21 -2
- package/package.json +6 -3
@@ -0,0 +1,124 @@
|
|
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
|
+
"vue-json"
|
110
|
+
]
|
111
|
+
},
|
112
|
+
"default": {}
|
113
|
+
},
|
114
|
+
"$schema": {
|
115
|
+
"type": "string",
|
116
|
+
"default": "https://lingo.dev/schema/i18n.json"
|
117
|
+
}
|
118
|
+
},
|
119
|
+
"required": [
|
120
|
+
"locale"
|
121
|
+
],
|
122
|
+
"additionalProperties": false,
|
123
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
124
|
+
}
|
package/build/index.cjs
CHANGED
@@ -319,7 +319,8 @@ var bucketTypes = [
|
|
319
319
|
"compiler",
|
320
320
|
"vtt",
|
321
321
|
"php",
|
322
|
-
"po"
|
322
|
+
"po",
|
323
|
+
"vue-json"
|
323
324
|
];
|
324
325
|
var bucketTypeSchema = _zod2.default.enum(bucketTypes);
|
325
326
|
|
@@ -470,7 +471,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
470
471
|
version: 1.3
|
471
472
|
})
|
472
473
|
});
|
473
|
-
var
|
474
|
+
var configSchema = "https://lingo.dev/schema/i18n.json";
|
475
|
+
var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
476
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
477
|
+
$schema: _zod2.default.string().default(configSchema)
|
478
|
+
}),
|
479
|
+
createDefaultValue: (baseDefaultValue) => ({
|
480
|
+
...baseDefaultValue,
|
481
|
+
version: 1.4,
|
482
|
+
$schema: configSchema
|
483
|
+
}),
|
484
|
+
createUpgrader: (oldConfig) => ({
|
485
|
+
...oldConfig,
|
486
|
+
version: 1.4,
|
487
|
+
$schema: configSchema
|
488
|
+
})
|
489
|
+
});
|
490
|
+
var LATEST_CONFIG_DEFINITION = configV1_4Definition;
|
474
491
|
function parseI18nConfig(rawConfig) {
|
475
492
|
try {
|
476
493
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -502,4 +519,6 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
502
519
|
|
503
520
|
|
504
521
|
|
505
|
-
|
522
|
+
|
523
|
+
|
524
|
+
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", "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"]>;
|
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", "vue-json"];
|
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", "vue-json"]>;
|
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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>, 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", "vue-json"]>, 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", "vue-json"]>>>>;
|
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", "vue-json"]>, 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", "vue-json"]>, 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): {
|
@@ -363,7 +449,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
363
449
|
targets: string[];
|
364
450
|
extraSource?: string | undefined;
|
365
451
|
};
|
366
|
-
buckets: Partial<Record<"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", {
|
452
|
+
buckets: Partial<Record<"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" | "vue-json", {
|
367
453
|
include: (string | {
|
368
454
|
path: string;
|
369
455
|
delimiter?: "-" | "_" | null | undefined;
|
@@ -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;
|
@@ -381,7 +468,7 @@ declare const defaultConfig: {
|
|
381
468
|
targets: string[];
|
382
469
|
extraSource?: string | undefined;
|
383
470
|
};
|
384
|
-
buckets: Partial<Record<"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", {
|
471
|
+
buckets: Partial<Record<"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" | "vue-json", {
|
385
472
|
include: (string | {
|
386
473
|
path: string;
|
387
474
|
delimiter?: "-" | "_" | null | undefined;
|
@@ -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", "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"]>;
|
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", "vue-json"];
|
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", "vue-json"]>;
|
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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>, 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", "vue-json"]>, 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", "po"]>>>>;
|
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", "vue-json"]>>>>;
|
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", "po"]>, 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", "vue-json"]>, 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", "po"]>, 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", "vue-json"]>, 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", "vue-json"]>>>>;
|
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", "vue-json"]>, 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", "vue-json"]>, 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): {
|
@@ -363,7 +449,7 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
363
449
|
targets: string[];
|
364
450
|
extraSource?: string | undefined;
|
365
451
|
};
|
366
|
-
buckets: Partial<Record<"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", {
|
452
|
+
buckets: Partial<Record<"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" | "vue-json", {
|
367
453
|
include: (string | {
|
368
454
|
path: string;
|
369
455
|
delimiter?: "-" | "_" | null | undefined;
|
@@ -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;
|
@@ -381,7 +468,7 @@ declare const defaultConfig: {
|
|
381
468
|
targets: string[];
|
382
469
|
extraSource?: string | undefined;
|
383
470
|
};
|
384
|
-
buckets: Partial<Record<"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", {
|
471
|
+
buckets: Partial<Record<"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" | "vue-json", {
|
385
472
|
include: (string | {
|
386
473
|
path: string;
|
387
474
|
delimiter?: "-" | "_" | null | undefined;
|
@@ -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
@@ -319,7 +319,8 @@ var bucketTypes = [
|
|
319
319
|
"compiler",
|
320
320
|
"vtt",
|
321
321
|
"php",
|
322
|
-
"po"
|
322
|
+
"po",
|
323
|
+
"vue-json"
|
323
324
|
];
|
324
325
|
var bucketTypeSchema = Z2.enum(bucketTypes);
|
325
326
|
|
@@ -470,7 +471,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
470
471
|
version: 1.3
|
471
472
|
})
|
472
473
|
});
|
473
|
-
var
|
474
|
+
var configSchema = "https://lingo.dev/schema/i18n.json";
|
475
|
+
var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
476
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
477
|
+
$schema: Z3.string().default(configSchema)
|
478
|
+
}),
|
479
|
+
createDefaultValue: (baseDefaultValue) => ({
|
480
|
+
...baseDefaultValue,
|
481
|
+
version: 1.4,
|
482
|
+
$schema: configSchema
|
483
|
+
}),
|
484
|
+
createUpgrader: (oldConfig) => ({
|
485
|
+
...oldConfig,
|
486
|
+
version: 1.4,
|
487
|
+
$schema: configSchema
|
488
|
+
})
|
489
|
+
});
|
490
|
+
var LATEST_CONFIG_DEFINITION = configV1_4Definition;
|
474
491
|
function parseI18nConfig(rawConfig) {
|
475
492
|
try {
|
476
493
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -481,6 +498,7 @@ function parseI18nConfig(rawConfig) {
|
|
481
498
|
}
|
482
499
|
var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
483
500
|
export {
|
501
|
+
LATEST_CONFIG_DEFINITION,
|
484
502
|
bucketItemSchema,
|
485
503
|
bucketTypeSchema,
|
486
504
|
bucketTypes,
|
@@ -489,6 +507,7 @@ export {
|
|
489
507
|
configV1_1Definition,
|
490
508
|
configV1_2Definition,
|
491
509
|
configV1_3Definition,
|
510
|
+
configV1_4Definition,
|
492
511
|
defaultConfig,
|
493
512
|
getAlternativeLocaleCodes,
|
494
513
|
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.3",
|
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
|
}
|