* 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.
57 lines
1.6 KiB
JSON
57 lines
1.6 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "INSERT INTO projects (\n id,\n name\n ) VALUES (\n $1, $2\n )\n RETURNING id as \"id!: Uuid\",\n name,\n dev_script,\n dev_script_working_dir,\n remote_project_id as \"remote_project_id: Uuid\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "id!: Uuid",
|
|
"ordinal": 0,
|
|
"type_info": "Blob"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"ordinal": 1,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "dev_script",
|
|
"ordinal": 2,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "dev_script_working_dir",
|
|
"ordinal": 3,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "remote_project_id: Uuid",
|
|
"ordinal": 4,
|
|
"type_info": "Blob"
|
|
},
|
|
{
|
|
"name": "created_at!: DateTime<Utc>",
|
|
"ordinal": 5,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "updated_at!: DateTime<Utc>",
|
|
"ordinal": 6,
|
|
"type_info": "Text"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 2
|
|
},
|
|
"nullable": [
|
|
true,
|
|
false,
|
|
true,
|
|
false,
|
|
true,
|
|
false,
|
|
false
|
|
]
|
|
},
|
|
"hash": "85fd1ae6ff6ab171c0ca452709697e659e75def14212c7cf69fd80bb85b0f7db"
|
|
}
|