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

Support .bun-version files #8

Closed
aklinker1 opened this issue Sep 17, 2024 · 7 comments
Closed

Support .bun-version files #8

aklinker1 opened this issue Sep 17, 2024 · 7 comments

Comments

@aklinker1
Copy link
Owner

No description provided.

@electriquo
Copy link

electriquo commented Mar 8, 2025

Relates to oven-sh/bun#3917.

It makes sense to use .bun-version instead of .bunv-version, aligning with other popular version managers such as pyenv and rbenv. Plus, Renovate already supports .bun-version for Bun, which further demonstrates the growing adoption of Bun in the ecosystem.

Once this feature is implemented, it will be easier to develop a GitHub Action to setup-bun, similar to setup-node, setup-python, and others.

Do you have an estimated timeline for when this feature might be implemented, if at all?

@aklinker1
Copy link
Owner Author

aklinker1 commented Mar 8, 2025

Woops, just a typo. I meant .bun-version, since that's what the GitHub actions supports.

Feel free to open a PR, I don't have any plans on implementing that myself right now. The existing package.json support does everything I need it to do personally.

Should be super easy, already have the structure setup to add support for more files:

https://github.com/aklinker1/bunv/blob/main/src%2Fvm.zig#L46-L47

@aklinker1 aklinker1 changed the title Support .bunv-version files Support .bun-version files Mar 8, 2025
@electriquo
Copy link

Don't know Zig.
Uncommenting is all it takes?

@aklinker1
Copy link
Owner Author

aklinker1 commented Mar 8, 2025

Um... maybe? Here's the implementation:

bunv/src/vm.zig

Lines 266 to 278 in 9b1cedc

const BunVersionFile = struct {
fn init() VersionFile {
return .{
.name = ".bun-version",
.extractBunVersion = &extractBunVersion,
};
}
fn extractBunVersion(allocator: mem.Allocator, contents: []u8) ?[]u8 {
return try allocator.dupe(u8, contents) catch |err| switch (err) {
else => return null,
};
}
};

Looks like the only change is to trim whitespace surrounding the version?

I guess I can do that real quick.

@aklinker1
Copy link
Owner Author

Closed by 1c70d2b

@aklinker1
Copy link
Owner Author

aklinker1 commented Mar 8, 2025

Released in v0.3.2. Re-run the install script to upgrade.

@electriquo
Copy link

You're awesome @aklinker1!

May you would like to update the Roadmap on the README?

bunv/README.md

Line 28 in 9a9ae4e

- [Support `.bunv-version` files `#8`](https://github.com/aklinker1/bunv/issues/8)

Since I can only install from "official" streams, when Bunv will be available through brew, I could test and share any insights.

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

No branches or pull requests

2 participants