项目作者: noderaider

项目描述 :
Scaffold a react monorepo and its component parts.
高级语言: JavaScript
项目地址: git://github.com/noderaider/modular.git
创建时间: 2016-10-19T22:23:31Z
项目社区:https://github.com/noderaider/modular

开源协议:Other

下载


NPM

An unofficial companion ecosystem to create-react-app

Build Status
codecov

What is this?

Often react applications can grow extremely large. create-react-app is a very innovative step forward in react apps, encouraging keeping them small by abstracting the build into a separate module (react-scripts). This ‘managed’ build strategy has many upsides, with the primary drawback being that you cannot modify the build process as easily. @raider/modular is an ecosystem of companion tools to create-react-app to continue in its footsteps, targeting the areas that it does not hit such as CSS modules support, and doing it in such a way that it will encourage project stacks to grow horizontally (many modules) instead of vertically.

Tenets

  • Every module is its own npm package.
  • Every module has built in hot reloading support to work in conjunction with a create-react-app downstream project.
  • Fast yarn installation support with fallback to npm if yarn is not installed.
  • Works on every platform.

PROGRESS

  1. create-component-module react-foo-bar [-t/--with-test-module]

After publishing / linking, you may use the component from your downstream react app like so:

  1. import React from 'react'
  2. import reactFooBar from 'react-foo-bar'
  3. // Create the component
  4. const FooBar = reactFooBar(React)
  5. export default (props) => <FooBar foo="bar" ></FooBar>

Note: Exporting modules as factories sidesteps a wide range of issues causing multiple instances of React in your downstream app.

Utils

  • @raider/install"">npm i -g @raider/install :scroll:
    • CLI / API component to run NPM install on a package.
    • Uses yarn if detected and falls back to npm.
  • @raider/which"">npm i -g @raider/which :scroll:
    • CLI / API component to run closs-platform which command.
  • @raider/cross"">npm i -g @raider/cross :scroll:
    • CLI / API component to upgrade a project / repos line endings to unix style safely and recursively.

Acknowledgements

Special thanks to Facebook for innovations with create-react-app, without it this project would not be possible.