style: restore repo formatting

This commit is contained in:
2026-03-09 18:10:32 -07:00
parent a34a7489db
commit fed60c265d
85 changed files with 641 additions and 143 deletions

View File

@@ -1,9 +1,6 @@
interface ElectronSecondInstanceAppLike {
requestSingleInstanceLock: () => boolean;
on: (
event: 'second-instance',
listener: (_event: unknown, argv: string[]) => void,
) => unknown;
on: (event: 'second-instance', listener: (_event: unknown, argv: string[]) => void) => unknown;
}
let cachedSingleInstanceLock: boolean | null = null;

View File

@@ -8,7 +8,9 @@ type ConfigHotReloadAppliedDeps = {
refreshGlobalAndOverlayShortcuts: () => void;
setSecondarySubMode: (mode: SecondarySubMode) => void;
broadcastToOverlayWindows: (channel: string, payload: unknown) => void;
applyAnkiRuntimeConfigPatch: (patch: { ai: ResolvedConfig['ankiConnect']['ai']['enabled'] }) => void;
applyAnkiRuntimeConfigPatch: (patch: {
ai: ResolvedConfig['ankiConnect']['ai']['enabled'];
}) => void;
};
type ConfigHotReloadMessageDeps = {

View File

@@ -65,7 +65,9 @@ export function createBuildConfigHotReloadAppliedMainDepsHandler(deps: {
refreshGlobalAndOverlayShortcuts: () => void;
setSecondarySubMode: (mode: SecondarySubMode) => void;
broadcastToOverlayWindows: (channel: string, payload: unknown) => void;
applyAnkiRuntimeConfigPatch: (patch: { ai: ResolvedConfig['ankiConnect']['ai']['enabled'] }) => void;
applyAnkiRuntimeConfigPatch: (patch: {
ai: ResolvedConfig['ankiConnect']['ai']['enabled'];
}) => void;
}) {
return () => ({
setKeybindings: (keybindings: ConfigHotReloadPayload['keybindings']) =>

View File

@@ -73,10 +73,7 @@ test('installFirstRunPluginToDefaultLocation installs plugin and backs up existi
assert.equal(result.ok, true);
assert.equal(result.pluginInstallStatus, 'installed');
assert.equal(detectInstalledFirstRunPlugin(installPaths), true);
assert.equal(
fs.readFileSync(installPaths.pluginEntrypointPath, 'utf8'),
'-- packaged plugin',
);
assert.equal(fs.readFileSync(installPaths.pluginEntrypointPath, 'utf8'), '-- packaged plugin');
assert.equal(fs.readFileSync(installPaths.pluginConfigPath, 'utf8'), 'configured=true\n');
const scriptsDirEntries = fs.readdirSync(installPaths.scriptsDir);
@@ -121,14 +118,8 @@ test('installFirstRunPluginToDefaultLocation installs plugin to Windows mpv defa
assert.equal(result.ok, true);
assert.equal(result.pluginInstallStatus, 'installed');
assert.equal(detectInstalledFirstRunPlugin(installPaths), true);
assert.equal(
fs.readFileSync(installPaths.pluginEntrypointPath, 'utf8'),
'-- packaged plugin',
);
assert.equal(
fs.readFileSync(installPaths.pluginConfigPath, 'utf8'),
'configured=true\n',
);
assert.equal(fs.readFileSync(installPaths.pluginEntrypointPath, 'utf8'), '-- packaged plugin');
assert.equal(fs.readFileSync(installPaths.pluginConfigPath, 'utf8'), 'configured=true\n');
});
});

View File

@@ -22,10 +22,7 @@ function resolveLegacyPluginDebugLoaderPath(installPaths: MpvInstallPaths): stri
function rewriteInstalledWindowsPluginConfig(configPath: string): void {
const content = fs.readFileSync(configPath, 'utf8');
const updated = content.replace(
/^socket_path=.*$/m,
'socket_path=\\\\.\\pipe\\subminer-socket',
);
const updated = content.replace(/^socket_path=.*$/m, 'socket_path=\\\\.\\pipe\\subminer-socket');
if (updated !== content) {
fs.writeFileSync(configPath, updated, 'utf8');
}

View File

@@ -279,9 +279,7 @@ export function buildFirstRunSetupHtml(model: FirstRunSetupHtmlModel): string {
</html>`;
}
export function parseFirstRunSetupSubmissionUrl(
rawUrl: string,
): FirstRunSetupSubmission | null {
export function parseFirstRunSetupSubmissionUrl(rawUrl: string): FirstRunSetupSubmission | null {
if (!rawUrl.startsWith('subminer://first-run-setup')) {
return null;
}

View File

@@ -32,7 +32,10 @@ export function resolveWindowsMpvShortcutPaths(options: {
desktopDir: string;
}): WindowsMpvShortcutPaths {
return {
startMenuPath: path.join(resolveWindowsStartMenuProgramsDir(options.appDataDir), WINDOWS_MPV_SHORTCUT_NAME),
startMenuPath: path.join(
resolveWindowsStartMenuProgramsDir(options.appDataDir),
WINDOWS_MPV_SHORTCUT_NAME,
),
desktopPath: path.join(options.desktopDir, WINDOWS_MPV_SHORTCUT_NAME),
};
}