From 80da9adc07555432e4347a46ce497fee387c8271 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 10:58:05 -0400 Subject: [PATCH 1/9] docs(guides): start fetching starter-kits data --- .gitignore | 1 + package.json | 1 + scripts/fetch.sh | 3 +++ scripts/fetch_starter_kits.js | 13 +++++++++++++ 4 files changed, 18 insertions(+) create mode 100755 scripts/fetch_starter_kits.js diff --git a/.gitignore b/.gitignore index 98c6aa66bf3c..ee93ba0570cc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build generated components/support/support-backers.json components/support/support-sponsors.json +components/starter-kits/starter-kits-data.json .antwar diff --git a/package.json b/package.json index 6043f0922d3a..7809846b79ea 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "react": "^15.3.2", "react-dom": "^15.3.2", "react-router": "^2.8.1", + "tool-list": "^0.9.1", "whatwg-fetch": "^2.0.1" } } diff --git a/scripts/fetch.sh b/scripts/fetch.sh index 6d4488a2de43..5053f487e227 100755 --- a/scripts/fetch.sh +++ b/scripts/fetch.sh @@ -18,3 +18,6 @@ cp -rf ./content/plugins/ ./generated/plugins # Fetch sponsors and backers from opencollective ./scripts/fetch_supporters.js + +# Fetch starter kits +./scripts/fetch_starter_kits.js diff --git a/scripts/fetch_starter_kits.js b/scripts/fetch_starter_kits.js new file mode 100755 index 000000000000..09eb12bd1875 --- /dev/null +++ b/scripts/fetch_starter_kits.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node +const fs = require('fs'); +const toolList = require('tool-list'); + +const data = toolList.startersWithTag('webpack'); +const body = JSON.stringify(data); + +fs.writeFile('./components/starter-kits/starter-kits-data.json', body, err => { + if (err) { + console.error('Failed to write starter kits file: ', err); + + } else console.log('Fetched 1 file: starter-kits-data.json') +}); From 709483c45abaff9bd151159e6d4dc619eccb9546 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 10:58:41 -0400 Subject: [PATCH 2/9] docs(guides): add starter-kits route and component --- antwar.config.js | 7 +++ .../starter-kits/starter-kits-style.scss | 4 ++ components/starter-kits/starter-kits.jsx | 58 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 components/starter-kits/starter-kits-style.scss create mode 100644 components/starter-kits/starter-kits.jsx diff --git a/antwar.config.js b/antwar.config.js index fea1a65d0412..7e4ca6f3785c 100644 --- a/antwar.config.js +++ b/antwar.config.js @@ -73,6 +73,13 @@ module.exports = { } ), + 'guides/starter-kits': { + title: 'Starter Kits', + path() { + return require('./components/starter-kits/starter-kits.jsx').default; + } + }, + development: section( 'Development', function() { diff --git a/components/starter-kits/starter-kits-style.scss b/components/starter-kits/starter-kits-style.scss new file mode 100644 index 000000000000..f291d8b7a826 --- /dev/null +++ b/components/starter-kits/starter-kits-style.scss @@ -0,0 +1,4 @@ +.starter-kits { + flex: 1 1 auto; + padding: 1.5em; +} diff --git a/components/starter-kits/starter-kits.jsx b/components/starter-kits/starter-kits.jsx new file mode 100644 index 000000000000..5f9cda73b294 --- /dev/null +++ b/components/starter-kits/starter-kits.jsx @@ -0,0 +1,58 @@ +import React from 'react'; +import Container from '../container/container'; +import Link from '../link/link'; +import Kits from './starter-kits-data.json'; +import './starter-kits-style'; + +// NOTE: The table classes used in this component correspond to +// those used in the markdown utility. Ideally we will soon create +// a table component that both the markdown utility and this page +// can use. This component could even use something like griddle +// to allow sorting and such. + +export default props => ( + +

Starter Kits

+ +

+ The following table contains a curated list of starter kits that can  + be used as a jumping off point for webpack-based projects. To add a new  + kit to the list please visit  + this repository  + and submit a PR against this file:  + generator/starterProjectUrls.js. +

+ +
+
+
+
+
Project Name
+
Maintainer
+
Tags
+
+
+
+ { Kits.map((kit, i) => ( +
+
+
Project Name
+
+ { kit.githubRepoName } +
+
+
+
Maintainer
+
{ kit.githubUserName }
+
+
+
Tags
+
{ kit.tags.join(' | ') }
+
+
+ ))} +
+
+
+
+); From 318aa62d94ff00f7e0fdca7a10baf84b76a9dc4c Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 10:59:48 -0400 Subject: [PATCH 3/9] fix(support): display fetch logs for support data --- scripts/fetch_supporters.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/fetch_supporters.js b/scripts/fetch_supporters.js index 57387209b5bf..a73756f1d86c 100755 --- a/scripts/fetch_supporters.js +++ b/scripts/fetch_supporters.js @@ -7,7 +7,10 @@ request('https://opencollective.com/webpack/sponsors.json?requireActive=false', console.error('Failed to fetch sponsors: ', err); } fs.writeFile('./components/support/support-sponsors.json', body, err => { - if (err) console.error('Failed to write sponsors file: ', err); + if (err) { + console.error('Failed to write sponsors file: ', err); + + } else console.log('Fetched 1 file: support-sponsors.json') }); }); @@ -16,6 +19,9 @@ request('https://opencollective.com/webpack/backers.json?requireActive=false', ( console.error('Failed to fetch backers: ', err); } fs.writeFile('./components/support/support-backers.json', body, err => { - if (err) console.error('Failed to write backers file: ', err); + if (err) { + console.error('Failed to write backers file: ', err); + + } else console.log('Fetched 1 file: support-backers.json') }); }); From d2b6bb8b3288ec69e773150fb01dda7bd8a7ddd1 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 11:38:40 -0400 Subject: [PATCH 4/9] docs(guides): display tags better in starter-kits --- components/starter-kits/starter-kits-style.scss | 14 ++++++++++++++ components/starter-kits/starter-kits.jsx | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/components/starter-kits/starter-kits-style.scss b/components/starter-kits/starter-kits-style.scss index f291d8b7a826..a5302be714f2 100644 --- a/components/starter-kits/starter-kits-style.scss +++ b/components/starter-kits/starter-kits-style.scss @@ -1,4 +1,18 @@ +@import 'functions'; + .starter-kits { flex: 1 1 auto; padding: 1.5em; } + +.starter-kits__tag { + display: inline-block; + font-size: getFontSize(-1); + font-weight: 600; + line-height: 1.5em; + margin: 0 0.25em 0.25em; + padding: 0 0.5em; + border-radius: 0.25em; + color: getColor(white); + background: getColor(malibu); +} diff --git a/components/starter-kits/starter-kits.jsx b/components/starter-kits/starter-kits.jsx index 5f9cda73b294..e2c740202e65 100644 --- a/components/starter-kits/starter-kits.jsx +++ b/components/starter-kits/starter-kits.jsx @@ -47,7 +47,11 @@ export default props => (
Tags
-
{ kit.tags.join(' | ') }
+
+ { kit.tags.map(tag => ( + { tag } + )) } +
))} From 49cab5a7931422f64a844f59dd2a7648bd346502 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 11:41:10 -0400 Subject: [PATCH 5/9] style(markdown): remove block quote icons and old icon code These looked pretty rough, and I've heard some people who were confused whether the icon was part of the content. If anything we should use more prominent, nice icons like the ones @pastelsky showed in his mockups. --- styles/markdown.scss | 13 ++++--------- utilities/markdown.js | 15 --------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/styles/markdown.scss b/styles/markdown.scss index 50738e7e7ff1..28a9ef1ec480 100644 --- a/styles/markdown.scss +++ b/styles/markdown.scss @@ -102,24 +102,19 @@ &.tip { background-color: #DCF2FD; color: #618ca0; - .tip-content::before { - content: 'ℹ'; - font-style: normal; - } } + &.warning { background-color: #fbedb7; color: #8c8466; - .tip-content::before { - content: '⚠'; - font-style: normal; - } } + &.todo { background-color: #fbddcd; color: #907a6e; + .tip-content::before { - content: '[TODO]'; + content: '[TODO]: '; font-style: normal; } } diff --git a/utilities/markdown.js b/utilities/markdown.js index 5606cb5d1fde..39c75d7fcea5 100644 --- a/utilities/markdown.js +++ b/utilities/markdown.js @@ -299,21 +299,6 @@ function parseCustomQuote(token, match, className) { var text = token.text; if (text.indexOf(match) === 0) { - // var icon; - - // TODO: Update icons and styling - // switch(className) { - // case 'tip': - // icon = 'icon-info'; - // break; - // case 'warning': - // icon = 'icon-warning'; - // break; - // default: - // icon = 'icon-chevron-right'; - // break; - // } - return { type: 'html', text: ( From dcc476044317f45e390eec4e1d6c4460a0295657 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 11:41:48 -0400 Subject: [PATCH 6/9] style(markdown): increase padding in mobile table design --- styles/markdown.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/styles/markdown.scss b/styles/markdown.scss index 28a9ef1ec480..f16af08c2615 100644 --- a/styles/markdown.scss +++ b/styles/markdown.scss @@ -140,13 +140,14 @@ &-tr { background-color: white; margin: 0; - padding: 0; + padding: 0.25em 0; display: block; border: 1px solid #cccccc; border-bottom: none; @include break { border: none; + padding: 0; display: table-row; } From 31186843049cf4b7c70e9119efa6a50ac202ea96 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 11:42:36 -0400 Subject: [PATCH 7/9] docs(guides): add a warning to the starter-kits guide --- components/starter-kits/starter-kits.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/starter-kits/starter-kits.jsx b/components/starter-kits/starter-kits.jsx index e2c740202e65..ad22f0343d3d 100644 --- a/components/starter-kits/starter-kits.jsx +++ b/components/starter-kits/starter-kits.jsx @@ -23,6 +23,16 @@ export default props => ( generator/starterProjectUrls.js.

+
+
+ Boilerplates should be used as Proof of Concepts to help you learn  + different webpack techniques for various frameworks. Make sure you understand  + what's going on in them and avoid copy and paste coding. Also note that none  + of these are officially supported by webpack. If you run into an issue, please  + report that to the maintainer(s) of the repository. +
+
+
From 47cd33242176c56955fce781b8ce229dfc816b08 Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 15:11:05 -0400 Subject: [PATCH 8/9] refactor(starter-kits): include `key` prop for tags --- components/starter-kits/starter-kits.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/starter-kits/starter-kits.jsx b/components/starter-kits/starter-kits.jsx index ad22f0343d3d..76976368658e 100644 --- a/components/starter-kits/starter-kits.jsx +++ b/components/starter-kits/starter-kits.jsx @@ -58,8 +58,8 @@ export default props => (
Tags
- { kit.tags.map(tag => ( - { tag } + { kit.tags.map((tag, i) => ( + { tag } )) }
From 829c9e40df2dd869930e024a3ea4fd998212c1bc Mon Sep 17 00:00:00 2001 From: Greg Venech Date: Sat, 27 May 2017 15:11:29 -0400 Subject: [PATCH 9/9] refactor(fetch): include missing semicolons --- scripts/fetch_starter_kits.js | 2 +- scripts/fetch_supporters.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/fetch_starter_kits.js b/scripts/fetch_starter_kits.js index 09eb12bd1875..0f250a5d7b53 100755 --- a/scripts/fetch_starter_kits.js +++ b/scripts/fetch_starter_kits.js @@ -9,5 +9,5 @@ fs.writeFile('./components/starter-kits/starter-kits-data.json', body, err => { if (err) { console.error('Failed to write starter kits file: ', err); - } else console.log('Fetched 1 file: starter-kits-data.json') + } else console.log('Fetched 1 file: starter-kits-data.json'); }); diff --git a/scripts/fetch_supporters.js b/scripts/fetch_supporters.js index a73756f1d86c..e481e922c993 100755 --- a/scripts/fetch_supporters.js +++ b/scripts/fetch_supporters.js @@ -10,7 +10,7 @@ request('https://opencollective.com/webpack/sponsors.json?requireActive=false', if (err) { console.error('Failed to write sponsors file: ', err); - } else console.log('Fetched 1 file: support-sponsors.json') + } else console.log('Fetched 1 file: support-sponsors.json'); }); }); @@ -22,6 +22,6 @@ request('https://opencollective.com/webpack/backers.json?requireActive=false', ( if (err) { console.error('Failed to write backers file: ', err); - } else console.log('Fetched 1 file: support-backers.json') + } else console.log('Fetched 1 file: support-backers.json'); }); });