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

Replace NodeJS "path" with "upath": normalize paths to posix style #4124

Closed
slorber opened this issue Jan 29, 2021 · 3 comments
Closed

Replace NodeJS "path" with "upath": normalize paths to posix style #4124

slorber opened this issue Jan 29, 2021 · 3 comments
Labels
proposal This issue is a proposal, usually non-trivial change

Comments

@slorber
Copy link
Collaborator

slorber commented Jan 29, 2021

💥 Proposal

https://www.npmjs.com/package/upath#why

It could be less painful to ensure Windows support if all paths where using posix style (/ separator) instead of being platform dependent.

Windows/NodeJS is able to understand both / and \\ so it would be nice to normalize on all paths on posix style.

This could prevent issues we often see after committing, when the CI (build or tests) fails but only on Windows, such as:

image

My idea would be to:

  • Use "upath" everywhere
  • Use upath.normalize() everywhere instead of our custom posixPath() fn.
  • Prevent "path" from being imported with an ESLint rule
@slorber slorber added the proposal This issue is a proposal, usually non-trivial change label Jan 29, 2021
slorber added a commit that referenced this issue Jan 29, 2021
slorber added a commit that referenced this issue Jan 29, 2021
* EditUrl function

* normalize blog/docs regarding the editUrl feature + editUrl function

* editUrl fn => always inject posix style relative paths, make tests more reliable
(see also #4124)

* fix editUrl on windows
@slorber
Copy link
Collaborator Author

slorber commented Mar 11, 2021

Looks like @armano2 you mentioned path.posix instead of upath and deleted that comment?

Both can be a solution, but apparently, they do not have the exact same behavior: anodynos/upath#26

@armano2
Copy link
Contributor

armano2 commented Mar 11, 2021

that's why i deleted my comment :)

@slorber
Copy link
Collaborator Author

slorber commented Sep 25, 2023

Not sure we need upath, we don't often get windows path issues anymore after the problem has been understood

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue is a proposal, usually non-trivial change
Projects
None yet
Development

No branches or pull requests

2 participants