Skip to content

Commit 5df1457

Browse files
committed
Merge branch 'develop'
2 parents aa73937 + 81af22e commit 5df1457

9 files changed

+2766
-671
lines changed

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": true,
3+
"tabWidth": 4,
4+
"printWidth": 120,
5+
"jsxBracketSameLine": false,
6+
"semi": true,
7+
"singleQuote": true
8+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ yarn
9191
yarn dev
9292
```
9393

94-
Open browser on [localhost:3000](http://localhost:3000/)
94+
Open browser on [localhost:4000](http://localhost:4000/)
9595

9696

9797
## Docs

client/config/webpack.config.common.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const common = {
4747
use: ['babel-loader?cacheDirectory'],
4848
exclude: /node_modules/,
4949
include: PATHS.app
50-
},
51-
{
52-
test: /\.json$/,
53-
loader: 'json-loader'
5450
}
5551
]
5652
},
@@ -71,7 +67,10 @@ const common = {
7167
mobile: true
7268
}),
7369
new webpack.optimize.ModuleConcatenationPlugin()
74-
]
70+
],
71+
stats: {
72+
children: false
73+
}
7574
};
7675

7776
module.exports = {

client/config/webpack.config.dev.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const merge = require('webpack-merge');
33
const webpack = require('webpack');
44

55
module.exports = merge(common, {
6-
devtool: 'eval-source-map',
6+
mode: 'development',
7+
devtool: 'eval',
78
module: {
89
rules: [
910
{
@@ -27,6 +28,9 @@ module.exports = merge(common, {
2728
localIdentName: '[path][name]__[local]'
2829
}
2930
},
31+
{
32+
loader: 'postcss-loader'
33+
},
3034
{
3135
loader: 'resolve-url-loader'
3236
},

client/config/webpack.config.prod.js

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
const CleanPlugin = require('clean-webpack-plugin');
22
const CopyWebpackPlugin = require('copy-webpack-plugin');
3-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
3+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
44
const merge = require('webpack-merge');
5-
const webpack = require('webpack');
65
const path = require('path');
6+
77
const { common, PATHS } = require('./webpack.config.common');
88

99
module.exports = merge(common, {
10+
mode: 'production',
1011
output: {
11-
path: PATHS.build,
12-
filename: '[name].[chunkhash].js',
13-
chunkFilename: '[chunkhash].js'
12+
chunkFilename: '[chunkhash].js',
13+
filename: '[name].[chunkhash].js'
14+
},
15+
optimization: {
16+
runtimeChunk: 'single',
17+
splitChunks: {
18+
chunks: 'all'
19+
}
1420
},
21+
devtool: 'hidden-source-map',
1522
module: {
1623
rules: [
1724
{
@@ -22,28 +29,26 @@ module.exports = merge(common, {
2229
},
2330
{
2431
test: /\.scss$/,
25-
use: ExtractTextPlugin.extract({
26-
fallback: 'style-loader',
27-
use: [
28-
{
29-
loader: 'css-loader',
30-
options: {
31-
modules: true,
32-
camelCase: 'dashes',
33-
minimize: true
34-
}
35-
},
36-
{
37-
loader: 'postcss-loader'
38-
},
39-
{
40-
loader: 'resolve-url-loader'
41-
},
42-
{
43-
loader: 'sass-loader'
32+
use: [
33+
MiniCssExtractPlugin.loader,
34+
{
35+
loader: 'css-loader',
36+
options: {
37+
modules: true,
38+
camelCase: 'dashes',
39+
minimize: true
4440
}
45-
]
46-
})
41+
},
42+
{
43+
loader: 'postcss-loader'
44+
},
45+
{
46+
loader: 'resolve-url-loader'
47+
},
48+
{
49+
loader: 'sass-loader'
50+
}
51+
]
4752
}
4853
]
4954
},
@@ -52,19 +57,7 @@ module.exports = merge(common, {
5257
root: PATHS.root,
5358
verbose: false
5459
}),
55-
new webpack.optimize.CommonsChunkPlugin({
56-
names: 'vendor',
57-
minChunks: module => /node_modules/.test(module.resource)
58-
}),
59-
new ExtractTextPlugin('[name].[chunkhash].css'),
60-
new webpack.DefinePlugin({
61-
'process.env.NODE_ENV': '"production"'
62-
}),
63-
new webpack.optimize.UglifyJsPlugin({
64-
compress: {
65-
warnings: false
66-
}
67-
}),
60+
new MiniCssExtractPlugin('[name].[chunkhash].css'),
6861
new CopyWebpackPlugin([
6962
{
7063
from: path.join(PATHS.app, 'favicon.ico'),

docs/setup.md

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# React Seed - Setup
1+
# React Seed - Setup
22

33
## Install dependencies
44

@@ -14,26 +14,25 @@ You can install Postgres or run your server in a Docker container.
1414

1515
### Postgres
1616

17-
* Install [postgres](https://www.postgresql.org/). When prompted to enter the `postgres` user password, use `sa.pg.01` or one of your choice
18-
* Make sure to update the password in `server/datastore/create/knexfile.js` if you picked a different password.
19-
* For more information about setting up the server see [official docs](https://wiki.postgresql.org/wiki/First_steps)
17+
* Install [postgres](https://www.postgresql.org/). When prompted to enter the `postgres` user password, use `sa.pg.01` or one of your choice
18+
* Make sure to update the password in `server/datastore/create/knexfile.js` if you picked a different password.
19+
* For more information about setting up the server see [official docs](https://wiki.postgresql.org/wiki/First_steps)
2020

2121
### Docker
2222

23-
* Install [Docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/)
24-
* Run `yarn database:docker-server` to create the docker container for the Postgres Server (volume to persist data will be mounted)
23+
* Install [Docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/)
24+
* Run `yarn database:docker-server` to create the docker container for the Postgres Server (volume to persist data will be mounted)
2525

2626
#### Structure and Data
2727

2828
Once you have configured your Postgres server, run the following commands:
2929

30-
* Create the `reactseeddb` database, `pg` user and grant access to database:
31-
* `yarn database:create`
32-
* Create tables running migrations:
33-
* `yarn migrate:latest`
34-
* Populate database running the seeds:
35-
* `yarn seed:run`
36-
30+
* Create the `reactseeddb` database, `pg` user and grant access to database:
31+
* `yarn database:create`
32+
* Create tables running migrations:
33+
* `yarn migrate:latest`
34+
* Populate database running the seeds:
35+
* `yarn seed:run`
3736

3837
## Start the app
3938

@@ -51,17 +50,16 @@ $ yarn dev # or (yarn run dev)
5150
$ yarn prod # build and start
5251
```
5352

54-
Open browser on [localhost:3000](http://localhost:3000/)
55-
53+
Open browser on [localhost:4000](http://localhost:4000/)
5654

5755
## NPM Scripts
5856

5957
```bash
60-
$ yarn build # build production assets
58+
$ yarn build # build production assets
6159

62-
$ yarn start # execute production server
60+
$ yarn start # execute production server
6361

64-
$ yarn test # execute all tests
62+
$ yarn test # execute all tests
6563

6664
$ yarn lint # execute linting
6765
```
@@ -70,28 +68,27 @@ $ yarn lint # execute linting
7068

7169
#### More scripts
7270

73-
* `test`: exec all test (client uses `jest`, server uses `tape`)
74-
* `test:client`: exec client test
75-
* `test:server`: exec server test
76-
* `tdd`: exec test (on watch mode)
77-
* `lint`: exec linting (`eslint`)
78-
* `migrate:*`: knex migrations
79-
* `migrate:make`: create migration script
80-
* `migrate:latest`: exec migrations
81-
* `migrate:rollback`: rollback migration
82-
* `seed:*`: data seeds
83-
* `seed:make`: create seed script
84-
* `seed:run`: exec seeds
85-
* `stats`: run `npm` stats
86-
* `build`: build production assets
87-
* `start`: exec production server
88-
* `dev`: exec development server
89-
* `prod`: build production assets and exec production server
71+
* `test`: exec all test (client uses `jest`, server uses `tape`)
72+
* `test:client`: exec client test
73+
* `test:server`: exec server test
74+
* `tdd`: exec test (on watch mode)
75+
* `lint`: exec linting (`eslint`)
76+
* `migrate:*`: knex migrations
77+
* `migrate:make`: create migration script
78+
* `migrate:latest`: exec migrations
79+
* `migrate:rollback`: rollback migration
80+
* `seed:*`: data seeds
81+
* `seed:make`: create seed script
82+
* `seed:run`: exec seeds
83+
* `stats`: run `npm` stats
84+
* `build`: build production assets
85+
* `start`: exec production server
86+
* `dev`: exec development server
87+
* `prod`: build production assets and exec production server
9088

9189
</details>
9290

93-
94-
## Development
91+
## Development
9592

9693
### Git Hooks (using `husky`)
9794

docs/vscode.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ We encourage the use of [prettier](https://github.com/prettier/prettier) in your
1818

1919
// settings for `relative path` extension
2020
"relativePath.removeExtension": true,
21-
"relativePath.removeLeadingDot": true,
22-
23-
// settings for `prettier` extension
24-
"prettier.singleQuote": true,
25-
"prettier.printWidth": 120,
26-
"prettier.useTabs": true,
27-
"prettier.tabWidth": 4
21+
"relativePath.removeLeadingDot": true
2822
}
2923
```
3024

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"scripts": {
2121
"precommit": "lint-staged",
2222
"prepush": "npm test",
23-
"lint": "eslint . --ext .js,.jsx --ignore-path .gitignore --cache --ignore-pattern plop-templates",
23+
"slint": "eslint . --ext .js,.jsx --ignore-path .gitignore --cache --ignore-pattern plop-templates",
2424
"stats": "cd client && npm run stats",
2525
"build": "cd client && npm run build",
2626
"start": "cd server && npm start",
@@ -46,11 +46,11 @@
4646
},
4747
"lint-staged": {
4848
"*.{js,jsx}": [
49-
"lint"
49+
"npm run slint"
5050
]
5151
},
5252
"devDependencies": {
53-
"autoprefixer": "^7.1.2",
53+
"autoprefixer": "^8.2.0",
5454
"babel-core": "^6.26.0",
5555
"babel-eslint": "^8.0.1",
5656
"babel-loader": "^7.1.2",
@@ -62,17 +62,16 @@
6262
"coveralls": "^2.13.1",
6363
"css-loader": "^0.28.5",
6464
"eslint": "^4.5.0",
65-
"eslint-loader": "^1.9.0",
65+
"eslint-loader": "^2.0.0",
6666
"eslint-plugin-react": "^7.3.0",
67-
"extract-text-webpack-plugin": "^3.0.0",
68-
"file-loader": "^0.11.2",
69-
"html-webpack-plugin": "^2.30.1",
67+
"file-loader": "^1.1.11",
68+
"html-webpack-plugin": "^3.1.0",
7069
"html-webpack-template": "^6.0.1",
7170
"http-server": "^0.10.0",
7271
"husky": "^0.14.3",
7372
"istanbul-instrumenter-loader": "^3.0.0",
74-
"json-loader": "^0.5.6",
75-
"lint-staged": "^4.0.3",
73+
"lint-staged": "^7.0.0",
74+
"mini-css-extract-plugin": "^0.2.0",
7675
"node-sass": "^4.5.3",
7776
"nodemon": "^1.11.0",
7877
"npm-install-webpack-plugin": "^4.0.5",
@@ -81,9 +80,10 @@
8180
"raw-loader": "^0.5.1",
8281
"resolve-url-loader": "^2.1.0",
8382
"sass-loader": "^6.0.6",
84-
"style-loader": "^0.18.2",
85-
"webpack": "^3.5.5",
86-
"webpack-dev-middleware": "^1.12.0",
83+
"style-loader": "^0.20.3",
84+
"webpack": "^4.2.0",
85+
"webpack-cli": "^2.0.13",
86+
"webpack-dev-middleware": "^3.0.1",
8787
"webpack-hot-middleware": "^2.18.2",
8888
"webpack-merge": "^4.1.0"
8989
},

0 commit comments

Comments
 (0)