99 * npm run dev -- tsc
1010 */
1111
12- import { getConfig } from './src/config.mjs' ;
12+ import { Command } from 'commander' ;
13+
14+ import environmentConfig from './src/config.mjs' ;
1315import * as github from './src/github.mjs' ;
1416import * as google from './src/google.mjs' ;
1517import * as hackmd from './src/hackmd.mjs' ;
1618import * as meetings from './src/meeting.mjs' ;
1719
20+ const program = new Command ( ) ;
21+ program
22+ . argument ( '<group>' , 'Meeting group' )
23+ . option ( '--dry-run' , 'Show output without creating/updating anything' , false )
24+ . option ( '--verbose' , 'Show debug output' )
25+ . parse ( process . argv ) ;
26+
1827// Step 1: Application configuration
19- const config = getConfig ( ) ;
28+ /** @type {import('./src/types').AppConfig } */
29+ const config = {
30+ ...environmentConfig ,
31+ ...program . opts ( ) ,
32+ meetingGroup : program . args [ 0 ] ,
33+ } ;
2034
2135// Step 2: Initialize Google Calendar client with API Key
2236const calendarClient = google . createCalendarClient ( config . google ) ;
@@ -30,6 +44,28 @@ const meetingConfig = await meetings.readMeetingConfig(config);
3044// Step 5: Initialize HackMD client with meeting configuration
3145const hackmdClient = hackmd . createHackMDClient ( config , meetingConfig ) ;
3246
47+ if ( config . dryRun ) {
48+ const gitHubAgendaIssues = await github . getAgendaIssues (
49+ githubClient ,
50+ config ,
51+ meetingConfig
52+ ) ;
53+
54+ const meetingAgenda = meetings . generateMeetingAgenda ( gitHubAgendaIssues ) ;
55+
56+ const issueContent = await meetings . generateMeetingIssue (
57+ config ,
58+ meetingConfig ,
59+ new Date ( ) ,
60+ meetingAgenda ,
61+ ''
62+ ) ;
63+
64+ console . log ( issueContent ) ;
65+
66+ process . exit ( 0 ) ;
67+ }
68+
3369// Step 6: Find next meeting event in calendar
3470const event = await google . findNextMeetingEvent ( calendarClient , meetingConfig ) ;
3571
0 commit comments