Skip to content

update master #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3f5c3fb
docs(api): minor fix in cli
skipjack Sep 8, 2017
9cd50d5
docs(plugins): clarify and simplify `SourceMapDevToolPlugin` docs (#1…
skipjack Sep 8, 2017
a26cc70
docs(guides): update "external limitations" example in author-librari…
pfmmfp Sep 10, 2017
287e0e1
docs(plugins): update commons-chunk-plugin.md (#1560)
liorgreenb Sep 10, 2017
e8dc2f3
docs(guides): rewrite shimming (#1579)
skipjack Sep 12, 2017
2caa06a
docs(guides): fix small issues in shimming (#1591)
jeremenichelli Sep 13, 2017
ddaf684
docs(guides): fix entry path in typescript (#1592)
ltaloc Sep 13, 2017
28ac2fd
docs(guides): fix typos in production (#1584)
elliotwaite Sep 13, 2017
2ff84b9
fix(sponsors): update to reflect opencollective change (#1588)
sokra Sep 13, 2017
cb9a035
docs(config): update configuration-languages (#1590)
peterblazejewicz Sep 14, 2017
bee0f3e
docs(guides): update hot-module-replacement (#1539)
bdwain Sep 14, 2017
2af6968
docs(guides): update development.md (#1586)
marcusmolchany Sep 14, 2017
5f6a75e
docs(guides): update tree-shaking.md (#1589)
Sep 14, 2017
3dc7e74
docs(guides): update code-splitting (#1585)
diegofaria Sep 14, 2017
5003179
docs(plugins): update module-concatenation-plugin (#1565)
pspeter3 Sep 15, 2017
60f2679
docs(api): fix type in compiler.md (#1601)
Sep 18, 2017
eecdc8d
docs(config): update output.md (#1541)
metatoaster Sep 18, 2017
b3cd5ac
docs(api): add concurrent usage warning in node.md (#1599)
sokra Sep 18, 2017
cdf2c87
docs(guides): update environment-variables (#1549)
grisanu Sep 18, 2017
9cfbbe7
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Sep 19, 2017
51a9aad
Swap ordering of pre/post loaders (#1602)
DrewML Sep 21, 2017
2af9244
docs(sponsors): update segment's donations (#1603)
sokra Sep 22, 2017
7f47223
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Sep 24, 2017
25a3d6d
Merge branch 'master' into cn
hello-lizhihua Oct 10, 2017
debfddd
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Oct 10, 2017
57fb4d4
update contributors
hello-lizhihua Oct 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sponsors): update to reflect opencollective change (#1588)
OpenCollective's structure changed a bit. This address that
and makes a few other notable changes:

- add additional sponsors
- allow to merge additional sponsors to existing sponsors
- limit width of logos to 3 x height to disallow very wide logos
- format money values with commas
  • Loading branch information
sokra authored and skipjack committed Sep 13, 2017
commit 2ff84b97f98c8907e669de36c2936924bc861472
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
npm-debug.log
build
generated
support-backers.json
support-sponsors.json
support-*.json
starter-kits-data.json
.antwar
10 changes: 5 additions & 5 deletions src/components/Splash/Splash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ const Splash = () => (
<p>Through contributions, donations, and sponsorship, you allow webpack to thrive. Your donations directly support office hours, continued enhancements, and most importantly, great documentation and learning material!</p>

<h2>Platinum Sponsors</h2>
<Support type="sponsors" rank="platinum" />
<Support rank="platinum" />

<h2>Gold Sponsors</h2>
<Support type="sponsors" rank="gold" />
<Support rank="gold" />

<h2>Silver Sponsors</h2>
<Support type="sponsors" rank="silver" />
<Support rank="silver" />

<h2>Bronze Sponsors</h2>
<Support type="sponsors" rank="bronze" />
<Support rank="bronze" />

<h2>Backers</h2>
<Support type="backers" />
<Support rank="backer" />
</Container>
</div>
</div>
Expand Down
58 changes: 43 additions & 15 deletions src/components/Support/Support.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React from 'react';
import Additional from './support-additional.json';
import GoldSponsors from './support-goldsponsors.json';
import SilverSponsors from './support-silversponsors.json';
import Sponsors from './support-sponsors.json';
import Backers from './support-backers.json';
import Additional from './support-additional.js';
import './Support.scss';

const ranks = {
backer: {
maximum: 200
},
bronze: {
minimum: 200,
maximum: 2000
},
silver: {
Expand All @@ -19,17 +27,37 @@ const ranks = {
}
};

function formatMoney(number) {
let str = Math.round(number) + '';
if (str.length > 3) {
str = str.substr(0, str.length - 3) + ',' + str.substr(-3);
}
return str;
}

export default class Support extends React.Component {
render() {
let { rank, type } = this.props;
let supporters = require(`./support-${type}.json`);
let { rank } = this.props;
let supporters = [
...GoldSponsors,
...SilverSponsors,
...Sponsors,
...Backers,
];

if (type === 'sponsors') {
supporters = supporters.slice();
supporters.push(...Additional);
supporters.sort((a, b) => b.totalDonations - a.totalDonations);
// merge or add additional backers/sponsors
for(const additional of Additional) {
const existing = supporters.find(supporter => supporter.username && supporter.username === additional.username);
if (existing) {
existing.totalDonations += additional.totalDonations;
} else {
supporters.push(additional);
}
}

// resort list
supporters.sort((a, b) => b.totalDonations - a.totalDonations);

let minimum, maximum;

if (rank && ranks[rank]) {
Expand All @@ -48,14 +76,14 @@ export default class Support extends React.Component {
return (
<div className="support">
<div className="support__description">
{ type === 'sponsors' ? (
{ rank === 'backer' ? (
<p>
<b className="support__rank">{ rank } sponsors</b>
<span>are those who have pledged { minimum ? `$${minimum}` : 'up' } { maximum ? `to $${maximum}` : 'or more' } to webpack.</span>
The following <b>Backers</b> are individuals who have contributed various amounts of money in order to help support webpack. Every little bit helps, and we appreciate even the smallest contributions.
</p>
) : (
<p>
The following <b>Backers</b> are individuals who have contributed various amounts of money in order to help support webpack. Every little bit helps, and we appreciate even the smallest contributions.
<b className="support__rank">{ rank } sponsors</b>
<span>are those who have pledged { minimum ? `$${formatMoney(minimum)}` : 'up' } { maximum ? `to $${formatMoney(maximum)}` : 'or more' } to webpack.</span>
</p>
)}
</div>
Expand All @@ -64,22 +92,22 @@ export default class Support extends React.Component {
supporters.map((supporter, index) => (
<a key={ supporter.id || supporter.username || index }
className="support__item"
title={ `$${supporter.totalDonations / 100} by ${supporter.name || supporter.username}` }
title={ `$${formatMoney(supporter.totalDonations / 100)} by ${supporter.name || supporter.username}` }
target="_blank"
href={ supporter.website || `https://opencollective.com/${supporter.username}` }>
{ supporter.avatar ? <img
className={ `support__${type}-avatar-${rank || 'normal'}` }
className={ `support__${rank}-avatar` }
src={ supporter.avatar }
alt={ supporter.username ? `${supporter.username}'s avatar` : 'avatar' } /> :
supporter.name }
{ type === 'backers' ? <figure className="support__outline" /> : null }
{ rank === 'backer' ? <figure className="support__outline" /> : null }
</a>
))
}

<div className="support__bottom">
<a className="support__button" href="https://opencollective.com/webpack#support">
Become a { type.replace(/s$/, '') }
Become a { rank === 'backer' ? 'backer' : 'sponsor' }
</a>
</div>
</div>
Expand Down
31 changes: 17 additions & 14 deletions src/components/Support/Support.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@
margin: 0 2px 2px 2px;
}

&__sponsors-avatar {
&-bronze, &-normal {
height: 32px;
}
&-silver {
height: 64px;
}
&-gold {
height: 96px;
}
&-platinum {
height: 128px;
}
&__bronze-avatar {
height: 32px;
max-width: 96px;
}

&__silver-avatar {
height: 64px;
max-width: 192px;
}

&__gold-avatar {
height: 96px;
}

&__platinum-avatar {
height: 128px;
}

&__backers-avatar-normal {
&__backer-avatar {
width: 31px;
height: 31px;
border-radius: 50%;
Expand Down
Binary file added src/components/Support/assets/segment-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions src/components/Support/support-additional.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export default [
{
name: "MoonMail",
avatar: "https://static.moonmail.io/moonmail-logo.svg",
website: "https://moonmail.io/?utm_source=webpack.js.org",
totalDonations: 11000,
reason: "Paypal"
},
{
name: "Google Angular",
avatar: "https://res.cloudinary.com/opencollective/image/upload/v1485288529/angular_uxllte.png",
website: "https://angular.io/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 250000,
reason: "Paypal"
},
{
name: "Architects.io",
avatar: null,
website: "http://architects.io/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 30000,
reason: "Paypal"
},
{
username: "peerigon",
name: "Peerigon",
avatar: "https://opencollective-production.s3-us-west-1.amazonaws.com/e8a1de10-99c8-11e6-8650-f92e594d5de8.png",
website: "https://peerigon.com/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 144139,
reason: "webpack meetup 2017-07"
},
{
name: "Segment",
avatar: require("./assets/segment-logo.png"),
website: "https://segment.com/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 1200000,
reason: "Sponsorship 2017-07 - 2017-09"
}
];
23 changes: 0 additions & 23 deletions src/components/Support/support-additional.json

This file was deleted.

24 changes: 24 additions & 0 deletions src/scripts/fetch_supporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
const fs = require('fs');
const request = require('request');

request('https://opencollective.com/webpack/goldsponsors.json?requireActive=false', (err, response, body) => {
if (err) {
console.error('Failed to fetch goldsponsors: ', err);

} fs.writeFile('./src/components/Support/support-goldsponsors.json', body, err => {
if (err) {
console.error('Failed to write goldsponsors file: ', err);

} else console.log('Fetched 1 file: support-goldsponsors.json');
});
});

request('https://opencollective.com/webpack/silversponsors.json?requireActive=false', (err, response, body) => {
if (err) {
console.error('Failed to fetch silversponsors: ', err);

} fs.writeFile('./src/components/Support/support-silversponsors.json', body, err => {
if (err) {
console.error('Failed to write silversponsors file: ', err);

} else console.log('Fetched 1 file: support-silversponsors.json');
});
});

request('https://opencollective.com/webpack/sponsors.json?requireActive=false', (err, response, body) => {
if (err) {
console.error('Failed to fetch sponsors: ', err);
Expand Down