diff --git a/calFactory/CalendarService.ts b/calFactory/CalendarService.ts index 9b4182cd..452a6694 100644 --- a/calFactory/CalendarService.ts +++ b/calFactory/CalendarService.ts @@ -1,10 +1,10 @@ +import { Log } from './Log'; import { CreationError, FetchError } from './Error'; import { role } from './common'; -import { Log } from './Log'; declare const exports: typeof import('./Error') & typeof import('./common') & typeof import('./Log'); -exports.FetchError; -exports.CreationError; exports.Log; +exports.CreationError; +exports.FetchError; type Calendar = GoogleAppsScript.Calendar.Calendar; type AclRule = GoogleAppsScript.Calendar.Schema.AclRule; type CalendarWithRules = Calendar & { rules: AclRule[], name: string, id: string, toString: () => string; }; diff --git a/calFactory/main.ts b/calFactory/main.ts index 6371e78f..328cc5e0 100644 --- a/calFactory/main.ts +++ b/calFactory/main.ts @@ -31,15 +31,15 @@ import { CalendarService } from "./CalendarService"; import { SheetInterpreter } from "./SheetInterpreter"; import { Log } from './Log'; declare const exports: typeof import('./CalendarService') & typeof import('./SheetInterpreter') & typeof import('./Log'); -exports.CalendarService; +exports.Log; // Be careful about the order of the `exports` statement. +exports.CalendarService; // `CalenderService` uses Log class; this must be after `exports.Log` statement. exports.SheetInterpreter; -exports.Log; const main = () => { + const logs = new Log(); const sheetInterpreter = new SheetInterpreter(env.SHEET_ID, env.TERM_TABLE); const calendarService = new CalendarService(); - const logs = new Log(); sheetInterpreter.getCalendarNamesInSheet().forEach(calName => { try { const cal = calendarService.getOrCreateCalendarByName(calName);