chore(dev): one-command local WordPress, and stop the unbuilt-block notice #3
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/local-dev-env"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Takes a fresh clone to a working local WordPress with the plugin active and demo pages rendering live relay data, in one command. laoc_buzz asked for something he can click around in.
Verified clean-room: run from a git worktree with no
docker-data/at all, not against an already-working environment.Four things were in the way
1. The composer targets pointed at a path that never existed.
composer:,composer-shared:andinstall:all usedwp-content/plugins/wp-nostr/amb-nostr, butdocker-compose.ymlmounts each module directly atwp-content/plugins/<module>. There is nowp-nostrparent. Replaced with a host-sidevendor:target: thewordpress:6.8-php8.4-apacheimage has neither composer norext-gmp, andswentel/nostr-phprequires gmp. nix supplies both.2. Nothing waited for MariaDB.
docker compose up -dreturns while the database is still initialising, so the firstwpcall fails with "Error establishing a database connection" — which reads like a misconfiguration rather than a race, and sends you debugging the wrong thing.up:now polls until the DB answers a query.3. A fresh install has plain permalinks, so
/amb-demo404s. Now sets/%postname%/and flushes. The plugin's planned archive routes need rewrite rules regardless.4. Blocks registered from an unbuilt directory — a real plugin bug.
build/is a compiled artifact and gitignored, so a fresh checkout has noblock.jsonthere.register_block_type()then falls back to treating the path string as a block name, and WordPress emitson every page load. Both blocks now check for the built
block.jsonand return quietly if it is absent. The shortcodes never needed the build; only the editor blocks do, viamake build.Safety
install-wpdeliberately does not activatenostr-publish— it can sign and publish events to a live relay, and this environment is for reading. Everything here only issuesREQ/COUNT.Evidence
After
make devon an empty tree:Filter honoured through the full WordPress stack, with the bogus-value control that makes the number mean something:
ExtendedFilterexercised inside the container on the real runtime (PHP 8.4, nostr-php 1.9.4), not just on the host:Suites, unchanged by the block guard:
Known and out of scope here
The
ext:facet filters are not reachable from the shortcode UI —[amb_nostr]accepts onlyt,authors,limit, andSearchEndpointstill has the hardcoded four-facetFILTER_FIELD_MAP. That is the §3.1 gap in the architecture doc and the next build task (ExtTagParser→FacetDiscovery→ArchiveRoute), not a regression.`make dev` now takes a fresh clone to a working WordPress with the plugin active and demo pages rendering live relay data. Verified clean-room: from a worktree with no docker-data/ at all. Four things were in the way. **The composer targets pointed at a path the compose file never creates.** `composer:`, `composer-shared:` and `install:` all used `wp-content/plugins/wp-nostr/amb-nostr`, but docker-compose.yml mounts each module directly at `wp-content/plugins/<module>`. They could not have worked. Replaced with a host-side `vendor:` target — the wordpress image has neither composer nor ext-gmp, which swentel/nostr-php requires, and nix supplies both. **Nothing waited for the database.** `docker compose up -d` returns while mariadb is still initialising, so the first `wp` call failed with "Error establishing a database connection" — which reads like a misconfiguration rather than a race. `up:` now polls until the DB accepts a query. **A fresh install has plain permalinks**, so /amb-demo 404'd. Set `/%postname%/` and flush; the plugin's future archive routes need rewrite rules regardless. **Blocks registered from an unbuilt directory.** `build/` is a compiled artifact and gitignored, so a fresh checkout has no block.json there. `register_block_type()` then falls back to treating the path string as a block name, and WordPress emits "Block type names must contain a namespace prefix" on *every page load*. Both blocks now check for the built block.json first and return quietly if it is absent. The shortcodes never needed the build; only the editor block does, via `make build`. nostr-publish is deliberately left deactivated by `install-wp`: it can sign and publish events to a live relay, and the local environment is for reading. Verified end to end after `make dev` on an empty tree: http://localhost:8080/amb-demo 200, 10 live kind-30142 resources http://localhost:8080/amb-search 200, search form renders "namespace prefix" notices 0 (was on every page load) make seed, run twice idempotent shared 15/15 longform 5/5 calendar 17/17 publish 14/14 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>