feat: migrate from clientside javascript to elysiajs eden
LA
6h ago+1767+1767+0123456789012345678901234567890123456789-475-475-012345678901234567890123456789
I'm playing around a bit with agentic coding using local LLMs. I thought I'd tackle this feature that way. This PR still needs a lot of thorough testing.
Summary
Migrates the inline/client-side JavaScript to typed TypeScript client scripts that talk to the server via Elysia Eden.
Client scripts
- Replaced
public/script.jsandpublic/results.jswithpublic/script.ts,public/results.ts, and a newpublic/history.ts. - Removed the inline JS from
src/pages/history.tsx(~100 lines), moving it intohistory.ts. - Added
src/eden.ts(typed Eden client, centralized server URL). - Added helpers:
findPresetTarget,historySelection, andnormalizeFiletypetweaks. The ffmpeg converter andconverters/main.tshave small related changes. These also support the wav-3cx preset and URL-param format pre-selection.
Build & tooling
- Client bundles are built before dev/hot, and in the Dockerfile.
- Updated
package.json,bun.lock,bunfig.toml,tsconfig*.json, andeslint.config.ts. - Generated bundles (e.g.
history.js) are git-ignored.
Review fixes
- Iterate NodeList via
Array.fromso the tsc build passes. - Tightened Eden typings and addressed type-safety/XSS review concerns.
- Pages now reference the built bundles instead of inline scripts.
Tests
- New DOM tests for script, history, and results (
tests/client/*), plus Eden app, helper, and build-script tests. - Updated page tests to assert no inline
<script>tags (matched case-insensitively). - Console output is silenced and client-script coverage is raised.