game2 / 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
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
;; shadow-cljs builds for the valley-blocks client.
;;
;; :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://game2.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).
;;
;; Dev ports are 4173/5173 ONLY (the relay's origin allowlist). Known wart
;; inherited from the game1 canon: 4173 points at dist, but `watch app` writes
;; its DEV build into dist/assets — while a watcher runs, 4173 serves a dev
;; build, not the release. Smoke a release with a standalone static server.
{: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 game2.main/init}
    :social {:entries [game2.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 [game2.testlib]
     :exports {;; ---- core ----
               mulberry32 game2.game.core.rng/mulberry32
               boardConsts game2.testlib/board-consts
               pieceTypes game2.testlib/piece-types
               cellsFor game2.game.core.pieces/cells-for
               kicksFor game2.game.core.pieces/kicks-for
               makeBag game2.testlib/make-bag
               bagNext game2.testlib/bag-next
               bagPeek game2.testlib/bag-peek
               makeBoard game2.testlib/make-board
               collides game2.game.core.board/collides?
               boardLock game2.game.core.board/lock!
               clearLines game2.game.core.board/clear-lines!
               isToppedOut game2.game.core.board/topped-out?
               pointsForLines game2.game.core.scoring/points-for-lines
               gravitySeconds game2.game.core.scoring/gravity-seconds
               levelForLines game2.game.core.scoring/level-for-lines
               snakeInterval game2.game.core.scoring/snake-interval
               snakeDuration game2.game.core.scoring/snake-duration
               ;; ---- engine ----
               makeGame game2.testlib/make-game
               gameUpdate game2.game.core.game/update!
               gameMove game2.game.core.game/move!
               gameRotate game2.game.core.game/rotate!
               gameHardDrop game2.game.core.game/hard-drop!
               gameHoldPiece game2.game.core.game/hold-piece!
               gameSetSoftDrop game2.game.core.game/set-soft-drop!
               gameSoftStep game2.game.core.game/soft-step!
               ghostY game2.testlib/ghost-y
               nextQueue game2.testlib/next-queue
               ;; ---- wire ----
               mkHi game2.game.frames/mk-hi
               mkLv game2.game.frames/mk-lv
               mkLo game2.game.frames/mk-lo
               mkRo game2.game.frames/mk-ro
               mkSt game2.game.frames/mk-st
               mkBs game2.game.frames/mk-bs
               mkOv game2.game.frames/mk-ov
               mkSn game2.game.frames/mk-sn
               isGameFrame game2.game.frames/is-game-frame
               boardStateOf game2.game.frames/board-state-of
               serializeGrid game2.game.frames/serialize-grid
               ;; ---- party / referee ----
               makeParty game2.game.party/make-party
               partyInit game2.game.party/init!
               partyHandleMsg game2.game.party/handle-msg!
               partyJoin game2.game.party/join!
               partyLeave game2.game.party/leave!
               partySetSettings game2.game.party/set-settings!
               partyStartRound game2.game.party/start-round!
               partyEndToLobby game2.game.party/end-to-lobby!
               partyOnRoomRoster game2.game.party/on-room-roster!
               partyOnPeerOpen game2.game.party/on-peer-open!
               partyOnPeerGone game2.game.party/on-peer-gone
               partyOnPeerState game2.game.party/on-peer-state!
               partyOnRelayError game2.game.party/on-relay-error!
               partySyncFrom game2.game.party/sync-from!
               partyForceSync game2.game.party/force-sync!
               partyAmHost game2.game.party/am-host?
               partyMySeat game2.game.party/my-seat
               partySpectating game2.game.party/spectating?
               partyMyWins game2.game.party/my-wins
               partyPlayers game2.game.party/players
               modeLabel game2.game.party/MODE-LABEL
               ;; ---- themes / storage ----
               paletteForLevel game2.game.render.themes/palette-for-level
               shade game2.game.render.themes/shade
               defaultSettings game2.game.storage.store/default-settings
               loadSettings game2.game.storage.store/load-settings
               saveSettings game2.game.storage.store/save-settings!
               persistSettings game2.game.storage.store/persist-settings!
               loadHighScore game2.game.storage.store/load-high-score
               saveHighScore game2.game.storage.store/save-high-score!
               resolveDark game2.game.storage.store/resolve-dark
               makeRecord game2.game.storage.history/make-record
               loadHistory game2.game.storage.history/load-history
               addRecord game2.game.storage.history/add-record!
               historyStats game2.game.storage.history/history-stats
               ;; ---- net ----
               newRoomSecret game2.net.room-crypto/new-room-secret
               createRoomCrypto game2.net.room-crypto/create-room-crypto
               toB64 game2.net.room-crypto/to-b64
               toB64url game2.net.room-crypto/to-b64url
               fromB64url game2.net.room-crypto/from-b64url
               protocolOf game2.net.peers/protocol-for
               ;; ---- i18n ----
               catalogKeys game2.testlib/catalog-keys
               catalogMsg game2.testlib/catalog-msg
               catalogEntries game2.testlib/catalog-entries}}}}}}

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