rooms-kit / 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
;; shadow-cljs build for the committed dist/ — deterministic ESM, node-flavored.
;;
;; :optimizations :simple, per dev/docs/CLJS.md for Node artifacts: it removes
;; the externs-inference risk class entirely, which matters a great deal here
;; because almost every line is interop with untyped ESM packages (@orbitdb/core
;; ships no types at all) and the native @ipshipyard/node-datachannel behind
;; @libp2p/webrtc must never be renamed OR bundled.
;;
;; THE TWO-STACK LAW (the suite's house rule 11): rooms-kit is the libp2p v2 /
;; @ipshipyard/node-datachannel 0.26 side; peer-kit is libp2p v3 /
;; node-datachannel 0.33. The two load different builds of libdatachannel, and
;; two copies of that native library in ONE process abort it (ThreadSafeCallback
;; cancellation) — which is why the bot forks a worker process per room. Every
;; npm dep therefore stays an EXTERNAL import (:js-options {:js-provider
;; :import}) so the natives are resolved by the consumer's node_modules and never
;; inlined, and deploy/check-dist.sh greps the emitted bundles for peer-kit,
;; unscoped node-datachannel and libp2p-v3 specifiers and aborts on a hit.
;;
;; DETERMINISM — :parallel-build false is load-bearing, not a tuning knob.
;; The CLJS compiler numbers gensym'd names from a JVM-GLOBAL counter; shadow
;; compiles namespaces in parallel by default, so the interleaving — and
;; therefore the numbers — differ between cold builds, and Closure's variable
;; coalescing then makes different merging decisions. That is a STRUCTURAL
;; difference the gensym normalizer cannot repair (peer-kit proved it). Serial
;; compilation consumes the counter in a fixed order and cold builds come out
;; byte-identical. scripts/normalize-gensyms.mjs is still run for the protocol
;; `$dyn` vars; it is necessary but not sufficient on its own.
;;
;; Four modules over a :shared base, one per published subpath plus the
;; historical deep names:
;;   :index     -> dist/index.js      the "." export
;;   :chat      -> dist/chat.js       the "./chat" export
;;   :board     -> dist/board.js      the "./board" export
;;   :internals -> dist/internals.js  the names v1.0.0's file tree exposed
;; :index DEPENDS ON :chat and :board rather than the other way round, because it
;; re-exports their classes: with the dependency reversed shadow hoists
;; ardegazu.rooms.chat into :index and the :chat module loses its only entry
;; ("Module Entry … was moved out of module"). The lib/* namespaces that chat and
;; board share hoist into :shared on their own.
;; scripts/gen-subpaths.mjs then writes v1.0.0's dist/ tree (dist/chat/index.js,
;; dist/board/index.js, dist/lib/**, dist/node/env.js) as thin re-export shims
;; over those four, so every path the TypeScript build published still resolves.
{:deps {:aliases [:dev]}
 :builds
 {:lib
  {:target :esm
   :output-dir "dist"
   :compiler-options {:optimizations :simple
                      :source-map false
                      :parallel-build false}
   :js-options {:js-provider :import}
   :modules
   {:shared {:entries []}

    :index
    {:entries [ardegazu.rooms.index]
     :depends-on #{:shared :chat :board}
     :exports {ChatClient ardegazu.rooms.index/ChatClient
               newRoomSecret ardegazu.rooms.index/new-room-secret
               CHAT_SALT ardegazu.rooms.index/CHAT-SALT
               BoardClient ardegazu.rooms.index/BoardClient
               BOARD_SALT ardegazu.rooms.index/BOARD-SALT
               installOrigin ardegazu.rooms.index/install-origin
               installBrowserGlobals ardegazu.rooms.index/install-browser-globals
               Identity ardegazu.rooms.index/Identity}}

    :chat
    {:entries [ardegazu.rooms.chat]
     :depends-on #{:shared}
     :exports {ChatClient ardegazu.rooms.chat/ChatClient
               newRoomSecret ardegazu.rooms.chat/new-room-secret
               CHAT_SALT ardegazu.rooms.chat/CHAT-SALT}}

    :board
    {:entries [ardegazu.rooms.board]
     :depends-on #{:shared}
     :exports {BoardClient ardegazu.rooms.board/BoardClient
               BOARD_SALT ardegazu.rooms.board/BOARD-SALT
               newRoomSecret ardegazu.rooms.board/new-room-secret}}

    :internals
    {:entries [ardegazu.rooms.internals]
     :depends-on #{:shared :index}
     :exports {randomBytes ardegazu.rooms.internals/random-bytes
               toB64 ardegazu.rooms.internals/to-b64
               fromB64 ardegazu.rooms.internals/from-b64
               toB64url ardegazu.rooms.internals/to-b64url
               fromB64url ardegazu.rooms.internals/from-b64url
               newPeerId ardegazu.rooms.internals/new-peer-id
               Sealer ardegazu.rooms.internals/Sealer
               AtRestCipher ardegazu.rooms.internals/AtRestCipher
               RoomCrypto ardegazu.rooms.internals/RoomCrypto
               makeLogEncryption ardegazu.rooms.internals/make-log-encryption
               resolveRelayConfig ardegazu.rooms.internals/resolve-relay-config
               IceConfig ardegazu.rooms.internals/IceConfig
               HardenedIPFSAccessController ardegazu.rooms.internals/HardenedIPFSAccessController
               signerMatchesIdentity ardegazu.rooms.internals/signer-matches-identity
               SuetaIdentityProvider ardegazu.rooms.internals/SuetaIdentityProvider
               registerSuetaProvider ardegazu.rooms.internals/register-sueta-provider
               openHelia ardegazu.rooms.internals/open-helia
               RoomLog ardegazu.rooms.internals/RoomLog
               newSessionKey ardegazu.rooms.internals/new-session-key
               Net ardegazu.rooms.internals/Net
               selfPeerIds ardegazu.rooms.internals/self-peer-ids
               installOriginWebSocket ardegazu.rooms.internals/install-origin-web-socket
               installOriginFetch ardegazu.rooms.internals/install-origin-fetch}}}}}}

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/rooms-kit.git