Просмотр исходного кода

chore: docs on running wrangler locally

Gabriel Horner 1 неделя назад
Родитель
Сommit
8bf63e9715
2 измененных файлов с 25 добавлено и 1 удалено
  1. 2 0
      deps/db-sync/README.md
  2. 23 1
      docs/develop-logseq.md

+ 2 - 0
deps/db-sync/README.md

@@ -31,6 +31,8 @@ wrangler d1 migrations apply logseq-sync-graph-meta-staging --env staging
 wrangler d1 migrations apply logseq-sync-graphs-prod --env prod
 ```
 
+For local development, run `wrangler d1 migrations apply DB --local`.
+
 ### Node.js Adapter (self-hosted)
 
 Build the adapter:

+ 23 - 1
docs/develop-logseq.md

@@ -123,7 +123,29 @@ yarn release-electron
 
 The final released binaries or installers will be at `static/out/`.
 
-## DB sync Node adapter (self-hosted)
+## DB sync
+
+DB sync can be run locally in one of two ways as described in the following
+sections. To use a local sync approach, the app must be built with
+`$ENABLE_DB_SYNC_LOCAL` e.g. `ENABLE_DB_SYNC_LOCAL=true yarn watch`. For more
+about db sync, see [its readme](/deps/db-sync/README.md).
+
+### DB sync Cloudflare Worker adapter
+
+Build and run a Cloudlare worker locally
+
+```bash
+cd deps/db-sync
+yarn install
+yarn release
+# This migration is a one time setup
+cd worker && wrangler d1 migrations apply DB --local && cd -
+yarn dev
+```
+
+When testing
+
+### DB sync Node adapter (self-hosted)
 
 Build and run the Node.js adapter for self-hosted DB sync.