refactor(main): modularize runtime and harden anilist setup flow

This commit is contained in:
2026-02-19 16:04:59 -08:00
parent 58f28b7b55
commit 162be118e1
73 changed files with 4413 additions and 1251 deletions

View File

@@ -0,0 +1,24 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { parseArgs } from './config';
test('parseArgs captures passthrough args for app subcommand', () => {
const parsed = parseArgs(['app', '--anilist', '--log-level', 'debug'], 'subminer', {});
assert.equal(parsed.appPassthrough, true);
assert.deepEqual(parsed.appArgs, ['--anilist', '--log-level', 'debug']);
});
test('parseArgs supports bin alias for app subcommand', () => {
const parsed = parseArgs(['bin', '--anilist-status'], 'subminer', {});
assert.equal(parsed.appPassthrough, true);
assert.deepEqual(parsed.appArgs, ['--anilist-status']);
});
test('parseArgs keeps all args after app verbatim', () => {
const parsed = parseArgs(['app', '--start', '--anilist-setup', '-h'], 'subminer', {});
assert.equal(parsed.appPassthrough, true);
assert.deepEqual(parsed.appArgs, ['--start', '--anilist-setup', '-h']);
});