11#!/usr/bin/env bun
22import { Command } from 'commander' ;
3- import { validate } from './validate .js' ;
3+ import { loadConfig , resolveSchema , resolveSpacePath , resolveTemplateDir } from './config .js' ;
44import { diagram } from './diagram.js' ;
5- import { show } from './show.js' ;
65import { dump } from './dump.js' ;
7- import { templateSync } from './template-sync.js' ;
86import { miroSync } from './miro/sync.js' ;
9- import { loadConfig , resolveSchema , resolveSpacePath , resolveTemplateDir } from './config.js' ;
7+ import { show } from './show.js' ;
8+ import { templateSync } from './template-sync.js' ;
9+ import { validate } from './validate.js' ;
1010
1111const program = new Command ( ) ;
1212
@@ -22,7 +22,10 @@ program
2222 . option ( '-s, --schema <path>' , 'Path to JSON schema file' )
2323 . action ( ( spaceOrDir , options ) => {
2424 const config = loadConfig ( ) ;
25- validate ( resolveSpacePath ( spaceOrDir , config ) , { ...options , schema : resolveSchema ( options . schema , config ) } ) ;
25+ validate ( resolveSpacePath ( spaceOrDir , config ) , {
26+ ...options ,
27+ schema : resolveSchema ( options . schema , config ) ,
28+ } ) ;
2629 } ) ;
2730
2831program
@@ -33,7 +36,10 @@ program
3336 . option ( '-s, --schema <path>' , 'Path to JSON schema file' )
3437 . action ( ( spaceOrDir , options ) => {
3538 const config = loadConfig ( ) ;
36- diagram ( resolveSpacePath ( spaceOrDir , config ) , { ...options , schema : resolveSchema ( options . schema , config ) } ) ;
39+ diagram ( resolveSpacePath ( spaceOrDir , config ) , {
40+ ...options ,
41+ schema : resolveSchema ( options . schema , config ) ,
42+ } ) ;
3743 } ) ;
3844
3945program
@@ -65,7 +71,10 @@ program
6571 . option ( '--dry-run' , 'Preview changes without writing files' )
6672 . action ( ( templateDir , options ) => {
6773 const config = loadConfig ( ) ;
68- templateSync ( resolveTemplateDir ( templateDir , config ) , { ...options , schema : resolveSchema ( options . schema , config ) } ) ;
74+ templateSync ( resolveTemplateDir ( templateDir , config ) , {
75+ ...options ,
76+ schema : resolveSchema ( options . schema , config ) ,
77+ } ) ;
6978 } ) ;
7079
7180program . parse ( ) ;
0 commit comments