Skip to content

Commit 25ece59

Browse files
Fix Web and Capacitor ESM exports (#815)
1 parent a08d6d5 commit 25ece59

88 files changed

Lines changed: 428 additions & 321 deletions

File tree

Some content is hidden

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

.changeset/calm-hats-retire.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@powersync/capacitor': minor
3+
'@powersync/web': minor
4+
---
5+
6+
Improved ESM exports and module declarations. Importing these packages in SSR environments should no longer throw errors.

.changeset/loud-crabs-destroy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/kysely-driver': patch
3+
---
4+
5+
Updated order of `types` and `default` package exports.

.changeset/strong-ads-tickle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/common': minor
3+
---
4+
5+
[Internal] Add ability to override `AbstractPowerSyncDatabase` `loadVersion` method.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
22
include ':capacitor-android'
3-
project(':capacitor-android').projectDir = new File('../node_modules/.pnpm/@capacitor+android@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/android/capacitor')
3+
project(':capacitor-android').projectDir = new File('../node_modules/.pnpm/@capacitor+android@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/android/capacitor')
44

55
include ':capacitor-community-sqlite'
6-
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/.pnpm/@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4/node_modules/@capacitor-community/sqlite/android')
6+
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/.pnpm/@capacitor-community+sqlite@7.0.3_@capacitor+core@7.4.3/node_modules/@capacitor-community/sqlite/android')
77

88
include ':capacitor-splash-screen'
9-
project(':capacitor-splash-screen').projectDir = new File('../node_modules/.pnpm/@capacitor+splash-screen@7.0.3_@capacitor+core@7.4.4/node_modules/@capacitor/splash-screen/android')
9+
project(':capacitor-splash-screen').projectDir = new File('../node_modules/.pnpm/@capacitor+splash-screen@7.0.0_@capacitor+core@7.4.3/node_modules/@capacitor/splash-screen/android')
1010

1111
include ':powersync-capacitor'
12-
project(':powersync-capacitor').projectDir = new File('../node_modules/.pnpm/@powersync+capacitor@0.1.3_@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4__@powersyn_smncg5wuctchvueg7u47nvgl4i/node_modules/@powersync/capacitor/android')
12+
project(':powersync-capacitor').projectDir = new File('../node_modules/@powersync/capacitor/android')

demos/example-capacitor/ios/App/Podfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require_relative '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios/scripts/pods_helpers'
1+
require_relative '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios/scripts/pods_helpers'
22

33
platform :ios, '14.0'
44
use_frameworks!
@@ -9,11 +9,11 @@ use_frameworks!
99
install! 'cocoapods', :disable_input_output_paths => true
1010

1111
def capacitor_pods
12-
pod 'Capacitor', :path => '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios'
13-
pod 'CapacitorCordova', :path => '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios'
14-
pod 'CapacitorCommunitySqlite', :path => '../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4/node_modules/@capacitor-community/sqlite'
15-
pod 'CapacitorSplashScreen', :path => '../../node_modules/.pnpm/@capacitor+splash-screen@7.0.3_@capacitor+core@7.4.4/node_modules/@capacitor/splash-screen'
16-
pod 'PowersyncCapacitor', :path => '../../node_modules/.pnpm/@powersync+capacitor@0.1.3_@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4__@powersyn_smncg5wuctchvueg7u47nvgl4i/node_modules/@powersync/capacitor'
12+
pod 'Capacitor', :path => '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios'
13+
pod 'CapacitorCordova', :path => '../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios'
14+
pod 'CapacitorCommunitySqlite', :path => '../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.3_@capacitor+core@7.4.3/node_modules/@capacitor-community/sqlite'
15+
pod 'CapacitorSplashScreen', :path => '../../node_modules/.pnpm/@capacitor+splash-screen@7.0.0_@capacitor+core@7.4.3/node_modules/@capacitor/splash-screen'
16+
pod 'PowersyncCapacitor', :path => '../../node_modules/.pnpm/@powersync+capacitor@file+..+..+packages+capacitor_@capacitor-community+sqlite@7.0.3_@c_0abc1a37c113f3d275f15aa18c563673/node_modules/@powersync/capacitor'
1717
end
1818

1919
target 'App' do
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
PODS:
22
- Capacitor (7.4.4):
33
- CapacitorCordova
4-
- CapacitorCommunitySqlite (7.0.2):
4+
- CapacitorCommunitySqlite (7.0.3):
55
- Capacitor
66
- SQLCipher
77
- ZIPFoundation
88
- CapacitorCordova (7.4.4)
9-
- CapacitorSplashScreen (7.0.3):
9+
- CapacitorSplashScreen (7.0.0):
1010
- Capacitor
1111
- powersync-sqlite-core (0.4.10)
12-
- PowersyncCapacitor (0.1.3):
12+
- PowersyncCapacitor (0.2.0):
1313
- Capacitor
14-
- powersync-sqlite-core (~> 0.4.6)
14+
- powersync-sqlite-core (~> 0.4.10)
1515
- SQLCipher (~> 4.0)
1616
- SQLCipher (4.10.0):
1717
- SQLCipher/standard (= 4.10.0)
@@ -21,11 +21,11 @@ PODS:
2121
- ZIPFoundation (0.9.20)
2222

2323
DEPENDENCIES:
24-
- "Capacitor (from `../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios`)"
25-
- "CapacitorCommunitySqlite (from `../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4/node_modules/@capacitor-community/sqlite`)"
26-
- "CapacitorCordova (from `../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios`)"
27-
- "CapacitorSplashScreen (from `../../node_modules/.pnpm/@capacitor+splash-screen@7.0.3_@capacitor+core@7.4.4/node_modules/@capacitor/splash-screen`)"
28-
- "PowersyncCapacitor (from `../../node_modules/.pnpm/@powersync+capacitor@0.1.3_@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4__@powersyn_smncg5wuctchvueg7u47nvgl4i/node_modules/@powersync/capacitor`)"
24+
- "Capacitor (from `../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios`)"
25+
- "CapacitorCommunitySqlite (from `../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.3_@capacitor+core@7.4.3/node_modules/@capacitor-community/sqlite`)"
26+
- "CapacitorCordova (from `../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios`)"
27+
- "CapacitorSplashScreen (from `../../node_modules/.pnpm/@capacitor+splash-screen@7.0.0_@capacitor+core@7.4.3/node_modules/@capacitor/splash-screen`)"
28+
- "PowersyncCapacitor (from `../../node_modules/.pnpm/@powersync+capacitor@file+..+..+packages+capacitor_@capacitor-community+sqlite@7.0.3_@c_0abc1a37c113f3d275f15aa18c563673/node_modules/@powersync/capacitor`)"
2929

3030
SPEC REPOS:
3131
trunk:
@@ -35,26 +35,26 @@ SPEC REPOS:
3535

3636
EXTERNAL SOURCES:
3737
Capacitor:
38-
:path: "../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios"
38+
:path: "../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios"
3939
CapacitorCommunitySqlite:
40-
:path: "../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4/node_modules/@capacitor-community/sqlite"
40+
:path: "../../node_modules/.pnpm/@capacitor-community+sqlite@7.0.3_@capacitor+core@7.4.3/node_modules/@capacitor-community/sqlite"
4141
CapacitorCordova:
42-
:path: "../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/ios"
42+
:path: "../../node_modules/.pnpm/@capacitor+ios@7.4.4_@capacitor+core@7.4.3/node_modules/@capacitor/ios"
4343
CapacitorSplashScreen:
44-
:path: "../../node_modules/.pnpm/@capacitor+splash-screen@7.0.3_@capacitor+core@7.4.4/node_modules/@capacitor/splash-screen"
44+
:path: "../../node_modules/.pnpm/@capacitor+splash-screen@7.0.0_@capacitor+core@7.4.3/node_modules/@capacitor/splash-screen"
4545
PowersyncCapacitor:
46-
:path: "../../node_modules/.pnpm/@powersync+capacitor@0.1.3_@capacitor-community+sqlite@7.0.2_@capacitor+core@7.4.4__@powersyn_smncg5wuctchvueg7u47nvgl4i/node_modules/@powersync/capacitor"
46+
:path: "../../node_modules/.pnpm/@powersync+capacitor@file+..+..+packages+capacitor_@capacitor-community+sqlite@7.0.3_@c_0abc1a37c113f3d275f15aa18c563673/node_modules/@powersync/capacitor"
4747

4848
SPEC CHECKSUMS:
49-
Capacitor: 358dd1c3fdd71d969547b17e159fd8a7736cb45f
50-
CapacitorCommunitySqlite: a57c58e1c37f4bc250ef01e66b0055cb6ddd775e
49+
Capacitor: 09d9ff8e9618e8c4b3cab2bbee34a17215dd2fef
50+
CapacitorCommunitySqlite: 30a73598245016daa4f88c0af391080bfc0af727
5151
CapacitorCordova: bf648a636f3c153f652d312ae145fb508b6ffced
52-
CapacitorSplashScreen: e388b8e0ed0e982a9d3a40417f478e7a018a8763
52+
CapacitorSplashScreen: f4e58cc02aafd91c7cbaf32a3d1b44d02a115125
5353
powersync-sqlite-core: b30017e077c91915d53faebc5f7245384df78275
54-
PowersyncCapacitor: 45baea36962329f34237a1a421391f90c19acdbe
54+
PowersyncCapacitor: 4fe9ac76191de407fd5cc9b74b9792d41e99bf24
5555
SQLCipher: eb79c64049cb002b4e9fcb30edb7979bf4706dfc
5656
ZIPFoundation: dfd3d681c4053ff7e2f7350bc4e53b5dba3f5351
5757

58-
PODFILE CHECKSUM: 56f567ab082005288c1d603459e2996d6bb9fb45
58+
PODFILE CHECKSUM: e2b83662b9229a3774f95609822544667aed8ef4
5959

6060
COCOAPODS: 1.16.2

demos/example-capacitor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"dependencies": {
2323
"@capacitor-community/sqlite": "^7.0.2",
2424
"@capacitor/android": "^7.4.3",
25-
"@capacitor/core": "latest",
25+
"@capacitor/core": "7.4.3",
2626
"@capacitor/ios": "^7.4.3",
27-
"@capacitor/splash-screen": "latest",
27+
"@capacitor/splash-screen": "7.0.0",
2828
"@powersync/capacitor": "^0.2.0",
2929
"@journeyapps/wa-sqlite": "^1.4.1",
3030
"@powersync/react": "^1.8.2",

demos/example-nextjs/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ next-env.d.ts
3939

4040
# supabase
4141
supabase/.branches/*
42-
supabase/.temp/*
42+
supabase/.temp/*
43+
44+
# public
45+
public/@powersync/*

demos/example-nextjs/next.config.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,5 @@ module.exports = {
22
images: {
33
disableStaticImages: true
44
},
5-
webpack: (config, { isServer }) => {
6-
if (isServer) {
7-
return config;
8-
}
9-
return {
10-
...config,
11-
module: {
12-
...config.module,
13-
rules: [
14-
...config.module.rules,
15-
{
16-
test: /\.css/,
17-
use: ['style-loader', 'css-loader']
18-
},
19-
{
20-
test: /\.scss/,
21-
use: ['style-loader', 'css-loader', 'sass-loader']
22-
}
23-
]
24-
}
25-
};
26-
}
5+
turbopack: {}
276
};

demos/example-nextjs/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"watch": "next dev",
99
"start": "next start",
1010
"lint": "next lint",
11-
"test:build": "pnpm build"
11+
"test:build": "pnpm build",
12+
"copy-assets": "powersync-web copy-assets -o public",
13+
"postinstall": "pnpm copy-assets"
1214
},
1315
"dependencies": {
1416
"@emotion/react": "^11.11.4",
@@ -22,19 +24,19 @@
2224
"@powersync/web": "^1.31.0",
2325
"lato-font": "^3.0.0",
2426
"lexical": "^0.15.0",
25-
"next": "14.2.3",
26-
"react": "^18.2.0",
27-
"react-dom": "^18.2.0"
27+
"next": "^16.1.1",
28+
"react": "^19.0.0",
29+
"react-dom": "^19.0.0"
2830
},
2931
"devDependencies": {
3032
"@types/node": "^20.12.12",
31-
"@types/react": "^18.3.2",
32-
"@types/react-dom": "^18.3.0",
33+
"@types/react": "^19.0.0",
34+
"@types/react-dom": "^19.0.0",
3335
"autoprefixer": "^10.4.19",
3436
"babel-loader": "^9.1.3",
3537
"css-loader": "^6.11.0",
36-
"eslint": "^8.57.0",
37-
"eslint-config-next": "14.0.0",
38+
"eslint": "^9.0.0",
39+
"eslint-config-next": "^16.0.0",
3840
"postcss": "^8.4.35",
3941
"sass": "^1.77.2",
4042
"sass-loader": "^13.3.3",

0 commit comments

Comments
 (0)