@lingo.dev/_spec 0.25.1 → 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 +20 -2
- package/build/index.d.cts +90 -2
- package/build/index.d.ts +90 -2
- package/build/index.mjs +19 -1
- 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
@@ -470,7 +470,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
470
470
|
version: 1.3
|
471
471
|
})
|
472
472
|
});
|
473
|
-
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;
|
474
490
|
function parseI18nConfig(rawConfig) {
|
475
491
|
try {
|
476
492
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -502,4 +518,6 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
502
518
|
|
503
519
|
|
504
520
|
|
505
|
-
|
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
@@ -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<{
|
@@ -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
@@ -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<{
|
@@ -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
@@ -470,7 +470,23 @@ var configV1_3Definition = extendConfigDefinition(configV1_2Definition, {
|
|
470
470
|
version: 1.3
|
471
471
|
})
|
472
472
|
});
|
473
|
-
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;
|
474
490
|
function parseI18nConfig(rawConfig) {
|
475
491
|
try {
|
476
492
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -481,6 +497,7 @@ function parseI18nConfig(rawConfig) {
|
|
481
497
|
}
|
482
498
|
var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
483
499
|
export {
|
500
|
+
LATEST_CONFIG_DEFINITION,
|
484
501
|
bucketItemSchema,
|
485
502
|
bucketTypeSchema,
|
486
503
|
bucketTypes,
|
@@ -489,6 +506,7 @@ export {
|
|
489
506
|
configV1_1Definition,
|
490
507
|
configV1_2Definition,
|
491
508
|
configV1_3Definition,
|
509
|
+
configV1_4Definition,
|
492
510
|
defaultConfig,
|
493
511
|
getAlternativeLocaleCodes,
|
494
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
|
}
|