mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #592] [MERGED] fix: scope getStaticProps revalidate parsing to the exported function #691
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#691
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/592
Author: @Boyeep
Created: 3/19/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @james-elicx
Base:
main← Head:fix/scope-getstaticprops-revalidate📝 Commits (8)
e6b1264fix: scope getStaticProps revalidate parsing5a1f4c8fix: handle early returns in getStaticProps revalidate parsing8e6136ffix: scope getStaticProps parsing to its declaration98598e2fix: handle destructured getStaticProps params1a86e86fix: ignore nested helper returns in getStaticProps8942db5fix: avoid re-export false positives in getStaticProps parsing4280a13fix: harden getStaticProps revalidate parsingf3d2a60chore: polish getStaticProps parser follow-up📊 Changes
2 files changed (+636 additions, -7 deletions)
View changed files
📝
packages/vinext/src/build/report.ts(+491 -7)📝
tests/build-report.test.ts(+145 -0)📄 Description
This fixes a false positive in
extractGetStaticPropsRevalidate().Previously, the helper could match
revalidate:anywhere in the file, including unrelated config objects outsidegetStaticProps. That could misclassify Pages Router routes in the build report.This change scopes the search to the exported
getStaticPropsreturn object when that function is present.extractGetStaticPropsRevalidate()togetStaticPropsrevalidatevalues outsidegetStaticPropsgetStaticPropsvalue still wins when both are presentpnpm exec vp test run tests/build-report.test.tspnpm exec vp fmt packages/vinext/src/build/report.ts tests/build-report.test.tspnpm exec vp lint packages/vinext/src/build/report.ts tests/build-report.test.ts#Notes
pnpm exec vp checkreports existing repo-wide formatting issues in this checkout, so validation here was kept targeted to the changed files.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.