mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-27 00:55:16 -07:00
feat(config): show default keybindings in generated example config (#64)
- Expand `keybindings` array in `config.example.jsonc` to list all built-in defaults instead of `[]` - Inject `DEFAULT_KEYBINDINGS` into template when resolved config has an empty keybindings array - Add regression tests for template parity, default binding compile/action mapping, overlay keyboard dispatch, and mpv plugin registration/dispatch - Add fullscreen binding to docs shortcut tables and clarify keybindings can target mpv commands or session actions
This commit is contained in:
@@ -4,7 +4,13 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import { ConfigService, ConfigStartupParseError } from './service';
|
||||
import { DEFAULT_CONFIG, RUNTIME_OPTION_REGISTRY, deepMergeRawConfig } from './definitions';
|
||||
import {
|
||||
DEFAULT_CONFIG,
|
||||
DEFAULT_KEYBINDINGS,
|
||||
RUNTIME_OPTION_REGISTRY,
|
||||
deepMergeRawConfig,
|
||||
} from './definitions';
|
||||
import { parseConfigContent } from './parse';
|
||||
import { generateConfigTemplate } from './template';
|
||||
|
||||
function makeTempDir(): string {
|
||||
@@ -2218,3 +2224,12 @@ test('template generator includes known keys', () => {
|
||||
/"launchAtStartup": true,? \/\/ Launch texthooker server automatically when SubMiner starts\. Values: true \| false/,
|
||||
);
|
||||
});
|
||||
|
||||
test('template generator shows built-in default keybindings in the keybindings array', () => {
|
||||
const output = generateConfigTemplate(DEFAULT_CONFIG);
|
||||
const parsed = parseConfigContent('config.example.jsonc', output) as {
|
||||
keybindings?: unknown;
|
||||
};
|
||||
|
||||
assert.deepEqual(parsed.keybindings, DEFAULT_KEYBINDINGS);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user