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/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..a5302be714f2 --- /dev/null +++ b/components/starter-kits/starter-kits-style.scss @@ -0,0 +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 new file mode 100644 index 000000000000..76976368658e --- /dev/null +++ b/components/starter-kits/starter-kits.jsx @@ -0,0 +1,72 @@ +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. +

+ +
+
+ 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. +
+
+ +
+
+
+
+
Project Name
+
Maintainer
+
Tags
+
+
+
+ { Kits.map((kit, i) => ( +
+
+
Project Name
+
+ { kit.githubRepoName } +
+
+
+
Maintainer
+
{ kit.githubUserName }
+
+
+
Tags
+
+ { kit.tags.map((tag, i) => ( + { tag } + )) } +
+
+
+ ))} +
+
+
+
+); 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..0f250a5d7b53 --- /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'); +}); diff --git a/scripts/fetch_supporters.js b/scripts/fetch_supporters.js index 57387209b5bf..e481e922c993 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'); }); }); diff --git a/styles/markdown.scss b/styles/markdown.scss index 50738e7e7ff1..f16af08c2615 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; } } @@ -145,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; } 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: (