Newton's Apple(NAPP) is a Command Line Interface(CLI) tool to simplify component creation for developers working on ReactJS projects. Running a simple command, it will create a file with the name you specify and generate the boilerplate code for a typical React component.
You can also configure default path's on where to save files created with NAPP. And soon NAPP will provide the ability to create other files commonly used with React (tests, Redux files, etc). Please read the docs thoroughly to learn more.
- Basic Usage (napp new)
- Lifecycle Methods (napp select)
- Create Tests
- Configuration (napp setup)
- View Config File (napp config)
To install, first make sure you have Node installed. If you see a version number, you will be able to install Newton's Apple via NPM as below:
$ node -v v8.9.4 $ npm install -g newtons-apple
There are a lot of commands and options in NAPP and more are being added all the time, so it's understandable that you won't be able to remember them all off the top of your head. Hopefully, the in-app help menu will help you there. Simply use the -h or --help flag to see your various options:
$ napp -h Usage: napp [options] [command] <arg> Options: -v, --version output the version number -h, --help output usage information Commands: new [options] <component-name> create new component in either current directory or provided path select select lifecycle methods to be included when creating components setup configure options for Newton's Apple config [options] [project] view the options in your config file - including a project name will list the defaults for that project reset reset NAPP to default usage where it only creates files in current directory
$ napp new --help Usage: new [options] <component-name> create new component in either current directory or provided path Options: -d, --dumb set component type to dumb, i.e. functional/stateless -a, --all enable all methods -n, --none disable all methods -c, --create creates directories if they don't exist -o, --overwrite overwrites file if it exists -t, --test creates test file for new component -h, --help output usage information
If you run into any issues using this tool, please first search the issues in the repo to make sure it has not already been reported. If you don't find anything, please feel free to open a new issue.
I welcome anyone who is interested to come help contribute on this project. The most important contribution you can make is to install and test the app. Please leave feedback on what you like, didn't like, any features you would like to see added, and create issues for any bugs you find!
I will try to keep an updated list here of features I plan to implement in this CLI.
- Add support for other test suites (Mocha, Jasmine, etc).
- Redux support (create boilerplate code for projects that use Redux).
- Add custom methods to be included in component creation.