-
Notifications
You must be signed in to change notification settings - Fork 25
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: add support for bun.lock
#379
base: main
Are you sure you want to change the base?
Conversation
It's generally fine to add new libraries if we think they can't be implemented easily on our side. Can you double check that this new import doesn't cause the SCALIBR binary size to get too much bigger? Regarding the Go version, do you mean that the lib needs Go 1.23 or beyond? We use Go 1.24 internally so requiring 1.23 or beyond should be fine for us. |
Yes that's my read of it - I think bumping the Go version could be a breaking change but either way probably best done in a dedicated PR. I'm happy to open that and we can continue any related discussion over there |
The |
@erikvarga I have gone ahead with switching out the library since |
Hm, if using tailscale means we have to wait until Go 1.24 is released so we'll stay compatible with the last 2 versions then maybe we're better off using tidwall/jsonc. |
As part of improving ergonomics, Bun has introduced a new text-based lockfile which this adds support for extracting.
While the blog post claims that it's "JSON with comments" (aka
JSONC
), it's actually "JSON with comments and trailing commas" (akaJWCC
orHuJSON
) - since the Go standard library only supports parsing standard JSON, I've had to bring in a third-party library to handle parsing, which is designed to leverage the existing standard library by instead handling "standardizing" the input into valid boring JSON.Aside from the general question of if this library is acceptable to use here, it also seems to require Go 1.23 resulting in the addition of a(I've since switched to using a library that requires Go 1.16)toolchain
line ingo.mod
which I've never managed to quite figure out what the right thing to do with - overall, I'd like someone from Google to confirm what library they'd prefer we use here.I have also specified the testdata fixtures as JSON5 as that's the most appropriate format supported by both VSCode and IntelliJ/GoLand, though that technically supports more features like single quotes (which it actually seems like
bun
does not mind if you use in your lockfile, though it'll always use double quotes itself) - personally I think that's fine, but don't mind renaming the files to be.hujson
if folks would prefer.Resolves google/osv-scanner#1405