From 32464e0aaf2353dd43c7ef82f1f3abb6d960dc81 Mon Sep 17 00:00:00 2001 From: koenigsley Date: Fri, 8 Sep 2023 16:49:39 +0300 Subject: [PATCH 1/3] chore: add license --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6b2a3b0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Pure Native + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 80dc64617dd6a0231b0e2511c6021fb0e1f5a4c6 Mon Sep 17 00:00:00 2001 From: koenigsley Date: Fri, 8 Sep 2023 16:58:59 +0300 Subject: [PATCH 2/3] chore: add copyright comments --- Sources/SwiftDI/Private/DIContainerStorage.swift | 11 +++++++++++ Sources/SwiftDI/Private/DIEntityTypeKey.swift | 11 +++++++++++ Sources/SwiftDI/Private/DIFabricObjectProvider.swift | 11 +++++++++++ .../SwiftDI/Private/DIInstanceObjectProvider.swift | 11 +++++++++++ Sources/SwiftDI/Private/DIObjectProvider.swift | 11 +++++++++++ Sources/SwiftDI/Public/DIContainer.swift | 11 +++++++++++ Sources/SwiftDI/Public/DIObjectScope.swift | 11 +++++++++++ Tests/SwiftDITests/SwiftDITests.swift | 9 +++++++++ 8 files changed, 86 insertions(+) diff --git a/Sources/SwiftDI/Private/DIContainerStorage.swift b/Sources/SwiftDI/Private/DIContainerStorage.swift index 0729a92..3da3a1c 100644 --- a/Sources/SwiftDI/Private/DIContainerStorage.swift +++ b/Sources/SwiftDI/Private/DIContainerStorage.swift @@ -1,3 +1,14 @@ +// +// DIContainerStorage.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + final class DIContainerStorage { private var providers = [DIEntityTypeKey: OP]() diff --git a/Sources/SwiftDI/Private/DIEntityTypeKey.swift b/Sources/SwiftDI/Private/DIEntityTypeKey.swift index 4feee4c..68176c2 100644 --- a/Sources/SwiftDI/Private/DIEntityTypeKey.swift +++ b/Sources/SwiftDI/Private/DIEntityTypeKey.swift @@ -1,3 +1,14 @@ +// +// DIEntityTypeKey.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + final class DIEntityTypeKey: Hashable { let entityName: String diff --git a/Sources/SwiftDI/Private/DIFabricObjectProvider.swift b/Sources/SwiftDI/Private/DIFabricObjectProvider.swift index f18ef8a..20a8e52 100644 --- a/Sources/SwiftDI/Private/DIFabricObjectProvider.swift +++ b/Sources/SwiftDI/Private/DIFabricObjectProvider.swift @@ -1,3 +1,14 @@ +// +// DIFabricObjectProvider.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + final class DIFabricObjectProvider: DIObjectProvider { static var scope: DIObjectScope { diff --git a/Sources/SwiftDI/Private/DIInstanceObjectProvider.swift b/Sources/SwiftDI/Private/DIInstanceObjectProvider.swift index 2b96877..4b00e23 100644 --- a/Sources/SwiftDI/Private/DIInstanceObjectProvider.swift +++ b/Sources/SwiftDI/Private/DIInstanceObjectProvider.swift @@ -1,3 +1,14 @@ +// +// DIInstanceObjectProvider.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + final class DIInstanceObjectProvider: DIObjectProvider { private var _instance: Any! diff --git a/Sources/SwiftDI/Private/DIObjectProvider.swift b/Sources/SwiftDI/Private/DIObjectProvider.swift index 0279081..e5a644c 100644 --- a/Sources/SwiftDI/Private/DIObjectProvider.swift +++ b/Sources/SwiftDI/Private/DIObjectProvider.swift @@ -1,3 +1,14 @@ +// +// DIObjectProvider.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + protocol DIObjectProvider { static var scope: DIObjectScope { get } diff --git a/Sources/SwiftDI/Public/DIContainer.swift b/Sources/SwiftDI/Public/DIContainer.swift index 0d0c0ab..d86eda9 100644 --- a/Sources/SwiftDI/Public/DIContainer.swift +++ b/Sources/SwiftDI/Public/DIContainer.swift @@ -1,3 +1,14 @@ +// +// DIContainer.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + public class DIContainer { private let fabricStorage = DIContainerStorage() diff --git a/Sources/SwiftDI/Public/DIObjectScope.swift b/Sources/SwiftDI/Public/DIObjectScope.swift index c5248be..f71a020 100644 --- a/Sources/SwiftDI/Public/DIObjectScope.swift +++ b/Sources/SwiftDI/Public/DIObjectScope.swift @@ -1,3 +1,14 @@ +// +// DIObjectScope.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + +import Foundation + public enum DIObjectScope: String { case fabric diff --git a/Tests/SwiftDITests/SwiftDITests.swift b/Tests/SwiftDITests/SwiftDITests.swift index a1ae6bc..8318f7d 100644 --- a/Tests/SwiftDITests/SwiftDITests.swift +++ b/Tests/SwiftDITests/SwiftDITests.swift @@ -1,3 +1,12 @@ +// +// SwiftDITests.swift +// SwiftDI +// +// MIT License +// +// Copyright (c) 2022 Pure Native +// + import XCTest @testable import SwiftDI From cd6d14b80167c078e7c97db90ff6f0eece5ca881 Mon Sep 17 00:00:00 2001 From: koenigsley Date: Fri, 8 Sep 2023 17:54:55 +0300 Subject: [PATCH 3/3] docs: fill up readme Set proper description, add requirements, installation, contributing and license sections --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5457b1..6c8c41c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # SwiftDI -A description of this package. +Lightweight dependency injection library. + +## Requirements + +- Swift 5.5 or newer +- iOS 11.0 or newer + +## Installation + +You can install this package using [Swift Package Manager](https://www.swift.org/package-manager/) by adding the following line to the `dependencies` in your `Package.swift` file: + +```swift +.package(url: "https://github.com/purenative/SwiftDI.git", .branch("main")) +``` + +## Contributing + +Don't forget to open an issue if you found a bug or have a question. Feel free to fork this repository and open a pull request if you fixed an existing feature or implemented a new one. + +## License + +SwiftDI is released under the MIT license. See LICENSE for details.