@lingo.dev/_spec 0.40.0 → 0.40.1

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.
@@ -3,29 +3,34 @@
3
3
  "properties": {
4
4
  "version": {
5
5
  "type": "number",
6
- "default": 0
6
+ "default": 0,
7
+ "description": "The version number of the schema."
7
8
  },
8
9
  "locale": {
9
10
  "type": "object",
10
11
  "properties": {
11
12
  "source": {
12
- "type": "string"
13
+ "type": "string",
14
+ "description": "Primary source locale code of your content (e.g. 'en', 'en-US', 'pt_BR', or 'pt-rBR'). Must be one of the supported locale codes – either a short ISO-639 language code or a full locale identifier using '-', '_' or Android '-r' notation."
13
15
  },
14
16
  "targets": {
15
17
  "type": "array",
16
18
  "items": {
17
19
  "$ref": "#/properties/locale/properties/source"
18
- }
20
+ },
21
+ "description": "List of target locale codes to translate to."
19
22
  },
20
23
  "extraSource": {
21
- "$ref": "#/properties/locale/properties/source"
24
+ "$ref": "#/properties/locale/properties/targets/items",
25
+ "description": "Optional extra source locale code used as fallback during translation."
22
26
  }
23
27
  },
24
28
  "required": [
25
29
  "source",
26
30
  "targets"
27
31
  ],
28
- "additionalProperties": false
32
+ "additionalProperties": false,
33
+ "description": "Locale configuration block."
29
34
  },
30
35
  "buckets": {
31
36
  "type": "object",
@@ -43,7 +48,8 @@
43
48
  "type": "object",
44
49
  "properties": {
45
50
  "path": {
46
- "type": "string"
51
+ "type": "string",
52
+ "description": "Path pattern containing a [locale] placeholder."
47
53
  },
48
54
  "delimiter": {
49
55
  "type": [
@@ -54,17 +60,20 @@
54
60
  "-",
55
61
  "_",
56
62
  null
57
- ]
63
+ ],
64
+ "description": "Delimiter that replaces the [locale] placeholder in the path (default: no delimiter)."
58
65
  }
59
66
  },
60
67
  "required": [
61
68
  "path"
62
69
  ],
63
- "additionalProperties": false
70
+ "additionalProperties": false,
71
+ "description": "Bucket path item. Either a string path or an object specifying path and delimiter."
64
72
  }
65
73
  ]
66
74
  },
67
- "default": []
75
+ "default": [],
76
+ "description": "Glob patterns or bucket items to include for this bucket."
68
77
  },
69
78
  "exclude": {
70
79
  "type": "array",
@@ -78,37 +87,43 @@
78
87
  }
79
88
  ]
80
89
  },
81
- "default": []
90
+ "default": [],
91
+ "description": "Glob patterns or bucket items to exclude from this bucket."
82
92
  },
83
93
  "injectLocale": {
84
94
  "type": "array",
85
95
  "items": {
86
96
  "type": "string"
87
- }
97
+ },
98
+ "description": "Keys within files where the current locale should be injected or removed."
88
99
  },
89
100
  "lockedKeys": {
90
101
  "type": "array",
91
102
  "items": {
92
103
  "type": "string"
93
104
  },
94
- "default": []
105
+ "default": [],
106
+ "description": "Keys that must remain unchanged and should never be overwritten by translations."
95
107
  },
96
108
  "lockedPatterns": {
97
109
  "type": "array",
98
110
  "items": {
99
111
  "type": "string"
100
112
  },
101
- "default": []
113
+ "default": [],
114
+ "description": "Regular expression patterns whose matched content should remain locked during translation."
102
115
  },
103
116
  "ignoredKeys": {
104
117
  "type": "array",
105
118
  "items": {
106
119
  "type": "string"
107
120
  },
108
- "default": []
121
+ "default": [],
122
+ "description": "Keys that should be completely ignored by translation processes."
109
123
  }
110
124
  },
111
- "additionalProperties": false
125
+ "additionalProperties": false,
126
+ "description": "Configuration options for a translation bucket."
112
127
  },
113
128
  "propertyNames": {
114
129
  "enum": [
@@ -161,16 +176,20 @@
161
176
  "ollama",
162
177
  "openrouter",
163
178
  "mistral"
164
- ]
179
+ ],
180
+ "description": "Identifier of the translation provider service."
165
181
  },
166
182
  "model": {
167
- "type": "string"
183
+ "type": "string",
184
+ "description": "Model name to use for translations."
168
185
  },
169
186
  "prompt": {
170
- "type": "string"
187
+ "type": "string",
188
+ "description": "Prompt template used when requesting translations."
171
189
  },
172
190
  "baseUrl": {
173
- "type": "string"
191
+ "type": "string",
192
+ "description": "Custom base URL for the provider API (optional)."
174
193
  }
175
194
  },
176
195
  "required": [
@@ -178,7 +197,8 @@
178
197
  "model",
179
198
  "prompt"
180
199
  ],
181
- "additionalProperties": false
200
+ "additionalProperties": false,
201
+ "description": "Configuration for the machine-translation provider."
182
202
  }
183
203
  },
184
204
  "required": [
package/build/index.cjs CHANGED
@@ -363,9 +363,13 @@ var bucketTypeSchema = _zod2.default.enum(bucketTypes);
363
363
  // src/config.ts
364
364
 
365
365
  var localeSchema = _zod2.default.object({
366
- source: localeCodeSchema,
367
- targets: _zod2.default.array(localeCodeSchema)
368
- });
366
+ source: localeCodeSchema.describe(
367
+ "Primary source locale code of your content (e.g. 'en', 'en-US', 'pt_BR', or 'pt-rBR'). Must be one of the supported locale codes \u2013 either a short ISO-639 language code or a full locale identifier using '-', '_' or Android '-r' notation."
368
+ ),
369
+ targets: _zod2.default.array(localeCodeSchema).describe(
370
+ "List of target locale codes to translate to."
371
+ )
372
+ }).describe("Locale configuration block.");
369
373
  var createConfigDefinition = (definition) => definition;
370
374
  var extendConfigDefinition = (definition, params) => {
371
375
  const schema = params.createSchema(definition.schema);
@@ -404,7 +408,7 @@ ${localeErrors.join("\n")}`);
404
408
  });
405
409
  };
406
410
  var configV0Schema = _zod2.default.object({
407
- version: _zod2.default.number().default(0)
411
+ version: _zod2.default.number().default(0).describe("The version number of the schema.")
408
412
  });
409
413
  var configV0Definition = createConfigDefinition({
410
414
  schema: configV0Schema,
@@ -416,7 +420,9 @@ var configV0Definition = createConfigDefinition({
416
420
  var configV1Definition = extendConfigDefinition(configV0Definition, {
417
421
  createSchema: (baseSchema) => baseSchema.extend({
418
422
  locale: localeSchema,
419
- buckets: _zod2.default.record(_zod2.default.string(), bucketTypeSchema).default({}).optional()
423
+ buckets: _zod2.default.record(_zod2.default.string(), bucketTypeSchema).default({}).describe(
424
+ "Mapping of source file paths (glob patterns) to bucket types."
425
+ ).optional()
420
426
  }),
421
427
  createDefaultValue: () => ({
422
428
  version: 1,
@@ -440,8 +446,12 @@ var configV1_1Definition = extendConfigDefinition(configV1Definition, {
440
446
  buckets: _zod2.default.record(
441
447
  bucketTypeSchema,
442
448
  _zod2.default.object({
443
- include: _zod2.default.array(_zod2.default.string()).default([]),
444
- exclude: _zod2.default.array(_zod2.default.string()).default([]).optional()
449
+ include: _zod2.default.array(_zod2.default.string()).default([]).describe(
450
+ "File paths or glob patterns to include for this bucket."
451
+ ),
452
+ exclude: _zod2.default.array(_zod2.default.string()).default([]).optional().describe(
453
+ "File paths or glob patterns to exclude from this bucket."
454
+ )
445
455
  })
446
456
  ).default({})
447
457
  }),
@@ -476,7 +486,9 @@ var configV1_2Definition = extendConfigDefinition(
476
486
  {
477
487
  createSchema: (baseSchema) => baseSchema.extend({
478
488
  locale: localeSchema.extend({
479
- extraSource: localeCodeSchema.optional()
489
+ extraSource: localeCodeSchema.optional().describe(
490
+ "Optional extra source locale code used as fallback during translation."
491
+ )
480
492
  })
481
493
  }),
482
494
  createDefaultValue: (baseDefaultValue) => ({
@@ -490,18 +502,20 @@ var configV1_2Definition = extendConfigDefinition(
490
502
  }
491
503
  );
492
504
  var bucketItemSchema = _zod2.default.object({
493
- path: _zod2.default.string(),
494
- delimiter: _zod2.default.union([
495
- _zod2.default.literal("-"),
496
- _zod2.default.literal("_"),
497
- _zod2.default.literal(null)
498
- ]).optional()
499
- });
505
+ path: _zod2.default.string().describe("Path pattern containing a [locale] placeholder."),
506
+ delimiter: _zod2.default.union([_zod2.default.literal("-"), _zod2.default.literal("_"), _zod2.default.literal(null)]).optional().describe(
507
+ "Delimiter that replaces the [locale] placeholder in the path (default: no delimiter)."
508
+ )
509
+ }).describe(
510
+ "Bucket path item. Either a string path or an object specifying path and delimiter."
511
+ );
500
512
  var bucketValueSchemaV1_3 = _zod2.default.object({
501
- include: _zod2.default.array(_zod2.default.union([_zod2.default.string(), bucketItemSchema])).default([]),
502
- exclude: _zod2.default.array(_zod2.default.union([_zod2.default.string(), bucketItemSchema])).default([]).optional(),
503
- injectLocale: _zod2.default.array(_zod2.default.string()).optional()
504
- });
513
+ include: _zod2.default.array(_zod2.default.union([_zod2.default.string(), bucketItemSchema])).default([]).describe("Glob patterns or bucket items to include for this bucket."),
514
+ exclude: _zod2.default.array(_zod2.default.union([_zod2.default.string(), bucketItemSchema])).default([]).optional().describe("Glob patterns or bucket items to exclude from this bucket."),
515
+ injectLocale: _zod2.default.array(_zod2.default.string()).optional().describe(
516
+ "Keys within files where the current locale should be injected or removed."
517
+ )
518
+ }).describe("Configuration options for a translation bucket.");
505
519
  var configV1_3Definition = extendConfigDefinition(
506
520
  configV1_2Definition,
507
521
  {
@@ -545,11 +559,13 @@ var providerSchema = _zod2.default.object({
545
559
  "ollama",
546
560
  "openrouter",
547
561
  "mistral"
548
- ]),
549
- model: _zod2.default.string(),
550
- prompt: _zod2.default.string(),
551
- baseUrl: _zod2.default.string().optional()
552
- });
562
+ ]).describe("Identifier of the translation provider service."),
563
+ model: _zod2.default.string().describe("Model name to use for translations."),
564
+ prompt: _zod2.default.string().describe(
565
+ "Prompt template used when requesting translations."
566
+ ),
567
+ baseUrl: _zod2.default.string().optional().describe("Custom base URL for the provider API (optional).")
568
+ }).describe("Configuration for the machine-translation provider.");
553
569
  var configV1_5Definition = extendConfigDefinition(
554
570
  configV1_4Definition,
555
571
  {
@@ -567,7 +583,9 @@ var configV1_5Definition = extendConfigDefinition(
567
583
  }
568
584
  );
569
585
  var bucketValueSchemaV1_6 = bucketValueSchemaV1_3.extend({
570
- lockedKeys: _zod2.default.array(_zod2.default.string()).default([]).optional()
586
+ lockedKeys: _zod2.default.array(_zod2.default.string()).default([]).optional().describe(
587
+ "Keys that must remain unchanged and should never be overwritten by translations."
588
+ )
571
589
  });
572
590
  var configV1_6Definition = extendConfigDefinition(
573
591
  configV1_5Definition,
@@ -586,7 +604,9 @@ var configV1_6Definition = extendConfigDefinition(
586
604
  }
587
605
  );
588
606
  var bucketValueSchemaV1_7 = bucketValueSchemaV1_6.extend({
589
- lockedPatterns: _zod2.default.array(_zod2.default.string()).default([]).optional()
607
+ lockedPatterns: _zod2.default.array(_zod2.default.string()).default([]).optional().describe(
608
+ "Regular expression patterns whose matched content should remain locked during translation."
609
+ )
590
610
  });
591
611
  var configV1_7Definition = extendConfigDefinition(
592
612
  configV1_6Definition,
@@ -605,7 +625,9 @@ var configV1_7Definition = extendConfigDefinition(
605
625
  }
606
626
  );
607
627
  var bucketValueSchemaV1_8 = bucketValueSchemaV1_7.extend({
608
- ignoredKeys: _zod2.default.array(_zod2.default.string()).default([]).optional()
628
+ ignoredKeys: _zod2.default.array(_zod2.default.string()).default([]).optional().describe(
629
+ "Keys that should be completely ignored by translation processes."
630
+ )
609
631
  });
610
632
  var configV1_8Definition = extendConfigDefinition(
611
633
  configV1_7Definition,
package/build/index.mjs CHANGED
@@ -363,9 +363,13 @@ var bucketTypeSchema = Z2.enum(bucketTypes);
363
363
  // src/config.ts
364
364
  import Z3 from "zod";
365
365
  var localeSchema = Z3.object({
366
- source: localeCodeSchema,
367
- targets: Z3.array(localeCodeSchema)
368
- });
366
+ source: localeCodeSchema.describe(
367
+ "Primary source locale code of your content (e.g. 'en', 'en-US', 'pt_BR', or 'pt-rBR'). Must be one of the supported locale codes \u2013 either a short ISO-639 language code or a full locale identifier using '-', '_' or Android '-r' notation."
368
+ ),
369
+ targets: Z3.array(localeCodeSchema).describe(
370
+ "List of target locale codes to translate to."
371
+ )
372
+ }).describe("Locale configuration block.");
369
373
  var createConfigDefinition = (definition) => definition;
370
374
  var extendConfigDefinition = (definition, params) => {
371
375
  const schema = params.createSchema(definition.schema);
@@ -404,7 +408,7 @@ ${localeErrors.join("\n")}`);
404
408
  });
405
409
  };
406
410
  var configV0Schema = Z3.object({
407
- version: Z3.number().default(0)
411
+ version: Z3.number().default(0).describe("The version number of the schema.")
408
412
  });
409
413
  var configV0Definition = createConfigDefinition({
410
414
  schema: configV0Schema,
@@ -416,7 +420,9 @@ var configV0Definition = createConfigDefinition({
416
420
  var configV1Definition = extendConfigDefinition(configV0Definition, {
417
421
  createSchema: (baseSchema) => baseSchema.extend({
418
422
  locale: localeSchema,
419
- buckets: Z3.record(Z3.string(), bucketTypeSchema).default({}).optional()
423
+ buckets: Z3.record(Z3.string(), bucketTypeSchema).default({}).describe(
424
+ "Mapping of source file paths (glob patterns) to bucket types."
425
+ ).optional()
420
426
  }),
421
427
  createDefaultValue: () => ({
422
428
  version: 1,
@@ -440,8 +446,12 @@ var configV1_1Definition = extendConfigDefinition(configV1Definition, {
440
446
  buckets: Z3.record(
441
447
  bucketTypeSchema,
442
448
  Z3.object({
443
- include: Z3.array(Z3.string()).default([]),
444
- exclude: Z3.array(Z3.string()).default([]).optional()
449
+ include: Z3.array(Z3.string()).default([]).describe(
450
+ "File paths or glob patterns to include for this bucket."
451
+ ),
452
+ exclude: Z3.array(Z3.string()).default([]).optional().describe(
453
+ "File paths or glob patterns to exclude from this bucket."
454
+ )
445
455
  })
446
456
  ).default({})
447
457
  }),
@@ -476,7 +486,9 @@ var configV1_2Definition = extendConfigDefinition(
476
486
  {
477
487
  createSchema: (baseSchema) => baseSchema.extend({
478
488
  locale: localeSchema.extend({
479
- extraSource: localeCodeSchema.optional()
489
+ extraSource: localeCodeSchema.optional().describe(
490
+ "Optional extra source locale code used as fallback during translation."
491
+ )
480
492
  })
481
493
  }),
482
494
  createDefaultValue: (baseDefaultValue) => ({
@@ -490,18 +502,20 @@ var configV1_2Definition = extendConfigDefinition(
490
502
  }
491
503
  );
492
504
  var bucketItemSchema = Z3.object({
493
- path: Z3.string(),
494
- delimiter: Z3.union([
495
- Z3.literal("-"),
496
- Z3.literal("_"),
497
- Z3.literal(null)
498
- ]).optional()
499
- });
505
+ path: Z3.string().describe("Path pattern containing a [locale] placeholder."),
506
+ delimiter: Z3.union([Z3.literal("-"), Z3.literal("_"), Z3.literal(null)]).optional().describe(
507
+ "Delimiter that replaces the [locale] placeholder in the path (default: no delimiter)."
508
+ )
509
+ }).describe(
510
+ "Bucket path item. Either a string path or an object specifying path and delimiter."
511
+ );
500
512
  var bucketValueSchemaV1_3 = Z3.object({
501
- include: Z3.array(Z3.union([Z3.string(), bucketItemSchema])).default([]),
502
- exclude: Z3.array(Z3.union([Z3.string(), bucketItemSchema])).default([]).optional(),
503
- injectLocale: Z3.array(Z3.string()).optional()
504
- });
513
+ include: Z3.array(Z3.union([Z3.string(), bucketItemSchema])).default([]).describe("Glob patterns or bucket items to include for this bucket."),
514
+ exclude: Z3.array(Z3.union([Z3.string(), bucketItemSchema])).default([]).optional().describe("Glob patterns or bucket items to exclude from this bucket."),
515
+ injectLocale: Z3.array(Z3.string()).optional().describe(
516
+ "Keys within files where the current locale should be injected or removed."
517
+ )
518
+ }).describe("Configuration options for a translation bucket.");
505
519
  var configV1_3Definition = extendConfigDefinition(
506
520
  configV1_2Definition,
507
521
  {
@@ -545,11 +559,13 @@ var providerSchema = Z3.object({
545
559
  "ollama",
546
560
  "openrouter",
547
561
  "mistral"
548
- ]),
549
- model: Z3.string(),
550
- prompt: Z3.string(),
551
- baseUrl: Z3.string().optional()
552
- });
562
+ ]).describe("Identifier of the translation provider service."),
563
+ model: Z3.string().describe("Model name to use for translations."),
564
+ prompt: Z3.string().describe(
565
+ "Prompt template used when requesting translations."
566
+ ),
567
+ baseUrl: Z3.string().optional().describe("Custom base URL for the provider API (optional).")
568
+ }).describe("Configuration for the machine-translation provider.");
553
569
  var configV1_5Definition = extendConfigDefinition(
554
570
  configV1_4Definition,
555
571
  {
@@ -567,7 +583,9 @@ var configV1_5Definition = extendConfigDefinition(
567
583
  }
568
584
  );
569
585
  var bucketValueSchemaV1_6 = bucketValueSchemaV1_3.extend({
570
- lockedKeys: Z3.array(Z3.string()).default([]).optional()
586
+ lockedKeys: Z3.array(Z3.string()).default([]).optional().describe(
587
+ "Keys that must remain unchanged and should never be overwritten by translations."
588
+ )
571
589
  });
572
590
  var configV1_6Definition = extendConfigDefinition(
573
591
  configV1_5Definition,
@@ -586,7 +604,9 @@ var configV1_6Definition = extendConfigDefinition(
586
604
  }
587
605
  );
588
606
  var bucketValueSchemaV1_7 = bucketValueSchemaV1_6.extend({
589
- lockedPatterns: Z3.array(Z3.string()).default([]).optional()
607
+ lockedPatterns: Z3.array(Z3.string()).default([]).optional().describe(
608
+ "Regular expression patterns whose matched content should remain locked during translation."
609
+ )
590
610
  });
591
611
  var configV1_7Definition = extendConfigDefinition(
592
612
  configV1_6Definition,
@@ -605,7 +625,9 @@ var configV1_7Definition = extendConfigDefinition(
605
625
  }
606
626
  );
607
627
  var bucketValueSchemaV1_8 = bucketValueSchemaV1_7.extend({
608
- ignoredKeys: Z3.array(Z3.string()).default([]).optional()
628
+ ignoredKeys: Z3.array(Z3.string()).default([]).optional().describe(
629
+ "Keys that should be completely ignored by translation processes."
630
+ )
609
631
  });
610
632
  var configV1_8Definition = extendConfigDefinition(
611
633
  configV1_7Definition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_spec",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "Lingo.dev open specification",
5
5
  "private": false,
6
6
  "publishConfig": {