feat: remove unnecessary export default for better tree-shaking

This commit is contained in:
JellyBrick
2025-09-06 22:31:02 +09:00
parent 26fa1f85b2
commit c1a06ab955
29 changed files with 53 additions and 81 deletions

View File

@ -2,7 +2,7 @@ import path from 'node:path';
import { app, BrowserWindow, ipcMain } from 'electron';
import config from '@/config';
import * as config from '@/config';
export const restart = () => restartInternal();

View File

@ -2,5 +2,3 @@ export const getSongMenu = () =>
document.querySelector<HTMLElement>(
'ytmusic-menu-popup-renderer tp-yt-paper-listbox',
);
export default { getSongMenu };

View File

@ -2,7 +2,7 @@ import path from 'node:path';
import { app, type BrowserWindow } from 'electron';
import getSongControls from './song-controls';
import { getSongControls } from './song-controls';
export const APP_PROTOCOL = 'youtubemusic';
@ -36,10 +36,3 @@ export function changeProtocolHandler(
) {
protocolHandler = f;
}
export default {
APP_PROTOCOL,
setupProtocolHandler,
handleProtocol,
changeProtocolHandler,
};

View File

@ -36,7 +36,7 @@ const parseStringFromArgsType = (args: ArgsType<string>) => {
}
};
export default (win: BrowserWindow) => {
export const getSongControls = (win: BrowserWindow) => {
return {
// Playback
previous: () => win.webContents.send('ytmd:previous-video'),

View File

@ -189,7 +189,7 @@ export const setupAutoPlayChangedListener = singleton(() => {
});
});
export default (api: YoutubePlayer) => {
export const setupSongInfo = (api: YoutubePlayer) => {
window.ipcRenderer.on('ytmd:setup-time-changed-listener', () => {
setupTimeChangedListener();
});

View File

@ -2,7 +2,7 @@ import { type BrowserWindow, ipcMain, nativeImage, net } from 'electron';
import { Mutex } from 'async-mutex';
import config from '@/config';
import * as config from '@/config';
import type { GetPlayerResponse } from '@/types/get-player-response';