Skip to content

Commit 5ec2b6e

Browse files
committed
🏷 update starter project tags
- dependency aka updateable - remove es6: the auto-detection doesn't work well and the vast majority of projects use es6 or es6+ - split flux into redux, mobx, and flux: it seems most people think of redux and flux as entirely different now - update webpack: remove webpack 2 tag, add a webpack 3 and webpack 4 tag
1 parent 6c41c73 commit 5ec2b6e

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

data/source/react-starter-project-tags.js

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const includesAny = require("../util/includesAny");
55
module.exports = [
66
{
77
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.",
911
},
1012
{
1113
name: "gatsby",
@@ -48,45 +50,19 @@ module.exports = [
4850
},
4951
},
5052
{
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"]),
7456
},
7557
{
7658
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"]),
9066
},
9167
{
9268
name: "hmr",
@@ -199,10 +175,31 @@ module.exports = [
199175
},
200176
},
201177
{
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.",
206203
match: project => {
207204
const dependencies = Object.assign(
208205
{},
@@ -218,7 +215,7 @@ module.exports = [
218215
if (!webpackMajorVersion) {
219216
return false;
220217
}
221-
return webpackMajorVersion === "2";
218+
return webpackMajorVersion === "4";
222219
},
223220
},
224221
{

0 commit comments

Comments
 (0)