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: when src is not local, basename is not fully describing the filename #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented Oct 28, 2024

Changes are visible to end-users: no

Test plan

  • Covered by existing test cases
  • New test cases added

@@ -1,6 +1,6 @@
{
"sources": [
"in.ts"
"examples/source_root/in.ts"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this going to be inconsistent? Shouldn't ALL paths in the sources here become repo-relative?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean throughout all test cases?

By default these sources are relative to the .map file, so no path navigation is needed when the .ts and .map are side-by-side. The exception being when an alternative root is specified (this fix), or when root_dir|out_dir are used to modify the path then we need to navigate there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build rule that generated this was

source_root = "../../../debug/source",
right?
I don't see how the relative location for the expected.js needs an extra examples/source_root to navigate back to the in.ts file in this case. It seems like the logic has to be updated to read the value passed to the source_root

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either one actually works when there is 1 .map for each .js. The "examples/source_root" path needs to live in one of the two so when you append them you get "examples/source_root/in.ts". But sourcemaps were designed to work with 1 .map for N .js and I think we should align with how that works, in which case the sources needs that path in it.

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