Browse Source

chore: add basic testing instructions

Move commented out PUBLISH-API-BASE so that it actually works
Gabriel Horner 2 weeks ago
parent
commit
a24a7d48fe
2 changed files with 15 additions and 2 deletions
  1. 12 0
      deps/publish/README.md
  2. 3 2
      src/main/frontend/config.cljs

+ 12 - 0
deps/publish/README.md

@@ -20,3 +20,15 @@ This module is intended to be consumed by the Logseq app and the publishing work
 ## Dev
 
 Keep this module aligned with the main repo's linting and testing conventions.
+
+### Local Testing
+
+For one-time setup, install the [CloudFlare cli wrangler](https://developers.cloudflare.com/workers/wrangler/) with `npm install -g wrangler@latest`.
+
+To test the publish feature locally, follow these steps:
+
+* Run `yarn watch` or `yarn release` to build the publish worker js asset.
+* Run `wrangler dev` in worker/ to start a local cloudflare worker server.
+* In `frontend.config`, enable the commented out `PUBLISH-API-BASE` which points to a localhost url.
+* Login on the desktop app.
+* Go to any page and select `Publish` from its page menu.

+ 3 - 2
src/main/frontend/config.cljs

@@ -25,8 +25,6 @@
 ;; when it launches (when pro plan launches) it should be removed
 (def ENABLE-SETTINGS-ACCOUNT-TAB false)
 
-;; (def PUBLISH-API-BASE "http://localhost:8787")
-
 (if ENABLE-FILE-SYNC-PRODUCTION
   (do (def LOGIN-URL
         "https://logseq-prod.auth.us-east-1.amazoncognito.com/login?client_id=3c7np6bjtb4r1k1bi9i049ops5&response_type=code&scope=email+openid+phone&redirect_uri=logseq%3A%2F%2Fauth-callback")
@@ -50,6 +48,9 @@
       (def OAUTH-DOMAIN "logseq-test2.auth.us-east-2.amazoncognito.com")
       (def PUBLISH-API-BASE "https://logseq-publish-staging.logseq.workers.dev")))
 
+;; Enable for local development
+;; (def PUBLISH-API-BASE "http://localhost:8787")
+
 (goog-define ENABLE-RTC-SYNC-PRODUCTION false)
 (if ENABLE-RTC-SYNC-PRODUCTION
   (def RTC-WS-URL "wss://ws.logseq.com/rtc-sync?token=%s")