Skip to content

Commit 78e9e13

Browse files
authored
Merge pull request #6 from noxify/cli-changes
update changesets
2 parents d957a01 + 4833d54 commit 78e9e13

File tree

5 files changed

+57
-96
lines changed

5 files changed

+57
-96
lines changed

.changeset/adapter-drizzle-initial-release.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ Database adapter supporting PostgreSQL and MariaDB/MySQL via Drizzle ORM.
99
## 🗄️ Database Support
1010

1111
### PostgreSQL
12+
1213
- **PostgreSQL 12+** with SKIP LOCKED support for concurrent processing
1314
- **Multiple drivers**: node-postgres, postgres.js, PGlite
1415
- **Full feature support**: JSONB payloads, UUID primary keys, timezone-aware timestamps
1516
- **Connection pooling** and transaction support
1617

17-
### MariaDB/MySQL
18+
### MariaDB/MySQL
19+
1820
- **MariaDB 10.6+** and **MySQL 8.0+** with SKIP LOCKED functionality
1921
- **mysql2 driver** with promise support and connection pooling
2022
- **JSON payloads** with proper serialization/deserialization
@@ -36,21 +38,21 @@ Database adapter supporting PostgreSQL and MariaDB/MySQL via Drizzle ORM.
3638

3739
## 📦 Easy Integration
3840

41+
**with PostgreSQL:**
42+
3943
```typescript
4044
// PostgreSQL
4145
import { PostgresQueueAdapter, postgresSchema } from "@vorsteh-queue/adapter-drizzle"
46+
4247
const db = drizzle(pool, { schema: postgresSchema })
4348
const adapter = new PostgresQueueAdapter(db, "my-queue")
49+
```
4450

51+
**with MariaDB/MySQL:**
52+
53+
```
4554
// MariaDB/MySQL
4655
import { MariaDBQueueAdapter, mariadbSchema } from "@vorsteh-queue/adapter-drizzle"
4756
const db = drizzle(connection, { schema: mariadbSchema })
4857
const adapter = new MariaDBQueueAdapter(db, "my-queue")
4958
```
50-
51-
## 🛡️ Enterprise Features
52-
53-
- **Connection pooling** support for high-throughput applications
54-
- **Transaction support** for atomic job operations
55-
- **Error handling** with proper database-specific error types
56-
- **Schema validation** and type safety throughout

.changeset/create-vorsteh-queue-initial-release.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,56 +17,33 @@ Interactive CLI tool for creating new Vorsteh Queue projects with zero configura
1717
## 🎯 Usage Options
1818

1919
### Interactive Mode
20+
2021
```bash
2122
npx create-vorsteh-queue
2223
# Prompts for project name, template, and package manager
2324
```
2425

25-
### Direct Mode
26+
### Direct Mode
27+
2628
```bash
27-
npx create-vorsteh-queue my-app --template=drizzle-pglite --package-manager=pnpm
29+
npx create-vorsteh-queue my-app --template=drizzle-pglite --package-manager=pnpm --no-install
2830
# Fully automated project creation
2931
```
3032

3133
### CLI Flags
34+
3235
- `--template=<name>` or `-t=<name>` - Choose template
3336
- `--package-manager=<pm>` or `-pm=<pm>` - Package manager (npm/pnpm/yarn/bun)
37+
- `--no-install` - Skip dependency install
3438
- `--quiet` or `-q` - Minimal output for automation
3539

3640
## 📦 Available Templates
3741

3842
Templates are **dynamically discovered** from the repository:
3943

40-
- **drizzle-postgres-example** - Advanced example using Drizzle ORM with postgres.js and recurring jobs
41-
- **drizzle-pg-example** - Basic example using Drizzle ORM with node-postgres (pg)
42-
- **drizzle-pglite-example** - Zero-setup example using Drizzle ORM with PGlite (embedded PostgreSQL)
43-
- **progress-tracking-example** - Real-time job progress tracking using Drizzle ORM with postgres.js
44-
- **event-system-example** - Comprehensive event monitoring and statistics using Drizzle ORM with postgres.js
45-
46-
## 🔧 Smart Features
47-
48-
- **Latest versions** - Automatically fetches current package versions from npm registry
49-
- **Workspace replacement** - Converts workspace dependencies to npm versions
50-
- **Template validation** - Ensures selected templates exist and are valid
51-
- **Package manager detection** - Validates and uses specified package manager
52-
- **Error handling** - Graceful fallbacks and helpful error messages
53-
54-
## 🤖 Automation Ready
55-
56-
Perfect for CI/CD pipelines and scripting:
57-
58-
```bash
59-
# Silent project creation
60-
npx create-vorsteh-queue worker-service \
61-
--template=drizzle-postgres \
62-
--package-manager=pnpm \
63-
--quiet
64-
```
65-
66-
## 🎨 Developer Experience
67-
68-
- **Colorful output** with picocolors for enhanced readability
69-
- **Progress indicators** with spinners for long-running operations
70-
- **Helpful links** to documentation and examples
71-
- **Validation** with clear error messages and suggestions
72-
- **Cross-platform** support for Windows, macOS, and Linux
44+
- **drizzle-pg** - Basic example using Drizzle ORM with node-postgres (pg)
45+
- **drizzle-pglite** - Zero-setup example using Drizzle ORM with PGlite (embedded PostgreSQL)
46+
- **drizzle-postgres** - Advanced example using Drizzle ORM with postgres.js and recurring jobs
47+
- **event-system** - Comprehensive event monitoring and statistics using Drizzle ORM with postgres.js
48+
- **pm2-workers** - Manage multiple Vorsteh Queues with PM2 using Drizzle ORM with postgres.js
49+
- **progress-tracking** - Real-time job progress tracking using Drizzle ORM with postgres.js

examples/pm2-workers/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "pm2-workers-example",
33
"version": "1.0.0",
4+
"description": "Manage multiple Vorsteh Queues with PM2 using Drizzle ORM with postgres.js",
45
"type": "module",
56
"private": true,
67
"scripts": {

packages/create-vorsteh-queue/README.md

Lines changed: 20 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,21 @@ npx create-vorsteh-queue my-app -pm=yarn
2929
npx create-vorsteh-queue my-app --quiet
3030
npx create-vorsteh-queue my-app -q
3131

32-
# Fully automated
32+
# Fully automated (no prompts)
3333
npx create-vorsteh-queue my-app -t=drizzle-pglite -pm=pnpm --quiet
34+
35+
# Skip dependency installation
36+
npx create-vorsteh-queue my-app -t=drizzle-pglite --no-install --quiet
3437
```
3538

3639
## CLI Options
3740

38-
| Option | Short | Description | Example |
39-
| ------------------------ | ----------- | --------------- | ------------------- |
40-
| `--template=<name>` | `-t=<name>` | Choose template | `-t=drizzle-pglite` |
41-
| `--package-manager=<pm>` | `-pm=<pm>` | Package manager | `-pm=pnpm` |
42-
| `--quiet` | `-q` | Minimal output | `--quiet` |
41+
| Option | Short | Description | Example |
42+
| ------------------------ | ----------- | ----------------------- | ------------------- |
43+
| `--template=<name>` | `-t=<name>` | Choose template | `-t=drizzle-pglite` |
44+
| `--package-manager=<pm>` | `-pm=<pm>` | Package manager | `-pm=pnpm` |
45+
| `--no-install` | - | Skip dependency install | `--no-install` |
46+
| `--quiet` | `-q` | Minimal output | `--quiet` |
4347

4448
### Package Managers
4549

@@ -48,39 +52,19 @@ npx create-vorsteh-queue my-app -t=drizzle-pglite -pm=pnpm --quiet
4852
- **yarn** - Popular alternative
4953
- **bun** - Ultra-fast (experimental)
5054

51-
## Available Templates
55+
## 📦 Available Templates
5256

53-
Templates are **dynamically discovered** from the GitHub repository:
57+
Templates are **dynamically discovered** from the repository:
5458

55-
- **drizzle-postgres-example** - Advanced example using Drizzle ORM with postgres.js and recurring jobs
56-
- **drizzle-pg-example** - Basic example using Drizzle ORM with node-postgres (pg)
57-
- **drizzle-pglite-example** - Zero-setup example using Drizzle ORM with PGlite (embedded PostgreSQL)
58-
- **progress-tracking-example** - Real-time job progress tracking using Drizzle ORM with postgres.js
59-
- **event-system-example** - Comprehensive event monitoring and statistics using Drizzle ORM with postgres.js
59+
- **drizzle-pg** - Basic example using Drizzle ORM with node-postgres (pg)
60+
- **drizzle-pglite** - Zero-setup example using Drizzle ORM with PGlite (embedded PostgreSQL)
61+
- **drizzle-postgres** - Advanced example using Drizzle ORM with postgres.js and recurring jobs
62+
- **event-system** - Comprehensive event monitoring and statistics using Drizzle ORM with postgres.js
63+
- **pm2-workers** - Manage multiple Vorsteh Queues with PM2 using Drizzle ORM with postgres.js
64+
- **progress-tracking** - Real-time job progress tracking using Drizzle ORM with postgres.js
6065

6166
> Templates are automatically fetched from the examples directory, so new examples are immediately available!
6267
63-
## Features
64-
65-
- 🚀 **Interactive CLI** - Beautiful prompts with @clack/prompts
66-
- 📦 **Dynamic templates** - Auto-discovered from GitHub repository
67-
- 🔄 **Latest versions** - Fetches current versions from npm registry
68-
- 🎨 **Colorful output** - Enhanced terminal experience with picocolors
69-
- 🔗 **Helpful links** - Direct links to documentation
70-
-**Fast downloads** - Efficient template downloading with giget
71-
- 🤫 **Quiet mode** - Silent operation for automation
72-
- 🛠️ **Multiple package managers** - npm, pnpm, yarn, bun support
73-
- 🎯 **CLI flags** - Full automation support
74-
75-
## What it does
76-
77-
1. **Discovers templates** - Dynamically fetches available templates from GitHub
78-
2. **Prompts for details** - Name, template, package manager (if not provided via CLI)
79-
3. **Downloads template** - Uses giget to efficiently download from GitHub
80-
4. **Updates package.json** - Replaces workspace dependencies with latest npm versions
81-
5. **Installs dependencies** - Uses selected package manager
82-
6. **Provides guidance** - Shows next steps with correct commands
83-
8468
## Examples
8569

8670
### Interactive Usage
@@ -114,7 +98,8 @@ Next steps:
11498
npx create-vorsteh-queue worker-service \
11599
--template=drizzle-postgres \
116100
--package-manager=pnpm \
117-
--quiet
101+
--quiet \
102+
--no-install
118103
```
119104

120105
## Development
@@ -128,15 +113,4 @@ pnpm dev
128113

129114
# Build for production
130115
pnpm build
131-
132-
# Test locally
133-
npx tsx src/index.ts my-test-app
134116
```
135-
136-
## Architecture
137-
138-
- **Dynamic Discovery** - Templates fetched from GitHub API
139-
- **Smart Caching** - giget handles efficient downloads
140-
- **Version Management** - npm registry API for latest versions
141-
- **Graceful Fallbacks** - Works offline with cached templates
142-
- **Cross-platform** - Works on Windows, macOS, Linux

packages/create-vorsteh-queue/src/index.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ async function main() {
175175
const pmFlag = args.find((arg) => arg.startsWith("--package-manager=") || arg.startsWith("-pm="))
176176
const templateFlag = args.find((arg) => arg.startsWith("--template=") || arg.startsWith("-t="))
177177
const quietMode = args.includes("--quiet") || args.includes("-q")
178+
const noInstall = args.includes("--no-install")
178179
const cliPackageManager = pmFlag?.split("=")[1]
179180
const cliTemplate = templateFlag?.split("=")[1]
180181

@@ -255,14 +256,20 @@ async function main() {
255256
}
256257
}
257258

258-
const installDeps = await confirm({
259-
message: "Install dependencies?",
260-
initialValue: true,
261-
})
259+
// Skip dependency prompt if all CLI args provided (full automation) or --no-install flag
260+
let installDeps = !noInstall
261+
if (!noInstall && (!cliTemplate || !cliPackageManager)) {
262+
const result = await confirm({
263+
message: "Install dependencies?",
264+
initialValue: true,
265+
})
266+
267+
if (isCancel(result)) {
268+
cancel("Operation cancelled")
269+
return process.exit(0)
270+
}
262271

263-
if (isCancel(installDeps)) {
264-
cancel("Operation cancelled")
265-
return process.exit(0)
272+
installDeps = result
266273
}
267274

268275
let packageManager = "npm"

0 commit comments

Comments
 (0)