Skip to content

Commit

Permalink
Update packages and project README (#34)
Browse files Browse the repository at this point in the history
* Update packages and project README

* Remove screenshots
  • Loading branch information
0xLeif authored Mar 10, 2023
1 parent 9e36fbf commit 896d26e
Show file tree
Hide file tree
Showing 31 changed files with 191 additions and 968 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- JSON: Network data model JSON files.
- Device: Device data models used in SwiftUI Views and ViewModels. Device models should be created from Network models by using Adapters.
- FileStorage: Local storage functionality.
- Navigation: SwiftUI NavigationPath using an object called CartographyPath and CartographyView. There is also the ability to present toasts, alerts, modals, and action sheets using the CartographyPath.
- Navigation: SwiftUI NavigationPath using OpenBytesNavigation.
- Networking: Networking functionality.
- Notifications: Local Notification functionality.
- Persistence
Expand All @@ -41,15 +41,6 @@
- UserRegistration: Tests for register using ViewModels and DI.
- Validation: Tests for different types of data validation.

### Dependency List

- [OpenBytes o](https://github.com/0xOpenBytes/o) <img src="https://img.shields.io/github/v/release/0xOpenBytes/o"/>
- Allows us to get the input and set the output of file, url, the console, and UserNotifications.
- [OpenBytes c](https://github.com/0xOpenBytes/c) <img src="https://img.shields.io/github/v/release/0xOpenBytes/c"/>
- Allows us to transform types from one to another while also providing us the various caching options.
- [Fork](https://github.com/0xLeif/Fork) <img src="https://img.shields.io/github/v/release/0xLeif/Fork"/>
- Fork allows us to run multiple asynchronous tasks at the same time.

## Getting Started

### Installing development dependencies
Expand Down
13 changes: 7 additions & 6 deletions base/App/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// RootView.swift
//

import OpenBytesNavigation
import SwiftUI

struct RootView: View {
Expand All @@ -27,7 +28,7 @@ struct RootView: View {

var body: some View {
TabView(selection: $navigation.tab) {
CartographyView(path: navigation.home) {
OpenBytesNavigationView(path: navigation.home) {
HomeScreen()
}
.tag(Tab.home)
Expand All @@ -36,7 +37,7 @@ struct RootView: View {
Text("Home")
}

CartographyView(path: navigation.search) {
OpenBytesNavigationView(path: navigation.search) {
SearchScreen()
}
.tag(Tab.search)
Expand All @@ -45,7 +46,7 @@ struct RootView: View {
Text("Search")
}

CartographyView(path: navigation.profile) {
OpenBytesNavigationView(path: navigation.profile) {
ProfileScreen()
}
.tag(Tab.profile)
Expand All @@ -60,9 +61,9 @@ struct RootView: View {
struct RootView_Previews: PreviewProvider {
static var previews: some View {
Navigation.shared.use { navigation -> RootView in
navigation.home = CartographyPath(id: "home.preview")
navigation.search = CartographyPath(id: "search.preview")
navigation.profile = CartographyPath(id: "profile.preview")
navigation.home = OpenBytesNavigationPath(id: "home.preview", isPreview: true)
navigation.search = OpenBytesNavigationPath(id: "search.preview", isPreview: true)
navigation.profile = OpenBytesNavigationPath(id: "profile.preview", isPreview: true)

return RootView(navigation: navigation)
}
Expand Down
3 changes: 2 additions & 1 deletion base/App/Search/SearchScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// SearchScreen.swift
//

import OpenBytesNavigation
import SwiftUI

struct SearchScreen: View {
Expand Down Expand Up @@ -79,7 +80,7 @@ struct SearchScreen: View {

struct SearchScreen_Previews: PreviewProvider {
static var previews: some View {
CartographyView.preview {
OpenBytesNavigationView.preview {
SearchScreen()
}
}
Expand Down
83 changes: 12 additions & 71 deletions base/App/Views/AcknowledgmentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,29 @@
// Created by Leif on 1/31/23.
//

import Disk
import OpenBytesNavigation
import SwiftUI

struct Acknowledgment: Identifiable {
let id: UUID = UUID()
struct Acknowledgment: Identifiable, Codable, Hashable {
var id: Self { self }

let title: String
let author: String
let url: URL?
let iconURL: URL?
let description: String
}

// swiftlint:disable line_length
extension OBbaseApp {
static var acknowledgments: [Acknowledgment] {
[
Acknowledgment(
title: "Fork",
author: "0xLeif",
url: URL(string: "https://github.com/0xLeif/Fork"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/8268288?v=4"),
description: "Fork is a Swift library that allows for parallelizing multiple async functions. It provides a Fork struct that takes a single input and splits it into two separate async functions that return different outputs. The two functions can then be merged into one which returns a single output."
),
Acknowledgment(
title: "o",
author: "0xOpenBytes",
url: URL(string: "https://github.com/0xOpenBytes/o"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/92551192"),
description: "Allows us to get the input and set the output of file, url, the console, and UserNotifications."
),
Acknowledgment(
title: "c",
author: "0xOpenBytes",
url: URL(string: "https://github.com/0xOpenBytes/c"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/92551192"),
description: "Allows us to transform types from one to another while also providing us the various caching options."
),
Acknowledgment(
title: "Swish",
author: "FullQueueDeveloper",
url: URL(string: "https://github.com/FullQueueDeveloper/Swish"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
description: "Swish is a Swift script running tool to easily run Swift packages in a supporting relative directory named Swish. Swish pairs nicely with Sh to run shell commands and process shell output from your Swift scripts."
),
Acknowledgment(
title: "Sh",
author: "FullQueueDeveloper",
url: URL(string: "https://github.com/FullQueueDeveloper/Sh"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
description: "Sh lets you reason about your script in Swift, easily calling shell commands and using their output in your Swift program. Or when orchestrating a build script, simply redirect all output to the terminal, a log file, or /dev/null."
),
Acknowledgment(
title: "ShGit",
author: "FullQueueDeveloper",
url: URL(string: "https://github.com/FullQueueDeveloper/ShGit"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
description: "Git wrapper for Swift powered by Sh."
),
Acknowledgment(
title: "ShXcrun",
author: "FullQueueDeveloper",
url: URL(string: "https://github.com/FullQueueDeveloper/ShXcrun"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
description: "A wrapper around xcodebuild, agvtool, and other xcrun tools, built on top of Sh."
),
Acknowledgment(
title: "XcodeGen",
author: "yonaskolb",
url: URL(string: "https://github.com/yonaskolb/XcodeGen"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/2393781"),
description: "XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec."
),
Acknowledgment(
title: "xcparse",
author: "ChargePoint",
url: URL(string: "https://github.com/ChargePoint/xcparse"),
iconURL: URL(string: "https://avatars.githubusercontent.com/u/9879654"),
description: "A command line tool to extract code coverage & screenshots from Xcode 11 XCResult files."
)
]
do {
return try Disk.json(named: "oss", type: [Acknowledgment].self) ?? []
} catch {
return []
}
}
}
// swiftlint:enable line_length

struct AcknowledgmentView: View {
let acknowledgments: [Acknowledgment]
Expand Down Expand Up @@ -134,7 +75,7 @@ struct AcknowledgmentView: View {
},
label: {
Text(acknowledgment.title)
.font(.title)
.font(.title2)
}
)

Expand All @@ -160,7 +101,7 @@ struct AcknowledgmentView: View {

struct OSSAcknowledgmentView_Previews: PreviewProvider {
static var previews: some View {
CartographyView.preview {
OpenBytesNavigationView.preview {
AcknowledgmentView()
}
}
Expand Down
1 change: 1 addition & 0 deletions base/App/Views/Components/ImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// ImageView.swift
//

import Network
import SwiftUI

class ImageViewModel: ObservableObject {
Expand Down
93 changes: 93 additions & 0 deletions base/Data/JSON/oss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[
{
"title": "OpenBytesNavigation",
"author": "0xOpenBytes",
"url": "https://github.com/0xOpenBytes/OpenBytesNavigation",
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
"description": "SwiftUI library that provides a flexible and easy-to-use navigation system for your SwiftUI apps."
},
{
"title": "Network",
"author": "0xOpenBytes",
"url": "https://github.com/0xOpenBytes/Network",
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
"description": "Output and Input for remote URLs using REST."
},
{
"title": "Cache",
"author": "0xOpenBytes",
"url": "https://github.com/0xOpenBytes/Cache",
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
"description": "Simple in-memory key-value store."
},
{
"title": "Disk",
"author": "0xOpenBytes",
"url": "https://github.com/0xOpenBytes/Disk",
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
"description": "Output and Input for Files."
},
{
"title": "Test",
"author": "0xOpenBytes",
"url": "https://github.com/0xOpenBytes/Test",
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
"description": "Test is a simple testing function that allows you to create test suites with multiple steps, expectations, and assertions."
},
{
"title": "Swish",
"author": "FullQueueDeveloper",
"url": "https://github.com/FullQueueDeveloper/Swish",
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
"description": "Swish is a Swift script running tool to easily run Swift packages in a supporting relative directory named Swish. Swish pairs nicely with Sh to run shell commands and process shell output from your Swift scripts."
},
{
"title": "Sh",
"author": "FullQueueDeveloper",
"url": "https://github.com/FullQueueDeveloper/Sh",
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
"description": "Sh lets you reason about your script in Swift, easily calling shell commands and using their output in your Swift program. Or when orchestrating a build script, simply redirect all output to the terminal, a log file, or /dev/null."
},
{
"title": "ShGit",
"author": "FullQueueDeveloper",
"url": "https://github.com/FullQueueDeveloper/ShGit",
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
"description": "Git wrapper for Swift powered by Sh."
},
{
"title": "ShXcrun",
"author": "FullQueueDeveloper",
"url": "https://github.com/FullQueueDeveloper/ShXcrun",
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
"description": "A wrapper around xcodebuild, agvtool, and other xcrun tools, built on top of Sh."
},
{
"title": "Fork",
"author": "0xLeif",
"url": "https://github.com/0xLeif/Fork",
"iconURL": "https://avatars.githubusercontent.com/u/8268288?v=4",
"description": "Fork is a Swift library that allows for parallelizing multiple async functions. It provides a Fork struct that takes a single input and splits it into two separate async functions that return different outputs. The two functions can then be merged into one which returns a single output."
},
{
"title": "Scribe",
"author": "0xLeif",
"url": "https://github.com/0xLeif/Scribe",
"iconURL": "https://avatars.githubusercontent.com/u/8268288?v=4",
"description": "Scribe is a flexible logging library for Swift, designed to make logging easy and efficient."
},
{
"title": "XcodeGen",
"author": "yonaskolb",
"url": "https://github.com/yonaskolb/XcodeGen",
"iconURL": "https://avatars.githubusercontent.com/u/2393781",
"description": "XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec."
},
{
"title": "xcparse",
"author": "ChargePoint",
"url": "https://github.com/ChargePoint/xcparse",
"iconURL": "https://avatars.githubusercontent.com/u/9879654",
"description": "A command line tool to extract code coverage & screenshots from Xcode 11 XCResult files."
}
]
13 changes: 7 additions & 6 deletions base/Data/Mock/Mock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
// Mock.swift
//

import Disk
import Foundation

enum Mock {
static func json<Value: Codable>(
named: String,
type: Value.Type = Value.self,
using decoder: JSONDecoder = JSONDecoder()
) throws -> Value? {
guard let file = Bundle.main.url(forResource: named, withExtension: "json") else {
return nil
}

return try decoder.decode(Value.self, from: Data(contentsOf: file))
) -> Value? {
try? Disk.json(
named: named,
type: type,
using: decoder
)
}
}
17 changes: 14 additions & 3 deletions base/FileStorage/DiskCapabilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@
// DiskCapabilities.swift
//

import o
import Disk
import Foundation

typealias Disk = o.file
extension Disk: StaticUsable {
static func json<Value: Codable>(
named: String,
type: Value.Type = Value.self,
using decoder: JSONDecoder = JSONDecoder()
) throws -> Value? {
guard let file = Bundle.main.url(forResource: named, withExtension: "json") else {
return nil
}

extension Disk: StaticUsable { }
return try decoder.decode(Value.self, from: Data(contentsOf: file))
}
}
25 changes: 0 additions & 25 deletions base/Navigation/Implementation/CartographyActionSheet.swift

This file was deleted.

Loading

0 comments on commit 896d26e

Please sign in to comment.