v0.4.4 - Enhanced CLI Scaffold Commands
🛠️ Enhanced CLI Developer Experience
This release significantly improves the command with new capabilities.
✨ New Scaffold Options
Interactive Menu:
npx @lance0/latch-cli scaffoldChoose from:
- API Routes - Auth endpoints (/api/latch/*)
- Proxy (Next.js 16) - Session validation middleware
- Auth Wrapper - lib/auth.ts helper functions
- All of the Above - Complete setup
Or use CLI flags:
npx @lance0/latch-cli scaffold --type proxy # Generate proxy.ts
npx @lance0/latch-cli scaffold --type wrapper # Generate lib/auth.ts
npx @lance0/latch-cli scaffold --type all # Everything📦 What Gets Generated
proxy.ts (Next.js 16 compatible):
- ✅ No runtime export (avoids build errors)
- ✅ Proper session validation (checks session.sub)
- ✅ Customizable public routes
- ✅ Works with Next.js 16 automatically
lib/auth.ts (Recommended wrapper pattern):
- ✅
getCurrentUser()with React cache - ✅
requireAuth()guard function - ✅ TODO comments for database sync
- ✅ JIT user provisioning pattern
🎯 Why These Additions?
Based on real production feedback:
- Users need a reference proxy.ts for Next.js 16
- Wrapping pattern should be easier to set up
- One command should generate everything needed
📖 Links
- 📦 npm: https://www.npmjs.com/package/@lance0/latch-cli
- 📚 Documentation: https://github.com/lance0/latch
- 🐛 Issues: https://github.com/lance0/latch/issues