package transom

  1. Overview
  2. Docs
OCaml sidecar glue for Tauri-style desktop apps

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1.0.tar.gz
md5=a6aa17a9cab249e390f574553bc22620
sha512=56ac775c6b61fc45488795f2658fcfcbf380427f9477e94d6d69770a6df288851f266fb026d27696ba579caa37386404e4059fa2d2218b23e8b1e5c59cd9994b

doc/README.html

Transom

Transom helps connect a Tauri/webview frontend to an OCaml native sidecar over newline-delimited JSON.

The v0.1 scope is small: a runtime protocol library, a manifest-driven code generator, a CLI, and one minimal project template. Users bring their own ATD files and ATD-generated JSON codecs.

Install From Source

opam install . --deps-only
dune build @all
dune install

During development, run the CLI without installing it:

dune exec transom -- version

Quickstart

Create a project from the minimal template:

transom new hello
cd hello/backend

Generate ATD codecs and Transom glue:

opam install atdgen
atdgen -t -o bin/api api.atd
atdgen -j -o bin/api api.atd
transom gen --manifest transom.json --out bin
dune build

The template is intentionally plain. It does not run npm, Cargo, opam, or Dune for you.

Manifest

Transom uses JSON for v0.1:

{
  "service_module": "Api_server",
  "types_module": "Api_t",
  "json_module": "Api_j",
  "typescript_types_module": "./api_types",
  "commands": [
    {
      "name": "ping",
      "request": "ping_req",
      "response": "ping_res",
      "ts_request": "PingReq",
      "ts_response": "PingRes"
    }
  ]
}

The generator writes:

transom gen --manifest transom.json --out generated

This creates api_server.mli, api_server.ml, and api_client.ts.

CLI

transom version
transom paths
transom doctor
transom check --manifest transom.json
transom gen --manifest transom.json --out generated
transom new NAME --template minimal

transom paths prints template search paths in order:

  1. TRANSOM_TEMPLATE_DIR
  2. ./templates
  3. $OPAM_SWITCH_PREFIX/share/transom/templates

Not In v0.1

Transom v0.1 does not implement a Tauri replacement, native GUI toolkit, schema language, webview host, async runtime integration, plugin system, npm package, or Cargo crate. It also does not parse .atd files. ATD codecs are supplied by the user.