npm package: @qrush/types
Description: Shared TypeScript types for the QRush ecosystem
Latest version: 2.1.111

# @qrush/types

Shared TypeScript types for the QRush ecosystem. This package provides type definitions for common data structures used across QRush applications.

## Installation

```bash
bun add @qrush/types
```

## Usage

### Full Import

```typescript
import { User, Event, Promotion, Location } from '@qrush/types';
```

### Selective Imports

```typescript
// Import specific modules
import { User, UserRole } from '@qrush/types/Users';
import { Event, EventStatus } from '@qrush/types/Events';
import { Promotion, PromotionType } from '@qrush/types/Promotion';
import { Location, LocationType } from '@qrush/types/Location';
import { Genre } from '@qrush/types/Genres';
import { Meta } from '@qrush/types/Meta';
import { CommonFields } from '@qrush/types/Common';
import { CustomDocType } from '@qrush/types/CustomDocType';
import { Timestamp, GeoPoint, formatTimestamp } from '@qrush/types/firebase';
import { IFireWebappUser, FireWebappUserSnapshotRef } from '@qrush/types/WebappUsers';
import { IFireChats, IFireMessages, FireChatsSnapshotRef } from '@qrush/types/Chat';
import { IFireMatchingRound, IFireAttendee, FireMatchingRoundSnapshotRef } from '@qrush/types/Matching';
```

## Available Types

- **Users** - User profiles, roles, and authentication types
- **Events** - Event data structures and status types
- **Promotions** - Promotion and marketing campaign types
- **Location** - Geographic and venue-related types
- **Genres** - Music and entertainment genre definitions
- **Meta** - Metadata and configuration types
- **Common** - Shared utility types and interfaces
- **CustomDocType** - Custom document type definitions
- **firebase** - Firebase/Firestore type re-exports and utilities
- **WebappUsers** - Web application specific user types and interfaces
- **Chat** - Chat system types and interfaces for messaging functionality
- **Matching** - Types for the matching system and attendee management

## Development

### Prerequisites

- [Bun](https://bun.sh) v1.1.1 or later
- Node.js 18+ (for npm publishing)

### Setup

```bash
# Install dependencies
bun install

# Build the project
bun run build

# Build and watch for changes
bun run build --watch
```

### Project Structure

```
src/
├── index.ts          # Main entry point
├── Common.ts         # Shared utility types
├── Users.ts          # User-related types
├── Events.ts         # Event-related types
├── Promotion.ts      # Promotion types
├── Location.ts       # Location types
├── Genres.ts         # Genre definitions
├── Meta.ts           # Metadata types
├── CustomDocType.ts  # Custom document types
├── firebase.ts       # Firebase/Firestore type utilities
└── WebappUsers.ts    # Web application user types
```

## Publishing

This package uses automated publishing via GitHub Actions:

### Automatic Publishing (Recommended)

1. Update the version in `package.json`
2. Commit your changes
3. Create and push a version tag:

```bash
git add .
git commit -m "Release v1.0.1"
git tag v1.0.1
git push origin v1.0.1
```

or use the release script (chmod +x release.sh once and then ./release.sh)

```bash
./release.sh
```

### Manual Publishing

1. Go to the GitHub repository
2. Navigate to **Actions** tab
3. Select **"Manual Publish to NPM"** workflow
4. Click **"Run workflow"**
5. Choose version bump type (patch/minor/major)
6. Click **"Run workflow"**

## Dependencies

### Peer Dependencies

- `@firebase/firestore` >=4.0.0

### Dev Dependencies

- `typescript` ^5.4.5
- `@firebase/firestore` ^4.6.3

## License

This project is part of the QRush ecosystem.

---

Built with [Bun](https://bun.sh) 🚀