// Drops package1's npm dependencies (including its only bin dependency) and
// package2's sibling-member dependency so that the next `deno install` has to
// prune the now-stale links, and the now-stale `.bin` entry, from each member's
// `node_modules`. package2 keeps `@denotest/bin`, so its `.bin` entry must stay.
const edits: [string, string][] = [
  ["package1/package.json", "@denotest/esm-basic"],
  ["package1/package.json", "@denotest/bin"],
  ["package2/package.json", "package1"],
];
for (const [path, dep] of edits) {
  const pkg = JSON.parse(Deno.readTextFileSync(path));
  delete pkg.dependencies[dep];
  Deno.writeTextFileSync(path, JSON.stringify(pkg, null, 2) + "\n");
}
console.log("dropped");
