Skip to content
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

Make it work on Windows #748

Merged
merged 19 commits into from
Jul 30, 2024
Merged

Make it work on Windows #748

merged 19 commits into from
Jul 30, 2024

Conversation

calebeby
Copy link
Member

@calebeby calebeby commented Jul 22, 2024

Hello and welcome to my pull request. The following are things about Windows that make me sad.

  • ☹️ Windows paths start with C:\ (or similar). On Windows, we need to handle those as absolute paths.
  • ☹️ Windows paths (usually) have \ instead of /. On Windows, we need to use \ for any path used on the file system, and / for any path used in the browser. In a lot of cases Windows doesn't seem to care which one you use, but I don't know if that is universally true (and if you ask for a path it will always give you one with \ AFAICT)
  • ☹️ Windows files have \r\n (CRLF) instead of \n between each line. This is not always true though; for example git for windows can be configured to checkout files as-is from GitHub instead of converting them while performing a checkout. So they can have either \r\n or \n. But text files in the browser (e.g. HTML, CSS, JS) will have \n instead since they are not on the filesystem. So we need to handle both.
  • ☹️ The fact that windows paths usually use \ which happens to be the escape character for JS strings makes things more difficult, e.g. you can't plop a windows path into a JS string with ${} directly because of the escaping. Don't ask how long I spent debugging a string that once interpolated became something\node_modules and the \n in the middle was seen as a line break so then I was like "what is ode modules I do not like it" 😱 🙀 😡 :rage4:
  • ☹️ Windows paths are case insensitive so they must be normalized before they can be compared

@calebeby calebeby marked this pull request as ready for review July 22, 2024 20:39
@calebeby calebeby marked this pull request as draft July 22, 2024 20:39
package.json Show resolved Hide resolved
@calebeby calebeby marked this pull request as ready for review July 23, 2024 21:34
@calebeby calebeby changed the title Windows updates Make it work on Windows Jul 23, 2024
Copy link
Member

@Paul-Hebert Paul-Hebert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Caleb! Code looks good and tests are passing 👍

I left a few small non-blocking suggestions that you may want to take a look at before merging. Thanks!

@calebeby calebeby merged commit 6d757ef into main Jul 30, 2024
8 checks passed
@calebeby calebeby deleted the windows branch July 30, 2024 21:39
@github-actions github-actions bot mentioned this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants