@ucdjs/schema-gen 0.1.0 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,47 +5,54 @@ import { z } from "zod";
5
5
 
6
6
  //#region src/fields.ts
7
7
  const SYSTEM_PROMOT = dedent`
8
- <system_prompt>
9
- <role>Expert TypeScript code generator specializing in interfaces and documentation</role>
8
+ <system_prompt>
9
+ <role>Expert TypeScript code generator specializing in interfaces and documentation</role>
10
10
 
11
- <task>
12
- <input>Text description: {{INPUT}}</input>
13
- <output>TypeScript interface with comprehensive JSDoc comments</output>
14
- </task>
11
+ <task>
12
+ <input>Text description: {{INPUT}}</input>
13
+ <output>TypeScript interface with comprehensive JSDoc comments</output>
14
+ </task>
15
15
 
16
- <requirements>
17
- <field_processing>
18
- - Extract all relevant fields from text
19
- - Convert field names to snake_case
20
- - Preserve original order
21
- </field_processing>
16
+ <requirements>
17
+ <field_processing>
18
+ - Extract all relevant fields from text
19
+ - Convert field names to snake_case
20
+ - Preserve original order
21
+ </field_processing>
22
22
 
23
- <documentation>
24
- - JSDoc for each property only
25
- - Document union types with double quotes (no enums)
26
- - Explain constraints and formats with examples
27
- - No JSDoc for the main interface
28
- </documentation>
23
+ <documentation>
24
+ - JSDoc for each property only
25
+ - Document union types with double quotes (no enums)
26
+ - Explain constraints and formats with examples
27
+ - No JSDoc for the main interface
28
+ </documentation>
29
29
 
30
- <structure>
31
- - Single interface named after the input file name without version numbers (e.g., ArabicShaping not ArabicShaping-16.0.0)
32
- - No additional interfaces or arrays
33
- - Create ordered keys array named [INTERFACE_NAME]_FIELDS using SCREAMING_SNAKE_CASE
34
- - Convert the interface name to SCREAMING_SNAKE_CASE by inserting underscores between camelCase words
35
- - Use double quotes for field names in the keys array
36
- - No example data or additional declarations
37
- - Export all variables and interfaces
38
- </structure>
39
- </requirements>
30
+ <structure>
31
+ - Use the file name from the first line of the input (ignoring version numbers) as the interface name
32
+ - Single interface named after the input file name without version numbers (e.g., ArabicShaping not ArabicShaping-16.0.0)
33
+ - No additional interfaces or arrays
34
+ - Create ordered keys array named [INTERFACE_NAME]_FIELDS using SCREAMING_SNAKE_CASE
35
+ - Convert the interface name to SCREAMING_SNAKE_CASE by inserting underscores between camelCase words
36
+ - Use double quotes for field names in the keys array
37
+ - No example data or additional declarations
38
+ - Export all variables and interfaces
39
+ </structure>
40
40
 
41
- <format>Single TypeScript code block containing only the interface and fields array, both exported</format>
41
+ <formatting>
42
+ - Use 2 space indentation
43
+ - Use trailing commas in all multi-line structures
44
+ - Use trailing commas in arrays and interfaces
45
+ </formatting>
46
+ </requirements>
42
47
 
43
- <examples>
44
- - Interface: NamedSequences -> Fields array: NAMED_SEQUENCES_FIELDS
45
- - Interface: NamedSequencesProv -> Fields array: NAMED_SEQUENCES_PROV_FIELDS
46
- - Interface: ArabicShaping -> Fields array: ARABIC_SHAPING_FIELDS
47
- </examples>
48
- </system_prompt>
48
+ <format>Single TypeScript code block containing only the interface and fields array, both exported</format>
49
+
50
+ <examples>
51
+ - Interface: NamedSequences -> Fields array: NAMED_SEQUENCES_FIELDS
52
+ - Interface: NamedSequencesProv -> Fields array: NAMED_SEQUENCES_PROV_FIELDS
53
+ - Interface: ArabicShaping -> Fields array: ARABIC_SHAPING_FIELDS
54
+ </examples>
55
+ </system_prompt>
49
56
  `;
50
57
  async function generateFields(options) {
51
58
  const { datafile, apiKey } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucdjs/schema-gen",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Lucas Nørgård",