Fix WordPress scaffolding gap; add delete project + WP admin link

Found via real usage: creating a WordPress project only produced
wp-content/ + the wp-config.php bridge — ddev config never downloads
WordPress core, and even with core present the site has no database
until `wp core install` runs (confirmed live: 403/302 until fixed).
The wizard's WordPress path now chains configure -> start ->
`wp core download` -> `wp core install` as separate tracked operations
(each needs its own terminal/status lifecycle, same reasoning as the
configure->start split from the original wizard work), with new site
title/admin username/password/email fields shown only for the
WordPress project type. wp-cli requires the containers running, so
"start after creating" is bypassed (always start) for this path rather
than leaving a checkbox that could produce the exact half-built state
this fixes.

Also added, per direct request:
- Delete project: `ddev delete <name> --yes` (keeps ddev's default
  database snapshot as a safety net), confirmed via window.confirm
  with copy clarifying it only removes DDEV's registration/containers/
  database, not the project's files on disk. Clears the app's selection
  on success.
- WP Admin quick-link: for running wordpress-type projects, a header
  button opening {primary_url}/wp-admin/ directly.

Verified end-to-end against a fresh throwaway project via CDP: full
configure->start->download->install chain produced a real working
site (200 on the homepage, proper login redirect on wp-admin, WP Admin
button href matches), and delete genuinely removes the project from
`ddev list` with the confirmation copy rendering correctly. Two
apparent bugs surfaced during this testing turned out to be the test
script reading DOM state before React's re-render or before ddev's
multi-step delete (build+start+snapshot+teardown) had actually
finished — not real defects; re-verified with proper waits.
This commit is contained in:
R3ap3R
2026-08-03 03:15:35 -05:00
parent cf8104f428
commit d1dd8ff87c
7 changed files with 277 additions and 29 deletions
+42
View File
@@ -25,4 +25,46 @@ export function registerCreateIpc(): void {
return runStreamed(operationId, args, event.sender, { cwd: directory })
}
)
// `ddev config --project-type=wordpress` only scaffolds the DDEV-managed
// wp-config.php bridge and wp-content/uploads — it doesn't download
// WordPress core (wp-admin, wp-includes, index.php, etc.), and even with
// core downloaded the site has no database tables until `wp core install`
// runs. Both require the project to be started, since wp-cli runs inside
// the web container. Kept as two separate tracked operations rather than
// one combined command so each phase's terminal:exit event correctly owns
// its own status-bar/toast lifecycle (see useCreateProject.ts).
ipcMain.handle('create:downloadWordpress', (event, operationId: string, directory: string) =>
runStreamed(operationId, ['wp', 'core', 'download'], event.sender, { cwd: directory })
)
ipcMain.handle(
'create:setupWordpress',
(
event,
operationId: string,
directory: string,
siteUrl: string,
title: string,
adminUser: string,
adminPassword: string,
adminEmail: string
) =>
runStreamed(
operationId,
[
'wp',
'core',
'install',
`--url=${siteUrl}`,
`--title=${title}`,
`--admin_user=${adminUser}`,
`--admin_password=${adminPassword}`,
`--admin_email=${adminEmail}`,
'--skip-email'
],
event.sender,
{ cwd: directory }
)
)
}
+6
View File
@@ -14,4 +14,10 @@ export function registerProjectsIpc(): void {
ipcMain.handle('projects:restart', (event, operationId: string, name: string) =>
runStreamed(operationId, ['restart', name], event.sender)
)
// Removes DDEV's project registration + containers + database (auto-
// snapshotted first, unless omitted) — does not touch the project's files
// on disk.
ipcMain.handle('projects:delete', (event, operationId: string, name: string) =>
runStreamed(operationId, ['delete', name, '--yes'], event.sender)
)
}