Skip to content

Commit b3e8bf0

Browse files
committed
refactor: 위젯 스냅샷 구현 의존성 방향 정리
1 parent 8dd04c5 commit b3e8bf0

8 files changed

Lines changed: 25 additions & 29 deletions

File tree

Application/DevLogPersistence/Project.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ let project = Project.devlogFramework(
1111
dependencies: [
1212
.project(target: "DevLogData", path: "../DevLogData"),
1313
.project(target: "DevLogCore", path: "../DevLogCore"),
14-
.project(target: "DevLogWidgetCore", path: "../../Widget/DevLogWidgetCore"),
1514
],
1615
hasTests: true
1716
)

Application/DevLogPersistence/Sources/PersistenceAssembler.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import DevLogCore
99
import DevLogData
10-
import DevLogWidgetCore
1110

1211
public final class PersistenceAssembler: Assembler {
1312
public init() { }
@@ -28,26 +27,5 @@ public final class PersistenceAssembler: Assembler {
2827
container.register(WebPageImageStore.self) {
2928
WebPageImageStoreImpl()
3029
}
31-
32-
container.register(WidgetSharedDefaultsStore.self) {
33-
WidgetSharedDefaultsStore()
34-
}
35-
36-
container.register(WidgetSnapshotStore.self) {
37-
WidgetSnapshotStore(
38-
store: container.resolve(WidgetSharedDefaultsStore.self)
39-
)
40-
}
41-
42-
container.register(WidgetSnapshotPreferenceStore.self) {
43-
WidgetSnapshotPreferenceStoreImpl()
44-
}
45-
46-
container.register(WidgetSnapshotUpdater.self) {
47-
WidgetSnapshotUpdaterImpl(
48-
snapshotStore: container.resolve(WidgetSnapshotStore.self),
49-
preferenceStore: container.resolve(WidgetSnapshotPreferenceStore.self)
50-
)
51-
}
5230
}
5331
}

Application/DevLogWidget/Project.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ let project = Project.devlogFramework(
1111
dependencies: [
1212
.project(target: "DevLogData", path: "../DevLogData"),
1313
.project(target: "DevLogCore", path: "../DevLogCore"),
14+
.project(target: "DevLogWidgetCore", path: "../../Widget/DevLogWidgetCore"),
1415
],
1516
hasTests: true
1617
)

Application/DevLogWidget/Sources/Widget/WidgetAssembler.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import DevLogCore
99
import DevLogData
10+
import DevLogWidgetCore
1011

1112
public final class WidgetAssembler: Assembler {
1213
public init() { }
@@ -19,6 +20,23 @@ public final class WidgetAssembler: Assembler {
1920
container.register(WidgetSyncEventBus.self) {
2021
WidgetSyncEventBusImpl()
2122
}
23+
container.register(WidgetSharedDefaultsStore.self) {
24+
WidgetSharedDefaultsStore()
25+
}
26+
container.register(WidgetSnapshotStore.self) {
27+
WidgetSnapshotStore(
28+
store: container.resolve(WidgetSharedDefaultsStore.self)
29+
)
30+
}
31+
container.register(WidgetSnapshotPreferenceStore.self) {
32+
WidgetSnapshotPreferenceStoreImpl()
33+
}
34+
container.register(WidgetSnapshotUpdater.self) {
35+
WidgetSnapshotUpdaterImpl(
36+
snapshotStore: container.resolve(WidgetSnapshotStore.self),
37+
preferenceStore: container.resolve(WidgetSnapshotPreferenceStore.self)
38+
)
39+
}
2240
container.register(WidgetSyncEventHandler.self) {
2341
WidgetSyncEventHandler(
2442
eventBus: container.resolve(WidgetSyncEventBus.self),

Application/DevLogPersistence/Sources/Widget/WidgetSnapshotPreferenceStoreImpl.swift renamed to Application/DevLogWidget/Sources/Widget/WidgetSnapshotPreferenceStoreImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// WidgetSnapshotPreferenceStoreImpl.swift
3-
// DevLogPersistence
3+
// DevLogWidget
44
//
55
// Created by opfic on 4/30/26.
66
//

Application/DevLogPersistence/Sources/Widget/WidgetSnapshotUpdaterImpl.swift renamed to Application/DevLogWidget/Sources/Widget/WidgetSnapshotUpdaterImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// WidgetSnapshotUpdaterImpl.swift
3-
// DevLogPersistence
3+
// DevLogWidget
44
//
55
// Created by opfic on 4/30/26.
66
//

Application/DevLogPersistence/Tests/Persistence/WidgetSnapshotPreferenceStoreTests.swift renamed to Application/DevLogWidget/Tests/Widget/WidgetSnapshotPreferenceStoreTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
22
// WidgetSnapshotPreferenceStoreTests.swift
3-
// DevLogPersistenceTests
3+
// DevLogWidgetTests
44
//
55
// Created by opfic on 4/30/26.
66
//
77

88
import Foundation
99
import DevLogCore
1010
import Testing
11-
@testable import DevLogPersistence
11+
@testable import DevLogWidget
1212

1313
struct WidgetSnapshotPreferenceStoreTests {
1414
@Test("Heatmap activity kind 설정이 비어 있으면 전체 kind를 사용한다")

Application/DevLogPersistence/Tests/Persistence/WidgetSnapshotUpdaterTests.swift renamed to Application/DevLogWidget/Tests/Widget/WidgetSnapshotUpdaterTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// WidgetSnapshotUpdaterTests.swift
3-
// DevLogPersistenceTests
3+
// DevLogWidgetTests
44
//
55
// Created by opfic on 4/30/26.
66
//
@@ -9,7 +9,7 @@ import Foundation
99
import DevLogCore
1010
import DevLogData
1111
import Testing
12-
@testable import DevLogPersistence
12+
@testable import DevLogWidget
1313
@testable import DevLogWidgetCore
1414

1515
struct WidgetSnapshotUpdaterTests {

0 commit comments

Comments
 (0)