Skip to content

Commit a1804f2

Browse files
committed
fix: sync-demo-bare env variables
1 parent cc70e02 commit a1804f2

File tree

9 files changed

+200
-13
lines changed

9 files changed

+200
-13
lines changed

examples/sync-demo-bare/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SQLITE_CLOUD_DATABASE_ID=
77

88
# Authentication (provide ONE of the following):
99
# Access token for user-level authentication (when using RLS)
10-
# In a real app, this comes from your auth system (e.g. Supabase Auth)
10+
# In a real app, this comes from your auth system
1111
# For testing, use a token from the user you want to test with
1212
ACCESS_TOKEN=
1313
# API key for simple authentication (if not using RLS)

examples/sync-demo-bare/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ gem 'bigdecimal'
1414
gem 'logger'
1515
gem 'benchmark'
1616
gem 'mutex_m'
17+
gem 'nkf'
18+
gem 'tsort'
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.8)
5+
activesupport (7.2.3.1)
6+
base64
7+
benchmark (>= 0.3)
8+
bigdecimal
9+
concurrent-ruby (~> 1.0, >= 1.3.1)
10+
connection_pool (>= 2.2.5)
11+
drb
12+
i18n (>= 1.6, < 2)
13+
logger (>= 1.4.2)
14+
minitest (>= 5.1, < 6)
15+
securerandom (>= 0.3)
16+
tzinfo (~> 2.0, >= 2.0.5)
17+
addressable (2.8.9)
18+
public_suffix (>= 2.0.2, < 8.0)
19+
algoliasearch (1.27.5)
20+
httpclient (~> 2.8, >= 2.8.3)
21+
json (>= 1.5.1)
22+
atomos (0.1.3)
23+
base64 (0.3.0)
24+
benchmark (0.5.0)
25+
bigdecimal (4.0.1)
26+
claide (1.1.0)
27+
cocoapods (1.15.2)
28+
addressable (~> 2.8)
29+
claide (>= 1.0.2, < 2.0)
30+
cocoapods-core (= 1.15.2)
31+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
32+
cocoapods-downloader (>= 2.1, < 3.0)
33+
cocoapods-plugins (>= 1.0.0, < 2.0)
34+
cocoapods-search (>= 1.0.0, < 2.0)
35+
cocoapods-trunk (>= 1.6.0, < 2.0)
36+
cocoapods-try (>= 1.1.0, < 2.0)
37+
colored2 (~> 3.1)
38+
escape (~> 0.0.4)
39+
fourflusher (>= 2.3.0, < 3.0)
40+
gh_inspector (~> 1.0)
41+
molinillo (~> 0.8.0)
42+
nap (~> 1.0)
43+
ruby-macho (>= 2.3.0, < 3.0)
44+
xcodeproj (>= 1.23.0, < 2.0)
45+
cocoapods-core (1.15.2)
46+
activesupport (>= 5.0, < 8)
47+
addressable (~> 2.8)
48+
algoliasearch (~> 1.0)
49+
concurrent-ruby (~> 1.1)
50+
fuzzy_match (~> 2.0.4)
51+
nap (~> 1.0)
52+
netrc (~> 0.11)
53+
public_suffix (~> 4.0)
54+
typhoeus (~> 1.0)
55+
cocoapods-deintegrate (1.0.5)
56+
cocoapods-downloader (2.1)
57+
cocoapods-plugins (1.0.0)
58+
nap
59+
cocoapods-search (1.0.1)
60+
cocoapods-trunk (1.6.0)
61+
nap (>= 0.8, < 2.0)
62+
netrc (~> 0.11)
63+
cocoapods-try (1.2.0)
64+
colored2 (3.1.2)
65+
concurrent-ruby (1.3.3)
66+
connection_pool (3.0.2)
67+
drb (2.2.3)
68+
escape (0.0.4)
69+
ethon (0.18.0)
70+
ffi (>= 1.15.0)
71+
logger
72+
ffi (1.17.3)
73+
fourflusher (2.3.1)
74+
fuzzy_match (2.0.4)
75+
gh_inspector (1.1.3)
76+
httpclient (2.9.0)
77+
mutex_m
78+
i18n (1.14.8)
79+
concurrent-ruby (~> 1.0)
80+
json (2.19.3)
81+
logger (1.7.0)
82+
minitest (5.27.0)
83+
molinillo (0.8.0)
84+
mutex_m (0.3.0)
85+
nanaimo (0.3.0)
86+
nap (1.1.0)
87+
netrc (0.11.0)
88+
nkf (0.2.0)
89+
public_suffix (4.0.7)
90+
rexml (3.4.4)
91+
ruby-macho (2.5.1)
92+
securerandom (0.4.1)
93+
tsort (0.2.0)
94+
typhoeus (1.6.0)
95+
ethon (>= 0.18.0)
96+
tzinfo (2.0.6)
97+
concurrent-ruby (~> 1.0)
98+
xcodeproj (1.25.1)
99+
CFPropertyList (>= 2.3.3, < 4.0)
100+
atomos (~> 0.1.3)
101+
claide (>= 1.0.2, < 2.0)
102+
colored2 (~> 3.1)
103+
nanaimo (~> 0.3.0)
104+
rexml (>= 3.3.6, < 4.0)
105+
106+
PLATFORMS
107+
ruby
108+
109+
DEPENDENCIES
110+
activesupport (>= 6.1.7.5, != 7.1.0)
111+
benchmark
112+
bigdecimal
113+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
114+
concurrent-ruby (< 1.3.4)
115+
logger
116+
mutex_m
117+
nkf
118+
tsort
119+
xcodeproj (< 1.26.0)
120+
121+
CHECKSUMS
122+
CFPropertyList (3.0.8) sha256=2c99d0d980536d3d7ab252f7bd59ac8be50fbdd1ff487c98c949bb66bb114261
123+
activesupport (7.2.3.1) sha256=11ebed516a43a0bb47346227a35ebae4d9427465a7c9eb197a03d5c8d283cb34
124+
addressable (2.8.9) sha256=cc154fcbe689711808a43601dee7b980238ce54368d23e127421753e46895485
125+
algoliasearch (1.27.5) sha256=26c1cddf3c2ec4bd60c148389e42702c98fdac862881dc6b07a4c0b89ffec853
126+
atomos (0.1.3) sha256=7d43b22f2454a36bace5532d30785b06de3711399cb1c6bf932573eda536789f
127+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
128+
benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
129+
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
130+
claide (1.1.0) sha256=6d3c5c089dde904d96aa30e73306d0d4bd444b1accb9b3125ce14a3c0183f82e
131+
cocoapods (1.15.2) sha256=f0f5153de8d028d133b96f423e04f37fb97a1da0d11dda581a9f46c0cba4090a
132+
cocoapods-core (1.15.2) sha256=322650d97fe1ad4c0831a09669764b888bd91c6d79d0f6bb07281a17667a2136
133+
cocoapods-deintegrate (1.0.5) sha256=517c2a448ef563afe99b6e7668704c27f5de9e02715a88ee9de6974dc1b3f6a2
134+
cocoapods-downloader (2.1) sha256=bb6ebe1b3966dc4055de54f7a28b773485ac724fdf575d9bee2212d235e7b6d1
135+
cocoapods-plugins (1.0.0) sha256=725d17ce90b52f862e73476623fd91441b4430b742d8a071000831efb440ca9a
136+
cocoapods-search (1.0.1) sha256=1b133b0e6719ed439bd840e84a1828cca46425ab73a11eff5e096c3b2df05589
137+
cocoapods-trunk (1.6.0) sha256=5f5bda8c172afead48fa2d43a718cf534b1313c367ba1194cebdeb9bfee9ed31
138+
cocoapods-try (1.2.0) sha256=145b946c6e7747ed0301d975165157951153d27469e6b2763c83e25c84b9defe
139+
colored2 (3.1.2) sha256=b13c2bd7eeae2cf7356a62501d398e72fde78780bd26aec6a979578293c28b4a
140+
concurrent-ruby (1.3.3) sha256=4f9cd28965c4dcf83ffd3ea7304f9323277be8525819cb18a3b61edcb56a7c6a
141+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
142+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
143+
escape (0.0.4) sha256=e49f44ae2b4f47c6a3abd544ae77fe4157802794e32f19b8e773cbc4dcec4169
144+
ethon (0.18.0) sha256=b598afc9f30448cb068b850714b7d6948e941476095d04f90a4ac65b8d6efcb2
145+
ffi (1.17.3) sha256=0e9f39f7bb3934f77ad6feab49662be77e87eedcdeb2a3f5c0234c2938563d4c
146+
fourflusher (2.3.1) sha256=1b3de61c7c791b6a4e64f31e3719eb25203d151746bb519a0292bff1065ccaa9
147+
fuzzy_match (2.0.4) sha256=b5de4f95816589c5b5c3ad13770c0af539b75131c158135b3f3bbba75d0cfca5
148+
gh_inspector (1.1.3) sha256=04cca7171b87164e053aa43147971d3b7f500fcb58177698886b48a9fc4a1939
149+
httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8
150+
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
151+
json (2.19.3) sha256=289b0bb53052a1fa8c34ab33cc750b659ba14a5c45f3fcf4b18762dc67c78646
152+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
153+
minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5
154+
molinillo (0.8.0) sha256=efbff2716324e2a30bccd3eba1ff3a735f4d5d53ffddbc6a2f32c0ca9433045d
155+
mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751
156+
nanaimo (0.3.0) sha256=aaaedc60497070b864a7e220f7c4b4cad3a0daddda2c30055ba8dae306342376
157+
nap (1.1.0) sha256=949691660f9d041d75be611bb2a8d2fd559c467537deac241f4097d9b5eea576
158+
netrc (0.11.0) sha256=de1ce33da8c99ab1d97871726cba75151113f117146becbe45aa85cb3dabee3f
159+
nkf (0.2.0) sha256=fbc151bda025451f627fafdfcb3f4f13d0b22ae11f58c6d3a2939c76c5f5f126
160+
public_suffix (4.0.7) sha256=8be161e2421f8d45b0098c042c06486789731ea93dc3a896d30554ee38b573b8
161+
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
162+
ruby-macho (2.5.1) sha256=9075e52e0f9270b552a90b24fcc6219ad149b0d15eae1bc364ecd0ac8984f5c9
163+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
164+
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
165+
typhoeus (1.6.0) sha256=bacc41c23e379547e29801dc235cd1699b70b955a1ba3d32b2b877aa844c331d
166+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
167+
xcodeproj (1.25.1) sha256=9a2310dccf6d717076e86f602b17c640046b6f1dfe64480044596f6f2f13dc84
168+
169+
RUBY VERSION
170+
ruby 4.0.1
171+
172+
BUNDLED WITH
173+
4.0.3

examples/sync-demo-bare/README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ Follow the [React Native environment setup guide](https://reactnative.dev/docs/s
6666
```
6767

6868
**Note**: The `TABLE_NAME` must match the table name you created in SQLite Cloud and enabled for OffSync.
69-
3. **Hardcode your access token** in [`src/App.tsx`](/Users/damlayildiz/SqliteCloud/sqlite-sync-react-native/examples/sync-demo-bare/src/App.tsx) by replacing the `HARDCODED_ACCESS_TOKEN` placeholder.
69+
3. **Set your auth credential** in [`examples/sync-demo-bare/.env`](/Users/damlayildiz/SqliteCloud/sqlite-sync-react-native/examples/sync-demo-bare/.env):
70+
71+
```env
72+
ACCESS_TOKEN=your_jwt_here
73+
# or use SQLITE_CLOUD_API_KEY=your_api_key_here
74+
```
75+
76+
The bare example reads env values from `.env` via `react-native-dotenv`, so after changing `.env` you should reset Metro cache before rerunning the app.
7077

7178
### 4. Install Dependencies
7279

@@ -80,8 +87,12 @@ yarn install
8087
From the repository root:
8188

8289
```bash
83-
yarn bare:ios # Build library + run iOS
84-
yarn bare:android # Build library + run Android
90+
yarn bare:metro:reset # Terminal 1: start Metro with cache reset
91+
yarn bare:ios # Terminal 2: clean + build + run iOS
92+
93+
# Android
94+
yarn bare:metro:reset # Terminal 1: same Metro command
95+
yarn bare:android # Terminal 2: clean + build + run Android
8596
```
8697

8798
## How It Works

examples/sync-demo-bare/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
"private": true,
55
"scripts": {
66
"android": "npx react-native run-android",
7+
"android:clean": "find \"${TMPDIR:-/tmp}\" -maxdepth 1 \\( -name 'metro-*' -o -name 'haste-map-*' \\) -exec rm -rf {} + && cd android && ./gradlew clean && cd .. && npx react-native run-android --no-packager",
78
"android:device": "npx react-native run-android --device",
89
"ios": "cd ios && pod install && cd .. && npx react-native run-ios",
10+
"ios:clean": "find \"${TMPDIR:-/tmp}\" -maxdepth 1 \\( -name 'metro-*' -o -name 'haste-map-*' \\) -exec rm -rf {} + && bundle check || bundle install && cd ios && bundle exec pod install && cd .. && npx react-native run-ios --no-packager",
911
"ios:device": "cd ios && pod install && cd .. && npx react-native run-ios --device",
1012
"lint": "eslint .",
1113
"start": "npx react-native start",
1214
"test": "jest",
1315
"clean": "rm -rf node_modules ios/Pods ios/build android/build android/app/build",
1416
"clean:ios": "rm -rf ios/Pods ios/build",
15-
"clean:android": "rm -rf android/build android/app/build"
17+
"clean:android": "rm -rf android/build android/app/build android/.gradle"
1618
},
1719
"dependencies": {
1820
"@op-engineering/op-sqlite": "^15.1.14",

examples/sync-demo-expo/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SQLITE_CLOUD_DATABASE_ID=
77

88
# Authentication (provide ONE of the following):
99
# Access token for user-level authentication (when using RLS)
10-
# In a real app, this comes from your auth system (e.g. Supabase Auth)
10+
# In a real app, this comes from your auth system
1111
# For testing, use a token from the user you want to test with
1212
ACCESS_TOKEN=
1313
# API key for simple authentication (if not using RLS)

examples/sync-demo-expo/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ Follow the [React Native environment setup guide](https://reactnative.dev/docs/s
6565
```env
6666
# SQLite Cloud credentials
6767
SQLITE_CLOUD_DATABASE_ID=db_xxxxxxxxxxxxxxxxxxxxxxxx
68-
SQLITE_CLOUD_API_KEY=your-api-key-here
68+
ACCESS_TOKEN=your-jwt-here
69+
# or SQLITE_CLOUD_API_KEY=your-api-key-here
6970
DATABASE_NAME=sync-demo.db
7071
TABLE_NAME=test_table
7172
@@ -75,7 +76,7 @@ Follow the [React Native environment setup guide](https://reactnative.dev/docs/s
7576
ANDROID_PACKAGE=com.yourcompany.sqlitesyncexample
7677
```
7778

78-
**Note**: The `TABLE_NAME` must match the table you created in SQLite Cloud and enabled for OffSync.
79+
**Note**: The `TABLE_NAME` must match the table you created in SQLite Cloud and enabled for OffSync. Provide either `ACCESS_TOKEN` for user-level auth/RLS or `SQLITE_CLOUD_API_KEY` if you are not using RLS.
7980

8081
### 4. Set Up Push Notifications
8182

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@
5050
"expo:ios:device": "yarn install && yarn prepare && yarn expo:example ios:device",
5151
"expo:android": "yarn install && yarn prepare && yarn expo:example android",
5252
"expo:android:device": "yarn install && yarn prepare && yarn expo:example android:device",
53-
"bare:ios": "yarn install && yarn prepare && yarn bare:example ios",
53+
"bare:ios": "yarn install && yarn prepare && yarn clean:bare:ios && yarn bare:example ios:clean",
54+
"bare:metro:reset": "cd examples/sync-demo-bare && npx react-native start --reset-cache",
5455
"bare:ios:device": "yarn install && yarn prepare && yarn bare:example ios:device",
55-
"bare:android": "yarn install && yarn prepare && yarn bare:example android",
56+
"bare:android": "yarn install && yarn prepare && yarn clean:bare:android && yarn bare:example android:clean",
5657
"bare:android:device": "yarn install && yarn prepare && yarn bare:example android:device",
5758
"postinstall": "bob build",
5859
"prepare": "./setup.sh && bob build",

react-native.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ module.exports = {
44
android: {
55
sourceDir: './android',
66
},
7-
ios: {
8-
podspecPath: './sqlite-sync-react-native.podspec',
9-
},
107
},
118
},
129
};

0 commit comments

Comments
 (0)