项目作者: fuglu

项目描述 :
Create React components easily.
高级语言: JavaScript
项目地址: git://github.com/fuglu/create-react-component.git
创建时间: 2017-03-13T12:55:12Z
项目社区:https://github.com/fuglu/create-react-component

开源协议:MIT License

下载


Create React Component Build Status

:warning: :warning: :warning: This project is deprecated. You should use nwb instead. :warning: :warning: :warning:

Create React components easily.

Quick Overview

  1. npm install -g @fuglu/create-react-component
  2. create-react-component my-component
  3. cd my-component/
  4. editor

Getting Started

Installation

Install it once globally:

  1. npm install -g @fuglu/create-react-component

Or use it in your multi-package repository (sometimes called monorepo):

  1. npm install --save @fuglu/create-react-component
  1. {
  2. "name": "monorepo",
  3. "version": "1.0.0",
  4. "scripts": {
  5. "create": "create-react-component --base-path packages/ --template-path template/ --",
  6. },
  7. "dependencies": {
  8. "@fuglu/create-react-component": "^1.0.0"
  9. }
  10. }

Creating a component

To create a new component, run:

  1. create-react-component my-react-component

It will create a directory called my-react-component inside the current folder.

Inside that directory, it will generate the initial component structure and install the transitive dependencies:

  1. my-react-component/
  2. node_modules/
  3. package.json
  4. src/
  5. index.js

Custom templates

You don’t have to use the provided templates.

Just provide your own template directory and you are ready to go:

  1. create-react-component my-react-component --template-path my/template/directory

The template directory will be used to create the new component and must contain a package.json.

You can pass relative and absolute paths to --template-path.

Custom installation directory

You can specify a custom installation directory using relative or absolute paths:

  1. create-react-component my-react-component --base-path path/to/components

Scoped packages

You might want to add a scope to your package:

  1. create-react-component my-react-component --scope org

This will set the name attribute to @org/my-react-component in package.json.

Contributing

We’d love to have your helping hand on create-react-component!

Some Ideas

  • :bulb: --template-package - Allow the usage of published templates.
  • :bulb: Extract create-react-component-template and use the published package.
  • :bulb: Use lerna to release create-react-component and publish changelogs.
  • :bomb: We need some proper end to end tests! Seriously!

Acknowledgements

We are grateful to the authors of Create React App.