From 749739f22113417507dd26f25bf9c25d6c75bab6 Mon Sep 17 00:00:00 2001 From: Akhileshrangani4 Date: Mon, 25 Nov 2024 16:37:33 -0500 Subject: [PATCH] chore: resolve merge conflicts with PHP template --- frontend/components/editor/navbar/run.tsx | 5 --- frontend/lib/templates/index.ts | 42 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/frontend/components/editor/navbar/run.tsx b/frontend/components/editor/navbar/run.tsx index 0e6d05c..4e95b3e 100644 --- a/frontend/components/editor/navbar/run.tsx +++ b/frontend/components/editor/navbar/run.tsx @@ -36,11 +36,6 @@ export default function RunButtonModal({ } }, [terminals, isRunning]) // commands to run in the terminal - const COMMANDS = { - streamlit: "./venv/bin/streamlit run main.py --server.runOnSave true", - php: "echo http://localhost:80 && npx vite", - default: "npm run dev", - } as const const handleRun = async () => { if (isRunning && lastCreatedTerminalRef.current) { await closeTerminal(lastCreatedTerminalRef.current) diff --git a/frontend/lib/templates/index.ts b/frontend/lib/templates/index.ts index 1b38d9e..c0db1ec 100644 --- a/frontend/lib/templates/index.ts +++ b/frontend/lib/templates/index.ts @@ -244,5 +244,47 @@ export interface TemplateConfig { "build": "vite build", "preview": "vite preview" } + }, + // PHP template config + php: { + id: "php", + name: "PHP", + runCommand: "echo http://localhost:80 && npx vite", + fileStructure: { + "index.php": { + purpose: "entry", + description: "Main PHP entry point" + }, + "package.json": { + purpose: "config", + description: "Frontend dependencies and scripts" + }, + "package-lock.json": { + purpose: "config", + description: "Locked dependency versions" + }, + "vite.config.js": { + purpose: "config", + description: "Vite configuration for frontend assets" + }, + "node_modules/": { + purpose: "dependencies", + description: "Frontend dependency files" + } + }, + conventions: [ + "Follow PSR-12 coding standards", + "Use modern PHP 8+ features", + "Organize assets with Vite", + "Keep PHP logic separate from presentation" + ], + dependencies: { + "vite": "^5.0.0" + }, + scripts: { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + } } }