Skip to content

Commit

Permalink
Merge pull request #27 from GSM-MSG/23-feat-signin-page
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsh153 authored May 1, 2023
2 parents 8bb059b + 7b7fa21 commit b861acc
Show file tree
Hide file tree
Showing 40 changed files with 549 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .tuist-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.17.0
3.18.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public extension TargetDependency {
}

public extension TargetDependency.SPM {
static let Needle = TargetDependency.external(name: "NeedleFoundation")
static let GAuthSignin = TargetDependency.external(name: "GAuthSignin")
static let Nimble = TargetDependency.external(name: "Nimble")
static let Quick = TargetDependency.external(name: "Quick")
static let Emdpoint = TargetDependency.external(name: "Emdpoint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ public extension TargetDependency {
}

public extension TargetDependency.Feature {
static let SigninFeatureInterface = TargetDependency.project(
target: ModulePaths.Feature.SigninFeature.targetName(type: .interface),
path: .relativeToFeature(ModulePaths.Feature.SigninFeature.rawValue)
)
static let SigninFeature = TargetDependency.project(
target: ModulePaths.Feature.SigninFeature.targetName(type: .sources),
path: .relativeToFeature(ModulePaths.Feature.SigninFeature.rawValue)
)
static let BaseFeature = TargetDependency.project(
target: ModulePaths.Feature.BaseFeature.targetName(type: .sources),
path: .relativeToFeature(ModulePaths.Feature.BaseFeature.rawValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum ModulePaths {

public extension ModulePaths {
enum Feature: String {
case SigninFeature
case BaseFeature

func targetName(type: MicroTargetType) -> String {
Expand Down
3 changes: 3 additions & 0 deletions Projects/App/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
excluded:
- "**/*/NeedleGenerated.swift"
- "Tuist"
9 changes: 7 additions & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let settings: Settings =
configurations: configurations,
defaultSettings: .recommended)

let scripts: [TargetScript] = isCI ? [] : [.swiftLint]
let scripts: [TargetScript] = isCI ? [] : [.swiftLint, .needle]

let targets: [Target] = [
.init(
Expand All @@ -36,7 +36,12 @@ let targets: [Target] = [
sources: ["Sources/**"],
resources: ["Resources/**"],
scripts: scripts,
dependencies: [],
dependencies: [
.Feature.SigninFeature,
.Domain.AuthDomain,
.Core.JwtStore,
.Shared.KeychainModule
],
settings: .settings(base: env.baseSetting)
)
]
Expand Down
30 changes: 0 additions & 30 deletions Projects/App/Sources/Application/AppDelegate.swift

This file was deleted.

33 changes: 33 additions & 0 deletions Projects/App/Sources/Application/DI/AppComponent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import NeedleFoundation
import SwiftUI
import AuthDomainInterface
import AuthDomain
import SigninFeature
import SigninFeatureInterface
import BaseDomain
import JwtStore
import JwtStoreInterface
import KeychainModule
import KeychainModuleInterface

final class AppComponent: BootstrapComponent {
func makeRootView() -> some View {
signinBuildable.makeView().eraseToAnyView()
}

var signinBuildable: any SigninBuildable {
SigninComponent(parent: self)
}

var authDomainBuildable: any AuthDomainBuildable {
AuthDomainComponent(parent: self)
}

var jwtStoreBuildable: any JwtStoreBuildable {
JwtStoreComponent(parent: self)
}

var keychainBuildable: any KeychainBuildable {
KeychainComponent(parent: self)
}
}
124 changes: 124 additions & 0 deletions Projects/App/Sources/Application/NeedleGenerated.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@


import AuthDomain
import AuthDomainInterface
import BaseDomain
import BaseFeature
import JwtStore
import JwtStoreInterface
import KeychainModule
import KeychainModuleInterface
import NeedleFoundation
import SigninFeature
import SigninFeatureInterface
import SwiftUI

// swiftlint:disable unused_declaration
private let needleDependenciesHash : String? = nil

// MARK: - Traversal Helpers

private func parent1(_ component: NeedleFoundation.Scope) -> NeedleFoundation.Scope {
return component.parent
}

// MARK: - Providers

#if !NEEDLE_DYNAMIC

private class JwtStoreDependency5613ee3d4fea5093f6faProvider: JwtStoreDependency {
var keychainBuildable: any KeychainBuildable {
return appComponent.keychainBuildable
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->JwtStoreComponent
private func factoryb27d5aae1eb7e73575a6f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return JwtStoreDependency5613ee3d4fea5093f6faProvider(appComponent: parent1(component) as! AppComponent)
}
private class SigninDependencyde06a9d0b22764487733Provider: SigninDependency {
var authDomainBuildable: any AuthDomainBuildable {
return appComponent.authDomainBuildable
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->SigninComponent
private func factory2882a056d84a613debccf47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SigninDependencyde06a9d0b22764487733Provider(appComponent: parent1(component) as! AppComponent)
}
private class AuthDomainDependency4518b8977185a5c9ff71Provider: AuthDomainDependency {
var jwtStoreBuildable: any JwtStoreBuildable {
return appComponent.jwtStoreBuildable
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->AuthDomainComponent
private func factoryc9b20c320bb79402d4c1f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return AuthDomainDependency4518b8977185a5c9ff71Provider(appComponent: parent1(component) as! AppComponent)
}

#else
extension JwtStoreComponent: Registration {
public func registerItems() {
keyPathToName[\JwtStoreDependency.keychainBuildable] = "keychainBuildable-any KeychainBuildable"
}
}
extension AppComponent: Registration {
public func registerItems() {


}
}
extension KeychainComponent: Registration {
public func registerItems() {

}
}
extension SigninComponent: Registration {
public func registerItems() {
keyPathToName[\SigninDependency.authDomainBuildable] = "authDomainBuildable-any AuthDomainBuildable"
}
}
extension AuthDomainComponent: Registration {
public func registerItems() {
keyPathToName[\AuthDomainDependency.jwtStoreBuildable] = "jwtStoreBuildable-any JwtStoreBuildable"
}
}


#endif

private func factoryEmptyDependencyProvider(_ component: NeedleFoundation.Scope) -> AnyObject {
return EmptyDependencyProvider(component: component)
}

// MARK: - Registration
private func registerProviderFactory(_ componentPath: String, _ factory: @escaping (NeedleFoundation.Scope) -> AnyObject) {
__DependencyProviderRegistry.instance.registerDependencyProviderFactory(for: componentPath, factory)
}

#if !NEEDLE_DYNAMIC

private func register1() {
registerProviderFactory("^->AppComponent->JwtStoreComponent", factoryb27d5aae1eb7e73575a6f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent", factoryEmptyDependencyProvider)
registerProviderFactory("^->AppComponent->KeychainComponent", factoryEmptyDependencyProvider)
registerProviderFactory("^->AppComponent->SigninComponent", factory2882a056d84a613debccf47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->AuthDomainComponent", factoryc9b20c320bb79402d4c1f47b58f8f304c97af4d5)
}
#endif

public func registerProviderFactories() {
#if !NEEDLE_DYNAMIC
register1()
#endif
}
16 changes: 16 additions & 0 deletions Projects/App/Sources/Application/SMSApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import BaseFeature
import DesignSystem
import SwiftUI

@main
struct SMSApp: App {
init() {
registerProviderFactories()
}

var body: some Scene {
WindowGroup {
AppComponent().makeRootView()
}
}
}
24 changes: 0 additions & 24 deletions Projects/App/Sources/Application/SceneDelegate.swift

This file was deleted.

6 changes: 4 additions & 2 deletions Projects/App/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>$(CLIENT_ID)</string>
<key>REDIREDCT_URI</key>
<string>$(REDIREDCT_URI)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
Expand Down Expand Up @@ -31,8 +35,6 @@
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Background.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Background 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Background 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
31 changes: 31 additions & 0 deletions Projects/Core/DesignSystem/Sources/Image/SMSImage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import SwiftUI

public struct SMSImage: View {
public enum Image {
case background
}

private var image: Image
private var renderingMode: SwiftUI.Image.TemplateRenderingMode

public init(
_ image: Image,
renderingMode: SwiftUI.Image.TemplateRenderingMode = .original
) {
self.image = image
self.renderingMode = renderingMode
}

public var body: some View {
smsImageToImage()
.resizable()
.renderingMode(renderingMode)
}

private func smsImageToImage() -> SwiftUI.Image {
switch image {
case .background:
return DesignSystemAsset.Images.background.swiftUIImage
}
}
}
5 changes: 5 additions & 0 deletions Projects/Core/JwtStore/Interface/DI/JwtStoreBuildable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import NeedleFoundation

public protocol JwtStoreBuildable {
var jwtStore: any JwtStore { get }
}
13 changes: 13 additions & 0 deletions Projects/Core/JwtStore/Sources/DI/JwtStoreComponent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import JwtStoreInterface
import KeychainModuleInterface
import NeedleFoundation

public protocol JwtStoreDependency: Dependency {
var keychainBuildable: any KeychainBuildable { get }
}

public final class JwtStoreComponent: Component<JwtStoreDependency>, JwtStoreBuildable {
public var jwtStore: any JwtStore {
KeychainJwtStore(keychain: dependency.keychainBuildable.keychain)
}
}
Loading

0 comments on commit b861acc

Please sign in to comment.