mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-30 18:12:08 -07:00
feat(core): add Electron runtime, services, and app composition
This commit is contained in:
33
src/config/resolve.ts
Normal file
33
src/config/resolve.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ConfigValidationWarning, RawConfig, ResolvedConfig } from '../types';
|
||||
import { applyAnkiConnectResolution } from './resolve/anki-connect';
|
||||
import { createResolveContext } from './resolve/context';
|
||||
import { applyCoreDomainConfig } from './resolve/core-domains';
|
||||
import { applyImmersionTrackingConfig } from './resolve/immersion-tracking';
|
||||
import { applyIntegrationConfig } from './resolve/integrations';
|
||||
import { applySubtitleDomainConfig } from './resolve/subtitle-domains';
|
||||
import { applyTopLevelConfig } from './resolve/top-level';
|
||||
|
||||
const APPLY_RESOLVE_STEPS = [
|
||||
applyTopLevelConfig,
|
||||
applyCoreDomainConfig,
|
||||
applySubtitleDomainConfig,
|
||||
applyIntegrationConfig,
|
||||
applyImmersionTrackingConfig,
|
||||
applyAnkiConnectResolution,
|
||||
] as const;
|
||||
|
||||
export function resolveConfig(raw: RawConfig): {
|
||||
resolved: ResolvedConfig;
|
||||
warnings: ConfigValidationWarning[];
|
||||
} {
|
||||
const { context, warnings } = createResolveContext(raw);
|
||||
|
||||
for (const applyStep of APPLY_RESOLVE_STEPS) {
|
||||
applyStep(context);
|
||||
}
|
||||
|
||||
return {
|
||||
resolved: context.resolved,
|
||||
warnings,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user