managarten/packages/shared-utils/src
Till JS e4e3360ca8 fix(csp): move jsdelivr allowlist to mana-web hooks (Vite SSR cache workaround)
The previous two attempts at allowlisting cdn.jsdelivr.net for
transformers.js's onnxruntime-web loader landed in shared-utils
security-headers.ts. The actual file change was correct (verified by
grep), the commits got pushed, the live security-headers.ts on disk
had the additions — but Vite's SSR module cache for cross-workspace-
package imports kept serving the OLD compiled shared-utils to
hooks.server.ts. Net effect: edits to hooks.server.ts hot-reloaded
fine (proven by the *.hf.co connect-src additions showing up
immediately) while edits to shared-utils/security-headers.ts did not.
A dev server restart should clear it but I'd rather not depend on
manual intervention every time we touch the shared CSP.

Move the jsdelivr allowlist out of the shared default and into
mana-web's hooks.server.ts via the existing scriptSrc + connectSrc
options. hooks.server.ts is in the SvelteKit app's own source tree so
it HMRs reliably, no SSR cache to fight. As a bonus this is also
architecturally cleaner: cdn.jsdelivr.net is only needed by mana-web
because mana-web is the only Mana app that bundles @mana/local-llm —
other apps get a slightly tighter CSP for free.

The pattern to remember: changes to packages/shared-utils that affect
SSR (response headers, server hooks) require either a dev server
restart OR a manual `rm -rf apps/.../node_modules/.vite` to take
effect. Client-side changes hot-reload fine.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 23:03:38 +02:00
..
parsers feat(parsers): add intelligent quick-create parsers for 6 apps with multilingual support 2026-03-24 22:18:05 +01:00
analytics-server.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
analytics.ts feat(mana/web): global requireAuth() gate for guest-blocked features 2026-04-08 15:36:38 +02:00
async.ts ♻️ refactor: remove duplicated code (Quick Wins) 2026-01-29 16:19:18 +01:00
cache.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
date.ts fix lint 2025-12-04 00:32:13 +01:00
format.ts fix lint 2025-12-04 00:32:13 +01:00
index.ts chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
keyboard.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
security-headers.ts fix(csp): move jsdelivr allowlist to mana-web hooks (Vite SSR cache workaround) 2026-04-08 23:03:38 +02:00
string.ts fix lint 2025-12-04 00:32:13 +01:00
validation.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
web-vitals.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00