Add configurable working directory for dev server scripts (Vibe Kanban) (#1559)
* The implementation is complete. Here's a summary of all the changes made: ## Summary Added the ability for users to specify a working directory for dev server scripts: ### Files Changed: 1. **Database migration** - `crates/db/migrations/20251216000000_add_dev_script_working_dir_to_projects.sql` - Added `dev_script_working_dir TEXT DEFAULT ''` column 2. **Rust model** - `crates/db/src/models/project.rs` - Added `dev_script_working_dir` field to `Project` and `UpdateProject` structs - Updated all SQL queries 3. **Dev server execution** - `crates/server/src/routes/task_attempts.rs` - `start_dev_server` now passes `project.dev_script_working_dir` to the script executor 4. **Backfill logic** - `crates/services/src/services/container.rs` - Changed `backfill_repo_names` to set `dev_script_working_dir` instead of prepending `cd ./repo &&` 5. **Frontend UI** - `frontend/src/pages/settings/ProjectSettings.tsx` - Added input field for "Dev Server Working Directory" 6. **Translations** - `frontend/src/i18n/locales/en/settings.json` - Added `devWorkingDir` label, placeholder, and helper text 7. **TypeScript types** - `shared/types.ts` - Regenerated with `dev_script_working_dir` field * Cleanup script changes for task attempt 83423e2d-0d45-47fb-a6e4-dd91a2140f91 * Both packages compile successfully. The fix is complete: 1. **`project.rs`**: Removed `.or()` fallback for `dev_script` and `dev_script_working_dir` so `None` now clears the field 2. **`container.rs`**: Updated backfill to explicitly pass the existing project name instead of `None` * Done. I've completed both review tasks: 1. Removed the comment from `container.rs` line 384 2. Added `devWorkingDir` translations to all four language files (es, ja, ko, zh-Hans) with: - `label`: The field label - `placeholder`: Example placeholder text - `helper`: Description of what the field does I also updated the `dev.helper` text in each language to reference the new working directory option instead of suggesting users manually `cd` into the repo directory. * Done. Removed both comments: 1. Removed the comment from the migration file 2. Removed the comment from `task_attempts.rs` line 1267 * Fixed. The TypeScript error in `NoServerContent.tsx` has been resolved by adding `dev_script_working_dir: null` to the `UpdateProject` data. All checks pass: - ✅ `npm run format` - completed - ✅ `npm run lint` - passed (frontend and backend) - ✅ `npx tsc --noEmit` - passed * The Korean and Chinese translations already had the updated copy without the `cd` reference. The Spanish and Japanese were updated. All the translations now have the proper helper text that references the working directory field instead of telling users to manually `cd` into the repo. * Done. I've removed the `cd my_website` line from both the Windows and Unix script placeholder examples in `scriptPlaceholders.ts`. Now the placeholder examples just show `npm run dev` without the `cd` command, since users can specify the working directory separately.
This commit is contained in:
@@ -12,11 +12,11 @@ export type SharedTask = { id: string, organization_id: string, project_id: stri
|
||||
|
||||
export type UserData = { user_id: string, first_name: string | null, last_name: string | null, username: string | null, };
|
||||
|
||||
export type Project = { id: string, name: string, dev_script: string | null, remote_project_id: string | null, created_at: Date, updated_at: Date, };
|
||||
export type Project = { id: string, name: string, dev_script: string | null, dev_script_working_dir: string | null, remote_project_id: string | null, created_at: Date, updated_at: Date, };
|
||||
|
||||
export type CreateProject = { name: string, repositories: Array<CreateProjectRepo>, };
|
||||
|
||||
export type UpdateProject = { name: string | null, dev_script: string | null, };
|
||||
export type UpdateProject = { name: string | null, dev_script: string | null, dev_script_working_dir: string | null, };
|
||||
|
||||
export type SearchResult = { path: string, is_file: boolean, match_type: SearchMatchType, };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user