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

feat: add posix and win32 exports to match node:path #193

Merged
merged 5 commits into from
Dec 30, 2024
Merged

Conversation

xeho91
Copy link
Contributor

@xeho91 xeho91 commented Dec 29, 2024

Resolves #192

@xeho91
Copy link
Contributor Author

xeho91 commented Dec 29, 2024

By the way, the same solution can be used for path.posix, but I don't know anyone ever encountered a problem with some package trying to access this export - when using pathe as fallback for "node:path".

EDIT. Oh wow, I had this issue 😅 , when re-testing.

Since pathe internally already does normalization. We can refer posix and win32 to path namespace. I think. Let me know if this solution is applicable.

@xeho91 xeho91 changed the title feat: Add win32 feat: Add export win32 Dec 29, 2024
@xeho91 xeho91 changed the title feat: Add export win32 feat: Add exportable posix and win32 Dec 29, 2024
@pi0 pi0 changed the title feat: Add exportable posix and win32 feat: add posix and win32 exports Dec 30, 2024
@pi0
Copy link
Member

pi0 commented Dec 30, 2024

I appreciate the PR ❤️ Updated types to be more precise with runtime behavior.

@pi0 pi0 changed the title feat: add posix and win32 exports feat: add posix and win32 exports for node:path compatibility Dec 30, 2024
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.31%. Comparing base (bdab761) to head (730852d).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
- Coverage   99.45%   99.31%   -0.14%     
==========================================
  Files           4        4              
  Lines         364      292      -72     
  Branches      114      119       +5     
==========================================
- Hits          362      290      -72     
  Misses          2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0 pi0 changed the title feat: add posix and win32 exports for node:path compatibility feat: add posix and win32 exports to match node:path Dec 30, 2024
@pi0 pi0 merged commit 7158866 into unjs:main Dec 30, 2024
1 check passed
@pi0
Copy link
Member

pi0 commented Dec 30, 2024

(This will likely land for path v2)

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.

export posix and win32 cannot be destructured
2 participants