;; shadow-cljs builds for the __NAME__ client (live/game stack in CLJS —
;; game1 is the canon this scaffold mirrors; dev/docs/CLJS.md is the law).
;;
;; :app — the browser build. Unlike the kits (external ESM imports), an APP
;; bundles its npm deps. Two modules keep the social-kit lazy boundary REAL:
;; :main carries the app + net + "ardegazu-social-kit/join" (the lean chips),
;; :social is loaded via shadow.lazy after boot and is the ONLY module
;; referencing "ardegazu-social-kit" — mirroring the TS
;; `void import("ardegazu-social-kit")` chunk split.
;;
;; :asset-path is RELATIVE — one build must serve at
;; https://__HOST__/ and /ipfs/<cid>/ alike.
;;
;; When black-box tests arrive, add a :testlib build (:target :esm,
;; :optimizations :simple, :js-options {:js-provider :import}) exporting the
;; pure logic — game1's shadow-cljs.edn shows the shape.
{:deps {:aliases [:dev]}
;; BOTH dev ports serve public/ + dist-dev/ — the WATCH's own output tree,
;; never dist/. dist/ belongs to `ardz build` alone: it holds a RELEASE build
;; (goog.DEBUG=false → the PRODUCTION relay), and the old
;; `4173 {:roots ["dist"]}` arm served exactly that to a dev tab whenever
;; the watcher had not overwritten it yet (or the browser had cached it) —
;; two tabs of one dev session then sat on DIFFERENT relays and never met.
;; scripts/dev.mjs redirects the watch to dist-dev/assets via --config-merge;
;; smoke a release build with a standalone static server over dist/, never
;; through these ports.
;; :use-index-files true — without it shadow's undertow file handler gets NO
;; welcome files (it only sets them from this key), so a directory request
;; ("/", "/id/") falls through to the push-state handler, which 404s any
;; request whose Accept header lacks text/html (curl, fetch). With it, "/"
;; serves index.html from the first root that has one.
:dev-http {5173 {:roots ["public" "dist-dev"] :push-state/index "index.html" :use-index-files true}
4173 {:roots ["public" "dist-dev"] :push-state/index "index.html" :use-index-files true}}
:builds
{:app
{:target :browser
:output-dir "dist/assets"
:asset-path "./assets"
:compiler-options {:optimizations :advanced
:infer-externs :auto
:source-map false}
:module-loader true
:modules
{:main {:init-fn __NAME__.main/init}
:social {:entries [__NAME__.social]
:depends-on #{:main}}}}}}