feat(widget): SP6 PR S6-1+2 - repo scaffolding + Preact bundle #1

Merged
serge merged 1 commits from feat/sp6-s6-1-2-scaffolding-bundle into main 2026-04-26 01:11:07 +03:00
Owner

What

SP6 PR S6-1 + S6-2 combined — full repo scaffolding for messenzy-widget, the embeddable Preact chat widget.

Files

File Role
package.json Preact 10 + Vite 6 + TypeScript 5, 0 vulnerabilities
vite.config.ts IIFE + ESM lib outputs, preact/compat alias, CSS inlined
tsconfig.json / tsconfig.node.json Strict TS (src/ and vite config separated)
src/index.ts Entry: injects <style>, mounts <Widget /> on DOMContentLoaded
src/config.ts Parses data-bot-id, data-api-key, data-server-url, data-position
src/vite-env.d.ts ?inline CSS type declaration
src/storage/visitor.ts localStorage UUID v4 with in-memory fallback
src/transport/ws-client.ts WS primary, exponential reconnect (max 5), HTTP polling fallback
src/ui/widget.tsx Root component — transport lifecycle, state, send handler
src/ui/bubble.tsx Floating FAB, chat/close SVG, bottom-right or bottom-left
src/ui/panel.tsx Header + scrollable messages + typing indicator + input bar
src/ui/message.tsx Message bubble (user right, bot left), timestamp
src/ui/theme.css CSS variables (--messenzy-primary, --messenzy-accent overridable)
.gitignore node_modules/, dist/, .vite/, .env*
README.md Integration snippet, attribute table, theme docs, build instructions

Build status

dist/messenzy-widget.iife.js  25.33 kB | gzip: 9.68 kB
dist/messenzy-widget.js       33.16 kB | gzip: 10.74 kB
  • CSS inlined in IIFE (no separate .css emitted — single <script> integration)
  • npm run typecheck — clean (strict + exactOptionalPropertyTypes)
  • npm run build — 0 errors, 0 vulnerabilities
## What SP6 PR S6-1 + S6-2 combined — full repo scaffolding for `messenzy-widget`, the embeddable Preact chat widget. ## Files | File | Role | |---|---| | `package.json` | Preact 10 + Vite 6 + TypeScript 5, 0 vulnerabilities | | `vite.config.ts` | IIFE + ESM lib outputs, `preact/compat` alias, CSS inlined | | `tsconfig.json` / `tsconfig.node.json` | Strict TS (src/ and vite config separated) | | `src/index.ts` | Entry: injects `<style>`, mounts `<Widget />` on DOMContentLoaded | | `src/config.ts` | Parses `data-bot-id`, `data-api-key`, `data-server-url`, `data-position` | | `src/vite-env.d.ts` | `?inline` CSS type declaration | | `src/storage/visitor.ts` | localStorage UUID v4 with in-memory fallback | | `src/transport/ws-client.ts` | WS primary, exponential reconnect (max 5), HTTP polling fallback | | `src/ui/widget.tsx` | Root component — transport lifecycle, state, send handler | | `src/ui/bubble.tsx` | Floating FAB, chat/close SVG, bottom-right or bottom-left | | `src/ui/panel.tsx` | Header + scrollable messages + typing indicator + input bar | | `src/ui/message.tsx` | Message bubble (user right, bot left), timestamp | | `src/ui/theme.css` | CSS variables (`--messenzy-primary`, `--messenzy-accent` overridable) | | `.gitignore` | `node_modules/`, `dist/`, `.vite/`, `.env*` | | `README.md` | Integration snippet, attribute table, theme docs, build instructions | ## Build status ``` dist/messenzy-widget.iife.js 25.33 kB | gzip: 9.68 kB dist/messenzy-widget.js 33.16 kB | gzip: 10.74 kB ``` - CSS inlined in IIFE (no separate `.css` emitted — single `<script>` integration) - `npm run typecheck` — clean (strict + exactOptionalPropertyTypes) - `npm run build` — 0 errors, 0 vulnerabilities
serge added 1 commit 2026-04-26 01:10:45 +03:00
- package.json with Preact 10 + Vite 6 + TypeScript 5
- vite.config: IIFE + ESM lib outputs, preact/compat alias, CSS inlined via
  ?inline import (no separate .css file emitted - single-file IIFE)
- tsconfig.json (src/) + tsconfig.node.json (vite.config.ts)
- src/index.ts: entry, injects <style>, mounts <Widget /> on script load
- src/config.ts: parses data-bot-id + data-api-key + data-server-url
- src/vite-env.d.ts: ?inline CSS type declaration
- src/storage/visitor.ts: localStorage UUID v4 with in-memory fallback
- src/transport/ws-client.ts: WebSocket primary, exponential reconnect
  (max 5 retries ~30s cap), HTTP polling fallback at /webchat/history every 5s
- src/ui/widget.tsx: root Preact component, transport lifecycle, send handler
- src/ui/bubble.tsx: floating FAB with chat/close SVG icons, position aware
- src/ui/panel.tsx: header + scrollable message list + typing indicator + input
- src/ui/message.tsx: single message bubble (user right/bot left), timestamp
- src/ui/theme.css: CSS variables (--messenzy-primary/accent overridable)
- Build output: dist/messenzy-widget.iife.js 25.3 kB (9.7 kB gz), zero errors
- typecheck: clean (strict + exactOptionalPropertyTypes)
- .gitignore: node_modules/ dist/ .vite/ .env* .DS_Store
- README: integration snippet, script attributes table, theme, build instructions
serge merged commit c7edf8c66c into main 2026-04-26 01:11:07 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: serge/messenzy-widget#1
No description provided.