0.0.6 • Published 7 years ago

react-sourcerer v0.0.6

Weekly downloads
2
License
UNLICENSED
Repository
github
Last release
7 years ago

react-sourcerer

This project allows you to express code patterns in the form of React components.

This is a very experimental project. Currently, this project is under heavy development but a lot can be understood from the tests.

Example

For example the following will match code that:

  1. Imports from 'lodash'
  2. Calls forEach on any identifier imported from lodash.
<Import
  source='lodash'
>
{imports => 
  <MemberExpression
    name='forEach'
    target={getIdentifiersFromImport(imports)}
  >
    {(matches) => 
      matches.length > 0
        ? <UseES2015Each />
        : null}
  </MemberExpression>
}
</Import>

Of course the patterns can be as sophisticated as you'd like them to be, and because React is awesome you can even observe changes in the code (componentDidUpdate).

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago