Repository navigation
refactor: replace pathe with pathslash - #288
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Brooooooklyn
approved these changes
Jul 28, 2026
Brooooooklyn
pushed a commit
that referenced
this pull request
Jul 29, 2026
Fixes #285. Third task of #287. ## Problem `runNodePrerenderRunner()` writes `.void/prerender-runner.mjs` into the consumer app and executes it as a separate Node process. The generated file imported the path library as a bare specifier: ```js import { join, dirname } from "pathslash"; // previously "pathe" ``` Bare specifiers in `<app>/.void/` resolve from the application, not from the installed `void` package. Under strict pnpm, any `target: "node"` + `output: "static"` app that doesn't install the path library directly fails: ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'pathslash' imported from <app>/.void/prerender-runner.mjs ``` The `pathe` → `pathslash` swap (#288) did not fix this — it only changed the name of the missing package. ## Fix The runner only handles local filesystem paths, so it now imports from the Node built-in: ```js import { dirname, join } from "node:path"; ``` ## Why CI never caught this `playground/node-static` declared the path library (`pathe`, then `pathslash`) as its own devDependency — the exact workaround reported in #285, baked into the test fixture. The runner's bare import always resolved inside the monorepo, so `node-static.test.ts` stayed green while every real strict-pnpm consumer broke. This PR removes that dependency so the playground resolves modules like a real consumer app, turning the existing integration test into a genuine regression test for #285. The only in-playground user of `pathslash` was the dev-convenience `scripts/serve-static.mjs`, which now uses `node:path` (with an oxlint exemption documenting why this playground must not depend on `pathslash`) — it only builds local fs paths, so no slash normalization is needed. ## Verification | Runner import | Playground `pathslash` dep | `node-static.test.ts` | | --------------------- | -------------------------- | ------------------------------------------- | | `pathslash` (no fix) | present (old state) | green — bug masked | | `pathslash` (no fix) | removed | red — `ERR_MODULE_NOT_FOUND` for the runner | | `node:path` (this PR) | removed | green — 13/13 pass | Also verified: `vp lint` passes, `serve:static` smoke-tested (serves pages, path-traversal guard intact), `void` package typecheck passes. The lockfile change is only the dependency removal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #287
Swap
patheforpathslashacross the workspace.pathslashre-exports the samenode:pathAPI with forward-slash normalization but does not carrypathe's Windows correctness bugs.