My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

deploy.sh: add one-time setup instructions for opam switches and jtw

Replace terse prerequisites list with copy-pasteable commands for
creating the three opam switches, pinning js_top_worker packages,
and building/installing the monorepo tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+41 -6
+41 -6
odoc-interactive-extension/deploy.sh
··· 1 1 #!/bin/bash 2 2 # Deploy interactive OCaml demo pages. 3 3 # 4 - # Prerequisites: 5 - # - opam switches: default (OCaml 5.4, yojson 3.0), demo-yojson-v2 (yojson 2.2), 5.2.0+ox 6 - # - js_top_worker packages pinned and installed in each switch that needs a universe 7 - # - jtw (odoc-notebook) installed in default switch 8 - # - odoc-interactive-extension installed in default switch (dune install) 4 + # This script builds 6 demo pages that showcase in-browser OCaml evaluation 5 + # using the odoc-interactive-extension and js_top_worker (jtw). 6 + # 7 + # ─── One-time setup ────────────────────────────────────────────────────── 8 + # 9 + # 1. Create the opam switches. The "default" switch is used for building 10 + # the monorepo and for the yojson 3.x universes. 11 + # 12 + # # default switch (should already exist) 13 + # opam switch create default ocaml-base-compiler.5.4.1 14 + # eval $(opam env --switch default --set-switch) 15 + # opam install yojson 16 + # 17 + # # yojson 2.x switch (for demo2_v2) 18 + # opam switch create demo-yojson-v2 ocaml-base-compiler.5.4.1 19 + # eval $(opam env --switch demo-yojson-v2 --set-switch) 20 + # opam install yojson.2.2.2 21 + # 22 + # # OxCaml switch (for demo3_oxcaml) 23 + # opam switch create 5.2.0+ox \ 24 + # --repos ox=git+https://github.com/oxcaml/opam-repository.git,default 25 + # 26 + # 2. Pin and install js_top_worker packages in every switch that needs a 27 + # universe. From the monorepo root: 28 + # 29 + # for sw in default demo-yojson-v2 5.2.0+ox; do 30 + # eval $(opam env --switch $sw --set-switch) 31 + # opam pin add js_top_worker . --no-action 32 + # opam pin add js_top_worker-web . --no-action 33 + # opam install js_top_worker js_top_worker-web 34 + # done 35 + # 36 + # 3. Build and install the monorepo tools (jtw, odoc, the extension) 37 + # into the default switch: 38 + # 39 + # eval $(opam env --switch default --set-switch) 40 + # dune build @install && dune install 41 + # 42 + # After this, `jtw opam --help` should work. 43 + # 44 + # ─── Usage ─────────────────────────────────────────────────────────────── 9 45 # 10 - # Usage: 11 46 # ./deploy.sh # build everything and serve on port 8080 12 47 # ./deploy.sh --no-serve # build only, don't start HTTP server 13 48