fix(windows): normalize paths for cross-platform compatibility#652
fix(windows): normalize paths for cross-platform compatibility#652marcogomez-dev wants to merge 1 commit intonuejs:masterfrom
Conversation
ade0de1 to
5e3f7b6
Compare
|
Using nue in windows environment i encountered the same problems as described here. First i switched my files format from CRLF to LF and it fixed some problems but the nue integrated server still couldn't reach the generated ".html.js" files getting "Not found /ui/entry.html.js" typical messages. Then i tried this fixed version and I can tell it now works perfectly : my nue project is now working like it shoulds, thank you @marcogomez-dev , i can now enjoy this delicious framework ! What is needed to get your merge request accepted into the original nue master branch ? Maybe some linux testing to check if it works on there as well ? (i'm new to this and this comment is my first participation on github ) |
Here my fork with those two fixes compared to nue:master : |
Summary
Add Windows path normalization for cross-platform compatibility.
Changes
toPosix()helper infswalk.jsto normalize paths at input boundariesjoin()output infswatch.jsfor directory watching eventsnode:pathsepwith hardcoded/for consistent POSIX pathsos.tmpdir()andjoin()for cross-platform compatibilityProblem
On Windows,
path.relative()and file system APIs return backslash paths (blog\post.md), but the codebase uses POSIX patterns (blog/) for matching. This caused:/blogand/DocsSolution
Normalize all paths to POSIX format (
/) at the input boundaries (fswalk.jsandfswatch.js), so the rest of the system receives consistent paths.Testing
Related
Fixes #621
Fixes #628
Fixes #629