[PR #702] [MERGED] refactor: consolidate fileURLToPath path resolution into resolveEntryPath() #781

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

📋 Pull Request Information

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

Base: mainHead: opencode/shiny-falcon


📝 Commits (1)

  • aae0ba7 refactor: consolidate fileURLToPath path resolution into resolveEntryPath()

📊 Changes

5 files changed (+68 additions, -85 deletions)

View changed files

📝 packages/vinext/src/cloudflare/tpr.ts (+1 -3)
📝 packages/vinext/src/entries/app-rsc-entry.ts (+35 -47)
📝 packages/vinext/src/entries/pages-server-entry.ts (+12 -30)
📝 packages/vinext/src/entries/runtime-entry-module.ts (+18 -3)
📝 packages/vinext/src/index.ts (+2 -2)

📄 Description

Summary

  • Adds resolveEntryPath(rel, base) to entries/runtime-entry-module.ts as the single owner of the fileURLToPath(new URL(rel, base)).replace(/\\/g, "/") idiom
  • Replaces 16 hand-rolled call sites in app-rsc-entry.ts and 8 in pages-server-entry.ts with the shared helper; resolveRuntimeEntryModule also delegates to it
  • Replaces const __dirname = path.dirname(fileURLToPath(import.meta.url)) in index.ts and cloudflare/tpr.ts with import.meta.dirname (Node 22+, already used throughout the test suite), removing now-unused imports

🔄 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/702 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/28/2026 **Status:** ✅ Merged **Merged:** 3/28/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `opencode/shiny-falcon` --- ### 📝 Commits (1) - [`aae0ba7`](https://github.com/cloudflare/vinext/commit/aae0ba76852d50ad500208196d701dc0f2b87228) refactor: consolidate fileURLToPath path resolution into resolveEntryPath() ### 📊 Changes **5 files changed** (+68 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/cloudflare/tpr.ts` (+1 -3) 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+35 -47) 📝 `packages/vinext/src/entries/pages-server-entry.ts` (+12 -30) 📝 `packages/vinext/src/entries/runtime-entry-module.ts` (+18 -3) 📝 `packages/vinext/src/index.ts` (+2 -2) </details> ### 📄 Description ## Summary - Adds `resolveEntryPath(rel, base)` to `entries/runtime-entry-module.ts` as the single owner of the `fileURLToPath(new URL(rel, base)).replace(/\\/g, "/")` idiom - Replaces 16 hand-rolled call sites in `app-rsc-entry.ts` and 8 in `pages-server-entry.ts` with the shared helper; `resolveRuntimeEntryModule` also delegates to it - Replaces `const __dirname = path.dirname(fileURLToPath(import.meta.url))` in `index.ts` and `cloudflare/tpr.ts` with `import.meta.dirname` (Node 22+, already used throughout the test suite), removing now-unused imports --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:04 +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#781
No description provided.