mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-31 23:31:39 +00:00
4606ba23d90d1a5f0d2c2b72d3bda80b1424d265
Add lazy loading of Telegram SDK only when running inside Telegram Mini App environment instead of unconditionally loading in all browsers. Includes: - New environment detection functions: isTelegramEnvironment(), isTelegramApp() - Dynamic SDK loading with 3s timeout via loadTelegramSdk() - Removed static script tag from index.html - Made haptic feedback lazy (SDK check on each call) - Made theme listeners lazy (attached in initializeTheme()) - Updated all components to use unified detection functions This prevents SDK load time overhead in regular browser environments while ensuring the app works correctly both in Telegram and browser contexts.
hapi
Monorepo with three Bun workspace packages:
cli/(hapi): CLI (npm package) exposinghapi/hapi-mcpserver/(hapi-server): backend API + Telegram bot server, servesweb/dist/web/(hapi-web): web frontend (Vite) building toweb/dist/
Commands
Run from the repo root:
bun install
bun run typecheck
bun run build
Languages
TypeScript
99.5%
CSS
0.2%
JavaScript
0.2%