Skip to content

Commit

Permalink
Run prettier on all readme's
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Mar 12, 2018
1 parent 006e6a1 commit 89358ff
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 107 deletions.
21 changes: 12 additions & 9 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Contributor Covenant Code of Conduct

<!-- START doctoc generated TOC please keep comment here to allow auto update -->

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

**Table of Contents**

- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct)
- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
- [Our Responsibilities](#our-responsibilities)
- [Scope](#scope)
- [Enforcement](#enforcement)
- [Attribution](#attribution)
* [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct)
* [Our Pledge](#our-pledge)
* [Our Standards](#our-standards)
* [Our Responsibilities](#our-responsibilities)
* [Scope](#scope)
* [Enforcement](#enforcement)
* [Attribution](#attribution)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -36,7 +39,7 @@ include:
Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
Expand Down Expand Up @@ -84,4 +87,4 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[version]: http://contributor-covenant.org/version/1/4/
35 changes: 18 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# How to Contribute to Backpack

<!-- START doctoc generated TOC please keep comment here to allow auto update -->

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

**Table of Contents**

- [How to Contribute to Backpack](#how-to-contribute-to-backpack)
- [Getting started](#getting-started)
- [Using Lerna](#using-lerna)
- [Support](#support)
* [How to Contribute to Backpack](#how-to-contribute-to-backpack)
* [Getting started](#getting-started)
* [Using Lerna](#using-lerna)
* [Support](#support)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Getting started
First fork the project to your GitHub account. Then clone it, checkout a new branch, and install the dependencies.

First fork the project to your GitHub account. Then clone it, checkout a new branch, and install the dependencies.

```bash
git clone https://github.com/YOUR_USERNAME/backpack.git
Expand All @@ -33,12 +37,12 @@ npm run dev

Next, I open up `packages/backpack-core/webpack.config.js` in my editor and make some changes to the webpack configuration focusing on development mode.

To try out these local changes, I would need to:

- Kill the running example (i.e. `CMD + c`)
- Rerun it to pickup changes (i.e. `npm run dev`)
To try out these local changes, I would need to:

That's it.
* Kill the running example (i.e. `CMD + c`)
* Rerun it to pickup changes (i.e. `npm run dev`)

That's it.

## Using Lerna

Expand All @@ -47,17 +51,14 @@ When moving between branches, it's a good idea to work with a fresh install.
In your project's root run the following:

```bash
./node_modules/bin/lerna clean
./node_modules/bin/lerna clean
./node_modules/bin/lerna bootstrap
```

This will clean out, reinstall, rebuild, and symlink all of the `examples` and `packages` properly.


## Support

- Join the #backpack channel in our public Slack group. Sign up at [https://palmer.chat](https://palmer.chat/)
- File an issue on GitHub
- Tweet to or DM [@jaredpalmer](https://twitter.com/jaredpalmer)


* Join the #backpack channel in our public Slack group. Sign up at [https://palmer.chat](https://palmer.chat/)
* File an issue on GitHub
* Tweet to or DM [@jaredpalmer](https://twitter.com/jaredpalmer)
81 changes: 44 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@ Backpack is minimalistic build system for Node.js. Inspired by Facebook's [creat

**Backpack comes with the "battery-pack included":**

- Latest ES6 features (including module syntax, async/await, object rest spread)
- SUPER friendly, human readable error messages
- Live reload (on saves, add/delete file, etc.)
- Zero-config, one dependency.
* Latest ES6 features (including module syntax, async/await, object rest spread)
* SUPER friendly, human readable error messages
* Live reload (on saves, add/delete file, etc.)
* Zero-config, one dependency.

HOWEVER, you can configure Backpack to your project's needs by extending [the underlying Webpack 2 configuration](#custom-configuration).
HOWEVER, you can configure Backpack to your project's needs by extending [the underlying Webpack 2 configuration](#custom-configuration).

**PLEASE READ:** If you're thinking of using Backpack with React.js, you should use [Razzle](https://github.com/jaredpalmer/razzle) instead. It is a project purpose-built for SSR React with an almost identical API.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

**Table of Contents**

- [How to use](#how-to-use)
- [Custom configuration](#custom-configuration)
- [Customizing webpack config](#customizing-webpack-config)
- [Customizing babel config](#customizing-babel-config)
- [Building for Production](#building-for-production)
- [CLI Commands](#cli-commands)
- [`backpack dev`](#backpack-dev)
- [`backpack build`](#backpack-build)
- [FAQ](#faq)
- [Inspiration](#inspiration)
- [Authors](#authors)
* [How to use](#how-to-use)
* [Custom configuration](#custom-configuration)
* [Customizing webpack config](#customizing-webpack-config)
* [Customizing babel config](#customizing-babel-config)
* [Building for Production](#building-for-production)
* [CLI Commands](#cli-commands)
* [`backpack dev`](#backpack-dev)
* [`backpack build`](#backpack-build)
* [FAQ](#faq)
* [Inspiration](#inspiration)
* [Authors](#authors)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -54,7 +56,7 @@ and add a script to your package.json like this:

After that there are just a few ~~conventions~~ defaults:

- `src/index.js`: the entry of your app.
* `src/index.js`: the entry of your app.

...actually that's it.

Expand All @@ -64,7 +66,7 @@ You can then run your application in development mode:
npm run dev
```

Successful builds will show a console like this. *Note: screenshot taken from running the [basic example](https://github.com/palmerhq/backpack/tree/master/examples/basic)*
Successful builds will show a console like this. _Note: screenshot taken from running the [basic example](https://github.com/palmerhq/backpack/tree/master/examples/basic)_
<img src="https://cloud.githubusercontent.com/assets/4060187/21944379/eaba2fde-d9a3-11e6-87aa-f30ddc88b5a8.png" width="600" alt="npm run dev">

### Custom configuration
Expand All @@ -77,13 +79,13 @@ For custom advanced behavior, you can create a `backpack.config.js` in the root
// You can however use the ES2015 features supported by your Node.js version.
module.exports = {
/* config options here */
}
};
```

### Customizing webpack config

[Example](https://github.com/palmerhq/backpack/tree/master/examples/with-custom-webpack-config)
[Example](https://github.com/palmerhq/backpack/tree/master/examples/with-custom-webpack-config)

To extend webpack, you can define a function that extends its config via `backpack.config.js`.

```js
Expand All @@ -92,18 +94,18 @@ module.exports = {
webpack: (config, options, webpack) => {
// Perform customizations to config
// Important: return the modified config
return config
}
}
return config;
},
};
```

### Customizing babel config

[Example](https://github.com/palmerhq/backpack/tree/master/examples/with-custom-babel-config)
[Example](https://github.com/palmerhq/backpack/tree/master/examples/with-custom-babel-config)

To extend our usage of `babel`, you can define a `.babelrc` file at the root of your app. This file is optional.

If found, Backpack will consider it to be the *source of truth*. Thus it must define what Backpack needs as well, which is the `backpack-core/babel` preset.
If found, Backpack will consider it to be the _source of truth_. Thus it must define what Backpack needs as well, which is the `backpack-core/babel` preset.

This is designed so that you are not surprised by modifications we could make to the default `babel` configurations.

Expand All @@ -118,7 +120,7 @@ Here's an example `.babelrc` file:
}
```

*Note: This works [exactly like Next.js does](https://github.com/zeit/next.js#customizing-babel-config).*
_Note: This works [exactly like Next.js does](https://github.com/zeit/next.js#customizing-babel-config)._

### Building for Production

Expand All @@ -137,20 +139,22 @@ Then run the build command and start your app

```bash
npm run build
node ./build/main.js
node ./build/main.js
```

## CLI Commands

### `backpack dev`
Runs backpack in development mode.


Runs backpack in development mode.

Your code will reload if you make edits.
You will see the build errors in the console that look like this.

<img src="https://cloud.githubusercontent.com/assets/4060187/21944372/e2d5e556-d9a3-11e6-9842-0e01ce28ddd6.png" width="600" alt="backpack dev">

### `backpack build`

Builds the app for production to the `build` folder.
It correctly bundles your production mode and optimizes the build for the best performance.

Expand All @@ -160,9 +164,10 @@ You can run your production application with the following command:
node ./build/main.js
```

Your application is ready to be deployed!
Your application is ready to be deployed!

_Note: Make sure to add the `build` directory to your `.gitignore` to keep compiled code out of your git repository_

*Note: Make sure to add the `build` directory to your `.gitignore` to keep compiled code out of your git repository*
## FAQ

<details>
Expand All @@ -173,6 +178,7 @@ Your application is ready to be deployed!
Yes in that they will all make your life easier.

No in that it that Backpack is focused on server-only applications. You should use create-react-app or Next.js for your frontend and then build your backend with Backpack.

</details>

<details>
Expand All @@ -196,11 +202,12 @@ We track V8. Since V8 has wide support for ES6, we don't transpile it. Since V8
</details>

## Inspiration
- [jlongster/backend-with-webpack](https://github.com/jlongster/backend-with-webpack)
- [nyt/kyt](https://github.com/NYTimes/kyt)
- [zeit/next.js](https://github.com/zeit/next.js)
- [facebookincubator/create-react-app](https://github.com/facebookincubator/create-react-app)

* [jlongster/backend-with-webpack](https://github.com/jlongster/backend-with-webpack)
* [nyt/kyt](https://github.com/NYTimes/kyt)
* [zeit/next.js](https://github.com/zeit/next.js)
* [facebookincubator/create-react-app](https://github.com/facebookincubator/create-react-app)

## Authors

- Jared Palmer ([@jaredpalmer](https://twitter.com/jaredpalmer)) - The Palmer Group
* Jared Palmer ([@jaredpalmer](https://twitter.com/jaredpalmer)) - The Palmer Group
2 changes: 2 additions & 0 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Basic Example

## How to use

Download the example [or clone the whole project](https://github.com/palmerhq/backpack.git):

```bash
Expand All @@ -16,6 +17,7 @@ npm run dev
```

## Idea behind the example

This is a basic example of how to use Backpack in a project. It is a simple Express.js server. It demonstrates how easy it is to use
Backpack in a project. It also shows off some of the default syntax features provided by Backpack such as async/await and object rest spread
as well as a Webpack environment flag (`__DEV__`).
10 changes: 6 additions & 4 deletions examples/with-custom-babel-config/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Custom Babel Configuration Example

## How to use

Download the example [or clone the whole project](https://github.com/palmerhq/backpack.git):

```bash
curl https://codeload.github.com/palmerhq/backpack/tar.gz/master | tar -xz --strip=2 backpack-master/examples/with-custom-babel-config
cd with-custom-babel-config
```

Install it and run:

```bash
npm install
npm run dev
```

## Idea behind the example

This demonstrates how extend the default Backpack babel configuration with a custom `.babelrc` file.
More specifically, this example shows how to add all `stage-0` transformations through `babel-preset-stage-0`.

Be sure to include `backpack-core/babel` in your `.babelrc` as the first item in the presets array:

```json
{
"presets": [
"backpack-core/babel",
"..."
]
"presets": ["backpack-core/babel", "..."]
}
```
9 changes: 7 additions & 2 deletions examples/with-custom-webpack-config/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Custom Webpack Configuration Example

## How to use

Download the example [or clone the whole project](https://github.com/palmerhq/backpack.git):

```bash
curl https://codeload.github.com/palmerhq/backpack/tar.gz/master | tar -xz --strip=2 backpack-master/examples/with-custom-webpack-config
cd with-custom-webpack-config
```

Install it and run:

```bash
npm install
npm run dev
```

## Idea behind the example
This demonstrates how to customize the underlying Webpack 2 configuration in a Backpack project using a `backpack.config.js` file.
The app itself is exactly the same simple Express.js server in the basic example. However, the entry point to the application has been

This demonstrates how to customize the underlying Webpack 2 configuration in a Backpack project using a `backpack.config.js` file.
The app itself is exactly the same simple Express.js server in the basic example. However, the entry point to the application has been
changed from `./src/index.js` to `./services/main.js`.
7 changes: 6 additions & 1 deletion examples/with-flowtype/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# FlowType Example

## How to use

Download the example [or clone the whole project](https://github.com/palmerhq/backpack.git):

```bash
curl https://codeload.github.com/palmerhq/backpack/tar.gz/master | tar -xz --strip=2 backpack-master/examples/with-flowtype
cd with-flowtype
```

Install it and run:

```bash
npm install
npm run dev
```

## Idea behind the example
This demonstrates how to add [Flow](https://flowtype.org/) to your Backpack project. Flow is a static type checker that helps you write code

This demonstrates how to add [Flow](https://flowtype.org/) to your Backpack project. Flow is a static type checker that helps you write code
with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept.

To learn more about Flow, take a look at [its documentation](https://flowtype.org/).
Loading

0 comments on commit 89358ff

Please sign in to comment.