Skip to content

Commit 049b276

Browse files
DominicGBauerDominicGBauer
and
DominicGBauer
authored
chore: rename swift package name and add comment (#4)
* chore: rename swift package name * chore: update package * fix: gh action --------- Co-authored-by: DominicGBauer <[email protected]>
1 parent a545847 commit 049b276

29 files changed

+62
-61
lines changed

.github/workflows/build_and_test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- name: Build and Test
1313
run: |
14-
xcodebuild test -scheme PowerSyncSwift -destination "platform=iOS Simulator,name=iPhone 15"
14+
xcodebuild test -scheme PowerSync -destination "platform=iOS Simulator,name=iPhone 15"

Demo/PowerSyncExample.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
18F30B2A2CCA4CD900A58917 /* PowerSyncSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 18F30B292CCA4CD900A58917 /* PowerSyncSwift */; };
1110
6A4AD3852B9EE763005CBFD4 /* SupabaseConnector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A4AD3842B9EE763005CBFD4 /* SupabaseConnector.swift */; };
1211
6A4AD3892B9EEB21005CBFD4 /* _Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A4AD3882B9EEB21005CBFD4 /* _Secrets.swift */; };
1312
6A4AD3902B9EF775005CBFD4 /* ErrorText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A4AD38F2B9EF775005CBFD4 /* ErrorText.swift */; };
@@ -40,6 +39,7 @@
4039
B666587C2C63B88700159A81 /* SwiftUINavigationCore in Frameworks */ = {isa = PBXBuildFile; productRef = B666587B2C63B88700159A81 /* SwiftUINavigationCore */; };
4140
B69F7D862C8EE27400565448 /* AnyCodable in Frameworks */ = {isa = PBXBuildFile; productRef = B69F7D852C8EE27400565448 /* AnyCodable */; };
4241
B6B3698A2C64F4B30033C307 /* Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6B369892C64F4B30033C307 /* Navigation.swift */; };
42+
B6FFD5322D06DA8000EEE60F /* PowerSync in Frameworks */ = {isa = PBXBuildFile; productRef = B6FFD5312D06DA8000EEE60F /* PowerSync */; };
4343
/* End PBXBuildFile section */
4444

4545
/* Begin PBXCopyFilesBuildPhase section */
@@ -116,9 +116,9 @@
116116
B66658772C63B7BB00159A81 /* IdentifiedCollections in Frameworks */,
117117
B69F7D862C8EE27400565448 /* AnyCodable in Frameworks */,
118118
B666587C2C63B88700159A81 /* SwiftUINavigationCore in Frameworks */,
119+
B6FFD5322D06DA8000EEE60F /* PowerSync in Frameworks */,
119120
6A9669022B9EE69500B05DCF /* Supabase in Frameworks */,
120121
6A9669002B9EE4FE00B05DCF /* PostgREST in Frameworks */,
121-
18F30B2A2CCA4CD900A58917 /* PowerSyncSwift in Frameworks */,
122122
6A9668FE2B9EE4FE00B05DCF /* Auth in Frameworks */,
123123
B666587A2C63B88700159A81 /* SwiftUINavigation in Frameworks */,
124124
);
@@ -481,7 +481,7 @@
481481
B66658792C63B88700159A81 /* SwiftUINavigation */,
482482
B666587B2C63B88700159A81 /* SwiftUINavigationCore */,
483483
B69F7D852C8EE27400565448 /* AnyCodable */,
484-
18F30B292CCA4CD900A58917 /* PowerSyncSwift */,
484+
B6FFD5312D06DA8000EEE60F /* PowerSync */,
485485
);
486486
productName = PowerSyncExample;
487487
productReference = 6A7315842B9854220004CB17 /* PowerSyncExample.app */;
@@ -832,11 +832,6 @@
832832
/* End XCRemoteSwiftPackageReference section */
833833

834834
/* Begin XCSwiftPackageProductDependency section */
835-
18F30B292CCA4CD900A58917 /* PowerSyncSwift */ = {
836-
isa = XCSwiftPackageProductDependency;
837-
package = 18F30B282CCA4B3B00A58917 /* XCLocalSwiftPackageReference "../../powersync-swift" */;
838-
productName = PowerSyncSwift;
839-
};
840835
6A9668FD2B9EE4FE00B05DCF /* Auth */ = {
841836
isa = XCSwiftPackageProductDependency;
842837
package = 6A9668FC2B9EE4FE00B05DCF /* XCRemoteSwiftPackageReference "supabase-swift" */;
@@ -872,6 +867,11 @@
872867
package = B69F7D842C8EE27300565448 /* XCRemoteSwiftPackageReference "AnyCodable" */;
873868
productName = AnyCodable;
874869
};
870+
B6FFD5312D06DA8000EEE60F /* PowerSync */ = {
871+
isa = XCSwiftPackageProductDependency;
872+
package = 18F30B282CCA4B3B00A58917 /* XCLocalSwiftPackageReference "../../powersync-swift" */;
873+
productName = PowerSync;
874+
};
875875
/* End XCSwiftPackageProductDependency section */
876876
};
877877
rootObject = 6A73157C2B9854220004CB17 /* Project object */;

Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"kind" : "remoteSourceControl",
1616
"location" : "https://github.com/powersync-ja/powersync-kotlin.git",
1717
"state" : {
18-
"revision" : "b547389faf77d0c79f30887b5d82489ee3f4de4b",
19-
"version" : "1.0.0-BETA9.0"
18+
"revision" : "ebdb9addc0494ad17f964e8c45617715d2ab6725",
19+
"version" : "1.0.0-BETA11.0"
2020
}
2121
},
2222
{

Demo/PowerSyncExample/PowerSync/Schema.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import PowerSyncSwift
2+
import PowerSync
33

44
let LISTS_TABLE = "lists"
55
let TODOS_TABLE = "todos"

Demo/PowerSyncExample/PowerSync/SupabaseConnector.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Auth
22
import SwiftUI
33
import Supabase
4-
import PowerSyncSwift
4+
import PowerSync
55
import AnyCodable
66

77
@Observable

Demo/PowerSyncExample/PowerSync/SystemManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import PowerSyncSwift
2+
import PowerSync
33

44
@Observable
55
class SystemManager {

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/powersync-ja/powersync-kotlin.git",
77
"state" : {
8-
"revision" : "b547389faf77d0c79f30887b5d82489ee3f4de4b",
9-
"version" : "1.0.0-BETA9.0"
8+
"revision" : "ebdb9addc0494ad17f964e8c45617715d2ab6725",
9+
"version" : "1.0.0-BETA11.0"
1010
}
1111
},
1212
{

Package.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
5-
let packageName = "PowerSyncSwift"
5+
let packageName = "PowerSync"
66

77
let package = Package(
88
name: packageName,
@@ -14,10 +14,10 @@ let package = Package(
1414
// Products define the executables and libraries a package produces, making them visible to other packages.
1515
.library(
1616
name: packageName,
17-
targets: ["PowerSyncSwift"]),
17+
targets: ["PowerSync"]),
1818
],
1919
dependencies: [
20-
.package(url: "https://github.com/powersync-ja/powersync-kotlin.git", exact: "1.0.0-BETA9.0"),
20+
.package(url: "https://github.com/powersync-ja/powersync-kotlin.git", exact: "1.0.0-BETA11.0"),
2121
.package(url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", "0.3.1"..<"0.4.0"),
2222
],
2323
targets: [
@@ -26,12 +26,12 @@ let package = Package(
2626
.target(
2727
name: packageName,
2828
dependencies: [
29-
.product(name: "PowerSync", package: "powersync-kotlin"),
29+
.product(name: "PowerSyncKotlin", package: "powersync-kotlin"),
3030
.product(name: "PowerSyncSQLiteCore", package: "powersync-sqlite-core-swift")
3131
]),
3232
.testTarget(
33-
name: "PowerSyncSwiftTests",
34-
dependencies: ["PowerSyncSwift"]
33+
name: "PowerSyncTests",
34+
dependencies: ["PowerSync"]
3535
),
3636
]
3737
)

Sources/PowerSyncSwift/Kotlin/KotlinAdapter.swift renamed to Sources/PowerSync/Kotlin/KotlinAdapter.swift

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import PowerSync
1+
import PowerSyncKotlin
22

33
internal struct KotlinAdapter {
44
struct Index {
5-
static func toKotlin(_ index: IndexProtocol) -> PowerSync.Index {
6-
PowerSync.Index(
5+
static func toKotlin(_ index: IndexProtocol) -> PowerSyncKotlin.Index {
6+
PowerSyncKotlin.Index(
77
name: index.name,
88
columns: index.columns.map { IndexedColumn.toKotlin($0) }
99
)
1010
}
1111
}
1212

1313
struct IndexedColumn {
14-
static func toKotlin(_ column: IndexedColumnProtocol) -> PowerSync.IndexedColumn {
15-
return PowerSync.IndexedColumn(
14+
static func toKotlin(_ column: IndexedColumnProtocol) -> PowerSyncKotlin.IndexedColumn {
15+
return PowerSyncKotlin.IndexedColumn(
1616
column: column.column,
1717
ascending: column.ascending,
1818
columnDefinition: nil,
@@ -22,8 +22,8 @@ internal struct KotlinAdapter {
2222
}
2323

2424
struct Table {
25-
static func toKotlin(_ table: TableProtocol) -> PowerSync.Table {
26-
PowerSync.Table(
25+
static func toKotlin(_ table: TableProtocol) -> PowerSyncKotlin.Table {
26+
PowerSyncKotlin.Table(
2727
name: table.name,
2828
columns: table.columns.map {Column.toKotlin($0)},
2929
indexes: table.indexes.map { Index.toKotlin($0) },
@@ -35,28 +35,28 @@ internal struct KotlinAdapter {
3535
}
3636

3737
struct Column {
38-
static func toKotlin(_ column: any ColumnProtocol) -> PowerSync.Column {
39-
PowerSync.Column(
38+
static func toKotlin(_ column: any ColumnProtocol) -> PowerSyncKotlin.Column {
39+
PowerSyncKotlin.Column(
4040
name: column.name,
4141
type: columnType(from: column.type)
4242
)
4343
}
4444

45-
private static func columnType(from swiftType: ColumnData) -> PowerSync.ColumnType {
45+
private static func columnType(from swiftType: ColumnData) -> PowerSyncKotlin.ColumnType {
4646
switch swiftType {
4747
case .text:
48-
return PowerSync.ColumnType.text
48+
return PowerSyncKotlin.ColumnType.text
4949
case .integer:
50-
return PowerSync.ColumnType.integer
50+
return PowerSyncKotlin.ColumnType.integer
5151
case .real:
52-
return PowerSync.ColumnType.real
52+
return PowerSyncKotlin.ColumnType.real
5353
}
5454
}
5555
}
5656

5757
struct Schema {
58-
static func toKotlin(_ schema: SchemaProtocol) -> PowerSync.Schema {
59-
PowerSync.Schema(
58+
static func toKotlin(_ schema: SchemaProtocol) -> PowerSyncKotlin.Schema {
59+
PowerSyncKotlin.Schema(
6060
tables: schema.tables.map { Table.toKotlin($0) }
6161
)
6262
}

Sources/PowerSyncSwift/Kotlin/KotlinPowerSyncDatabaseImpl.swift renamed to Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Foundation
2-
import PowerSync
2+
import PowerSyncKotlin
33

44
final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol {
5-
private let kotlinDatabase: PowerSync.PowerSyncDatabase
5+
private let kotlinDatabase: PowerSyncKotlin.PowerSyncDatabase
66

77
var currentStatus: SyncStatus {
88
get { kotlinDatabase.currentStatus }
@@ -12,7 +12,7 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol {
1212
schema: Schema,
1313
dbFilename: String
1414
) {
15-
let factory = PowerSync.DatabaseDriverFactory()
15+
let factory = PowerSyncKotlin.DatabaseDriverFactory()
1616
self.kotlinDatabase = PowerSyncDatabase(
1717
factory: factory,
1818
schema: KotlinAdapter.Schema.toKotlin(schema),
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import PowerSyncKotlin
2+
3+
public typealias KotlinPowerSyncBackendConnector = PowerSyncKotlin.PowerSyncBackendConnector
4+
public typealias CrudEntry = PowerSyncKotlin.CrudEntry
5+
public typealias CrudBatch = PowerSyncKotlin.CrudBatch
6+
public typealias SyncStatus = PowerSyncKotlin.SyncStatus
7+
public typealias SqlCursor = PowerSyncKotlin.RuntimeSqlCursor
8+
public typealias JsonParam = PowerSyncKotlin.JsonParam
9+
public typealias CrudTransaction = PowerSyncKotlin.CrudTransaction
10+
public typealias KotlinPowerSyncCredentials = PowerSyncKotlin.PowerSyncCredentials
11+
public typealias KotlinPowerSyncDatabase = PowerSyncKotlin.PowerSyncDatabase
12+

Sources/PowerSyncSwift/QueriesProtocol.swift renamed to Sources/PowerSync/QueriesProtocol.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import Foundation
22
import Combine
3-
import PowerSync
3+
import PowerSyncKotlin
44

55
public protocol Queries {
66
/// Execute a write query (INSERT, UPDATE, DELETE)
7+
/// Using `RETURNING *` will result in an error.
78
func execute(sql: String, parameters: [Any]?) async throws -> Int64
89

910
/// Execute a read-only (SELECT) query and return a single result.

Sources/PowerSyncSwift/Schema/Column.swift renamed to Sources/PowerSync/Schema/Column.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import PowerSync
2+
import PowerSyncKotlin
33

44
public protocol ColumnProtocol: Equatable {
55
var name: String { get }

Sources/PowerSyncSwift/Schema/Index.swift renamed to Sources/PowerSync/Schema/Index.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import PowerSync
2+
import PowerSyncKotlin
33

44
public protocol IndexProtocol {
55
var name: String { get }

Sources/PowerSyncSwift/Kotlin/KotlinTypes.swift

-12
This file was deleted.

Tests/PowerSyncSwiftTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift renamed to Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class KotlinPowerSyncDatabaseImplTests: XCTestCase {
55
private var database: KotlinPowerSyncDatabaseImpl!

Tests/PowerSyncSwiftTests/Schema/ColumnTests.swift renamed to Tests/PowerSyncTests/Schema/ColumnTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class ColumnTests: XCTestCase {
55

Tests/PowerSyncSwiftTests/Schema/IndexTests.swift renamed to Tests/PowerSyncTests/Schema/IndexTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class IndexTests: XCTestCase {
55

Tests/PowerSyncSwiftTests/Schema/IndexedColumnTests.swift renamed to Tests/PowerSyncTests/Schema/IndexedColumnTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class IndexedColumnTests: XCTestCase {
55

Tests/PowerSyncSwiftTests/Schema/SchemaTests.swift renamed to Tests/PowerSyncTests/Schema/SchemaTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class SchemaTests: XCTestCase {
55
private func makeValidTable(name: String) -> Table {

Tests/PowerSyncSwiftTests/Schema/TableTests.swift renamed to Tests/PowerSyncTests/Schema/TableTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import PowerSyncSwift
2+
@testable import PowerSync
33

44
final class TableTests: XCTestCase {
55

0 commit comments

Comments
 (0)