-
Notifications
You must be signed in to change notification settings - Fork 0
Clarify Vercel production-readiness audit scope: web-app vs API/CLI #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,7 +56,8 @@ function parseArgs() { | |||||||||||||||||||||
| context: {}, | ||||||||||||||||||||||
| model: 'claude', | ||||||||||||||||||||||
| interactive: false, | ||||||||||||||||||||||
| help: false | ||||||||||||||||||||||
| help: false, | ||||||||||||||||||||||
| projectType: 'web-app' | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| for (let i = 0; i < args.length; i++) { | ||||||||||||||||||||||
|
|
@@ -99,6 +100,11 @@ function parseArgs() { | |||||||||||||||||||||
| options.model = next; | ||||||||||||||||||||||
| i++; | ||||||||||||||||||||||
| break; | ||||||||||||||||||||||
| case '--project-type': | ||||||||||||||||||||||
| case '-t': | ||||||||||||||||||||||
| options.projectType = next; | ||||||||||||||||||||||
| i++; | ||||||||||||||||||||||
| break; | ||||||||||||||||||||||
| case '--interactive': | ||||||||||||||||||||||
| case '-I': | ||||||||||||||||||||||
| options.interactive = true; | ||||||||||||||||||||||
|
|
@@ -132,6 +138,7 @@ ${colors.bright}Options:${colors.reset} | |||||||||||||||||||||
| --output, -o Output file path (default: PRD-{timestamp}.md) | ||||||||||||||||||||||
| --context, -c Additional context (JSON string or file) | ||||||||||||||||||||||
| --model, -m AI model to use (claude|gpt4|gemini, default: claude) | ||||||||||||||||||||||
| --project-type, -t Project type: web-app|api|cli (default: web-app) | ||||||||||||||||||||||
| --help, -h Show this help message | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ${colors.bright}Context JSON Format:${colors.reset} | ||||||||||||||||||||||
|
|
@@ -176,6 +183,7 @@ async function interactiveMode() { | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| console.log(`\n${colors.dim}Optional context (press Enter to skip):${colors.reset}`); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const projectTypeInput = await question(`${colors.yellow}Project type (web-app/api/cli, default: web-app):${colors.reset} `); | ||||||||||||||||||||||
| const targetAudience = await question(`${colors.yellow}Target Audience:${colors.reset} `); | ||||||||||||||||||||||
| const businessGoals = await question(`${colors.yellow}Business Goals:${colors.reset} `); | ||||||||||||||||||||||
| const technicalConstraints = await question(`${colors.yellow}Technical Constraints:${colors.reset} `); | ||||||||||||||||||||||
|
|
@@ -187,6 +195,7 @@ async function interactiveMode() { | |||||||||||||||||||||
| rl.close(); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const context = {}; | ||||||||||||||||||||||
| context.projectType = projectTypeInput || 'web-app'; | ||||||||||||||||||||||
|
Comment on lines
186
to
198
|
||||||||||||||||||||||
| if (targetAudience) context.targetAudience = targetAudience; | ||||||||||||||||||||||
| if (businessGoals) context.businessGoals = businessGoals; | ||||||||||||||||||||||
| if (technicalConstraints) context.technicalConstraints = technicalConstraints; | ||||||||||||||||||||||
|
|
@@ -200,10 +209,30 @@ async function interactiveMode() { | |||||||||||||||||||||
| }; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Generate Vercel production-readiness section based on project type | ||||||||||||||||||||||
| function generateVercelSection(projectType) { | ||||||||||||||||||||||
| const isNonWebApp = projectType === 'api' || projectType === 'cli'; | ||||||||||||||||||||||
| if (isNonWebApp) { | ||||||||||||||||||||||
| const kind = projectType === 'api' ? 'backend API' : 'CLI'; | ||||||||||||||||||||||
| return `> **N/A** \u2014 This is a ${kind} project and is not applicable for Vercel web deployment. Vercel hosts web apps (e.g., Next.js, Vite); ${projectType === 'api' ? 'API' : 'CLI'} projects should be deployed to their own appropriate runtime (e.g., Base44 serverless functions, Docker, cloud run).`; | ||||||||||||||||||||||
|
Comment on lines
+214
to
+217
|
||||||||||||||||||||||
| const isNonWebApp = projectType === 'api' || projectType === 'cli'; | |
| if (isNonWebApp) { | |
| const kind = projectType === 'api' ? 'backend API' : 'CLI'; | |
| return `> **N/A** \u2014 This is a ${kind} project and is not applicable for Vercel web deployment. Vercel hosts web apps (e.g., Next.js, Vite); ${projectType === 'api' ? 'API' : 'CLI'} projects should be deployed to their own appropriate runtime (e.g., Base44 serverless functions, Docker, cloud run).`; | |
| const normalizedType = (projectType || '').toString().trim().toLowerCase(); | |
| const isNonWebApp = normalizedType === 'api' || normalizedType === 'cli'; | |
| if (isNonWebApp) { | |
| const kind = normalizedType === 'api' ? 'backend API' : 'CLI'; | |
| const label = normalizedType === 'api' ? 'API' : 'CLI'; | |
| return `> **N/A** \u2014 This is a ${kind} project and is not applicable for Vercel web deployment. Vercel hosts web apps (e.g., Next.js, Vite); ${label} projects should be deployed to their own appropriate runtime (e.g., Base44 serverless functions, Docker, cloud run).`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing input validation for project type. The code accepts any string value for --project-type but only handles 'web-app', 'api', and 'cli'. Invalid values (e.g., 'webapp', 'backend', or typos) will silently default to showing the web-app checklist, which could be confusing.
Add validation to check if the provided value is one of the accepted values ('web-app', 'api', 'cli') and show an error message with valid options if not.