Skip to content

Commit

Permalink
Fixes web APIs clients, refactoring using a Core module, debug HTTP r…
Browse files Browse the repository at this point in the history
…esponse
  • Loading branch information
matax87 committed Dec 5, 2023
1 parent 70d0c4f commit 3ffa4f5
Show file tree
Hide file tree
Showing 21 changed files with 289 additions and 100 deletions.
14 changes: 7 additions & 7 deletions NOICommunity.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
31178FE026FA318800BDCDAA /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31178FDF26FA318800BDCDAA /* Collection.swift */; };
311E0EC62825157800404DCE /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 311E0EC52825157800404DCE /* FirebaseMessaging */; };
3121AFDE2858B43A00248CDF /* MeetMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3121AFDD2858B43A00248CDF /* MeetMainViewController.xib */; };
3122EA5127DB6FF7007E89E6 /* SwiftCache in Frameworks */ = {isa = PBXBuildFile; productRef = 3122EA5027DB6FF7007E89E6 /* SwiftCache */; };
312BBB5B2832658600AF84F0 /* UIViewController+PresentMailCompose.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312BBB5A2832658600AF84F0 /* UIViewController+PresentMailCompose.swift */; };
312D29D8270451B600F4F4E7 /* ImageCardContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312D29D7270451B600F4F4E7 /* ImageCardContentView.swift */; };
312F5D272808250000C84598 /* AuthWelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312F5D262808250000C84598 /* AuthWelcomeViewController.swift */; };
Expand Down Expand Up @@ -104,6 +103,7 @@
317EC889283BB83E00F30B95 /* PeopleClient in Frameworks */ = {isa = PBXBuildFile; productRef = 317EC888283BB83E00F30B95 /* PeopleClient */; };
317EC88B283BB83E00F30B95 /* PeopleClientLive in Frameworks */ = {isa = PBXBuildFile; productRef = 317EC88A283BB83E00F30B95 /* PeopleClientLive */; };
317F74FA27D8B5610084E619 /* CircleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 317F74F927D8B5610084E619 /* CircleButton.swift */; };
3181B9212B1E12BD000D2A0F /* Core in Frameworks */ = {isa = PBXBuildFile; productRef = 3181B9202B1E12BD000D2A0F /* Core */; };
3182A177282CEFB7005439B4 /* NewsCardContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3182A176282CE550005439B4 /* NewsCardContentView.xib */; };
3182A178282CEFB7005439B4 /* NewsCardContentConfiguration.SharedConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3182A175282CE550005439B4 /* NewsCardContentConfiguration.SharedConfig.swift */; };
3182A179282CEFB7005439B4 /* NewsCardContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3182A174282CE550005439B4 /* NewsCardContentView.swift */; };
Expand Down Expand Up @@ -433,12 +433,12 @@
31CE9BF62701BF33005EA61A /* Kingfisher in Frameworks */,
3182F4A227DB3841005ADDAF /* AppPreferencesClient in Frameworks */,
3182F4A627DB3841005ADDAF /* EventShortClient in Frameworks */,
3181B9212B1E12BD000D2A0F /* Core in Frameworks */,
3182F4AA27DB3841005ADDAF /* EventShortTypesClient in Frameworks */,
31E058F22812F18800D1F7FE /* KeychainAccess in Frameworks */,
319C4653282BB32400946AC7 /* ArticlesClient in Frameworks */,
3182F4A427DB3841005ADDAF /* AppPreferencesClientLive in Frameworks */,
319C4655282BB32400946AC7 /* ArticlesClientLive in Frameworks */,
3122EA5127DB6FF7007E89E6 /* SwiftCache in Frameworks */,
3182F4A827DB3841005ADDAF /* EventShortClientLive in Frameworks */,
317B6F9C28118BD6008D07C0 /* AuthClient in Frameworks */,
3182F4AC27DB3841005ADDAF /* EventShortTypesClientLive in Frameworks */,
Expand Down Expand Up @@ -1017,7 +1017,6 @@
3182F4A727DB3841005ADDAF /* EventShortClientLive */,
3182F4A927DB3841005ADDAF /* EventShortTypesClient */,
3182F4AB27DB3841005ADDAF /* EventShortTypesClientLive */,
3122EA5027DB6FF7007E89E6 /* SwiftCache */,
31EF82582810517600EBE5F0 /* AppAuth */,
317B6F9B28118BD6008D07C0 /* AuthClient */,
317B6F9D28118BD6008D07C0 /* AuthClientLive */,
Expand All @@ -1028,6 +1027,7 @@
319C4654282BB32400946AC7 /* ArticlesClientLive */,
317EC888283BB83E00F30B95 /* PeopleClient */,
317EC88A283BB83E00F30B95 /* PeopleClientLive */,
3181B9202B1E12BD000D2A0F /* Core */,
);
productName = NOICommunity;
productReference = 3145D22D26B3F73F00F16787 /* NOICommunity.app */;
Expand Down Expand Up @@ -2000,10 +2000,6 @@
package = 311E0EC42825157800404DCE /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseMessaging;
};
3122EA5027DB6FF7007E89E6 /* SwiftCache */ = {
isa = XCSwiftPackageProductDependency;
productName = SwiftCache;
};
317B6F9B28118BD6008D07C0 /* AuthClient */ = {
isa = XCSwiftPackageProductDependency;
productName = AuthClient;
Expand All @@ -2020,6 +2016,10 @@
isa = XCSwiftPackageProductDependency;
productName = PeopleClientLive;
};
3181B9202B1E12BD000D2A0F /* Core */ = {
isa = XCSwiftPackageProductDependency;
productName = Core;
};
3182F4A127DB3841005ADDAF /* AppPreferencesClient */ = {
isa = XCSwiftPackageProductDependency;
productName = AppPreferencesClient;
Expand Down
2 changes: 1 addition & 1 deletion NOICommunity/Factories/DependencyContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import AuthStateStorageClient
import AuthClient
import EventShortClient
import EventShortTypesClient
import SwiftCache
import Core
import ArticlesClient
import PeopleClient

Expand Down
2 changes: 1 addition & 1 deletion NOICommunity/MoreFeature/MyAccountViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import Foundation
import Combine
import AuthClient
import SwiftCache
import Core

// MARK: - MyAccountViewModel

Expand Down
2 changes: 1 addition & 1 deletion NOICommunity/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import EventShortClientLive
import AppPreferencesClientLive
import EventShortTypesClient
import EventShortTypesClientLive
import SwiftCache
import Core
import AuthClientLive
import AuthStateStorageClient
import ArticlesClientLive
Expand Down
106 changes: 41 additions & 65 deletions NOICommunityLib/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,8 @@ let package = Package(
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftCache",
targets: ["SwiftCache"]
),
.library(
name: "ArrayBuilder",
targets: ["ArrayBuilder"]
),
.library(
name: "Endpoint",
targets: ["Endpoint"]
),
.library(
name: "EndpointWithQueryBuilder",
targets: ["EndpointWithQueryBuilder"]
),
.library(
name: "PascalJSONDecoder",
targets: ["PascalJSONDecoder"]
),
.library(
name: "DecodeEmptyRepresentable",
targets: ["DecodeEmptyRepresentable"]
name: "Core",
targets: ["Core"]
),
.library(
name: "EventShortTypesClient",
Expand Down Expand Up @@ -100,91 +80,91 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "SwiftCache",
dependencies: []
),
.target(
name: "ArrayBuilder",
name: "Core",
dependencies: []
),
.testTarget(
name: "ArrayBuilderTests",
dependencies: ["ArrayBuilder"]
),
.target(
name: "Endpoint",
dependencies: []
),
.target(
name: "EndpointWithQueryBuilder",
name: "CoreTests",
dependencies: [
"Endpoint",
"ArrayBuilder"
"Core"
]
),
.target(
name: "PascalJSONDecoder",
dependencies: []
),
.target(
name: "DecodeEmptyRepresentable",
dependencies: []
),
.target(
name: "EventShortTypesClient",
dependencies: []
dependencies: [
"Core"
]
),
.testTarget(
name: "EventShortTypesClientTests",
dependencies: ["EventShortTypesClient"]
dependencies: [
"Core",
"EventShortTypesClient"
]
),
.target(
name: "EventShortTypesClientLive",
dependencies: [
"PascalJSONDecoder",
"DecodeEmptyRepresentable",
"Core",
"EventShortTypesClient"
]
),
.target(
name: "AppPreferencesClient",
dependencies: []
dependencies: [
"Core"
]
),
.testTarget(
name: "AppPreferencesClientTests",
dependencies: ["AppPreferencesClient"]
dependencies: [
"Core",
"AppPreferencesClient"
]
),
.target(
name: "AppPreferencesClientLive",
dependencies: ["AppPreferencesClient"]
dependencies: [
"Core",
"AppPreferencesClient"
]
),
.target(
name: "EventShortClient",
dependencies: []
dependencies: [
"Core",
]
),
.testTarget(
name: "EventShortClientTests",
dependencies: ["EventShortClient"]
dependencies: [
"Core",
"EventShortClient"
]
),
.target(
name: "EventShortClientLive",
dependencies: [
"PascalJSONDecoder",
"DecodeEmptyRepresentable",
"Core",
"EventShortClient"
]
),
.target(
name: "AuthStateStorageClient",
dependencies: []
dependencies: [
"Core"
]
),
.target(
name: "AuthClient",
dependencies: []
dependencies: [
"Core"
]
),
.target(
name: "AuthClientLive",
dependencies: [
"Core",
"AuthClient",
"AuthStateStorageClient",
.product(name: "AppAuth", package: "AppAuth-iOS")
Expand All @@ -197,9 +177,7 @@ let package = Package(
.target(
name: "ArticlesClientLive",
dependencies: [
"PascalJSONDecoder",
"DecodeEmptyRepresentable",
"EndpointWithQueryBuilder",
"Core",
"ArticlesClient",
]
),
Expand All @@ -210,9 +188,7 @@ let package = Package(
.target(
name: "PeopleClientLive",
dependencies: [
"PascalJSONDecoder",
"DecodeEmptyRepresentable",
"EndpointWithQueryBuilder",
"Core",
"PeopleClient",
]
)
Expand Down
3 changes: 1 addition & 2 deletions NOICommunityLib/Sources/ArticlesClientLive/Endpoints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
//

import Foundation
import Core
import ArticlesClient
import Endpoint
import EndpointWithQueryBuilder

private let dateFormatter: DateFormatter = { dateFormatter in
dateFormatter.calendar = Calendar(identifier: .iso8601)
Expand Down
4 changes: 1 addition & 3 deletions NOICommunityLib/Sources/ArticlesClientLive/Live.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@

import Foundation
import Combine
import PascalJSONDecoder
import DecodeEmptyRepresentable
import Core
import ArticlesClient
import Endpoint

// MARK: - Private Constants

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//
// ArrayBuilder.swift
// ArrayBuilder
// Core
//
// Created by Matteo Matassoni on 11/05/22.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//
// Cache.swift
// Cache
// Core
//
// Created by Matteo Matassoni on 11/03/22.
//
Expand Down
Loading

0 comments on commit 3ffa4f5

Please sign in to comment.