Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Type checking
run: yarn type-check
run: pnpm type-check

- name: Build TypeScript
run: yarn build
run: pnpm build

- name: Test Docker build (no push)
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ Thumbs.db
docs/
ai_context/

# Enforce Yarn usage - ignore npm lockfile
# Enforce pnpm usage - ignore npm and yarn lockfiles
package-lock.json
yarn.lock

# Environment files with sensitive data
.env
Expand Down
13 changes: 13 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# pnpm configuration
# Use shamefully-hoist to make peer dependencies available
# This resolves TypeScript type inference issues with nested dependencies
shamefully-hoist=true

# Public hoist pattern - hoist @redis packages to resolve TypeScript type issues
public-hoist-pattern[]=@redis/*

# Auto-install peers to prevent missing peer dependency warnings
auto-install-peers=true

# Use strict peer dependencies to maintain dependency integrity
strict-peer-dependencies=false
4 changes: 0 additions & 4 deletions .yarnrc

This file was deleted.

24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ To get started with development:

2. **Install dependencies**
```bash
yarn install
pnpm install
```
> ⚠️ **Important**: This project enforces the use of Yarn. npm install will be blocked automatically.
> ⚠️ **Important**: This project enforces the use of pnpm. npm and yarn install will be blocked automatically.

3. **Set up environment variables**
- Copy `.env.example` to `.env`
Expand All @@ -52,7 +52,7 @@ To get started with development:

5. **Start the project in development mode**
```bash
yarn dev
pnpm dev
```

Please refer to the [README](./README.md) for more detailed setup instructions.
Expand All @@ -61,19 +61,19 @@ Please refer to the [README](./README.md) for more detailed setup instructions.

```bash
# Development with auto-reload
yarn dev
pnpm dev

# Build for production
yarn build
pnpm build

# Type checking only
yarn type-check
pnpm type-check

# Clean build artifacts
yarn clean
pnpm clean

# Start production build
yarn start
pnpm start
```

#### 🏛️ Project Structure
Expand Down Expand Up @@ -103,7 +103,7 @@ src/
- **TypeScript First**: All code must be written in TypeScript with strict type checking
- **Structured Logging**: Use `@wgtechlabs/log-engine` for all logging with built-in PII protection and security features
- **Error Handling**: Implement comprehensive error handling with detailed logging
- **Package Manager**: Use Yarn exclusively (enforced via preinstall script)
- **Package Manager**: Use pnpm exclusively (enforced via preinstall script)
- **Code Style**: Follow existing patterns and maintain consistency
- **Environment**: Use Node.js 20+ for development
- **Redis Integration**: Ensure Redis connectivity for all webhook-related features
Expand All @@ -122,9 +122,9 @@ While this project doesn't currently have a test suite, when contributing:
#### 🔍 Code Review Process

1. **Pre-submission checks**:
- [ ] Code builds without errors (`yarn build`)
- [ ] TypeScript type checking passes (`yarn type-check`)
- [ ] Development server starts successfully (`yarn dev`)
- [ ] Code builds without errors (`pnpm build`)
- [ ] TypeScript type checking passes (`pnpm type-check`)
- [ ] Development server starts successfully (`pnpm dev`)
- [ ] Redis integration works properly
- [ ] Error handling is comprehensive

Expand Down
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ RUN apk update && apk upgrade && \
apk add --no-cache dumb-init && \
rm -rf /var/cache/apk/*

# Enable and install pnpm via corepack
RUN corepack enable && \
corepack prepare pnpm@latest --activate

# Set working directory for all subsequent stages
WORKDIR /usr/src/app

Expand All @@ -46,9 +50,10 @@ FROM base AS deps
# Use bind mounts and cache for faster builds
# Downloads dependencies without copying package files into the layer
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=yarn.lock,target=yarn.lock \
--mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-yarn-cache,target=/root/.yarn \
yarn install --production --frozen-lockfile
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
--mount=type=bind,source=.npmrc,target=.npmrc \
--mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-pnpm-store,target=/root/.local/share/pnpm/store \
pnpm install --prod --frozen-lockfile

# =============================================================================
# STAGE 3: Build Application
Expand All @@ -58,13 +63,14 @@ FROM deps AS build

# Install all dependencies (including devDependencies for building)
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=yarn.lock,target=yarn.lock \
--mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-yarn-cache,target=/root/.yarn \
yarn install --frozen-lockfile
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
--mount=type=bind,source=.npmrc,target=.npmrc \
--mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-pnpm-store,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile

# Copy source code and build the application
COPY . .
RUN yarn run build
RUN pnpm run build

# =============================================================================
# STAGE 4: Final Runtime Image
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ These outstanding organizations partner with us to support our open-source work:

## 🚀 Quick Start

**Requirements**: Node.js 20+, Redis, Yarn
**Requirements**: Node.js 20+, Redis, pnpm

```bash
# 1. Install dependencies
yarn install
pnpm install

# 2. Configure environment
cp .env.example .env
Expand All @@ -37,8 +37,8 @@ sudo systemctl start redis-server # Linux
docker run -d -p 6379:6379 redis:alpine # Docker

# 4. Run the server
yarn dev # Development with auto-reload
yarn start # Production mode
pnpm dev # Development with auto-reload
pnpm start # Production mode
```

Server runs on `http://localhost:3000` with endpoints:
Expand Down Expand Up @@ -209,11 +209,11 @@ Events are queued with this enhanced structure:
### Build Commands

```bash
yarn clean # Clean previous builds
yarn build # Build for production
yarn type-check # TypeScript type checking only
yarn dev # Development with hot-reload
yarn start # Run production build
pnpm clean # Clean previous builds
pnpm build # Build for production
pnpm type-check # TypeScript type checking only
pnpm dev # Development with hot-reload
pnpm start # Run production build
```

### Project Structure
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"main": "dist/app.js",
"engines": {
"node": ">=20.0.0",
"yarn": ">=1.22.0"
"pnpm": ">=8.0.0"
},
"scripts": {
"preinstall": "npx only-allow yarn",
"preinstall": "npx only-allow pnpm",
"build": "tsc",
"start": "node dist/app.js",
"dev": "nodemon --exec ts-node src/app.ts",
Expand All @@ -49,5 +49,5 @@
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
Loading