function findCustomElementsPerAstFile(oxcAst) {
  const definitions = [];
  oxcTraverse(oxcAst, {
    CallExpression(astPath) {
      let found = false;
      // Doing it like this we detect 'customElements.define()',
      // but also 'window.customElements.define()'
      astPath.traverse({
        // MemberExpression in babel
        StaticMemberExpression(memberPath) {
          if (memberPath.node !== astPath.node.callee) {
            return;
          }

          const { node } = memberPath;

          if (node.object.name === 'customElements' && node.property.name === 'define') {
            found = true;
          }
          if (
            node.object.object?.name === 'window' &&
            node.object.property.name === 'customElements' &&
            node.property.name === 'define'
          ) {
            found = true;
          }
        },
      });
      if (found) {
        let tagName;
        let constructorIdentifier;

        if (
          astPath.node.arguments[0].type === 'StringLiteral' ||
          astPath.node.arguments[0].type === 'Literal'
        ) {
          tagName = astPath.node.arguments[0].value;
        } else {
          // No Literal found. For now, we only mark them as '[variable]'
          tagName = '[variable]';
        }
        if (astPath.node.arguments[1].type === 'Identifier') {
          constructorIdentifier = astPath.node.arguments[1].name;
        } else {
          // We assume customElements.define('my-el', class extends HTMLElement {...})
          constructorIdentifier = '[inline]';
        }
        definitions.push({ tagName, constructorIdentifier, __tmp: { astPath } });
      }
    },
  });
  return definitions;
}
Finds import specifiers and sources
@param {File} oxcAst