fliphub-monorepo
Version:
the builder of builders
370 lines (272 loc) • 13.1 kB
Markdown
[//travis-ci.org/fliphub/fliphub.svg?branch=master
[ ]: https://travis-ci.org/fliphub/fliphub
[ ]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg
[ ]: https://www.npmjs.com/package/flipfam
[ ]:https://nodesecurity.io/orgs/fliphub/projects/d37f0cc6-02ea-4f05-a8aa-3b6c1e08bd21
[ ]: https://nodesecurity.io/orgs/fliphub/projects/d37f0cc6-02ea-4f05-a8aa-3b6c1e08bd21/badge
[ ]: https://img.shields.io/npm/v/fliphub.svg
[ ]: https://npmjs.org/package/fliphub
<!-- [![Slack][slack-image]][slack-url] -->
[![Build Status][travis-image]](travis-url)
[![NPM version][fliphub-npm-image]][fliphub-npm-url]
[![fliphub][gitter-badge]][gitter-url]
[![flipfam][flipfam-image]][flipfam-url]
[![Dependencies][david-deps-img]][david-deps-url]
[![MIT License][license-image]][license-url]
[![Standard JS Style][standard-image]][standard-url]
[![NSP Status][nsp-image]][nsp-url]

[](http://makeapullrequest.com)
> the builder, of builders.
enables configs that would take hundreds or thousands of lines, with just a few properties.
```js
const FlipHub = require('fliphub')
new FlipHub({entry: './src/index.js'}).build()
```
```bash
yarn add fliphub
npm i fliphub --save
```
<!-- legend for all the packages 0.0?
[ ][docs-cli]
-->
- [introduction](
- [all the apps](
- [flipfam][flipfam-url]
- [fliphub-core](
- [presets](
- [hubs](
- [examples](
- [apps](
- [cli](
- [terminology](
- explain the goals, mentality, reasoning
keep up to date! updated frequently.
[ ]: https://github.com/fliphub/fliphub/blob/master/docs/CHANGELOG.md
<!-- also see the [board](https://github.com/fliphub/fliphub/issues#boards?repos=82865013) -->
one app? two apps? 100 apps? fusebox, rollup, _and_ webpack? nodejs server, inferno, and react? existing configs? happy and no happy pack? at the same time? no sweat.
```js
const FlipHub = require('fliphub')
// take an existing config, flip it to fusebox or rollup or webpack
const config = require('./webpack.config.js')
config.flips = {to: 'fusebox'}
const apps = [
config,
{
name: 'infernod',
entry: './src/index.js',
presets: ['inferno', 'neutrino-preset-happypack', 'web'],
},
{
name: 'backend',
entry: './backend/src',
presets: ['node'],
},
]
FlipHub.init({apps}).build()
```
```js
const { FlipHub } = require('fliphub')
const apps = [
{
name: 'reacted',
presets: ['react'],
},
{
name: 'infernod',
presets: ['inferno'],
},
]
FlipHub.init({
presets: {
reusable: {
entry: './src/index.js',
flips: {to: 'fusebox'},
},
},
apps,
}).build()
```
[ ][docs-presets-default]
[ ](
- [build systems are notorious for their difficulty][medium-webpack-difficulty].
- finding and setting up the right
- scripts
- plugins
- loaders
- configs
- requiring the dependencies
- bloating your config files
- making configs for
- development bundling
- production bundling
- production dev bundling
- test environments
- development servers
- production servers
- tedious, with a high barrier of entry
- time intensive; switching build systems for 1 app is grueling
- ... all of the above for _every application_
- [with the flip of a flag](
- [existing configs](
- [easily create presets & hubs][docs-presets-add-your-own] to start converting your build system to another, flip the switch to keep compatibility without breaking everything,
- [examples-minimal][examples-minimal]
- [examples-canadas][examples-canadas]
- [examples-monorepo][examples-monorepo]
- [examples-react][examples-react]
- [examples-react-and-alias][examples-react-and-alias]
- [examples-typescript][examples-typescript]
- [examples-node][examples-node]
- [examples-lint][examples-lint]
- [examples-compat][examples-compat] 🚧
- [examples-tests][examples-tests] 🚧
- [examples-webworker][examples-webworker] 🚧
- [examples-code-splitting][examples-code-splitting] 🚧
- [examples-es6-ts-config][examples-es6-ts-config] 🚧
- [examples-flags][examples-flags] 🚧
- [📖 see the wiki][wiki-url]
- [🚧 see the work-in-progress docs][docs-wip]
[ ][docs-hubs]
white-list flags are used to filter which apps are run for different [operations][wiki-url]
[ ][docs-alias]
[ ][docs-presets]
```js
const apps = [{
presets: ['alias-resolve', 'neutrino-preset-web', 'eslint'],
}]
const appsWithArgs = [{
presets: {
aliasResolve: __dirname,
presetWeb: null,
eslint: require('./.eslintrc.js')
},
}]
```
<!--
- see flipfam
-->
v0 is still available as [flipbox][flipbox-url] but is unmaintained.
[ ]: https://github.com/fliphub/fliphub/wiki/supported-build-systems
[ ]: https://github.com/fliphub/fliphub/wiki/presets-add-your-own
[ ]: https://github.com/fliphub/fliphub/tree/master/docs
[ ]: https://github.com/fliphub/fliphub/wiki
[ ]: https://www.npmjs.com/package/flipbox
[ ]: https://webpack.js.org/
[ ]: rollupjs.org
[ ]: fuse-box.org
[ ]: https://github.com/fliphub/fliphub/wiki/presets-default
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/minimal
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/compat
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/react
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/react-and-alias
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/canadas
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/lint
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/empty
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/monorepo
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/typescript
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/webworker
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/tests
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/code-splitting
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/es6-ts-config
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/node
[ ]: https://github.com/fliphub/fliphub/tree/master/examples/flags
[ ]: https://github.com/fliphub/fliphub/tree/master/packages/fliphub-core/src
[ ]: https://github.com/fliphub/fliphub/tree/master/packages/fliphub/src/hubs
[ ]: https://github.com/fliphub/fliphub/blob/master/packages/fliphub/src/hubs/ConfigDefaulter.js
[ ]: https://github.com/fliphub/fliphub/tree/master/packages/fliphub/src/presets
[ ]: https://github.com/fliphub/fliphub/tree/master/packages/fliphub/src/core
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/cli.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/cli.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/cli.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/cli.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/dependencies.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/debugging.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/event-lifecycle.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/hubs.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/next.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/operations.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/preset-sourcemaps.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/preset-html.md
[ ]: https://github.com/fliphub/fliphub/tree/master/docs/preset-default.md
[ ]: https://github.com/fliphub/fliplog/issues/new
[ ]: https://www.npmjs.com/package/fliplog
[ ]: https://www.npmjs.com/package/flipfile
[ ]: https://github.com/fliphub/fliphub/tree/master/package.json
[ ]: https://github.com/fliphub/fliphub/tree/master/src/middleware/defaults.js
[ ]: https://github.com/fliphub/fliphub/tree/master/src/middleware/builders/fusebox.js
[ ]: https://github.com/fliphub/fliphub/tree/master/src/middleware/presets.js
[ ]: https://github.com/fliphub/fliphub/tree/master/src/middleware/defaults.js
[ ]: https://github.com/fliphub/fliphub/tree/master/flow/MiddlewareInterface
[ ]: https://github.com/fliphub/fliphub/tree/master/flow/MiddlewareInterface
[ ]: https://david-dm.org/fliphub/fliphub.svg
[ ]: https://david-dm.org/fliphub/fliphub
[ ]: https://github.com/aretecode/emoji-commits/
[ ]: https://github.com/chalk/chalk
[ ]: https://facebook.github.io/react/docs/error-decoder.html?invariant=119
[ ]: https://docs.npmjs.com/cli/shrinkwrap
[ ]: https://babeljs.io/docs/setup/
[ ]: https://github.com/tleunen/babel-plugin-module-resolver
[ ]: https://github.com/aretecode/babel-loader-builder
[ ]: [https://github.com/babel/babel/blob/master/doc/design/monorepo.md]
[ ]: [https://github.com/babel/babel/blob/master/Makefile]
[ ]: https://webpack.js.org/
[ ]: https://webpack.js.org/configuration/resolve/
[ ]: https://webpack.js.org/guides/migrating/#resolve-root-resolve-fallback-resolve-modulesdirectories
[ ]: https://medium.com/@dtothefp/why-can-t-anyone-write-a-simple-webpack-tutorial-d0b075db35ed#.b57i57t24
[ ]: https://webpack.js.org/configuration/externals/#components/sidebar/sidebar.jsx
[ ]: https://github.com/amireh/happypack
[ ]: https://webpack.js.org/guides/migrating/#uglifyjsplugin-minimize-loaders
[ ]: http://fuse-box.org/
[ ]: http://fuse-box.org/#alias
[ ]: http://fuse-box.org/#home-directory
[ ]: http://fuse-box.org/#arithmetic-instructions
[ ]: https://github.com/sighjs/sigh
[ ]: https://github.com/flyjs/fly
[ ]: http://brunch.io/
[ ]: [http://broccolijs.com/]
[ ]: [http://gearjs.org/]
[ ]: [http://yeoman.io/]
[ ]: [https://github.com/mklabs/make]
[ ]: [http://documentation.js.org/]
[ ]: [https://ninja-build.org/manual.html]
[ ]: [https://github.com/meteor/meteor/tree/devel/scripts]
[ ]: [https://github.com/facebook/react/blob/master/gulpfile.js]
[ ]: [https://github.com/facebook/react/tree/master/scripts]
[ ]: https://github.com/tj/commander.js/
[ ]: https://nodejs.org/api/globals.html
[ ]: https://nodejs.org/api/process.html#process_process_env
[ ]: https://nodejs.org/api/util.html#util_util_format_format
[ ]: https://github.com/marcello3d/node-tosource
[ ]: https://www.npmjs.com/package/yargs
[ ]: https://www.npmjs.com/package/node-flag
[ ]: https://img.shields.io/badge/%F0%9F%91%95%20code%20style-standard%2Bes6+-blue.svg
[ ]: https://github.com/aretecode/eslint-config-aretecode
[ ]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[ ]: https://spdx.org/licenses/MIT
[ ]: https://now-examples-slackin-mquyzyrecx.now.sh/
[ ]: https://now-examples-slackin-mquyzyrecx.now.sh/badge.svg
[ ]: @TODO
[ ]: @TODO
[ ]: https://img.shields.io/gitter/room/fliphub/pink.svg
[ ]: https://gitter.im/fliphub/Lobby
]: https: