|
| 1 | +# create-vorsteh-queue |
| 2 | + |
| 3 | +Create Vorsteh Queue applications with one command. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +### Interactive Mode |
| 8 | + |
| 9 | +```bash |
| 10 | +# Full interactive experience |
| 11 | +npx create-vorsteh-queue |
| 12 | +``` |
| 13 | + |
| 14 | +### Direct Mode |
| 15 | + |
| 16 | +```bash |
| 17 | +# With project name |
| 18 | +npx create-vorsteh-queue my-queue-app |
| 19 | + |
| 20 | +# With template selection |
| 21 | +npx create-vorsteh-queue my-app --template=drizzle-pglite |
| 22 | +npx create-vorsteh-queue my-app -t=progress-tracking |
| 23 | + |
| 24 | +# With package manager |
| 25 | +npx create-vorsteh-queue my-app --package-manager=pnpm |
| 26 | +npx create-vorsteh-queue my-app -pm=yarn |
| 27 | + |
| 28 | +# Quiet mode (minimal output) |
| 29 | +npx create-vorsteh-queue my-app --quiet |
| 30 | +npx create-vorsteh-queue my-app -q |
| 31 | + |
| 32 | +# Fully automated |
| 33 | +npx create-vorsteh-queue my-app -t=drizzle-pglite -pm=pnpm --quiet |
| 34 | +``` |
| 35 | + |
| 36 | +## CLI Options |
| 37 | + |
| 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` | |
| 43 | + |
| 44 | +### Package Managers |
| 45 | + |
| 46 | +- **npm** - Default Node.js package manager |
| 47 | +- **pnpm** - Fast, disk space efficient |
| 48 | +- **yarn** - Popular alternative |
| 49 | +- **bun** - Ultra-fast (experimental) |
| 50 | + |
| 51 | +## Available Templates |
| 52 | + |
| 53 | +Templates are **dynamically discovered** from the GitHub repository: |
| 54 | + |
| 55 | +- **drizzle-postgres** - Drizzle ORM + postgres.js (Production ready) |
| 56 | +- **drizzle-pg** - Drizzle ORM + node-postgres (Simple setup) |
| 57 | +- **drizzle-pglite** - Drizzle ORM + PGlite (Embedded, zero setup) |
| 58 | +- **progress-tracking** - Advanced progress tracking with real-time updates |
| 59 | +- **event-system** - Comprehensive event monitoring and statistics |
| 60 | + |
| 61 | +> Templates are automatically fetched from the examples directory, so new examples are immediately available! |
| 62 | +
|
| 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 | + |
| 84 | +## Examples |
| 85 | + |
| 86 | +### Interactive Usage |
| 87 | + |
| 88 | +```bash |
| 89 | +┌ create-vorsteh-queue |
| 90 | +│ |
| 91 | +◇ What is your project name? |
| 92 | +│ my-queue-app |
| 93 | +│ |
| 94 | +◇ Choose a template: |
| 95 | +│ ● drizzle-pglite-example (Embedded PostgreSQL with zero setup) |
| 96 | +│ |
| 97 | +◇ Install dependencies? |
| 98 | +│ Yes |
| 99 | +│ |
| 100 | +◇ Which package manager? |
| 101 | +│ ● pnpm |
| 102 | +│ |
| 103 | +└ 🎉 Project created successfully! |
| 104 | + |
| 105 | +Next steps: |
| 106 | + cd my-queue-app |
| 107 | + pnpm run dev |
| 108 | +``` |
| 109 | + |
| 110 | +### Automated Usage |
| 111 | + |
| 112 | +```bash |
| 113 | +# Perfect for scripts and CI/CD |
| 114 | +npx create-vorsteh-queue worker-service \ |
| 115 | + --template=drizzle-postgres \ |
| 116 | + --package-manager=pnpm \ |
| 117 | + --quiet |
| 118 | +``` |
| 119 | + |
| 120 | +## Development |
| 121 | + |
| 122 | +```bash |
| 123 | +# Install dependencies |
| 124 | +pnpm install |
| 125 | + |
| 126 | +# Run in development |
| 127 | +pnpm dev |
| 128 | + |
| 129 | +# Build for production |
| 130 | +pnpm build |
| 131 | + |
| 132 | +# Test locally |
| 133 | +npx tsx src/index.ts my-test-app |
| 134 | +``` |
| 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 |
0 commit comments