const fs = require('fs');
const path = require('path');

const api = path.join(__dirname, '..', 'dist', 'api');

function rmrf(p) {
  if (fs.existsSync(p)) fs.rmSync(p, { recursive: true, force: true });
}

function deleteByExt(dir, ext) {
  if (!fs.existsSync(dir)) return;
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
    const full = path.join(dir, entry.name);
    if (entry.isDirectory()) deleteByExt(full, ext);
    else if (entry.name.endsWith(ext)) fs.unlinkSync(full);
  }
}

console.log('[prepack] API is no longer bundled with the npm package (downloaded dynamically). Nothing to clean up.');

