#!/usr/bin/env node

process.emitWarning = () => {};
process.removeAllListeners("warning");

// ast-grep gives annoying warnings
console.debug = () => {};

// Suppress specific experimental warnings
const originalEmit = process.emit;
process.emit = function (event, ...args) {
  if (event === "warning" && args[0]) {
    const warning = args[0];
    // Suppress ExperimentalWarning (including JSON module imports)
    if (warning.name === "ExperimentalWarning") {
      return false;
    }
    // Suppress DEP0040
    if (warning.code === "DEP0040") {
      return false;
    }
  }
  return originalEmit.apply(process, [event, ...args]);
};

// Use the file extension to help the module resolver find the file
import("./cli-bundle.js").catch(console.error);
