diff options
author | 2022-01-27 01:02:02 +0100 | |
---|---|---|
committer | 2022-02-08 21:43:17 +0100 | |
commit | da610a51f49807d1409f36b98e06e89447a4202b (patch) | |
tree | a4f7911f45ca52626ef02f370c3f260d33f8272e /packages/main/src/infrastructure | |
parent | refactor: Coding conventions (diff) | |
download | sophie-da610a51f49807d1409f36b98e06e89447a4202b.tar.gz sophie-da610a51f49807d1409f36b98e06e89447a4202b.tar.zst sophie-da610a51f49807d1409f36b98e06e89447a4202b.zip |
refactor: Extract config handling
Move the handling of the contents of the config file out of the stores
and into dedicated files to simplify the code of the stores.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/infrastructure')
-rw-r--r-- | packages/main/src/infrastructure/config/ConfigRepository.ts | 2 | ||||
-rw-r--r-- | packages/main/src/infrastructure/config/impl/ConfigFile.ts (renamed from packages/main/src/infrastructure/config/ConfigFile.ts) | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/packages/main/src/infrastructure/config/ConfigRepository.ts b/packages/main/src/infrastructure/config/ConfigRepository.ts index 0ce7fc1..e00f5a0 100644 --- a/packages/main/src/infrastructure/config/ConfigRepository.ts +++ b/packages/main/src/infrastructure/config/ConfigRepository.ts | |||
@@ -18,7 +18,7 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | import type { Config } from '../../stores/SharedStore'; | 21 | import type Config from '../../stores/config/Config'; |
22 | import type Disposer from '../../utils/Disposer'; | 22 | import type Disposer from '../../utils/Disposer'; |
23 | 23 | ||
24 | export type ReadConfigResult = | 24 | export type ReadConfigResult = |
diff --git a/packages/main/src/infrastructure/config/ConfigFile.ts b/packages/main/src/infrastructure/config/impl/ConfigFile.ts index 193a20d..90ee187 100644 --- a/packages/main/src/infrastructure/config/ConfigFile.ts +++ b/packages/main/src/infrastructure/config/impl/ConfigFile.ts | |||
@@ -25,12 +25,11 @@ import path from 'node:path'; | |||
25 | import JSON5 from 'json5'; | 25 | import JSON5 from 'json5'; |
26 | import { throttle } from 'lodash-es'; | 26 | import { throttle } from 'lodash-es'; |
27 | 27 | ||
28 | import type { Config } from '../../stores/SharedStore'; | 28 | import type Config from '../../../stores/config/Config'; |
29 | import type Disposer from '../../utils/Disposer'; | 29 | import type Disposer from '../../../utils/Disposer'; |
30 | import { getLogger } from '../../utils/log'; | 30 | import { getLogger } from '../../../utils/log'; |
31 | 31 | import type ConfigRepository from '../ConfigRepository'; | |
32 | import type ConfigRepository from './ConfigRepository'; | 32 | import type ReadConfigResult from '../ReadConfigResult'; |
33 | import type ReadConfigResult from './ReadConfigResult'; | ||
34 | 33 | ||
35 | const log = getLogger('ConfigFile'); | 34 | const log = getLogger('ConfigFile'); |
36 | 35 | ||