Skip to content

Commit b91d2b6

Browse files
Merge pull request #62 from powersync-ja/web-alpha-2
[Web Alpha] Improvements 1
2 parents 57e5be3 + 32755dc commit b91d2b6

File tree

34 files changed

+346
-160
lines changed

34 files changed

+346
-160
lines changed

.github/workflows/packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Check publish score
3434
run: |
3535
flutter pub global activate pana
36-
./.github/workflows/scripts/run-pana.sh
36+
melos analyze:packages:pana --no-select
3737
3838
test:
3939
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This triggers whenever a tagged release is pushed
2+
name: Compile Assets and Create Draft Release
3+
4+
on:
5+
push:
6+
tags:
7+
# Trigger on tags beginning with 'v'
8+
# Note that `melos version ...` adds the package name as a suffix
9+
# This action is not compatible with tags such as `powersync-v1.1.1`
10+
# marvinpinto/action-automatic-releases struggles to generate changelogs
11+
# Be sure to manually tag the commit to trigger this action
12+
- 'v*'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
22+
- name: Install Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: '3.x'
26+
channel: 'stable'
27+
28+
- name: Install Melos
29+
run: flutter pub global activate melos
30+
31+
- name: Install Dependencies and Compile Assets
32+
run: melos prepare
33+
34+
- name: Create Draft Release
35+
uses: 'marvinpinto/action-automatic-releases@latest'
36+
with:
37+
repo_token: '${{ secrets.GITHUB_TOKEN }}'
38+
prerelease: true # TODO update when out of alpha
39+
draft: true
40+
files: |
41+
assets/powersync_db.worker.js

.github/workflows/scripts/run-pana.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## 2024-02-15
7+
8+
### Changes
9+
10+
---
11+
12+
Packages with breaking changes:
13+
14+
- There are no breaking changes in this release.
15+
16+
Packages with other changes:
17+
18+
- [`powersync` - `v1.3.0-alpha.2`](#powersync---v130-alpha2)
19+
- [`powersync_attachments_helper` - `v0.3.0-alpha.2`](#powersync_attachments_helper---v030-alpha2)
20+
21+
Packages with dependency updates only:
22+
23+
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
24+
25+
- `powersync_attachments_helper` - `v0.3.0-alpha.2`
26+
27+
---
28+
29+
#### `powersync` - `v1.3.0-alpha.2`
30+
31+
- **FIX**(powersync-attachements-helper): pubspec file (#29).
32+
- **DOCS**: update readme and getting started (#51).
33+

demos/supabase-anonymous-auth/lib/powersync.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// This file performs setup of the PowerSync database
2-
import 'dart:io';
3-
2+
import 'package:universal_io/io.dart';
43
import 'package:flutter/foundation.dart';
54
import 'package:logging/logging.dart';
65
import 'package:path/path.dart';
@@ -137,8 +136,13 @@ String? getUserId() {
137136
}
138137

139138
Future<String> getDatabasePath() async {
140-
final dir = kIsWeb ? Directory('/') : await getApplicationSupportDirectory();
141-
return join(dir.path, 'powersync-demo.db');
139+
const dbFilename = 'powersync-demo.db';
140+
// getApplicationSupportDirectory is not supported on Web
141+
if (kIsWeb) {
142+
return dbFilename;
143+
}
144+
final dir = await getApplicationSupportDirectory();
145+
return join(dir.path, dbFilename);
142146
}
143147

144148
Future<void> openDatabase() async {

demos/supabase-anonymous-auth/pubspec.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,14 @@ packages:
540540
url: "https://pub.dev"
541541
source: hosted
542542
version: "1.3.2"
543+
universal_io:
544+
dependency: "direct main"
545+
description:
546+
name: universal_io
547+
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
548+
url: "https://pub.dev"
549+
source: hosted
550+
version: "2.2.2"
543551
url_launcher:
544552
dependency: transitive
545553
description:

demos/supabase-anonymous-auth/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
powersync: ^1.3.0-alpha.1
14+
powersync: ^1.3.0-alpha.2
1515
path_provider: ^2.1.1
1616
supabase_flutter: ^2.0.2
1717
path: ^1.8.3
1818
logging: ^1.2.0
1919
sqlite_async: ^0.7.0-alpha.1
20+
universal_io: ^2.2.2
2021

2122
dev_dependencies:
2223
flutter_test:

demos/supabase-edge-function-auth/lib/powersync.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// This file performs setup of the PowerSync database
2-
import 'dart:io';
3-
2+
import 'package:universal_io/io.dart';
43
import 'package:flutter/foundation.dart';
54
import 'package:logging/logging.dart';
65
import 'package:path/path.dart';
@@ -140,8 +139,13 @@ String? getUserId() {
140139
}
141140

142141
Future<String> getDatabasePath() async {
143-
final dir = kIsWeb ? Directory('/') : await getApplicationSupportDirectory();
144-
return join(dir.path, 'powersync-demo.db');
142+
const dbFilename = 'powersync-demo.db';
143+
// getApplicationSupportDirectory is not supported on Web
144+
if (kIsWeb) {
145+
return dbFilename;
146+
}
147+
final dir = await getApplicationSupportDirectory();
148+
return join(dir.path, dbFilename);
145149
}
146150

147151
Future<void> openDatabase() async {

demos/supabase-edge-function-auth/pubspec.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,14 @@ packages:
540540
url: "https://pub.dev"
541541
source: hosted
542542
version: "1.3.2"
543+
universal_io:
544+
dependency: "direct main"
545+
description:
546+
name: universal_io
547+
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
548+
url: "https://pub.dev"
549+
source: hosted
550+
version: "2.2.2"
543551
url_launcher:
544552
dependency: transitive
545553
description:

demos/supabase-edge-function-auth/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
powersync: ^1.3.0-alpha.1
14+
powersync: ^1.3.0-alpha.2
1515
path_provider: ^2.1.1
1616
supabase_flutter: ^2.0.2
1717
path: ^1.8.3
1818
logging: ^1.2.0
1919
sqlite_async: ^0.7.0-alpha.1
20+
universal_io: ^2.2.2
2021

2122
dev_dependencies:
2223
flutter_test:

0 commit comments

Comments
 (0)