refactor(sync-ui): split runtime into focused modules

- Extract sync-ui-runtime.ts into sync-ui-hosts-state, sync-ui-ipc-handlers, sync-ui-run-lifecycle, sync-ui-snapshots
- Reject sync --ui combined with --remote-cmd or --db in cli-parser-builder
This commit is contained in:
2026-07-12 23:04:59 -07:00
parent 247549fcfe
commit 89e5ac60f6
7 changed files with 416 additions and 285 deletions
+17 -1
View File
@@ -87,7 +87,10 @@ test('parseCliPrograms lowers sync options into app-owned CLI tokens', () => {
const makeTemp = parseCliPrograms(['sync', '--make-temp'], 'subminer');
assert.deepEqual(makeTemp.invocations.syncCliTokens, ['--make-temp']);
const removeTemp = parseCliPrograms(['sync', '--remove-temp', '/tmp/subminer-sync-x'], 'subminer');
const removeTemp = parseCliPrograms(
['sync', '--remove-temp', '/tmp/subminer-sync-x'],
'subminer',
);
assert.deepEqual(removeTemp.invocations.syncCliTokens, ['--remove-temp', '/tmp/subminer-sync-x']);
});
@@ -112,3 +115,16 @@ test('parseCliPrograms captures sync --ui', () => {
/--ui cannot be combined/,
);
});
test('parseCliPrograms rejects sync --ui with --remote-cmd', () => {
assert.throws(
() => parseCliPrograms(['sync', '--ui', '--remote-cmd', '/opt/SubMiner.AppImage'], 'subminer'),
{ message: 'Sync --ui cannot be combined with other sync options.' },
);
});
test('parseCliPrograms rejects sync --ui with --db', () => {
assert.throws(() => parseCliPrograms(['sync', '--ui', '--db', '/tmp/db.sqlite'], 'subminer'), {
message: 'Sync --ui cannot be combined with other sync options.',
});
});
+2
View File
@@ -340,6 +340,8 @@ export function parseCliPrograms(
check ||
makeTemp ||
removeTemp ||
options.remoteCmd !== undefined ||
options.db !== undefined ||
options.json === true ||
options.force === true
) {