aboutsummaryrefslogtreecommitdiff
path: root/src/install/npm.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-02-09 00:37:14 +0200
committerGravatar GitHub <noreply@github.com> 2023-02-08 14:37:14 -0800
commit18807cef03ac83a6a3dabded7a9735b87792f52e (patch)
treed40b8968840d16a7e1a96695b46e5415b3c4176a /src/install/npm.zig
parentcbc28afd51547f7a90161741cf826ee7f1485ae6 (diff)
downloadbun-18807cef03ac83a6a3dabded7a9735b87792f52e.tar.gz
bun-18807cef03ac83a6a3dabded7a9735b87792f52e.tar.zst
bun-18807cef03ac83a6a3dabded7a9735b87792f52e.zip
[install] assorted fixes & improvements (#2011)
- take `peerDependencies` into account during package placement - do not recursively resolve `workspaces` (matches `npm`) - link binaries to non-root packages correctly - prune empty nodes during dependency tree construction - support non-standard `workspace:` specifier
Diffstat (limited to 'src/install/npm.zig')
-rw-r--r--src/install/npm.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/install/npm.zig b/src/install/npm.zig
index 79dea81ce..71b892bef 100644
--- a/src/install/npm.zig
+++ b/src/install/npm.zig
@@ -1119,8 +1119,8 @@ pub const PackageManifest = struct {
const bin_name = obj.properties.ptr[0].key.?.asString(allocator) orelse break :bin;
const value = obj.properties.ptr[0].value.?.asString(allocator) orelse break :bin;
- package_version.bin = Bin{
- .tag = Bin.Tag.named_file,
+ package_version.bin = .{
+ .tag = .named_file,
.value = .{
.named_file = .{
string_builder.append(String, bin_name),
@@ -1174,8 +1174,8 @@ pub const PackageManifest = struct {
extern_strings_bin_entries = extern_strings_bin_entries[group_slice.len..];
}
- package_version.bin = Bin{
- .tag = Bin.Tag.map,
+ package_version.bin = .{
+ .tag = .map,
.value = .{ .map = ExternalStringList.init(all_extern_strings_bin_entries, group_slice) },
};
},
@@ -1185,8 +1185,8 @@ pub const PackageManifest = struct {
},
.e_string => |stri| {
if (stri.data.len > 0) {
- package_version.bin = Bin{
- .tag = Bin.Tag.file,
+ package_version.bin = .{
+ .tag = .file,
.value = .{
.file = string_builder.append(String, stri.data),
},
@@ -1209,8 +1209,8 @@ pub const PackageManifest = struct {
if (dirs.expr.asProperty("bin")) |bin_prop| {
if (bin_prop.expr.asString(allocator)) |str_| {
if (str_.len > 0) {
- package_version.bin = Bin{
- .tag = Bin.Tag.dir,
+ package_version.bin = .{
+ .tag = .dir,
.value = .{
.dir = string_builder.append(String, str_),
},