game3 / client / shadow-cljs.edn
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
;; shadow-cljs builds for the tessera client (CLJS app canon: game1).
;;
;; :app — the browser build. It bundles its npm deps (the libp2p family is
;; plain ESM in node_modules; shadow's default :browser bundling consumes it).
;; The two ardegazu kits are NOT among them: id-kit and social-kit are
;; ClojureScript libraries compiled from source off the classpath
;; (client/deps.edn), so they are ordinary namespaces in this module graph.
;; Two modules keep the social-kit lazy boundary REAL: :main carries the game
;; + net + ardegazu.social.join (the lean chips — that namespace requires only
;; ardegazu.social.text), :social is loaded via shadow.lazy after boot and is
;; the ONLY module reaching ardegazu.social.{gamelb,app-boot} (GameLb +
;; attach-social). ardegazu.social.net — the kit's sole libp2p-bearing
;; namespace — is required by nothing here, so it never enters either module.
;;
;; :asset-path is RELATIVE — one build must serve at
;; https://game3.ardegazu.ro/ and /ipfs/<cid>/ alike.
;;
;; :testlib — the pure game/net logic compiled to node-consumable ESM for the
;; black-box tests in test/*.test.mjs (golden vectors from the TS canon).
{: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 game3.main/init}
    :social {:entries [game3.social]
             :depends-on #{:main}}}}
  :testlib
  {:target :esm
   :output-dir "test-dist"
   :compiler-options {:optimizations :simple
                      :source-map false}
   :js-options {:js-provider :import}
   :modules
   {:testlib
    {:entries [game3.testlib]
     :exports {spawnStarts game3.game.sim/spawn-starts
               splashCells game3.game.sim/splash-cells
               tickHeads game3.game.sim/tick-heads!
               pushInput game3.game.sim/push-input!
               bloomSpawns game3.game.sim/bloom-spawns?
               tally game3.game.sim/tally
               rleEncode game3.game.sim/rle-encode
               rleDecodeCells game3.game.sim/rle-decode-cells
               claimDecision game3.game.sim/claim-decision
               bystanderClaimWins game3.game.sim/bystander-claim-wins
               electHost game3.game.sim/elect-host
               freeColorOf game3.game.sim/free-color-of
               clockText game3.game.sim/clock-text
               mkHi game3.game.frames/mk-hi
               mkFu game3.game.frames/mk-fu
               mkRo game3.game.frames/mk-ro
               mkIn game3.game.frames/mk-in
               mkSt game3.game.frames/mk-st
               mkTk game3.game.frames/mk-tk
               mkOv game3.game.frames/mk-ov
               mkMa game3.game.frames/mk-ma
               mkLo game3.game.frames/mk-lo
               mkSn game3.game.frames/mk-sn
               isGameFrame game3.game.frames/is-game-frame
               newRoomSecret game3.net.room-crypto/new-room-secret
               createRoomCrypto game3.net.room-crypto/create-room-crypto
               toB64url game3.net.room-crypto/to-b64url
               fromB64url game3.net.room-crypto/from-b64url
               protocolOf game3.net.peers/protocol-for
               catalogKeys game3.testlib/catalog-keys
               catalogMsg game3.testlib/catalog-msg}}}}}}

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/game3.git