A cli tool for converting React class components to functional components with hooks.
- To use as a global tool:
- Clone the repo
[sudo] npm link
[sudo] hookd <filePath>
- To use as a npm cl tool:
npm i -D @reactionaries/hookd
- create a
package.json
script for hookd
Then Hookd will create a /hookd
directory with your newly converted file
Babel will be the main tool for parsing traversal and generating your new code.
- babel parser
- parse existing code into an ast
- babel traverse
- traversal and manipulation of the ast
- babel types
- define and verify the state and creation of nodes
- babel generator
- creation of final ast code
- jamiebuilds' babel handbook fundamentals for creating babel plugins
- AST Explorer receives a special thanks