All files / backend/dist/adapters dev-adapters.js

11.11% Statements 3/27
0% Branches 0/9
13.63% Functions 3/22
11.11% Lines 3/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86        3x           3x                                 3x                                                                                                                    
/**
 * Development adapters - Minimal implementations for standalone development
 */
function createNoopMenuAdapter() {
    return {
        setMenuItemEnabled: () => { },
        createMainMenu: () => { },
    };
}
function createDevAppInfoAdapter() {
    return {
        isPackaged: () => false,
        getAppPath: () => process.cwd(),
        getVersion: () => '0.0.0-dev',
        getPath: (name) => {
            switch (name) {
                case 'home':
                    return process.env.HOME || process.env.USERPROFILE || '/tmp';
                case 'temp':
                    return process.env.TMPDIR || process.env.TEMP || '/tmp';
                default:
                    return process.cwd();
            }
        },
    };
}
export function createDevAdapters() {
    return {
        menu: createNoopMenuAdapter(),
        window: {
            reloadMainWindow: () => {
                console.log('[DEV] reloadMainWindow called');
            },
            sendToRenderer: () => {
                console.log('[DEV] sendToRenderer called');
            },
            openSiteLibrary: async () => {
                console.log('[DEV] openSiteLibrary called');
            },
            setMenuBarVisibility: () => {
                console.log('[DEV] setMenuBarVisibility called');
            },
            appendToOutputConsole: () => {
                console.log('[DEV] appendToOutputConsole called');
            },
        },
        dialog: {
            showOpenDialog: async () => {
                console.log('[DEV] showOpenDialog called');
                return [];
            },
            showSaveDialog: async () => {
                console.log('[DEV] showSaveDialog called');
                return undefined;
            },
            showMessageBox: async () => {
                console.log('[DEV] showMessageBox called');
                return 0;
            },
        },
        shell: {
            openExternal: async (url) => {
                console.log('[DEV] openExternal called:', url);
            },
            showItemInFolder: (fullPath) => {
                console.log('[DEV] showItemInFolder called:', fullPath);
            },
            openPath: async (path) => {
                console.log('[DEV] openPath called:', path);
                return '';
            },
        },
        outputConsole: {
            appendLine: (line) => {
                console.log('[Hugo Output]', line);
            },
        },
        screenshotWindowManager: {
            createScreenshotAndFavicon: (host, port, outputDir) => {
                console.log('[DEV] createScreenshotAndFavicon called:', host, port, outputDir);
            },
        },
        appInfo: createDevAppInfoAdapter(),
    };
}