super-productivity/packages/plugin-dev/sync-md/src/background/background.ts
Johannes Millan 11f119555d feat(plugins): pass Log class through plugin system to sync-md
- Add log property to PluginAPI interface and implementation
- Extend PluginBridgeService to provide Log.withContext for each plugin
- Create simplified logger helper for sync-md plugin with fallback
- Replace console.log statements in sync-md with centralized logging
- All plugin logs now integrate with main app's Log class and history
2025-07-12 16:30:45 +02:00

21 lines
626 B
TypeScript

import { initSyncManager } from './sync/sync-manager';
import { initUiBridge } from './ui-bridge';
import { loadLocalConfig } from './local-config';
import { log } from '../shared/logger';
export const initPlugin = (): void => {
log.log('initPlugin called');
// Initialize UI bridge to handle messages
initUiBridge();
log.log('UI bridge initialized');
// Load saved config from local storage and start sync if enabled
const config = loadLocalConfig();
log.log('Loaded config:', config);
if (config?.filePath) {
// Transform config to match sync-manager expectations
initSyncManager(config);
}
};