Support stripping a prefix from all file paths#231
Merged
tschneidereit merged 1 commit intobytecodealliance:mainfrom Mar 20, 2025
Merged
Support stripping a prefix from all file paths#231tschneidereit merged 1 commit intobytecodealliance:mainfrom
tschneidereit merged 1 commit intobytecodealliance:mainfrom
Conversation
Contributor
|
Could we define a concept of base path? Or can we run Wizer such that the project root is |
This introduces the CLI option `--strip-path-prefix prefix` and strips the provided `prefix` from all paths as seen by content, in stack traces, and the debugger. Previously, we unilaterally stripped the directory part of the top-level script's path instead. This new approach is better in two ways: 1. it works for files that are in ancestor or sibling directories to the top-level script 2. it enables using an ancestor directory as the root The second of these advantages can be seen in the diffs to the test expectations files: the stacks for those are more informative, because they now include the directory of the actual test, since we're only stripping the `[StarlingMonkey root]/tests` part of the path.
4aa3220 to
337c2ba
Compare
Member
Author
|
@guybedford agreed that that is much better, so I did that in this new version of this PR. Turns out without that kind of approach it was hard to make the e2e tests pass again anyway :) |
guybedford
approved these changes
Mar 20, 2025
tschneidereit
added a commit
to tschneidereit/ComponentizeJS
that referenced
this pull request
Mar 21, 2025
tschneidereit
added a commit
to tschneidereit/ComponentizeJS
that referenced
this pull request
Mar 21, 2025
guybedford
pushed a commit
to bytecodealliance/ComponentizeJS
that referenced
this pull request
Mar 21, 2025
* Update to latest StarlingMonkey Pulls in bytecodealliance/StarlingMonkey#231 * Strip path prefix Since for weval we can't map the build dir to something else, we instruct StarlingMonkey to strip the path prefix instead, achieving stack traces that don't depend on source location.
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.
This introduces the CLI option
--strip-path-prefix prefixand strips the providedprefixfrom all paths as seen by content, in stack traces, and the debugger.Previously, we unilaterally stripped the directory part of the top-level script's path instead. This new approach is better in two ways:
The second of these advantages can be seen in the diffs to the test expectations files: the stacks for those are more informative, because they now include the directory of the actual test, since we're only stripping the
[StarlingMonkey root]/testspart of the path.