Skip to content

Development Mode ​

Starting the Dev Server ​

bash
acodez dev

acodez dev initiates the development watch environment:

  1. Esbuild Watcher: Incrementally recompiles TypeScript/JavaScript and SASS in milliseconds.
  2. Unified Port (3000): Serves HTTP endpoints (/plugin.zip, /main.js, /plugin.json) and runs the WebSocket bridge on the same port.
  3. 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.
  4. Pipes Console Logs: Automatically intercepts console.log, warn, and error inside 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 ​

ChangeAction
.ts / .js savedRecompiled incrementally → main.js & plugin.zip updated → Soft HMR triggered
.scss savedSASS compiled to CSS text → Bundle updated → Soft HMR triggered
plugin.json changedManifest re-packaged into plugin.zip → Soft HMR triggered
icon.png changedIcon 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

Built with precision by Rugved.