Skip to content

Commit 248c7d1

Browse files
authored
Merge pull request #3 from noxify/ai-notice
Updates
2 parents 544428a + 79b3580 commit 248c7d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+881
-485
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ name: CI
33
on:
44
pull_request:
55
branches: ["*"]
6-
types: [opened, synchronize, reopened, ready_for_review]
7-
pull_request_target:
8-
branches: ["*"]
9-
types: [opened, synchronize, reopened, ready_for_review]
106
push:
117
branches: ["main"]
128
merge_group:
139
workflow_dispatch:
1410
inputs:
1511
pr_number:
16-
description: 'PR number to run CI for'
12+
description: "PR number to run CI for"
1713
required: false
1814
type: string
1915

@@ -68,11 +64,29 @@ jobs:
6864

6965
unittest:
7066
runs-on: ubuntu-latest
67+
strategy:
68+
matrix:
69+
node-version: [20, 22]
70+
name: Test (Node.js ${{ matrix.node-version }})
7171
steps:
7272
- uses: actions/checkout@v4
7373

74-
- name: Setup
75-
uses: ./.github/setup
74+
- name: Setup Node.js ${{ matrix.node-version }}
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: ${{ matrix.node-version }}
78+
79+
- name: Setup pnpm
80+
uses: pnpm/action-setup@v4
81+
with:
82+
version: 10.13.1
83+
run_install: false
84+
85+
- shell: bash
86+
run: pnpm install
87+
88+
- name: Build packages
89+
run: pnpm --filter "./packages/*" build
7690

7791
- name: Test Core Package
7892
run: pnpm test:core

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535

3636
## Quick Start
3737

38+
### Requirements
39+
40+
- **Node.js 20+**
41+
- **ESM only** - This package is ESM-only and cannot be imported with `require()`
42+
3843
### Installation
3944

4045
```bash
@@ -43,6 +48,8 @@ npm install @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
4348
pnpm add @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
4449
```
4550

51+
> **Note**: Make sure your project has `"type": "module"` in package.json or use `.mjs` file extensions.
52+
4653
### Basic Usage
4754

4855
```typescript
@@ -251,6 +258,8 @@ queue.on("queue:resumed", () => {
251258

252259
## Development
253260

261+
This project was developed with AI assistance, combining human expertise with AI-powered code generation to accelerate development while maintaining high code quality standards.
262+
254263
```bash
255264
# Install dependencies
256265
pnpm install

apps/docs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"class-variance-authority": "0.7.1",
2727
"clsx": "2.1.1",
2828
"cmdk": "1.1.1",
29-
"date-fns": "4.1.0",
29+
"date-fns": "^4.1.0",
3030
"lucide-react": "0.525.0",
3131
"next": "15.4.2",
3232
"next-themes": "latest",
@@ -50,14 +50,14 @@
5050
"@vorsteh-queue/eslint-config": "workspace:*",
5151
"@vorsteh-queue/prettier-config": "workspace:*",
5252
"@vorsteh-queue/tsconfig": "workspace:*",
53-
"eslint": "9.31.0",
53+
"eslint": "^9.31.0",
5454
"next-validate-link": "1.5.2",
5555
"pagefind": "1.3.0",
5656
"postcss": "8.5.6",
57-
"prettier": "3.6.2",
57+
"prettier": "^3.6.2",
5858
"tailwind-merge": "3.3.1",
5959
"tailwindcss": "4.1.11",
6060
"tailwindcss-animate": "1.0.7",
61-
"typescript": "5.8.3"
61+
"typescript": "^5.8.3"
6262
}
6363
}

examples/drizzle-pg/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ Minimal example showing how to use vorsteh-queue with Drizzle ORM and node-postg
55
## Setup
66

77
1. Install dependencies:
8+
89
```bash
910
pnpm install
1011
```
1112

1213
2. Set up PostgreSQL database and copy environment variables:
14+
1315
```bash
1416
cp .env.example .env
1517
# Edit .env with your database URL
1618
```
1719

1820
3. Push database schema:
21+
1922
```bash
2023
pnpm db:push
2124
```
2225

2326
4. Run the example:
27+
2428
```bash
2529
pnpm dev
2630
```
@@ -30,4 +34,4 @@ pnpm dev
3034
- Basic job registration and processing
3135
- Priority-based job execution
3236
- Delayed job scheduling
33-
- Graceful shutdown handling
37+
- Graceful shutdown handling

examples/drizzle-pg/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"dependencies": {
1212
"@vorsteh-queue/adapter-drizzle": "workspace:*",
1313
"@vorsteh-queue/core": "workspace:*",
14-
"drizzle-orm": "0.44.3",
14+
"drizzle-orm": "^0.44.3",
1515
"pg": "8.16.3"
1616
},
1717
"devDependencies": {
1818
"@types/pg": "8.15.4",
19-
"drizzle-kit": "0.31.4",
19+
"drizzle-kit": "^0.31.4",
2020
"tsx": "4.20.3",
21-
"typescript": "5.8.3"
21+
"typescript": "^5.8.3"
2222
}
2323
}

examples/drizzle-pglite/README.md

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,37 @@ A complete example using Vorsteh Queue with Drizzle ORM and PGlite (embedded Pos
1414
-**Queue statistics** - Monitor queue health
1515
-**Graceful shutdown** - Clean termination
1616

17-
## Quick Start
17+
## Setup
18+
19+
1. Install dependencies:
1820

1921
```bash
20-
# Install dependencies
2122
pnpm install
23+
```
24+
25+
2. Push database schema:
2226

23-
# Run the example
27+
```bash
28+
pnpm db:push
29+
```
30+
31+
3. Run the example:
32+
33+
```bash
2434
pnpm dev
2535
```
2636

37+
> **Note**: PGlite creates an embedded PostgreSQL database automatically, but the schema still needs to be initialized.
38+
2739
## What It Does
2840

2941
1. **Creates embedded database** - PGlite starts with empty database
30-
2. **Sets up schema** - Creates queue tables automatically
31-
3. **Registers job handlers** - Email and data processing jobs
32-
4. **Adds various jobs** - Immediate, delayed, priority, and recurring
42+
2. **Initializes schema** - Uses drizzle-kit pushSchema to create tables
43+
3. **Registers job handlers** - Email and data processing jobs with TypeScript types
44+
4. **Adds sample jobs** - Immediate, delayed, and priority jobs
3345
5. **Processes jobs** - Shows real-time progress and events
34-
6. **Displays stats** - Queue statistics every 5 seconds
35-
7. **Graceful shutdown** - Stops after 30 seconds
46+
6. **Displays stats** - Queue statistics every 10 seconds
47+
7. **Graceful shutdown** - Press Ctrl+C to stop cleanly
3648

3749
## Perfect for Bug Reports
3850

@@ -47,38 +59,51 @@ This example is ideal for reproducing bugs because:
4759
## Example Output
4860

4961
```
50-
🚀 Starting PGlite Queue Example
51-
52-
📝 Adding jobs to queue...
62+
🚀 Starting PGlite Queue Example (Embedded PostgreSQL)
63+
📋 Initializing database schema...
64+
✅ Database schema initialized
5365
✅ Job added: send-email (abc123...)
54-
✅ Job added: send-email (def456...)
55-
✅ Job added: process-data (ghi789...)
56-
57-
🔄 Starting queue processing...
66+
✅ Job added: process-data (def456...)
67+
✅ Job added: send-email (ghi789...)
68+
🔄 Queue processing started. Press Ctrl+C to stop.
5869
⚡ Processing: send-email (abc123...)
59-
📧 Sending email to user@example.com
60-
Subject: Welcome to Vorsteh Queue!
70+
📧 Sending email to user@example.com: Welcome!
6171
🎉 Completed: send-email (abc123...)
62-
63-
📊 Queue Stats: { pending: 2, processing: 0, completed: 1, failed: 0, delayed: 1 }
72+
⚡ Processing: process-data (def456...)
73+
📊 Processing 20 items in batches of 5
74+
📈 Progress: process-data - 25%
75+
📈 Progress: process-data - 50%
76+
📊 Queue Stats: { pending: 1, processing: 1, completed: 1, failed: 0, delayed: 1 }
6477
```
6578

6679
## Job Types
6780

6881
### Email Job
82+
6983
```typescript
7084
interface EmailJob {
7185
to: string
72-
subject: string
73-
body: string
86+
subject: string
87+
body?: string
88+
}
89+
90+
interface EmailResult {
91+
sent: boolean
92+
messageId: string
7493
}
7594
```
7695

7796
### Data Processing Job
97+
7898
```typescript
7999
interface DataProcessingJob {
80-
items: string[]
81-
batchSize: number
100+
data: unknown[]
101+
batchSize?: number
102+
}
103+
104+
interface DataProcessingResult {
105+
processed: number
106+
results: unknown[]
82107
}
83108
```
84109

@@ -95,4 +120,4 @@ interface DataProcessingJob {
95120
- **Bug reproduction** - Minimal setup for issue reports
96121
- **Feature testing** - Quick way to test new features
97122
- **Learning** - Understand how Vorsteh Queue works
98-
- **Prototyping** - Rapid development without database setup
123+
- **Prototyping** - Rapid development without database setup

examples/drizzle-pglite/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
"type": "module",
77
"scripts": {
88
"dev": "tsx src/index.ts",
9-
"build": "tsc",
10-
"start": "node dist/index.js"
9+
"db:push": "drizzle-kit push"
1110
},
1211
"dependencies": {
13-
"@electric-sql/pglite": "0.3.5",
12+
"@electric-sql/pglite": "^0.3.5",
1413
"@vorsteh-queue/adapter-drizzle": "workspace:*",
1514
"@vorsteh-queue/core": "workspace:*",
16-
"drizzle-orm": "0.44.3"
15+
"drizzle-orm": "^0.44.3"
1716
},
1817
"devDependencies": {
1918
"@types/node": "22.16.5",
2019
"tsx": "4.20.3",
21-
"typescript": "5.8.3"
20+
"typescript": "^5.8.3"
2221
}
2322
}

0 commit comments

Comments
 (0)