[PR #477] [MERGED] feat(build): add Next.js-style route report to vinext build output #601

Closed
opened 2026-05-06 13:09:01 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/477
Author: @james-elicx
Created: 3/11/2026
Status: Merged
Merged: 3/11/2026
Merged by: @james-elicx

Base: mainHead: opencode/playful-knight


📝 Commits (8)

  • de43308 feat(build): add Next.js-style route report to vinext build output
  • ee932e2 fmt
  • 18db3d2 fix exmaple
  • 7937d4a support -v
  • 7d33a6b .
  • 8599c61 .
  • 2fbfa92 fix(build-report): address review comments
  • ef1d204 test(build-report): replace misleading classifyAppRoute tests with real fixture coverage

📊 Changes

6 files changed (+988 additions, -25 deletions)

View changed files

packages/vinext/src/build/report.ts (+372 -0)
📝 packages/vinext/src/cli.ts (+138 -25)
tests/build-report.test.ts (+456 -0)
tests/fixtures/app-basic/app/error-static-test/page.tsx (+8 -0)
tests/fixtures/app-basic/app/revalidate-infinity-test/page.tsx (+7 -0)
tests/fixtures/app-basic/app/revalidate-zero-test/page.tsx (+7 -0)

📄 Description

image

Note that more accurate analysis will be implemented through https://github.com/cloudflare/vinext/pull/274

Summary

  • Adds a build/report.ts module with regex-based route classification (○ Static, ◐ ISR, ƒ Dynamic, ? Unknown, λ API) and a Next.js-style formatted route table printed at the end of vinext build
  • Routes sort alphabetically by path (filesystem order); legend sorts alphabetically by label
  • Routes without explicit export const dynamic or export const revalidate are classified as ? Unknown rather than falsely claiming static — a note is shown when unknown routes are present explaining this will improve in a future release
  • Clean build logger suppresses Vite/Rollup noise by default; --verbose flag restores raw output
  • 55 unit tests covering all classification paths, formatting, and sorting

Notes

  • Dynamic detection (detecting headers(), cookies(), etc. via runtime analysis) is deferred — tracked as a follow-up
  • Pages Router classification is unchanged; unknown only applies to App Router routes without explicit config

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/477 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `opencode/playful-knight` --- ### 📝 Commits (8) - [`de43308`](https://github.com/cloudflare/vinext/commit/de43308a4bf4ff2c37c616eb77502c757a83d912) feat(build): add Next.js-style route report to vinext build output - [`ee932e2`](https://github.com/cloudflare/vinext/commit/ee932e293dcc7f0e9371e88d4a536110b9ec9e8e) fmt - [`18db3d2`](https://github.com/cloudflare/vinext/commit/18db3d2a9989c8f811acb725fe70bfe0e14b440c) fix exmaple - [`7937d4a`](https://github.com/cloudflare/vinext/commit/7937d4aad1707cc9bde021ad9014750f8620544f) support -v - [`7d33a6b`](https://github.com/cloudflare/vinext/commit/7d33a6b9a8be295efb5042fa05efe1f9d3ec681e) . - [`8599c61`](https://github.com/cloudflare/vinext/commit/8599c61e35abc3e395c3c749b51efac889fd80ab) . - [`2fbfa92`](https://github.com/cloudflare/vinext/commit/2fbfa92a876b5bb275f4c7df64db14ac733d1f3e) fix(build-report): address review comments - [`ef1d204`](https://github.com/cloudflare/vinext/commit/ef1d2041a7371647c7760532f89f32ed853a959f) test(build-report): replace misleading classifyAppRoute tests with real fixture coverage ### 📊 Changes **6 files changed** (+988 additions, -25 deletions) <details> <summary>View changed files</summary> ➕ `packages/vinext/src/build/report.ts` (+372 -0) 📝 `packages/vinext/src/cli.ts` (+138 -25) ➕ `tests/build-report.test.ts` (+456 -0) ➕ `tests/fixtures/app-basic/app/error-static-test/page.tsx` (+8 -0) ➕ `tests/fixtures/app-basic/app/revalidate-infinity-test/page.tsx` (+7 -0) ➕ `tests/fixtures/app-basic/app/revalidate-zero-test/page.tsx` (+7 -0) </details> ### 📄 Description <img width="951" height="700" alt="image" src="https://github.com/user-attachments/assets/17af216c-f483-40a1-b1c2-3987453f6106" /> Note that more accurate analysis will be implemented through https://github.com/cloudflare/vinext/pull/274 ## Summary - Adds a `build/report.ts` module with regex-based route classification (`○ Static`, `◐ ISR`, `ƒ Dynamic`, `? Unknown`, `λ API`) and a Next.js-style formatted route table printed at the end of `vinext build` - Routes sort alphabetically by path (filesystem order); legend sorts alphabetically by label - Routes without explicit `export const dynamic` or `export const revalidate` are classified as `? Unknown` rather than falsely claiming static — a note is shown when unknown routes are present explaining this will improve in a future release - Clean build logger suppresses Vite/Rollup noise by default; `--verbose` flag restores raw output - 55 unit tests covering all classification paths, formatting, and sorting ## Notes - Dynamic detection (detecting `headers()`, `cookies()`, etc. via runtime analysis) is deferred — tracked as a follow-up - Pages Router classification is unchanged; `unknown` only applies to App Router routes without explicit config --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:01 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#601
No description provided.