From cfddbcc70a3abeaebfdd10162c320f75c5042865 Mon Sep 17 00:00:00 2001 From: Christiaan Landman Date: Thu, 12 Dec 2024 13:26:01 +0200 Subject: [PATCH] Calling `copy-assets` as `pre` step for serving and building instead of as a post install. --- demos/angular-supabase-todolist/README.md | 2 +- demos/angular-supabase-todolist/package.json | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/demos/angular-supabase-todolist/README.md b/demos/angular-supabase-todolist/README.md index 9bb394a0..6b32f90c 100644 --- a/demos/angular-supabase-todolist/README.md +++ b/demos/angular-supabase-todolist/README.md @@ -22,7 +22,7 @@ A step-by-step guide on Supabase<>PowerSync integration is available [here](http ### Notes - The Angular development server (`pnpm serve`) doesn't support service worker applications -- For Angular, workers need to be configured when instantiating `PowerSyncDatabase`. To do this, copy the worker assets (`pnpm powersync-web copy-assets -o src/assets` - done automatically as a `postinstall` step in this demo) and ensure the worker paths are specified ([example here](./src/app/powersync.service.ts)). +- For Angular, workers need to be configured when instantiating `PowerSyncDatabase`. To do this, copy the worker assets (`pnpm powersync-web copy-assets -o src/assets` - done automatically as `pre-` steps in this demo for serving and building) and ensure the worker paths are specified ([example here](./src/app/powersync.service.ts)). ## Development Server diff --git a/demos/angular-supabase-todolist/package.json b/demos/angular-supabase-todolist/package.json index 395ffcb7..584e6ba2 100644 --- a/demos/angular-supabase-todolist/package.json +++ b/demos/angular-supabase-todolist/package.json @@ -2,14 +2,17 @@ "name": "angular-supabase-todolist", "version": "0.0.25", "scripts": { + "copy-assets": "pnpm powersync-web copy-assets -o src/assets", "ng": "ng", + "preserve": "pnpm copy-assets", "serve": "ng serve", "start": "http-server -p 8080 -c-1 dist/", + "prebuild": "pnpm copy-assets", "build": "ng build", "format": "prettier --write .", "test:build": "pnpm build", - "watch": "ng build --watch --configuration development", - "postinstall": "[ \"$GITHUB_ACTIONS\" = \"true\" ] || pnpm powersync-web copy-assets -o src/assets" + "prewatch": "pnpm copy-assets", + "watch": "ng build --watch --configuration development" }, "private": true, "dependencies": {