Tienson Qin 0eadb024de Merge branch 'master' into feat/worker-sync 2 هفته پیش
..
.carve cd8f312b9f enhance(dev): add linters and workflow for publish 4 هفته پیش
.clj-kondo 143a548f04 fix: more lint error 3 هفته پیش
scripts 8c4be25e92 add timestamp version to invalid cache 1 ماه پیش
src 0eadb024de Merge branch 'master' into feat/worker-sync 2 هفته پیش
worker 729ca7fcbf Merge branch 'master' into feat/worker-sync 3 هفته پیش
.gitignore cd8f312b9f enhance(dev): add linters and workflow for publish 4 هفته پیش
README.md 5d4a91eb7e enhance(dev): Add more publish docs 4 هفته پیش
bb.edn cd8f312b9f enhance(dev): add linters and workflow for publish 4 هفته پیش
deps.edn a5fe0b8dd5 fix: publish not building in CI 4 هفته پیش
package.json 8c4be25e92 add timestamp version to invalid cache 1 ماه پیش
shadow-cljs.edn d4d8b1a7e6 fix: add shadow-cljs.edn for publish worker 1 ماه پیش
yarn.lock d4d8b1a7e6 fix: add shadow-cljs.edn for publish worker 1 ماه پیش

README.md

Description

Shared library for page publish features (snapshot payloads, SSR helpers, shared schemas, and storage contracts).

The Cloudflare Durable Object implementation is expected to use SQLite with the Logseq datascript fork layered on top. Page publish payloads are expected to send datoms (transit) so the DO can reconstruct/query datascript state.

See deps/publish/worker for a Cloudflare Worker skeleton that stores transit blobs in R2 and metadata in a SQLite-backed Durable Object.

API

Namespaces live under logseq.publish.

Usage

This module is intended to be consumed by the Logseq app and the publish worker.

Dev

Keep this module aligned with the main repo's linting and testing conventions. Most of the same linters are used, with configurations that are specific to this library. See this library's CI file for linting examples.

Local Testing

For one-time setup, install the CloudFlare cli wrangler with npm install -g wrangler@latest.

To test the publish features 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.

Deploy

When changes are ready to be deployed, run yarn deploy.