EOS is an npm package that allows you to have a full redux application up and running in only a few lines of code in the console!
We are a team that strives to make coding simple and efficient, and we are working to make the React-Redux paradigm easier to get up and running and more accessible for everyone!
Install EOS as a global npm package
npm install -g eos-redux
You're all set!
All commands are run through the following syntax:
eos <command> [args]
eos start [name]
eos s [name]
Creates a Redux app with the name specified and a Node.js Express server.
To skip backend generation, use:
eos start [name] --backend none
The following file tree is generated for the frontend:
[name]/+ frontend/+ actions/+ components/app.jsxroot.jsxrouter.jsx+ middleware/master_middleware.js+ reducers/root_reducer.js+ store/store.js+ util/index.jsx.gitignoreindex.htmlpackage.jsonwebpack.config.js
Along with the creation of the file structure comes the installation of all dependencies needed. WARNING: NVM users will need to run the following commands to install dependencies:
cd [name]npm install
All the first level dependencies included are:
If a backend was generated on start, the following additional dependencies are included:
For ease of use we have also included a default webpack.config.js file that is structured correctly for this framework.
eos generate [action] [name]
eos g [action] [name]
Generates an individual element or a full cycle.
It is important how you format your name if it is more than one word. Currently it is required that you enter the name in one of the following formats:
This command will both generate pre-filled files and place the generated middleware or reducer into the master_middleware.js or root_reducer.js respectively.
eos generate cycle [name]
Generates a full redux cycle for a given name. The files that will be generated are as follows:
eos generate component [name]
Generates file structure for a single component:
eos generate actions [name]
Generates actions file.
eos generate middleware [name]
Generates middleware file.
eos generate reducer [name]
Generates reducer file.
eos generate api_util [name]
Generates api_util file.
eos generate service [framework] [name]
Generates a server with its own associated environment. It is totally independent anything else in the project folder and can be deployed as its own app.
eos generate service express static_file_server
will create the following file structure:
eos start [project name] (unless
--backend none is added) this command is run as
follows to setup a default server.
eos g service express server
Currently supported frameworks:
Remove follows the same syntax as generate and directly reverses any action that generate makes. It can be used on the full redux cycle or on any individual portion.
eos remove [type] [name]
eos rm [type] [name]
Run Webpack from the root directory of a project with a default server.
webpack once in the frontend directory.
eos webpack watch
webpack --watch in the frontend directory. Note the slight difference in syntax here.
To enable colorized output from webpack, just do
cd frontend && webpack from the root directory.
If a backend was generated on start, this command starts an Express server listening on port 8000.
To use a local copy of EOS Redux clone down the repo:
Setup the local environment:
cd eos-reduxnpm install
To run commands with the local copy instead of
$ eos <command> [args] use:
[path to local copy]/eos-redux/eos-cli/eos-cli.js <command> [args]