Skip to content

Commit ad31b39

Browse files
authored
Merge branch 'main' into auto-profiling
2 parents 51cc4af + 042589c commit ad31b39

File tree

110 files changed

+8907
-4972
lines changed

Some content is hidden

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

110 files changed

+8907
-4972
lines changed

.changeset/config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
"access": "restricted",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": [],
10+
"ignore": ["!@powersync/*"],
1111
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
1212
"onlyUpdatePeerDependentsWhenOutOfRange": true,
1313
"updateInternalDependents": "out-of-range"
14+
},
15+
"privatePackages": {
16+
"tag": true,
17+
"version": true
1418
}
1519
}

.changeset/happy-gifts-sort.md

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

.changeset/mean-carrots-relax.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@powersync/common': minor
3+
'@powersync/web': minor
4+
'@powersync/react-native': minor
5+
---
6+
7+
Added a warning if connector `uploadData` functions don't process CRUD items completely.

.changeset/real-bottles-mate.md

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

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.idea
3+
4+
**/node_modules
5+
**/dist
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Diagnostics Image Build
2+
3+
on:
4+
push:
5+
6+
concurrency: ${{ github.workflow }}-${{ github.ref }}
7+
8+
jobs:
9+
build-docker-image:
10+
name: Build diagnostics-app Docker Image
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Build Image
20+
uses: docker/build-push-action@v5
21+
with:
22+
platforms: linux/amd64
23+
cache-from: type=registry,ref=${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:latest
24+
context: .
25+
file: ./tools/diagnostics-app/Dockerfile
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Publishes the Diagnostics App Docker image to DockerHub
2+
# This is triggered whenever the `diagnostics-app` package is versioned and tagged
3+
name: Diagnostics Image Release
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
tags:
9+
- '@powersync/diagnostics-app*'
10+
11+
concurrency: ${{ github.workflow }}-${{ github.ref }}
12+
13+
jobs:
14+
release-docker-image:
15+
name: Build and Release diagnostics-app Docker Image
16+
runs-on: ubuntu-latest
17+
if: github.ref == 'refs/heads/main'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
31+
# This uses the service's package.json version for the Docker Image tag
32+
- name: Get Image Version from package.json
33+
id: get_version
34+
run: echo "IMAGE_VERSION=$(node -p "require('./tools/diagnostics-app/package.json').version")" >> $GITHUB_OUTPUT
35+
36+
- name: Build Image and Push
37+
uses: docker/build-push-action@v5
38+
with:
39+
platforms: linux/amd64
40+
cache-from: type=registry,ref=${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:latest
41+
context: .
42+
tags: ${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:latest,${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}:${{steps.get_version.outputs.IMAGE_VERSION}}
43+
push: true
44+
file: ./tools/diagnostics-app/Dockerfile
45+
46+
# Updates the README section on the DockerHub page
47+
- name: Update repo description
48+
# Note that this 3rd party extention is recommended in the DockerHub docs:
49+
# https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/
50+
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0
51+
with:
52+
username: ${{ secrets.DOCKERHUB_USERNAME }}
53+
password: ${{ secrets.DOCKERHUB_TOKEN }}
54+
repository: ${{vars.DIAGNOSTICS_DOCKER_REGISTRY}}
55+
# This is the contents of what will be shown on DockerHub
56+
readme-filepath: ./tools/diagnostics-app/README.md

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
- uses: pnpm/action-setup@v2
2222
name: Install pnpm
2323
with:
24-
version: 9
24+
# Pnpm 9.4 introduces this https://github.com/pnpm/pnpm/pull/7633
25+
# which causes workspace:^1.2.0 to be converted to 1.2.0^1.2.0
26+
version: 9.3
2527
run_install: false
2628
- name: Get pnpm store directory
2729
shell: bash

.github/workflows/test-isolated.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Ensures packages and demos test correctly
2+
name: Test Isolated Demos
3+
4+
on:
5+
push:
6+
7+
jobs:
8+
test:
9+
name: Test Isolated Demos
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
16+
- name: Setup NodeJS
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: '.nvmrc'
20+
21+
- uses: pnpm/action-setup@v2
22+
name: Install pnpm
23+
with:
24+
# Pnpm 9.4 introduces this https://github.com/pnpm/pnpm/pull/7633
25+
# which causes workspace:^1.2.0 to be converted to 1.2.0^1.2.0
26+
version: 9.3
27+
run_install: false
28+
29+
- name: Get pnpm store directory
30+
shell: bash
31+
run: |
32+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
33+
34+
- uses: actions/cache@v3
35+
name: Setup pnpm cache
36+
with:
37+
path: ${{ env.STORE_PATH }}
38+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
${{ runner.os }}-pnpm-store-
41+
42+
- name: Install
43+
run: pnpm install
44+
45+
- name: Build Packages
46+
run: pnpm build:packages
47+
48+
- name: Start Verdaccio
49+
run: |
50+
npm install -g verdaccio
51+
nohup verdaccio -c verdaccio-config.yaml &
52+
sleep 10 # Give Verdaccio some time to start
53+
54+
- name: Prepare For Test Publish
55+
run: npx tsx scripts/test-publish-helper.ts
56+
57+
- name: Registry login
58+
run: npx npm-cli-login -u test -p test -e test@example.com -r http://localhost:4873
59+
60+
- name: Config Temporary Registry
61+
run: echo "@powersync:registry=http://localhost:4873" >> ~/.npmrc
62+
63+
# No actual auth is ever supplied to this action.
64+
# It should never be able to publish to NPMJS
65+
- name: Test publish
66+
run: pnpm -r publish --no-git-checks
67+
68+
- name: Test Demos
69+
run: npx tsx scripts/isolated-demo-test.ts
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# See the local demo at https://github.com/powersync-ja/self-host-demo/tree/main/demos/supabase
2+
WEBPACK_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
3+
WEBPACK_PUBLIC_SUPABASE_ANON_KEY=
4+
WEBPACK_PUBLIC_POWERSYNC_URL=http://localhost:8080

demos/angular-supabase-todolist/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,3 @@ testem.log
166166
# System files
167167
.DS_Store
168168
Thumbs.db
169-
170-
environment.ts

demos/angular-supabase-todolist/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# PowerSync Angular Demo
22

3+
## 0.0.25
4+
5+
### Patch Changes
6+
7+
- @powersync/web@1.2.4
8+
9+
## 0.0.24
10+
11+
### Patch Changes
12+
13+
- Updated dependencies [31c61b9]
14+
- @powersync/web@1.2.3
15+
16+
## 0.0.23
17+
18+
### Patch Changes
19+
20+
- a567998: Upgrade to Angular 18 and fix build issues
21+
- Updated dependencies [a1b52be]
22+
- @powersync/web@1.2.2
23+
324
## 0.0.22
425

526
### Patch Changes

demos/angular-supabase-todolist/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ A step-by-step guide on Supabase<>PowerSync integration is available [here](http
1313
## Quick Start
1414

1515
1. Run `pnpm install`
16-
2. Run `pnpm watch` to build application and check for code changes
17-
3. In a new terminal run `pnpm start` to start the server
18-
4. Go to <http://localhost:8080>
16+
2. Create a `.env` file by copying the template `cp .env.template .env`
17+
3. Populate the `.env` file with PowerSync and Supabase details
18+
4. Run `pnpm watch` to build application and check for code changes
19+
5. In a new terminal run `pnpm start` to start the server
20+
6. Go to <http://localhost:8080>
1921

2022
**Note:** The Angular development server (`pnpm serve`) doesn't support service worker applications
2123

demos/angular-supabase-todolist/angular.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121
"path": "./extra-webpack.config.js"
2222
},
2323
"allowedCommonJsDependencies": [
24-
"object-hash",
25-
"event-iterator",
26-
"can-ndjson-stream",
27-
"lodash",
2824
"js-logger",
29-
"websocket"
25+
"ws"
3026
],
3127
"outputPath": "dist",
3228
"index": "src/index.html",

demos/angular-supabase-todolist/extra-webpack.config.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
const webpack = require('webpack');
22
const pkg = require('./package.json');
3-
const { inspect } = require('util');
43
const path = require('path');
54

5+
const dotenv = require('dotenv');
6+
7+
dotenv.config();
8+
69
module.exports = (config, options, targetOptions) => {
710
delete config.optimization;
811
return {
@@ -11,16 +14,33 @@ module.exports = (config, options, targetOptions) => {
1114
rules: config.module.rules
1215
},
1316
resolve: config.resolve,
14-
plugins: config.plugins,
17+
plugins: [
18+
...config.plugins,
19+
new webpack.DefinePlugin({
20+
// Embed environment variables starting with `WEBPACK_PUBLIC_`
21+
'process.env': JSON.stringify(
22+
Object.fromEntries(Object.entries(process.env).filter(([key]) => key.startsWith('WEBPACK_PUBLIC_')))
23+
)
24+
})
25+
],
1526
output: {
1627
filename: config.filename,
1728
path: config.path,
1829
clean: true
1930
},
31+
experiments: {
32+
...config.experiments,
33+
topLevelAwait: true
34+
},
35+
externals: {
36+
// BSON includes imports to these, but does not have a hard requirement for them to be present.
37+
crypto: 'Crypto',
38+
stream: 'Stream',
39+
vm: 'VM'
40+
},
2041
resolveLoader: { symlinks: true },
2142
cache: config.cache,
2243
target: config.target,
23-
experiments: config.experiments,
2444
stats: config.stats,
2545
devtool: 'source-map',
2646
mode: 'development'
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
{
22
"name": "angular-supabase-todolist",
3-
"version": "0.0.22",
3+
"version": "0.0.25",
44
"scripts": {
55
"ng": "ng",
66
"serve": "ng serve",
77
"start": "http-server -p 8080 -c-1 dist/",
88
"build": "ng build",
99
"format": "prettier --write .",
10+
"test:build": "pnpm build",
1011
"watch": "ng build --watch --configuration development"
1112
},
1213
"private": true,
1314
"dependencies": {
14-
"@angular/animations": "^17.0.4",
15-
"@angular/common": "^17.0.4",
16-
"@angular/compiler": "^17.0.4",
17-
"@angular/core": "^17.0.4",
18-
"@angular/forms": "^17.0.4",
19-
"@angular/platform-browser": "^17.0.4",
20-
"@angular/platform-browser-dynamic": "^17.0.4",
21-
"@angular/router": "^17.0.4",
22-
"@angular/service-worker": "^17.0.4",
15+
"@angular/animations": "^18.1.1",
16+
"@angular/common": "^18.1.1",
17+
"@angular/compiler": "^18.1.1",
18+
"@angular/core": "^18.1.1",
19+
"@angular/forms": "^18.1.1",
20+
"@angular/platform-browser": "^18.1.1",
21+
"@angular/platform-browser-dynamic": "^18.1.1",
22+
"@angular/router": "^18.1.1",
23+
"@angular/service-worker": "^18.1.1",
24+
"@journeyapps/wa-sqlite": "^0.2.0",
2325
"@powersync/web": "workspace:*",
24-
"@journeyapps/wa-sqlite": "^0.0.2",
25-
"@supabase/supabase-js": "^2.38.5",
26+
"@supabase/supabase-js": "^2.44.4",
2627
"rxjs": "~7.8.1",
27-
"tslib": "^2.6.2",
28-
"zone.js": "~0.14.2"
28+
"tslib": "^2.6.3",
29+
"zone.js": "~0.14.8"
2930
},
3031
"devDependencies": {
31-
"@angular-builders/custom-webpack": "^17.0.0",
32-
"@angular-devkit/build-angular": "^17.0.3",
33-
"@angular/cli": "^17.0.3",
34-
"@angular/compiler-cli": "^17.0.4",
32+
"@angular-builders/custom-webpack": "^18.0.0",
33+
"@angular-devkit/build-angular": "^18.1.1",
34+
"@angular/cli": "^18.1.1",
35+
"@angular/compiler-cli": "^18.1.1",
36+
"dotenv": "^16.4.5",
3537
"http-server": "^14.1.1",
36-
"prettier": "^3.1.0",
37-
"typescript": "~5.2.2"
38+
"typescript": "~5.5.3"
3839
}
3940
}

demos/angular-supabase-todolist/src/app/supabase.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
type SupabaseClient,
88
type User
99
} from '@supabase/supabase-js';
10-
import { environment } from '../../environment';
10+
import { environment } from '../environment';
1111
import { type AbstractPowerSyncDatabase, type CrudEntry, UpdateType, PowerSyncBackendConnector } from '@powersync/web';
1212

1313
/// Postgres Response codes that we cannot recover from by retrying.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare namespace NodeJS {
2+
// These are injected in the Webpack config
3+
interface ProcessEnv {
4+
WEBPACK_PUBLIC_SUPABASE_URL: string;
5+
WEBPACK_PUBLIC_SUPABASE_ANON_KEY: string;
6+
WEBPACK_PUBLIC_POWERSYNC_URL: string;
7+
}
8+
}

0 commit comments

Comments
 (0)