@twist/babel-plugin-transform

0.2.2 • Public • Published

babel-plugin-transform-twist

Build Status

This babel plugin provides support for the syntax features of twist that are common to any UI framework that you might use twist with. Specifically, it implements:

  • Configuring decorators for auto-import.
  • Allowing
  • Configuring JSX tags for auto-import.

Quick Reference

Plugin Options:

{
    autoImport: {
        'Store': {
            module: '@twist/core',
            export: 'StoreDecorator',
            inherits: {
                module: '@twist/core',
                export: 'Store'
            }
        }
        'ui:button': {
            module: 'my-ui-library',
            export: 'Button'
        }
    }
}

With the above options, the following code:

@Store
class MyStore {
    getView() {
        return <ui:button>My Button</ui:button>;
    }
}

becomes:

import { StoreDecorator, Store } from '@twist/core';
import { Button } from 'my-ui-library';

@StoreDecorator
class MyStore extends Store {
    getView() {
        return <Button>My Button</Button>;
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @twist/babel-plugin-transform

Weekly Downloads

1

Version

0.2.2

License

Apache-2.0

Last publish

Collaborators

  • arifuchs
  • kerrishotts
  • mcav
  • lanther