mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
add version to Framework struct
This commit is contained in:
@@ -2005,6 +2005,9 @@ pub const Framework = struct {
|
||||
fallback: EntryPoint = EntryPoint{},
|
||||
|
||||
display_name: string = "",
|
||||
/// "version" field in package.json
|
||||
version: string = "",
|
||||
/// "name" field in package.json
|
||||
package: string = "",
|
||||
development: bool = true,
|
||||
resolved: bool = false,
|
||||
|
||||
@@ -299,6 +299,14 @@ pub const PackageJSON = struct {
|
||||
}
|
||||
}
|
||||
|
||||
if (json.get("version")) |version| {
|
||||
if (version.asString(allocator)) |str| {
|
||||
if (str.len > 0) {
|
||||
pair.framework.version = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (framework_object.expr.asProperty("static")) |static_prop| {
|
||||
if (static_prop.expr.asString(allocator)) |str| {
|
||||
if (str.len > 0) {
|
||||
|
||||
Reference in New Issue
Block a user