
export default function({types: t }) {
    return {
        visitor: {

        }
    };
}

@@ -1,92 +1,2464 @@
-%0A
+import %7B elements %7D from './elements';%0A%0A/**%0A * plugin%0A * @ast
 exp
+l
 or
-t default function(%7Btypes: t %7D) %7B%0A    return %7B%0A        visitor: %7B%0A%0A        %7D%0A    %7D;%0A%7D
+er: https://astexplorer.net/#/DG3oIHIg5f/11%0A * @param t%0A * @returns %7B%7Bvisitor: %7BClassDeclaration: (function(*))%7D%7D%7D%0A */%0Afunction plugin(%7Btypes: t%7D) %7B%0A%0A    let getDecorator = (node, decoratorName) =%3E %7B%0A%0A        let decorators = node.decorators %7C%7C %5B%5D;%0A%0A        for(let decorator of decorators)%7B%0A            let %7B name %7D = decorator.expression.callee;%0A            if(decoratorName === name)%7B%0A                return decorator;%0A            %7D%0A        %7D%0A%0A        return null;%0A    %7D;%0A%0A    let getElementClassByName = (name, elements) =%3E %7B%0A%0A        let element = elements%5Bname%5D %7C%7C 'HTMLElement';%0A        return element;%0A    %7D;%0A%0A    let getArguments = (node) =%3E %7B%0A%0A        // set default%0A        let args = %7B%0A            extends: 'div',%0A        %7D;%0A        let %5B firstArgument %5D = node.expression.arguments;%0A%0A        if(!t.isObjectExpression(firstArgument))%7B%0A            return args;%0A        %7D%0A%0A        let %7B properties %7D = firstArgument;%0A        for(let property of properties)%7B%0A            args%5Bproperty.key.name%5D = property.value.value%0A        %7D%0A%0A        return args;%0A    %7D;%0A%0A%0A    let addSuperClass = (node, element) =%3E %7B%0A%0A        let identifier = t.identifier(element);%0A        node.superClass = identifier;%0A    %7D;%0A%0A    let addStaticGetterProperty = (node, type, superClass) =%3E %7B%0A%0A        let x = t.classMethod(%0A            'get',%0A            t.identifier(type),%0A            %5B%5D,%0A            t.blockStatement(%5B%0A                t.returnStatement(t.stringLiteral(superClass))%0A            %5D),%0A            false,%0A            true%0A        );%0A%0A        node.body.body.push(x);%0A    %7D%0A%0A    return %7B%0A        visitor: %7B%0A            ClassDeclaration(path) %7B%0A%0A                let node = path.node;%0A%0A                // @component decortors exsists%0A                let component = getDecorator(node, 'component');%0A                if(!component)%7B%0A                    return;%0A                %7D%0A%0A                // get arguments%0A                let superClass = getArguments(component).extends;%0A%0A                // add extends identifier%0A                let element = getElementClassByName(superClass, elements);%0A                addSuperClass(node, element);%0A%0A                if(superClass === 'div')%7B%0A                    return;%0A                %7D%0A%0A                // add static getter property%0A                addStaticGetterProperty(node, 'extends', superClass)%0A%0A            %7D,%0A        %7D,%0A    %7D;%0A%7D%0A%0Aexport default plugin;
 %0A

implement plugin: first and second tests green :)