Skip to content

Commit

Permalink
Merge branch 'master' into pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
langpavel authored Jan 2, 2017
2 parents d58acd2 + 97fbda6 commit e93a777
Show file tree
Hide file tree
Showing 34 changed files with 6,816 additions and 314 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ forked repo, check that it meets these guidelines:
* Create a separate PR for each small feature or bug fix.
* [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)
your commits into one for each PR.
* Run `npm test` to make sure that your code style is OK and there are no any regression bugs.
* Run `yarn test` to make sure that your code style is OK and there are no any regression bugs.
* When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title

#### Style Guide

Our linter will catch most styling issues that may exist in your code. You can check the status
of your code styling by simply running: `npm run lint`
of your code styling by simply running: `yarn lint`

However, there are still some styles that the linter cannot pick up. If you are unsure about
something, looking at [Airbnb's Style Guide](https://github.com/airbnb/javascript) will guide you
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:7.2.1-alpine

# Copy applicaiton files
COPY ./build /usr/src/app
WORKDIR /usr/src/app

# Install Node.js dependencies
RUN npm install --production --silent

CMD [ "node", "server.js" ]
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## React Starter Kit — "[isomorphic](http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/)" web app boilerplate

> [React Starter Kit](https://www.reactstarterkit.com) is an opinionated
> boilerplate for web development built on top of [Node.js](https://nodejs.org/),
> [Express](http://expressjs.com/), [GraphQL](http://graphql.org/) and
> [React](https://facebook.github.io/react/), containing modern web development
> tools such as [Webpack](http://webpack.github.io/), [Babel](http://babeljs.io/)
> and [Browsersync](http://www.browsersync.io/). Helping you to stay productive
> following the best practices. A solid starting point for both professionals
> and newcomers to the industry.
**See** [getting started](./docs/getting-started.md) guide,
[demo](http://demo.reactstarterkit.com), [docs](https://github.com/kriasoft/react-starter-kit/tree/master/docs),
[to-do list](https://waffle.io/kriasoft/react-starter-kit)  | 
**Join** [#react-starter-kit](https://gitter.im/kriasoft/react-starter-kit) chat room to stay up to date  | 
## React Starter Kit — "[isomorphic](http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/)" web app boilerplate &nbsp; <a href="https://github.com/kriasoft/react-starter-kit/stargazers"><img src="https://img.shields.io/github/stars/kriasoft/react-starter-kit.svg?style=social&label=Star&maxAge=3600" height="20"></a> <a href="https://twitter.com/ReactStarter"><img src="https://img.shields.io/twitter/follow/ReactStarter.svg?style=social&label=Follow&maxAge=3600" height="20"></a>

[React Starter Kit](https://www.reactstarterkit.com) is an opinionated boilerplate for web
development built on top of [Node.js](https://nodejs.org/),
[Express](http://expressjs.com/), [GraphQL](http://graphql.org/) and
[React](https://facebook.github.io/react/), containing modern web development
tools such as [Webpack](http://webpack.github.io/), [Babel](http://babeljs.io/)
and [Browsersync](http://www.browsersync.io/). Helping you to stay productive
following the best practices. A solid starting point for both professionals
and newcomers to the industry.

**See** [getting started guide](./docs/getting-started.md), [demo][demo],
[docs](https://github.com/kriasoft/react-starter-kit/tree/master/docs),
[roadmap](https://github.com/kriasoft/react-starter-kit/projects/1) &nbsp;|&nbsp;
**Join** [#react-starter-kit][chat] chat room on Gitter &nbsp;|&nbsp;
**Visit our sponsors**:<br><br>

[![Rollbar - Full-stack error tracking for all apps in any language](https://dl.dropboxusercontent.com/u/16006521/react-starter-kit/rollbar.png)](https://rollbar.com/?utm_source=reactstartkit(github)&utm_medium=link&utm_campaign=reactstartkit(github)) &nbsp;&nbsp;
[![Localize - Translate your web app in minutes](https://dl.dropboxusercontent.com/u/16006521/react-starter-kit/localize.png)](https://localizejs.com/?cid=802&utm_source=rsk)
[![Rollbar - Full-stack error tracking for all apps in any language](https://koistya.github.io/files/rsk/rollbar.png)](https://rollbar.com/?utm_source=reactstartkit(github)&utm_medium=link&utm_campaign=reactstartkit(github)) &nbsp;&nbsp;
[![Localize - Translate your web app in minutes](https://koistya.github.io/files/rsk/localize.png)](https://localizejs.com/?cid=802&utm_source=rsk)


### Getting Started
Expand Down Expand Up @@ -201,6 +201,7 @@ requests](CONTRIBUTING.md#pull-requests).

### Related Projects

* [GraphQL Starter Kit](https://github.com/kriasoft/graphql-starter-kit) — Boilerplate for building data APIs with Node.js, JavaScript (via Babel) and GraphQL
* [Membership Database](https://github.com/membership/membership.db) — SQL schema boilerplate for user accounts, profiles, roles, and auth claims
* [Babel Starter Kit](https://github.com/kriasoft/babel-starter-kit) — Boilerplate for authoring JavaScript/React.js libraries

Expand All @@ -213,6 +214,7 @@ requests](CONTRIBUTING.md#pull-requests).
* [appear.in/react](https://appear.in/react) — Open hours! Exchange ideas and experiences (React, GraphQL, startups and pet projects)
* [@koistya](https://twitter.com/koistya) on [Codementor](https://www.codementor.io/koistya), or [Skype](http://hatscripts.com/addskype?koistya) — Private consulting


### License

Copyright © 2014-2016 Kriasoft, LLC. This source code is licensed under the MIT
Expand All @@ -222,3 +224,8 @@ file. The documentation to the project is licensed under the

---
Made with ♥ by Konstantin Tarkus ([@koistya](https://twitter.com/koistya)) and [contributors](https://github.com/kriasoft/react-starter-kit/graphs/contributors)

[rsk]: https://www.reactstarterkit.com
[demo]: http://demo.reactstarterkit.com
[node]: https://nodejs.org
[chat]: https://gitter.im/kriasoft/react-starter-kit
37 changes: 21 additions & 16 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
### Requirements

* Mac OS X, Windows, or Linux
* [Node.js](https://nodejs.org/) v6.5 or newer
* `npm` v3.10 or newer (new to [npm](https://docs.npmjs.com/)?)
* [Yarn][https://yarnpkg.com/] package + [Node.js](https://nodejs.org/) v6.5 or newer
* `node-gyp` prerequisites mentioned [here](https://github.com/nodejs/node-gyp)
* Text editor or IDE pre-configured with React/JSX/Flow/ESlint ([learn more](./how-to-configure-text-editors.md))

Expand All @@ -20,7 +19,6 @@ Before you start, take a moment to see how the project structure looks like:
├── /public/ # Static files which are copied into the /build/public folder
├── /src/ # The source code of the application
│ ├── /components/ # React components
│ ├── /content/ # Static pages like About Us, Privacy Policy etc.
│ ├── /core/ # Core framework and utility functions
│ ├── /data/ # GraphQL server schema and data models
│ ├── /routes/ # Page/screen components along with the routing information
Expand All @@ -45,7 +43,7 @@ Before you start, take a moment to see how the project structure looks like:
**Note**: The current version of RSK does not contain a Flux implementation.
It can be easily integrated with any Flux library of your choice. The most
commonly used Flux libraries are [Flux](http://facebook.github.io/flux/),
[Redux](http://redux.js.org/), and [Relay](http://facebook.github.io/relay/).
[Redux](http://redux.js.org/) and [Relay](http://facebook.github.io/relay/).

### Quick Start

Expand All @@ -64,12 +62,12 @@ Alternatively, you can start a new project based on RSK right from
[WebStorm IDE](https://www.jetbrains.com/webstorm/help/create-new-project-react-starter-kit.html),
or by using [Yeoman generator](https://www.npmjs.com/package/generator-react-fullstack).

#### 2. Run `npm install`
#### 2. Run `yarn install`

This will install both run-time project dependencies and developer tools listed
in [package.json](../package.json) file.

#### 3. Run `npm start`
#### 3. Run `yarn start`

This command will build the app from the source files (`/src`) into the output
`/build` folder. As soon as the initial build completes, it will start the
Expand All @@ -88,13 +86,13 @@ app on the fly and refresh all the connected browsers.

![browsersync](https://dl.dropboxusercontent.com/u/16006521/react-starter-kit/brwosersync.jpg)

Note that the `npm start` command launches the app in `development` mode,
Note that the `yarn start` command launches the app in `development` mode,
the compiled output files are not optimized and minimized in this case.
You can use `--release` command line argument to check how your app works
in release (production) mode:

```shell
$ npm start -- --release
$ yarn start -- --release
```
*NOTE: double dashes are required*

Expand All @@ -104,14 +102,21 @@ $ npm start -- --release
If you need just to build the app (without running a dev server), simply run:

```shell
$ npm run build
$ yarn run build
```

or, for a production build:

```shell
$ npm run build -- --release
$ yarn run build -- --release
```

or, for a production docker build:

```shell
$ yarn run build -- --release --docker
```

*NOTE: double dashes are required*

After running this command, the `/build` folder will contain the compiled
Expand All @@ -121,14 +126,14 @@ running `node build/server.js`.
To check the source code for syntax errors and potential issues run:

```shell
$ npm run lint
$ yarn run lint
```

To launch unit tests:

```shell
$ npm test # Run unit tests with Mocha
$ npm run test:watch # Launch unit test runner and start watching for changes
$ yarn run test # Run unit tests with Mocha
$ yarn run test:watch # Launch unit test runner and start watching for changes
```

By default, [Mocha](https://mochajs.org/) test runner is looking for test files
Expand All @@ -138,13 +143,13 @@ as an example.
To deploy the app, run:

```shell
$ npm run deploy
$ yarn run deploy
```

The deployment script `tools/deploy.js` is configured to push the contents of
the `/build` folder to a remote server via Git. You can easily deploy your app
to [Azure Web Apps](https://azure.microsoft.com/en-us/services/app-service/web/),
or [Heroku](https://www.heroku.com/) this way. Both will execute `npm install --production`
or [Heroku](https://www.heroku.com/) this way. Both will execute `yarn install --production`
upon receiving new files from you. Note, you should only deploy the contents
of the `/build` folder to a remote server.

Expand All @@ -158,5 +163,5 @@ back into your own project by running:
$ git checkout master
$ git fetch react-starter-kit
$ git merge react-starter-kit/master
$ npm install
$ yarn install
```
11 changes: 6 additions & 5 deletions docs/how-to-configure-text-editors.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Install local npm packages
* [stylelint](https://www.npmjs.com/package/stylelint)

```shell
npm install --save-dev eslint babel-eslint eslint-plugin-react stylelint
yarn add --dev eslint babel-eslint eslint-plugin-react stylelint
```

*You may need to restart atom for changes to take effect*
Expand All @@ -71,9 +71,10 @@ Set Babel as default syntax for a particular extension:
* Repeat this for each extension (e.g.: .js and .jsx).

Install local npm packages

```
npm install eslint@latest
npm install babel-eslint@latest
npm install eslint-plugin-react
npm install stylelint
yarn add --dev eslint@latest
yarn add --dev babel-eslint@latest
yarn add --dev eslint-plugin-react
yarn add --dev stylelint
```
4 changes: 2 additions & 2 deletions docs/recipes/how-to-integrate-react-intl.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
[en, cs].forEach(addLocaleData);
```

5. Execute `npm run extractMessages` or `npm start` to strip out messages.
5. Execute `yarn run extractMessages` or `yarn start` to strip out messages.
Message files are created in `src/messages` directory.

6. Edit `src/messages/*.json` files, change only `message` property.

7. Execute `npm run build`,
7. Execute `yarn run build`,
your translations should be copied to `build/messages/` directory.


Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/how-to-use-sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Install [`node-sass`](https://github.com/sass/node-sass) and
[`sass-loader`](https://github.com/jtangelder/sass-loader) modules as dev dependencies:

```sh
$ npm install node-sass --save-dev
$ npm install sass-loader --save-dev
$ yarn add node-sass --dev
$ yarn add sass-loader --dev
```

### Step 2
Expand Down
10 changes: 5 additions & 5 deletions docs/recipes/using-npm-and-webpack-as-a-build-tool.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Using NPM and Webpack as a Build Tool
## Using Yarn and Webpack as a Build Tool

The [npm](https://docs.npmjs.com/) command line utility that comes with Node.js
The [Yarn](https://yarnpkg.com/) command line utility that comes with Node.js
allows you to run arbitrary scripts and [Node.js modules](https://www.npmjs.com/)
without them being globally installed. This is very convenient, because other
developers in your team don't need to worry about having some set of tools
Expand All @@ -11,7 +11,7 @@ For example, if you need to lint your JavaScript code with [ESLint](http://eslin
and [JSCS](http://jscs.info/), you just install them as project's dependencies:

```shell
$ npm install eslint jscs --save-dev
$ yarn add eslint jscs --dev
```

Add a new command line to `package.json/scripts`:
Expand All @@ -31,7 +31,7 @@ Add a new command line to `package.json/scripts`:
And execute it by running:

```shell
$ npm run lint # npm run <script-name>
$ yarn run lint # yarn run <script-name>
```

Which will be the same as running `./node_modules/bin/eslint src && ./node_modules/bin/jscs src`,
Expand Down Expand Up @@ -89,5 +89,5 @@ The `npm` script for it may look like this:
You can run it as follows:

```shell
$ npm run build
$ yarn run build
```
10 changes: 5 additions & 5 deletions docs/testing-your-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ You may also want to take a look at the following related packages:
### Running tests

To test your application simply run the
[`npm test`](https://github.com/kriasoft/react-starter-kit/blob/b22b1810461cec9c53eedffe632a3ce70a6b29a3/package.json#L154)
[`yarn test`](https://github.com/kriasoft/react-starter-kit/blob/b22b1810461cec9c53eedffe632a3ce70a6b29a3/package.json#L154)
command which will:
- recursively find all files ending with `.test.js` in your `src/` directory
- mocha execute found files

```bash
npm test
yarn test
```

### Conventions

- test filenames MUST end with `test.js` or `npm test` will not be able to detect them
- test filenames MUST end with `test.js` or `yarn test` will not be able to detect them
- test filenames SHOULD be named after the related component (e.g. create `Login.test.js` for
`Login.js` component)

Expand Down Expand Up @@ -92,9 +92,9 @@ Please note that NOT using IntlProvider will produce the following error:
### Linting

Running RSK eslint will also scan your test files:
In order to check if your JavaScript and CSS code follows the suggested style guidelines run:

```bash
npm run eslint
yarn run lint
```

Loading

0 comments on commit e93a777

Please sign in to comment.