-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 bun run folder #15117
Fix bun run folder #15117
Conversation
I think you should also update the docs with this new order to be more explicit :) https://bun.sh/docs/cli/run |
…eQuotedString to no longer need casting
very excited to see this land; of the top ~1000 packages, this affects 402 |
is there a chance we could avoid doing this when a file path with an extension is passed? just so we don't read package.json files up to the root unnecessarily |
@Jarred-Sumner I'm not seeing any performance impact from this PR with |
var list = std.ArrayList(u8).init(stack_fallback.get()); | ||
errdefer list.deinit(); | ||
|
||
std.io.getStdIn().reader().readAllArrayList(&list, 1024 * 1024 * 1024) catch return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid using zig std for this, they use too much unreachable for this to not cause issues for us.
instead, use bun.sys.File
This isn't really done, but I'm going to merge it. Please add a follow-up PR that:
There are 2 additional system calls to bun run from this PR. I think that's okay given the context. |
This may be a breaking change, so it might wait for 1.2. When using
bun <script>
orbun run <script>
, it now always checks in this order:node_modules/.bin
with that name? Execute it and exit.bun run
only) Is there a binary in$PATH
with that name? Execute it and exit.Previously, it would try guessing if it looked like a script name and sometimes it would execute before checking scripts in package.json.
Fixes #13819, Fixes #15743, Fixes #16169, Fixes #16482
New features: If there is a script called
myscript.js
you can now run it withbun myscript
just like node allowsTODO:
cli/run
about resolution orderTest failures:
Consider:
bun:main
and run directly instead.bun:main
is generated inentry_points.zig
.Performance:
~0.5ms slower :/ even for
./
which is strange