feat(screens): Next.js as a Screens app — pages, route handlers, links and redirects
- frameworks/nextjs.ts (split out of react.ts): App Router app/**/page.tsx and Pages Router pages → routes named by path ((group) stripped, [slug] → :slug, [...all] → :all*), bound to the default export; app/**/route.ts exports → METHOD /api/… endpoints referencing their functions; pages/api → ANY; resolve() claims router.push/replace/prefetch, redirect/permanentRedirect and NextResponse.redirect(new URL(…)) into navigates edges via the Expo href readers, against a Next-only route table gated on the app's root
- next-router-synthesizer.ts: <Link href> and internal <a href> → dashed navigates edges from the component (next-link, registeredAt)
- expo-router.ts: href readers exported; matcher accepts :param / :all* segments
- steps.ts: a Next page's own work fires from page load; a Next page makes the project a web app; {status: 201} read off the call site (branch-guards CallSiteText.status) for response rows
- frameworks/package-deps.ts: nested package.json files probed on disk (getAllFiles lists only sources); Express/React/Expo/Nest detectors use it; routing manifest names constant handlers
- tests: nextjs.test.ts (file→route rules, extract, verbs, end to end with Screens and Steps); frameworks.test.ts Next cases moved to the Next resolver
- docs: CHANGELOG, spec §3.12 frameworks paragraph, CLAUDE.md, synthesis doc, plan P4 built, playbook rows for Next / MERN / Nest channels
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REFyW9hmNrxhwN5wxRoAkC
This commit is contained in:
co-authored by
Claude Fable 5
parent
b1f40c57dd
commit
9c6bc23b21
@@ -85,6 +85,15 @@ the call at request time from the directive. Validated on `bradtraversy/proshop_
|
||||
all correct on inspection, after Express mounts + chained `router.route()` landed) and `nestjs/nest` (`sample/26-queues`,
|
||||
`sample/30-event-emitter`); test `__tests__/ui-steps-cross-tier.test.ts`.
|
||||
|
||||
## Next.js links (`src/resolution/next-router-synthesizer.ts`, 2026-08-28)
|
||||
|
||||
`<Link href="/x">`, `<Link href={`/users/${id}`}>`, `<Link href={{ pathname }}>` and an internal `<a href>` are JSX
|
||||
attributes — no reference is ever extracted for them — so this pass reads them from the source, attributes each to the
|
||||
component it is written in, matches the href against the Next page table (`frameworks/nextjs.ts`) and synthesizes a
|
||||
`navigates` edge (`synthesizedBy:'next-link'`, `href`, `navMethod: 'link' | 'a'`, `registeredAt` = the JSX site). Only files
|
||||
under a Next app's root, never test files; ≤ 24 links per component (a navigation menu is not a decision); an external `<a>`
|
||||
is nothing. The Screens view walks back from these edges exactly as from `router.push`; they draw dashed.
|
||||
|
||||
## The hole
|
||||
|
||||
```ts
|
||||
|
||||
Reference in New Issue
Block a user