Commit Graph

99 Commits

Author SHA1 Message Date
dependabot[bot]
15a1449407 Bump redis from 2.6.5 to 2.8.0 (#1855)
Bumps [redis](https://github.com/NodeRedis/node_redis) from 2.6.5 to 2.8.0.
- [Release notes](https://github.com/NodeRedis/node_redis/releases)
- [Changelog](https://github.com/NodeRedis/node_redis/blob/master/changelog.md)
- [Commits](https://github.com/NodeRedis/node_redis/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 15:38:03 -04:00
Paul Melnikow
0db88d33e0 Add debug logging to BaseService and BaseJsonService (#1867)
Invoke this using `npm run test:services:trace`.
2018-08-10 15:22:13 -04:00
dependabot[bot]
2ebb173a62 Bump simple-icons from 1.7.1 to 1.8.3 (#1877)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.7.1 to 1.8.3.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 13:33:17 -04:00
dependabot[bot]
be8fbc2308 Bump babel-eslint from 8.0.2 to 8.2.6 (#1878)
Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 8.0.2 to 8.2.6.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/compare/v8.0.2...v8.2.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:38:16 +01:00
dependabot[bot]
049530c7a9 Bump node-fetch from 2.0.0 to 2.2.0 (#1873)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.0.0 to 2.2.0.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/bitinn/node-fetch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.0.0...v2.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:36:26 +01:00
dependabot[bot]
96be0a94f9 Bump joi from 13.3.0 to 13.5.2 (#1879)
Bumps [joi](https://github.com/hapijs/joi) from 13.3.0 to 13.5.2.
- [Release notes](https://github.com/hapijs/joi/releases)
- [Changelog](https://github.com/hapijs/joi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hapijs/joi/compare/v13.3.0...v13.5.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:34:32 +01:00
dependabot[bot]
872fbf68b0 Bump eslint from 5.2.0 to 5.3.0 (#1876)
Bumps [eslint](https://github.com/eslint/eslint) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.2.0...v5.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:29:13 +01:00
dependabot[bot]
1640ff98c2 Bump sinon from 6.1.4 to 6.1.5 (#1875)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.1.4 to 6.1.5.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v6.1.4...v6.1.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:28:31 +01:00
dependabot[bot]
fabc9f2b41 Bump nock from 9.3.2 to 9.5.0 (#1865)
Bumps [nock](https://github.com/nock/nock) from 9.3.2 to 9.5.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v9.3.2...v9.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 10:34:10 -04:00
dependabot[bot]
8d669385e1 Bump classnames from 2.2.5 to 2.2.6 (#1850)
Bumps [classnames](https://github.com/JedWatson/classnames) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/JedWatson/classnames/releases)
- [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md)
- [Commits](https://github.com/JedWatson/classnames/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 10:00:40 -04:00
dependabot[bot]
c7851e2d38 Bump prop-types from 15.6.0 to 15.6.2 (#1851)
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.6.0 to 15.6.2.
- [Release notes](https://github.com/facebook/prop-types/releases)
- [Changelog](https://github.com/facebook/prop-types/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/prop-types/commits/v15.6.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:59:02 -04:00
dependabot[bot]
72d017d9ad Bump query-string from 6.0.0 to 6.1.0 (#1853)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.0.0...v6.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:53:32 -04:00
dependabot[bot]
efe639a0c7 Bump js-yaml from 3.11.0 to 3.12.0 (#1860)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:52:44 -04:00
dependabot[bot]
68e6ed9d5a Bump prettier from 1.14.0 to 1.14.2 (#1869)
Bumps [prettier](https://github.com/prettier/prettier) from 1.14.0 to 1.14.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.14.0...1.14.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:47:07 -04:00
Paul Melnikow
ab051b3804 Turn on prettier (except repo root) (#1167)
* Use prettier-check
* Update semi option
    See discussion https://github.com/badges/shields/issues/948#issuecomment-349205606
* Developer documentation
* Run the same steps in both `main` jobs
* Move integration tests from `danger` to `main` where they belong
2018-08-08 17:49:06 -04:00
dependabot[bot]
ff15e9bdab Bump mocha from 5.0.0 to 5.2.0 (#1864)
Bumps [mocha](https://github.com/mochajs/mocha) from 5.0.0 to 5.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v5.0.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-08 17:28:59 -04:00
Paul Melnikow
e3b100504d Add Joi-based request validation to BaseJsonService and rewrite [NPM] and [node] badges (#1743)
When JSON responses come back, they are sometimes not in the format expected by the API. As a result we have a lot of defensive coding (expressions like `(data || {}).someProperty`) to avoid exceptions being thrown in badge processing. Often we rely on the `try` blocks that wrap so much of the badge-processing code, which catch all JavaScript exceptions and return some error result, usually **invalid**. The problem with this is that these `try` blocks catch all sorts of programmer errors too, so when we see **invalid** we don't know whether the API returned something unexpected, or we've made a mistake. We also spend a lot of time writing defensive tests around malformed responses, and creating and maintaining the defensive coding.

A better solution is to validate the API responses using declarative contracts. Here the programmer says exactly what they expect from the API. That way, if the response isn't what we expect we can just say it's an **invalid json response**. And if our code then throws an exception, well that's our mistake; when we catch that we can call it a **shields internal error**. It's also less code and less error-prone. Over time we may be confident enough in the contracts that we won't need so many tests of malformed responses. The contract doesn't need to describe the entire response, only the part that's needed. Unknown keys can simply be dropped, preventing unvalidated parts of the response from creeping into the code. Checking what's in our response before calling values on it also makes our code more secure.

I used Joi here, since we're already using it for testing. There may be another contracts library that's a better fit, though I think we could look at that later.

Those changes are in base.js.

The rest is a rewrite of the remaining NPM badges, including the extraction of an NpmBase class. Inspired by @chris48s's work in #1740, this class splits the service concerns into fetching, validation, transformation, and rendering. This is treated as a design pattern. See the PR discussion for more. There are two URL patterns, one which allows specifying a tag (used by e.g. the version badge `https://img.shields.io/npm/v/npm/next.svg`), and the other which does not accept a tag (e.g. the license badge `https://img.shields.io/npm/l/express.svg`). Subclasses like NpmLicense and NpmTypeDefinitions can specify the URL fragment, examples, the validation schema for the chunk of the package data they use, and a render function. The NpmVersion subclass uses a different endpoint, so it overrides the `handle` implementation from NpmBase.

The remaining services using BaseJsonService are shimmed, so they will keep working after the changes.
2018-08-08 17:08:16 -04:00
dependabot[bot]
11cb3e3929 Bump danger from 3.8.3 to 3.8.4 (#1857)
Bumps [danger](https://github.com/danger/danger-js) from 3.8.3 to 3.8.4.
- [Release notes](https://github.com/danger/danger-js/releases)
- [Changelog](https://github.com/danger/danger-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/danger/danger-js/compare/3.8.3...3.8.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-07 23:28:11 -04:00
dependabot[bot]
c69642a4e5 Bump eslint-plugin-react from 7.7.0 to 7.10.0 (#1837)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.7.0 to 7.10.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.7.0...v7.10.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:14:44 +01:00
dependabot[bot]
e20ab7c412 Bump sinon from 6.0.0 to 6.1.4 (#1832)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.0.0 to 6.1.4.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v6.0.0...v6.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:13:57 +01:00
dependabot[bot]
4e5b6d077f Bump concurrently from 3.5.1 to 3.6.1 (#1835)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 3.5.1 to 3.6.1.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/3.5.1...3.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:12:54 +01:00
dependabot[bot]
dee9524bd6 Bump check-node-version from 3.1.1 to 3.2.0 (#1828)
Bumps [check-node-version](https://github.com/parshap/check-node-version) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/parshap/check-node-version/releases)
- [Changelog](https://github.com/parshap/check-node-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/parshap/check-node-version/compare/v3.1.1...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:08:21 +01:00
dependabot[bot]
89493f0eaf Bump eslint-plugin-import from 2.9.0 to 2.13.0 (#1836)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.9.0 to 2.13.0.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.9.0...v2.13.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:05:23 +01:00
dependabot[bot]
672631a2d6 Bump eslint-plugin-promise from 3.6.0 to 3.8.0 (#1829)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 3.6.0 to 3.8.0.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/compare/v3.6.0...v3.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:05:01 +01:00
dependabot[bot]
258fdd0fbc Bump sinon-chai from 3.0.0 to 3.2.0 (#1830)
Bumps [sinon-chai](https://github.com/domenic/sinon-chai) from 3.0.0 to 3.2.0.
- [Release notes](https://github.com/domenic/sinon-chai/releases)
- [Commits](https://github.com/domenic/sinon-chai/compare/v3.0.0...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:02:11 +01:00
chris48s
cdce0b45e0 upgrade react and related dependencies (#1840) 2018-08-03 18:59:54 +01:00
Paul Melnikow
5d102dabb3 Update several lockfile dependencies using npm audit fix (#1833) 2018-08-03 18:46:12 +01:00
dependabot[bot]
2008623ba3 Bump gm from 1.23.0 to 1.23.1 (#1821)
Bumps [gm](https://github.com/aheckmann/gm) from 1.23.0 to 1.23.1.
- [Release notes](https://github.com/aheckmann/gm/releases)
- [Changelog](https://github.com/aheckmann/gm/blob/master/History.md)
- [Commits](https://github.com/aheckmann/gm/compare/1.23.0...1.23.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:22:39 +01:00
dependabot[bot]
dfdffa599c Bump moment from 2.19.3 to 2.22.2 (#1824)
Bumps [moment](https://github.com/moment/moment) from 2.19.3 to 2.22.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.19.3...2.22.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:19:22 +01:00
dependabot[bot]
d15250afcc Bump danger from 3.7.14 to 3.8.3 (#1822)
Bumps [danger](https://github.com/danger/danger-js) from 3.7.14 to 3.8.3.
- [Release notes](https://github.com/danger/danger-js/releases)
- [Changelog](https://github.com/danger/danger-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/danger/danger-js/commits/3.8.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:15:21 +01:00
dependabot[bot]
e4af2d485c Bump pretty-bytes from 5.0.0 to 5.1.0 (#1825)
Bumps [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/sindresorhus/pretty-bytes/releases)
- [Commits](https://github.com/sindresorhus/pretty-bytes/compare/v5.0.0...v5.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:11:06 +01:00
Danial
317e19ea2a Add support for simple-icons, colored icons with ?logoColor (#1810)
* add simple-icons

* handle undefined

* support logoColor param

* our icon > simple-icon

* dont crash 

* return false → undefined

* update test

* add test

* support logoColor on our logos

* cache as base64, pre-load-simple-icons, logo-helper

* add ?logoColor information

* and simple-icons reference, link to github master branch for our logos

* update simple-icons

update to 1.7.1

* Revert "and simple-icons reference, link to github master branch for our logos"

This reverts commit 5e99d5f8db.

* add link to simple-icons

* Add snapshot test

* support dash in place of space for logo name
2018-08-02 09:07:23 +12:00
greenkeeper[bot]
8020ff00e3 Update eslint to the latest version 🚀 (#1746)
* Work around upstream issue https://github.com/standard/standard/issues/1156#issuecomment-400048419
2018-08-01 16:55:42 -04:00
chris48s
901a7b8a43 Split front end into one page per category (#1808)
- Present 'downloads', 'version', etc as pages
- Don't show any badges on the index page,
  just links to categories.
- Tweak search so we can search all badges
  from the index page, but without rendering
  every badge as soon as we press a key.
2018-08-01 21:02:55 +01:00
greenkeeper[bot]
ca01b99e9f Update prettier to the latest version 🚀 (#1814)
* chore(package): update prettier to version 1.14.0

* Update package-lock
2018-08-01 15:11:27 -04:00
Paul Melnikow
f850126146 Bump icedfrisby version (#1803) 2018-07-25 13:47:33 -05:00
greenkeeper[bot]
6462cc49d5 Update eslint-plugin-node to the latest version 🚀 (#1786)
* chore(package): update eslint-plugin-node to version 7.0.0

* Update lockfile

* Update call to deprecated API
2018-07-18 18:36:54 -07:00
greenkeeper[bot]
01f4bab4f6 Update prettier to the latest version 🚀 (#1749)
* chore(package): update prettier to version 1.13.6

* Update lockfile
2018-07-12 11:54:34 -04:00
Paul Melnikow
b3ec3e7a96 Generalized rotating token pool (#1736)
This was designed as part of a rewrite of the Github auth code in #1205 which is stalled because I don't want to deploy it without access to server logs. The need for token rotation came up recently in #541, so I picked up this code, removed the github-specific bits, and pulled it in. Ordinarily I wouldn't merge helper code without a use, though sadly it seems like the best way to move forward this rewrite.
2018-07-11 23:08:56 -04:00
Danial
d8cf836264 Add support for rgb, rgba, hsl, hsla, css named colors (#1635)
* add support for rgb, rgb, css named colors

* add support for hsl, hsla & add color-validate

* update makeBadge test, better coverage

* re-add comment

* add comment for supported colors

* dynamic badge gen, remove 'hex'

* add support for 1.0 opacity & fix 101-109

* fix colorscheme tests

* remove extra tests

* add test for negative values

* add test for uppercase & mixed case colors

* fix mixed case/uppercase test

* allow whitespace around color

* update test error messages

* add comments

* add more uppercase test

* update error message

* default to grey/red if invalid color chosen

default colorscheme:
colorA: grey
colorB: red

* Revert "default to grey/red if invalid color chosen"

This reverts commit 10db0c6d74.
Reverted as this affects the CLI version/when no color specified.

* validColor -> isCSSColor

* assignColor function

* update tests to use sazerac
2018-07-12 10:26:17 +12:00
greenkeeper[bot]
7cd3720edc Update prettier to the latest version 🚀 (#1641) 2018-06-16 16:45:02 -04:00
greenkeeper[bot]
9612d5c6bb Update sinon to the latest version 🚀 (#1733)
* chore(package): update sinon to version 6.0.0

* update package-lock
2018-06-16 12:32:32 -04:00
chris48s
124748ecde Fix [codeclimate] tests (#1727)
* update nock

The version we were using didn't allow
regex pattern with allowUnmocked option.

Update to latest version which includes this patch:
https://github.com/node-nock/nock/pull/1068

* update codeclimate test to allow any snapshot id on second call

This test was failing because the
snapshot id changed for some reason.

This change allows that to happen
and we will still intercept the
second API call.
2018-06-10 22:20:21 +01:00
greenkeeper[bot]
707ada3718 Update snap-shot-it to the latest version 🚀 (#1715)
* chore(package): update snap-shot-it to version 5.0.1

* update package-lock
2018-06-03 15:09:58 +01:00
greenkeeper[bot]
83007a0c43 Update nyc to the latest version 🚀 (#1716)
* chore(package): update nyc to version 12.0.1

* update package-lock
2018-06-03 15:09:31 +01:00
chris48s
57a1bf2f08 add more rules to dangerfile (#1703)
* upgrade danger.js to latest version

* If PR contains tests using assert, suggest expect syntax

* if PR touches service, check service tester also touched
2018-05-30 18:39:27 +01:00
chris48s
960c5bf72d upgrade sinon (#1697)
update sinon to version 5.0.7
2018-05-22 15:21:11 +01:00
chris48s
5d4ab86b1b upgrade to Joi 13.3.0 (#1696) 2018-05-22 15:20:51 +01:00
chris48s
3ff98bf038 update request (#1695)
update request to version 2.87.0
2018-05-22 15:20:34 +01:00
greenkeeper[bot]
c6b6183ee4 Update pretty-bytes to the latest version 🚀 (#1676)
* fix(package): update pretty-bytes to version 5.0.0

* update package-lock
2018-05-22 10:14:41 +12:00