function injectRegisterClass(clazz, componentName) {
  const callee = t.memberExpression(t.identifier(WC_HMR_NAMESPACE), t.identifier(REGISTER_FN_NAME));
  const importMeta = parseStatement(`import.meta`, t.isExpressionStatement).expression;
  const componentNameString = t.stringLiteral(componentName);

  const classExpr = clazz.isExpression()
    ? clazz.node
    : t.classExpression(
        clazz.node.id,
        clazz.node.superClass,
        clazz.node.body,
        clazz.node.decorators,
      );
  const callExpr = t.callExpression(callee, [importMeta, componentNameString, classExpr]);

  if (clazz.isExpression()) {
    clazz.replaceWith(callExpr);
  } else if (clazz.isClassDeclaration()) {
    // @ts-ignore
    const { name } = clazz.node.id;
    const declarator = t.variableDeclarator(t.identifier(name), callExpr);
    const declaration = t.variableDeclaration('let', [declarator]);
    clazz.replaceWith(declaration);
  }
}
Wraps a class declaration or expression into a register call
@param {NodePath<ClassDeclaration> | NodePath<Expression> } clazz
@param {string} componentName