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 | ;; shadow-cljs builds for the hub. TWO builds, not two modules of one — see
;; the long note below, it is a rule-4 matter.
;;
;; :app — the hub shell (index.html). Five modules that reproduce the Vite/
;; rollup chunk graph exactly:
;;
;; :main cljs.core + the id-kit namespaces home.record needs + the
;; catalog/glyphs/router/qr/i18n/update code
;; :share home.social-share + home.net-share, and with them the social-kit
;; namespaces more than one leaf module reaches — SUITE-APPS, the
;; mailbox client, sha256/verify-raw. The bots view loads
;; unconditionally, so this is what first pays for them.
;; :bots the residents view
;; :social friends/presence/invites — the ONLY module that requires
;; ardegazu.social.net, so libp2p stays out of everything else
;; :lb the leaderboards (receipts + lbgossip land here, nowhere else)
;;
;; The arrows are :main <- :share <- {:bots :social :lb}. Both kits are
;; ClojureScript SOURCE on this build's classpath (client/deps.edn), so shadow
;; places each of their namespaces in the lowest common ancestor of the modules
;; that use it and DCE drops the ones the hub never calls — the split above is
;; the compiler's, not npm's. Point :lb at :main and the shared social-kit
;; namespaces hoist into the initial chunk, which trips the build gate.
;;
;; :bridge — /id/, the identity bridge every app in the suite embeds. A
;; SEPARATE build, deliberately, and this is the load-bearing part:
;;
;; rule 4 says the bridge is never served stale. Its own files are excluded
;; from the service worker three ways (globIgnores "id/**", a NetworkOnly
;; runtime route on /\/id(\/|$)/, navigateFallbackDenylist). But a MODULE of
;; the :app build would put the bridge's shared base at dist/assets/<name>.js
;; — outside every one of those three exclusions, and therefore precached.
;; Vite got away with the same shape only because it content-hashes asset
;; names, so a stale precache simply has no entry for the new URL and the
;; request falls through to the network. CLJS cannot hash (:module-hash-names
;; is forbidden by the determinism rule), so the URL is STABLE: with
;; skipWaiting false, a waiting worker would keep serving the OLD
;; dist/assets base to a bridge page whose own code came fresh off the
;; network. Version skew between the bridge and its runtime is exactly the
;; failure rule 4 exists to prevent. Two builds put every byte the bridge
;; loads under dist/id/, where all three exclusions cover it.
;;
;; :asset-path is RELATIVE in both builds — one build must serve at
;; https://ardegazu.ro/ and /ipfs/<cid>/ alike — and the bridge sits one path
;; level deeper, which its own output-dir handles ("./assets" resolves against
;; /id/, not against /).
;;
;; :testlib — the pure logic compiled to node-consumable ESM for the black-box
;; tests in test/*.test.mjs (the 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 a service worker), 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
;; and stages theme.css / version.json / catalog.json there; `ardz dev`
;; stages the bridge under dist-dev/id/. 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, "/"
;; and "/id/" serve their 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 home.main/init}
:share {:entries [home.social-share home.net-share]
:depends-on #{:main}}
:bots {:entries [home.bots]
:depends-on #{:share}}
:social {:entries [home.social]
:depends-on #{:share}}
:lb {:entries [home.lb-ui]
:depends-on #{:share}}}}
:bridge
{:target :browser
:output-dir "dist/id/assets"
:asset-path "./assets"
:compiler-options {:optimizations :advanced
:infer-externs :auto
:source-map false}
:modules {:bridge {:init-fn home.bridge/init}}}
:testlib
{:target :esm
:output-dir "test-dist"
:compiler-options {:optimizations :simple
:source-map false}
:js-options {:js-provider :import}
:modules
{:testlib
{:entries [home.testlib]
:exports {loadCatalog home.catalog/load-catalog
validate home.catalog/validate
catText home.catalog/cat-text
renderCatalog home.catalog/render-catalog
glyphFor home.glyphs/glyph-for
catalogGlyph home.glyphs/catalog-glyph
glyphKeys home.testlib/glyph-keys
glyphMap home.testlib/glyph-map
initRouter home.router/init-router
go home.router/go
qrMatrix home.testlib/qr-matrix-rows
qrSvg home.qr/qr-svg
newRecord home.record/new-record
recordFields home.testlib/record-fields
curRecord home.record/cur-rec
writeRecord home.record/write-record!
wroteRecord home.record/wrote?
appsSyncHooks home.apps-sync/hooks
appsSnapshot home.apps-sync/snapshot
profileTs home.profile/profile-ts
setProfileTs home.profile/set-profile-ts!
bumpProfileTs home.profile/bump-profile-ts!
clearProfileTs home.profile/clear-profile-ts!
storedProfileTs home.profile/stored-profile-ts
writeProfile home.profile/write-profile!
writeName home.profile/write-name!
profileSyncHooks home.profile-sync/hooks
presenceLabel home.social-share/presence-label
provideSocial home.social-share/provide-social!
providePubsub home.net-share/provide-pubsub!
bootBots home.bots/boot-bots
bootLb home.lb-ui/boot-lb
setFetchWeekly home.testlib/set-fetch-weekly!
setLang home.i18n/set-lang
t home.testlib/t1
tn home.testlib/tn1
catalogKeys home.testlib/catalog-keys
catalogMsg home.testlib/catalog-msg
catalogJson home.testlib/catalog-json
config home.testlib/config-js
versionOf home.update/version
liveVersionOf home.update/fetch-live-version}}}}}}
|