Problem statement
Next.js is the most widely used React framework. Starting a Next.js project with a clean structure, proper TypeScript config, and a chosen architecture pattern requires significant manual setup.
Proposed solution
Implement NextJSGenerator in generators/typescript/nextjs.go.
Name(): "ts-nextjs"
Language(): "typescript"
Modules(): ["nextjs"]
Apply() generates:
package.json, tsconfig.json, next.config.ts
- App Router structure (
app/layout.tsx, app/page.tsx, app/loading.tsx)
public/ directory
- File structure under
src/ varies by spec.Config.FrontendArchitecture
Router choice (App Router vs Pages Router) asked at dot init.
Commands: new page <name>, new component <name>, new api-route <name>
Alternatives considered
Use create-next-app under the hood. Rejected — same reason as other generators.
Area
Core
Additional context
Uses static composition with TypeScript frontend architecture generators based on spec.Config.FrontendArchitecture. Depends on: TypeScript architecture generators.
Problem statement
Next.js is the most widely used React framework. Starting a Next.js project with a clean structure, proper TypeScript config, and a chosen architecture pattern requires significant manual setup.
Proposed solution
Implement
NextJSGeneratoringenerators/typescript/nextjs.go.Name():"ts-nextjs"Language():"typescript"Modules():["nextjs"]Apply()generates:package.json,tsconfig.json,next.config.tsapp/layout.tsx,app/page.tsx,app/loading.tsx)public/directorysrc/varies byspec.Config.FrontendArchitectureRouter choice (App Router vs Pages Router) asked at
dot init.Commands:
new page <name>,new component <name>,new api-route <name>Alternatives considered
Use
create-next-appunder the hood. Rejected — same reason as other generators.Area
Core
Additional context
Uses static composition with TypeScript frontend architecture generators based on
spec.Config.FrontendArchitecture. Depends on: TypeScript architecture generators.