@nimbuslab/cli 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -75
- package/dist/index.js +378 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,136 +1,228 @@
|
|
|
1
1
|
# @nimbuslab/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Modern Next.js project generator with AI-friendly documentation and best practices built-in.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Create production-ready Next.js projects in seconds with intelligent setup, optimized documentation for AI coding assistants, and interactive service configuration.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install -g @nimbuslab/cli
|
|
9
|
-
```
|
|
7
|
+
## Features
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
✨ **Modern Stack** - Next.js 16, React 19, TypeScript, Tailwind CSS 4, shadcn/ui
|
|
10
|
+
🤖 **AI-Friendly Documentation** - Auto-generated context files for Claude Code, Cursor, GitHub Copilot
|
|
11
|
+
⚡ **Interactive Setup** - Configure services (email, analytics) during project creation
|
|
12
|
+
📦 **Zero Config** - Smart defaults, production-ready from day one
|
|
13
|
+
🎨 **Beautiful UI** - shadcn/ui components with dark mode support
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
12
16
|
|
|
13
17
|
```bash
|
|
14
|
-
|
|
15
|
-
nimbus
|
|
16
|
-
nimbus upgrade # Planejar upgrades de dependencias
|
|
17
|
-
nimbus update # Atualizar o CLI
|
|
18
|
-
nimbus setup node # Configurar ambiente Node.js (Volta)
|
|
19
|
-
nimbus help # Ajuda
|
|
18
|
+
npm install -g @nimbuslab/cli
|
|
19
|
+
nimbus create my-project
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Templates
|
|
23
23
|
|
|
24
24
|
### Landing Page
|
|
25
25
|
|
|
26
|
+
Perfect for marketing sites, product launches, and portfolios.
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
|
-
nimbus create
|
|
29
|
+
nimbus create my-site --landing
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
**Includes:**
|
|
33
|
+
- Next.js 16 (App Router, Turbopack)
|
|
34
|
+
- React 19 (Server Components)
|
|
35
|
+
- Tailwind CSS 4 (CSS-first)
|
|
36
|
+
- shadcn/ui (default style)
|
|
37
|
+
- TypeScript (strict mode)
|
|
38
|
+
- Responsive design
|
|
39
|
+
- Dark mode support
|
|
40
|
+
- SEO optimized
|
|
41
|
+
|
|
42
|
+
### Web Application
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
Full-stack app with authentication and database.
|
|
33
45
|
|
|
34
46
|
```bash
|
|
35
|
-
nimbus create
|
|
47
|
+
nimbus create my-app --app
|
|
36
48
|
```
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
**Everything in Landing, plus:**
|
|
51
|
+
- Better Auth (authentication)
|
|
52
|
+
- Drizzle ORM (database)
|
|
53
|
+
- Protected routes
|
|
54
|
+
- User management
|
|
55
|
+
- Dashboard layout
|
|
56
|
+
- Docker support
|
|
39
57
|
|
|
40
58
|
### Monorepo
|
|
41
59
|
|
|
60
|
+
Turborepo setup for multi-app projects.
|
|
61
|
+
|
|
42
62
|
```bash
|
|
43
|
-
nimbus create
|
|
63
|
+
nimbus create my-workspace --turborepo
|
|
44
64
|
```
|
|
45
65
|
|
|
46
|
-
|
|
66
|
+
**Includes:**
|
|
67
|
+
- Turborepo (build system)
|
|
68
|
+
- Shared packages (ui, config, utils)
|
|
69
|
+
- Multiple apps support
|
|
70
|
+
- Optimized caching
|
|
71
|
+
- Parallel execution
|
|
72
|
+
|
|
73
|
+
## AI-Friendly Documentation
|
|
74
|
+
|
|
75
|
+
Every project includes automatically generated documentation optimized for LLMs:
|
|
47
76
|
|
|
48
|
-
|
|
77
|
+
### Generated Files
|
|
49
78
|
|
|
50
|
-
|
|
79
|
+
- **AGENTS.md** - Universal context for Claude Code, Cursor, GitHub Copilot
|
|
80
|
+
- **llms.txt** - 2026 standard for LLM indexing (ChatGPT, Perplexity)
|
|
81
|
+
- **ARCHITECTURE.md** - Architectural decisions with rationale
|
|
82
|
+
- **EXAMPLES.md** - Common tasks with complete code examples
|
|
83
|
+
- **Compatibility symlinks** - `.cursorrules`, `.github/copilot-instructions.md`
|
|
51
84
|
|
|
52
|
-
###
|
|
85
|
+
### Interactive Service Setup
|
|
53
86
|
|
|
54
|
-
|
|
55
|
-
- **llms.txt** - Padrão 2026 para indexação por LLMs (ChatGPT, Perplexity)
|
|
56
|
-
- **ARCHITECTURE.md** - Decisões arquiteturais explicadas
|
|
57
|
-
- **EXAMPLES.md** - Casos de uso com código completo
|
|
58
|
-
- **Symlinks** - `.cursorrules` e `.github/copilot-instructions.md` apontam para AGENTS.md
|
|
87
|
+
Configure integrations during project creation:
|
|
59
88
|
|
|
60
|
-
|
|
89
|
+
- **Resend** - Transactional email (3,000 emails/month free)
|
|
90
|
+
- **Google Analytics** - Site metrics (free)
|
|
61
91
|
|
|
62
|
-
|
|
92
|
+
The CLI provides:
|
|
93
|
+
- Pricing information and signup links
|
|
94
|
+
- API key validation
|
|
95
|
+
- Automatic `.env` and `.env.example` generation
|
|
96
|
+
- Direct links to documentation
|
|
63
97
|
|
|
64
|
-
|
|
65
|
-
- **Google Analytics** - Métricas do site (grátis)
|
|
98
|
+
Based on [GEO (Generative Engine Optimization)](https://gitbook.com/docs/guides/seo-and-llm-optimization/geo-guide) best practices.
|
|
66
99
|
|
|
67
|
-
|
|
68
|
-
- Mostra informações de pricing e signup
|
|
69
|
-
- Valida formato das API keys
|
|
70
|
-
- Gera `.env` e `.env.example` automaticamente
|
|
71
|
-
- Inclui links diretos para obter chaves
|
|
100
|
+
## Commands
|
|
72
101
|
|
|
73
|
-
|
|
102
|
+
```bash
|
|
103
|
+
nimbus create [name] # Create new project (interactive)
|
|
104
|
+
nimbus analyze [dir] # Analyze existing project stack
|
|
105
|
+
nimbus upgrade [target] # Plan dependency upgrades
|
|
106
|
+
nimbus update # Update CLI itself
|
|
107
|
+
nimbus setup node # Configure Node.js environment (Volta)
|
|
108
|
+
nimbus help # Show help
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Options
|
|
74
112
|
|
|
75
|
-
|
|
113
|
+
| Flag | Description |
|
|
114
|
+
|------|-------------|
|
|
115
|
+
| `-y, --yes` | Accept defaults (skip prompts) |
|
|
116
|
+
| `--no-git` | Skip Git initialization |
|
|
117
|
+
| `--no-install` | Skip dependency installation |
|
|
118
|
+
| `--landing` | Use landing page template |
|
|
119
|
+
| `--app` | Use web app template |
|
|
120
|
+
| `--turborepo` | Use monorepo template |
|
|
76
121
|
|
|
77
|
-
|
|
122
|
+
## Examples
|
|
78
123
|
|
|
79
|
-
|
|
80
|
-
- fnm e nvm causam problemas de cache do shell
|
|
81
|
-
- Volta nao tem esse problema (binarios nativos)
|
|
82
|
-
- Funciona igual no Linux e Windows
|
|
83
|
-
- Gerencia Node, npm e pacotes globais automaticamente
|
|
124
|
+
### Landing Page (Auto Mode)
|
|
84
125
|
|
|
85
126
|
```bash
|
|
86
|
-
|
|
87
|
-
|
|
127
|
+
nimbus create portfolio --landing -y
|
|
128
|
+
cd portfolio
|
|
129
|
+
bun dev
|
|
130
|
+
```
|
|
88
131
|
|
|
89
|
-
|
|
90
|
-
|
|
132
|
+
### Web App (Interactive)
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
nimbus create dashboard --app
|
|
136
|
+
# Follow prompts for service configuration
|
|
137
|
+
cd dashboard
|
|
138
|
+
bun setup # Database setup
|
|
139
|
+
bun dev
|
|
91
140
|
```
|
|
92
141
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
142
|
+
### Analyze Existing Project
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
nimbus analyze ./my-project
|
|
146
|
+
nimbus analyze --json # JSON output
|
|
147
|
+
```
|
|
98
148
|
|
|
99
|
-
|
|
149
|
+
### Plan Upgrades
|
|
100
150
|
|
|
101
151
|
```bash
|
|
102
|
-
#
|
|
103
|
-
nimbus
|
|
104
|
-
nimbus
|
|
105
|
-
|
|
106
|
-
# Planejar upgrades
|
|
107
|
-
nimbus upgrade --plan
|
|
108
|
-
nimbus upgrade tailwind
|
|
109
|
-
nimbus upgrade next
|
|
152
|
+
nimbus upgrade --plan # Show available upgrades
|
|
153
|
+
nimbus upgrade tailwind # Upgrade specific package
|
|
154
|
+
nimbus upgrade next # Upgrade Next.js
|
|
110
155
|
```
|
|
111
156
|
|
|
112
|
-
##
|
|
157
|
+
## Node.js Setup (Volta)
|
|
158
|
+
|
|
159
|
+
Configure Node.js environment using [Volta](https://volta.sh).
|
|
160
|
+
|
|
161
|
+
**Why Volta?**
|
|
162
|
+
- No shell cache issues (unlike fnm/nvm)
|
|
163
|
+
- Native binaries for better performance
|
|
164
|
+
- Cross-platform (Linux, macOS, Windows)
|
|
165
|
+
- Automatic version management per project
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Check current environment
|
|
169
|
+
nimbus setup node --check
|
|
170
|
+
|
|
171
|
+
# Migrate to Volta (interactive)
|
|
172
|
+
nimbus setup node
|
|
173
|
+
```
|
|
113
174
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
175
|
+
The command will:
|
|
176
|
+
1. Detect existing fnm/nvm installations
|
|
177
|
+
2. Remove them automatically
|
|
178
|
+
3. Install Volta
|
|
179
|
+
4. Reinstall global packages
|
|
119
180
|
|
|
120
|
-
##
|
|
181
|
+
## Requirements
|
|
121
182
|
|
|
122
183
|
- [Bun](https://bun.sh) >= 1.0
|
|
123
184
|
|
|
124
185
|
```bash
|
|
186
|
+
# Linux/macOS
|
|
125
187
|
curl -fsSL https://bun.sh/install | bash
|
|
188
|
+
|
|
189
|
+
# Windows
|
|
190
|
+
powershell -c "irm bun.sh/install.ps1 | iex"
|
|
126
191
|
```
|
|
127
192
|
|
|
128
|
-
##
|
|
193
|
+
## Open Source Templates
|
|
194
|
+
|
|
195
|
+
- [create-next-landing](https://github.com/nimbuslab/create-next-landing) - Landing page template
|
|
196
|
+
- [create-next-app](https://github.com/nimbuslab/create-next-app) - Web app template
|
|
197
|
+
- [create-turborepo](https://github.com/nimbuslab/create-turborepo) - Monorepo template
|
|
198
|
+
|
|
199
|
+
## Why nimbuslab CLI?
|
|
200
|
+
|
|
201
|
+
**Modern Stack**
|
|
202
|
+
Built with the latest technologies: Next.js 16, React 19, Tailwind CSS 4. Always up-to-date.
|
|
203
|
+
|
|
204
|
+
**AI-First**
|
|
205
|
+
Documentation designed for AI coding assistants. Get better suggestions, faster onboarding.
|
|
206
|
+
|
|
207
|
+
**Zero Config**
|
|
208
|
+
Smart defaults based on industry best practices. Production-ready from day one.
|
|
209
|
+
|
|
210
|
+
**Interactive**
|
|
211
|
+
Guided setup for services and integrations. No more reading docs to get started.
|
|
212
|
+
|
|
213
|
+
**Open Source**
|
|
214
|
+
All templates are open source. Fork, customize, contribute back.
|
|
215
|
+
|
|
216
|
+
## Support
|
|
217
|
+
|
|
218
|
+
- 📖 [Documentation](https://github.com/nimbuslab/nimbus-cli)
|
|
219
|
+
- 🐛 [Issues](https://github.com/nimbuslab/nimbus-cli/issues)
|
|
220
|
+
- 💬 [Discussions](https://github.com/nimbuslab/nimbus-cli/discussions)
|
|
221
|
+
|
|
222
|
+
## License
|
|
129
223
|
|
|
130
|
-
|
|
131
|
-
- [create-next-app](https://github.com/nimbuslab/create-next-app)
|
|
132
|
-
- [create-turborepo](https://github.com/nimbuslab/create-turborepo)
|
|
224
|
+
MIT © [nimbuslab](https://nimbuslab.com.br)
|
|
133
225
|
|
|
134
|
-
|
|
226
|
+
---
|
|
135
227
|
|
|
136
|
-
|
|
228
|
+
**Created by nimbuslab** - Building digital products with design and technology.
|
package/dist/index.js
CHANGED
|
@@ -877,6 +877,7 @@ async function generateAIFriendlyDocs(projectPath, config) {
|
|
|
877
877
|
await generateLLMsFile(projectPath, config);
|
|
878
878
|
await generateArchitectureDoc(projectPath, config);
|
|
879
879
|
await generateExamplesDoc(projectPath, config);
|
|
880
|
+
await generateModificationsDoc(projectPath, config);
|
|
880
881
|
await createCompatibilitySymlinks(projectPath);
|
|
881
882
|
}
|
|
882
883
|
async function generateAgentsFile(projectPath, config) {
|
|
@@ -982,6 +983,14 @@ import type { User } from '@/types'
|
|
|
982
983
|
- Use arrow functions for components
|
|
983
984
|
- Explicit return types for exported functions
|
|
984
985
|
|
|
986
|
+
## Project Inventory
|
|
987
|
+
|
|
988
|
+
${generateProjectInventory(config)}
|
|
989
|
+
|
|
990
|
+
## Feature Dependencies
|
|
991
|
+
|
|
992
|
+
${generateFeatureDependencies(config)}
|
|
993
|
+
|
|
985
994
|
## Common Tasks
|
|
986
995
|
|
|
987
996
|
### Add a new section
|
|
@@ -1094,6 +1103,7 @@ async function generateLLMsFile(projectPath, config) {
|
|
|
1094
1103
|
- [Project Overview](./AGENTS.md)
|
|
1095
1104
|
- [Architecture](./ARCHITECTURE.md)
|
|
1096
1105
|
- [Examples](./EXAMPLES.md)
|
|
1106
|
+
- [How to Modify](./MODIFICATIONS.md)
|
|
1097
1107
|
- [Contributing](./CONTRIBUTING.md)
|
|
1098
1108
|
|
|
1099
1109
|
## Quick Context
|
|
@@ -1160,7 +1170,20 @@ async function generateArchitectureDoc(projectPath, config) {
|
|
|
1160
1170
|
- Smaller bundle size
|
|
1161
1171
|
- Familiar DX
|
|
1162
1172
|
|
|
1163
|
-
${config.
|
|
1173
|
+
### 3. ${config.stack.components}
|
|
1174
|
+
|
|
1175
|
+
**Why:**
|
|
1176
|
+
- Copy-paste workflow (no lock-in)
|
|
1177
|
+
- Full control over components
|
|
1178
|
+
- Customizable without ejecting
|
|
1179
|
+
- Built on Radix UI (accessibility)
|
|
1180
|
+
|
|
1181
|
+
**Trade-offs:**
|
|
1182
|
+
- Manual updates (not auto-updated via npm)
|
|
1183
|
+
- More files in your repo
|
|
1184
|
+
- Worth it for flexibility
|
|
1185
|
+
|
|
1186
|
+
${config.type === "landing" ? `### 4. Landing Page Structure
|
|
1164
1187
|
|
|
1165
1188
|
\`\`\`
|
|
1166
1189
|
Hero
|
|
@@ -1178,7 +1201,17 @@ CTA
|
|
|
1178
1201
|
Footer
|
|
1179
1202
|
\`\`\`
|
|
1180
1203
|
|
|
1181
|
-
|
|
1204
|
+
**Why this order:**
|
|
1205
|
+
- Hero grabs attention first
|
|
1206
|
+
- Features build interest
|
|
1207
|
+
- FAQ reduces friction
|
|
1208
|
+
- CTA when ready to convert
|
|
1209
|
+
|
|
1210
|
+
` : ""}## This Project's Specific Decisions
|
|
1211
|
+
|
|
1212
|
+
${generateProjectDecisions(config)}
|
|
1213
|
+
|
|
1214
|
+
## Data Flow
|
|
1182
1215
|
|
|
1183
1216
|
\`\`\`
|
|
1184
1217
|
User Action
|
|
@@ -1327,6 +1360,348 @@ export const env = envSchema.parse(process.env)
|
|
|
1327
1360
|
`;
|
|
1328
1361
|
await Bun.write(join(projectPath, "EXAMPLES.md"), content);
|
|
1329
1362
|
}
|
|
1363
|
+
function generateProjectDecisions(config) {
|
|
1364
|
+
let decisions = "";
|
|
1365
|
+
if (config.stack.email) {
|
|
1366
|
+
decisions += `### Email Provider: ${config.stack.email}
|
|
1367
|
+
|
|
1368
|
+
**Why chosen:**
|
|
1369
|
+
- 3,000 emails/month free tier
|
|
1370
|
+
- React Email support (type-safe templates)
|
|
1371
|
+
- Simple API, great DX
|
|
1372
|
+
|
|
1373
|
+
**Alternatives considered:**
|
|
1374
|
+
- SendGrid: More complex, steeper pricing
|
|
1375
|
+
- Postmark: Great but no free tier
|
|
1376
|
+
- AWS SES: Requires more setup
|
|
1377
|
+
|
|
1378
|
+
**If you need to change:**
|
|
1379
|
+
1. Update \`lib/email.ts\` client
|
|
1380
|
+
2. Update env vars (\`.env\`)
|
|
1381
|
+
3. Update API route implementation
|
|
1382
|
+
|
|
1383
|
+
`;
|
|
1384
|
+
}
|
|
1385
|
+
if (config.stack.forms) {
|
|
1386
|
+
decisions += `### Form Library: ${config.stack.forms}
|
|
1387
|
+
|
|
1388
|
+
**Why chosen:**
|
|
1389
|
+
- Better performance than Formik
|
|
1390
|
+
- Smaller bundle size
|
|
1391
|
+
- Native TypeScript support
|
|
1392
|
+
- Works great with Zod
|
|
1393
|
+
|
|
1394
|
+
**Trade-off:**
|
|
1395
|
+
- More verbose than simple useState
|
|
1396
|
+
- Worth it for complex forms with validation
|
|
1397
|
+
|
|
1398
|
+
**If you need simpler forms:**
|
|
1399
|
+
- Use plain \`<form>\` + \`useState\`
|
|
1400
|
+
- Good for 1-2 field forms
|
|
1401
|
+
|
|
1402
|
+
`;
|
|
1403
|
+
}
|
|
1404
|
+
if (config.features.contactForm) {
|
|
1405
|
+
decisions += `### Contact Form Implementation
|
|
1406
|
+
|
|
1407
|
+
**Current setup:**
|
|
1408
|
+
- Client-side validation (instant feedback)
|
|
1409
|
+
- Server-side validation (security)
|
|
1410
|
+
- Rate limiting (spam prevention)
|
|
1411
|
+
|
|
1412
|
+
**Why both validations:**
|
|
1413
|
+
- Client: Better UX (immediate feedback)
|
|
1414
|
+
- Server: Security (never trust client)
|
|
1415
|
+
|
|
1416
|
+
`;
|
|
1417
|
+
}
|
|
1418
|
+
if (!decisions) {
|
|
1419
|
+
decisions = `No specific architectural decisions documented yet. As you make choices, document them here.
|
|
1420
|
+
`;
|
|
1421
|
+
}
|
|
1422
|
+
return decisions;
|
|
1423
|
+
}
|
|
1424
|
+
function generateProjectInventory(config) {
|
|
1425
|
+
let inventory = `**Implemented Components:**
|
|
1426
|
+
`;
|
|
1427
|
+
if (config.type === "landing") {
|
|
1428
|
+
inventory += `- Hero (\`components/sections/hero.tsx\`) - Main value proposition and CTA
|
|
1429
|
+
- Features (\`components/sections/features.tsx\`) - Product features grid
|
|
1430
|
+
- FAQ (\`components/sections/faq.tsx\`) - Frequently asked questions
|
|
1431
|
+
`;
|
|
1432
|
+
if (config.features.contactForm) {
|
|
1433
|
+
inventory += `- Contact Form (\`components/forms/contact-form.tsx\`) - Email contact with validation
|
|
1434
|
+
`;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
if (config.type === "app") {
|
|
1438
|
+
inventory += `- Dashboard Layout (\`components/dashboard/layout.tsx\`) - Main app layout
|
|
1439
|
+
- Auth Forms (\`components/auth/\`) - Login/signup components
|
|
1440
|
+
`;
|
|
1441
|
+
}
|
|
1442
|
+
inventory += `
|
|
1443
|
+
**API Routes:**
|
|
1444
|
+
`;
|
|
1445
|
+
if (config.features.contactForm) {
|
|
1446
|
+
inventory += `- \`/api/contact\` - Form submission handler (rate-limited, ${config.stack.email || "email"} integration)
|
|
1447
|
+
`;
|
|
1448
|
+
}
|
|
1449
|
+
if (config.features.auth) {
|
|
1450
|
+
inventory += `- \`/api/auth/[...nextauth]\` - Authentication endpoints
|
|
1451
|
+
`;
|
|
1452
|
+
}
|
|
1453
|
+
if (!config.features.contactForm && !config.features.auth) {
|
|
1454
|
+
inventory += `- None yet (add API routes in \`app/api/\`)
|
|
1455
|
+
`;
|
|
1456
|
+
}
|
|
1457
|
+
inventory += `
|
|
1458
|
+
**Utilities:**
|
|
1459
|
+
`;
|
|
1460
|
+
if (config.stack.email) {
|
|
1461
|
+
inventory += `- \`lib/email.ts\` - ${config.stack.email} client configuration
|
|
1462
|
+
`;
|
|
1463
|
+
}
|
|
1464
|
+
if (config.features.contactForm) {
|
|
1465
|
+
inventory += `- \`lib/validations.ts\` - Zod schemas (contactSchema: name, email, message)
|
|
1466
|
+
`;
|
|
1467
|
+
}
|
|
1468
|
+
inventory += `- \`lib/utils.ts\` - Helper functions (cn, formatters)
|
|
1469
|
+
`;
|
|
1470
|
+
return inventory;
|
|
1471
|
+
}
|
|
1472
|
+
function generateFeatureDependencies(config) {
|
|
1473
|
+
let deps = "";
|
|
1474
|
+
if (config.features.contactForm) {
|
|
1475
|
+
deps += `**Contact Form** depends on:
|
|
1476
|
+
\`\`\`
|
|
1477
|
+
\u251C\u2500 React Hook Form (form state management)
|
|
1478
|
+
\u251C\u2500 Zod (validation schemas)
|
|
1479
|
+
${config.stack.email ? `\u251C\u2500 ${config.stack.email} (email sending)
|
|
1480
|
+
` : ""}\u2514\u2500 /api/contact (server endpoint)
|
|
1481
|
+
\`\`\`
|
|
1482
|
+
|
|
1483
|
+
**To modify contact form:**
|
|
1484
|
+
1. Update validation: \`lib/validations.ts\` (contactSchema)
|
|
1485
|
+
2. Update UI: \`components/forms/contact-form.tsx\`
|
|
1486
|
+
3. Update API: \`app/api/contact/route.ts\`
|
|
1487
|
+
4. Update email template: \`emails/contact-email.tsx\` (if exists)
|
|
1488
|
+
|
|
1489
|
+
`;
|
|
1490
|
+
}
|
|
1491
|
+
if (config.features.auth) {
|
|
1492
|
+
deps += `**Authentication** depends on:
|
|
1493
|
+
\`\`\`
|
|
1494
|
+
\u251C\u2500 ${config.stack.auth} (auth provider)
|
|
1495
|
+
\u251C\u2500 Database (user storage)
|
|
1496
|
+
\u2514\u2500 /api/auth/[...nextauth] (auth endpoints)
|
|
1497
|
+
\`\`\`
|
|
1498
|
+
|
|
1499
|
+
**To modify auth:**
|
|
1500
|
+
1. Update config: \`lib/auth.ts\`
|
|
1501
|
+
2. Update providers: Add/remove in auth config
|
|
1502
|
+
3. Update callbacks: Customize JWT/session
|
|
1503
|
+
|
|
1504
|
+
`;
|
|
1505
|
+
}
|
|
1506
|
+
if (!deps) {
|
|
1507
|
+
deps = `No complex feature dependencies yet. Add features and their dependency maps will appear here.
|
|
1508
|
+
`;
|
|
1509
|
+
}
|
|
1510
|
+
return deps;
|
|
1511
|
+
}
|
|
1512
|
+
async function generateModificationsDoc(projectPath, config) {
|
|
1513
|
+
let content = `# Modification Guide
|
|
1514
|
+
|
|
1515
|
+
This file shows you exactly how to modify existing features in this project.
|
|
1516
|
+
|
|
1517
|
+
> **Context-aware:** These are the actual files in YOUR project, not generic examples.
|
|
1518
|
+
|
|
1519
|
+
`;
|
|
1520
|
+
if (config.type === "landing") {
|
|
1521
|
+
content += `## Landing Page Sections
|
|
1522
|
+
|
|
1523
|
+
### Change Hero Text
|
|
1524
|
+
|
|
1525
|
+
**File:** \`components/sections/hero.tsx\`
|
|
1526
|
+
**What to edit:** Lines with \`<h1>\` and \`<p>\` tags
|
|
1527
|
+
**Current pattern:** Value proposition + subheading + CTA
|
|
1528
|
+
**Example change:**
|
|
1529
|
+
\`\`\`tsx
|
|
1530
|
+
<h1 className="text-4xl font-bold">
|
|
1531
|
+
Your New Headline Here
|
|
1532
|
+
</h1>
|
|
1533
|
+
<p className="text-xl text-muted-foreground">
|
|
1534
|
+
Your new subheading
|
|
1535
|
+
</p>
|
|
1536
|
+
\`\`\`
|
|
1537
|
+
|
|
1538
|
+
### Add/Remove Feature Cards
|
|
1539
|
+
|
|
1540
|
+
**File:** \`components/sections/features.tsx\`
|
|
1541
|
+
**What to edit:** \`features\` array (usually lines 10-25)
|
|
1542
|
+
**Current:** 3 feature cards
|
|
1543
|
+
**To add:** Push new object to array: \`{ icon: Icon, title: "", description: "" }\`
|
|
1544
|
+
**To remove:** Delete object from array or filter it out
|
|
1545
|
+
|
|
1546
|
+
### Modify FAQ Questions
|
|
1547
|
+
|
|
1548
|
+
**File:** \`components/sections/faq.tsx\`
|
|
1549
|
+
**What to edit:** \`questions\` array
|
|
1550
|
+
**Current:** Pre-populated with common questions
|
|
1551
|
+
**Pattern:** Keep answers concise (< 100 chars) for better UX
|
|
1552
|
+
**To add:** \`{ question: "...", answer: "..." }\`
|
|
1553
|
+
|
|
1554
|
+
`;
|
|
1555
|
+
}
|
|
1556
|
+
if (config.features.contactForm) {
|
|
1557
|
+
content += `## Contact Form
|
|
1558
|
+
|
|
1559
|
+
### Change Form Fields
|
|
1560
|
+
|
|
1561
|
+
**Files to modify:**
|
|
1562
|
+
1. \`lib/validations.ts\` - Add field to schema
|
|
1563
|
+
2. \`components/forms/contact-form.tsx\` - Add UI input
|
|
1564
|
+
3. \`app/api/contact/route.ts\` - Handle new field
|
|
1565
|
+
|
|
1566
|
+
**Example: Add phone field**
|
|
1567
|
+
\`\`\`typescript
|
|
1568
|
+
// 1. lib/validations.ts
|
|
1569
|
+
export const contactSchema = z.object({
|
|
1570
|
+
name: z.string().min(2),
|
|
1571
|
+
email: z.string().email(),
|
|
1572
|
+
phone: z.string().min(10), // NEW
|
|
1573
|
+
message: z.string().min(10),
|
|
1574
|
+
})
|
|
1575
|
+
|
|
1576
|
+
// 2. components/forms/contact-form.tsx
|
|
1577
|
+
<FormField
|
|
1578
|
+
name="phone"
|
|
1579
|
+
control={form.control}
|
|
1580
|
+
render={({ field }) => (
|
|
1581
|
+
<Input placeholder="Phone" {...field} />
|
|
1582
|
+
)}
|
|
1583
|
+
/>
|
|
1584
|
+
|
|
1585
|
+
// 3. app/api/contact/route.ts
|
|
1586
|
+
// Phone is now available in validated data
|
|
1587
|
+
const { name, email, phone, message } = validated.data
|
|
1588
|
+
\`\`\`
|
|
1589
|
+
|
|
1590
|
+
### Change Email Template
|
|
1591
|
+
|
|
1592
|
+
**File:** \`emails/contact-email.tsx\` (if using React Email)
|
|
1593
|
+
**Alternative:** Inline in \`app/api/contact/route.ts\`
|
|
1594
|
+
**What to edit:** Subject, body content, styling
|
|
1595
|
+
**Test locally:** \`bun run email:dev\` (if available)
|
|
1596
|
+
|
|
1597
|
+
### Change Email Recipient
|
|
1598
|
+
|
|
1599
|
+
**File:** \`app/api/contact/route.ts\`
|
|
1600
|
+
**What to edit:** The \`to:\` field in email send
|
|
1601
|
+
\`\`\`typescript
|
|
1602
|
+
await resend.emails.send({
|
|
1603
|
+
to: 'your-new-email@example.com', // CHANGE THIS
|
|
1604
|
+
// ...
|
|
1605
|
+
})
|
|
1606
|
+
\`\`\`
|
|
1607
|
+
|
|
1608
|
+
`;
|
|
1609
|
+
}
|
|
1610
|
+
content += `## Styling Changes
|
|
1611
|
+
|
|
1612
|
+
### Update Colors
|
|
1613
|
+
|
|
1614
|
+
**File:** \`app/globals.css\`
|
|
1615
|
+
**What to edit:** CSS variables in \`:root\` and \`.dark\`
|
|
1616
|
+
\`\`\`css
|
|
1617
|
+
:root {
|
|
1618
|
+
--primary: 220 90% 56%; /* Change this */
|
|
1619
|
+
}
|
|
1620
|
+
\`\`\`
|
|
1621
|
+
**Tip:** Use [shadcn theme editor](https://ui.shadcn.com/themes) to generate new colors
|
|
1622
|
+
|
|
1623
|
+
### Change Fonts
|
|
1624
|
+
|
|
1625
|
+
**File:** \`app/layout.tsx\`
|
|
1626
|
+
**What to edit:** Font imports and \`className\` on \`<body>\`
|
|
1627
|
+
\`\`\`tsx
|
|
1628
|
+
import { Inter } from 'next/font/google'
|
|
1629
|
+
|
|
1630
|
+
const font = Inter({ subsets: ['latin'] })
|
|
1631
|
+
|
|
1632
|
+
<body className={font.className}>
|
|
1633
|
+
\`\`\`
|
|
1634
|
+
|
|
1635
|
+
## Adding New Features
|
|
1636
|
+
|
|
1637
|
+
### Add a New Page
|
|
1638
|
+
|
|
1639
|
+
\`\`\`bash
|
|
1640
|
+
# 1. Create route
|
|
1641
|
+
touch app/about/page.tsx
|
|
1642
|
+
|
|
1643
|
+
# 2. Add navigation link
|
|
1644
|
+
# Edit: components/layout/header.tsx or footer.tsx
|
|
1645
|
+
\`\`\`
|
|
1646
|
+
|
|
1647
|
+
### Add shadcn/ui Component
|
|
1648
|
+
|
|
1649
|
+
\`\`\`bash
|
|
1650
|
+
bunx --bun shadcn@latest add [component-name]
|
|
1651
|
+
# Example: bunx --bun shadcn@latest add dialog
|
|
1652
|
+
\`\`\`
|
|
1653
|
+
|
|
1654
|
+
## Environment Variables
|
|
1655
|
+
|
|
1656
|
+
**File:** \`.env\` (create from \`.env.example\`)
|
|
1657
|
+
|
|
1658
|
+
${config.stack.email ? `### ${config.stack.email} API Key
|
|
1659
|
+
\`\`\`env
|
|
1660
|
+
RESEND_API_KEY=re_xxxxxxxxxxxx
|
|
1661
|
+
\`\`\`
|
|
1662
|
+
**Get key:** [${config.stack.email} Dashboard](https://resend.com/api-keys)
|
|
1663
|
+
|
|
1664
|
+
` : ""}${config.features.analytics ? `### Google Analytics
|
|
1665
|
+
\`\`\`env
|
|
1666
|
+
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
|
|
1667
|
+
\`\`\`
|
|
1668
|
+
**Get ID:** [Google Analytics](https://analytics.google.com)
|
|
1669
|
+
|
|
1670
|
+
` : ""}## Common Modifications
|
|
1671
|
+
|
|
1672
|
+
### Change Site Metadata (SEO)
|
|
1673
|
+
|
|
1674
|
+
**File:** \`app/layout.tsx\`
|
|
1675
|
+
**What to edit:** \`metadata\` export
|
|
1676
|
+
\`\`\`tsx
|
|
1677
|
+
export const metadata = {
|
|
1678
|
+
title: 'Your New Title',
|
|
1679
|
+
description: 'Your new description',
|
|
1680
|
+
// ...
|
|
1681
|
+
}
|
|
1682
|
+
\`\`\`
|
|
1683
|
+
|
|
1684
|
+
### Add Custom Font from File
|
|
1685
|
+
|
|
1686
|
+
\`\`\`tsx
|
|
1687
|
+
// app/layout.tsx
|
|
1688
|
+
import localFont from 'next/font/local'
|
|
1689
|
+
|
|
1690
|
+
const customFont = localFont({
|
|
1691
|
+
src: './fonts/CustomFont.woff2',
|
|
1692
|
+
variable: '--font-custom',
|
|
1693
|
+
})
|
|
1694
|
+
\`\`\`
|
|
1695
|
+
|
|
1696
|
+
---
|
|
1697
|
+
|
|
1698
|
+
**Pro tip:** Before modifying, search the codebase for the text/component you want to change:
|
|
1699
|
+
\`\`\`bash
|
|
1700
|
+
grep -r "text to find" .
|
|
1701
|
+
\`\`\`
|
|
1702
|
+
`;
|
|
1703
|
+
await Bun.write(join(projectPath, "MODIFICATIONS.md"), content);
|
|
1704
|
+
}
|
|
1330
1705
|
async function createCompatibilitySymlinks(projectPath) {
|
|
1331
1706
|
const agentsContent = await Bun.file(join(projectPath, "AGENTS.md")).text();
|
|
1332
1707
|
await Bun.write(join(projectPath, ".cursorrules"), agentsContent);
|
|
@@ -3965,7 +4340,7 @@ async function setupNode(args) {
|
|
|
3965
4340
|
|
|
3966
4341
|
// src/index.ts
|
|
3967
4342
|
var PACKAGE_NAME2 = "@nimbuslab/cli";
|
|
3968
|
-
var CURRENT_VERSION = "1.
|
|
4343
|
+
var CURRENT_VERSION = "1.2.0";
|
|
3969
4344
|
var LOGO = `
|
|
3970
4345
|
\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
3971
4346
|
\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbuslab/cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Modern Next.js project generator with AI-friendly documentation and best practices built-in",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nimbus": "./dist/index.js"
|