aboutsummaryrefslogtreecommitdiff
path: root/src/install/lockfile.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-01-28 17:05:28 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-28 07:05:28 -0800
commit07258bd559a25a08e406f8e3630c04677a920eba (patch)
treeacce7d37e7770ece03986b91ff1f58b0e50b950e /src/install/lockfile.zig
parent0646efbf30a5e4f84973c8a1a312eb224407913d (diff)
downloadbun-07258bd559a25a08e406f8e3630c04677a920eba.tar.gz
bun-07258bd559a25a08e406f8e3630c04677a920eba.tar.zst
bun-07258bd559a25a08e406f8e3630c04677a920eba.zip
[WIP] append GitHub package after fully parsed (#1911)
Diffstat (limited to 'src/install/lockfile.zig')
-rw-r--r--src/install/lockfile.zig21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index c8033c049..eaec4f2f6 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -1039,7 +1039,10 @@ pub const Printer = struct {
if (package_id > end) continue;
const is_new = installed.isSet(package_id);
- const package_name = names[package_id].slice(string_buf);
+ const package_name = brk: {
+ const alias = this.lockfile.alias_map.get(package_id) orelse names[package_id];
+ break :brk alias.slice(string_buf);
+ };
if (this.updates.len > 0) {
const name_hash = names_hashes[package_id];
@@ -1109,7 +1112,7 @@ pub const Printer = struct {
for (this.updates) |_, update_id| {
const package_id = id_map[update_id];
if (package_id == std.math.maxInt(PackageID)) continue;
- const name = names[package_id];
+ const name = this.lockfile.alias_map.get(package_id) orelse names[package_id];
const bin = bins[package_id];
const package_name = name.slice(string_buf);
@@ -2820,15 +2823,11 @@ pub const Package = extern struct {
if (comptime !features.is_main) {
if (comptime ResolverContext != void) {
- if (comptime std.meta.trait.is(.Pointer)(ResolverContext) and @hasDecl(std.meta.Child(ResolverContext), "resolveWithPackage")) {
- package.resolution = try resolver.resolveWithPackage(*Lockfile.StringBuilder, &string_builder, package);
- } else {
- package.resolution = try resolver.resolve(
- *Lockfile.StringBuilder,
- &string_builder,
- json,
- );
- }
+ package.resolution = try resolver.resolve(
+ *Lockfile.StringBuilder,
+ &string_builder,
+ json,
+ );
}
} else {
package.resolution = .{