Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

chore: Framework-ify SubconsciousCore #841

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions xcode/Subconscious/Shared/Components/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import os
import Combine

/// Top-level view for app
struct AppView: View {
public struct AppView: View {
public init() {}

/// Store for global application state
@StateObject private var store = Store(
state: AppModel(),
Expand All @@ -20,7 +22,7 @@ struct AppView: View {
)
@Environment(\.scenePhase) private var scenePhase: ScenePhase

var body: some View {
public var body: some View {
ZStack {
VStack(spacing: 0) {
if Config.default.appTabs {
Expand Down
2 changes: 1 addition & 1 deletion xcode/Subconscious/Shared/Library/CombineUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extension Publisher {
/// Recover from a failure.
/// Similar to `catch` but allows you to map an `Error` to an `Output`,
/// without having to wrap in a publisher.
func recover(
public func recover(
_ transform: @escaping (Error) -> Output
) -> Publishers.Catch<Self, Just<Output>> {
self.catch({ error in
Expand Down
2 changes: 1 addition & 1 deletion xcode/Subconscious/Shared/Library/Sentry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import os
import OSLog
import Sentry

struct SentryIntegration {}
public struct SentryIntegration {}

extension SentryIntegration {
public static func start() {
Expand Down
1,513 changes: 743 additions & 770 deletions xcode/Subconscious/Subconscious.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "B8EB29FA26F27797006E97C3"
BuildableName = "Subconscious.app"
BlueprintName = "Subconscious (iOS)"
BlueprintName = "Unconscious (iOS)"
ReferencedContainer = "container:Subconscious.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand Down Expand Up @@ -76,7 +76,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "B8EB29FA26F27797006E97C3"
BuildableName = "Subconscious.app"
BlueprintName = "Subconscious (iOS)"
BlueprintName = "Unconscious (iOS)"
ReferencedContainer = "container:Subconscious.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -100,7 +100,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "B8EB29FA26F27797006E97C3"
BuildableName = "Subconscious.app"
BlueprintName = "Subconscious (iOS)"
BlueprintName = "Unconscious (iOS)"
ReferencedContainer = "container:Subconscious.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
18 changes: 18 additions & 0 deletions xcode/Subconscious/SubconsciousCore/SubconsciousCore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// SubconsciousCore.h
// SubconsciousCore
//
// Created by Jordan Santell on 7/31/23.
//

#import <Foundation/Foundation.h>

//! Project version number for SubconsciousCore.
FOUNDATION_EXPORT double SubconsciousCoreVersionNumber;

//! Project version string for SubconsciousCore.
FOUNDATION_EXPORT const unsigned char SubconsciousCoreVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <SubconsciousCore/PublicHeader.h>


1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/TestUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import XCTest
import Combine
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

struct TestUtilities {
/// Create a unique temp dir and return URL
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Test_Markup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Test_Markup: XCTestCase {
func testWikilinkLosslessStringConvertable() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_AddressBookService: XCTestCase {
func testFollowUser() async throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_App: XCTestCase {
func testNicknameFormField() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_AppMigrations: XCTestCase {
func testBasicMigrations() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Audience.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Audience: XCTestCase {
func testAudienceUserDescription() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_CollectionUtilities: XCTestCase {
func testCollectionGetValidBounds() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Config: XCTestCase {
func testLoadBuildVars() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import XCTest
import Combine
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_DataService: XCTestCase {
/// A place to put cancellables from publishers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_DatabaseService: XCTestCase {
func createDatabaseService() throws -> DatabaseService {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Detail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Detail: XCTestCase {
let environment = AppEnvironment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Did_SubconsciousLocal: XCTestCase {
func testDidIsLocal() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Did.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Did: XCTestCase {
func testValidDid() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_EntryLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_EntryLink: XCTestCase {
func testSanitizeTitle() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_FileFingerprint: XCTestCase {
/// Modified time as Unix Timestamp Integer (rounded to the nearest second).
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_FirstRun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_FirstRun: XCTestCase {
func testPersistFirstRunComplete() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_FormField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import XCTest
import ObservableStore
import SwiftUI
@testable import Subconscious
@testable import SubconsciousCore

class Tests_FormField: XCTestCase {
static func validateStringIsHello(input: String) -> String? {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Func.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Func: XCTestCase {
func testPipe() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Header.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Header: XCTestCase {
func testHeaderTitleNormalization() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_HeaderSubtext: XCTestCase {
func testSize() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Link.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Link: XCTestCase {
func testParse() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_LogFmt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_LogFmt: XCTestCase {
func testFormat() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_MarkupText: XCTestCase {
func testRequestFocus() {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Memo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Memo: XCTestCase {
func testMemoMerge() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_MemoRecord: XCTestCase {
func testThrowsWhenInitilizedWithLocalDidWithoutSize() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import XCTest
import ObservableStore
import Combine
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_MemoViewerDetailMetaSheet: XCTestCase {
func testSetAddress() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Migrations: XCTestCase {
func testMigrationMigrate() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Noosphere.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import Noosphere
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Noosphere: XCTestCase {
func testCallWithError() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_NoosphereService: XCTestCase {
/// Create a unique temp dir and return URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

/// Tests for Notebook.update
class Tests_NotebookUpdate: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import OrderedCollections
@testable import Subconscious
@testable import SubconsciousCore

class Tests_OrderedCollectionUtilities: XCTestCase {
func testSetDefault() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Parser: XCTestCase {
func testDiscardSpaces() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Peer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Peer: XCTestCase {
func testPeerIsAbsolute() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Petname.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Petname: XCTestCase {
func testValid() throws {
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Prose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Prose: XCTestCase {
func testTitle() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_RecoveryPhrase: XCTestCase {
final class MockPasteboard: PasteboardProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_SQLite3Database: XCTestCase {
/// Get URL to temp dir for this test instance
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Search.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import XCTest
import ObservableStore
@testable import Subconscious
@testable import SubconsciousCore

class Tests_Search: XCTestCase {
let environment = AppEnvironment()
Expand Down
1 change: 1 addition & 0 deletions xcode/Subconscious/SubconsciousTests/Tests_Slashlink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import XCTest
@testable import Subconscious
@testable import SubconsciousCore

final class Tests_Slashlink: XCTestCase {
func testValid() throws {
Expand Down
Loading