diff --git a/src/install/isolated_install.zig b/src/install/isolated_install.zig index 48e85bd5aacf..e4a44b501c30 100644 --- a/src/install/isolated_install.zig +++ b/src/install/isolated_install.zig @@ -250,7 +250,7 @@ pub fn installIsolatedPackages( } } - next_peer: for (peer_dep_ids.items) |peer_dep_id| { + for (peer_dep_ids.items) |peer_dep_id| { const resolved_pkg_id, const auto_installed = resolved_pkg_id: { // Go through the peers parents looking for a package with the same name. @@ -316,13 +316,12 @@ pub fn installIsolatedPackages( // version. Only mark all parents if resolution is // different from this transitive peer. - if (peer_dep.behavior.isOptionalPeer()) { - // exclude it - continue :next_peer; - } - const best_version = resolutions[peer_dep_id]; + if (best_version == invalid_package_id) { + break :resolved_pkg_id .{ invalid_package_id, true }; + } + if (best_version == ids.pkg_id) { break :resolved_pkg_id .{ ids.pkg_id, true }; } @@ -344,16 +343,15 @@ pub fn installIsolatedPackages( curr_id = node_parent_ids[curr_id.get()]; } - if (peer_dep.behavior.isOptionalPeer()) { - // exclude it - continue; - } - // choose the current best version break :resolved_pkg_id .{ resolutions[peer_dep_id], true }; }; - bun.debugAssert(resolved_pkg_id != invalid_package_id); + if (resolved_pkg_id == invalid_package_id) { + // these are optional peers that failed to find any dependency with a matching + // name. they are completely excluded + continue; + } for (visited_parent_node_ids.items) |visited_parent_id| { const ctx: Store.Node.TransitivePeer.OrderedArraySetCtx = .{ diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig index 38679c7c3e6a..adc005856cc1 100644 --- a/src/install/lockfile.zig +++ b/src/install/lockfile.zig @@ -914,7 +914,6 @@ pub fn hoist( var slice = lockfile.packages.slice(); var builder = Tree.Builder(method){ - .name_hashes = slice.items(.name_hash), .queue = .init(allocator), .resolution_lists = slice.items(.resolutions), .resolutions = lockfile.buffers.resolutions.items, @@ -926,6 +925,7 @@ pub fn hoist( .install_root_dependencies = install_root_dependencies, .workspace_filters = workspace_filters, .packages_to_install = packages_to_install, + .pending_optional_peers = .init(bun.default_allocator), }; try (Tree{}).processSubtree( diff --git a/src/install/lockfile/Tree.zig b/src/install/lockfile/Tree.zig index a75feae0705f..471876ae3947 100644 --- a/src/install/lockfile/Tree.zig +++ b/src/install/lockfile/Tree.zig @@ -52,14 +52,20 @@ pub const invalid_id: Id = std.math.maxInt(Id); pub const HoistDependencyResult = union(enum) { dependency_loop, hoisted, - placement: struct { + resolve: PackageID, + resolve_replace: ResolveReplace, + resolve_later, + placement: Placement, + + const ResolveReplace = struct { + id: Id, + dep_id: DependencyID, + }; + + const Placement = struct { id: Id, bundled: bool = false, - }, - // replace: struct { - // dest_id: Id, - // dep_id: DependencyID, - // }, + }; }; pub const SubtreeError = OOM || error{DependencyLoop}; @@ -234,14 +240,16 @@ pub const BuilderMethod = enum { pub fn Builder(comptime method: BuilderMethod) type { return struct { allocator: Allocator, - name_hashes: []const PackageNameHash, list: bun.MultiArrayList(Entry) = .{}, - resolutions: []const PackageID, + resolutions: []PackageID, dependencies: []const Dependency, resolution_lists: []const Lockfile.DependencyIDSlice, queue: TreeFiller, log: *logger.Log, lockfile: *const Lockfile, + // unresolved optional peers that might resolve later. if they do we will want to assign + // builder.resolutions[peer.dep_id] to the resolved pkg_id. + pending_optional_peers: std.AutoHashMap(PackageNameHash, bun.collections.ArrayListDefault(DependencyID)), manager: if (method == .filter) *const PackageManager else void, sort_buf: std.ArrayListUnmanaged(DependencyID) = .{}, workspace_filters: if (method == .filter) []const WorkspaceFilter else void = if (method == .filter) &.{}, @@ -302,6 +310,7 @@ pub fn Builder(comptime method: BuilderMethod) type { } this.queue.deinit(); this.sort_buf.deinit(this.allocator); + this.pending_optional_peers.deinit(); // take over the `builder.list` pointer for only trees if (@intFromPtr(trees.ptr) != @intFromPtr(list_ptr)) { @@ -328,6 +337,10 @@ pub fn isFilteredDependencyOrWorkspace( ) bool { const pkg_id = lockfile.buffers.resolutions.items[dep_id]; if (pkg_id >= lockfile.packages.len) { + const dep = lockfile.buffers.dependencies.items[dep_id]; + if (dep.behavior.isOptionalPeer()) { + return false; + } return true; } @@ -454,8 +467,6 @@ pub fn processSubtree( const trees = list_slice.items(.tree); const dependency_lists = list_slice.items(.dependencies); const next: *Tree = &trees[builder.list.len - 1]; - const name_hashes: []const PackageNameHash = builder.name_hashes; - const max_package_id = @as(PackageID, @truncate(name_hashes.len)); const pkgs = builder.lockfile.packages.slice(); const pkg_resolutions = pkgs.items(.resolution); @@ -478,8 +489,6 @@ pub fn processSubtree( for (builder.sort_buf.items) |dep_id| { const pkg_id = builder.resolutions[dep_id]; - // Skip unresolved packages, e.g. "peerDependencies" - if (pkg_id >= max_package_id) continue; // filter out disabled dependencies if (comptime method == .filter) { @@ -494,6 +503,12 @@ pub fn processSubtree( continue; } + // unresolved packages are skipped when filtering. they already had + // their chance to resolve. + if (pkg_id == invalid_package_id) { + continue; + } + if (builder.packages_to_install) |packages_to_install| { if (parent_pkg_id == 0) { var found = false; @@ -511,14 +526,33 @@ pub fn processSubtree( } } + const dependency = builder.dependencies[dep_id]; + const hoisted: HoistDependencyResult = hoisted: { - const dependency = builder.dependencies[dep_id]; // don't hoist if it's a folder dependency or a bundled dependency. if (dependency.behavior.isBundled()) { break :hoisted .{ .placement = .{ .id = next.id, .bundled = true } }; } + if (pkg_id == invalid_package_id) { + if (dependency.behavior.isOptionalPeer()) { + break :hoisted try next.hoistDependency( + true, + hoist_root_id, + pkg_id, + &dependency, + dependency_lists, + trees, + method, + builder, + ); + } + + // skip unresolvable dependencies + continue; + } + if (pkg_resolutions[pkg_id].tag == .folder) { break :hoisted .{ .placement = .{ .id = next.id } }; } @@ -537,10 +571,61 @@ pub fn processSubtree( switch (hoisted) { .dependency_loop, .hoisted => continue, + + .resolve => |res_id| { + bun.assertWithLocation(pkg_id == invalid_package_id, @src()); + bun.assertWithLocation(res_id != invalid_package_id, @src()); + builder.resolutions[dep_id] = res_id; + if (comptime Environment.allow_assert) { + bun.assertWithLocation(!builder.pending_optional_peers.contains(dependency.name_hash), @src()); + } + if (builder.pending_optional_peers.fetchRemove(dependency.name_hash)) |entry| { + var peers = entry.value; + defer peers.deinit(); + for (peers.items()) |unresolved_dep_id| { + bun.assertWithLocation(builder.resolutions[unresolved_dep_id] == invalid_package_id, @src()); + builder.resolutions[unresolved_dep_id] = res_id; + } + } + }, + .resolve_replace => |replace| { + bun.assertWithLocation(pkg_id != invalid_package_id, @src()); + builder.resolutions[replace.dep_id] = pkg_id; + if (builder.pending_optional_peers.fetchRemove(dependency.name_hash)) |entry| { + var peers = entry.value; + defer peers.deinit(); + for (peers.items()) |unresolved_dep_id| { + bun.assertWithLocation(builder.resolutions[unresolved_dep_id] == invalid_package_id, @src()); + builder.resolutions[unresolved_dep_id] = pkg_id; + } + } + for (dependency_lists[replace.id].items) |*placed_dep_id| { + if (placed_dep_id.* == replace.dep_id) { + placed_dep_id.* = dep_id; + } + } + if (pkg_id != invalid_package_id and builder.resolution_lists[pkg_id].len > 0) { + try builder.queue.writeItem(.{ + .tree_id = replace.id, + .dependency_id = dep_id, + .hoist_root_id = hoist_root_id, + }); + } + }, + .resolve_later => { + // `dep_id` is an unresolved optional peer. while hoisting it deduplicated + // with another unresolved optional peer. save it so we remember resolve it + // later if it's possible to resolve it. + const entry = try builder.pending_optional_peers.getOrPut(dependency.name_hash); + if (!entry.found_existing) { + entry.value_ptr.* = .init(); + } + try entry.value_ptr.append(dep_id); + }, .placement => |dest| { bun.handleOom(dependency_lists[dest.id].append(builder.allocator, dep_id)); trees[dest.id].dependencies.len += 1; - if (builder.resolution_lists[pkg_id].len > 0) { + if (pkg_id != invalid_package_id and builder.resolution_lists[pkg_id].len > 0) { try builder.queue.writeItem(.{ .tree_id = dest.id, .dependency_id = dep_id, @@ -580,7 +665,29 @@ fn hoistDependency( const dep = builder.dependencies[dep_id]; if (dep.name_hash != dependency.name_hash) continue; - if (builder.resolutions[dep_id] == package_id) { + const res_id = builder.resolutions[dep_id]; + + if (res_id == invalid_package_id and package_id == invalid_package_id) { + bun.assertWithLocation(dep.behavior.isOptionalPeer(), @src()); + bun.assertWithLocation(dependency.behavior.isOptionalPeer(), @src()); + // both optional peers will need to be resolved if they can resolve later. + // remember input package_id and dependency for later + return .resolve_later; + } + + if (res_id == invalid_package_id) { + bun.assertWithLocation(dep.behavior.isOptionalPeer(), @src()); + return .{ .resolve_replace = .{ .id = this.id, .dep_id = dep_id } }; + } + + if (package_id == invalid_package_id) { + bun.assertWithLocation(dependency.behavior.isOptionalPeer(), @src()); + bun.assertWithLocation(res_id != invalid_package_id, @src()); + // resolve optional peer to `builder.resolutions[dep_id]` + return .{ .resolve = res_id }; // 1 + } + + if (res_id == package_id) { // this dependency is the same package as the other, hoist return .hoisted; // 1 } @@ -599,7 +706,7 @@ fn hoistDependency( if (dependency.behavior.isPeer()) { if (dependency.version.tag == .npm) { - const resolution: Resolution = builder.lockfile.packages.items(.resolution)[builder.resolutions[dep_id]]; + const resolution: Resolution = builder.lockfile.packages.items(.resolution)[res_id]; const version = dependency.version.value.npm.version; if (resolution.tag == .npm and version.satisfies(resolution.value.npm.version, builder.buf(), builder.buf())) { return .hoisted; // 1 @@ -618,8 +725,8 @@ fn hoistDependency( builder.maybeReportError("Package \"{}@{}\" has a dependency loop\n Resolution: \"{}@{}\"\n Dependency: \"{}@{}\"", .{ builder.packageName(package_id), builder.packageVersion(package_id), - builder.packageName(builder.resolutions[dep_id]), - builder.packageVersion(builder.resolutions[dep_id]), + builder.packageName(res_id), + builder.packageVersion(res_id), dependency.name.fmt(builder.buf()), dependency.version.literal.fmt(builder.buf()), }); diff --git a/test/cli/install/__snapshots__/migrate-bun-lockb-v2.test.ts.snap b/test/cli/install/__snapshots__/migrate-bun-lockb-v2.test.ts.snap new file mode 100644 index 000000000000..27d3a4899d97 --- /dev/null +++ b/test/cli/install/__snapshots__/migrate-bun-lockb-v2.test.ts.snap @@ -0,0 +1,2087 @@ +// Bun Snapshot v1, https://bun.sh/docs/test/snapshots + +exports[`migrate migrate-bun-lockb-v2 1`] = ` +{ + "dependencies": [ + { + "behavior": { + "prod": true, + }, + "id": 0, + "literal": "^1.0.0", + "name": "is-even", + "npm": { + "name": "is-even", + "version": ">=1.0.0 <2.0.0", + }, + "package_id": 2, + }, + { + "behavior": { + "prod": true, + }, + "id": 1, + "literal": "~3.7.1", + "name": "jquery", + "npm": { + "name": "jquery", + "version": ">=3.7.1 <3.8.0", + }, + "package_id": 1, + }, + { + "behavior": { + "prod": true, + }, + "id": 2, + "literal": "^0.1.2", + "name": "is-odd", + "npm": { + "name": "is-odd", + "version": ">=0.1.2 <0.2.0", + }, + "package_id": 3, + }, + { + "behavior": { + "prod": true, + }, + "id": 3, + "literal": "^3.0.0", + "name": "is-number", + "npm": { + "name": "is-number", + "version": ">=3.0.0 <4.0.0", + }, + "package_id": 4, + }, + { + "behavior": { + "prod": true, + }, + "id": 4, + "literal": "^3.0.2", + "name": "kind-of", + "npm": { + "name": "kind-of", + "version": ">=3.0.2 <4.0.0", + }, + "package_id": 5, + }, + { + "behavior": { + "prod": true, + }, + "id": 5, + "literal": "^1.1.5", + "name": "is-buffer", + "npm": { + "name": "is-buffer", + "version": ">=1.1.5 <2.0.0", + }, + "package_id": 6, + }, + ], + "format": "v3", + "meta_hash": "b9927bfb7908a620d68ada06aeac0e7bf460658dbcef45edbfb50f09003dd7df", + "package_index": { + "is-buffer": 6, + "is-even": 2, + "is-number": 4, + "is-odd": 3, + "jquery": 1, + "kind-of": 5, + "migrate-bun-lockb-v2": 0, + }, + "packages": [ + { + "bin": null, + "dependencies": [ + 0, + 1, + ], + "id": 0, + "integrity": null, + "man_dir": "", + "name": "migrate-bun-lockb-v2", + "name_hash": "4533838613693112248", + "origin": "local", + "resolution": { + "resolved": "", + "tag": "root", + "value": "", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 1, + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "man_dir": "", + "name": "jquery", + "name_hash": "265418099762006574", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "tag": "npm", + "value": "3.7.1", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 2, + ], + "id": 2, + "integrity": "sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg==", + "man_dir": "", + "name": "is-even", + "name_hash": "7770159972461911348", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-even/-/is-even-1.0.0.tgz", + "tag": "npm", + "value": "1.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 3, + ], + "id": 3, + "integrity": "sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw==", + "man_dir": "", + "name": "is-odd", + "name_hash": "1288785352440382779", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-0.1.2.tgz", + "tag": "npm", + "value": "0.1.2", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 4, + ], + "id": 4, + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "man_dir": "", + "name": "is-number", + "name_hash": "17443668381655379754", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "tag": "npm", + "value": "3.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 5, + ], + "id": 5, + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "man_dir": "", + "name": "kind-of", + "name_hash": "13897574220744325158", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "tag": "npm", + "value": "3.2.2", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 6, + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "man_dir": "", + "name": "is-buffer", + "name_hash": "3876533396633871001", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "tag": "npm", + "value": "1.1.6", + }, + "scripts": {}, + }, + ], + "trees": [ + { + "dependencies": { + "is-buffer": { + "id": 5, + "package_id": 6, + }, + "is-even": { + "id": 0, + "package_id": 2, + }, + "is-number": { + "id": 3, + "package_id": 4, + }, + "is-odd": { + "id": 2, + "package_id": 3, + }, + "jquery": { + "id": 1, + "package_id": 1, + }, + "kind-of": { + "id": 4, + "package_id": 5, + }, + }, + "depth": 0, + "id": 0, + "path": "node_modules", + }, + ], + "workspace_paths": {}, + "workspace_versions": {}, +} +`; + +exports[`migrate migrate-bun-lockb-v2-most-features 1`] = ` +{ + "dependencies": [ + { + "behavior": { + "workspace": true, + }, + "id": 0, + "literal": "packages/pkg1", + "name": "pkg-wat", + "package_id": 44, + "workspace": "packages/pkg1", + }, + { + "behavior": { + "workspace": true, + }, + "id": 1, + "literal": "packages/pkg2", + "name": "pkg-wat-2", + "package_id": 42, + "workspace": "packages/pkg2", + }, + { + "behavior": { + "dev": true, + }, + "id": 2, + "literal": "0.25.10", + "name": "esbuild", + "npm": { + "name": "esbuild", + "version": "==0.25.10", + }, + "package_id": 15, + }, + { + "behavior": { + "dev": true, + }, + "catalog": { + "name": "react", + "version": "catalog:", + }, + "id": 3, + "literal": "catalog:", + "name": "react", + "package_id": 14, + }, + { + "behavior": { + "dev": true, + }, + "id": 4, + "literal": "^3.22.4", + "name": "zod", + "npm": { + "name": "zod", + "version": ">=3.22.4 <4.0.0", + }, + "package_id": 13, + }, + { + "behavior": { + "optional": true, + }, + "id": 5, + "literal": "^7.0.0", + "name": "is-number", + "npm": { + "name": "is-number", + "version": ">=7.0.0 <8.0.0", + }, + "package_id": 12, + }, + { + "behavior": { + "prod": true, + }, + "id": 6, + "literal": "^0.0.4", + "name": "false", + "npm": { + "name": "false", + "version": ">=0.0.4 <0.0.5", + }, + "package_id": 11, + }, + { + "behavior": { + "prod": true, + }, + "id": 7, + "literal": "~3.7.1", + "name": "jquery", + "npm": { + "name": "jquery", + "version": ">=3.7.1 <3.8.0", + }, + "package_id": 10, + }, + { + "behavior": { + "prod": true, + }, + "id": 8, + "literal": "^0.23.0", + "name": "scheduler", + "npm": { + "name": "scheduler", + "version": ">=0.23.0 <0.24.0", + }, + "package_id": 6, + }, + { + "behavior": { + "peer": true, + }, + "id": 9, + "literal": "^1.0.0", + "name": "is-even", + "npm": { + "name": "is-even", + "version": ">=1.0.0 <2.0.0", + }, + "package_id": 1, + }, + { + "behavior": { + "optional": true, + "peer": true, + }, + "id": 10, + "literal": "^4.17.21", + "name": "lodash", + "npm": { + "name": "lodash", + "version": ">=4.17.21 <5.0.0", + }, + "package_id": null, + }, + { + "behavior": { + "prod": true, + }, + "id": 11, + "literal": "^0.1.2", + "name": "is-odd", + "npm": { + "name": "is-odd", + "version": ">=0.1.2 <0.2.0", + }, + "package_id": 2, + }, + { + "behavior": { + "prod": true, + }, + "id": 12, + "literal": "^3.0.0", + "name": "is-number", + "npm": { + "name": "is-number", + "version": ">=3.0.0 <4.0.0", + }, + "package_id": 3, + }, + { + "behavior": { + "prod": true, + }, + "id": 13, + "literal": "^3.0.2", + "name": "kind-of", + "npm": { + "name": "kind-of", + "version": ">=3.0.2 <4.0.0", + }, + "package_id": 4, + }, + { + "behavior": { + "prod": true, + }, + "id": 14, + "literal": "^1.1.5", + "name": "is-buffer", + "npm": { + "name": "is-buffer", + "version": ">=1.1.5 <2.0.0", + }, + "package_id": 5, + }, + { + "behavior": { + "prod": true, + }, + "id": 15, + "literal": "^1.1.0", + "name": "loose-envify", + "npm": { + "name": "loose-envify", + "version": ">=1.1.0 <2.0.0", + }, + "package_id": 8, + }, + { + "behavior": { + "prod": true, + }, + "id": 16, + "literal": "^4.1.1", + "name": "object-assign", + "npm": { + "name": "object-assign", + "version": ">=4.1.1 <5.0.0", + }, + "package_id": 7, + }, + { + "behavior": { + "prod": true, + }, + "id": 17, + "literal": "^3.0.0 || ^4.0.0", + "name": "js-tokens", + "npm": { + "name": "js-tokens", + "version": ">=3.0.0 <4.0.0 || >=4.0.0 <5.0.0 && >=4.0.0 <5.0.0", + }, + "package_id": 9, + }, + { + "behavior": { + "optional": true, + }, + "id": 18, + "literal": "0.25.10", + "name": "@esbuild/aix-ppc64", + "npm": { + "name": "@esbuild/aix-ppc64", + "version": "==0.25.10", + }, + "package_id": 41, + }, + { + "behavior": { + "optional": true, + }, + "id": 19, + "literal": "0.25.10", + "name": "@esbuild/android-arm", + "npm": { + "name": "@esbuild/android-arm", + "version": "==0.25.10", + }, + "package_id": 40, + }, + { + "behavior": { + "optional": true, + }, + "id": 20, + "literal": "0.25.10", + "name": "@esbuild/android-arm64", + "npm": { + "name": "@esbuild/android-arm64", + "version": "==0.25.10", + }, + "package_id": 39, + }, + { + "behavior": { + "optional": true, + }, + "id": 21, + "literal": "0.25.10", + "name": "@esbuild/android-x64", + "npm": { + "name": "@esbuild/android-x64", + "version": "==0.25.10", + }, + "package_id": 38, + }, + { + "behavior": { + "optional": true, + }, + "id": 22, + "literal": "0.25.10", + "name": "@esbuild/darwin-arm64", + "npm": { + "name": "@esbuild/darwin-arm64", + "version": "==0.25.10", + }, + "package_id": 37, + }, + { + "behavior": { + "optional": true, + }, + "id": 23, + "literal": "0.25.10", + "name": "@esbuild/darwin-x64", + "npm": { + "name": "@esbuild/darwin-x64", + "version": "==0.25.10", + }, + "package_id": 36, + }, + { + "behavior": { + "optional": true, + }, + "id": 24, + "literal": "0.25.10", + "name": "@esbuild/freebsd-arm64", + "npm": { + "name": "@esbuild/freebsd-arm64", + "version": "==0.25.10", + }, + "package_id": 35, + }, + { + "behavior": { + "optional": true, + }, + "id": 25, + "literal": "0.25.10", + "name": "@esbuild/freebsd-x64", + "npm": { + "name": "@esbuild/freebsd-x64", + "version": "==0.25.10", + }, + "package_id": 34, + }, + { + "behavior": { + "optional": true, + }, + "id": 26, + "literal": "0.25.10", + "name": "@esbuild/linux-arm", + "npm": { + "name": "@esbuild/linux-arm", + "version": "==0.25.10", + }, + "package_id": 33, + }, + { + "behavior": { + "optional": true, + }, + "id": 27, + "literal": "0.25.10", + "name": "@esbuild/linux-arm64", + "npm": { + "name": "@esbuild/linux-arm64", + "version": "==0.25.10", + }, + "package_id": 32, + }, + { + "behavior": { + "optional": true, + }, + "id": 28, + "literal": "0.25.10", + "name": "@esbuild/linux-ia32", + "npm": { + "name": "@esbuild/linux-ia32", + "version": "==0.25.10", + }, + "package_id": 31, + }, + { + "behavior": { + "optional": true, + }, + "id": 29, + "literal": "0.25.10", + "name": "@esbuild/linux-loong64", + "npm": { + "name": "@esbuild/linux-loong64", + "version": "==0.25.10", + }, + "package_id": 30, + }, + { + "behavior": { + "optional": true, + }, + "id": 30, + "literal": "0.25.10", + "name": "@esbuild/linux-mips64el", + "npm": { + "name": "@esbuild/linux-mips64el", + "version": "==0.25.10", + }, + "package_id": 29, + }, + { + "behavior": { + "optional": true, + }, + "id": 31, + "literal": "0.25.10", + "name": "@esbuild/linux-ppc64", + "npm": { + "name": "@esbuild/linux-ppc64", + "version": "==0.25.10", + }, + "package_id": 28, + }, + { + "behavior": { + "optional": true, + }, + "id": 32, + "literal": "0.25.10", + "name": "@esbuild/linux-riscv64", + "npm": { + "name": "@esbuild/linux-riscv64", + "version": "==0.25.10", + }, + "package_id": 27, + }, + { + "behavior": { + "optional": true, + }, + "id": 33, + "literal": "0.25.10", + "name": "@esbuild/linux-s390x", + "npm": { + "name": "@esbuild/linux-s390x", + "version": "==0.25.10", + }, + "package_id": 26, + }, + { + "behavior": { + "optional": true, + }, + "id": 34, + "literal": "0.25.10", + "name": "@esbuild/linux-x64", + "npm": { + "name": "@esbuild/linux-x64", + "version": "==0.25.10", + }, + "package_id": 25, + }, + { + "behavior": { + "optional": true, + }, + "id": 35, + "literal": "0.25.10", + "name": "@esbuild/netbsd-arm64", + "npm": { + "name": "@esbuild/netbsd-arm64", + "version": "==0.25.10", + }, + "package_id": 24, + }, + { + "behavior": { + "optional": true, + }, + "id": 36, + "literal": "0.25.10", + "name": "@esbuild/netbsd-x64", + "npm": { + "name": "@esbuild/netbsd-x64", + "version": "==0.25.10", + }, + "package_id": 23, + }, + { + "behavior": { + "optional": true, + }, + "id": 37, + "literal": "0.25.10", + "name": "@esbuild/openbsd-arm64", + "npm": { + "name": "@esbuild/openbsd-arm64", + "version": "==0.25.10", + }, + "package_id": 22, + }, + { + "behavior": { + "optional": true, + }, + "id": 38, + "literal": "0.25.10", + "name": "@esbuild/openbsd-x64", + "npm": { + "name": "@esbuild/openbsd-x64", + "version": "==0.25.10", + }, + "package_id": 21, + }, + { + "behavior": { + "optional": true, + }, + "id": 39, + "literal": "0.25.10", + "name": "@esbuild/openharmony-arm64", + "npm": { + "name": "@esbuild/openharmony-arm64", + "version": "==0.25.10", + }, + "package_id": 20, + }, + { + "behavior": { + "optional": true, + }, + "id": 40, + "literal": "0.25.10", + "name": "@esbuild/sunos-x64", + "npm": { + "name": "@esbuild/sunos-x64", + "version": "==0.25.10", + }, + "package_id": 19, + }, + { + "behavior": { + "optional": true, + }, + "id": 41, + "literal": "0.25.10", + "name": "@esbuild/win32-arm64", + "npm": { + "name": "@esbuild/win32-arm64", + "version": "==0.25.10", + }, + "package_id": 18, + }, + { + "behavior": { + "optional": true, + }, + "id": 42, + "literal": "0.25.10", + "name": "@esbuild/win32-ia32", + "npm": { + "name": "@esbuild/win32-ia32", + "version": "==0.25.10", + }, + "package_id": 17, + }, + { + "behavior": { + "optional": true, + }, + "id": 43, + "literal": "0.25.10", + "name": "@esbuild/win32-x64", + "npm": { + "name": "@esbuild/win32-x64", + "version": "==0.25.10", + }, + "package_id": 16, + }, + { + "behavior": { + "prod": true, + }, + "id": 44, + "literal": "6.0.3", + "name": "kind-of", + "npm": { + "name": "kind-of", + "version": "==6.0.3", + }, + "package_id": 43, + }, + { + "behavior": { + "prod": true, + }, + "id": 45, + "literal": "3.7.0", + "name": "jquery", + "npm": { + "name": "jquery", + "version": "==3.7.0", + }, + "package_id": 45, + }, + { + "behavior": { + "prod": true, + }, + "id": 46, + "literal": "workspace:", + "name": "pkg-wat-2", + "package_id": 42, + "workspace": "", + }, + ], + "format": "v3", + "meta_hash": "570d874a26ea3cde290c102a78c1a6b51ff33d19f52c50b0dbc0b125bd4d8233", + "package_index": { + "@esbuild/aix-ppc64": 41, + "@esbuild/android-arm": 40, + "@esbuild/android-arm64": 39, + "@esbuild/android-x64": 38, + "@esbuild/darwin-arm64": 37, + "@esbuild/darwin-x64": 36, + "@esbuild/freebsd-arm64": 35, + "@esbuild/freebsd-x64": 34, + "@esbuild/linux-arm": 33, + "@esbuild/linux-arm64": 32, + "@esbuild/linux-ia32": 31, + "@esbuild/linux-loong64": 30, + "@esbuild/linux-mips64el": 29, + "@esbuild/linux-ppc64": 28, + "@esbuild/linux-riscv64": 27, + "@esbuild/linux-s390x": 26, + "@esbuild/linux-x64": 25, + "@esbuild/netbsd-arm64": 24, + "@esbuild/netbsd-x64": 23, + "@esbuild/openbsd-arm64": 22, + "@esbuild/openbsd-x64": 21, + "@esbuild/openharmony-arm64": 20, + "@esbuild/sunos-x64": 19, + "@esbuild/win32-arm64": 18, + "@esbuild/win32-ia32": 17, + "@esbuild/win32-x64": 16, + "esbuild": 15, + "false": 11, + "is-buffer": 5, + "is-even": 1, + "is-number": [ + 12, + 3, + ], + "is-odd": 2, + "jquery": [ + 10, + 45, + ], + "js-tokens": 9, + "kind-of": [ + 43, + 4, + ], + "loose-envify": 8, + "migrate-everything": 0, + "object-assign": 7, + "pkg-wat": 44, + "pkg-wat-2": 42, + "react": 14, + "scheduler": 6, + "zod": 13, + }, + "packages": [ + { + "bin": null, + "dependencies": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + ], + "id": 0, + "integrity": null, + "man_dir": "", + "name": "migrate-everything", + "name_hash": "11252688678730182607", + "origin": "local", + "resolution": { + "resolved": "", + "tag": "root", + "value": "", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 11, + ], + "id": 1, + "integrity": "sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg==", + "man_dir": "", + "name": "is-even", + "name_hash": "7770159972461911348", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-even/-/is-even-1.0.0.tgz", + "tag": "npm", + "value": "1.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 12, + ], + "id": 2, + "integrity": "sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw==", + "man_dir": "", + "name": "is-odd", + "name_hash": "1288785352440382779", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-0.1.2.tgz", + "tag": "npm", + "value": "0.1.2", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 13, + ], + "id": 3, + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "man_dir": "", + "name": "is-number", + "name_hash": "17443668381655379754", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "tag": "npm", + "value": "3.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 14, + ], + "id": 4, + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "man_dir": "", + "name": "kind-of", + "name_hash": "13897574220744325158", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "tag": "npm", + "value": "3.2.2", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 5, + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "man_dir": "", + "name": "is-buffer", + "name_hash": "3876533396633871001", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "tag": "npm", + "value": "1.1.6", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 15, + 16, + ], + "id": 6, + "integrity": "sha512-XegIgta1bIaz2LdaL6eg1GEcE42g0BY9qFXCqlZ/+s2MuEKfigFCW6DEGBlZzeVFlwDmVusrWEyFtBo4sbkkdA==", + "man_dir": "", + "name": "scheduler", + "name_hash": "6246319597786948434", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.0.tgz", + "tag": "npm", + "value": "0.20.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 7, + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "man_dir": "", + "name": "object-assign", + "name_hash": "741501977461426514", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "tag": "npm", + "value": "4.1.1", + }, + "scripts": {}, + }, + { + "bin": { + "file": "cli.js", + "name": "loose-envify", + }, + "dependencies": [ + 17, + ], + "id": 8, + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "man_dir": "", + "name": "loose-envify", + "name_hash": "3112622411417245442", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "tag": "npm", + "value": "1.4.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 9, + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "man_dir": "", + "name": "js-tokens", + "name_hash": "8072375596980283624", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "tag": "npm", + "value": "4.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 10, + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "man_dir": "", + "name": "jquery", + "name_hash": "265418099762006574", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "tag": "npm", + "value": "3.7.1", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 11, + "integrity": "sha512-CPAG3ud9Cz8NvLKlsTLr/F1aoJL6tPyhNTzaDFzS5CX6id21hVuS5sBK8wlTLuvFklpvH1idvPbW8Lbri3G7qA==", + "man_dir": "", + "name": "false", + "name_hash": "14246137032213060424", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/false/-/false-0.0.4.tgz", + "tag": "npm", + "value": "0.0.4", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 12, + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "man_dir": "", + "name": "is-number", + "name_hash": "17443668381655379754", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "tag": "npm", + "value": "7.0.0", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 13, + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "man_dir": "", + "name": "zod", + "name_hash": "13942938047053248045", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "tag": "npm", + "value": "3.25.76", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 14, + "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", + "man_dir": "", + "name": "react", + "name_hash": "10719851453835962256", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", + "tag": "npm", + "value": "19.1.1", + }, + "scripts": {}, + }, + { + "bin": { + "file": "bin/esbuild", + "name": "esbuild", + }, + "dependencies": [ + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + ], + "id": 15, + "integrity": "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==", + "man_dir": "", + "name": "esbuild", + "name_hash": "13254946337092084496", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 16, + "integrity": "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==", + "man_dir": "", + "name": "@esbuild/win32-x64", + "name_hash": "8841853191689358390", + "origin": "npm", + "os": [ + "win32", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "ia32", + ], + "bin": null, + "dependencies": [], + "id": 17, + "integrity": "sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==", + "man_dir": "", + "name": "@esbuild/win32-ia32", + "name_hash": "14741409370801574152", + "origin": "npm", + "os": [ + "win32", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 18, + "integrity": "sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==", + "man_dir": "", + "name": "@esbuild/win32-arm64", + "name_hash": "10616572549607257800", + "origin": "npm", + "os": [ + "win32", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 19, + "integrity": "sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==", + "man_dir": "", + "name": "@esbuild/sunos-x64", + "name_hash": "17818235823914608065", + "origin": "npm", + "os": [ + "sunos", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 20, + "integrity": "sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==", + "man_dir": "", + "name": "@esbuild/openharmony-arm64", + "name_hash": "14507817562898589114", + "origin": "npm", + "os": [], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 21, + "integrity": "sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==", + "man_dir": "", + "name": "@esbuild/openbsd-x64", + "name_hash": "9843335422580374419", + "origin": "npm", + "os": [ + "openbsd", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 22, + "integrity": "sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==", + "man_dir": "", + "name": "@esbuild/openbsd-arm64", + "name_hash": "7084930640788656434", + "origin": "npm", + "os": [ + "openbsd", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 23, + "integrity": "sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==", + "man_dir": "", + "name": "@esbuild/netbsd-x64", + "name_hash": "8663255934676239496", + "origin": "npm", + "os": [], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 24, + "integrity": "sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==", + "man_dir": "", + "name": "@esbuild/netbsd-arm64", + "name_hash": "5074083378749729580", + "origin": "npm", + "os": [], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 25, + "integrity": "sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==", + "man_dir": "", + "name": "@esbuild/linux-x64", + "name_hash": "13544082894153357031", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "s390x", + ], + "bin": null, + "dependencies": [], + "id": 26, + "integrity": "sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==", + "man_dir": "", + "name": "@esbuild/linux-s390x", + "name_hash": "17731831782316971618", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [], + "bin": null, + "dependencies": [], + "id": 27, + "integrity": "sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==", + "man_dir": "", + "name": "@esbuild/linux-riscv64", + "name_hash": "4735976835754647660", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "ppc64", + ], + "bin": null, + "dependencies": [], + "id": 28, + "integrity": "sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==", + "man_dir": "", + "name": "@esbuild/linux-ppc64", + "name_hash": "11665320297089208874", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [], + "bin": null, + "dependencies": [], + "id": 29, + "integrity": "sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==", + "man_dir": "", + "name": "@esbuild/linux-mips64el", + "name_hash": "5758178421336220113", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [], + "bin": null, + "dependencies": [], + "id": 30, + "integrity": "sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==", + "man_dir": "", + "name": "@esbuild/linux-loong64", + "name_hash": "11252031954434475691", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "ia32", + ], + "bin": null, + "dependencies": [], + "id": 31, + "integrity": "sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==", + "man_dir": "", + "name": "@esbuild/linux-ia32", + "name_hash": "15142519142185085346", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 32, + "integrity": "sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==", + "man_dir": "", + "name": "@esbuild/linux-arm64", + "name_hash": "13968642332621702107", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm", + ], + "bin": null, + "dependencies": [], + "id": 33, + "integrity": "sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==", + "man_dir": "", + "name": "@esbuild/linux-arm", + "name_hash": "16603934224415504745", + "origin": "npm", + "os": [ + "linux", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 34, + "integrity": "sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==", + "man_dir": "", + "name": "@esbuild/freebsd-x64", + "name_hash": "4612505319005618370", + "origin": "npm", + "os": [ + "freebsd", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 35, + "integrity": "sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==", + "man_dir": "", + "name": "@esbuild/freebsd-arm64", + "name_hash": "14372867258341136141", + "origin": "npm", + "os": [ + "freebsd", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 36, + "integrity": "sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg==", + "man_dir": "", + "name": "@esbuild/darwin-x64", + "name_hash": "148344697379242544", + "origin": "npm", + "os": [ + "darwin", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 37, + "integrity": "sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==", + "man_dir": "", + "name": "@esbuild/darwin-arm64", + "name_hash": "6513306581678955422", + "origin": "npm", + "os": [ + "darwin", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "x64", + ], + "bin": null, + "dependencies": [], + "id": 38, + "integrity": "sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==", + "man_dir": "", + "name": "@esbuild/android-x64", + "name_hash": "7293239100947757592", + "origin": "npm", + "os": [ + "android", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm64", + ], + "bin": null, + "dependencies": [], + "id": 39, + "integrity": "sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==", + "man_dir": "", + "name": "@esbuild/android-arm64", + "name_hash": "12038435285769403986", + "origin": "npm", + "os": [ + "android", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "arm", + ], + "bin": null, + "dependencies": [], + "id": 40, + "integrity": "sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==", + "man_dir": "", + "name": "@esbuild/android-arm", + "name_hash": "14010109405703440328", + "origin": "npm", + "os": [ + "android", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "arch": [ + "ppc64", + ], + "bin": null, + "dependencies": [], + "id": 41, + "integrity": "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==", + "man_dir": "", + "name": "@esbuild/aix-ppc64", + "name_hash": "4160537343427600094", + "origin": "npm", + "os": [ + "aix", + ], + "resolution": { + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz", + "tag": "npm", + "value": "0.25.10", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 44, + ], + "id": 42, + "integrity": null, + "man_dir": "", + "name": "pkg-wat-2", + "name_hash": "5824839127353763395", + "origin": "npm", + "resolution": { + "resolved": "workspace:packages/pkg2", + "tag": "workspace", + "value": "workspace:packages/pkg2", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 43, + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "man_dir": "", + "name": "kind-of", + "name_hash": "13897574220744325158", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "tag": "npm", + "value": "6.0.3", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [ + 45, + 46, + ], + "id": 44, + "integrity": null, + "man_dir": "", + "name": "pkg-wat", + "name_hash": "8896020699701999556", + "origin": "npm", + "resolution": { + "resolved": "workspace:packages/pkg1", + "tag": "workspace", + "value": "workspace:packages/pkg1", + }, + "scripts": {}, + }, + { + "bin": null, + "dependencies": [], + "id": 45, + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==", + "man_dir": "", + "name": "jquery", + "name_hash": "265418099762006574", + "origin": "npm", + "resolution": { + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "tag": "npm", + "value": "3.7.0", + }, + "scripts": {}, + }, + ], + "trees": [ + { + "dependencies": { + "@esbuild/aix-ppc64": { + "id": 18, + "package_id": 41, + }, + "@esbuild/android-arm": { + "id": 19, + "package_id": 40, + }, + "@esbuild/android-arm64": { + "id": 20, + "package_id": 39, + }, + "@esbuild/android-x64": { + "id": 21, + "package_id": 38, + }, + "@esbuild/darwin-arm64": { + "id": 22, + "package_id": 37, + }, + "@esbuild/darwin-x64": { + "id": 23, + "package_id": 36, + }, + "@esbuild/freebsd-arm64": { + "id": 24, + "package_id": 35, + }, + "@esbuild/freebsd-x64": { + "id": 25, + "package_id": 34, + }, + "@esbuild/linux-arm": { + "id": 26, + "package_id": 33, + }, + "@esbuild/linux-arm64": { + "id": 27, + "package_id": 32, + }, + "@esbuild/linux-ia32": { + "id": 28, + "package_id": 31, + }, + "@esbuild/linux-loong64": { + "id": 29, + "package_id": 30, + }, + "@esbuild/linux-mips64el": { + "id": 30, + "package_id": 29, + }, + "@esbuild/linux-ppc64": { + "id": 31, + "package_id": 28, + }, + "@esbuild/linux-riscv64": { + "id": 32, + "package_id": 27, + }, + "@esbuild/linux-s390x": { + "id": 33, + "package_id": 26, + }, + "@esbuild/linux-x64": { + "id": 34, + "package_id": 25, + }, + "@esbuild/netbsd-arm64": { + "id": 35, + "package_id": 24, + }, + "@esbuild/netbsd-x64": { + "id": 36, + "package_id": 23, + }, + "@esbuild/openbsd-arm64": { + "id": 37, + "package_id": 22, + }, + "@esbuild/openbsd-x64": { + "id": 38, + "package_id": 21, + }, + "@esbuild/openharmony-arm64": { + "id": 39, + "package_id": 20, + }, + "@esbuild/sunos-x64": { + "id": 40, + "package_id": 19, + }, + "@esbuild/win32-arm64": { + "id": 41, + "package_id": 18, + }, + "@esbuild/win32-ia32": { + "id": 42, + "package_id": 17, + }, + "@esbuild/win32-x64": { + "id": 43, + "package_id": 16, + }, + "esbuild": { + "id": 2, + "package_id": 15, + }, + "false": { + "id": 6, + "package_id": 11, + }, + "is-buffer": { + "id": 14, + "package_id": 5, + }, + "is-even": { + "id": 9, + "package_id": 1, + }, + "is-number": { + "id": 5, + "package_id": 12, + }, + "is-odd": { + "id": 11, + "package_id": 2, + }, + "jquery": { + "id": 7, + "package_id": 10, + }, + "js-tokens": { + "id": 17, + "package_id": 9, + }, + "kind-of": { + "id": 44, + "package_id": 43, + }, + "lodash": { + "id": 10, + "package_id": 4294967295, + }, + "loose-envify": { + "id": 15, + "package_id": 8, + }, + "object-assign": { + "id": 16, + "package_id": 7, + }, + "pkg-wat": { + "id": 0, + "package_id": 44, + }, + "pkg-wat-2": { + "id": 1, + "package_id": 42, + }, + "react": { + "id": 3, + "package_id": 14, + }, + "scheduler": { + "id": 8, + "package_id": 6, + }, + "zod": { + "id": 4, + "package_id": 13, + }, + }, + "depth": 0, + "id": 0, + "path": "node_modules", + }, + { + "dependencies": { + "jquery": { + "id": 45, + "package_id": 45, + }, + }, + "depth": 1, + "id": 1, + "path": "node_modules/pkg-wat/node_modules", + }, + { + "dependencies": { + "is-number": { + "id": 12, + "package_id": 3, + }, + }, + "depth": 1, + "id": 2, + "path": "node_modules/is-odd/node_modules", + }, + { + "dependencies": { + "kind-of": { + "id": 13, + "package_id": 4, + }, + }, + "depth": 2, + "id": 3, + "path": "node_modules/is-odd/node_modules/is-number/node_modules", + }, + ], + "workspace_paths": { + "5824839127353763395": "packages/pkg2", + "8896020699701999556": "packages/pkg1", + }, + "workspace_versions": {}, +} +`; diff --git a/test/cli/install/isolated-install.test.ts b/test/cli/install/isolated-install.test.ts index ffa3812f0a98..a39d0ff2a126 100644 --- a/test/cli/install/isolated-install.test.ts +++ b/test/cli/install/isolated-install.test.ts @@ -467,6 +467,138 @@ describe("isolated workspaces", () => { }); }); +describe("optional peers", () => { + const tests = [ + // non-optional versions + { + name: "non-optional transitive only", + deps: [{ "one-optional-peer-dep": "1.0.1" }, { "one-optional-peer-dep": "1.0.1" }], + expected: ["no-deps@1.1.0", "node_modules", "one-optional-peer-dep@1.0.1+7ff199101204a65d"], + }, + { + name: "non-optional direct pkg1", + deps: [{ "one-optional-peer-dep": "1.0.1", "no-deps": "1.0.1" }, { "one-optional-peer-dep": "1.0.1" }], + expected: ["no-deps@1.0.1", "node_modules", "one-optional-peer-dep@1.0.1+f8a822eca018d0a1"], + }, + { + name: "non-optional direct pkg2", + deps: [{ "one-optional-peer-dep": "1.0.1" }, { "one-optional-peer-dep": "1.0.1", "no-deps": "1.0.1" }], + expected: ["no-deps@1.0.1", "node_modules", "one-optional-peer-dep@1.0.1+f8a822eca018d0a1"], + }, + // optional versions + { + name: "optional transitive only", + deps: [{ "one-optional-peer-dep": "1.0.2" }, { "one-optional-peer-dep": "1.0.2" }], + expected: ["node_modules", "one-optional-peer-dep@1.0.2"], + }, + { + name: "optional direct pkg1", + deps: [{ "one-optional-peer-dep": "1.0.2", "no-deps": "1.0.1" }, { "one-optional-peer-dep": "1.0.2" }], + expected: ["no-deps@1.0.1", "node_modules", "one-optional-peer-dep@1.0.2+f8a822eca018d0a1"], + }, + { + name: "optional direct pkg2", + deps: [{ "one-optional-peer-dep": "1.0.2" }, { "one-optional-peer-dep": "1.0.2", "no-deps": "1.0.1" }], + expected: ["no-deps@1.0.1", "node_modules", "one-optional-peer-dep@1.0.2+f8a822eca018d0a1"], + }, + ]; + + for (const { deps, expected, name } of tests) { + test(`will resolve if available through another importer (${name})`, async () => { + const { packageDir } = await registry.createTestDir({ + bunfigOpts: { isolated: true }, + files: { + "package.json": JSON.stringify({ + name: "optional-peers", + workspaces: ["packages/*"], + }), + "packages/pkg1/package.json": JSON.stringify({ + name: "pkg1", + dependencies: deps[0], + }), + "packages/pkg2/package.json": JSON.stringify({ + name: "pkg2", + dependencies: deps[1], + }), + }, + }); + + async function checkInstall() { + const { exited } = spawn({ + cmd: [bunExe(), "install"], + cwd: packageDir, + env: bunEnv, + stdout: "ignore", + stderr: "ignore", + }); + + expect(await exited).toBe(0); + expect(await readdirSorted(join(packageDir, "node_modules/.bun"))).toEqual(expected); + } + + // without lockfile + // without node_modules + await checkInstall(); + + // with lockfile + // without node_modules + await rm(join(packageDir, "node_modules"), { recursive: true, force: true }); + await checkInstall(); + + // without lockfile + // with node_modules + await rm(join(packageDir, "bun.lock"), { force: true }); + await checkInstall(); + + // with lockfile + // with node_modules + await checkInstall(); + }); + } + + test("successfully resolves optional peer with nested package", async () => { + const { packageDir } = await registry.createTestDir({ + bunfigOpts: { isolated: true }, + files: { + "package.json": JSON.stringify({ + name: "optional-peer-nested-resolve", + dependencies: { + "one-one-dep": "1.0.0", + }, + peerDependencies: { + "one-dep": "1.0.0", + }, + peerDependenciesMeta: { + "one-dep": { + optional: true, + }, + }, + }), + }, + }); + + async function checkInstall() { + let { exited } = spawn({ + cmd: [bunExe(), "install"], + cwd: packageDir, + env: bunEnv, + }); + expect(await exited).toBe(0); + + expect(await readdirSorted(join(packageDir, "node_modules"))).toEqual([".bun", "one-dep", "one-one-dep"]); + expect(await readdirSorted(join(packageDir, "node_modules/.bun"))).toEqual([ + "no-deps@1.0.1", + "node_modules", + "one-dep@1.0.0", + "one-one-dep@1.0.0", + ]); + } + + await checkInstall(); + await checkInstall(); + }); +}); + for (const backend of ["clonefile", "hardlink", "copyfile"]) { test(`isolated install with backend: ${backend}`, async () => { const { packageJson, packageDir } = await registry.createTestDir({ bunfigOpts: { isolated: true } }); diff --git a/test/cli/install/migrate-bun-lockb-v2.test.ts b/test/cli/install/migrate-bun-lockb-v2.test.ts index 671a938f56eb..3c4a4d141589 100644 --- a/test/cli/install/migrate-bun-lockb-v2.test.ts +++ b/test/cli/install/migrate-bun-lockb-v2.test.ts @@ -85,8 +85,6 @@ for (const testInfo of tests) { await cp(join(import.meta.dir, "fixtures", testInfo.lockfile), join(testDir, "bun.lockb")); - const oldLockfile = parseLockfile(testDir); - let { stderr, exited } = spawn({ cmd: [bunExe(), "install"], cwd: testDir, @@ -106,7 +104,7 @@ for (const testInfo of tests) { // contents should be different due to semver numbers changing size expect(newLockfileContents).not.toEqual(oldLockfileContents); // but parse result should be the same - expect(newLockfile).toEqual(oldLockfile); + expect(newLockfile).toMatchSnapshot(); // another install should not change the lockfile ({ stderr, exited } = spawn({ diff --git a/test/cli/install/registry/packages/one-one-dep/one-one-dep-1.0.0.tgz b/test/cli/install/registry/packages/one-one-dep/one-one-dep-1.0.0.tgz new file mode 100644 index 000000000000..7ffb493935cc Binary files /dev/null and b/test/cli/install/registry/packages/one-one-dep/one-one-dep-1.0.0.tgz differ diff --git a/test/cli/install/registry/packages/one-one-dep/package.json b/test/cli/install/registry/packages/one-one-dep/package.json new file mode 100644 index 000000000000..c8636a04e3d2 --- /dev/null +++ b/test/cli/install/registry/packages/one-one-dep/package.json @@ -0,0 +1,44 @@ +{ + "name": "one-one-dep", + "versions": { + "1.0.0": { + "name": "one-one-dep", + "version": "1.0.0", + "dependencies": { + "one-dep": "1.0.0" + }, + "_id": "one-one-dep@1.0.0", + "_integrity": "sha512-S6Bn6e9/9cZITQE2DiS8P3gd+Zwb6DF8LyLPcNemmE0nLh5kfjnxnGypmjzaRnSRnfqjEfqRFhjJPomjyNphuQ==", + "_nodeVersion": "24.3.0", + "_npmVersion": "10.8.3", + "integrity": "sha512-S6Bn6e9/9cZITQE2DiS8P3gd+Zwb6DF8LyLPcNemmE0nLh5kfjnxnGypmjzaRnSRnfqjEfqRFhjJPomjyNphuQ==", + "shasum": "52fab2c318e3e5b13fc6a4fb52da3791d79bba84", + "dist": { + "integrity": "sha512-S6Bn6e9/9cZITQE2DiS8P3gd+Zwb6DF8LyLPcNemmE0nLh5kfjnxnGypmjzaRnSRnfqjEfqRFhjJPomjyNphuQ==", + "shasum": "52fab2c318e3e5b13fc6a4fb52da3791d79bba84", + "tarball": "http://http://localhost:4873/one-one-dep/-/one-one-dep-1.0.0.tgz" + }, + "contributors": [] + } + }, + "time": { + "modified": "2025-11-01T03:49:53.670Z", + "created": "2025-11-01T03:49:53.670Z", + "1.0.0": "2025-11-01T03:49:53.670Z" + }, + "users": {}, + "dist-tags": { + "latest": "1.0.0" + }, + "_uplinks": {}, + "_distfiles": {}, + "_attachments": { + "one-one-dep-1.0.0.tgz": { + "shasum": "52fab2c318e3e5b13fc6a4fb52da3791d79bba84", + "version": "1.0.0" + } + }, + "_rev": "", + "_id": "one-one-dep", + "readme": "" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.1.tgz b/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.1.tgz new file mode 100644 index 000000000000..aee036cfc23f Binary files /dev/null and b/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.1.tgz differ diff --git a/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.2.tgz b/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.2.tgz new file mode 100644 index 000000000000..107138e6e66a Binary files /dev/null and b/test/cli/install/registry/packages/one-optional-peer-dep/one-optional-peer-dep-1.0.2.tgz differ diff --git a/test/cli/install/registry/packages/one-optional-peer-dep/package.json b/test/cli/install/registry/packages/one-optional-peer-dep/package.json new file mode 100644 index 000000000000..de8eeff651d2 --- /dev/null +++ b/test/cli/install/registry/packages/one-optional-peer-dep/package.json @@ -0,0 +1,73 @@ +{ + "name": "one-optional-peer-dep", + "versions": { + "1.0.1": { + "name": "one-optional-peer-dep", + "version": "1.0.1", + "peerDependencies": { + "no-deps": "^1.0.0" + }, + "_id": "one-optional-peer-dep@1.0.1", + "_integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==", + "_nodeVersion": "24.3.0", + "_npmVersion": "10.8.3", + "integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==", + "shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71", + "dist": { + "integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==", + "shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71", + "tarball": "http://http://localhost:4873/one-optional-peer-dep/-/one-optional-peer-dep-1.0.1.tgz" + }, + "contributors": [] + }, + "1.0.2": { + "name": "one-optional-peer-dep", + "version": "1.0.2", + "peerDependencies": { + "no-deps": "^1.0.0" + }, + "peerDependenciesMeta": { + "no-deps": { + "optional": true + } + }, + "_id": "one-optional-peer-dep@1.0.2", + "_integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==", + "_nodeVersion": "24.3.0", + "_npmVersion": "10.8.3", + "integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==", + "shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d", + "dist": { + "integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==", + "shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d", + "tarball": "http://http://localhost:4873/one-optional-peer-dep/-/one-optional-peer-dep-1.0.2.tgz" + }, + "contributors": [] + } + }, + "time": { + "modified": "2025-10-31T21:56:37.922Z", + "created": "2025-10-31T21:48:54.585Z", + "1.0.1": "2025-10-31T21:48:54.585Z", + "1.0.2": "2025-10-31T21:56:37.922Z" + }, + "users": {}, + "dist-tags": { + "latest": "1.0.2" + }, + "_uplinks": {}, + "_distfiles": {}, + "_attachments": { + "one-optional-peer-dep-1.0.1.tgz": { + "shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71", + "version": "1.0.1" + }, + "one-optional-peer-dep-1.0.2.tgz": { + "shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d", + "version": "1.0.2" + } + }, + "_rev": "", + "_id": "one-optional-peer-dep", + "readme": "" +} \ No newline at end of file diff --git a/test/integration/next-pages/test/__snapshots__/dev-server-ssr-100.test.ts.snap b/test/integration/next-pages/test/__snapshots__/dev-server-ssr-100.test.ts.snap index 89959331b6e0..8b3ef2323b3b 100644 --- a/test/integration/next-pages/test/__snapshots__/dev-server-ssr-100.test.ts.snap +++ b/test/integration/next-pages/test/__snapshots__/dev-server-ssr-100.test.ts.snap @@ -23958,10 +23958,18 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 407, "package_id": 61, }, + "@opentelemetry/api": { + "id": 633, + "package_id": 4294967295, + }, "@pkgjs/parseargs": { "id": 599, "package_id": 62, }, + "@playwright/test": { + "id": 634, + "package_id": 4294967295, + }, "@puppeteer/browsers": { "id": 719, "package_id": 63, @@ -24238,10 +24246,18 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 905, "package_id": 131, }, + "babel-plugin-react-compiler": { + "id": 635, + "package_id": 4294967295, + }, "balanced-match": { "id": 202, "package_id": 132, }, + "bare-buffer": { + "id": 197, + "package_id": 4294967295, + }, "bare-events": { "id": 194, "package_id": 133, @@ -24286,6 +24302,10 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 1014, "package_id": 143, }, + "bufferutil": { + "id": 1005, + "package_id": 4294967295, + }, "bun-types": { "id": 4, "package_id": 144, @@ -24530,6 +24550,10 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 398, "package_id": 204, }, + "eslint-plugin-import-x": { + "id": 416, + "package_id": 4294967295, + }, "eslint-plugin-jsx-a11y": { "id": 399, "package_id": 205, @@ -25294,6 +25318,10 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 451, "package_id": 395, }, + "sass": { + "id": 638, + "package_id": 4294967295, + }, "scheduler": { "id": 731, "package_id": 396, @@ -25490,6 +25518,10 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 877, "package_id": 442, }, + "ts-node": { + "id": 701, + "package_id": 4294967295, + }, "tsconfig-paths": { "id": 436, "package_id": 443, @@ -25546,6 +25578,10 @@ exports[`ssr works for 100-ish requests 1`] = ` "id": 138, "package_id": 456, }, + "utf-8-validate": { + "id": 1006, + "package_id": 4294967295, + }, "util-deprecate": { "id": 705, "package_id": 457, diff --git a/test/integration/next-pages/test/__snapshots__/dev-server.test.ts.snap b/test/integration/next-pages/test/__snapshots__/dev-server.test.ts.snap index 321cb363413d..be4a0b6e7da6 100644 --- a/test/integration/next-pages/test/__snapshots__/dev-server.test.ts.snap +++ b/test/integration/next-pages/test/__snapshots__/dev-server.test.ts.snap @@ -23958,10 +23958,18 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 407, "package_id": 61, }, + "@opentelemetry/api": { + "id": 633, + "package_id": 4294967295, + }, "@pkgjs/parseargs": { "id": 599, "package_id": 62, }, + "@playwright/test": { + "id": 634, + "package_id": 4294967295, + }, "@puppeteer/browsers": { "id": 719, "package_id": 63, @@ -24238,10 +24246,18 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 905, "package_id": 131, }, + "babel-plugin-react-compiler": { + "id": 635, + "package_id": 4294967295, + }, "balanced-match": { "id": 202, "package_id": 132, }, + "bare-buffer": { + "id": 197, + "package_id": 4294967295, + }, "bare-events": { "id": 194, "package_id": 133, @@ -24286,6 +24302,10 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 1014, "package_id": 143, }, + "bufferutil": { + "id": 1005, + "package_id": 4294967295, + }, "bun-types": { "id": 4, "package_id": 144, @@ -24530,6 +24550,10 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 398, "package_id": 204, }, + "eslint-plugin-import-x": { + "id": 416, + "package_id": 4294967295, + }, "eslint-plugin-jsx-a11y": { "id": 399, "package_id": 205, @@ -25294,6 +25318,10 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 451, "package_id": 395, }, + "sass": { + "id": 638, + "package_id": 4294967295, + }, "scheduler": { "id": 731, "package_id": 396, @@ -25490,6 +25518,10 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 877, "package_id": 442, }, + "ts-node": { + "id": 701, + "package_id": 4294967295, + }, "tsconfig-paths": { "id": 436, "package_id": 443, @@ -25546,6 +25578,10 @@ exports[`hot reloading works on the client (+ tailwind hmr) 1`] = ` "id": 138, "package_id": 456, }, + "utf-8-validate": { + "id": 1006, + "package_id": 4294967295, + }, "util-deprecate": { "id": 705, "package_id": 457, diff --git a/test/integration/next-pages/test/__snapshots__/next-build.test.ts.snap b/test/integration/next-pages/test/__snapshots__/next-build.test.ts.snap index 05004d7e99ba..b484a46fa6b1 100644 --- a/test/integration/next-pages/test/__snapshots__/next-build.test.ts.snap +++ b/test/integration/next-pages/test/__snapshots__/next-build.test.ts.snap @@ -23958,10 +23958,18 @@ exports[`next build works: bun 1`] = ` "id": 407, "package_id": 61, }, + "@opentelemetry/api": { + "id": 633, + "package_id": 4294967295, + }, "@pkgjs/parseargs": { "id": 599, "package_id": 62, }, + "@playwright/test": { + "id": 634, + "package_id": 4294967295, + }, "@puppeteer/browsers": { "id": 719, "package_id": 63, @@ -24238,10 +24246,18 @@ exports[`next build works: bun 1`] = ` "id": 905, "package_id": 131, }, + "babel-plugin-react-compiler": { + "id": 635, + "package_id": 4294967295, + }, "balanced-match": { "id": 202, "package_id": 132, }, + "bare-buffer": { + "id": 197, + "package_id": 4294967295, + }, "bare-events": { "id": 194, "package_id": 133, @@ -24286,6 +24302,10 @@ exports[`next build works: bun 1`] = ` "id": 1014, "package_id": 143, }, + "bufferutil": { + "id": 1005, + "package_id": 4294967295, + }, "bun-types": { "id": 4, "package_id": 144, @@ -24530,6 +24550,10 @@ exports[`next build works: bun 1`] = ` "id": 398, "package_id": 204, }, + "eslint-plugin-import-x": { + "id": 416, + "package_id": 4294967295, + }, "eslint-plugin-jsx-a11y": { "id": 399, "package_id": 205, @@ -25294,6 +25318,10 @@ exports[`next build works: bun 1`] = ` "id": 451, "package_id": 395, }, + "sass": { + "id": 638, + "package_id": 4294967295, + }, "scheduler": { "id": 731, "package_id": 396, @@ -25490,6 +25518,10 @@ exports[`next build works: bun 1`] = ` "id": 877, "package_id": 442, }, + "ts-node": { + "id": 701, + "package_id": 4294967295, + }, "tsconfig-paths": { "id": 436, "package_id": 443, @@ -25546,6 +25578,10 @@ exports[`next build works: bun 1`] = ` "id": 138, "package_id": 456, }, + "utf-8-validate": { + "id": 1006, + "package_id": 4294967295, + }, "util-deprecate": { "id": 705, "package_id": 457, @@ -49896,10 +49932,18 @@ exports[`next build works: node 1`] = ` "id": 407, "package_id": 61, }, + "@opentelemetry/api": { + "id": 633, + "package_id": 4294967295, + }, "@pkgjs/parseargs": { "id": 599, "package_id": 62, }, + "@playwright/test": { + "id": 634, + "package_id": 4294967295, + }, "@puppeteer/browsers": { "id": 719, "package_id": 63, @@ -50176,10 +50220,18 @@ exports[`next build works: node 1`] = ` "id": 905, "package_id": 131, }, + "babel-plugin-react-compiler": { + "id": 635, + "package_id": 4294967295, + }, "balanced-match": { "id": 202, "package_id": 132, }, + "bare-buffer": { + "id": 197, + "package_id": 4294967295, + }, "bare-events": { "id": 194, "package_id": 133, @@ -50224,6 +50276,10 @@ exports[`next build works: node 1`] = ` "id": 1014, "package_id": 143, }, + "bufferutil": { + "id": 1005, + "package_id": 4294967295, + }, "bun-types": { "id": 4, "package_id": 144, @@ -50468,6 +50524,10 @@ exports[`next build works: node 1`] = ` "id": 398, "package_id": 204, }, + "eslint-plugin-import-x": { + "id": 416, + "package_id": 4294967295, + }, "eslint-plugin-jsx-a11y": { "id": 399, "package_id": 205, @@ -51232,6 +51292,10 @@ exports[`next build works: node 1`] = ` "id": 451, "package_id": 395, }, + "sass": { + "id": 638, + "package_id": 4294967295, + }, "scheduler": { "id": 731, "package_id": 396, @@ -51428,6 +51492,10 @@ exports[`next build works: node 1`] = ` "id": 877, "package_id": 442, }, + "ts-node": { + "id": 701, + "package_id": 4294967295, + }, "tsconfig-paths": { "id": 436, "package_id": 443, @@ -51484,6 +51552,10 @@ exports[`next build works: node 1`] = ` "id": 138, "package_id": 456, }, + "utf-8-validate": { + "id": 1006, + "package_id": 4294967295, + }, "util-deprecate": { "id": 705, "package_id": 457,