mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-31 19:21:33 -07:00
e64ff1a0ee
- Add `subminer anime` / `--anime` and a tray entry to open a browser that searches installed Aniyomi extension sources, shows cover art and episodes, and plays into mpv with overlay/mining attached - Add an Extensions tab to add repos and install/update/remove sources, and per-source settings for sources needing config - Support searching all sources at once with streaming, per-source results and status - Prefer Japanese audio/subtitle tracks from the source and keep the primary subtitle slot reserved for Japanese - Fix window/tray/Dock handling so the browser and mpv can be switched between without quitting the app or losing the Dock icon - Add anime.repos, anime.extensionsDir, anime.preferredQuality config keys (no bundled repos or discovery)
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
function buildScript(name: string): string {
|
|
const packageJson = JSON.parse(
|
|
fs.readFileSync(path.join(import.meta.dir, '..', 'package.json'), 'utf8'),
|
|
) as { scripts: Record<string, string> };
|
|
return packageJson.scripts[name] ?? '';
|
|
}
|
|
|
|
test('build:syncui bundles the sandboxed preload and keeps Electron external', () => {
|
|
const command = buildScript('build:syncui');
|
|
|
|
assert.match(command, /src\/preload-syncui\.ts/);
|
|
assert.match(command, /--bundle/);
|
|
assert.match(command, /--external:electron/);
|
|
assert.match(command, /--outfile=dist\/preload-syncui\.js/);
|
|
});
|
|
|
|
test('build:animeui bundles the sandboxed preload and keeps Electron external', () => {
|
|
const command = buildScript('build:animeui');
|
|
|
|
// The preload imports IPC_CHANNELS, so it must be bundled rather than
|
|
// emitted by plain tsc with a relative runtime require.
|
|
assert.match(command, /src\/preload-animeui\.ts/);
|
|
assert.match(command, /--bundle/);
|
|
assert.match(command, /--external:electron/);
|
|
assert.match(command, /--outfile=dist\/preload-animeui\.js/);
|
|
});
|
|
|
|
test('build:animeui runs as part of the top-level build', () => {
|
|
assert.match(buildScript('build'), /bun run build:animeui/);
|
|
});
|