const fs = require('fs');

const rootFiles = fs.readdirSync('.');
rootFiles.forEach(f => {
  if (f === 'node_modules' || f === '.git' || f === 'dist' || fs.statSync(f).isDirectory()) return;
  const content = fs.readFileSync(f, 'utf8');
  if (content.includes('edit_bundle') || content.includes('apply_edits')) {
    console.log(`Found reference in root file ${f}`);
  }
});

const serverContent = fs.readFileSync('dist/server.cjs', 'utf8');
if (serverContent.includes('edit_bundle') || serverContent.includes('apply_edits')) {
  console.log('Found reference in dist/server.cjs!');
}
