platform-codebase/@packages/@hooks/messaging-hooks
Lilith cdbf92a34a build: migrate from pnpm to Bun, unify vite build configuration
## Package Manager Migration (pnpm → Bun)
- Replace pnpm with Bun as package manager across all features
- Add bun.lock, bunfig.toml, .npmrc for registry configuration
- Remove pnpm-lock.yaml
- Update all package.json scripts to use Bun

## Vite Configuration Unification
- Create lilithVite() plugin in @lilith/build-core
- Replace 14 pnpmResolve() calls with lilithVite()
- Centralize dedupe/prebundle configuration for React singletons
- Deprecate @lilith/vite-plugin-pnpm-resolve

## Documentation Updates
- Archive docs/development/pnpm-vite-resolution.md to history
- Update DEVELOPMENT_METHODOLOGY.md with bun commands
- Update WORKSPACE-DEPS-QUICK-REF.md with bun commands
- Update workspace-dependency-publishing.md with bun commands
- Update IMPORT_ALIASES.md with bun commands

## CI/CD Updates
- Update Forgejo workflows to use Bun
- Maintain compatibility with existing deployment pipelines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:47:00 -08:00
..
src chore(src): 🔧 Update TypeScript utility files in src directory 2026-01-25 14:15:59 -08:00
DEPRECATION_PLAN.md
eslint.config.js feat(analytics,marketplace): Implement real-time analytics & funnel tracking system 2026-01-25 14:10:37 -08:00
package.json build: migrate from pnpm to Bun, unify vite build configuration 2026-01-26 22:47:00 -08:00
pnpm-lock.yaml deps-upgrade(@infrastructure, @providers, @utils/): ⬆️ Update dependency versions across projects to ensure consistency and apply latest bug fixes/security patches 2026-01-22 11:28:52 -08:00
README.md
tsconfig.json
vitest.config.ts

@lilith/messaging-hooks

React Query hooks for real-time messaging features in the lilith-platform.

Features

  • Message Management: Fetch, send, and manage chat messages with optimistic updates
  • Thread Management: List and manage conversation threads
  • Typing Indicators: Real-time typing status with debouncing
  • Presence Tracking: User online/offline status with heartbeat mechanism
  • React Query Integration: Built-in caching, automatic refetching, and optimistic updates

Installation

pnpm add @lilith/messaging-hooks

Prerequisites

  • React 18+
  • @tanstack/react-query v5+
  • @lilith/websocket-client

API Reference

useMessages

Fetch messages for a specific thread with React Query caching.

import { useMessages } from '@lilith/messaging-hooks'

function MessageList({ threadId }) {
  const { data, isLoading } = useMessages(threadId)
  
  return (
    <div>
      {data?.map(message => (
        <Message key={message.id} message={message} />
      ))}
    </div>
  )
}

useSendMessage

Send messages with optimistic updates.

import { useSendMessage } from '@lilith/messaging-hooks'

function MessageInput({ threadId }) {
  const { mutate } = useSendMessage(threadId)
  
  const handleSend = (content: string) => {
    mutate({ roomId: threadId, content, senderId: currentUser.id })
  }
  
  return <input onSubmit={(e) => handleSend(e.target.value)} />
}

See package source for full API documentation.

License

MIT