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

Added returning of original path from Bun.build #15167

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BjornTheProgrammer
Copy link
Contributor

What does this PR do?

This PR fixes #15033, by adding the sourcefile attribute on BuildArtificat. It remains as null if the output is not an entry-point

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

I ran bun-debug test bundle
I added a test to check for the sourcefile attribute, and added onto some tests to do the same.

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be

  • I included a test for the new code, or an existing test covers it

  • JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed

  • I wrote TypeScript/JavaScript tests and they pass locally (bun-debug test test-file-name.test)

  • I added TypeScript types for the new methods, getters, or setters

@BjornTheProgrammer
Copy link
Contributor Author

Some things maybe should be considered, such as whether chunks should also have a sourcefile if they existed. Additionally, this code makes it so that sourcefile doesn't display if the type isn't an entry-point. Maybe that should be changed.

Copy link
Member

@paperdave paperdave left a comment

Choose a reason for hiding this comment

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

implementation looks reasonable. i want to get other people's opinions on the field name sourcefile. maybe it should be named entrypoint, since it is the pre-resolved text and not the actual path to the file that it built.

src/options.zig Outdated Show resolved Hide resolved
@BjornTheProgrammer
Copy link
Contributor Author

Thanks for the feedback, I've changed it to be entrypoint!

@BjornTheProgrammer
Copy link
Contributor Author

I've rebased and reran bun-debug test bundler. All tests seem to be passing on my machine.

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.

Bun.build return the original path of entry point
2 participants