-
Notifications
You must be signed in to change notification settings - Fork 24
fix(win): use windows-safe paths #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes Windows compatibility issues in doc-kit by replacing new URL().pathname with Windows-safe path resolution using POSIX paths. The changes also correct variable naming inconsistencies and improve code generation formatting.
- Introduces Windows-safe path handling using
node:path/posixand a computed ROOT constant - Fixes variable naming bug where server-side rendering used incorrect variable references
- Updates external dependencies configuration and improves code formatting
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/generators/web/constants.mjs | Adds ROOT constant calculation and replaces URL.pathname with resolve() calls for Windows compatibility |
| src/generators/web/utils/generate.mjs | Updates import path resolution and fixes variable naming in server program generation |
| src/generators/web/utils/processing.mjs | Moves SSR variable declaration to module scope and fixes variable reference bug |
| src/generators/web/utils/bundle.mjs | Adds 'preact-render-to-string' to external dependencies list |
You can disable region comments via
Oh 👀 |
Will do! I'll work on getting a minimal repro of this, and the other issue we spoke about, today. |
|
@nodejs/web-infra requesting fast track, as this is used in a reproduction for Rolldown. |
Currently,
doc-kitdoes not work on Windows due to a Rolldown issue, and a paths issue.This PR fixes the paths issue by using Windows-safe paths.
Additionally,
//#endregioncomment. We need to add a newline before thereturncode =to to dehydration, not our generated variable. TBH, I'm not sure how this worked at all previously...@TheAlexLichter There appears to be a bug when building this on Windows:
It appears to import everything twice. Once using a Unix path, and once using a Windows path.