;; Test-only build config. ird-p2p-cljs is a source git dependency (see README);
;; consumers compile src/ with their own shadow-cljs/cljs build and never need
;; this file. Dependencies and source paths come from deps.edn (:test alias).
;;
;; :prepend defines the ESM dynamic-import helper in the entry file, which Node
;; loads natively (so its import() has a dynamic-import callback). The libp2p
;; stack is ESM-only; ird.p2p.impl.libp2p calls this helper. Under :node-test
;; the compiled runtime is loaded without an import callback, so import() from
;; inside it would fail with ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING.
{:deps {:aliases [:test]}
:builds
{;; offline suite: every ird.p2p.*-test namespace except the network-gated ird.p2p.live.*
:test {:target :node-test
:output-to "target/test.js"
:ns-regexp "^ird\\.p2p\\.(?!live).+-test$"
:prepend "globalThis.ird_dyn_import = function (n) { return import(n); };\n"}
;; live smoke suite against a real app; skips itself without IRD_P2P_HOST + IRD_P2P_ORIGIN
:live {:target :node-test
:output-to "target/live.js"
:ns-regexp "^ird\\.p2p\\.live\\..*-test$"
:prepend "globalThis.ird_dyn_import = function (n) { return import(n); };\n"}}}