Replace textarea with CodeMirror 6 editor

- Add CodeMirror 6 with oneDark theme and markdown language support
- Bundle via esbuild into public/vendor/ (built on deploy, not committed)
- Add codemirror-entry.mjs as bundle entry point
- Fix SPA fallback to only serve index.html for /, not all paths
- Fix mime type handling by mutating mime-types registry
- Add Write/Preview tabs; preview renders on tab switch only
- Multi-cursor via Shift+Alt+Up/Down; Alt+Click adds cursor
- gitignore package-lock.json and public/vendor/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 15:08:36 +00:00
parent dbef6605c9
commit 6058c22b6c
8 changed files with 100 additions and 897 deletions

View File

@@ -142,9 +142,8 @@ app.delete('/api/entries/:id', (req, res) => {
ok(res);
});
// SPA fallback
const INDEX_HTML = new URL('./public/index.html', import.meta.url).pathname;
app.get('/{*path}', (req, res) => res.sendFile(INDEX_HTML));
app.get('/', (req, res) => res.sendFile(INDEX_HTML));
app.use((err, req, res, next) => {
console.error(`[express error] ${req.method} ${req.path}`, err);