Repository navigation
Commit f02fa04
committed
fix(web): a release works on Cloudflare Pages: the client's node_modules is served, the sign-in page keeps its headers
Three things a release did on Pages that it does not do on a plain file server (the previous
commit shows them):
- node_modules. The build stages static/node_modules a second time as static/node-modules, and
writes a _redirects with one rule, /_/:id/static/node_modules/* -> /_/:id/static/node-modules/:splat
(200, a rewrite), so Pages serves the client's files at the address it asks for, for this build
and for a previous one kept online. Other hosts serve node_modules and ignore _redirects. The
build refuses a node_modules folder anywhere else in a release. (+959 files, +35 MB: 1,840
files are uploaded, of Pages' 20,000.)
- /callback. Pages serves callback.html at /callback and matches _headers by the address asked
for: the sign-in page went without its default-src 'none' policy and no-store there. Every
page's rule is now also written without `.html` (index.html's is `/`, which has its own).
- levelcode-themes. A client built from a checkout that has LevelCode's extensions bakes it in;
the build still staged a second copy (without a package.nls.json), which the workbench skipped
with an error per translation lookup. It is staged only when the client does not have it.
Checked with the client the live release was built from: e2e.mjs --pages 32/32 (the terminal
opens; no script, JSON or WebAssembly answered with HTML), e2e-look.mjs --pages 26/26 (the web
themes are in use: the baked theme's default is outranked by following the system),
e2e-signin-tab.mjs --pages 20/20 (the sign-in page reached through Pages' .html redirect), e2e.mjs
without --pages 32/32. Unit gate 127 files on Node 24 and Node 18. Not run on Cloudflare itself.1 parent d4c6e5d commit f02fa04
4 files changed
Lines changed: 71 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
326 | 350 | | |
327 | 351 | | |
328 | 352 | | |
| |||
427 | 451 | | |
428 | 452 | | |
429 | 453 | | |
430 | | - | |
| 454 | + | |
431 | 455 | | |
432 | 456 | | |
433 | 457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
81 | 97 | | |
82 | 98 | | |
83 | 99 | | |
| |||
98 | 114 | | |
99 | 115 | | |
100 | 116 | | |
101 | | - | |
102 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
103 | 121 | | |
104 | 122 | | |
105 | 123 | | |
| |||
116 | 134 | | |
117 | 135 | | |
118 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
119 | 142 | | |
120 | 143 | | |
121 | 144 | | |
| |||
159 | 182 | | |
160 | 183 | | |
161 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
162 | 188 | | |
163 | 189 | | |
164 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
0 commit comments