Skip to content

Commit d44f49e

Browse files
chore: capacitor integration tests
1 parent 84381ab commit d44f49e

16 files changed

Lines changed: 506 additions & 17 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/capacitor': patch
3+
---
4+
5+
Fix Capacitor batch operations so they do not start a nested native transaction when executed inside PowerSync's write transaction wrapper.

demos/example-capacitor/ios/App/CapApp-SPM/Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/capacitor/example-app/capacitor.config.json

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { CapacitorConfig } from '@capacitor/cli';
2+
3+
const config: CapacitorConfig = {
4+
appId: 'com.powersync.capacitor',
5+
appName: 'PowerSync Capacitor SDK example',
6+
webDir: 'dist',
7+
server: {
8+
cleartext: true,
9+
/**
10+
* We receive the Vitest URL as an environment variable, Capacitor should load this on boot.
11+
*/
12+
url: process.env.CAPACITOR_VITEST_SERVER_URL
13+
}
14+
};
15+
16+
export default config;

packages/capacitor/example-app/ios/App/CapApp-SPM/Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ let package = Package(
1212
],
1313
dependencies: [
1414
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.3.4"),
15-
.package(name: "PowersyncCapacitor", path: "../../../node_modules/@powersync/capacitor")
15+
.package(name: "PowersyncCapacitor", path: "../../../node_modules/@powersync/capacitor"),
16+
.package(name: "CapacitorCommunitySqlite", path: "../../../node_modules/.pnpm/@capacitor-community+sqlite@8.1.0_@capacitor+core@8.3.4/node_modules/@capacitor-community/sqlite")
1617
],
1718
targets: [
1819
.target(
1920
name: "CapApp-SPM",
2021
dependencies: [
2122
.product(name: "Capacitor", package: "capacitor-swift-pm"),
2223
.product(name: "Cordova", package: "capacitor-swift-pm"),
23-
.product(name: "PowersyncCapacitor", package: "PowersyncCapacitor")
24+
.product(name: "PowersyncCapacitor", package: "PowersyncCapacitor"),
25+
.product(name: "CapacitorCommunitySqlite", package: "CapacitorCommunitySqlite")
2426
]
2527
)
2628
]

packages/capacitor/example-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"@capacitor/core": "^8.0.0",
1717
"@powersync/capacitor": "file:..",
1818
"@capacitor/ios": "^8.0.0",
19-
"@capacitor/android": "^8.0.0"
19+
"@capacitor/android": "^8.0.0",
20+
"@capacitor-community/sqlite": "~8.1.0"
2021
},
2122
"devDependencies": {
2223
"@capacitor/cli": "^8.0.0",

packages/capacitor/example-app/pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'CordovaPluginsResources'
3+
s.version = '0.0.105'
4+
s.summary = 'Resources for Cordova plugins'
5+
s.license = 'MIT'
6+
s.homepage = 'https://capacitorjs.com/'
7+
s.authors = { 'Ionic Team' => 'hi@ionicframework.com' }
8+
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s }
9+
s.resources = ['resources/*']
10+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)