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

feat(resolver): Add NODE_PATH support #14089

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

Conversation

AielloChan
Copy link
Contributor

What does this PR do?

Add resolve check for NODE_PATH.

  • 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 wrote automated tests

  • I included a test for the new code, or existing tests cover it

  • I ran my tests locally and they pass (bun-debug test test-file-name.test)

  • 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)

@AielloChan
Copy link
Contributor Author

#13125

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.

tiny nitpick but this looks incredibly reasonable

can you add a test that checks that more than one NODE_PATH entries work?

// resolve `NODE_PATH`
var node_path: []const u8 = "";
if (r.env_loader) |env_loader| {
node_path = env_loader.get("NODE_PATH") orelse "";
Copy link
Member

Choose a reason for hiding this comment

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

couldn't this just be const node_path = and then moving the second if check inside of this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All done

@paperdave paperdave self-assigned this Sep 24, 2024
@AielloChan
Copy link
Contributor Author

@paperdave Looks some github action configure was broken. Runner image is Ubuntu, but script try to call a zig.exe

Arc 2024-09-25 11 24 51
/usr/bin/bash: line 1: vendor/zig/zig.exe: No such file or directory
error: script "zig" exited with code 127
error: script "zig:fmt" exited with code 127
error: script "fmt:zig" exited with code [12](https://github.com/oven-sh/bun/actions/runs/11006290644/job/30561806366?pr=14089#step:7:13)7
Error: Process completed with exit code 127.

@bingtsingw
Copy link

@paperdave Hi, is this pr ready to be merged?

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