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

fix(glob): fs.glob uses native path separator which broke module IDs #283

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Oct 25, 2024

Should have added Node 22 to CI before doing the fs.globSync change 🤦🏼‍♂️

Platforms affected

Windows

Motivation and Context

So fs.glob returns paths using the system path separator, while fast-glob and globby always return POSIX-style paths. Since we use this value for module IDs (i.e., cordova.require('some/module/path')) we need to ensure the IDs use POSIX-style separators.

NodeJS apparently still doesn't have an API to fix this beyond just doing string replacements.

Description

Force module IDs to always use POSIX-style path separators.

Testing

Ran tests in CI with logging to reproduce and fix the bug.

Checklist

  • I've run the tests to see all new and existing tests pass

We need to ensure that the module IDs use URL-style (aka POSIX-style)
path separators, even on Windows.
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.62%. Comparing base (d05df6e) to head (3682e5c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #283   +/-   ##
=======================================
  Coverage   83.62%   83.62%           
=======================================
  Files          14       14           
  Lines         519      519           
=======================================
  Hits          434      434           
  Misses         85       85           

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

@dpogue dpogue merged commit 788b62a into apache:master Oct 25, 2024
13 checks passed
@dpogue dpogue deleted the globfix branch October 25, 2024 15:06
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.

3 participants