Giter VIP home page Giter VIP logo

react-native-generator's Introduction

react-native-generator

Why use this when there are other generators?

There are different type of generator to help create react and redux based application. They are doing great job with action, enums and reducers generation, but based on exist experience we believe that module based structuring is more reliable way to go. This generator created in mind to provide efficient way for component, container, screens, actions, generator. You can create a project (React Native) structure fro 20 minutes, save your time :) . It's very simple and convenient for using.


Install

yarn  add -D rn-generator

or

npm install -D rn-generator

Open package json and add generate command within the scripts option

"scripts": {
    "generator": "generate"
}

Generators

The generator help to generate following components.

  • Component generator
    • Name: The name of the component. i.e (Button, LoginForm etc.)
    • Flow: The static type
    • Use PureComponent / Component
    • Component properties: choose the component properties i.e ( constructor, propTypes, default props ) or life cycles
    • life cycles
    • Tests
  • Container generator
    • Name: the name of the container, i.e. Awesome, which converts to: AwesomeContainer.
    • Component: you must select the component in list, that connects this container.
    • Module
    • Actions: set the action names
  • Redux store configuration generator
    • Create store config file

To run the generators with a list of options, run

yarn run generator

or

npm run generator

Note:

When you use the generator you need to use "redux-action", for actions and reducers. You can see it there

Configs

The generators output paths can be configured in two ways.

1. package.json

You just need create rnGenerator properties in package.json file and give relative paths

"rnGenerator": {
   "paths": {
     "componentsDir": "src/components/"
    }
}

2. .rnGenerator

Create ".rnGenerator" file in the root directory (where package.json is)

Set your custom configs there as json data

{
	"paths": {
		"rootReducerPath": "src/reducers/index.js",
	    "componentsDir": "src/components",
	    "containersDir": "src/containers",
	    "modulesDir": "src/modules",
	    "testRootDir": "./__test__",
	    "rootFile": "src/index.js",
	    "storePath": "src/store",
	    "appFile": "src/app.js,
	    "templatePath": "",
	}
}

Roadmap

  • Add custom generators

Licence

MIT

react-native-generator's People

Contributors

bayazetyan avatar

Stargazers

 avatar  avatar Hayk Simonyan avatar Dmitry Malakhov avatar  avatar  avatar

Watchers

Dmitry Malakhov avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.