rc-generate
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

rc-generate

React CLI to generate components ( Reactjs + React Native)

npm version

Use in project

Config with package.json

{
  "rc-generate": {
    "baseUrl": "src",
    "typescript": true,
    "reactNative": false
  },
}

Or config with rc-generate.config.js

const styles = `
.container {
  color: red;
}
`;
const actions = `
const getTodo = () => {
  return {
    type: 'GET_TODO',
    payload: {}
  }
}
`;
const reducers = ``;
const sagas = ``;
const thunks = ``;

const config = {
  baseUrl: 'src',
  typescript: true,
  reactNative: false,
  templates: {
    styles,
    actions,
    reducers,
    sagas,
    thunks
  }
}
module.exports = config;

Easy use with npx

npx rc-generate --style scss --redux saga --component:name components/Button

Or use with npm global

Install

npm install rc-generate -g

Usage

rc-generate --style scss --redux saga --component:name components/Button

Options

Option Type Default Description
-c:type, --component:type function, class function Generate a component type ( example: Button or components/Button)
-c:name, --component:name string - Generate a component name
-s, --style css, scss, react-native - Generate a style
-r, --redux thunk, saga - Generate a redux state management
-V, --version - - output the version number
-h, --help - - display help for command

License

MIT © wiloke1

Readme

Keywords

none

Package Sidebar

Install

npm i rc-generate

Weekly Downloads

7

Version

0.5.2

License

MIT

Unpacked Size

37.6 kB

Total Files

34

Last publish

Collaborators

  • longnguyen