Skip to content

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

Closed as not planned

Description

@slorber

💥 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

Activity

  1. added
    proposal
    on Jan 29, 2021
  2. slorber commented on Mar 11, 2021

    @slorber
    CollaboratorAuthor

    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

  3. armano2 commented on Mar 11, 2021

    @armano2
    Contributor

    that's why i deleted my comment :)

  4. slorber commented on Sep 25, 2023

    @slorber
    CollaboratorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions