Skip to content

Commit b08d3c2

Browse files
hnnynhspiffcs
andauthored
feat: add support for Bun lockfile (#4625)
--------- Signed-off-by: Yoonho Hann <hnnynh125@gmail.com> Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
1 parent 63232bf commit b08d3c2

20 files changed

Lines changed: 5434 additions & 4 deletions

File tree

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ require (
101101
modernc.org/sqlite v1.51.0
102102
)
103103

104-
require github.com/pb33f/ordered-map/v2 v2.3.1
104+
require (
105+
github.com/pb33f/ordered-map/v2 v2.3.1
106+
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd
107+
)
105108

106109
require (
107110
cel.dev/expr v0.25.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,8 @@ github.com/sylabs/sif/v2 v2.24.0 h1:1wB5uMDUQYjk8AckTySaDcP9YnpMb1LyDRr1Jt9A10w=
924924
github.com/sylabs/sif/v2 v2.24.0/go.mod h1:DbXWqWZ1hdLSU+K9ipdds5AmZeHWsyxCOj/oQakBa88=
925925
github.com/sylabs/squashfs v1.0.6 h1:PvJcDzxr+vIm2kH56mEMbaOzvGu79gK7P7IX+R7BDZI=
926926
github.com/sylabs/squashfs v1.0.6/go.mod h1:DlDeUawVXLWAsSRa085Eo0ZenGzAB32JdAUFaB0LZfE=
927+
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd h1:Rf9uhF1+VJ7ZHqxrG8pJ6YacmHvVCmByDmGbAWCc/gA=
928+
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd/go.mod h1:EbW0wDK/qEUYI0A5bqq0C2kF8JTQwWONmGDBbzsxxHo=
927929
github.com/terminalstatic/go-xsd-validate v0.1.6 h1:TenYeQ3eY631qNi1/cTmLH/s2slHPRKTTHT+XSHkepo=
928930
github.com/terminalstatic/go-xsd-validate v0.1.6/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw=
929931
github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw=

internal/constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package internal
33
const (
44
// JSONSchemaVersion is the current schema version output by the JSON encoder
55
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
6-
JSONSchemaVersion = "16.1.3"
6+
JSONSchemaVersion = "16.1.4"
77

88
// Changelog
99
// 16.1.0 - reformulated the python pdm fields (added "URL" and removed the unused "path" field).
1010
// 16.1.1 - correct elf package osCpe field according to the document of systemd (also add appCpe field)
1111
// 16.1.2 - placeholder for 16.1.2 changelog
1212
// 16.1.3 - add GGUFFileParts to GGUFFileHeader metadata
13+
// 16.1.4 - add BunLockEntry metadata type for bun.lock support
1314

1415
)

internal/packagemetadata/generated.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ func AllTypes() []any {
1111
pkg.ApkDBEntry{},
1212
pkg.BinarySignature{},
1313
pkg.BitnamiSBOMEntry{},
14+
pkg.BunLockEntry{},
1415
pkg.CocoaPodfileLockEntry{},
1516
pkg.ConanV1LockEntry{},
1617
pkg.ConanV2LockEntry{},

internal/packagemetadata/names.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ var jsonTypes = makeJSONTypes(
9696
jsonNames(pkg.NpmPackageLockEntry{}, "javascript-npm-package-lock-entry", "NpmPackageLockJsonMetadata"),
9797
jsonNames(pkg.YarnLockEntry{}, "javascript-yarn-lock-entry", "YarnLockJsonMetadata"),
9898
jsonNames(pkg.PnpmLockEntry{}, "javascript-pnpm-lock-entry"),
99+
jsonNames(pkg.BunLockEntry{}, "javascript-bun-lock-entry"),
99100
jsonNames(pkg.PEBinary{}, "pe-binary"),
100101
jsonNames(pkg.PhpComposerLockEntry{}, "php-composer-lock-entry", "PhpComposerJsonMetadata"),
101102
jsonNamesWithoutLookup(pkg.PhpComposerInstalledEntry{}, "php-composer-installed-entry", "PhpComposerJsonMetadata"), // the legacy value is split into two types, where the other is preferred

0 commit comments

Comments
 (0)