Skip to content

Commit

Permalink
simplify configuration, update deps, add redux example and docs 💥
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2ju committed Nov 4, 2017
1 parent f3d2629 commit 205968a
Show file tree
Hide file tree
Showing 56 changed files with 2,635 additions and 11,135 deletions.
45 changes: 29 additions & 16 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
{
"presets": [
["env", {
"targets": {
"chrome": 53,
"browsers": ["last 2 versions", "safari 7"]
},
"modules": false,
"loose": true
}],
"react"
],
"env": {
"development": {
"presets": [
["env", {
"modules": false,
"loose": true,
"targets": {
"browsers": ["last 2 versions", "safari 7"]
}
}],
"react"
],
"plugins": [
"react-hot-loader/babel"
"transform-class-properties",
"transform-object-rest-spread"
]
},
"production": {
"presets": [
// TODO: check babili-webpack-plugin
"babili"
"babili",
["env", {
"loose": true,
"targets": {
"browsers": ["last 2 versions", "safari 7"]
}
}],
"react"
],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
]
},
"test": {
// bacause of earlier we disable transformation of es2015 modules (needed for jest)
"presets": ["env"]
"presets": ["env", "react"],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
]
}
}
}
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/*{.,-}min.js
**/dist/*
**/config/*
**/webpack/*
**/node_modules/*
11 changes: 2 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
{
"extends": [
"airbnb",
"plugin:flowtype/recommended"
"airbnb"
],
"parser": "babel-eslint",
"env": {
"jest": true,
"browser": true
},
"plugins": [
"react",
"flowtype"
"react"
],
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
},
"rules": {
"react/forbid-prop-types": [0],
"import/no-unresolved": 0,
Expand Down
12 changes: 0 additions & 12 deletions .flowconfig

This file was deleted.

50 changes: 43 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,46 @@
![](http://media.giphy.com/media/EldfH1VJdbrwY/giphy.gif)

## Toolset
- webpack 2
- babel-preset-env
- babili
- ESLint
- Flow
- Jest + enzyme
- React-router
* [webpack](https://webpack.js.org/) with [webpack-dev-server](https://github.com/webpack/webpack-dev-server), [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin)
* [Babel](http://babeljs.io/) with [babel-preset-env](https://github.com/babel/babel-preset-env), [babel-preset-react](https://github.com/babel/babel/tree/master/packages/babel-preset-react), [object spread](https://babeljs.io/docs/plugins/transform-object-rest-spread/), [class properties](https://babeljs.io/docs/plugins/transform-class-properties/), [babili](https://github.com/babel/minify)
* [ESLint](http://eslint.org/)
* [Jest](http://facebook.github.io/jest) + [Enzyme](http://airbnb.io/enzyme/)
* [React-router v3](https://github.com/ReactTraining/react-router/tree/v3/docs)

## Prerequisites
You should have `node` and `yarn` installed on your machine:
* [Node](https://nodejs.org/en/)
* [Yarn](https://yarnpkg.com/en/docs): to install run `npm install --global yarn`

## Getting Started

1. Clone this repo
```sh
$ git clone https://github.com/ok2ju/modern-react-boilerplate.git && cd modern-react-boilerplate
```

2. Install project dependencies
```sh
$ yarn install
```

3. Run app (in dev mode) using following command:
```sh
$ yarn dev
```

4. Visit http://localhost:8080

## Available scripts
* `yarn dev` - run app in dev mode
* `yarn build` - build production-ready app
* `yarn lint` - lint(validate) source code
* `yarn test` - run tests

## Varieties
This repository has two branches:
* `develop` - basic react application boilerplate with minimum configuration
* `package/flowtyped-react` - react boilerplate with [flow](https://flow.org/) - static type checker

**Note**: currently this branches have different dependencies versions. 😓 I will fix it later.
For example `develop` branch has `react-router v3` but `package/flowtyped-react` - `react-router v4`
227 changes: 0 additions & 227 deletions flow-typed/npm/babel-core_vx.x.x.js

This file was deleted.

Loading

0 comments on commit 205968a

Please sign in to comment.