;; Four SEPARATE builds — one per process entry — so the two native WebRTC
;; stacks can never meet in one module graph (the two-stack law, house rule 11):
;; :main → dist/main.js value-imports ardegazu-peer-kit ONLY
;; :worker → dist/worker.js value-imports ardegazu-rooms-kit ONLY
;; :train → dist/rl/train.js peer-kit gyms + train-kit (no rooms-kit)
;; :link → dist/fleet/link.js peer-kit identity only
;; npm deps stay external ESM imports (:js-provider :import) — the kits'
;; libdatachannel natives and tfjs-node must never be bundled. scripts/build.mjs
;; assembles the four outputs into dist/ and normalizes gensyms for the
;; deterministic committed dist (deploy/check-dist.sh).
;;
;; :exports on :main are the pure-function surface the black-box test suite
;; exercises against the committed dist (test/*.test.mjs).
{:deps {:aliases [:dev]}
:builds
{:main
{:target :esm
:output-dir "target/esm-main"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var — under parallel
;; compilation the counter interleaves
;; nondeterministically, and THAT class of delta cannot
;; be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:main {:entries [__NAME__.main]
:init-fn __NAME__.main/init
:exports {loadConfig __NAME__.config/load-config
shouldReap __NAME__.main/should-reap
roomKey __NAME__.rooms/room-key
appOfHost __NAME__.rooms/app-of-host
backoffDelay __NAME__.rooms/backoff-delay
joinWorkerRoom __NAME__.rooms/join-worker-room
attachBehavior __NAME__.behaviors/attach-behavior}}}}
:worker
{:target :esm
:output-dir "target/esm-worker"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var — under parallel
;; compilation the counter interleaves
;; nondeterministically, and THAT class of delta cannot
;; be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:worker {:entries [__NAME__.worker]
:init-fn __NAME__.worker/init}}}
:train
{:target :esm
:output-dir "target/esm-train"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var — under parallel
;; compilation the counter interleaves
;; nondeterministically, and THAT class of delta cannot
;; be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:train {:entries [__NAME__.rl.train]
:init-fn __NAME__.rl.train/init}}}
:link
{:target :esm
:output-dir "target/esm-link"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var — under parallel
;; compilation the counter interleaves
;; nondeterministically, and THAT class of delta cannot
;; be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:link {:entries [__NAME__.fleet.link]
:init-fn __NAME__.fleet.link/init}}}}}