@@ -3,6 +3,7 @@ import { globbySync } from 'globby';
33import path from 'path' ;
44import { fileURLToPath } from 'url' ;
55import { zod2md } from 'zod2md' ;
6+ import { convertSchemas , formatModelsAsMarkdown } from 'zod2md' ;
67
78const __filename = fileURLToPath ( import . meta. url ) ;
89const __dirname = path . dirname ( __filename ) ;
@@ -228,6 +229,24 @@ async function main() {
228229 await fs . writeFile ( OUTPUT_FILE , out , 'utf8' ) ;
229230 console . log ( `Wrote ${ OUTPUT_FILE } ` ) ;
230231
232+ // Special case: Software Schema (malware + tool)
233+ const sdoIndex = await import ( path . join ( SCHEMA_DIR , 'sdo/index.ts' ) ) ;
234+ const { malwareSchema, toolSchema } = sdoIndex ;
235+
236+ // Compose models for both schemas
237+ const models = convertSchemas ( [
238+ { schema : malwareSchema , path : 'sdo/malware.schema.ts' , name : 'Malware' } ,
239+ { schema : toolSchema , path : 'sdo/tool.schema.ts' , name : 'Tool' } ,
240+ ] ) ;
241+ const softwareMarkdown = formatModelsAsMarkdown ( models , {
242+ title : 'Software Schema' ,
243+ } ) ;
244+
245+ const softwareOutputFile = path . join ( OUTPUT_DIR , 'sdo' , 'software.schema.mdx' ) ;
246+ await fs . ensureDir ( path . dirname ( softwareOutputFile ) ) ;
247+ await fs . writeFile ( softwareOutputFile , softwareMarkdown , 'utf8' ) ;
248+ console . log ( `Wrote ${ softwareOutputFile } ` ) ;
249+
231250 // --- Schema file generation ---
232251 const schemaFiles = globbySync ( [ '**/*.schema.ts' ] , { cwd : SCHEMA_DIR } ) ;
233252
0 commit comments