react-app-components-cli

1.1.0 • Public • Published

react-app-cli Build Status

Simple create and scraffolding React components and utilities. This cli was created after reading this post So many thanks for idea to David Gilbertson

Preparing

First of all you need to create src folder. It's a start for application sources. For best expirience you may configure aliases for webpack to resolve Components and Utils.

// webpack.config.js
// ...
alias: {
  // ...
  'Components': path.resolve(`${__dirname}/src/components`),
  'Utils': path.resolve(`${__dirname}/src/utils`),
  // ...
}
// ...

After this you can use simple importing in you React application:

import MyTab from 'Components/MyTab';

import myUtil from 'Utils/myUtil';
import { myUtil1, myUtil2 } from 'Utils';

Instalation

npm install -g react-app-components-cli

Usage

cd my-awesome-react-app
mkdir src # if not exists

Configure

rcc config After running config it will create a .rcc-config.json in the root folder. You can edit settings manually in JSON file any time.

Create component

rcc component MyAwesomeComponent

Create utility

rcc util myAwesomeUtil

Main Idea.

When you create a new component, automattically will be created new folder with main JSX file, test and style. Also will de created package.json file inside this dir for best resolving names. The same thing happens when create utility. The difference is that utility is not creates package.json. All utilities are stored in index.js filera

If you have any questions you can contact me via email or telegram

Readme

Keywords

Package Sidebar

Install

npm i react-app-components-cli

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

13.9 kB

Total Files

19

Last publish

Collaborators

  • vkl