[PR #520] [MERGED] Ignore @slot and _private dirs in metadata scan #641

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

📋 Pull Request Information

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

Base: mainHead: fix/metadata-scan-ignore-private-slot-dirs


📝 Commits (3)

  • d6bae05 Ignore @slot and _private dirs in metadata scan
  • 40f629c Disambiguate metadata routes under invisible segments
  • c47142d Exclude @children from metadata suffixing

📊 Changes

2 files changed (+74 additions, -9 deletions)

View changed files

📝 packages/vinext/src/server/metadata-routes.ts (+39 -6)
📝 tests/metadata-routes.test.ts (+35 -3)

📄 Description

Summary
This keeps scanMetadataFiles() aligned with the app router's URL semantics. Metadata under parallel route slots no longer leaks @slot into public URLs, and metadata inside _private folders is ignored entirely.

What Changed

  • skip _private directories while scanning metadata files
  • treat @slot directories like route groups for URL construction
  • add regression tests for both cases in tests/metadata-routes.test.ts

Why It Matters
The app router already treats _private folders as non-routable and @slot segments as invisible in URL space. Metadata scanning had drifted from that behavior and could emit invalid routes like /_private/icon and /@modal/icon.

Risks Or Limits
This only changes metadata directory traversal. Metadata file matching and dynamic-vs-static precedence are unchanged.

Verification

  • pnpm test tests/metadata-routes.test.ts
  • pnpm test tests/app-router.test.ts -t "scanMetadataFiles"
  • pre-commit checks: format, targeted test, lint, typecheck

Closes #519


🔄 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/520 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/metadata-scan-ignore-private-slot-dirs` --- ### 📝 Commits (3) - [`d6bae05`](https://github.com/cloudflare/vinext/commit/d6bae05f6f2ae834b1e4e8e09d142bb96bc694b1) Ignore @slot and _private dirs in metadata scan - [`40f629c`](https://github.com/cloudflare/vinext/commit/40f629c7e83c7d8230aa353718daafc0981b5f6e) Disambiguate metadata routes under invisible segments - [`c47142d`](https://github.com/cloudflare/vinext/commit/c47142dc4fbcb7e76f5dfc2484eedf3f0d5f2c6a) Exclude @children from metadata suffixing ### 📊 Changes **2 files changed** (+74 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/metadata-routes.ts` (+39 -6) 📝 `tests/metadata-routes.test.ts` (+35 -3) </details> ### 📄 Description Summary This keeps `scanMetadataFiles()` aligned with the app router's URL semantics. Metadata under parallel route slots no longer leaks `@slot` into public URLs, and metadata inside `_private` folders is ignored entirely. What Changed - skip `_private` directories while scanning metadata files - treat `@slot` directories like route groups for URL construction - add regression tests for both cases in `tests/metadata-routes.test.ts` Why It Matters The app router already treats `_private` folders as non-routable and `@slot` segments as invisible in URL space. Metadata scanning had drifted from that behavior and could emit invalid routes like `/_private/icon` and `/@modal/icon`. Risks Or Limits This only changes metadata directory traversal. Metadata file matching and dynamic-vs-static precedence are unchanged. Verification - `pnpm test tests/metadata-routes.test.ts` - `pnpm test tests/app-router.test.ts -t "scanMetadataFiles"` - pre-commit checks: format, targeted test, lint, typecheck Closes #519 --- <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:16 +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#641
No description provided.