fix: Normalize paths and line endings for cross-platform compatibility#631
Conversation
|
Hey, thanks for the pr. Some comments :) For the unzip issue, there's already an open pr (See #622). Your changes also don't work on all OSes, als tar can't unzip on every device. Windows tar supports zip, but Unix systems have the unzip command, that specifically is for zips compared to the tar command (which may or may not support extracting zip). So, maybe just revert that part. You left some non English comments in the code. The "fix #...." keywords need to be mentioned in the top pr description, to be automatically applied when the pr is merged (you can see in the sidebar, which PRs are referenced for closing) I plan to take a deeper look at this pr around tomorrow evening. |
Hello there! Thanks so much for taking the time to review my PR and for all the insightful comments! I really appreciate the guidance. I apologize for the confusion regarding the Regarding the non-English comments, you are absolutely right—I noticed that late! I've already made a note to ensure all comments are in English moving forward. Also, I completely agree that separating the changes into different PRs (one for path/line endings, one for the trailing slash redirect) would have been much cleaner. It's a great piece of advice, and I welcome all your feedback since I'm quite new to this. Honestly, just getting the first PR opened felt like a major accomplishment! 😄 I'm going to follow your advice: I will prepare another commit now, switching the comments to English and reverting the change on For this specific PR, I'll keep the changes bundled together, as I'm a bit unsure how to best separate them now without starting over. But I will definitely keep the "separate PRs for separate concerns" advice in mind for all my future contributions. Thank you again for all the support, help, and guidance! It means a lot! |
|
@marcogomez-dev For what it's worth, I just pulled this PR on my Windows machine and I can confirm the |
|
@nobkd Hello! Thanks for taking your time reviewing my code, and thanks for your suggestions and guidance. I saw your comments and I've made all the changes. Can you tell me if it's all okay now? |
|
I'll take a more thorough look in a few |
fb60357 to
c2b252c
Compare
- Replaced platform-specific path separators with POSIX format (/) in deps.js, file.js, serve.js, and fswalk.js - Updated line ending processing in compiler.js to remove carriage returns (\r) - Added directory redirection to trailing slash in serve.js when index files exist Changes ensure consistent file path handling and text processing across Windows, Linux, and macOS platforms.
- Disable source maps in JS compilation to fix failure - Refactor unzip function to use tar for multi-platform extraction with proper cleanup - Normalize paths to POSIX and improve build filtering for shared data dirs - Update imports in create.js for new file operations in unzip logic
…s BSD TAR and GNU TAR, for windows, macOs and unix systems)
…in site.js fswalk.js fswatch.js
c2b252c to
05a1d4c
Compare
|
rebased on master As I said, I wish there was a builtin function. If anyone knows about a builtin function to convert to posix path, that would be nice. I still think it would be alright, to convert to posix in all places, where the path first comes into contact with nue, e.g. in both |
fix #621
Fix #630
Fix #629
Fix #628
Changes ensure consistent file path handling and text processing across Windows, Linux, and macOS platforms.