Skip to content

Commit db11a7d

Browse files
DominicGBauerDominicGBauer
and
DominicGBauer
authored
feat: add package (#1)
* chore: initial upload * feat: add demo and connect * chore: add tests * chore: add tests * chore: add tests * fix: ci issue * fix: ci issue * fix: ci issue * docs: README * chore: remove secrets * chore: change name --------- Co-authored-by: DominicGBauer <[email protected]>
1 parent 53cce7c commit db11a7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3597
-1
lines changed

.github/workflows/build_and_test.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build and test
2+
3+
on:
4+
push
5+
6+
jobs:
7+
build:
8+
name: Build and test
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Build and Test
13+
run: |
14+
xcodebuild test -scheme PowerSyncSwift -destination "platform=iOS Simulator,name=iPhone 15"

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ fastlane/report.xml
6060
fastlane/Preview.html
6161
fastlane/screenshots/**/*.png
6262
fastlane/test_output
63+
64+
.DS_Store
65+
/.build
66+
/Packages
67+
xcuserdata/
68+
DerivedData/
69+
.swiftpm/configuration/registries.json
70+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
71+
.netrc

Demo/PowerSyncExample.xcodeproj/project.pbxproj

+878
Large diffs are not rendered by default.

Demo/PowerSyncExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict/>
5+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"originHash" : "5d7fb7f47b01e814cbc6b4a65dfe62c7af5a96a435a0288b747750c370fcd28a",
3+
"pins" : [
4+
{
5+
"identity" : "anycodable",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/Flight-School/AnyCodable",
8+
"state" : {
9+
"revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05",
10+
"version" : "0.6.7"
11+
}
12+
},
13+
{
14+
"identity" : "powersync-kotlin",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/powersync-ja/powersync-kotlin.git",
17+
"state" : {
18+
"revision" : "4186fa9a2004a4bc85a22c3f37bce4f3ebd4ff81",
19+
"version" : "1.0.0-BETA5.0"
20+
}
21+
},
22+
{
23+
"identity" : "powersync-sqlite-core-swift",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/powersync-ja/powersync-sqlite-core-swift.git",
26+
"state" : {
27+
"revision" : "6aaa0606d8053fe2e2f57015a8a275c0440ee643",
28+
"version" : "0.3.4"
29+
}
30+
},
31+
{
32+
"identity" : "supabase-swift",
33+
"kind" : "remoteSourceControl",
34+
"location" : "https://github.com/supabase-community/supabase-swift.git",
35+
"state" : {
36+
"revision" : "8f5b94f6a7a35305ccc1726f2f8f9d415ee2ec50",
37+
"version" : "2.20.4"
38+
}
39+
},
40+
{
41+
"identity" : "swift-asn1",
42+
"kind" : "remoteSourceControl",
43+
"location" : "https://github.com/apple/swift-asn1.git",
44+
"state" : {
45+
"revision" : "7faebca1ea4f9aaf0cda1cef7c43aecd2311ddf6",
46+
"version" : "1.3.0"
47+
}
48+
},
49+
{
50+
"identity" : "swift-case-paths",
51+
"kind" : "remoteSourceControl",
52+
"location" : "https://github.com/pointfreeco/swift-case-paths",
53+
"state" : {
54+
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f",
55+
"version" : "1.5.6"
56+
}
57+
},
58+
{
59+
"identity" : "swift-collections",
60+
"kind" : "remoteSourceControl",
61+
"location" : "https://github.com/apple/swift-collections",
62+
"state" : {
63+
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
64+
"version" : "1.1.4"
65+
}
66+
},
67+
{
68+
"identity" : "swift-concurrency-extras",
69+
"kind" : "remoteSourceControl",
70+
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
71+
"state" : {
72+
"revision" : "6054df64b55186f08b6d0fd87152081b8ad8d613",
73+
"version" : "1.2.0"
74+
}
75+
},
76+
{
77+
"identity" : "swift-crypto",
78+
"kind" : "remoteSourceControl",
79+
"location" : "https://github.com/apple/swift-crypto.git",
80+
"state" : {
81+
"revision" : "21f7878f2b39d46fd8ba2b06459ccb431cdf876c",
82+
"version" : "3.8.1"
83+
}
84+
},
85+
{
86+
"identity" : "swift-custom-dump",
87+
"kind" : "remoteSourceControl",
88+
"location" : "https://github.com/pointfreeco/swift-custom-dump",
89+
"state" : {
90+
"revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
91+
"version" : "1.3.3"
92+
}
93+
},
94+
{
95+
"identity" : "swift-http-types",
96+
"kind" : "remoteSourceControl",
97+
"location" : "https://github.com/apple/swift-http-types.git",
98+
"state" : {
99+
"revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
100+
"version" : "1.3.0"
101+
}
102+
},
103+
{
104+
"identity" : "swift-identified-collections",
105+
"kind" : "remoteSourceControl",
106+
"location" : "https://github.com/pointfreeco/swift-identified-collections",
107+
"state" : {
108+
"revision" : "2f5ab6e091dd032b63dacbda052405756010dc3b",
109+
"version" : "1.1.0"
110+
}
111+
},
112+
{
113+
"identity" : "swift-syntax",
114+
"kind" : "remoteSourceControl",
115+
"location" : "https://github.com/swiftlang/swift-syntax",
116+
"state" : {
117+
"revision" : "0687f71944021d616d34d922343dcef086855920",
118+
"version" : "600.0.1"
119+
}
120+
},
121+
{
122+
"identity" : "swiftui-navigation",
123+
"kind" : "remoteSourceControl",
124+
"location" : "https://github.com/pointfreeco/swiftui-navigation",
125+
"state" : {
126+
"revision" : "e628806aeaa9efe25c1abcd97931a7c498fab281",
127+
"version" : "1.5.5"
128+
}
129+
},
130+
{
131+
"identity" : "xctest-dynamic-overlay",
132+
"kind" : "remoteSourceControl",
133+
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
134+
"state" : {
135+
"revision" : "770f990d3e4eececb57ac04a6076e22f8c97daeb",
136+
"version" : "1.4.2"
137+
}
138+
}
139+
],
140+
"version" : 3
141+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1530"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "6A7315832B9854220004CB17"
19+
BuildableName = "PowerSyncExample.app"
20+
BlueprintName = "PowerSyncExample"
21+
ReferencedContainer = "container:PowerSyncExample.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "6A7315832B9854220004CB17"
48+
BuildableName = "PowerSyncExample.app"
49+
BlueprintName = "PowerSyncExample"
50+
ReferencedContainer = "container:PowerSyncExample.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
<EnvironmentVariables>
54+
<EnvironmentVariable
55+
key = "CG_NUMERICS_SHOW_BACKTRACE"
56+
value = "true"
57+
isEnabled = "YES">
58+
</EnvironmentVariable>
59+
<EnvironmentVariable
60+
key = "IDEPreferLogStreaming"
61+
value = "YES"
62+
isEnabled = "YES">
63+
</EnvironmentVariable>
64+
</EnvironmentVariables>
65+
</LaunchAction>
66+
<ProfileAction
67+
buildConfiguration = "Release"
68+
shouldUseLaunchSchemeArgsEnv = "YES"
69+
savedToolIdentifier = ""
70+
useCustomWorkingDirectory = "NO"
71+
debugDocumentVersioning = "YES">
72+
<BuildableProductRunnable
73+
runnableDebuggingMode = "0">
74+
<BuildableReference
75+
BuildableIdentifier = "primary"
76+
BlueprintIdentifier = "6A7315832B9854220004CB17"
77+
BuildableName = "PowerSyncExample.app"
78+
BlueprintName = "PowerSyncExample"
79+
ReferencedContainer = "container:PowerSyncExample.xcodeproj">
80+
</BuildableReference>
81+
</BuildableProductRunnable>
82+
</ProfileAction>
83+
<AnalyzeAction
84+
buildConfiguration = "Debug">
85+
</AnalyzeAction>
86+
<ArchiveAction
87+
buildConfiguration = "Release"
88+
revealArchiveInOrganizer = "YES">
89+
</ArchiveAction>
90+
</Scheme>
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
cp _Secrets.swift Secrets.swift
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
}
8+
],
9+
"info" : {
10+
"author" : "xcode",
11+
"version" : 1
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import SwiftUI
2+
3+
struct AddListView: View {
4+
@Environment(SystemManager.self) private var system
5+
6+
@Binding var newList: NewListContent
7+
let completion: (Result<Bool, Error>) -> Void
8+
9+
var body: some View {
10+
Section {
11+
TextField("Name", text: $newList.name)
12+
Button("Save") {
13+
Task.detached {
14+
do {
15+
try await system.insertList(newList)
16+
await completion(.success(true))
17+
} catch {
18+
await completion(.failure(error))
19+
throw error
20+
}
21+
}
22+
}
23+
}
24+
}
25+
}
26+
27+
#Preview {
28+
AddListView(
29+
newList: .constant(
30+
.init(
31+
name: "",
32+
ownerId: "",
33+
createdAt: ""
34+
)
35+
)
36+
) { _ in
37+
}.environment(SystemManager())
38+
}

0 commit comments

Comments
 (0)