@@ -16,7 +16,7 @@ def detect_template(app_dir: Path) -> str:
1616 app_dir: Path to the application directory
1717
1818 Returns:
19- Template type: "dbx-sdk", "trpc", or "unknown"
19+ Template type: "dbx-sdk", "trpc", "vite", or "unknown"
2020 """
2121 # DBX SDK markers (new template)
2222 if _is_dbx_sdk_app (app_dir ):
@@ -26,6 +26,10 @@ def detect_template(app_dir: Path) -> str:
2626 if _is_trpc_app (app_dir ):
2727 return "trpc"
2828
29+ # Vite markers (simple frontend apps)
30+ if _is_vite_app (app_dir ):
31+ return "vite"
32+
2933 return "unknown"
3034
3135
@@ -87,6 +91,39 @@ def _is_trpc_app(app_dir: Path) -> bool:
8791 return score >= 2
8892
8993
94+ def _is_vite_app (app_dir : Path ) -> bool :
95+ """Check if app uses Vite template (simple frontend apps)."""
96+ score = 0
97+
98+ # Check for vite.config.ts/js
99+ if (app_dir / "vite.config.ts" ).exists () or (app_dir / "vite.config.js" ).exists ():
100+ score += 2
101+
102+ # Check for single root package.json (not monorepo)
103+ root_pkg = app_dir / "package.json"
104+ if root_pkg .exists ():
105+ try :
106+ import json
107+ pkg_content = json .loads (root_pkg .read_text ())
108+ # Check for vite in devDependencies
109+ dev_deps = pkg_content .get ("devDependencies" , {})
110+ if "vite" in dev_deps :
111+ score += 2
112+ # Check for typical Vite scripts
113+ scripts = pkg_content .get ("scripts" , {})
114+ if "dev" in scripts and "vite" in scripts .get ("dev" , "" ):
115+ score += 1
116+ except :
117+ pass
118+
119+ # Check that it's NOT a monorepo (no separate server/client package.json files)
120+ if not (app_dir / "server" / "package.json" ).exists () and not (app_dir / "client" / "package.json" ).exists ():
121+ score += 1
122+
123+ # Need at least 2 indicators
124+ return score >= 2
125+
126+
90127def get_template_info (template : str ) -> dict :
91128 """
92129 Get template-specific configuration.
@@ -115,6 +152,15 @@ def get_template_info(template: str) -> dict:
115152 "api_pattern" : "/api/trpc/{procedure}" ,
116153 "sql_location" : "inline" , # SQL embedded in TypeScript
117154 }
155+ elif template == "vite" :
156+ return {
157+ "backend_dirs" : [], # Frontend-only
158+ "frontend_dirs" : ["src" ],
159+ "entry_points" : ["src/main.tsx" , "src/main.ts" , "src/index.tsx" , "src/index.ts" ],
160+ "package_json_location" : "root" ,
161+ "api_pattern" : "none" , # No backend
162+ "sql_location" : "none" , # No SQL
163+ }
118164 else :
119165 # Fallback: try all common patterns
120166 return {
0 commit comments