Skip to content

Commit 81a811c

Browse files
kadamwhiteclaude
andcommitted
docs: add handoff.md; note block/FSE test-data expansion in backlog
- handoff.md: living status doc; records the Phase 0 baseline, the deferred discover/route-parser gap, and the dev workflow. - modernization-plan.md: backlog note to add a secondary block/FSE-oriented seed in phase 5 (the classic WXR predates the block editor), kept separate from the classic dataset that guards the wp/v2 regression net. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b3a7438 commit 81a811c

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

handoff.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Modernization Handoff
2+
3+
Living status doc for the node-wpapi modernization. See `modernization-plan.md`
4+
(vision) and `modernization-execution-plan.md` (phased plan). Trunk is `main`;
5+
each phase lands via a `--no-ff` merge.
6+
7+
## Current state: Phase 0 complete (baseline green)
8+
9+
Full suite green against the local wp-env WordPress:
10+
`805 passed, 16 skipped, 0 failed` (39 suites). No library/request logic changed
11+
except one isolated modern-WP compatibility fix (see below).
12+
13+
### What Phase 0 did
14+
15+
- **Local env is the integration target.** Tests now read the endpoint from
16+
`tests/helpers/constants.js` (`WPAPI_HOST`, default `http://localhost:2747`),
17+
replacing the old hardcoded `http://wpapi.local/wp-json`.
18+
- **Deterministic seed.** `npm run env:seed` empties the site, then imports
19+
`tests/fixtures/theme-unit-test-data.xml` (the classic Theme Unit Test WXR).
20+
`.wp-env.json` now also installs the `WP-API/Basic-Auth` plugin so the
21+
authenticated tests work (modern WP core rejects plain Basic Auth).
22+
- **Refreshed expectations.** Integration assertions were updated for modern WP:
23+
chiefly the WXR "Scheduled" post is now past-dated (today is 2026) and thus
24+
published, shifting post counts/pagination; and modern WP default options
25+
differ (empty tagline, extra settings keys). Only data values changed — no
26+
test mechanic was loosened.
27+
- **Fixed:** `WPAPI.discover` read the root `_links.self` as a string; modern WP
28+
returns `[ { href } ]`. Now accepts both (`lib/bind-transport.js`).
29+
30+
### Known gap (deferred to Phase 5)
31+
32+
- **`discover` / live-route bootstrap fails on modern WP.** The route-tree regex
33+
parser (`lib/route-tree.js:83`) throws "Unterminated group" on routes whose
34+
named groups contain nested patterns, e.g. `wp/v2/templates/(?P<id>...)`.
35+
Default-mode instances are unaffected (they use the frozen
36+
`lib/data/default-routes.json`). The `discover` integration suite is
37+
`describe.skip`-ped with a `TODO(phase-5)`; its `beforeAll` `.catch()`es the
38+
rejection so it can't leak into other suites. Fix the parser in Phase 5, then
39+
un-skip and remove that `.catch()`.
40+
41+
## Dev workflow
42+
43+
```
44+
npm install
45+
npm run env:start # boot wp-env (localhost:2747)
46+
npm run env:seed # once, against a fresh env
47+
npm run test:unit # no WP needed
48+
npm run test:integration
49+
```
50+
51+
## Next: Phase 1 — modern toolchain (still JS)
52+
53+
tsdown build (dual ESM+CJS+UMD, exports map), Jest -> Vitest, ESLint 9 flat +
54+
Prettier, Node 18+ / drop IE11, GitHub Actions CI. See execution plan Phase 1.
55+
56+
Note for Phase 1/CI: integration tests currently pass both parallel and serial,
57+
but they share one DB. If CRUD suites prove flaky in CI, run integration with
58+
`--runInBand`.

modernization-plan.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,29 @@ Get to "current baseline functionality, but working with modern WP", then move o
4747
Using the `gh` CLI, look through the issues backlog and make me a report of which can be closed (dependencies, vulnerabilities, etc), which deserve human responses (there's a lot of support requests so categorize as support, feature request, etc) and evaluate which are highest-value to action.
4848

4949
NEVER UPDATE ISSUES DIRECTLY. Tell me recommendations, and I will execute.
50+
51+
## Backlog notes
52+
53+
### Expand the integration test-data set (Phase 5 sub-task, not urgent)
54+
55+
The classic Theme Unit Test WXR (`tests/fixtures/theme-unit-test-data.xml`) predates the
56+
block editor: it's all classic-markup posts/pages/comments. It exercises the `wp/v2`
57+
content endpoints (posts, pages, media, taxonomies, pagination) well — exactly what the
58+
current integration suite asserts — so it remains fit as the Phase 0 regression net.
59+
60+
It does not cover the modern surface Phase 5 targets: no block content, reusable blocks,
61+
templates/template-parts, global styles, navigation/menus, or font-family data. It won't
62+
meaningfully test the FSE/block-editor routes.
63+
64+
When Phase 5 adds those route handlers, add a **secondary** block/FSE-oriented seed
65+
(keep the classic WXR as the stable baseline; don't replace it). Options to evaluate:
66+
67+
- Gutenberg's own block-markup fixtures / E2E content (canonical block serialization).
68+
- WordPress/theme-test-data's block-based additions (check current state).
69+
- A `wp-cli` script that activates a block theme (Twenty Twenty-Four/Five) and seeds
70+
templates, template-parts, global styles, `wp_block` reusable blocks, and a nav menu.
71+
Stays maintainable and mirrors how modern WP state is actually created — recommended.
72+
- A small hand-authored block WXR committed as a second fixture.
73+
74+
Recommendation: classic WXR proves we didn't regress; a block/FSE seed (likely the
75+
wp-cli-script approach) proves the new routes work. Keep the two concerns separate.

0 commit comments

Comments
 (0)