From 4dc16c30197eef0bd2de1b43782ceb36db99bbec Mon Sep 17 00:00:00 2001
From: "David A. Wheeler"
Date: Fri, 12 Aug 2016 10:52:01 -0400
Subject: [PATCH 01/13] Add CII Best Practices
Add a link to the Linux Foundation Core Infrastructure Initiative (CII)
best practices badge, which uses the shields.io spec.
To see this, visit: https://bestpractices.coreinfrastructure.org/
and select "Projects".
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 1ceba917f8245..58bb31c73bc7c 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,7 @@ What kind of metadata can you convey using badges?
## Services using the Shields standard
* [Badger](https://github.com/badges/badgerbadgerbadger)
* [badges2svg](https://github.com/bfontaine/badges2svg)
+* [CII Best Practices](https://bestpractices.coreinfrastructure.org/)
* [Codacy](https://www.codacy.com)
* [Code Climate](https://codeclimate.com/changelog/510d4fde56b102523a0004bf)
* [Coveralls](https://coveralls.io/)
From dfb4804973b2daf8eb8c0242ab1d6ddf0d4152df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3zef=20Soko=C5=82owski?=
Date: Tue, 16 Aug 2016 10:51:51 +0200
Subject: [PATCH 02/13] Fix contributors badge
Fixes #764
---
server.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/server.js b/server.js
index a58e1d701545c..16b6922f0c965 100644
--- a/server.js
+++ b/server.js
@@ -2910,8 +2910,15 @@ cache(function(data, match, sendBadge, request) {
return;
}
try {
- var data = JSON.parse(buffer);
- badgeData.text[1] = metric(data[0].contributions);
+ var contributors;
+
+ if (res.headers['link'] && res.headers['link'].indexOf('rel="last"') !== -1) {
+ contributors = res.headers['link'].match(/[?&]page=(\d+)[^>]+>; rel="last"/)[1];
+ } else {
+ contributors = JSON.parse(buffer).length;
+ }
+
+ badgeData.text[1] = contributors;
badgeData.colorscheme = 'blue';
} catch(e) {
badgeData.text[1] = 'inaccessible';
From e374eeab805c9fc735cd8394fbf0e116b9f2ba39 Mon Sep 17 00:00:00 2001
From: Thomas VIAL
Date: Thu, 18 Aug 2016 13:28:37 +0200
Subject: [PATCH 03/13] Fixed Dockerfile and improved doc regarding
`secret.json`.
---
.dockerignore | 1 +
Dockerfile | 2 +-
INSTALL.md | 4 ++--
3 files changed, 4 insertions(+), 3 deletions(-)
create mode 100644 .dockerignore
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000000..40b878db5b1c9
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+node_modules/
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 4f05c1f98667b..25d8275038c87 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,3 @@
-FROM node:0.12-onbuild
+FROM node:6.4.0-onbuild
ENV INFOSITE http://shields.io
EXPOSE 80
diff --git a/INSTALL.md b/INSTALL.md
index 12b6ae9bc7939..f28f8d17c521d 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -137,7 +137,7 @@ You can build and run the server locally using Docker. First build an image:
```console
$ docker build -t shields ./
Sending build context to Docker daemon 3.923 MB
-Step 0 : FROM node:0.12.7-onbuild
+Step 0 : FROM node:6.4.0-onbuild
…
Removing intermediate container c4678889953f
Successfully built 4471b442c220
@@ -146,7 +146,7 @@ Successfully built 4471b442c220
Then run the container:
```console
-$ docker run --rm -p 8080:80 shields
+$ docker run --rm -p 8080:80 -v "$(pwd)/secret.json":/usr/src/app/secret.json --name shields shields
> gh-badges@1.1.2 start /usr/src/app
> node server.js
From 9ba76602c1cfdd3c5670c0c100f48b05759a6293 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Tue, 30 Aug 2016 13:06:20 +0300
Subject: [PATCH 04/13] Fix badge preview on style change
This was broken by 89affa49fec5
---
try.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/try.html b/try.html
index c3f502c8fcb27..0ba697900511f 100644
--- a/try.html
+++ b/try.html
@@ -1311,8 +1311,10 @@ Like This?
var url = copyForm.url.value;
var img = copyForm.img.value;
var style = copyForm.style.value;
- // Default style doesn't show.
- if (style !== 'flat') { img += '?style=' + style; }
+ // Default style doesn't need value
+ if (style !== 'flat') {
+ img += (img.indexOf('?') != -1 ? '&style=' : '?style=') + style;
+ }
var md = '[![' + trname + '](' + img + ')](' + url + ')';
var rst = '.. image:: ' + img + ' :target: ' + url;
copyMarkdown.value = md;
From 64c01c3c1f22c24660f4d54444eba4f02ac01550 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Tue, 30 Aug 2016 14:24:08 +0300
Subject: [PATCH 05/13] Also correctly strip maxAge from initial link
---
try.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/try.html b/try.html
index 0ba697900511f..04ca3168d7448 100644
--- a/try.html
+++ b/try.html
@@ -1292,7 +1292,7 @@ Like This?
var th = tr.firstElementChild;
var link = th.dataset.link? th.dataset.link: '';
// Remove the ?maxAge parameter from the query string.
- trimg.replace(/[\?&]maxAge=\d+$|maxAge=\d+&/, '');
+ trimg = trimg.replace(/[\?&]maxAge=\d+$|maxAge=\d+&/, '');
copyForm.img.value = trimg;
copyForm.url.value = link;
// Insert documentation.
From 25fb85e3973a702f1961f666630f357082a21f7c Mon Sep 17 00:00:00 2001
From: Nishanth Vijayan
Date: Tue, 6 Sep 2016 16:46:41 +0530
Subject: [PATCH 06/13] Allow label overriding in all Chrome web store badges
---
server.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server.js b/server.js
index 843e6ba6550ea..6264feae39f55 100644
--- a/server.js
+++ b/server.js
@@ -5284,7 +5284,7 @@ cache(function(data, match, sendBadge, request) {
badgeData.colorscheme = vdata.color;
} else if (type === 'd') {
var downloads = value.interactionCount.UserDownloads;
- badgeData.text[0] = 'downloads';
+ badgeData.text[0] = data.label || 'downloads';
badgeData.text[1] = metric(downloads) + ' total';
badgeData.colorscheme = downloadCountColor(downloads);
} else if (type === 'price') {
@@ -5292,12 +5292,12 @@ cache(function(data, match, sendBadge, request) {
badgeData.colorscheme = 'brightgreen';
} else if (type === 'rating') {
var rating = Math.round(value.ratingValue * 100) / 100;
- badgeData.text[0] = 'rating';
+ badgeData.text[0] = data.label || 'rating';
badgeData.text[1] = rating;
badgeData.colorscheme = floorCountColor(rating, 2, 3, 4);
} else if (type === 'rating-count') {
var ratingCount = value.ratingCount;
- badgeData.text[0] = 'rating count';
+ badgeData.text[0] = data.label || 'rating count';
badgeData.text[1] = metric(ratingCount) + ' total';
badgeData.colorscheme = floorCountColor(ratingCount, 5, 50, 500);
}
From 6c21450c4692cb8684fc488e1258ae5e7ccc3d55 Mon Sep 17 00:00:00 2001
From: Peter Dave Hello
Date: Wed, 17 Aug 2016 16:37:50 +0800
Subject: [PATCH 07/13] bump dependencies
---
package.json | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 2151b239a7d16..8534186d3978c 100644
--- a/package.json
+++ b/package.json
@@ -17,14 +17,14 @@
},
"dependencies": {
"dot": "~1.0.3",
- "svgo": "~0.5.1",
- "pdfkit": "~0.7.1",
- "phantomjs-prebuilt": "~2.1.7",
- "request": "~2.55.0",
- "redis": "~1.0.0",
- "camp": "~16.2.2",
- "semver": "~4.3.3",
- "bower": "~1.4.1",
+ "svgo": "~0.7.1",
+ "pdfkit": "~0.8.0",
+ "phantomjs-prebuilt": "~2.1.13",
+ "request": "~2.75.0",
+ "redis": "~2.6.2",
+ "camp": "~16.2.3",
+ "semver": "~5.3.0",
+ "bower": "~1.7.9",
"chrome-web-store-item-property": "^1.1.2",
"json-autosave": "~1.1.1"
},
From 2b44bcc7c28d90101229628a15086447c5ae57d3 Mon Sep 17 00:00:00 2001
From: Thaddee Tyl
Date: Sat, 15 Oct 2016 14:48:15 +0200
Subject: [PATCH 08/13] Use maintainer's twitter account
---
try.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/try.html b/try.html
index c3f502c8fcb27..b6f1c9eb40224 100644
--- a/try.html
+++ b/try.html
@@ -575,8 +575,8 @@ Social
https://img.shields.io/twitter/url/http/shields.io.svg?style=social |
Twitter Follow: |
- |
- https://img.shields.io/twitter/follow/shields_io.svg?style=social&label=Follow |
+ |
+ https://img.shields.io/twitter/follow/espadrine.svg?style=social&label=Follow |
@@ -1044,7 +1044,7 @@ Like This?
And tell us, we might be able to bring it to you anyway!
-
+
-
+