Files
arkonandClaude Opus 4.6 f44f0a912f refactor: split app.js into focused frontend modules (phase 5)
Extract 8 modules from the 15K-line app.js monolith:
- constants.js: shared constants, timing, escapeHtml(), extractSyncSegments()
- mobile-handlers.js: MobileDetection, KeyboardHandler, SwipeHandler
- voice-input.js: DeepgramProvider, VoiceInput
- notification-manager.js: NotificationManager class
- keyboard-accessory.js: KeyboardAccessoryBar, FocusTrap
- api-client.js: _api(), _apiJson(), _apiPost(), _apiDelete() helpers
- subagent-windows.js: 13 subagent window methods (open, close, drag, lines)
- vendor/xterm-zerolag-input.js: IIFE build replacing inlined copy

app.js reduced from ~15,200 to ~11,500 lines. All modules use global
scope with <script defer> ordering. Prototype extensions use
Object.assign(CodemanApp.prototype, {...}) pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 04:57:37 +01:00

34 lines
950 B
TypeScript

import { defineConfig } from 'tsup';
export default defineConfig([
// Standard builds (CJS + ESM + DTS)
{
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
clean: true,
},
// IIFE build for browser <script> tag usage
{
entry: ['src/index.ts'],
format: ['iife'],
globalName: 'XtermZerolagInput',
outDir: 'dist',
// Append global aliases so app.js can access classes directly
footer: {
js: [
'// Global aliases for browser usage',
'if(typeof window!=="undefined"){',
' window.ZerolagInputAddon=XtermZerolagInput.ZerolagInputAddon;',
' window.LocalEchoOverlay=class extends XtermZerolagInput.ZerolagInputAddon{',
' constructor(terminal){',
' super({prompt:{type:"character",char:"\\u276f",offset:2}});',
' this.activate(terminal);',
' }',
' };',
'}',
].join('\n'),
},
},
]);