webui/bridge
2024-06-09 01:29:30 +00:00
..
.gitignore WebUI Bridge 2023-08-18 15:50:31 -04:00
build.bat Bridge build windows batch script 2023-08-22 21:43:39 -04:00
build.ps1 Update the date to 2024 2024-05-26 19:52:59 -04:00
build.sh Update the date to 2024 2024-05-26 19:52:59 -04:00
js2c.py Update the date to 2024 2024-05-26 19:52:59 -04:00
README.md C99 to C 2023-10-28 19:51:02 -04:00
utils.ts Update the date to 2024 2024-05-26 19:52:59 -04:00
webui_bridge.h Adding isConnected to the JavaScript bridge 2024-06-07 18:31:55 -04:00
webui_bridge.ts fix index for command data 2024-06-09 01:29:30 +00:00

WebUI Bridge

The WebUI Bridge connects the UI (Web Browser) with the backend application through WebSocket. This bridge is written in TypeScript, and it needs to be transpiled to JavaScript using ESBuild to produce webui_bridge.js, then converted to C header using the Python script js2c.py to generate webui_bridge.h.

Windows

  • Install Python
  • Install Node.js
  • cd webui\bridge
  • npm install esbuild
  • .\node_modules\.bin\esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=.\ .\webui_bridge.ts
  • python js2c.py

Windows PowerShell

  • cd webui\bridge
  • ./build.ps1
  • If you get running scripts is disabled on this system error. Then run Set-ExecutionPolicy RemoteSigned to enable script execution. After done, you can roll back by running Set-ExecutionPolicy Restricted

Linux

  • Install Python
  • Install Node.js
  • cd webui/bridge
  • npm install esbuild
  • ./node_modules/.bin/esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=./ ./webui_bridge.ts
  • python js2c.py

Linux Bash

  • cd webui\bridge
  • sh ./build.sh

macOS

  • Install Python
  • Install Node.js
  • cd webui/bridge
  • npm install esbuild
  • ./node_modules/.bin/esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=./ ./webui_bridge.ts
  • python js2c.py

macOS Bash

  • cd webui\bridge
  • sh ./build.sh