Skip to content

Commit 67a45bc

Browse files
doble196claude
andcommitted
fix(cli): restrict React+Vite to frontend-only projects + improve device auth UX
- Fullstack mode now only offers Next.js (no React+Vite template exists) - Add warning message when browser device auth fails - Update project type hints to clarify framework availability Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 807f2ba commit 67a45bc

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

src/prompts/framework.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ export interface FrameworkAnswers {
77
packageManager: PackageManager;
88
}
99

10-
export async function promptFramework(typescriptOverride?: boolean): Promise<FrameworkAnswers> {
10+
export async function promptFramework(typescriptOverride?: boolean, isFullstack?: boolean): Promise<FrameworkAnswers> {
1111
const packageManager = detectPackageManager();
1212

13+
// React+Vite only available for frontend-only projects (no fullstack template exists)
14+
const frameworkOptions = isFullstack
15+
? [{ value: 'nextjs', label: 'Next.js 16', hint: 'App Router · SSR · middleware auth' }]
16+
: [
17+
{ value: 'nextjs', label: 'Next.js 16', hint: 'App Router · SSR · middleware auth' },
18+
{ value: 'react-vite', label: 'React 19 + Vite 7', hint: 'SPA · client-side routing' },
19+
];
20+
1321
const answers = await p.group(
1422
{
1523
framework: () =>
1624
p.select({
1725
message: 'Framework',
18-
options: [
19-
{ value: 'nextjs', label: 'Next.js 16', hint: 'App Router · SSR · middleware auth' },
20-
{ value: 'react-vite', label: 'React 19 + Vite 7', hint: 'SPA · client-side routing' },
21-
],
26+
options: frameworkOptions,
2227
}),
2328
typescript: () =>
2429
typescriptOverride !== undefined

src/prompts/githat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ export async function promptGitHat(existingKey?: string): Promise<GitHatAnswers>
147147
const key = await deviceAuthFlow();
148148
if (key) {
149149
publishableKey = key;
150+
} else {
151+
p.log.warn('Authorization failed. Continuing without key...');
150152
}
151-
// If browser auth failed, continue without key (same as skip)
152153
} else if (connectChoice === 'paste') {
153154
const pastedKey = await p.text({
154155
message: 'Publishable key',

src/prompts/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ export async function runPrompts(args: {
7777
const projectType = await promptProjectType();
7878

7979
sectionHeader('Stack');
80-
const framework = await promptFramework(args.typescript);
80+
const isFullstack = projectType.projectType === 'fullstack';
81+
const framework = await promptFramework(args.typescript, isFullstack);
8182

8283
// Only prompt for backend if fullstack
8384
let backend: Partial<BackendAnswers> = {};
84-
if (projectType.projectType === 'fullstack') {
85+
if (isFullstack) {
8586
backend = await promptBackend();
8687
}
8788

src/prompts/project-type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export async function promptProjectType(): Promise<ProjectTypeAnswers> {
1515
{
1616
value: 'frontend',
1717
label: 'Frontend only',
18-
hint: 'Next.js with API routes',
18+
hint: 'Next.js or React+Vite',
1919
},
2020
{
2121
value: 'fullstack',
2222
label: 'Fullstack',
23-
hint: 'Next.js + separate API (Turborepo)',
23+
hint: 'Next.js + API (Turborepo)',
2424
},
2525
],
2626
}),

0 commit comments

Comments
 (0)