feat: accept URL instances in nodeFileTrace() files parameter#572
Open
TooTallNate wants to merge 2 commits intomainfrom
Open
feat: accept URL instances in nodeFileTrace() files parameter#572TooTallNate wants to merge 2 commits intomainfrom
TooTallNate wants to merge 2 commits intomainfrom
Conversation
Allow passing URL instances (e.g. from import.meta.url) in addition to strings as entry files to nodeFileTrace(). URL instances are converted to file paths via fileURLToPath() at the boundary, so all downstream code continues to work with plain strings.
There was a problem hiding this comment.
Pull request overview
This PR expands nodeFileTrace() to accept URL instances as entry inputs (in addition to strings), converting URLs to file paths at the API boundary so downstream tracing logic continues to operate on plain string paths.
Changes:
- Widen
nodeFileTrace(files)parameter type to(string | URL)[]and convertURLviafileURLToPath(). - Add Jest tests covering URL input, URL vs string equivalence, and mixed URL+string arrays.
- Update
package-lock.json(large set of transitive/metadata changes).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/url-input.test.js | Adds new tests validating URL inputs to nodeFileTrace() |
| src/node-file-trace.ts | Accepts (string | URL)[] and normalizes URL inputs to filesystem paths |
| package-lock.json | Large lockfile churn not directly tied to the feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Address review feedback: the mixed-input test claimed to verify both inputs but only asserted the string-based one. Add an assertion for the URL-based input2 as well.
styfle
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
filesparameter ofnodeFileTrace()fromstring[]to(string | URL)[], allowing callers to passURLinstances (e.g. fromimport.meta.url) directlyURLinstances are converted to file paths viafileURLToPath()at the entry point — all downstream code continues to work with plain strings