Skip to content

Commit 3480915

Browse files
chore: update README with degit instructions, remove IF NOT EXISTS from schema, and adjust Vite worker format
1 parent f4b777b commit 3480915

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ We recommend using the first option for a quick start.
1111
2. Use [degit](https://github.com/Rich-Harris/degit) to scaffold the project:
1212

1313
```bash
14-
npx degit powersync-product-success/vite-react-ts-powersync-supabase vite-react-ts-powersync-supabase
14+
npx degit powersync-product-success/vite-react-ts-powersync-supabase my-powersync-app
15+
cd my-powersync-app
1516
```
1617

18+
> **Note**: `degit` is a tool that downloads the latest version of a repository without the git history, giving you a clean starting point. Replace `my-powersync-app` with your preferred project name.
19+
1720
3. Clone the repository directly and install dependencies:
1821

1922
```bash
@@ -121,4 +124,4 @@ The sync rules are already deployed if you followed the CLI setup steps above.
121124
#### Option 2: Using Dashboard
122125
1. Open the [`sync-rules.yaml`](sync-rules.yaml) in this repo and copy the contents.
123126
2. In the [PowerSync dashboard](https://powersync.journeyapps.com/), paste that into the 'sync-rules.yaml' editor panel.
124-
3. Click the "Deploy sync rules" button and select your PowerSync instance from the drop-down list.
127+
3. Click the "Deploy sync rules" button and select your PowerSync instance from the drop-down list.

database.pgsql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- See our guide for more information on how to set up your Supabase database:
22
-- https://docs.powersync.com/integration-guides/supabase-+-powersync#supabase-powersync
33

4-
CREATE TABLE IF NOT exists counters
4+
CREATE TABLE counters
55
(
66
id TEXT PRIMARY KEY,
77
count INTEGER NOT NULL DEFAULT 0,
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT exists counters
1010
);
1111

1212
-- Create a role/user with replication privileges for PowerSync
13-
CREATE IF NOT EXISTS ROLE powersync_role WITH REPLICATION BYPASSRLS LOGIN PASSWORD 'myhighlyrandompassword';
13+
CREATE ROLE powersync_role WITH REPLICATION BYPASSRLS LOGIN PASSWORD 'myhighlyrandompassword';
1414
-- Set up permissions for the newly created role
1515
-- Read-only (SELECT) access is required
1616
GRANT SELECT ON ALL TABLES IN SCHEMA public TO powersync_role;

vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import react from '@vitejs/plugin-react';
55
// https://vite.dev/config/
66
export default defineConfig({
77
plugins: [react(), wasm()],
8+
worker: {
9+
format: 'es'
10+
},
811
optimizeDeps: {
912
// Don't optimize these packages as they contain web workers and WASM files.
1013
// https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673

0 commit comments

Comments
 (0)