From 5b56b6e7eafd623554c28a80fb8e030fca4360d4 Mon Sep 17 00:00:00 2001 From: RiskyMH Date: Thu, 24 Jul 2025 17:32:10 +1000 Subject: [PATCH] better tests --- test/cli/install/bun-install-registry.test.ts | 8 +- test/cli/install/bun-install.test.ts | 244 +++++++++++++++++- .../@platform-test/darwin-arm64/package.json | 37 +++ .../platform-test-darwin-arm64-1.0.0.tgz | Bin 0 -> 814 bytes .../@platform-test/darwin-x64/package.json | 37 +++ .../platform-test-darwin-x64-1.0.0.tgz | Bin 0 -> 813 bytes .../@platform-test/linux-arm/package.json | 40 +++ .../platform-test-linux-arm-1.0.0.tgz | Bin 0 -> 817 bytes .../linux-arm64-musl/package.json | 40 +++ .../platform-test-linux-arm64-musl-1.0.0.tgz | Bin 0 -> 823 bytes .../@platform-test/linux-arm64/package.json | 40 +++ .../platform-test-linux-arm64-1.0.0.tgz | Bin 0 -> 819 bytes .../linux-x64-musl/package.json | 40 +++ .../platform-test-linux-x64-musl-1.0.0.tgz | Bin 0 -> 820 bytes .../@platform-test/linux-x64/package.json | 40 +++ .../platform-test-linux-x64-1.0.0.tgz | Bin 0 -> 819 bytes .../@platform-test/windows-ia32/package.json | 37 +++ .../platform-test-windows-ia32-1.0.0.tgz | Bin 0 -> 817 bytes .../@platform-test/windows-x64/package.json | 37 +++ .../platform-test-windows-x64-1.0.0.tgz | Bin 0 -> 811 bytes .../packages/platform-test/package.json | 39 +++ .../platform-test/platform-test-1.0.0.tgz | Bin 0 -> 741 bytes 22 files changed, 636 insertions(+), 3 deletions(-) create mode 100644 test/cli/install/registry/packages/@platform-test/darwin-arm64/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/darwin-arm64/platform-test-darwin-arm64-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/darwin-x64/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/darwin-x64/platform-test-darwin-x64-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm/platform-test-linux-arm-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm64-musl/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm64-musl/platform-test-linux-arm64-musl-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm64/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/linux-arm64/platform-test-linux-arm64-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/linux-x64-musl/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/linux-x64-musl/platform-test-linux-x64-musl-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/linux-x64/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/linux-x64/platform-test-linux-x64-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/windows-ia32/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/windows-ia32/platform-test-windows-ia32-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/@platform-test/windows-x64/package.json create mode 100644 test/cli/install/registry/packages/@platform-test/windows-x64/platform-test-windows-x64-1.0.0.tgz create mode 100644 test/cli/install/registry/packages/platform-test/package.json create mode 100644 test/cli/install/registry/packages/platform-test/platform-test-1.0.0.tgz diff --git a/test/cli/install/bun-install-registry.test.ts b/test/cli/install/bun-install-registry.test.ts index 6e2dd7bb4f..3106ce6f10 100644 --- a/test/cli/install/bun-install-registry.test.ts +++ b/test/cli/install/bun-install-registry.test.ts @@ -3355,7 +3355,9 @@ test("it should install with missing bun.lockb, node_modules, and/or cache", asy expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([ expect.stringContaining("bun install v1."), "", - expect.stringContaining("Checked 19 installs across 23 packages (no changes)"), + isLinux + ? expect.stringContaining("Checked 18 installs across 23 packages (no changes)") + : expect.stringContaining("Checked 19 installs across 23 packages (no changes)"), ]); expect(await exited).toBe(0); assertManifestsPopulated(join(packageDir, ".bun-cache"), registryUrl()); @@ -3384,7 +3386,9 @@ test("it should install with missing bun.lockb, node_modules, and/or cache", asy expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([ expect.stringContaining("bun install v1."), "", - expect.stringContaining("Checked 19 installs across 23 packages (no changes)"), + isLinux + ? expect.stringContaining("Checked 18 installs across 23 packages (no changes)") + : expect.stringContaining("Checked 19 installs across 23 packages (no changes)"), ]); }); diff --git a/test/cli/install/bun-install.test.ts b/test/cli/install/bun-install.test.ts index 516e71db0b..c5f3cf3c40 100644 --- a/test/cli/install/bun-install.test.ts +++ b/test/cli/install/bun-install.test.ts @@ -12,6 +12,7 @@ import { test, } from "bun:test"; import { access, cp, exists, mkdir, readlink, rm, stat, writeFile } from "fs/promises"; +import { existsSync, readdirSync } from "fs"; import { bunEnv, bunExe, @@ -25,7 +26,7 @@ import { toBeWorkspaceLink, toHaveBins, } from "harness"; -import { join, resolve, sep } from "path"; +import { basename, join, resolve, sep } from "path"; import { dummyAfterAll, dummyAfterEach, @@ -8595,3 +8596,244 @@ test("non-optional dependencies need to be resolvable in text lockfile", async ( expect(await exited).toBe(1); }); + +describe("platform-specific dependencies", () => { + const registryDir = join(__dirname, "registry", "packages"); + + beforeEach(async () => { + await rm(join(package_dir, "node_modules"), { recursive: true, force: true }).catch(() => {}); + await rm(join(package_dir, "bun.lockb"), { force: true }).catch(() => {}); + await rm(join(package_dir, "bun.lock"), { force: true }).catch(() => {}); + }); + + test("handles missing platform packages gracefully", async () => { + await write( + join(package_dir, "package.json"), + JSON.stringify({ + name: "test-missing-platform", + dependencies: { + "platform-test": `file:${join(registryDir, "platform-test", "platform-test-1.0.0.tgz")}`, + }, + }), + ); + + const { stderr, exited } = spawn({ + cmd: [bunExe(), "install", "--os=freebsd", "--cpu=x64"], + cwd: package_dir, + stdout: "pipe", + stderr: "pipe", + env, + }); + + const [err, exitCode] = await Promise.all([new Response(stderr).text(), exited]); + + expect(exitCode).toBe(0); + expect(err).toContain("Saved lockfile"); + + expect(await exists(join(package_dir, "node_modules", "platform-test", "package.json"))).toBe(true); + }); + + const platformTestHandler = (req: Request, urls: string[]) => { + const url = new URL(req.url); + const pathname = url.pathname.replaceAll("%2f", "/"); + + urls.push(req.url); + + if (pathname === "/platform-test") { + return Response.json({ + name: "platform-test", + versions: { + "1.0.0": { + name: "platform-test", + version: "1.0.0", + main: "index.js", + optionalDependencies: { + "@platform-test/darwin-x64": "1.0.0", + "@platform-test/darwin-arm64": "1.0.0", + "@platform-test/linux-x64": "1.0.0", + "@platform-test/linux-arm64": "1.0.0", + "@platform-test/linux-x64-musl": "1.0.0", + "@platform-test/linux-arm64-musl": "1.0.0", + "@platform-test/windows-x64": "1.0.0", + "@platform-test/windows-ia32": "1.0.0", + "@platform-test/linux-arm": "1.0.0", + }, + dist: { + tarball: `${root_url}/platform-test-1.0.0.tgz`, + }, + }, + }, + "dist-tags": { + latest: "1.0.0", + }, + }); + } + + if (pathname.startsWith("/@platform-test/")) { + const pkgName = pathname.slice(1); + const platform = pkgName.split("/")[1]; + + const constraints: any = {}; + + if (platform.includes("darwin")) { + constraints.os = ["darwin"]; + } else if (platform.includes("linux")) { + constraints.os = ["linux"]; + } else if (platform.includes("windows")) { + constraints.os = ["win32"]; + } + + if (platform.includes("x64")) { + constraints.cpu = ["x64"]; + } else if (platform.includes("arm64")) { + constraints.cpu = ["arm64"]; + } else if (platform.includes("arm") && !platform.includes("arm64")) { + constraints.cpu = ["arm"]; + } else if (platform.includes("ia32")) { + constraints.cpu = ["ia32"]; + } + + if (!req.headers.get("accept")?.includes("application/vnd.bun.install-lockfile+json")) { + if (platform.includes("musl")) { + constraints.libc = ["musl"]; + } else if (constraints.os?.includes("linux")) { + constraints.libc = ["glibc"]; + } + } + + return Response.json({ + name: pkgName, + versions: { + "1.0.0": { + name: pkgName, + version: "1.0.0", + main: "index.js", + ...constraints, + dist: { + tarball: `${root_url}/${pkgName.replace("/", "-")}-1.0.0.tgz`, + }, + }, + }, + "dist-tags": { + latest: "1.0.0", + }, + }); + } + + if (pathname.endsWith(".tgz")) { + const filename = basename(pathname); + let tgzPath: string; + + if (filename.startsWith("platform-test-")) { + // Main package: platform-test-1.0.0.tgz + tgzPath = join(registryDir, "platform-test", filename); + } else if (filename.includes("@platform-test-")) { + // Platform packages: @platform-test-linux-x64-1.0.0.tgz -> @platform-test/linux-x64/platform-test-linux-x64-1.0.0.tgz + const match = filename.match(/@platform-test-([^-]+(?:-[^-]+)*)-\d+\.\d+\.\d+\.tgz/); + if (match) { + const platform = match[1]; + tgzPath = join(registryDir, "@platform-test", platform, filename.replace("@", "")); + } else { + return new Response("Invalid platform package filename", { status: 400 }); + } + } else { + return new Response("Unknown package", { status: 404 }); + } + + try { + return new Response(file(tgzPath)); + } catch (error) { + console.log("Failed to find tarball at:", tgzPath); + return new Response("Tarball not found", { status: 404 }); + } + } + + return new Response("Not found", { status: 404 }); + }; + + const platforms = [ + { os: "darwin", cpu: "x64", libc: "*" }, + { os: "darwin", cpu: "arm64", libc: "*" }, + { os: "linux", cpu: "x64", libc: "*" }, + { os: "linux", cpu: "arm64", libc: "*" }, + { os: "linux", cpu: "x64", libc: "glibc" }, + { os: "linux", cpu: "arm64", libc: "glibc" }, + { os: "linux", cpu: "x64", libc: "musl" }, + { os: "linux", cpu: "arm64", libc: "musl" }, + { os: "win32", cpu: "x64", libc: "*" }, + { os: "win32", cpu: "ia32", libc: "*" }, + ]; + test.each(platforms)( + "filters (os: $os, cpu: $cpu, libc: $libc)", + async ({ os, cpu, libc }) => { + const urls: string[] = []; + setHandler(e => platformTestHandler(e, urls)); + + await write( + join(package_dir, "package.json"), + JSON.stringify({ + name: "test-registry-platform-filtering", + dependencies: { + "platform-test": "1.0.0", + }, + }), + ); + + const { stderr, exited } = spawn({ + cmd: [bunExe(), "install", `--os=${os}`, `--cpu=${cpu}`, `--libc=${libc}`], + cwd: package_dir, + stdout: "pipe", + stderr: "pipe", + env, + }); + + const [err, exitCode] = await Promise.all([new Response(stderr).text(), exited]); + if (exitCode !== 0) { + console.log(err); + } + expect(exitCode).toBe(0); + + const platformDir = join(package_dir, "node_modules", "@platform-test"); + const installedPackages = existsSync(platformDir) ? readdirSync(platformDir) : []; + + const installedName = (os + "-" + cpu + (libc === "musl" ? "-musl" : "")).replace("win32", "windows"); + + expect(installedPackages).toContain(installedName); + expect(installedPackages).toHaveLength(os === "linux" && libc === "*" ? 2 : 1); + }, + ); + + test("wildcards should show all platforms", async () => { + const urls: string[] = []; + setHandler(e => platformTestHandler(e, urls)); + + await write( + join(package_dir, "package.json"), + JSON.stringify({ + name: "test-registry-wildcard-filtering", + dependencies: { + "platform-test": "1.0.0", + }, + }), + ); + + const { stderr, exited } = spawn({ + cmd: [bunExe(), "install", "--os=*", "--cpu=*", "--libc=*"], + cwd: package_dir, + stdout: "pipe", + stderr: "pipe", + env, + }); + + const [err, exitCode] = await Promise.all([new Response(stderr).text(), exited]); + expect(exitCode).toBe(0); + + const platformDir = join(package_dir, "node_modules", "@platform-test"); + const installedPackages = existsSync(platformDir) ? readdirSync(platformDir) : []; + + expect(installedPackages.length).toBeGreaterThan(5); + expect(installedPackages).toContain("linux-x64"); + expect(installedPackages).toContain("darwin-x64"); + expect(installedPackages).toContain("windows-x64"); + }); +}); diff --git a/test/cli/install/registry/packages/@platform-test/darwin-arm64/package.json b/test/cli/install/registry/packages/@platform-test/darwin-arm64/package.json new file mode 100644 index 0000000000..f47dcb434e --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/darwin-arm64/package.json @@ -0,0 +1,37 @@ +{ + "name": "@platform-test/darwin-arm64", + "versions": { + "1.0.0": { + "name": "@platform-test/darwin-arm64", + "version": "1.0.0", + "description": "Platform test package for darwin-arm64", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "_id": "@platform-test/darwin-arm64@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/darwin-arm64/-/platform-test-darwin-arm64-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.125Z", + "created": "2025-07-18T16:17:21.125Z", + "1.0.0": "2025-07-18T16:17:21.125Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/darwin-arm64" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/darwin-arm64/platform-test-darwin-arm64-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/darwin-arm64/platform-test-darwin-arm64-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..dd99198f5fde59f36368a76b9be870ad6c2b61b9 GIT binary patch literal 814 zcmV+}1JV2+iwFRbb9!h11MQkkZ__Xw#!AZBGso#SOCq5k?0Z!OWM_;zJY-& zp$}OUH93q#c+3M9xZGG+G=Bfs|8xJBeQye1Qga#Gti8!uor{v&5`qUw-4oMpW1{|% zGopW+5UKz6v^#PUbFP204E)6Nc?CPRxoWF{hZvjIYS}Rhwga|m&#F5co3*#kVVfn1 zfETH?Qhi;kE`7kCmKvMU%bjY0l)xHs{$U9oL}8qGfgFcs6Ml)O--a9yO2}3GAECt7{x27_|C?)IsqX-@ng=H8ACJ!e z)N(BC|MI{>7y3UUFUwRLz#9+DO!a*x>fa=z>pw9az5eHc8wPPGW!Vf59~W!sZQuom z;Azxk$>&h`D+!O2Qk{ttFIZv1rv%7kFqlw$vR)XfXS){*+y-}#)}*nhJUW%acX=Gc zvx+;*U}O8uKn4?TqoeAY^_a{P%Kv*oowqa6zT)cs-y#TU{pW)A|8vct|Icb3xVrzh zu}QW6&x1?+zl9xQu4?~(wg~jVZ9|)$=gvVk{DD#ag6gX zuFtx=nkm!W|7Y$IJLGZ>2!kxzxW@j!Y3lbs@0>{AGk650qCp55 zgn;2$PtJ^sGeRoXfI^U_V?)tZ1t3MybwvWG@R>1sQEY~6Dxnjde3{YitV3ycM*ZZ6 z0&|{aaoo6nQ(Bg!XQl;S?1ML81TT|ru|s9YXLj)G@Bh|i>)>E-^e2z_%8uKaCQE7g zJczGb&U=hp z{VOP=e}Xkl0{wYUaQc3j$245F?Rg0TWoV_k1(>{-=_0e0F?T6t(yO@=p1%(%BB4@3m^U0rpwY&f8f*V;Zk5`aV<@STBBzJpJ>F%>GXl zLjt7usa0P8unvy`KZ+fX-G^=$ev0Nl2D=|R##ixwSjR;8zfutXuhPJJ>Hv#c2XgiQ zm;ci>L-@Z^nBxBo6$$@W1z=&SPs!E4n$*58btxMseLX!!yTQ>+2Y>LXcj{k2Y%)ee90nfYqVa$p$kO%?Ia9^cIaGc+u%# z6>ROk8mllvt25wzE&6^`4etLP&!+u?w9mP^|JN`=LjR>8{C}kx_y0w$1G)M~MmGP; zRsiAu%Rp^hp8v%fCc^$-e_&y%Ps!6iA|$*2D>@eYe;K&G-D9$({lE|72sD8_)%nYt zi=M1t?hNz)rgdT-Q?>^9UJ+ybNB&<`#s7blgYf^AW+MMz&^mDS{68_UA^d+COv(Qf z_AJ&_@dM!60}E4qN}m2PQnLF$68XP!IIjU9d!|d}jak-zl{Y)3VdVH8Z^;%3h>}v9 zMpozq@u=oc{-1XNMqjS%OM_vcYdXV-iyxp#Y0_E5D)`h`!PxsL-rDnR3MSuK$*kdE r80_=7!z3;lj@P{()>%O>t>ly7HMPN_AAmq05G;t_J8TwT05SjoeovZl literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm/package.json b/test/cli/install/registry/packages/@platform-test/linux-arm/package.json new file mode 100644 index 0000000000..09885c68b2 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/linux-arm/package.json @@ -0,0 +1,40 @@ +{ + "name": "@platform-test/linux-arm", + "versions": { + "1.0.0": { + "name": "@platform-test/linux-arm", + "version": "1.0.0", + "description": "Platform test package for linux-arm", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "linux" + ], + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "_id": "@platform-test/linux-arm@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/linux-arm/-/platform-test-linux-arm-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.064Z", + "created": "2025-07-18T16:17:21.064Z", + "1.0.0": "2025-07-18T16:17:21.064Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/linux-arm" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm/platform-test-linux-arm-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/linux-arm/platform-test-linux-arm-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..932ddd050789dddbb720fac18ab825593026b8cd GIT binary patch literal 817 zcmV-11J3*(iwFRbb9!h11MQkmZ__Xs#!|NYYU>^?PvP#HZsUzzI9;mbP14HZ`fV_$Nha{Q9-sG>`oxDLjHo)*yro zNw%$Bja?U*bMnlLOVMCKBeBbHe=3|_~@4c za~@@O+s|JP*w;9zg?QDpq!+ugA$OKJH7 z%Xgs}1P+5i=$|mp^em<0H|i@N@TZmbcJOkqULsYn&y#lEPfHrocxln+p{T%0_I=FKzc?6M|0y;U zK(ilO;q?zI@F?)3*!K8&a2)t0ntvbseCUK+#s3kVQ0f12LHfT!11qTm%xWH(ss9W9 zPuC3T|8ilH|EtnWOt;gj?|1z+>7I+#s zX8hR?-L;rSafO$4x@%_W0$v8rkIGLrOCv4p4zhsNX4dfrw-mKUr(E(Diz0Z|WN#I0 z?Y2$K5G2kHL{&9MK^Y96?{|EE~hrT@=^ z3H~2fsYVRx|8G1nGu5Ze(m$ePeEr9|CfENwaQ$Y7tCDpCKa3+#1LaB1zr4BVu}bDo z^8DYlj?EV1bAaz<(Z@BO|EsF}|3^MZ|6gcEp8sbw4_w3l8^n*FKx2O3hf{s zM9yCTh!()$+8TRlkmR|hog|#ye)dcIZACmF2F449-cE_yp5J6(^o>=SSL`LpzQ{Z5 v=Ow*~(8nZX1)Ve|#&8~S>`zu2Y9)svSn4hMr;$h`l1%vrDa3s#05SjoW-72e literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm64-musl/package.json b/test/cli/install/registry/packages/@platform-test/linux-arm64-musl/package.json new file mode 100644 index 0000000000..2359b5edac --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/linux-arm64-musl/package.json @@ -0,0 +1,40 @@ +{ + "name": "@platform-test/linux-arm64-musl", + "versions": { + "1.0.0": { + "name": "@platform-test/linux-arm64-musl", + "version": "1.0.0", + "description": "Platform test package for linux-arm64-musl", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "_id": "@platform-test/linux-arm64-musl@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/linux-arm64-musl/-/platform-test-linux-arm64-musl-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.098Z", + "created": "2025-07-18T16:17:21.098Z", + "1.0.0": "2025-07-18T16:17:21.098Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/linux-arm64-musl" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm64-musl/platform-test-linux-arm64-musl-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/linux-arm64-musl/platform-test-linux-arm64-musl-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..deeed36e46d08bedaf535d6fec82a434ff7fd068 GIT binary patch literal 823 zcmV-71IYXziwFRbb9!h11MQkmZ__Xs#i6KniBHEzfD?Awk+xeGHYKUF_$Nha{Q9-sw2%GNDLjBu(IA8j zLO^oXhiAsw86g#GKp{xev7zXy0+6EUx*`Eo_{bQ&C^kbjl+ccjzg<%AYnM{zlKAAC z0y&SeIBq?>EiFpY3)2FxcELL^f|p5m*rBrH3p@Dr&;M((wYRr3ddV}sv*Yemm4&qY zf#ti<3<8J3AoNeDXL=Tu78a%7KlcCJ|3&WQ@FoSb*f#r{)a=l(ZuP>DdU3}N^X?;4 z{|cJYKf#(NfqvctxrmDEUqir+ZI?C`gQ%;7V5~s2s$MRIMnUbkCIAC$wT?q=|Er&YrZu*;IR-d~n9rt#Xm??Y9A_2T=;(m%hLTK|b+ zNPrYSw94xr*5N_mN3rd(``|e6bCiD{?0&EbzD}tR|>-aRT@}N9bi%OK&JlB z`9EDVg#RmrS^m#xXsRy!-;Dwg(oz8CpSmX3e)SZ)u$2DWzu zo(7H?fAT|jC8kkaXJx(qiW#~(UU7So16T-57s^l8YZL8lkJaWZV21zK*cDcU|G)9T!c?Dh${0GQ|2{2B$RuWY2V|yq0bKmwDwA8b-G7@%n74fM{6S zp^+8ZK|G55+xh1Wfzem&;)e!Fx@+1=-r0}QVd=2Rhz0mCS;5$|Dqh?3I}}Vlzmi$S zL6YqAy!~Nb(kTypOhQ)BOJm7U(wJi(T4^vDA&=Dt^Zuj+0)Zf3{sLUfDVP8<002M+ BvAqBQ literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm64/package.json b/test/cli/install/registry/packages/@platform-test/linux-arm64/package.json new file mode 100644 index 0000000000..3bc08ac202 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/linux-arm64/package.json @@ -0,0 +1,40 @@ +{ + "name": "@platform-test/linux-arm64", + "versions": { + "1.0.0": { + "name": "@platform-test/linux-arm64", + "version": "1.0.0", + "description": "Platform test package for linux-arm64", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "_id": "@platform-test/linux-arm64@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/linux-arm64/-/platform-test-linux-arm64-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.043Z", + "created": "2025-07-18T16:17:21.043Z", + "1.0.0": "2025-07-18T16:17:21.043Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/linux-arm64" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/linux-arm64/platform-test-linux-arm64-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/linux-arm64/platform-test-linux-arm64-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..38ead93012b09fab6785a8ac95a4ec4f5d10d392 GIT binary patch literal 819 zcmV-31I+v%iwFRbb9!h11MQkkZ__Xs$FoTYQ7&+RvsG~bZFB9!cIc)`lnH5-28?YW zU_w)tnl>zNB&w=bO-(AT{z*|9KYnZ{&ENhvDLjN))*ysT zN<-hffO3 zc$C?3>)~x}S<_xxHh8@U-h&>pOuHjCU2I>)CXavpUz64S{oUS2nejtxcSou$^~)dF zfd{QHbU6&8;Dq~@Z*y&FS^M+z;P3t4^xh0kQZbGltG&goI*&?rD~hiftp~u_Pn~gxmA1j0=BIr ziQr{&tyJICsw*Gy(MoeGe6?FGkTTd4N!uSLB@Jl2Fz@TIsK8S8eN5B8JQ!L3DK<4g zvme^R>mQcjVHm`T<1INWD8-<}(c6yn>ZgTs0UD%4sqf;S!o5wLcYqqlr zHh10*1gywzc4S-gz9Nf-^#6`u=k1KNFS)w^HwZ#X|GA+2|3Wk9|FfD0uI~RS)|vAE zc`(NR6T+Cul>fi+z|2(NXPW*IWuxmqX3GEPf)~_VLY2H722m1&3Mh_u{>6=Xk5(~j z(&zt{eQY(jm;(Yoi$1RL{9o7A|3C6U`TvDx==py}^T0Lyze!Bx|MOss|JTa~Hgx6x zZ#*zF)%TgEe{s)^uK%J?t^av&S^%KvTOKd2PqhB4vfc@gVkhurRWVCI)Ge*^*p8eq z=|#>T|I0Q&@9w(r(jd+BEGJDl`w7}D?Y0(+fE=7C7R_ xpqrQWCqtjokR7)AvF<3&W3F>#_k)e}PzDQ~d4E9)g+h@L{{S^HL&pFz0083Ermg@0 literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/linux-x64-musl/package.json b/test/cli/install/registry/packages/@platform-test/linux-x64-musl/package.json new file mode 100644 index 0000000000..05af49e992 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/linux-x64-musl/package.json @@ -0,0 +1,40 @@ +{ + "name": "@platform-test/linux-x64-musl", + "versions": { + "1.0.0": { + "name": "@platform-test/linux-x64-musl", + "version": "1.0.0", + "description": "Platform test package for linux-x64-musl", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "_id": "@platform-test/linux-x64-musl@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/linux-x64-musl/-/platform-test-linux-x64-musl-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.085Z", + "created": "2025-07-18T16:17:21.085Z", + "1.0.0": "2025-07-18T16:17:21.085Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/linux-x64-musl" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/linux-x64-musl/platform-test-linux-x64-musl-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/linux-x64-musl/platform-test-linux-x64-musl-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..421b3458116bb868191c351689159013167e2a99 GIT binary patch literal 820 zcmV-41Izp$iwFRbb9!h11MQhjZ__Xs$FoTYQ7&+RvsG~bZFB9!cJ`u5lnH5-28?YW zU_w)tdTUtTNYYU>^?PvP#HZsUzzI9;NL#v=O-(AT{z*|a-XMfb zNHmYQ4P%iUUutbsj|wEccuQlG|4v%U`V3asQm$0YsBH$(eB#ij;m z{-w>m{$T|khC!S-zPJvq3qQrvpF>;^M#xqCA7O+l|5pgg|IIb9k~zS<)`5xo|HuC^ z!&LsS5H9h5*dzuvl>fW&z}!@yF;V}J|riQ4~*zz+O45VCZGlgH(H_h;bvC*W!5 zTFG$`c`FHzlZt3-wO87Vtaz>11tI_jo61i%N&{o<^zwn-SdrcA$gyU9UFHSp{~f=<+c{}pa&`Z25QLQe3qkq+xu)O$=d})8-Tzap zGv)t_V6^{d6t5yml>fi+z}!@yF-iZ3;oxsABDlo=>#Izs zYs&xMcwla-&zPitB7#Hvzv!v<{~|aq0Z{fWkC)dcS^s6(^^8Zc6Zo>XSSTRswl;Wd zM^2dZB7g7w%V9w82R7=VL7MDYPMUS`N3`489WWLFS)yp@drl>L`$2<)!Dm-x(Xo>z y2Qu%Vo0m>0Lm$(S9k#NVC?t!x&XJvk()whq)S2~nq);dndGH5n+?@mfG5`Q;PORSm literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/linux-x64/package.json b/test/cli/install/registry/packages/@platform-test/linux-x64/package.json new file mode 100644 index 0000000000..7403384ea6 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/linux-x64/package.json @@ -0,0 +1,40 @@ +{ + "name": "@platform-test/linux-x64", + "versions": { + "1.0.0": { + "name": "@platform-test/linux-x64", + "version": "1.0.0", + "description": "Platform test package for linux-x64", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "_id": "@platform-test/linux-x64@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/linux-x64/-/platform-test-linux-x64-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.022Z", + "created": "2025-07-18T16:17:21.022Z", + "1.0.0": "2025-07-18T16:17:21.022Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/linux-x64" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/linux-x64/platform-test-linux-x64-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/linux-x64/platform-test-linux-x64-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..e310ee48d8242fced35bcc3aadea33c0c2384ccd GIT binary patch literal 819 zcmV-31I+v%iwFRbb9!h11MQkkZ__Xs$FoTYQ7&+RvsG~bZFB9!ak@>FC==2u4H(-% zz=Wodnl`L?AxTHj)bGKC6Q7Qc04MCUTVJ-eY^qaf^-qe@`0-;qN&oi0N#POHWP=d0 zOcP{#+TC-`_6X_30N6wZB^IVS1_)zHu?CRzk#X8_Vn=)^ksBX>pHS~xld;x>`0z=A z8IMvPw;tZsmNo5#?SNPN;2r28%CtLt)A{z5Z{qmZ|20`XIN0lb6d6DGc6X%8QosCx z6L`=L!xn>K6r3>M_8q1zEo*;%9{#=m+q^e}lT?gj*G{*YU1w3rX-5(Ble!ztx{s;) z$7n?VCNT^Rq_ZB#Wh}V<4FtTz^;iX4rd~EpLNG+gC{sdlxnNpgr}nJ6x3yh+`y8fr zl0@(_xmK#LYt@wx_|r;rJAAoUEs%Av&y#lEPf8llcwyexVNro4`F%{&zc?6K|4nRZ zz?46nxR|eZkfJzd?}Fe?BPxzt9Z&e_8Xu)&0MTb*lV- z9*lebi}ffi+KxwM)Gfn@*m(j;Hp8xB*`u|5hDF46E3_bssG!In! literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/windows-ia32/package.json b/test/cli/install/registry/packages/@platform-test/windows-ia32/package.json new file mode 100644 index 0000000000..f6bb1f6ab9 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/windows-ia32/package.json @@ -0,0 +1,37 @@ +{ + "name": "@platform-test/windows-ia32", + "versions": { + "1.0.0": { + "name": "@platform-test/windows-ia32", + "version": "1.0.0", + "description": "Platform test package for windows-ia32", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "win32" + ], + "cpu": [ + "ia32" + ], + "_id": "@platform-test/windows-ia32@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/windows-ia32/-/platform-test-windows-ia32-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:21.002Z", + "created": "2025-07-18T16:17:21.002Z", + "1.0.0": "2025-07-18T16:17:21.002Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/windows-ia32" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/windows-ia32/platform-test-windows-ia32-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/windows-ia32/platform-test-windows-ia32-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..436123da7d6485fe184ba042a8fba48df4d85267 GIT binary patch literal 817 zcmV-11J3*(iwFRab9!h11MQkmZ__Xs##Xl)ZV*9lnH;?@!DLjB$)*yr| zLO`;o{k`CPkC1^)pc7lVNCPPIo(Vcp%tFzX(20(}PAGTU;=DZ}fBd4r zjC+|Kw;tZs7B%e!v%#xf@D2=+Y1$pJ8Dje)HhKQz|EjF-?d=Q>WyCkJ-Axr)7^Xk4 zeHXGIXmc2Z{t5S(XLD^~QTz3M|M&f$oslZO?%6NcQ2n@%|EHm2$y zSt2& zgcqr`R)5{7FMZHIEwwg-mpki|b6XVcs!_U#|+YsYHF}{lb!=k+Mf4QLiU!j4Op##in9+;|sJw5+Z z(=wF*%L5Z#=>G^N)vBos;Ee}nrurdM^>5(x`i~8&*8e=PeJ}EbEZhFk<8q^a8#vw( zcp9`>eCUVnO3b6Ua_V?Z|1?^0m}vl!3`P^mPu5Fg^=uDff!*Tv@tQCewMS<{_%@Fs zcwTXD8EkC78OdOw-RjA@<~=4wLi&I4Q}S*`+Lv72|C^>|DgEby^8bZq)csm8;1J-M?NV3UueeO|7SE0T*Locm@5CD2bcJN zL`{Pz|9|s=nW=urH2sT*&Gh<@kg3-HJUA->Q1+P1%WIRZ|FSH2!o$e%Jy}+V2%>&! zlSg*w1o0r}@7sS_2^id7|9&(`LS5!0G3O7V{nUPSk;stU6A2^VsAOr+Z*nmH-Ks1K v_L5*<#_jjxM1!Iwar`mKvV+brFX@ELD)r|5BPbLK#T@tp=v{0(05SjoE2pbV literal 0 HcmV?d00001 diff --git a/test/cli/install/registry/packages/@platform-test/windows-x64/package.json b/test/cli/install/registry/packages/@platform-test/windows-x64/package.json new file mode 100644 index 0000000000..283961c759 --- /dev/null +++ b/test/cli/install/registry/packages/@platform-test/windows-x64/package.json @@ -0,0 +1,37 @@ +{ + "name": "@platform-test/windows-x64", + "versions": { + "1.0.0": { + "name": "@platform-test/windows-x64", + "version": "1.0.0", + "description": "Platform test package for windows-x64", + "main": "index.js", + "scripts": { + "postinstall": "node postinstall.js" + }, + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "_id": "@platform-test/windows-x64@1.0.0", + "_nodeVersion": "20.8.0", + "_npmVersion": "10.1.0", + "dist": { + "integrity": "sha512-PLACEHOLDER", + "shasum": "PLACEHOLDER", + "tarball": "http://localhost:4873/@platform-test/windows-x64/-/platform-test-windows-x64-1.0.0.tgz" + } + } + }, + "time": { + "modified": "2025-07-18T16:17:20.981Z", + "created": "2025-07-18T16:17:20.981Z", + "1.0.0": "2025-07-18T16:17:20.981Z" + }, + "dist-tags": { + "latest": "1.0.0" + }, + "_id": "@platform-test/windows-x64" +} \ No newline at end of file diff --git a/test/cli/install/registry/packages/@platform-test/windows-x64/platform-test-windows-x64-1.0.0.tgz b/test/cli/install/registry/packages/@platform-test/windows-x64/platform-test-windows-x64-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..7689960d1bce412634e4d086b7333ae2882166f4 GIT binary patch literal 811 zcmV+`1JwKZ4g2h zrJ#Fcy`$j#h!7?wFeow^u?&V0K!(8>(f~?*WP(|K4$9Q zKx6u+#KanC&wC)3k#qf<2zZI>@v>o2T%wc^1lK9Htdd1pfm&dv`mD0IwOxJt9JcKw ziQr{&EmvMwD=Qz2Pb-b>@a0~mK-R&&2-oNrv}pi zO@C;)*FP-6qcDgQ*BAGp*@R!>`S&622P5Pv{*Q?I%Kv48@_)Go76%S6t$ARk{xA4H zW?IVsWx@piS0WZ7CFTEaJTNuY516TcjK|l1g4Oz;2~Ob0fskc0s6W=Ly~n`y>)>hF zw3E+4`49}bG ztb(oGH$w$>kv2|F&~%*SVMj0zZvDuCf1*vHJfg6y3I3lN$iSBJ z|2H0(n(7D4(mz2L_Wwn$TK}`)tN?)S+aA|9rdt11S?`2Lu^afZssRy1z1$j)oyZN7 ze#yV>f7u4;KV27I8gwH)+wF#&{{-#j_F9WYfgGI37>gC z&aQ6vs_0)4vWWvQMUG26?AjP0j9nKS0F|DZqAfEfR4O8r$6v3A>ohrUUC}@pv`+5_)EkD|`Fql&G{7gdV;pVJLl-`{WaJ{CQ`t8#ZFWMxqQz)vE` z(zL~4Dv}c(v)Jdx%Bu1E$HzbSf6;q$SfpkguUWpuS-^$mw}s$w7KCEnb4=7fMkD&C z#BmIe&pVOJSaSV42t-*J@lEVed!153FvK>kc{W+EnbZS2+fVC_XItBEU%;GYnShtc zb+i6vyT0}Te_Cs9r7s(GlhnYT>a_Fzs!kU)ZeI6uSXQ7_{v4C^U)+rB{}g)$pyj8w z^!kSuJP6}}=kQ3DHHUg0E+Mn{KZhWs{og{+{%@&)*1!Rl^&Xh0|9|}-wq5Q27QyBI z&qWR*$kqPu#sf=J{eVgO$HX1o|FKK;{=Wz;3+%Em25F0Bhlz+l#$^Ul<{z`q+>DZ- ztu)K?G!dBuo8X%X&OF%+tr$y-LkE3jg2xw$(cziOZN{ zcK=UoTmS#N7_|RiYA*W!vfcy#;r~72Y5%_n#{B=gUcn`YXdHQ5vEzMW&8;Obi%9& zlCwzGI*+N!l>6af=!1Z#Tpd7TKjgAIcBBR?2JN3qyS4oxo?ndLI6IH1)+a-mTOHLm z>BwsClHtV1hlb3tC&jkHxSdZkXg83FXok?KC$C0r*_t7Psp11B)RUNIZN12m#i`I! X^YprZ%o>eGqnVn&VG(Kr04M+eV8Mlr literal 0 HcmV?d00001