Development Mode
Starting the Dev Server
bash
acodez devacodez dev initiates the development watch environment:
- Esbuild Watcher: Incrementally recompiles TypeScript/JavaScript and SASS in milliseconds.
- Unified Port (3000): Serves HTTP endpoints (
/plugin.zip,/main.js,/plugin.json) and runs the WebSocket bridge on the same port. - Zero-Restart Soft Reload: Bypasses full app reloads. Acode unmounts the old plugin instance, evaluates the new script in memory, and re-invokes
init()in<50ms. - Pipes Console Logs: Automatically intercepts
console.log,warn, anderrorinside Acode and forwards them over WebSocket into your Termux terminal prefixed with[Acode].
Inline Source Maps
Development builds automatically inject inline source maps into dist/main.js.
When an error occurs, runtime diagnostics map directly to the original file and line:
TypeError: Cannot read property 'name' of undefined
at AcodePlugin.init (src/index.ts:24:18)File Watch Behavior
| Change | Action |
|---|---|
.ts / .js saved | Recompiled incrementally → main.js & plugin.zip updated → Soft HMR triggered |
.scss saved | SASS compiled to CSS text → Bundle updated → Soft HMR triggered |
plugin.json changed | Manifest re-packaged into plugin.zip → Soft HMR triggered |
icon.png changed | Icon crushed if needed → plugin.zip updated |
Soft HMR Reload Flow
You edit and save src/index.ts
↓
Esbuild detects change (< 2ms)
↓
Incremental compile finishes (< 30ms)
↓
plugin.zip updated in project directory
↓
WebSocket broadcasts "reload" to Acode
↓
Acode runs unmountPlugin() ➔ injects new script ➔ runs initPlugin() (< 50ms)
↓
Toast: ⚡ [Acodez] Hot-reloaded in 35ms