Scaffold a react monorepo and its component parts.
An unofficial companion ecosystem to create-react-app
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.
create-react-app
downstream project.npm i -g create-css-module
npm i -g create-umd-module
npm i -g create-cli-module
npm i -g create-sass-module
npm i -g create-component-module
react
/ react-dom
dependencies, components are created functionally via a factory interface:
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:
import React from 'react'
import reactFooBar from 'react-foo-bar'
// Create the component
const FooBar = reactFooBar(React)
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.
npm i -g create-jest-module
react
/ react-dom
be included as npm dependencies of your module.npm i -g create-express-module
npm i -g create-koa-module
npm i -g create-proxy-module
npm i -g create-deploy-module
npm i -g create-react-repo
npm i -g @raider/install
npm i -g @raider/which
which
command.npm i -g @raider/cross
Special thanks to Facebook for innovations with create-react-app
, without it this project would not be possible.