generact

Generate React components by replicating your own

Github星跟蹤圖

It already works with boilerplates such as create-react-app (above example), react-boilerplate, react-starter-kit and ARc (ok, I'm self-promoting here ?). So, most likely this will work for you with your current project.

Install

$ npm install -g generact

Motivation

I usually work on different projects with different file structures. Whenever I needed to create a new component, the approach I used was to copy and paste a similar or very basic component and start writing the new component from it. Talking with other developers, this seemed like a very common process.

However, I've never been satisfied with that. It looked like I was doing a robot job. So why not create a robot to do that?

Usage

$ cd ~/my-projects/my-react-project
$ generact

That will scan ~/my-projects/my-react-project for components to replicate.

Specify another root path to find components

If you want to replicate components from another directory, you can do that by using root option:

$ generact --root relative/or/absolute/path/to/any/react/project

Specify component path to replicate

generact will probably find all component files inside the root path automagically (using list-react-files). But, if it doesn't, you can still pass in the component path:

$ generact relative/or/absolute/path/to/component.js

Contributing

PRs are welcome.

Use npm run watch while coding.

License

MIT © Diego Haz

主要指標

概覽
名稱與所有者diegohaz/generact
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2017-06-03 17:57:58
推送於2019-03-08 17:18:29
最后一次提交2019-03-08 14:18:08
發布數8
最新版本名稱v0.4.0 (發布於 2019-03-08 14:18:08)
第一版名稱v0.1.0 (發布於 2017-06-04 19:28:53)
用户参与
星數1.5k
關注者數14
派生數64
提交數39
已啟用問題?
問題數19
打開的問題數10
拉請求數8
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?