@mereb/app-messaging
v1.0.3
Published
Messaging experience primitives for Mereb applications
Readme
@mereb/app-messaging
Messaging experience primitives for Mereb applications.
This package exposes a small set of surfaces for shared messaging logic, GraphQL documents, in-memory test helpers, and React Native UI screens.
Package Surfaces
@mereb/app-messaging- root export with the headless API and GraphQL aliases@mereb/app-messaging/headless- GraphQL documents, pure helpers, and shared messaging types@mereb/app-messaging/store- in-memory messaging store for local development and tests@mereb/app-messaging/native- React Native messaging screens and native-only types@mereb/app-messaging/gql- uppercase GraphQL document aliases
Installation
pnpm add @mereb/app-messagingThe native screens expect these peer dependencies to be present in the consuming app:
reactreact-nativereact-native-safe-area-contextexpo-router@apollo/clientgraphql
Usage
Headless helpers
import {
ConversationsDocument,
deriveConversationTitle,
formatMessagingTimestamp,
summarizeMessagingBody
} from '@mereb/app-messaging/headless'GraphQL aliases
import {CONVERSATIONS, SEND_MESSAGE} from '@mereb/app-messaging/gql'In-memory store
import {createInMemoryMessagingStore} from '@mereb/app-messaging/store'
const store = createInMemoryMessagingStore()React Native screens
import {MessagesScreen} from '@mereb/app-messaging/native'Scripts
Run these from packages/app-messaging/:
pnpm run typecheck- TypeScript checkpnpm run test- Vitest unit testspnpm run coverage- Vitest coverage checkpnpm run build- clean and emit the published packagepnpm run smoke:dist- verify built package importspnpm run version:bump- bump package version using the script defaultpnpm run version:bump:major- bump major versionpnpm run version:bump:minor- bump minor versionpnpm run version:bump:patch- bump patch version
To change the version bump used by the pre-commit hook, set VERSION_BUMP before committing, for example VERSION_BUMP=major git commit.
Project Layout
src/headless.ts- GraphQL documents and pure helperssrc/store.ts- in-memory storesrc/native/- React Native UI and native helperssrc/gql.ts- uppercase GraphQL aliasessrc/index.tsx- root package exportdocs/testing-plan.md- test coverage plandocs/testing-implementation-dag.md- phased implementation DAG
Testing
The package uses Vitest with Node as the default environment. Coverage is configured in vitest.config.ts and is enforced through pnpm run coverage.
Build Output
The published package is emitted to dist/ and should be treated as generated code. Package export paths are validated by the smoke:dist script after build.
