← Files NGS Analysis WorkbenchARCHIVED FILE

scripts/check-package-lock.mjs

827 Bytes · Sep 30, 2026 · 23:20 UTC

↓ Download file

import { readFile } from "node:fs/promises";

const lockfilePath = new URL("../package-lock.json", import.meta.url);
const lockfile = await readFile(lockfilePath, "utf8");
const clusterSocketResolvedUrl =
  /"resolved"\s*:\s*"https:\/\/socket-firewall-registry\.gateway\.[a-z0-9-]+\.internal\.api\.openai\.org\/npm\//g;
const matches = [...lockfile.matchAll(clusterSocketResolvedUrl)];

if (matches.length > 0) {
  const lines = matches.map(
    ({ index }) => lockfile.slice(0, index).split("\n").length,
  );
  console.error(
    `package-lock.json contains ${matches.length} cluster-specific Socket Firewall URL(s) at line(s): ${lines.join(", ")}`,
  );
  console.error(
    "Regenerate it with `npm install --package-lock-only --ignore-scripts`; this project omits registry URLs from lockfiles.",
  );
  process.exit(1);
}

SHA-256: bb873d93b3de1a8210ab05a04c44617d963fd12fb7affadebd81618a9e3c95a7