Skip to content

Commit 0c778df

Browse files
authored
Upgrade node and packages (#1679)
1 parent 6a59354 commit 0c778df

File tree

9 files changed

+1214
-1223
lines changed

9 files changed

+1214
-1223
lines changed

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.14.0

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Webpacker
22

33
![travis-ci status](https://api.travis-ci.org/rails/webpacker.svg?branch=master)
4-
[![node.js](https://img.shields.io/badge/node-%3E%3D%206.0.0-brightgreen.svg)](https://nodejs.org/en/)
4+
[![node.js](https://img.shields.io/badge/node-%3E%3D%206.14.0-brightgreen.svg)](https://nodejs.org/en/)
55
[![Gem](https://img.shields.io/gem/v/webpacker.svg)](https://github.com/rails/webpacker)
66

77
Webpacker makes it easy to use the JavaScript pre-processor and bundler
@@ -50,8 +50,8 @@ in which case you may not even need the asset pipeline. This is mostly relevant
5050

5151
* Ruby 2.2+
5252
* Rails 4.2+
53-
* Node.js 6.0.0+
54-
* Yarn 0.25.2+
53+
* Node.js 6.14.0+
54+
* Yarn 1.x+
5555

5656

5757
## Features

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"lib/install/config/webpacker.yml"
99
],
1010
"engines": {
11-
"node": ">=6.0.0",
12-
"yarn": ">=0.25.2"
11+
"node": ">=6.14.0",
12+
"yarn": ">=1.0.0"
1313
},
1414
"dependencies": {
1515
"@babel/core": "^7.0.0",
@@ -25,33 +25,33 @@
2525
"babel-core": "^7.0.0-bridge",
2626
"babel-loader": "^8.0.0",
2727
"case-sensitive-paths-webpack-plugin": "^2.1.2",
28-
"compression-webpack-plugin": "^1.1.11",
28+
"compression-webpack-plugin": "^1.1.12",
2929
"css-loader": "^1.0.0",
30-
"file-loader": "^1.1.11",
31-
"glob": "^7.1.2",
30+
"file-loader": "^2.0.0",
31+
"glob": "^7.1.3",
3232
"js-yaml": "^3.12.0",
33-
"mini-css-extract-plugin": "^0.4.0",
34-
"node-sass": "^4.9.0",
35-
"optimize-css-assets-webpack-plugin": "^5.0.0",
33+
"mini-css-extract-plugin": "^0.4.2",
34+
"node-sass": "^4.9.3",
35+
"optimize-css-assets-webpack-plugin": "^5.0.1",
3636
"path-complete-extname": "^1.0.0",
37-
"postcss-import": "^11.1.0",
38-
"postcss-loader": "^2.1.5",
39-
"postcss-preset-env": "^5.1.0",
40-
"sass-loader": "^7.0.2",
41-
"style-loader": "^0.21.0",
42-
"uglifyjs-webpack-plugin": "^1.2.5",
43-
"webpack": "^4.10.2",
44-
"webpack-assets-manifest": "^3.0.1",
45-
"webpack-cli": "^3.0.1",
46-
"webpack-sources": "^1.1.0"
37+
"postcss-import": "^12.0.0",
38+
"postcss-loader": "^3.0.0",
39+
"postcss-preset-env": "^5.3.0",
40+
"sass-loader": "^7.1.0",
41+
"style-loader": "^0.23.0",
42+
"uglifyjs-webpack-plugin": "^1.3.0",
43+
"webpack": "^4.17.1",
44+
"webpack-assets-manifest": "^3.0.2",
45+
"webpack-cli": "^3.1.0",
46+
"webpack-sources": "^1.2.0"
4747
},
4848
"devDependencies": {
49-
"eslint": "^4.18.2",
50-
"eslint-config-airbnb": "^16.1.0",
51-
"eslint-plugin-import": "^2.12.0",
52-
"eslint-plugin-jsx-a11y": "^6.0.3",
53-
"eslint-plugin-react": "^7.8.2",
54-
"jest": "^23.1.0"
49+
"eslint": "^5.4.0",
50+
"eslint-config-airbnb": "^17.1.0",
51+
"eslint-plugin-import": "^2.14.0",
52+
"eslint-plugin-jsx-a11y": "^6.1.1",
53+
"eslint-plugin-react": "^7.11.1",
54+
"jest": "^23.5.0"
5555
},
5656
"jest": {
5757
"testRegex": "(/__tests__/.*|(\\.|/))\\.jsx?$",
@@ -61,7 +61,7 @@
6161
},
6262
"scripts": {
6363
"test": "jest",
64-
"lint": "eslint {package,lib}/"
64+
"lint": "eslint package/"
6565
},
6666
"repository": {
6767
"type": "git",

package/config_types/config_list.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ class ConfigList extends Array {
3838
}
3939

4040
getIndex(key, shouldThrow = false) {
41-
const index = this.findIndex(entry =>
42-
(
43-
entry === key ||
44-
entry.key === key ||
45-
(entry.constructor && entry.constructor.name === key)
46-
))
41+
const index = this.findIndex(entry => (
42+
entry === key
43+
|| entry.key === key
44+
|| (entry.constructor && entry.constructor.name === key)
45+
))
4746

4847
if (shouldThrow && index < 0) throw new Error(`Item ${key} not found`)
4948
return index

package/environments/base.js

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,32 @@ const getModulePaths = () => {
7474
return result
7575
}
7676

77-
const getBaseConfig = () =>
78-
new ConfigObject({
79-
mode: 'production',
80-
output: {
81-
filename: '[name]-[chunkhash].js',
82-
chunkFilename: '[name]-[chunkhash].chunk.js',
83-
hotUpdateChunkFilename: '[id]-[hash].hot-update.js',
84-
path: config.outputPath,
85-
publicPath: config.publicPath
86-
},
87-
88-
resolve: {
89-
extensions: config.extensions
90-
},
91-
92-
resolveLoader: {
93-
modules: ['node_modules']
94-
},
95-
96-
node: {
97-
dgram: 'empty',
98-
fs: 'empty',
99-
net: 'empty',
100-
tls: 'empty',
101-
child_process: 'empty'
102-
}
103-
})
77+
const getBaseConfig = () => new ConfigObject({
78+
mode: 'production',
79+
output: {
80+
filename: '[name]-[chunkhash].js',
81+
chunkFilename: '[name]-[chunkhash].chunk.js',
82+
hotUpdateChunkFilename: '[id]-[hash].hot-update.js',
83+
path: config.outputPath,
84+
publicPath: config.publicPath
85+
},
86+
87+
resolve: {
88+
extensions: config.extensions
89+
},
90+
91+
resolveLoader: {
92+
modules: ['node_modules']
93+
},
94+
95+
node: {
96+
dgram: 'empty',
97+
fs: 'empty',
98+
net: 'empty',
99+
tls: 'empty',
100+
child_process: 'empty'
101+
}
102+
})
104103

105104
module.exports = class Base {
106105
constructor() {

package/utils/deep_merge.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ const deepMerge = (target, source) => {
1010
if (!(isObject(target) && isObject(source))) return source
1111

1212
return [...Object.keys(target), ...Object.keys(source)].reduce(
13-
(result, key) =>
14-
(Object.assign(
15-
{},
16-
result,
17-
{ [key]: deepMerge(target[key], source[key]) }
18-
)),
13+
(result, key) => (Object.assign(
14+
{},
15+
result,
16+
{ [key]: deepMerge(target[key], source[key]) }
17+
)),
1918
{}
2019
)
2120
}

package/utils/helpers.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
const isObject = value =>
2-
typeof value === 'object' &&
3-
value !== null &&
4-
(value.length === undefined || value.length === null)
1+
const isObject = value => typeof value === 'object'
2+
&& value !== null
3+
&& (value.length === undefined || value.length === null)
54

65
const isBoolean = str => /^true/.test(str) || /^false/.test(str)
76

package/utils/objectify.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const objectify = (path, obj) =>
2-
path.split('.').reduce((prev, curr) => (prev ? prev[curr] : undefined), obj)
1+
const objectify = (path, obj) => path.split('.').reduce((prev, curr) => (prev ? prev[curr] : undefined), obj)
32

43
module.exports = objectify

0 commit comments

Comments
 (0)