@@ -5,7 +5,9 @@ const includesAny = require("../util/includesAny");
5
5
module . exports = [
6
6
{
7
7
name : "dependency" ,
8
- description : "Rather than copying the project, you add it as a dependency." ,
8
+ aka : [ "updateable" ] ,
9
+ description :
10
+ "Rather than copying the project, you add it as a dependency. This makes updates a lot easier and keeps your project cleaner." ,
9
11
} ,
10
12
{
11
13
name : "gatsby" ,
@@ -48,45 +50,19 @@ module.exports = [
48
50
} ,
49
51
} ,
50
52
{
51
- name : "es6" ,
52
- aka : [ "esnext" , "es6+" , "es7" , "es2015" , "es2016" , "transpiled" ] ,
53
- description :
54
- "Uses transpiling to convert JavaScript with the latest language features into well-supported (ES5) code" ,
55
-
56
- match : project => {
57
- // Projects with coffeescript are automatically considered to NOT be using ES6
58
- if (
59
- includesAny ( project . dependencies , [ "coffee-loader" , "coffee-script" ] )
60
- ) {
61
- return false ;
62
- }
63
-
64
- return includesAny ( project . dependencies , [
65
- "babel" ,
66
- "babel-core" ,
67
- "babel-loader" ,
68
- "babel-preset-react" ,
69
- "babel-preset-es2015" ,
70
- "babelify" ,
71
- "babel-jest" ,
72
- ] ) ;
73
- } ,
53
+ name : "redux" ,
54
+ description : "Redux is used for state management." ,
55
+ match : project => includesAny ( project . dependencies , [ "redux" ] ) ,
74
56
} ,
75
57
{
76
58
name : "flux" ,
77
- description : "Something flux-like is used: Redux, Mobx, Flux, Reflux, etc." ,
78
- match : project =>
79
- includesAny ( project . dependencies , [
80
- "flux" ,
81
- "mobx" ,
82
- "redux" ,
83
- "reflux" ,
84
- "alt" ,
85
- "alt.js" ,
86
- "flummox" ,
87
- "martyjs" ,
88
- "miniflux" ,
89
- ] ) ,
59
+ description : "Flux is used for state management." ,
60
+ match : project => includesAny ( project . dependencies , [ "flux" ] ) ,
61
+ } ,
62
+ {
63
+ name : "mobx" ,
64
+ description : "Mobx is used for state management." ,
65
+ match : project => includesAny ( project . dependencies , [ "mobx" ] ) ,
90
66
} ,
91
67
{
92
68
name : "hmr" ,
@@ -199,10 +175,31 @@ module.exports = [
199
175
} ,
200
176
} ,
201
177
{
202
- name : "webpack 2" ,
203
- aka : [ "webpack2" ] ,
204
- description :
205
- "Webpack 2 was released in Jan 2017 and includes some breaking changes." ,
178
+ name : "webpack 3" ,
179
+ aka : [ "webpack3" ] ,
180
+ description : "Webpack 3 was released in June 2017." ,
181
+ match : project => {
182
+ const dependencies = Object . assign (
183
+ { } ,
184
+ project . packageJson . dependencies ,
185
+ project . packageJson . devDependencies
186
+ ) ;
187
+ const webpackVersionRange = dependencies . webpack ;
188
+ if ( ! webpackVersionRange ) {
189
+ return false ;
190
+ }
191
+ // Get the first digit
192
+ const webpackMajorVersion = webpackVersionRange . match ( / [ 0 - 9 ] / ) [ 0 ] ;
193
+ if ( ! webpackMajorVersion ) {
194
+ return false ;
195
+ }
196
+ return webpackMajorVersion === "3" ;
197
+ } ,
198
+ } ,
199
+ {
200
+ name : "webpack 4" ,
201
+ aka : [ "webpack4" ] ,
202
+ description : "Webpack 4 was released in Feb 2018." ,
206
203
match : project => {
207
204
const dependencies = Object . assign (
208
205
{ } ,
@@ -218,7 +215,7 @@ module.exports = [
218
215
if ( ! webpackMajorVersion ) {
219
216
return false ;
220
217
}
221
- return webpackMajorVersion === "2 " ;
218
+ return webpackMajorVersion === "4 " ;
222
219
} ,
223
220
} ,
224
221
{
0 commit comments