Compare commits

...

260 Commits

Author SHA1 Message Date
chris48s
02692fe810 empty commit (#6074) 2021-01-18 20:01:10 +00:00
chris48s
af9b70d035 Start a changelog, create a tag (#6073) 2021-01-18 19:21:47 +00:00
chris48s
48b50d853a add a github action to create tags from labelled PR (#6069)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-17 21:29:42 +00:00
chris48s
b3c8aa95f8 fix [wordpress] 'Can't generate version color for false' (#6072) 2021-01-17 20:17:14 +00:00
dependabot-preview[bot]
ba77f91158 Build(deps): bump jsonpath from 1.0.2 to 1.1.0 (#6054)
Bumps [jsonpath](https://github.com/dchester/jsonpath) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/dchester/jsonpath/releases)
- [Commits](https://github.com/dchester/jsonpath/compare/1.0.2...1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-16 12:10:53 -06:00
Cobertos / Samantha
7a1eee06a2 Update self-hosting.md documentation for running with Prometheus (#6052)
* Update documentation for running with Prometheus

There's two environment variables that need to be set in order to use Prometheus and the /metrics endpoint.

* Missing s

* Update doc/self-hosting.md

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 17:54:43 +00:00
Caleb Cartwright
2d9ac83bb4 fix: remove erroneous clearRequestCache call (#6067)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 17:42:32 +00:00
dependabot-preview[bot]
a1fb30f75d Build(deps-dev): bump node-mocks-http from 1.9.0 to 1.10.0 (#6063)
Bumps [node-mocks-http](https://github.com/howardabrams/node-mocks-http) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/howardabrams/node-mocks-http/releases)
- [Changelog](https://github.com/howardabrams/node-mocks-http/blob/master/HISTORY.md)
- [Commits](https://github.com/howardabrams/node-mocks-http/compare/v1.9.0...v1.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 11:29:32 -06:00
dependabot-preview[bot]
345c2896de Build(deps-dev): bump gatsby from 2.30.1 to 2.30.2 (#6059)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.30.1 to 2.30.2.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.30.1...gatsby@2.30.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 02:37:43 +00:00
dependabot-preview[bot]
3b8018bbe5 Build(deps): bump decamelize from 3.2.0 to 5.0.0 (#6062)
Bumps [decamelize](https://github.com/sindresorhus/decamelize) from 3.2.0 to 5.0.0.
- [Release notes](https://github.com/sindresorhus/decamelize/releases)
- [Commits](https://github.com/sindresorhus/decamelize/compare/v3.2.0...v5.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 02:27:57 +00:00
dependabot-preview[bot]
2cd975b162 Build(deps-dev): bump nodemon from 2.0.6 to 2.0.7 (#6061)
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.6...v2.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 02:18:58 +00:00
dependabot-preview[bot]
639d303f18 Build(deps): bump @sentry/node from 5.29.2 to 5.30.0 (#6060)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.29.2 to 5.30.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.2...5.30.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 02:07:58 +00:00
dependabot-preview[bot]
fddd7e4ce0 Build(deps-dev): bump @types/node from 14.14.20 to 14.14.21 (#6057)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.20 to 14.14.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 02:00:35 +00:00
dependabot-preview[bot]
12b9f2f0de Build(deps): bump simple-icons from 4.5.0 to 4.6.0 (#6055)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.5.0...4.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-16 00:58:29 +00:00
dependabot-preview[bot]
3afa6a2108 Build(deps-dev): bump react-select from 3.1.1 to 3.2.0 (#6053)
Bumps [react-select](https://github.com/JedWatson/react-select) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@3.1.1...react-select@3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-15 18:39:20 -06:00
Paul Melnikow
46b98c40be Remove the in-memory cache (#6037)
Shields has long had an in-memory cache with some complex logic for determining when the cached values are used and when they are flushed. At the time this was implemented, squeezing cache performance was helpful since there was no downstream cache. For years now we've used Cloudflare as a CDN, so trying to cache onboard is less useful than before. Furthermore, since the cache is very small and only used in fairly restrictive ways, it probably has very little impact on performance.
2021-01-11 15:53:36 -05:00
chris48s
0d95612bcf add note to docs about img.shields.io vs shields.io (#6039)
* there are now fewer bottlenecks

* add note to docs about img.shields.io vs shields.io
2021-01-10 20:40:44 +00:00
dependabot-preview[bot]
3a31721631 Build(deps): bump js-yaml from 3.14.1 to 4.0.0; run [DynamicYaml] (#6026)
* Build(deps): bump js-yaml from 3.14.1 to 4.0.0

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 4.0.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.14.1...4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: apply js-yaml v4 changes

* deps: js-yaml v4 updates in gatsby config

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-10 15:23:32 +00:00
dependabot-preview[bot]
7ac57d993a Build(deps-dev): bump danger from 10.5.4 to 10.6.0 (#6030)
Bumps [danger](https://github.com/danger/danger-js) from 10.5.4 to 10.6.0.
- [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/10.5.4...10.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-09 00:48:17 +00:00
dependabot-preview[bot]
daa99c1f13 Build(deps-dev): bump gatsby-plugin-page-creator from 2.7.1 to 2.8.0 (#6031)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-page-creator) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.8.0/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 22:09:45 +00:00
dependabot-preview[bot]
c77e5c2d90 Build(deps): bump simple-icons from 4.4.0 to 4.5.0 (#6028)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.4.0...4.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 21:56:36 +00:00
dependabot-preview[bot]
ff61257052 Build(deps-dev): bump gatsby from 2.29.3 to 2.30.1 (#6021)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.29.3 to 2.30.1.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.29.3...gatsby@2.30.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 21:44:41 +00:00
chris48s
88bff9d37d improve [pypi] license parsing from classifiers (#6018)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 21:34:46 +00:00
dependabot-preview[bot]
83a2fb0465 Build(deps-dev): bump @types/node from 14.14.17 to 14.14.20 (#6025)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.17 to 14.14.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 18:32:22 +00:00
dependabot-preview[bot]
d5adf88e2c Build(deps-dev): bump husky from 4.3.6 to 4.3.7 (#6024)
Bumps [husky](https://github.com/typicode/husky) from 4.3.6 to 4.3.7.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v4.3.6...v4.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 18:22:14 +00:00
dependabot-preview[bot]
8ebf918642 Build(deps-dev): bump cypress from 6.2.0 to 6.2.1 (#6029)
Bumps [cypress](https://github.com/cypress-io/cypress) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v6.2.0...v6.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 13:28:17 +00:00
dependabot-preview[bot]
c87c66c4f0 Build(deps-dev): bump eslint-plugin-jsdoc from 30.7.9 to 30.7.13 (#6033)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.7.9 to 30.7.13.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.7.9...v30.7.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 13:12:01 +00:00
dependabot-preview[bot]
caa6fce393 Build(deps-dev): bump eslint from 7.16.0 to 7.17.0 (#6023)
Bumps [eslint](https://github.com/eslint/eslint) from 7.16.0 to 7.17.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/v7.16.0...v7.17.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-08 12:54:47 +00:00
dependabot-preview[bot]
0ce01af915 Build(deps-dev): bump sinon from 9.2.2 to 9.2.3 (#6022)
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.2 to 9.2.3.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.2.2...v9.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-08 12:35:40 +00:00
chris48s
e54e69cf8e add docs on input validation (#6009)
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2021-01-04 19:32:32 +00:00
Samuel FORESTIER
d3a7afdec0 [PyPI] Fixes Python versions order by using proper Semver comparison (#6000)
* [PyPI] Fixes Python versions order by using proper Semver comparison

* [PyPI] Adds a proper specification file for Python versions service

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-02 18:17:09 +00:00
dependabot-preview[bot]
79ff825504 Build(deps): bump query-string from 6.13.7 to 6.13.8 (#6002)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.13.7 to 6.13.8.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.13.7...v6.13.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-02 15:30:51 +00:00
chris48s
c854af65e8 use new [HexPM] latest_stable_version property (#6010)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-02 15:20:13 +00:00
dependabot-preview[bot]
b644c1027d Build(deps): bump fast-xml-parser from 3.17.5 to 3.17.6 (#6007)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.17.5 to 3.17.6.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-02 15:10:34 +00:00
dependabot-preview[bot]
61d2b0d07f Build(deps-dev): bump @types/node from 14.14.16 to 14.14.17 (#6006)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.16 to 14.14.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-01 18:38:34 +00:00
dependabot-preview[bot]
1babb2a44a Build(deps-dev): bump @types/react-select from 3.0.28 to 3.1.2 (#6003)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.28 to 3.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-01 18:29:59 +00:00
dependabot-preview[bot]
be996f60a8 Build(deps): bump simple-icons from 4.3.0 to 4.4.0 (#6004)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.3.0...4.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-01 17:07:58 +00:00
dependabot-preview[bot]
3e3ea1e6c7 Build(deps-dev): bump gatsby from 2.29.2 to 2.29.3 (#6008)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.29.2 to 2.29.3.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.29.2...gatsby@2.29.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-01 16:58:58 +00:00
dependabot-preview[bot]
6d6cac01a0 Build(deps-dev): bump start-server-and-test from 1.11.6 to 1.11.7 (#6001)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.11.6 to 1.11.7.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.11.6...v1.11.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-01-01 16:43:08 +00:00
dependabot-preview[bot]
0bc48b607e Build(deps-dev): bump eslint-plugin-react from 7.21.5 to 7.22.0 (#6005)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.5 to 7.22.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.21.5...v7.22.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-01 12:41:38 +00:00
chris48s
5ae87b1c30 github auth endpoint improvements (#5999) 2020-12-31 15:04:06 +00:00
chris48s
e7ed16284a set 'Cache-Control: private' on token auth endpoint (#5998) 2020-12-30 19:59:39 +00:00
Paul Melnikow
ccdc803eea Remove obsolete sysadmin script (#5995)
This was used for initially loading the uniqified GitHub tokens into Redis (#3332), but is no longer needed.
2020-12-29 13:26:09 -05:00
chris48s
09988d98e4 bump scoutcamp to 18.1.1 (#5992) 2020-12-27 18:43:52 +00:00
dependabot-preview[bot]
886aa679ee Build(deps): bump pretty-bytes from 5.4.1 to 5.5.0 (#5980)
Bumps [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/sindresorhus/pretty-bytes/releases)
- [Commits](https://github.com/sindresorhus/pretty-bytes/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-26 13:38:50 +00:00
dependabot-preview[bot]
07326a1240 Build(deps-dev): bump @types/styled-components from 5.1.6 to 5.1.7 (#5989)
* Build(deps-dev): bump @types/styled-components from 5.1.6 to 5.1.7

Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.6 to 5.1.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: drop types/styled-components work around

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-26 13:31:33 +00:00
dependabot-preview[bot]
43bbff446f Build(deps-dev): bump @types/node from 14.14.14 to 14.14.16 (#5981)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.14 to 14.14.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 20:32:09 +00:00
dependabot-preview[bot]
668eab81ac Build(deps): bump simple-icons from 4.2.0 to 4.3.0 (#5991)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.2.0...4.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 18:47:38 +00:00
dependabot-preview[bot]
daf45a9042 Build(deps-dev): bump husky from 4.3.5 to 4.3.6 (#5983)
Bumps [husky](https://github.com/typicode/husky) from 4.3.5 to 4.3.6.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v4.3.5...v4.3.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 18:40:19 +00:00
dependabot-preview[bot]
3ed90af5ad Build(deps-dev): bump gatsby from 2.29.1 to 2.29.2 (#5982)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.29.1...gatsby@2.29.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 18:27:57 +00:00
SeaHOH
8d94869bf8 Fixed escapes single '_' of badge urls; affects [static website] (#5979)
Fixed escapes inline single '_' of badge urls

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2020-12-25 18:20:42 +00:00
dependabot-preview[bot]
d968c8d277 Build(deps-dev): bump eslint from 7.15.0 to 7.16.0 (#5987)
Bumps [eslint](https://github.com/eslint/eslint) from 7.15.0 to 7.16.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/v7.15.0...v7.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 13:13:56 +00:00
dependabot-preview[bot]
fecbb4a1b2 Build(deps-dev): bump eslint-plugin-jsdoc from 30.7.8 to 30.7.9 (#5990)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.7.8 to 30.7.9.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.7.8...v30.7.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 13:05:48 +00:00
dependabot-preview[bot]
7efe089d8c Build(deps-dev): bump cypress from 6.1.0 to 6.2.0 (#5988)
Bumps [cypress](https://github.com/cypress-io/cypress) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v6.1.0...v6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-25 12:57:44 +00:00
dependabot-preview[bot]
bcc97d08e1 Build(deps-dev): bump eslint-config-prettier from 7.0.0 to 7.1.0 (#5985)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v7.0.0...v7.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-25 12:40:29 +00:00
chris48s
cd531ffc65 add generic [GithubIssuesSearch] badges (#5976)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-24 18:39:44 +00:00
dependabot-preview[bot]
e202b73c3c Build(deps): bump prom-client from 11.5.3 to 13.0.0 (#5962)
* Build(deps): bump prom-client from 11.5.3 to 13.0.0

Bumps [prom-client](https://github.com/siimon/prom-client) from 11.5.3 to 13.0.0.
- [Release notes](https://github.com/siimon/prom-client/releases)
- [Changelog](https://github.com/siimon/prom-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/siimon/prom-client/compare/v11.5.3...v13.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: apply updates for prom version bump

* register.getMetricsAsJSON is async now

* PrometheusMetrics#metrics is async

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: Marcin Mielnicki <marcin.mielnicki@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 23:32:08 +00:00
chris48s
6ccd24815f remove refs to netlify from docs (#5978)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 23:22:22 +00:00
Vanshaj Singhania
d69f7b6b5f [GitHubChecksStatus] Add commit check badge (#5973)
* Add GH commit check badge

* Fix class name, tests

* Run prettier

* Refactor to generic checks

* Run prettier

* Make keywords separate from title

* Make commit failing tests actually fail

* Resolve suggested edits

* Sanitize imports

* Follow import order requirements

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 23:14:28 +00:00
dependabot-preview[bot]
d0b93b4103 Build(deps): bump path-to-regexp from 5.0.0 to 6.2.0, run [Appveyor Bitbucket Circle GitHub GitLab ScrutinizerBuild] (#5684)
* Build(deps): bump path-to-regexp from 5.0.0 to 6.2.0

Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 5.0.0 to 6.2.0.
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v5.0.0...v6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: apply path-to-regexp breaking changes

* fix: path-to-regexp types in frontend

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 22:59:31 +00:00
Weihao
ad867ddc90 Fix [Spiget] rating display issue (#5972)
* Round rating to at most 2 decimal places

* use toFixed method

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 19:42:46 +00:00
Marcin Mielnicki
b748e62e0a Test for server running with metrics enabled (#5975)
* Test server running with metrics enabled

* Verify custom metric was send

* Extra code removed

* Tests moved to core/server/server.spec.js

* tickAsync value based on push interval

* Trigger Build

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 18:52:08 +00:00
chris48s
a93e6a36a4 deploy docs to gh-pages (#5977)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-23 18:43:34 +00:00
chris48s
05f3c600d2 use new plugin api for [jetbrains] (#5974)
* use new plugin api for [jetbrains]

* restore mocked XML response tests
2020-12-23 17:07:39 +00:00
dependabot-preview[bot]
91b108d4b7 Build(deps-dev): bump gatsby-plugin-page-creator from 2.6.0 to 2.7.1 (#5965)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-page-creator) from 2.6.0 to 2.7.1.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/gatsby-plugin-page-creator@2.7.1/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.7.1/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-19 22:40:06 +00:00
dependabot-preview[bot]
5b31a2c692 Build(deps-dev): bump typescript from 4.1.2 to 4.1.3 (#5964)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.2...v4.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-18 18:01:01 -06:00
dependabot-preview[bot]
04a547213a Build(deps): bump @sentry/node from 5.29.0 to 5.29.2 (#5963)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.29.0 to 5.29.2.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.0...5.29.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 18:09:13 +00:00
dependabot-preview[bot]
7f1aecbdcc Build(deps-dev): bump @types/node from 14.14.12 to 14.14.14 (#5961)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.12 to 14.14.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 17:39:05 +00:00
dependabot-preview[bot]
e06026ec10 Build(deps): bump ioredis from 4.19.2 to 4.19.4 (#5957)
Bumps [ioredis](https://github.com/luin/ioredis) from 4.19.2 to 4.19.4.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/master/Changelog.md)
- [Commits](https://github.com/luin/ioredis/compare/v4.19.2...v4.19.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 17:23:06 +00:00
dependabot-preview[bot]
3404ff216d Build(deps-dev): bump gatsby from 2.28.2 to 2.29.1 (#5956)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.28.2 to 2.29.1.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.28.2...gatsby@2.29.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 17:13:40 +00:00
dependabot-preview[bot]
448e9df671 Build(deps): bump simple-icons from 4.1.0 to 4.2.0 (#5953)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.1.0...4.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 16:37:17 +00:00
dependabot-preview[bot]
5a6f299c16 Build(deps-dev): bump @types/styled-components from 5.1.5 to 5.1.6 (#5955)
Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.5 to 5.1.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-18 16:27:33 +00:00
dependabot-preview[bot]
bd766111a7 Build(deps-dev): bump sinon from 9.2.1 to 9.2.2 (#5959)
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits/v9.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-18 12:46:59 +00:00
Caleb Cartwright
473619cf12 tests: fix GitHubCommitsSince service test (#5951)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-17 16:43:03 +00:00
chris48s
ebaf4f5b48 use a logo in the README that looks ok in light or dark mode (#5949) 2020-12-17 16:33:57 +00:00
Julio L. Muller
f0a93d020b Fix example URL for npm peer dependencies (#5945) 2020-12-15 20:26:14 +00:00
Pierre-Yves B
87d8028b0b Deprecate [Continuousphp] service (#5942)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-14 00:36:52 +00:00
dependabot-preview[bot]
1361500296 Build(deps-dev): bump prettier from 2.1.2 to 2.2.1 (#5905)
* Build(deps-dev): bump prettier from 2.1.2 to 2.2.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.1.2 to 2.2.1.
- [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/2.1.2...2.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* run new prettier

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-12 16:10:19 +00:00
dependabot-preview[bot]
8a4bc636e8 Build(deps-dev): bump @types/styled-components from 5.1.4 to 5.1.5 (#5938)
Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.4 to 5.1.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-12 14:44:25 +00:00
dependabot-preview[bot]
646f76924e Build(deps-dev): bump @types/node from 14.14.10 to 14.14.12 (#5936)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.10 to 14.14.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-12 14:31:25 +00:00
dependabot-preview[bot]
0422e9f552 Build(deps-dev): bump @babel/core from 7.12.9 to 7.12.10 (#5939)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.9 to 7.12.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.10/packages/babel-core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-12 14:22:42 +00:00
dependabot-preview[bot]
c194f1c9ac Build(deps-dev): bump eslint-config-standard-react from 9.2.0 to 11.0.1 (#5902)
* Build(deps-dev): bump eslint-config-standard-react from 9.2.0 to 11.0.1

Bumps [eslint-config-standard-react](https://github.com/feross/eslint-config-standard-react) from 9.2.0 to 11.0.1.
- [Release notes](https://github.com/feross/eslint-config-standard-react/releases)
- [Commits](https://github.com/feross/eslint-config-standard-react/compare/v9.2.0...v11.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: apply eslint-config-standard-react updates

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
2020-12-11 18:18:12 -06:00
dependabot-preview[bot]
d3f7492ad3 Build(deps-dev): bump eslint-config-prettier from 6.15.0 to 7.0.0 (#5932)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.15.0 to 7.0.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.15.0...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 19:52:15 +00:00
dependabot-preview[bot]
eee0de97bd Build(deps): bump simple-icons from 4.0.1 to 4.1.0 (#5935)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/4.0.1...4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 19:41:52 +00:00
dependabot-preview[bot]
fce6d62127 Build(deps-dev): bump got from 11.8.0 to 11.8.1 (#5927)
Bumps [got](https://github.com/sindresorhus/got) from 11.8.0 to 11.8.1.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v11.8.0...v11.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 19:29:15 +00:00
dependabot-preview[bot]
febc895db6 Build(deps-dev): bump gatsby from 2.28.0 to 2.28.2 (#5931)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.28.0 to 2.28.2.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.28.0...gatsby@2.28.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 19:18:55 +00:00
dependabot-preview[bot]
35212b1f3e Build(deps-dev): bump husky from 4.3.0 to 4.3.5 (#5930)
Bumps [husky](https://github.com/typicode/husky) from 4.3.0 to 4.3.5.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v4.3.0...v4.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 19:05:27 +00:00
dependabot-preview[bot]
574206a84b Build(deps-dev): bump @types/mocha from 8.0.4 to 8.2.0 (#5929)
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.4 to 8.2.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 18:47:17 +00:00
dependabot-preview[bot]
7b151a0cd5 Build(deps-dev): bump @types/react-select from 3.0.27 to 3.0.28 (#5928)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.27 to 3.0.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 18:34:58 +00:00
dependabot-preview[bot]
211b262d3a Build(deps): bump @sentry/node from 5.28.0 to 5.29.0 (#5926)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.28.0 to 5.29.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.28.0...5.29.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 18:11:32 +00:00
dependabot-preview[bot]
ba558ecfbe Build(deps-dev): bump @babel/register from 7.12.1 to 7.12.10 (#5925)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.12.1 to 7.12.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.10/packages/babel-register)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 17:59:29 +00:00
dependabot-preview[bot]
a098a493eb Build(deps): bump webextension-store-meta from 1.0.2 to 1.0.3 (#5765)
Bumps [webextension-store-meta](https://github.com/crimx/webextension-store-meta) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/crimx/webextension-store-meta/releases)
- [Commits](https://github.com/crimx/webextension-store-meta/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 17:52:10 +00:00
dependabot-preview[bot]
00a8f50eae Build(deps): bump js-yaml from 3.14.0 to 3.14.1 (#5924)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.0 to 3.14.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/3.14.1/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.0...3.14.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 17:41:08 +00:00
dependabot-preview[bot]
bdfc758c5a Build(deps-dev): bump cypress from 6.0.1 to 6.1.0 (#5937)
Bumps [cypress](https://github.com/cypress-io/cypress) from 6.0.1 to 6.1.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v6.0.1...v6.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 13:35:03 +00:00
dependabot-preview[bot]
bcbe598b88 Build(deps-dev): bump eslint-plugin-sort-class-members (#5934)
Bumps [eslint-plugin-sort-class-members](https://github.com/bryanrsmith/eslint-plugin-sort-class-members) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/bryanrsmith/eslint-plugin-sort-class-members/releases)
- [Commits](https://github.com/bryanrsmith/eslint-plugin-sort-class-members/compare/v1.8.0...v1.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-11 13:19:08 +00:00
dependabot-preview[bot]
de09cad621 Build(deps-dev): bump eslint from 7.14.0 to 7.15.0 (#5933)
Bumps [eslint](https://github.com/eslint/eslint) from 7.14.0 to 7.15.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/v7.14.0...v7.15.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-11 12:56:13 +00:00
dependabot[bot]
3d6041f67b Build(deps): bump ini from 1.3.4 to 1.3.7 (#5923)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.4 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.4...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-10 21:05:13 -06:00
Caleb Cartwright
c8ef4ec980 tests: fix OpenVSX service tests (#5893)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-06 00:12:54 +00:00
dependabot-preview[bot]
f0eabce923 Build(deps): bump simple-icons from 3.13.0 to 4.0.1 (#5913)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.13.0 to 4.0.1.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.13.0...4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-05 17:17:29 +00:00
dependabot-preview[bot]
0ee1a3c1df Build(deps): bump semver from 7.3.2 to 7.3.4 (#5899)
Bumps [semver](https://github.com/npm/node-semver) from 7.3.2 to 7.3.4.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.2...v7.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 16:58:09 +00:00
dependabot-preview[bot]
c9906f08e1 Build(deps): bump fast-xml-parser from 3.17.4 to 3.17.5 (#5901)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.17.4 to 3.17.5.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 16:50:19 +00:00
dependabot-preview[bot]
43ba4618bb Build(deps-dev): bump danger from 10.5.3 to 10.5.4 (#5910)
Bumps [danger](https://github.com/danger/danger-js) from 10.5.3 to 10.5.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/10.5.3...10.5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 14:13:56 +00:00
dependabot-preview[bot]
3822b73381 Build(deps-dev): bump lint-staged from 10.5.2 to 10.5.3 (#5912)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.5.2 to 10.5.3.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.5.2...v10.5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-05 00:27:39 -06:00
dependabot-preview[bot]
4b51fc9541 Build(deps-dev): bump tsd from 0.13.1 to 0.14.0 (#5900)
Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.13.1 to 0.14.0.
- [Release notes](https://github.com/SamVerschueren/tsd/releases)
- [Commits](https://github.com/SamVerschueren/tsd/compare/v0.13.1...v0.14.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 00:38:04 +00:00
dependabot-preview[bot]
157b227461 Build(deps): bump @sentry/node from 5.27.6 to 5.28.0 (#5896)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.27.6 to 5.28.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.27.6...5.28.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 00:24:03 +00:00
dependabot-preview[bot]
a84bedd347 Build(deps-dev): bump @types/react-select from 3.0.26 to 3.0.27 (#5898)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.26 to 3.0.27.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-05 00:14:58 +00:00
dependabot-preview[bot]
49ca0f48ee Build(deps-dev): bump gatsby from 2.27.4 to 2.28.0 (#5904)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.27.4 to 2.28.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.27.4...gatsby@2.28.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-04 21:19:41 +00:00
dependabot-preview[bot]
2decbb1cfc Build(deps-dev): bump gatsby-plugin-page-creator from 2.3.33 to 2.6.0 (#5897)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-page-creator) from 2.3.33 to 2.6.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.6.0/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-04 21:10:23 +00:00
dependabot-preview[bot]
686c946dd3 Build(deps-dev): bump eslint-plugin-mocha from 6.3.0 to 8.0.0 (#5895)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 6.3.0 to 8.0.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/6.3.0...8.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-04 21:00:59 +00:00
dependabot-preview[bot]
d75ed0cd90 Build(deps): bump cross-env from 7.0.2 to 7.0.3 (#5914)
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v7.0.2...v7.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-04 20:41:36 +00:00
dependabot-preview[bot]
4af7008e4f Build(deps-dev): bump cypress from 6.0.0 to 6.0.1 (#5909)
Bumps [cypress](https://github.com/cypress-io/cypress) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v6.0.0...v6.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-04 13:01:44 +00:00
dependabot-preview[bot]
de5d4d7823 Build(deps-dev): bump @babel/core from 7.12.3 to 7.12.9 (#5872)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.3 to 7.12.9.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.9/packages/babel-core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-02 05:09:08 +00:00
chris48s
0be2ee0aa7 post-Heroku migration cleanup tasks (#5886)
* remove 'commits to be deployed' badge

* remove old deploy scripts

* update prod hosting docs

* remove 'commit is/isn't in gh-pages' action

* remove OVH servers from docs

* clarify role of CloudFlare DNS

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-01 19:48:20 +00:00
chris48s
87f40f5ace delete eslint-plugin-standard, update eslint-config-standard and eslint; affects [github jira scoop] (#5889)
* delete eslint-plugin-standard, update eslint-config-standard and eslint

* update code for new eslint rules

* Update services/jira/jira-sprint.service.js

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-12-01 19:37:54 +00:00
Caleb Cartwright
b709951439 refacor: remove GH sponsors style override (#5888) 2020-11-30 17:16:09 -06:00
chris48s
e1bae8c18f remove redirectUrl: from prod settings (#5885) 2020-11-29 12:09:30 +00:00
Paul Melnikow
ac3d0b5dfc Support gzipped endpoint URLs (#5869)
Fix #5868
2020-11-28 23:17:58 -05:00
Pierre-Yves B
26df74a35a Remove some unused dev dependencies (#5884) 2020-11-28 17:50:33 +00:00
dependabot-preview[bot]
f5aa2c8db2 Build(deps): bump @sentry/node from 5.27.4 to 5.27.6 (#5878)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.27.4 to 5.27.6.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.27.4...5.27.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-28 15:57:44 +00:00
dependabot-preview[bot]
56a3bb271b Build(deps): bump config from 3.3.2 to 3.3.3 (#5876)
Bumps [config](https://github.com/lorenwest/node-config) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/lorenwest/node-config/releases)
- [Changelog](https://github.com/lorenwest/node-config/blob/master/History.md)
- [Commits](https://github.com/lorenwest/node-config/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-28 15:45:52 +00:00
dependabot-preview[bot]
d87dfc13a8 Build(deps-dev): bump @types/node from 14.14.9 to 14.14.10 (#5875)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.9 to 14.14.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-28 01:22:04 +00:00
dependabot-preview[bot]
2802a15854 Build(deps-dev): bump start-server-and-test from 1.11.5 to 1.11.6 (#5871)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.11.5 to 1.11.6.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.11.5...v1.11.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 20:46:30 +00:00
dependabot-preview[bot]
02d57f9eb2 Build(deps-dev): bump lint-staged from 10.5.1 to 10.5.2 (#5877)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.5.1 to 10.5.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.5.1...v10.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 20:39:10 +00:00
dependabot-preview[bot]
a8a5c6fd3c Build(deps-dev): bump react-select from 3.1.0 to 3.1.1 (#5880)
Bumps [react-select](https://github.com/JedWatson/react-select) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@3.1.0...react-select@3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 20:30:20 +00:00
dependabot-preview[bot]
f38423c6fa Build(deps-dev): bump cypress from 5.6.0 to 6.0.0 (#5874)
Bumps [cypress](https://github.com/cypress-io/cypress) from 5.6.0 to 6.0.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v5.6.0...v6.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 20:15:31 +00:00
dependabot-preview[bot]
9eeb576e57 Build(deps): bump simple-icons from 3.12.4 to 3.13.0 (#5870)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.12.4 to 3.13.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.12.4...3.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 20:06:43 +00:00
dependabot-preview[bot]
bf7f4768c0 Build(deps-dev): bump react-modal from 3.11.2 to 3.12.1 (#5881)
Bumps [react-modal](https://github.com/reactjs/react-modal) from 3.11.2 to 3.12.1.
- [Release notes](https://github.com/reactjs/react-modal/releases)
- [Changelog](https://github.com/reactjs/react-modal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactjs/react-modal/compare/v3.11.2...v3.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-27 19:52:38 +00:00
dependabot-preview[bot]
f569678fe6 Build(deps-dev): bump gatsby from 2.27.0 to 2.27.4 (#5873)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.27.0 to 2.27.4.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.27.0...gatsby@2.27.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-27 19:41:58 +00:00
dependabot-preview[bot]
338f86da8b Build(deps-dev): bump clipboard-copy from 3.2.0 to 4.0.1 (#5857)
Bumps [clipboard-copy](https://github.com/feross/clipboard-copy) from 3.2.0 to 4.0.1.
- [Release notes](https://github.com/feross/clipboard-copy/releases)
- [Commits](https://github.com/feross/clipboard-copy/compare/v3.2.0...v4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-26 17:31:53 +00:00
Pierre-Yves B
c73b92f188 Drop .env support (#5864) 2020-11-23 21:20:55 +00:00
chris48s
20067c6d5d bump approve bot (#5865)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-23 20:15:23 +00:00
Pierre-Yves B
796dc5a25b Remove documentation about old OVH VPS servers (#5863) 2020-11-22 18:54:02 +00:00
chris48s
0fda6da8e7 special case generating baseUrl for production (#5840) 2020-11-21 20:38:36 +00:00
dependabot-preview[bot]
4025d4a7bf Build(deps-dev): bump typescript from 4.0.5 to 4.1.2 (#5859)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.5 to 4.1.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.5...v4.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-21 17:28:13 +00:00
dependabot-preview[bot]
e3a6adb0ea Build(deps-dev): bump danger from 10.5.1 to 10.5.3 (#5858)
Bumps [danger](https://github.com/danger/danger-js) from 10.5.1 to 10.5.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/compare/10.5.1...10.5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-21 17:20:29 +00:00
dependabot-preview[bot]
6a49337a73 Build(deps-dev): bump @types/node from 14.14.7 to 14.14.9 (#5854)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.7 to 14.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-21 02:35:05 +00:00
dependabot-preview[bot]
cc8cf7e504 Build(deps-dev): bump eslint-plugin-jsdoc from 30.7.7 to 30.7.8 (#5856)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.7.7 to 30.7.8.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.7.7...v30.7.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-20 21:11:25 +00:00
dependabot-preview[bot]
aa1e291b43 Build(deps): bump simple-icons from 3.12.2 to 3.12.4 (#5855)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.12.2 to 3.12.4.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.12.2...3.12.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-20 20:53:36 +00:00
dependabot-preview[bot]
1f90409bce Build(deps-dev): bump gatsby from 2.26.0 to 2.27.0 (#5851)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.26.0 to 2.27.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.26.0...gatsby@2.27.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-20 20:36:49 +00:00
chris48s
a14083d858 map REDIRECT_URI env var to redirectUrl setting (#5845)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-18 21:04:00 +00:00
chris48s
f57fde0c91 lint/format typescript files in pre-commit hook (#5841) 2020-11-18 19:58:52 +00:00
Caleb Cartwright
783a107771 docs: add contact info for pkgreview badge (#5832) 2020-11-15 18:47:47 +00:00
dependabot-preview[bot]
8462cefa7d Build(deps-dev): bump @types/mocha from 8.0.3 to 8.0.4 (#5831)
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.3 to 8.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-14 04:29:58 +00:00
dependabot-preview[bot]
234a9407e5 Build(deps-dev): bump lint-staged from 10.4.2 to 10.5.1 (#5829)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.4.2 to 10.5.1.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.4.2...v10.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 19:15:25 +00:00
dependabot-preview[bot]
2d915fcb09 Build(deps-dev): bump nock from 13.0.4 to 13.0.5 (#5821)
Bumps [nock](https://github.com/nock/nock) from 13.0.4 to 13.0.5.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.0.4...v13.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 19:04:30 +00:00
dependabot-preview[bot]
61870df2bb Build(deps-dev): bump @types/react-select from 3.0.23 to 3.0.26 (#5826)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.23 to 3.0.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 18:55:00 +00:00
dependabot-preview[bot]
eef07bf60e Build(deps-dev): bump gatsby from 2.24.91 to 2.26.0 (#5827)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.24.91 to 2.26.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.24.91...gatsby@2.26.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 18:41:36 +00:00
dependabot-preview[bot]
1c8c44ef74 Build(deps-dev): bump @types/node from 14.14.6 to 14.14.7 (#5822)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.6 to 14.14.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 18:30:49 +00:00
dependabot-preview[bot]
9ae60e04ce Build(deps): bump @sentry/node from 5.27.1 to 5.27.4 (#5819)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.27.1 to 5.27.4.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.27.1...5.27.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 18:15:29 +00:00
dependabot-preview[bot]
c283c8c9f1 Build(deps-dev): bump cypress from 5.5.0 to 5.6.0 (#5824)
Bumps [cypress](https://github.com/cypress-io/cypress) from 5.5.0 to 5.6.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v5.5.0...v5.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 13:25:33 +00:00
dependabot-preview[bot]
88f1993d7b Build(deps-dev): bump eslint-plugin-jsdoc from 30.7.3 to 30.7.7 (#5828)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.7.3 to 30.7.7.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.7.3...v30.7.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 13:17:23 +00:00
dependabot-preview[bot]
9de8541d2d Build(deps-dev): bump eslint-plugin-standard from 4.0.2 to 4.1.0 (#5820)
Bumps [eslint-plugin-standard](https://github.com/standard/eslint-plugin-standard) from 4.0.2 to 4.1.0.
- [Release notes](https://github.com/standard/eslint-plugin-standard/releases)
- [Commits](https://github.com/standard/eslint-plugin-standard/compare/v4.0.2...v4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 12:44:57 +00:00
dependabot-preview[bot]
1696bfc040 Build(deps-dev): bump eslint-config-prettier from 6.13.0 to 6.15.0 (#5818)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.13.0 to 6.15.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.13.0...v6.15.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-13 12:27:46 +00:00
Bryan Kok
a363ea80b9 Add Downloads, Category, License, Sponge Versions, Stars, and Version badges for [Ore], an API platform for Sponge Minecraft plugins (#5757)
* Add Downloads, Category, License, Sponge Versions, Stars, and Version badges for Ore, an API platform for Sponge Minecraft plugins

* Update services/ore/ore-downloads.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Replace mocked e2e tests with unit tests, fix schema and add test case for Ore License

* Simplify single case forCases

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 05:12:00 +00:00
Jakka Prihatna
b2f29ff3dc Add [OpenVSX] registry badges (#5815)
* feat: Add [OpenVSX] downloads, version, rating, and release-date badges

Signed-off-by: Jakka Prihatna <jprihatna@gmail.com>

* test: Add tests for [OpenVSX] badges

Signed-off-by: Jakka Prihatna <jprihatna@gmail.com>

* Apply suggestions from code review

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Apply changes from code review

Signed-off-by: Jakka Prihatna <jprihatna@gmail.com>

* Update services/open-vsx/open-vsx-base.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* fix: Change Joi.forbidden() to Joi.optional()

Signed-off-by: Jakka Prihatna <jprihatna@gmail.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-13 02:02:46 +00:00
chris48s
8dd6da3cf9 Configure max-age header for frontend (#5775)
* upgrade scoutcamp

* set max age for static content, add tests

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-12 20:04:20 +00:00
Jakub Fijałkowski
2610305066 Refactor the [nuget myget] service (#5814)
* Refactor the nuget-v3 service

* Remove the extra `await` in `fetch`

* Simplify the extraction & test code
2020-11-11 19:00:00 -06:00
Caleb Cartwright
71299a8178 fix: hacktoberfest start date calc (#5813) 2020-11-07 13:32:04 -06:00
Caleb Cartwright
9803471170 docs: cleanup hacktoberfest readme material (#5812) 2020-11-07 12:03:33 -06:00
dependabot-preview[bot]
21c6e0a5f6 Build(deps-dev): bump babel-plugin-inline-react-svg from 1.1.1 to 1.1.2 (#5809)
Bumps [babel-plugin-inline-react-svg](https://github.com/kesne/babel-plugin-inline-react-svg) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/kesne/babel-plugin-inline-react-svg/releases)
- [Commits](https://github.com/kesne/babel-plugin-inline-react-svg/compare/v1.1.1...1.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 14:08:48 +00:00
dependabot-preview[bot]
b1f7d2f67a Build(deps-dev): bump clipboard-copy from 3.1.0 to 3.2.0 (#5808)
Bumps [clipboard-copy](https://github.com/feross/clipboard-copy) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/feross/clipboard-copy/releases)
- [Commits](https://github.com/feross/clipboard-copy/compare/v3.1.0...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 02:43:08 +00:00
dependabot-preview[bot]
7821112076 Build(deps-dev): bump @types/react-select from 3.0.22 to 3.0.23 (#5807)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.22 to 3.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-06 20:33:36 -06:00
dependabot-preview[bot]
fa319397ca Build(deps-dev): bump @types/styled-components from 5.1.3 to 5.1.4 (#5806)
Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.3 to 5.1.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 02:13:39 +00:00
dependabot-preview[bot]
d216afb14a Build(deps-dev): bump danger from 10.5.0 to 10.5.1 (#5805)
Bumps [danger](https://github.com/danger/danger-js) from 10.5.0 to 10.5.1.
- [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/10.5.0...10.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:59:30 +00:00
dependabot-preview[bot]
2cc159f89f Build(deps): bump query-string from 6.13.6 to 6.13.7 (#5804)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.13.6 to 6.13.7.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.13.6...v6.13.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:42:56 +00:00
dependabot-preview[bot]
5127fff25a Build(deps): bump simple-icons from 3.12.1 to 3.12.2 (#5802)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.12.1 to 3.12.2.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.12.1...3.12.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:35:13 +00:00
dependabot-preview[bot]
c04699fdf6 Build(deps): [security] bump node-fetch from 2.6.0 to 2.6.1 (#5795)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. **This update includes a security fix.**
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:26:35 +00:00
dependabot-preview[bot]
505912ef9d Build(deps): bump ioredis from 4.19.1 to 4.19.2 (#5801)
Bumps [ioredis](https://github.com/luin/ioredis) from 4.19.1 to 4.19.2.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/master/Changelog.md)
- [Commits](https://github.com/luin/ioredis/compare/v4.19.1...v4.19.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:18:13 +00:00
dependabot-preview[bot]
20c2ab97de Build(deps-dev): bump typescript from 4.0.3 to 4.0.5 (#5800)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.3 to 4.0.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.3...v4.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 01:08:23 +00:00
dependabot-preview[bot]
bdc0ec53cd Build(deps-dev): bump gatsby-plugin-typescript from 2.4.24 to 2.5.0 (#5799)
Bumps [gatsby-plugin-typescript](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-typescript) from 2.4.24 to 2.5.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-typescript/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-typescript@2.5.0/packages/gatsby-plugin-typescript)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 00:53:03 +00:00
dependabot-preview[bot]
f824b173e7 Build(deps-dev): bump fetch-ponyfill from 6.1.1 to 7.0.0 (#5798)
Bumps [fetch-ponyfill](https://github.com/qubyte/fetch-ponyfill) from 6.1.1 to 7.0.0.
- [Release notes](https://github.com/qubyte/fetch-ponyfill/releases)
- [Changelog](https://github.com/qubyte/fetch-ponyfill/blob/main/HISTORY.md)
- [Commits](https://github.com/qubyte/fetch-ponyfill/compare/v6.1.1...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-07 00:43:20 +00:00
dependabot-preview[bot]
b4adc0e504 Build(deps-dev): bump cypress from 5.3.0 to 5.5.0 (#5803)
Bumps [cypress](https://github.com/cypress-io/cypress) from 5.3.0 to 5.5.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v5.3.0...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-06 12:56:40 +00:00
dependabot-preview[bot]
fe4f6eb03e Build(deps-dev): bump mocha from 8.2.0 to 8.2.1 (#5797)
Bumps [mocha](https://github.com/mochajs/mocha) from 8.2.0 to 8.2.1.
- [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/v8.2.0...v8.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-06 12:31:16 +00:00
homersimpsons
3597b7e80f Refactor forgotten static get in services (#5794)
Co-authored-by: Guillaume <g.alabre@thecodingmachine.com>
2020-11-05 20:35:10 +00:00
dependabot-preview[bot]
f165c9f8dd Build(deps): bump camelcase from 6.1.0 to 6.2.0 (#5786)
Bumps [camelcase](https://github.com/sindresorhus/camelcase) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/sindresorhus/camelcase/releases)
- [Commits](https://github.com/sindresorhus/camelcase/compare/v6.1.0...v6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-05 02:22:50 +00:00
homersimpsons
5e335e1bb2 Refactor static get: website, wercker, wheelmap, wordpress, youtube (#5793)
Co-authored-by: Guillaume <g.alabre@thecodingmachine.com>
2020-11-03 19:19:09 +00:00
Jakub Fijałkowski
878f4fbcbc Add support for NuGet badges from [nuget feedz] hosting (#5753)
* Add support for Feedz NuGet feeds

* Fix tests & error messages that are used

* Cleanup service and change route according to the conventions

* Change route nomenclature

* Extract `searchServiceUrl`, `stripBuildMetadata` and `selectVersion` to NuGet helpers

* Fix Feedz examples

* Fixup the pattern in Feedz examples

Missed save...

* Use MongoDB.Driver.Core in Feedz examples

* Use standard route pattern instead of `RouteBuilder`

* Extract `transform` function in feedz service

* Add simple test for the `apiUrl` function

* Distinguish repository/package errors

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-03 00:52:13 +00:00
dependabot-preview[bot]
05850d1a1b Build(deps): bump joi from 17.2.1 to 17.3.0 (#5779)
Bumps [joi](https://github.com/sideway/joi) from 17.2.1 to 17.3.0.
- [Release notes](https://github.com/sideway/joi/releases)
- [Commits](https://github.com/sideway/joi/compare/v17.2.1...v17.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-01 18:23:03 +00:00
dependabot-preview[bot]
74d1014102 Build(deps-dev): bump react-error-overlay from 6.0.7 to 6.0.8 (#5787)
Bumps [react-error-overlay](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-error-overlay) from 6.0.7 to 6.0.8.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-error-overlay@6.0.8/packages/react-error-overlay)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-11-01 18:15:58 +00:00
dependabot-preview[bot]
015843741d Build(deps-dev): bump mocha from 7.2.0 to 8.2.0 (#5777)
Bumps [mocha](https://github.com/mochajs/mocha) from 7.2.0 to 8.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/v7.2.0...v8.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-01 12:05:40 -06:00
dependabot-preview[bot]
1319de64e7 Build(deps-dev): bump gatsby from 2.24.73 to 2.24.91 (#5784)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.24.73 to 2.24.91.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.24.73...gatsby@2.24.91)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 18:52:22 +00:00
dependabot-preview[bot]
d021b01d3c Build(deps): bump xmldom from 0.2.1 to 0.4.0 (#5788)
Bumps [xmldom](https://github.com/xmldom/xmldom) from 0.2.1 to 0.4.0.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.2.1...0.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 18:40:06 +00:00
dependabot-preview[bot]
2f348d731a Build(deps): bump ioredis from 4.17.3 to 4.19.1 (#5785)
Bumps [ioredis](https://github.com/luin/ioredis) from 4.17.3 to 4.19.1.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/master/Changelog.md)
- [Commits](https://github.com/luin/ioredis/compare/v4.17.3...v4.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 05:45:41 +00:00
dependabot-preview[bot]
04e7119437 Build(deps-dev): bump react-dom from 16.13.1 to 16.14.0 (#5781)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.13.1 to 16.14.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.14.0/packages/react-dom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 05:35:46 +00:00
dependabot-preview[bot]
8964bec622 Build(deps-dev): bump styled-components from 5.2.0 to 5.2.1 (#5780)
Bumps [styled-components](https://github.com/styled-components/styled-components) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/styled-components/styled-components/releases)
- [Changelog](https://github.com/styled-components/styled-components/blob/v5.2.1/CHANGELOG.md)
- [Commits](https://github.com/styled-components/styled-components/compare/v5.2.0...v5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-31 00:23:16 -05:00
dependabot-preview[bot]
ac9287bc98 Build(deps-dev): bump got from 11.7.0 to 11.8.0 (#5783)
Bumps [got](https://github.com/sindresorhus/got) from 11.7.0 to 11.8.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v11.7.0...v11.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 05:08:11 +00:00
Hubert Jagodziński
c6d97de22e [GithubCommitsSince GithubDownloads GithubRelease] GithubDownloads supports latest release by SemVer (#5756)
* Latest release by SemVer

* Tests covering altered behavior

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 04:59:31 +00:00
Vividh Chandna
79e7d2f7f2 [Docker] version badge: Add architecture param (#5772)
* [Docker] Support architecture query param in docker version badge

* [Docker] Add new unit test with architecture query param

* Run prettier

* [Docker] Add arch param in customizer example

* [Docker] version badge: Update test cases for arch param

* [Docker] Add arch param valid values

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 02:10:40 +00:00
dependabot-preview[bot]
2909feec6a Build(deps-dev): bump @types/node from 14.11.8 to 14.14.6 (#5782)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.11.8 to 14.14.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-31 01:55:19 +00:00
dependabot-preview[bot]
94458c4855 Build(deps-dev): bump sinon from 9.2.0 to 9.2.1 (#5778)
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-31 01:15:30 +00:00
dependabot-preview[bot]
d79b0ec46a Build(deps): bump xpath from 0.0.29 to 0.0.32 (#5768)
Bumps [xpath](https://github.com/goto100/xpath) from 0.0.29 to 0.0.32.
- [Release notes](https://github.com/goto100/xpath/releases)
- [Commits](https://github.com/goto100/xpath/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-26 19:27:21 -05:00
dependabot-preview[bot]
2104135a68 Build(deps-dev): bump nodemon from 2.0.5 to 2.0.6 (#5769)
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.5...v2.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 20:35:00 +00:00
dependabot-preview[bot]
c2d1a8cd6d Build(deps-dev): bump @types/chai from 4.2.12 to 4.2.14 (#5766)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.12 to 4.2.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 18:02:47 +00:00
dependabot-preview[bot]
84b7413524 Build(deps-dev): bump react from 16.13.1 to 16.14.0 (#5764)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.13.1 to 16.14.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.14.0/packages/react)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 17:49:27 +00:00
dependabot-preview[bot]
ef56865d11 Build(deps-dev): bump gatsby-plugin-typescript from 2.4.22 to 2.4.24 (#5762)
Bumps [gatsby-plugin-typescript](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-typescript) from 2.4.22 to 2.4.24.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-typescript/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-typescript@2.4.24/packages/gatsby-plugin-typescript)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 17:22:48 +00:00
dependabot-preview[bot]
3701780f20 Build(deps): bump simple-icons from 3.11.0 to 3.12.1 (#5761)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.11.0 to 3.12.1.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.11.0...3.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 16:43:11 +00:00
dependabot-preview[bot]
0927689f45 Build(deps-dev): bump ts-mocha from 7.0.0 to 8.0.0 (#5760)
Bumps [ts-mocha](https://github.com/piotrwitek/ts-mocha) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/piotrwitek/ts-mocha/releases)
- [Changelog](https://github.com/piotrwitek/ts-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/piotrwitek/ts-mocha/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 16:33:22 +00:00
dependabot-preview[bot]
2d92500961 Build(deps): bump @sentry/node from 5.26.0 to 5.27.1 (#5770)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.26.0 to 5.27.1.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.26.0...5.27.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 14:43:34 +00:00
dependabot-preview[bot]
40d7cc8ac6 Build(deps-dev): bump eslint-plugin-standard from 4.0.1 to 4.0.2 (#5771)
Bumps [eslint-plugin-standard](https://github.com/standard/eslint-plugin-standard) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/standard/eslint-plugin-standard/releases)
- [Commits](https://github.com/standard/eslint-plugin-standard/compare/v4.0.1...v4.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 12:45:29 +00:00
dependabot-preview[bot]
4121a57af3 Build(deps-dev): bump eslint-plugin-react from 7.21.4 to 7.21.5 (#5763)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.4 to 7.21.5.
- [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.21.4...v7.21.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-25 12:16:25 +00:00
dependabot-preview[bot]
37b0edcfbc Build(deps-dev): bump eslint-plugin-jsdoc from 30.6.5 to 30.7.3 (#5759)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.6.5 to 30.7.3.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.6.5...v30.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-25 11:59:53 +00:00
dependabot-preview[bot]
c69ed93a0b Build(deps): bump query-string from 6.13.2 to 6.13.6 (#5742)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.13.2 to 6.13.6.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.13.2...v6.13.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2020-10-21 20:49:53 -05:00
Paul Melnikow
f1a5dd9427 Align style prop of coalesceBadge() with internal makeBadge() (#5726)
This is an analogous change to #5719 for `’template’` and `’style’`. (See the top comment for more explanation.)
2020-10-20 19:16:38 -04:00
Joe Izzard
d60b90b860 [Wordpress] Theme & Plugin Last Updated badge (#5722)
* feat: added schema and API options for new badge

* fix: fixed platform test's for new schema and api options

* feat: added new badge for theme and plugin last updated

* test: added testing for new badge

* feat: added regex pattern for last update string

* fix: fixed mock test's that didn't match regex pattern

* refactor: changed to moment formatting

Changed to use the moment lib to validate and format last_update date strings from upstream API

* fix: fixed failing platform service tests

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2020-10-20 17:44:58 +00:00
Joe Izzard
7e7162156b [Wordpress] Added Theme Required WP Version Badge & refactor (#5717)
* feat: added wp required version badge for themes

Refactored to allow plugin and theme extensionType for WP Required Version. Also added required schema for themes, already present for plugins.

* test: added testing for the new badge

Added testing for the new theme badge

* refactor: convert static classes to static props

* fix: modules export

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-20 01:56:13 +00:00
dependabot-preview[bot]
47a9df7b1c Build(deps-dev): bump @babel/core from 7.11.6 to 7.12.3 (#5739)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.11.6 to 7.12.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.3/packages/babel-core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-20 00:09:57 +00:00
Bryan Kok
dd2223407f Refactor remaining [github] services (#5748) 2020-10-19 18:41:03 -05:00
dependabot-preview[bot]
77826cf257 Build(deps-dev): bump @babel/polyfill from 7.11.5 to 7.12.1 (#5738)
* Build(deps-dev): bump @babel/polyfill from 7.11.5 to 7.12.1

Bumps [@babel/polyfill](https://github.com/babel/babel/tree/HEAD/packages/babel-polyfill) from 7.11.5 to 7.12.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.1/packages/babel-polyfill)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* deps: fix anafanafo

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
2020-10-18 20:27:04 -05:00
dependabot-preview[bot]
de0a98c3a4 Build(deps-dev): bump gatsby-plugin-typescript from 2.4.16 to 2.4.22 (#5740)
Bumps [gatsby-plugin-typescript](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-typescript) from 2.4.16 to 2.4.22.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-typescript/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-typescript@2.4.22/packages/gatsby-plugin-typescript)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-19 00:33:38 +00:00
dependabot-preview[bot]
feeeda113a Build(deps-dev): bump nodemon from 2.0.4 to 2.0.5 (#5744)
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.4...v2.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 18:13:03 +00:00
dependabot-preview[bot]
f77fd65f57 Build(deps-dev): bump eslint-plugin-import from 2.22.0 to 2.22.1 (#5736)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.22.0 to 2.22.1.
- [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.22.0...v2.22.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 17:25:41 +00:00
dependabot-preview[bot]
7ad2410de2 Build(deps): bump @sentry/node from 5.25.0 to 5.26.0 (#5737)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.25.0 to 5.26.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.25.0...5.26.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 17:16:28 +00:00
dependabot-preview[bot]
36600fee1f Build(deps-dev): bump @babel/register from 7.11.5 to 7.12.1 (#5735)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.11.5 to 7.12.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.1/packages/babel-register)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 17:08:09 +00:00
dependabot-preview[bot]
11a2084a65 Build(deps-dev): bump gatsby-plugin-page-creator from 2.3.32 to 2.3.33 (#5732)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-page-creator) from 2.3.32 to 2.3.33.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.3.33/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 17:00:05 +00:00
JeongHoon Byun (a.k.a Outsider)
0737e317da Add [GitHubSponsors] badge (#5694)
* Add GitHub Sponsors badge

Signed-off-by: Outsider <outsideris@gmail.com>

* rollback custom github sponsors logo

Signed-off-by: Outsider <outsideris@gmail.com>

* remove redirect for github sponsors

Signed-off-by: Outsider <outsideris@gmail.com>

* Update services/github/github-sponsors.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* fix indentation as prettier

Signed-off-by: Outsider <outsideris@gmail.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 16:15:00 +00:00
dependabot-preview[bot]
800b61ab46 Build(deps): bump anafanafo from 2.0.0-beta.1 to 2.0.0 in /badge-maker (#5746)
Bumps [anafanafo](https://github.com/metabolize/anafanafo) from 2.0.0-beta.1 to 2.0.0.
- [Release notes](https://github.com/metabolize/anafanafo/releases)
- [Commits](https://github.com/metabolize/anafanafo/compare/anafanafo@2.0.0-beta.1...anafanafo@2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 16:07:01 +00:00
dependabot-preview[bot]
6dbf8d009a Build(deps-dev): bump lint-staged from 10.4.0 to 10.4.2 (#5733)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.4.0 to 10.4.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.4.0...v10.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 14:38:01 +00:00
Hubert Jagodziński
7a19dc40ef Add [GithubDirectoryFileCount] badge (#5705)
* Added GithubDirectoryFileCount badge

* Additional information on a schema

* Update services/github/github-directory-file-count.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Update services/github/github-directory-file-count.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Update services/github/github-directory-file-count.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* More examples

* Moved isArray check to transform method

* Using isMetric for validation

* Added documentaion on type and extension parameters

* Moved a couple of service tests to unit tests

* extension is applicable for type file only

* Note on GitHub API limit

* Using metric helper for a count formatting

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 14:30:15 +00:00
dependabot-preview[bot]
10ddd866da Build(deps-dev): bump eslint-config-prettier from 6.12.0 to 6.13.0 (#5745)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.12.0 to 6.13.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.12.0...v6.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 10:05:35 +00:00
dependabot-preview[bot]
e786d69dbe Build(deps-dev): bump eslint-plugin-jsdoc from 30.6.4 to 30.6.5 (#5734)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.6.4 to 30.6.5.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.6.4...v30.6.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-18 09:32:08 +00:00
Hubert Jagodziński
e236c9a15c Added [GithubRPackageVersion] badge (#5708)
* Added GithubRPackageVersion badge

* Minor changes to GithubGoModGoVersion badge

* More examples

* Removed mocking with nock from service tests

* Added unit tests

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-18 01:31:57 +00:00
Joe Izzard
a1c50ea4d5 [Wordpress] Plugin & Theme required php (#5723)
* feat: added schema and api options

* feat: added new badge for required php version

* test: fixed existing testing and added new for new badge

Fixed existing testing to conform to new api options and schema. Also added testing for the new badge

* fix: changed to mocked test

Changed the Theme Not Set test to a mock as unable to find a live example (previously used 'generatepress' however this now has the data). Also split out query selector fields to allow updating in one place for themes and plugins

* fix: changed the style of the badge to better show the info

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-17 18:31:58 +00:00
Marcin Mielnicki
6822922ad2 getSimpleIcon handles 'get' icon (#5730) 2020-10-17 19:23:39 +02:00
Paul Melnikow
4415d07e8b A few straight refactors in badge-renderers (#5716)
These are aimed at improving readability and a bit of DRY.
2020-10-17 11:27:09 -04:00
CRIMX
668ea878d9 Add back [ChromeWebStore] rating (#5697)
* Add back Chrome Web Store rating

Replace chrome-web-store-item-property with webextension-store-meta.

fix #5475

* perf: imporve parsing performance of webextension-store-meta

* perf: improve chrome-web-store start-up speeding

* refactor: remove getters

Co-authored-by: Pierre-Yves B <PyvesDev@gmail.com>
2020-10-17 13:26:40 +02:00
Sam Donald
21c15e4029 Specify logoColor does not work with logoSvg (#5727)
If your endpoint uses the `logoSvg` you can _not_ specify the `logoColor` property. This will result in the 'invalid properties: logoColor' badge.

Related to #4749
2020-10-16 21:59:51 -05:00
Paul Melnikow
1184938ed1 Align label and message props of coalesceBadge() with internal makeBadge() (#5719)
There is an internal `makeBadge()` function which is called from a few places in the server and from the public `makeBadge()` function which is a light wrapper. (Eventually we want to dogfood the public API: that's the work of #4950, and this helps with it by aligning the interfaces.)

Related to that is #3370, which is about aligning the `serviceData` schema (i.e. the result of `handle()`) with the public `makeBadge()` function.

A legacy quirk of the _private_ `makeBadge()` function is accepting a `text: ['label', 'message']` array instead of separate `{ label, message }` props like the rest of the codebase. `coalesceBadge()` has to translate from `{ label, message }` to `text: ['label', message']`. This removes that bit of indirection.

It also rewrites most of the tests of `coalesceBadge()` to use `.includes()`, providing IMO a slight improvement in readability.
2020-10-16 18:06:32 -04:00
Paul Melnikow
e1bd1602a6 Fail in CI when package tests fail (#5718)
* Fail in CI when package tests fail

Fixes #5713

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2020-10-16 21:24:23 +01:00
Paul Melnikow
aa5addb442 Change [issuestats] redirector from format to pattern (#5720)
* Change [issuestats] redirector from format to pattern

Ref #3329

* Match other services where this approach was taken
2020-10-16 20:11:17 +00:00
Joe Izzard
374bf4aafa [Wordpress] Convert static classes to props (#5725)
* refactor: downloads

* refactor: ratings

* refactor: versions

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-16 19:44:59 +00:00
Paul Melnikow
43f7adbe64 Use our typical casing for [nodeping] label (#5715)
* Use our typical casing for [nodeping] label

* Fix test + reformat
2020-10-16 00:17:19 +00:00
Paul Melnikow
af3f720113 Improve appearance of for-the-badge and social badges by measuring correct font (#5696)
Even before #2311, Shields has measured all badge text using 11px Verdana, which is the correct font for plastic, flat, and flat-square.

However the for-the-badge style uses 10px Verdana and bold 10px Verdana, and the social badge uses bold 11px _Helvetica_. This causes these badges to be wider or narrower than they should be, and the text to be stretched accordingly.

Since the for-the-badge style relies on synthetic letter spacing (we just multiply the computed length in code) there is room to massage this further. Our test badges all look as good or better than before, so I think it should not block merging this, however we might need to get it right before the downstream problem in squint goes away. (There's also #4691 which this doesn't attempt to address.)

Fixes #4275
2020-10-15 20:06:46 -04:00
Dominik Grzelak
d1ec834cb5 [Github] Handle the case when the Github deployment status returns null (#5704)
* Handle the case when the Github deployment status returns null

* Integration test null latestStatus response from Github Deployments

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-15 23:51:31 +00:00
Paul Melnikow
cd70bf5246 Prettify the SVG snapshots (and a couple cleanups) (#5714)
I’m running into some strange issues working on badge-maker in #5696, where the images look good but the snapshots have changed in unexpected ways. I’m finding them a little tricky to debug.

This saves the prettified snapshots instead, which I think will make them easier to compare and debug. They may have to be updated when we upgrade prettier.

I also inlined a few things in the test file.
2020-10-15 19:40:14 -04:00
Paul Melnikow
cbd8eba2c4 Fix REQUIRE_CLOUDFLARE for Heroku (#5712)
Ref #3027
2020-10-15 19:27:07 -04:00
chris48s
a4a8258fd5 unskip token integration test (#5711)
* unskip token integration test

* Update services/github/github-api-provider.integration.js

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
2020-10-15 21:44:07 +00:00
Marcin Mielnicki
e03549d88d fix: TypeError in [DockerVersion] badge (#5707)
* fix: TypeError in DockerVersion badge

* A reference to the issue in test

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>

Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
2020-10-15 22:02:04 +02:00
Marcin Mielnicki
1aa25ab321 Add a deployment status using GitHub Actions (#5709) 2020-10-15 21:52:40 +02:00
Hubert Jagodziński
b9d5da66fd Update service-tests.md (#5706)
* Update service-tests.md

Added information `expectBadge()` accepts a RegExp.

* Run prettier
2020-10-15 19:19:46 +00:00
Caleb Cartwright
740947ba06 tests: fix PackagistVersion service test (#5703) 2020-10-14 22:03:36 +00:00
Caleb Cartwright
3576fbd7b8 test(aur): use unit tests for outdated (#5700) 2020-10-13 18:40:23 -05:00
Paul Melnikow
1fab1a7140 When configured, require requests to come from Cloudflare (#5666)
This is the code part of #3027, following [this article](https://www.viget.com/articles/heroku-cloudflare-the-right-way/) and using [this middleware](https://github.com/clive-io/cloudflare-middleware).

I pulled in the `addHandlerAtIndex()` function @chris48s wrote for #5574.

The middleware isn't perfect for scoutcamp, since it relies on `req.ip` which is something set by Express. However, the other solutions I found were either explicitly deprecated ([cloudflare-ip](https://www.npmjs.com/package/cloudflare-ip)) or relied on dynamically fetching the list of Cloudflare hosts ([cloudflare-ips](https://www.npmjs.com/package/cloudflare-ips)), which seems unnecessary as this list has not changed in several years.

I've left this off to start, so we can test it in production using an env var before we make it the production default.
2020-10-12 12:36:42 -04:00
dependabot-preview[bot]
4da15aafc1 Build(deps-dev): bump danger from 10.4.1 to 10.5.0 (#5693)
Bumps [danger](https://github.com/danger/danger-js) from 10.4.1 to 10.5.0.
- [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/10.4.1...10.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-12 11:34:29 +00:00
dependabot-preview[bot]
a0008ba7d1 Build(deps): bump moment from 2.29.0 to 2.29.1 (#5685)
Bumps [moment](https://github.com/moment/moment) from 2.29.0 to 2.29.1.
- [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.29.0...2.29.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 20:10:41 +00:00
dependabot-preview[bot]
ace467246d Build(deps): bump camelcase from 5.3.1 to 6.1.0 (#5687)
Bumps [camelcase](https://github.com/sindresorhus/camelcase) from 5.3.1 to 6.1.0.
- [Release notes](https://github.com/sindresorhus/camelcase/releases)
- [Commits](https://github.com/sindresorhus/camelcase/compare/v5.3.1...v6.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 20:01:23 +00:00
dependabot-preview[bot]
1d2d92b968 Build(deps-dev): bump @types/react-select from 3.0.21 to 3.0.22 (#5690)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.21 to 3.0.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 17:09:19 +00:00
dependabot-preview[bot]
1a5eb7376f Build(deps-dev): bump @types/node from 14.11.2 to 14.11.8 (#5682)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.11.2 to 14.11.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 17:02:16 +00:00
chris48s
57ae9cdb6b loosen [visualstudiomarketplace] input schema (#5638)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 16:53:25 +00:00
dependabot-preview[bot]
d1808c8d26 Build(deps-dev): bump gatsby-plugin-page-creator from 2.3.30 to 2.3.32 (#5683)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-page-creator) from 2.3.30 to 2.3.32.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.3.32/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 16:37:48 +00:00
dependabot-preview[bot]
681d2c0505 Build(deps-dev): bump gatsby from 2.24.65 to 2.24.73 (#5688)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.24.65 to 2.24.73.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.24.65...gatsby@2.24.73)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 16:23:56 +00:00
dependabot-preview[bot]
19e6f18d9b Build(deps): bump @sentry/node from 5.24.2 to 5.25.0 (#5681)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 5.24.2 to 5.25.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.24.2...5.25.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 16:13:15 +00:00
dependabot-preview[bot]
498f57d960 Build(deps): bump simple-icons from 3.10.0 to 3.11.0 (#5680)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/3.10.0...3.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 16:05:39 +00:00
dependabot-preview[bot]
c134d4914d Build(deps-dev): bump sinon from 9.1.0 to 9.2.0 (#5692)
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.1.0 to 9.2.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.1.0...v9.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 08:23:12 +00:00
dependabot-preview[bot]
5d8adbe54f Build(deps-dev): bump eslint-plugin-jsdoc from 30.6.3 to 30.6.4 (#5691)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 30.6.3 to 30.6.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v30.6.3...v30.6.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-10-11 08:14:17 +00:00
dependabot-preview[bot]
7c0f211e0b Build(deps-dev): bump eslint-plugin-react from 7.21.3 to 7.21.4 (#5689)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.3 to 7.21.4.
- [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.21.3...v7.21.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-11 08:02:04 +00:00
Paul Melnikow
564a9145e9 Remove FsTokenPersistence (#5671)
Closes #5665
2020-10-10 21:59:52 +00:00
JeongHoon Byun (a.k.a Outsider)
dc32a5fc4b Fix wrong anchor for writing tests document (#5677) 2020-10-10 05:14:52 +00:00
Paul Melnikow
3b1aaf3137 Move chai-as-promised from prod to dev dependencies (#5674) 2020-10-08 17:39:55 -04:00
Paul Melnikow
e1ac63d3be Finish removing server-secrets.js (#5664)
I’ve tested locally that setting `gh_token` still conditionally enables `ConditionalGithubAuthV3Service`.

Closes #3393
2020-10-07 17:29:03 -04:00
Paul Melnikow
3a23695f89 Update Danger rule for joi (#5667)
Follow-on to #5624
2020-10-06 20:48:03 -04:00
243 changed files with 13337 additions and 9844 deletions

View File

@@ -86,33 +86,6 @@ services_steps: &services_steps
- store_test_results:
path: junit
run_package_tests: &run_package_tests
when: always
command: |
# https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/3
set +e
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install $NODE_VERSION
nvm use $NODE_VERSION
node --version
# install the shields.io dependencies
npm ci
# run the package tests
npm run test:package
npm run check-types:package
# delete the sheilds.io dependencies
rm -rf node_modules/
# run a smoke test (render a badge with the CLI)
# with only the package dependencies installed
cd badge-maker
npm link
badge cactus grown :green @flat
package_steps: &package_steps
steps:
- checkout
@@ -132,31 +105,31 @@ package_steps: &package_steps
# https://nodejs.org/en/about/releases/
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/badge-maker/v10/results.xml
NODE_VERSION: v10
CYPRESS_INSTALL_BINARY: 0
name: Run package tests on Node 10
command: scripts/run_package_tests.sh
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/badge-maker/v12/results.xml
NODE_VERSION: v12
CYPRESS_INSTALL_BINARY: 0
name: Run package tests on Node 12
command: scripts/run_package_tests.sh
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/badge-maker/v14/results.xml
NODE_VERSION: v14
CYPRESS_INSTALL_BINARY: 0
name: Run package tests on Node 14
command: scripts/run_package_tests.sh
- store_test_results:
path: junit

View File

@@ -1,5 +1,6 @@
extends:
- standard
- standard-jsx
- standard-react
- plugin:@typescript-eslint/recommended
- prettier

10
.github/probot.js vendored
View File

@@ -1,10 +0,0 @@
on('pull_request.closed')
.filter(context => context.payload.pull_request.merged)
.filter(
context =>
context.payload.pull_request.head.ref.slice(0, 11) !== 'dependabot/'
)
.filter(context => context.payload.pull_request.base.ref === 'master')
.comment(`This pull request was merged to [{{ pull_request.base.ref }}]({{ repository.html_url }}/tree/{{ pull_request.base.ref }}) branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our \`#ops\` channel on [Discord](https://discordapp.com/invite/HjJCwm5)!
After deployment, changes are copied to [gh-pages]({{ repository.html_url }}/tree/gh-pages) branch: ![](https://img.shields.io/github/commit-status/{{ repository.full_name }}/gh-pages/{{ pull_request.merge_commit_sha }}.svg?label=deploy%20status)`)

View File

@@ -5,6 +5,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: chris48s/approve-bot@2.0.1
- uses: chris48s/approve-bot@2.0.2
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

26
.github/workflows/deploy-docs.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Deploy Documentation
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- name: Build
run: |
npm ci
npm run build-docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: api-docs
CLEAN: true

31
.github/workflows/tag-release.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Tag Release
on:
pull_request:
types: [closed]
jobs:
tag-release:
if: |
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date --rfc-3339=date)"
- name: Checkout branch "master"
uses: actions/checkout@v2
with:
ref: 'master'
- name: Tag Release
uses: tvdias/github-tagger@v0.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: server-${{ steps.date.outputs.date }}

9
CHANGELOG.md Normal file
View File

@@ -0,0 +1,9 @@
# Changelog
Note: this changelog is for the shields.io server. The changelog for the badge-maker NPM package is at https://github.com/badges/shields/blob/master/badge-maker/CHANGELOG.md
---
## server-2021-01-18
- Gotta start somewhere

View File

@@ -1,70 +0,0 @@
SHELL:=/bin/bash
SERVER_TMP=${TMPDIR}shields-server-deploy
FRONTEND_TMP=${TMPDIR}shields-frontend-deploy
# This branch is reserved for the deploy process and should not be used for
# development. The deploy script will clobber it. To avoid accidentally
# pushing secrets to GitHub, this branch is configured to reject pushes.
WORKING_BRANCH=server-deploy-working-branch
all: test
deploy: deploy-s0 deploy-s1 deploy-s2 clean-server-deploy deploy-gh-pages deploy-gh-pages-clean
deploy-s0: prepare-server-deploy push-s0
deploy-s1: prepare-server-deploy push-s1
deploy-s2: prepare-server-deploy push-s2
prepare-server-deploy:
# Ship a copy of the front end to each server for debugging.
# https://github.com/badges/shields/issues/1220
INCLUDE_DEV_PAGES=false \
npm run build
rm -rf ${SERVER_TMP}
git worktree prune
git worktree add -B ${WORKING_BRANCH} ${SERVER_TMP}
cp -r public ${SERVER_TMP}
git -C ${SERVER_TMP} add -f public/
git -C ${SERVER_TMP} commit --no-verify -m '[DEPLOY] Add frontend for debugging'
cp config/local-shields-io-production.yml ${SERVER_TMP}/config/
git -C ${SERVER_TMP} add -f config/local-shields-io-production.yml
git -C ${SERVER_TMP} commit --no-verify -m '[DEPLOY] MUST NOT BE ON GITHUB'
clean-server-deploy:
rm -rf ${SERVER_TMP}
git worktree prune
push-s0:
git push -f s0 ${WORKING_BRANCH}:master
push-s1:
git push -f s1 ${WORKING_BRANCH}:master
push-s2:
git push -f s2 ${WORKING_BRANCH}:master
deploy-gh-pages:
rm -rf ${FRONTEND_TMP}
git worktree prune
GATSBY_BASE_URL=https://img.shields.io \
INCLUDE_DEV_PAGES=false \
npm run build
git worktree add -B gh-pages ${FRONTEND_TMP}
git -C ${FRONTEND_TMP} ls-files | xargs git -C ${FRONTEND_TMP} rm
git -C ${FRONTEND_TMP} commit --no-verify -m '[DEPLOY] Completely clean the index'
cp -r public/* ${FRONTEND_TMP}
echo shields.io > ${FRONTEND_TMP}/CNAME
touch ${FRONTEND_TMP}/.nojekyll
git -C ${FRONTEND_TMP} add .
git -C ${FRONTEND_TMP} commit --no-verify -m '[DEPLOY] Add built site'
git push -f origin gh-pages
deploy-gh-pages-clean:
rm -rf ${FRONTEND_TMP}
git worktree prune
test:
npm test
.PHONY: all deploy prepare-server-deploy clean-server-deploy deploy-s0 deploy-s1 deploy-s2 push-s0 push-s1 push-s2 deploy-gh-pages deploy-gh-pages-clean deploy-heroku setup redis test

View File

@@ -1,5 +1,5 @@
<p align="center">
<img src="https://raw.githubusercontent.com/badges/shields/master/frontend/images/logo.svg?sanitize=true"
<img src="https://raw.githubusercontent.com/badges/shields/master/readme-logo.svg?sanitize=true"
height="130">
</p>
<p align="center">
@@ -22,9 +22,6 @@
<a href="https://lgtm.com/projects/g/badges/shields/alerts/">
<img src="https://img.shields.io/lgtm/alerts/g/badges/shields"
alt="Total alerts"/></a>
<a href="https://github.com/badges/shields/compare/gh-pages...master">
<img src="https://img.shields.io/github/commits-since/badges/shields/gh-pages?label=commits%20to%20be%20deployed"
alt="commits to be deployed"></a>
<a href="https://discord.gg/HjJCwm5">
<img src="https://img.shields.io/discord/308323056592486420?logo=discord"
alt="chat on Discord"></a>
@@ -91,10 +88,6 @@ maybe you'd like to open a pull request to address one of them.
You can read a [tutorial on how to add a badge][tutorial].
[![GitHub issues by-label](https://img.shields.io/github/issues/badges/shields/good%20first%20issue)](https://github.com/badges/shields/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
[![Hacktoberfest 2020](https://img.shields.io/github/hacktoberfest/2020/badges/shields?label=hacktoberfest%202020)](https://github.com/badges/shields/issues?q=is%3Aopen+is%3Aissue+label%3Ahacktoberfest)
Let's see if we can beat last year!
[![Hacktoberfest 2019](https://img.shields.io/github/hacktoberfest/2019/badges/shields?label=hacktoberfest%202019)](https://github.com/badges/shields/issues?q=is%3Aopen+is%3Aissue+label%3Ahacktoberfest)
[service-tests]: https://github.com/badges/shields/blob/master/doc/service-tests.md
[tutorial]: doc/TUTORIAL.md

File diff suppressed because it is too large Load Diff

View File

@@ -14,14 +14,9 @@ function capitalize(s) {
function colorsForBackground(color) {
if (brightness(color) <= brightnessThreshold) {
return {
textColor: '#fff',
shadowColor: '#010101',
}
}
return {
textColor: '#333',
shadowColor: '#ccc',
return { textColor: '#fff', shadowColor: '#010101' }
} else {
return { textColor: '#333', shadowColor: '#ccc' }
}
}
@@ -39,19 +34,12 @@ function escapeXml(s) {
}
function roundUpToOdd(val) {
// Increase chances of pixel grid alignment.
return val % 2 === 0 ? val + 1 : val
}
function preferredWidthOf(str) {
return roundUpToOdd((anafanafo(str) / 10) | 0)
}
function computeWidths({ label, message }) {
return {
labelWidth: preferredWidthOf(label),
messageWidth: preferredWidthOf(message),
}
function preferredWidthOf(str, options) {
// Increase chances of pixel grid alignment.
return roundUpToOdd(anafanafo(str, options) | 0)
}
function createAccessibleText({ label, message }) {
@@ -89,22 +77,19 @@ function renderLogo({
logoWidth = 14,
logoPadding = 0,
}) {
if (!logo) {
if (logo) {
const logoHeight = 14
const y = (badgeHeight - logoHeight) / 2
const x = horizPadding
return {
hasLogo: false,
totalLogoWidth: 0,
renderedLogo: '',
hasLogo: true,
totalLogoWidth: logoWidth + logoPadding,
renderedLogo: `<image x="${x}" y="${y}" width="${logoWidth}" height="${logoHeight}" xlink:href="${escapeXml(
logo
)}"/>`,
}
}
const logoHeight = 14
const y = (badgeHeight - logoHeight) / 2
const x = horizPadding
return {
hasLogo: true,
totalLogoWidth: logoWidth + logoPadding,
renderedLogo: `<image x="${x}" y="${y}" width="${logoWidth}" height="14" xlink:href="${escapeXml(
logo
)}"/>`,
} else {
return { hasLogo: false, totalLogoWidth: 0, renderedLogo: '' }
}
}
@@ -139,7 +124,7 @@ function renderText({
return { renderedText: '', width: 0 }
}
const textLength = preferredWidthOf(content)
const textLength = preferredWidthOf(content, { font: '11px Verdana' })
const escapedContent = escapeXml(content)
const shadowMargin = 150 + verticalMargin
@@ -191,10 +176,6 @@ function renderBadge(
</svg>`
}
function stripXmlWhitespace(xml) {
return xml.replace(/>\s+/g, '>').replace(/<\s+/g, '<').trim()
}
class Badge {
static get fontFamily() {
throw new Error('Not implemented')
@@ -301,6 +282,10 @@ class Badge {
this.renderedMessage = renderedMessage
}
static render(params) {
return new this(params).render()
}
render() {
throw new Error('Not implemented')
}
@@ -451,30 +436,6 @@ class FlatSquare extends Badge {
}
}
function plastic(params) {
const badge = new Plastic(params)
if (params.minify) {
return stripXmlWhitespace(badge.render())
}
return badge.render()
}
function flat(params) {
const badge = new Flat(params)
if (params.minify) {
return stripXmlWhitespace(badge.render())
}
return badge.render()
}
function flatSquare(params) {
const badge = new FlatSquare(params)
if (params.minify) {
return stripXmlWhitespace(badge.render())
}
return badge.render()
}
function social({
label,
message,
@@ -484,7 +445,6 @@ function social({
logoPadding,
color = '#4c1',
labelColor = '#555',
minify,
}) {
// Social label is styled with a leading capital. Convert to caps here so
// width can be measured using the correct characters.
@@ -492,24 +452,23 @@ function social({
const externalHeight = 20
const internalHeight = 19
const horizPadding = 5
const labelHorizPadding = 5
const messageHorizPadding = 4
const horizGutter = 6
const { totalLogoWidth, renderedLogo } = renderLogo({
logo,
badgeHeight: externalHeight,
horizPadding,
horizPadding: labelHorizPadding,
logoWidth,
logoPadding,
})
const hasMessage = message.length
let { labelWidth, messageWidth } = computeWidths({ label, message })
labelWidth += 10 + totalLogoWidth
messageWidth += 10
messageWidth -= 4
const labelTextX = ((labelWidth + totalLogoWidth) / 2) * 10
const labelTextLength = (labelWidth - (10 + totalLogoWidth)) * 10
const escapedLabel = escapeXml(label)
const font = 'bold 11px Helvetica'
const labelTextWidth = preferredWidthOf(label, { font })
const messageTextWidth = preferredWidthOf(message, { font })
const labelRectWidth = labelTextWidth + totalLogoWidth + 2 * labelHorizPadding
const messageRectWidth = messageTextWidth + 2 * messageHorizPadding
let [leftLink, rightLink] = links
leftLink = escapeXml(leftLink)
@@ -519,29 +478,35 @@ function social({
const accessibleText = createAccessibleText({ label, message })
function renderMessageBubble() {
const messageBubbleMainX = labelWidth + 6.5
const messageBubbleNotchX = labelWidth + 6
const messageBubbleMainX = labelRectWidth + horizGutter + 0.5
const messageBubbleNotchX = labelRectWidth + horizGutter
return `
<rect x="${messageBubbleMainX}" y="0.5" width="${messageWidth}" height="${internalHeight}" rx="2" fill="#fafafa"/>
<rect x="${messageBubbleMainX}" y="0.5" width="${messageRectWidth}" height="${internalHeight}" rx="2" fill="#fafafa"/>
<rect x="${messageBubbleNotchX}" y="7.5" width="0.5" height="5" stroke="#fafafa"/>
<path d="M${messageBubbleMainX} 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/>
`
}
function renderLabelText() {
const rect = `<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="${labelWidth}" height="${internalHeight}" rx="2" />`
const labelTextX =
10 * (totalLogoWidth + labelTextWidth / 2 + labelHorizPadding)
const labelTextLength = 10 * labelTextWidth
const escapedLabel = escapeXml(label)
const shouldWrapWithLink = hasLeftLink && !shouldWrapBodyWithLink({ links })
const rect = `<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="${labelRectWidth}" height="${internalHeight}" rx="2" />`
const shadow = `<text aria-hidden="true" x="${labelTextX}" y="150" fill="#fff" transform="scale(.1)" textLength="${labelTextLength}">${escapedLabel}</text>`
const text = `<text x="${labelTextX}" y="140" transform="scale(.1)" textLength="${labelTextLength}">${escapedLabel}</text>`
if (hasLeftLink && !shouldWrapBodyWithLink({ links })) {
return `
return shouldWrapWithLink
? `
<a target="_blank" xlink:href="${leftLink}">
${shadow}
${text}
${rect}
</a>
`
}
return `
: `
${rect}
${shadow}
${text}
@@ -549,34 +514,36 @@ function social({
}
function renderMessageText() {
const messageTextX = (labelWidth + messageWidth / 2 + 6) * 10
const messageTextLength = (messageWidth - 8) * 10
const messageTextX =
10 * (labelRectWidth + horizGutter + messageRectWidth / 2)
const messageTextLength = 10 * messageTextWidth
const escapedMessage = escapeXml(message)
const rect = `<rect width="${messageWidth + 1}" x="${
labelWidth + 6
const rect = `<rect width="${messageRectWidth + 1}" x="${
labelRectWidth + horizGutter
}" height="${internalHeight + 1}" fill="rgba(0,0,0,0)" />`
const shadow = `<text aria-hidden="true" x="${messageTextX}" y="150" fill="#fff" transform="scale(.1)" textLength="${messageTextLength}">${escapedMessage}</text>`
const text = `<text id="rlink" x="${messageTextX}" y="140" transform="scale(.1)" textLength="${messageTextLength}">${escapedMessage}</text>`
if (hasRightLink) {
return `
return hasRightLink
? `
<a target="_blank" xlink:href="${rightLink}">
${rect}
${shadow}
${text}
</a>
`
}
return `
: `
${shadow}
${text}
`
}
const badge = renderBadge(
return renderBadge(
{
links,
leftWidth: labelWidth + 1,
rightWidth: hasMessage ? messageWidth + 6 : 0,
leftWidth: labelRectWidth + 1,
rightWidth: hasMessage ? horizGutter + messageRectWidth : 0,
accessibleText,
height: externalHeight,
},
@@ -591,7 +558,7 @@ function social({
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<g stroke="#d5d5d5">
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="${labelWidth}" height="${internalHeight}" rx="2"/>
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="${labelRectWidth}" height="${internalHeight}" rx="2"/>
${hasMessage ? renderMessageBubble() : ''}
</g>
${renderedLogo}
@@ -601,11 +568,6 @@ function social({
</g>
`
)
if (minify) {
return stripXmlWhitespace(badge)
}
return badge
}
function forTheBadge({
@@ -617,14 +579,15 @@ function forTheBadge({
logoPadding,
color = '#4c1',
labelColor,
minify,
}) {
// For the Badge is styled in all caps. Convert to caps here so widths can
// be measured using the correct characters.
label = label.toUpperCase()
message = message.toUpperCase()
let { labelWidth, messageWidth } = computeWidths({ label, message })
let labelWidth = preferredWidthOf(label, { font: '10px Verdana' }) || 0
let messageWidth =
preferredWidthOf(message, { font: 'bold 10px Verdana' }) || 0
const height = 28
const hasLabel = label.length || labelColor
if (labelColor == null) {
@@ -641,7 +604,9 @@ function forTheBadge({
labelWidth += 10 + totalLogoWidth
if (label.length) {
labelWidth += 10 + label.length * 1.5
// Add 10 px of padding, plus approximately 1 px of letter spacing per
// character.
labelWidth += 10 + 2 * label.length
} else if (hasLogo) {
if (hasLabel) {
labelWidth += 7
@@ -652,8 +617,9 @@ function forTheBadge({
labelWidth -= 11
}
messageWidth += 10
messageWidth += 10 + message.length * 2
// Add 20 px of padding, plus approximately 1.5 px of letter spacing per
// character.
messageWidth += 20 + 1.5 * message.length
const leftWidth = hasLogo && !hasLabel ? 0 : labelWidth
const rightWidth =
hasLogo && !hasLabel ? messageWidth + labelWidth : messageWidth
@@ -675,7 +641,9 @@ function forTheBadge({
const labelTextX = ((labelWidth + totalLogoWidth) / 2) * 10
const labelTextLength = (labelWidth - (24 + totalLogoWidth)) * 10
const escapedLabel = escapeXml(label)
const text = `<text fill="${textColor}" x="${labelTextX}" y="175" transform="scale(.1)" textLength="${labelTextLength}">${escapedLabel}</text>`
if (hasLeftLink && !shouldWrapBodyWithLink({ links })) {
return `
<a target="_blank" xlink:href="${leftLink}">
@@ -683,18 +651,21 @@ function forTheBadge({
${text}
</a>
`
} else {
return text
}
return text
}
function renderMessageText() {
const { textColor } = colorsForBackground(color)
const text = `<text fill="${textColor}" x="${
(labelWidth + messageWidth / 2) * 10
}" y="175" font-weight="bold" transform="scale(.1)" textLength="${
(messageWidth - 24) * 10
}">
${escapeXml(message)}</text>`
if (hasRightLink) {
return `
<a target="_blank" xlink:href="${rightLink}">
@@ -702,11 +673,12 @@ function forTheBadge({
${text}
</a>
`
} else {
return text
}
return text
}
const badge = renderBadge(
return renderBadge(
{
links,
leftWidth,
@@ -725,17 +697,12 @@ function forTheBadge({
${renderMessageText()}
</g>`
)
if (minify) {
return stripXmlWhitespace(badge)
}
return badge
}
module.exports = {
plastic,
flat,
plastic: params => Plastic.render(params),
flat: params => Flat.render(params),
'flat-square': params => FlatSquare.render(params),
social,
'flat-square': flatSquare,
'for-the-badge': forTheBadge,
}

View File

@@ -51,14 +51,8 @@ function _clean(format) {
}
})
// convert "public" format to "internal" format
cleaned.text = [cleaned.label || '', cleaned.message]
delete cleaned.label
delete cleaned.message
if ('style' in cleaned) {
cleaned.template = cleaned.style
delete cleaned.style
}
// Legacy.
cleaned.label = cleaned.label || ''
return cleaned
}

View File

@@ -3,14 +3,19 @@
const { normalizeColor, toSvgColor } = require('./color')
const badgeRenderers = require('./badge-renderers')
function stripXmlWhitespace(xml) {
return xml.replace(/>\s+/g, '>').replace(/<\s+/g, '<').trim()
}
/*
note: makeBadge() is fairly thinly wrapped so if we are making changes here
it is likely this will impact on the package's public interface in index.js
*/
module.exports = function makeBadge({
format,
template = 'flat',
text,
style = 'flat',
label,
message,
color,
labelColor,
logo,
@@ -19,9 +24,8 @@ module.exports = function makeBadge({
links = ['', ''],
}) {
// String coercion and whitespace removal.
text = text.map(value => `${value}`.trim())
const [label, message] = text
label = `${label}`.trim()
message = `${message}`.trim()
// This ought to be the responsibility of the server, not `makeBadge`.
if (format === 'json') {
@@ -39,23 +43,24 @@ module.exports = function makeBadge({
})
}
const render = badgeRenderers[template]
const render = badgeRenderers[style]
if (!render) {
throw new Error(`Unknown template: '${template}'`)
throw new Error(`Unknown badge style: '${style}'`)
}
logoWidth = +logoWidth || (logo ? 14 : 0)
return render({
label,
message,
links,
logo,
logoPosition,
logoWidth,
logoPadding: logo && label.length ? 3 : 0,
color: toSvgColor(color),
labelColor: toSvgColor(labelColor),
minify: true,
})
return stripXmlWhitespace(
render({
label,
message,
links,
logo,
logoPosition,
logoWidth,
logoPadding: logo && label.length ? 3 : 0,
color: toSvgColor(color),
labelColor: toSvgColor(labelColor),
})
)
}

View File

@@ -4,12 +4,18 @@ const { test, given, forCases } = require('sazerac')
const { expect } = require('chai')
const snapshot = require('snap-shot-it')
const isSvg = require('is-svg')
const prettier = require('prettier')
const makeBadge = require('./make-badge')
function expectBadgeToMatchSnapshot(format) {
snapshot(prettier.format(makeBadge(format), { parser: 'html' }))
}
function testColor(color = '', colorAttr = 'color') {
return JSON.parse(
makeBadge({
text: ['name', 'Bob'],
label: 'name',
message: 'Bob',
[colorAttr]: color,
format: 'json',
})
@@ -75,23 +81,26 @@ describe('The badge generator', function () {
describe('SVG', function () {
it('should produce SVG', function () {
const svg = makeBadge({ text: ['cactus', 'grown'], format: 'svg' })
expect(svg)
expect(makeBadge({ label: 'cactus', message: 'grown', format: 'svg' }))
.to.satisfy(isSvg)
.and.to.include('cactus')
.and.to.include('grown')
})
it('should match snapshot', function () {
const svg = makeBadge({ text: ['cactus', 'grown'], format: 'svg' })
snapshot(svg)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
})
})
})
describe('JSON', function () {
it('should produce the expected JSON', function () {
const json = makeBadge({
text: ['cactus', 'grown'],
label: 'cactus',
message: 'grown',
format: 'json',
links: ['https://example.com/', 'https://other.example.com/'],
})
@@ -104,484 +113,471 @@ describe('The badge generator', function () {
})
})
it('should replace undefined svg template with "flat"', function () {
it('should replace undefined svg badge style with "flat"', function () {
const jsonBadgeWithUnknownStyle = makeBadge({
text: ['name', 'Bob'],
label: 'name',
message: 'Bob',
format: 'svg',
})
const jsonBadgeWithDefaultStyle = makeBadge({
text: ['name', 'Bob'],
label: 'name',
message: 'Bob',
format: 'svg',
template: 'flat',
style: 'flat',
})
expect(jsonBadgeWithUnknownStyle)
.to.equal(jsonBadgeWithDefaultStyle)
.and.to.satisfy(isSvg)
})
it('should fail with unknown svg template', function () {
it('should fail with unknown svg badge style', function () {
expect(() =>
makeBadge({
text: ['name', 'Bob'],
label: 'name',
message: 'Bob',
format: 'svg',
template: 'unknown_style',
style: 'unknown_style',
})
).to.throw(Error, "Unknown template: 'unknown_style'")
).to.throw(Error, "Unknown badge style: 'unknown_style'")
})
})
describe('"flat" template badge generation', function () {
it('should match snapshots: message/label, no logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
labelColor: '#0f0',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
labelColor: '#0f0',
})
})
it('should match snapshots: message/label, with logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, no logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
})
})
it('should match snapshots: message only, with logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, with logo and labelColor', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message/label, with links', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
})
})
describe('"flat-square" template badge generation', function () {
it('should match snapshots: message/label, no logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
})
})
it('should match snapshots: message/label, with logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, no logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
})
})
it('should match snapshots: message only, with logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, with logo and labelColor', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message/label, with links', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat-square',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
})
})
describe('"plastic" template badge generation', function () {
it('should match snapshots: message/label, no logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
labelColor: '#0f0',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
labelColor: '#0f0',
})
})
it('should match snapshots: message/label, with logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, no logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
})
})
it('should match snapshots: message only, with logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, with logo and labelColor', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message/label, with links', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'plastic',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'plastic',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
})
})
describe('"for-the-badge" template badge generation', function () {
// https://github.com/badges/shields/issues/1280
it('numbers should produce a string', function () {
const svg = makeBadge({
text: [1998, 1999],
format: 'svg',
template: 'for-the-badge',
})
expect(svg).to.include('1998').and.to.include('1999')
expect(
makeBadge({
label: 1998,
message: 1999,
format: 'svg',
style: 'for-the-badge',
})
)
.to.include('1998')
.and.to.include('1999')
})
it('lowercase/mixedcase string should produce uppercase string', function () {
const svg = makeBadge({
text: ['Label', '1 string'],
format: 'svg',
template: 'for-the-badge',
})
expect(svg).to.include('LABEL').and.to.include('1 STRING')
expect(
makeBadge({
label: 'Label',
message: '1 string',
format: 'svg',
style: 'for-the-badge',
})
)
.to.include('LABEL')
.and.to.include('1 STRING')
})
it('should match snapshots: message/label, no logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
})
})
it('should match snapshots: message/label, with logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, no logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
})
})
it('should match snapshots: message only, with logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, with logo and labelColor', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message/label, with links', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
})
})
describe('"social" template badge generation', function () {
it('should produce capitalized string for badge key', function () {
const svg = makeBadge({
text: ['some-key', 'some-value'],
format: 'svg',
template: 'social',
})
expect(svg).to.include('Some-key').and.to.include('some-value')
expect(
makeBadge({
label: 'some-key',
message: 'some-value',
format: 'svg',
style: 'social',
})
)
.to.include('Some-key')
.and.to.include('some-value')
})
// https://github.com/badges/shields/issues/1606
it('should handle empty strings used as badge keys', function () {
const svg = makeBadge({
text: ['', 'some-value'],
format: 'json',
template: 'social',
})
expect(svg).to.include('""').and.to.include('some-value')
expect(
makeBadge({
label: '',
message: 'some-value',
format: 'json',
style: 'social',
})
)
.to.include('""')
.and.to.include('some-value')
})
it('should match snapshots: message/label, no logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
labelColor: '#0f0',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
labelColor: '#0f0',
})
})
it('should match snapshots: message/label, with logo', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, no logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
})
})
it('should match snapshots: message only, with logo', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message only, with logo and labelColor', function () {
snapshot(
makeBadge({
text: ['', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
)
expectBadgeToMatchSnapshot({
label: '',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
labelColor: '#0f0',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
})
it('should match snapshots: message/label, with links', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'social',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'social',
color: '#b3e',
labelColor: '#0f0',
links: ['https://shields.io/', 'https://www.google.co.uk/'],
})
})
})
describe('badges with logos should always produce the same badge', function () {
it('badge with logo', function () {
const svg = makeBadge({
text: ['label', 'message'],
expectBadgeToMatchSnapshot({
label: 'label',
message: 'message',
format: 'svg',
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxu',
})
snapshot(svg)
})
})
describe('text colors', function () {
it('should use black text when the label color is light', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'flat',
color: '#000',
labelColor: '#f3f3f3',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'flat',
color: '#000',
labelColor: '#f3f3f3',
})
})
it('should use black text when the message color is light', function () {
snapshot(
makeBadge({
text: ['cactus', 'grown'],
format: 'svg',
template: 'for-the-badge',
color: '#e2ffe1',
labelColor: '#000',
})
)
expectBadgeToMatchSnapshot({
label: 'cactus',
message: 'grown',
format: 'svg',
style: 'for-the-badge',
color: '#e2ffe1',
labelColor: '#000',
})
})
})
})

View File

@@ -35,7 +35,7 @@
"logo": "https://opencollective.com/opencollective/logo.txt"
},
"dependencies": {
"anafanafo": "^1.0.0",
"anafanafo": "2.0.0",
"css-color-converter": "^2.0.0"
},
"scripts": {

View File

@@ -21,7 +21,7 @@ public:
key: 'HTTPS_KEY'
cert: 'HTTPS_CRT'
redirectUri: 'REDIRECT_URI'
redirectUrl: 'REDIRECT_URI'
rasterUrl: 'RASTER_URL'
@@ -30,9 +30,6 @@ public:
__name: 'ALLOWED_ORIGIN'
__format: 'json'
persistence:
dir: 'PERSISTENCE_DIR'
services:
bitbucketServer:
authorizedOrigins: 'BITBUCKET_SERVER_ORIGINS'
@@ -64,6 +61,8 @@ public:
fetchLimit: 'FETCH_LIMIT'
requireCloudflare: 'REQUIRE_CLOUDFLARE'
private:
azure_devops_token: 'AZURE_DEVOPS_TOKEN'
bintray_user: 'BINTRAY_USER'

View File

@@ -16,9 +16,6 @@ public:
cors:
allowedOrigin: []
persistence:
dir: './private'
services:
github:
baseUri: 'https://api.github.com/'
@@ -36,4 +33,6 @@ public:
fetchLimit: '10MB'
requireCloudflare: false
private: {}

View File

@@ -15,6 +15,4 @@ public:
cors:
allowedOrigin: ['http://shields.io', 'https://shields.io']
redirectUrl: 'https://shields.io/'
rasterUrl: 'https://raster.shields.io'

View File

@@ -5,11 +5,8 @@
function escapeFormat(t) {
return (
t
// Inline single underscore.
.replace(/([^_])_([^_])/g, '$1 $2')
// Leading or trailing underscore.
.replace(/([^_])_$/, '$1 ')
.replace(/^_([^_])/, ' $1')
// Single underscore.
.replace(/(^|[^_])((?:__)*)_(?!_)/g, '$1$2 ')
// Double underscore and double dash.
.replace(/__/g, '_')
.replace(/--/g, '-')

View File

@@ -0,0 +1,21 @@
'use strict'
const { test, given } = require('sazerac')
const { escapeFormat } = require('./path-helpers')
describe('Badge URL helper functions', function () {
test(escapeFormat, () => {
given('_single leading underscore').expect(' single leading underscore')
given('single trailing underscore_').expect('single trailing underscore ')
given('__double leading underscores').expect('_double leading underscores')
given('double trailing underscores__').expect(
'double trailing underscores_'
)
given('treble___underscores').expect('treble_ underscores')
given('fourfold____underscores').expect('fourfold__underscores')
given('double--dashes').expect('double-dashes')
given('treble---dashes').expect('treble--dashes')
given('fourfold----dashes').expect('fourfold--dashes')
given('once_in_a_blue--moon').expect('once in a blue-moon')
})
})

View File

@@ -1,74 +0,0 @@
'use strict'
const makeBadge = require('../../badge-maker/lib/make-badge')
const BaseService = require('./base')
const { MetricHelper } = require('./metric-helper')
const { setCacheHeaders } = require('./cache-headers')
const { makeSend } = require('./legacy-result-sender')
const coalesceBadge = require('./coalesce-badge')
const { prepareRoute, namedParamsForMatch } = require('./route')
// Badges are subject to two independent types of caching: in-memory and
// downstream.
//
// Services deriving from `NonMemoryCachingBaseService` are not cached in
// memory on the server. This means that each request that hits the server
// triggers another call to the handler. When using badges for server
// diagnostics, that's useful!
//
// In contrast, The `handle()` function of most other `BaseService`
// subclasses is wrapped in onboard, in-memory caching. See `lib /request-
// handler.js` and `BaseService.prototype.register()`.
//
// All services, including those extending NonMemoryCachingBaseServices, may
// be cached _downstream_. This is governed by cache headers, which are
// configured by the service, the user's request, and the server's default
// cache length.
module.exports = class NonMemoryCachingBaseService extends BaseService {
static register({ camp, metricInstance }, serviceConfig) {
const { cacheHeaders: cacheHeaderConfig } = serviceConfig
const { _cacheLength: serviceDefaultCacheLengthSeconds } = this
const { regex, captureNames } = prepareRoute(this.route)
const metricHelper = MetricHelper.create({
metricInstance,
ServiceClass: this,
})
camp.route(regex, async (queryParams, match, end, ask) => {
const metricHandle = metricHelper.startRequest()
const namedParams = namedParamsForMatch(captureNames, match, this)
const serviceData = await this.invoke(
{},
serviceConfig,
namedParams,
queryParams
)
const badgeData = coalesceBadge(
queryParams,
serviceData,
this.defaultBadgeData,
this
)
// The final capture group is the extension.
const format = (match.slice(-1)[0] || '.svg').replace(/^\./, '')
badgeData.format = format
const svg = makeBadge(badgeData)
setCacheHeaders({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
queryParams,
res: ask.res,
})
makeSend(format, ask.res, end)(svg)
metricHandle.noteResponseSent()
})
}
}

View File

@@ -6,10 +6,6 @@ const Joi = require('joi')
const makeBadge = require('../../badge-maker/lib/make-badge')
const BaseSvgScrapingService = require('./base-svg-scraping')
function makeExampleSvg({ label, message }) {
return makeBadge({ text: ['this is the label', 'this is the result!'] })
}
const schema = Joi.object({
message: Joi.string().required(),
}).required()
@@ -29,10 +25,7 @@ class DummySvgScrapingService extends BaseSvgScrapingService {
describe('BaseSvgScrapingService', function () {
const exampleLabel = 'this is the label'
const exampleMessage = 'this is the result!'
const exampleSvg = makeExampleSvg({
label: exampleLabel,
message: exampleMessage,
})
const exampleSvg = makeBadge({ label: exampleLabel, message: exampleMessage })
describe('valueFromSvgBadge', function () {
it('should find the correct value', function () {

View File

@@ -57,7 +57,7 @@ class BaseYamlService extends BaseService {
})
let parsed
try {
parsed = yaml.safeLoad(buffer.toString(), encoding)
parsed = yaml.load(buffer.toString(), encoding)
} catch (err) {
logTrace(emojic.dart, 'Response YAML (unparseable)', buffer)
throw new InvalidResponse({

View File

@@ -329,7 +329,7 @@ describe('BaseService', function () {
describe('ScoutCamp integration', function () {
// TODO Strangly, without the useless escape the regexes do not match in Node 12.
// eslint-disable-next-line no-useless-escape
const expectedRouteRegex = /^\/foo\/([^\/]+?)(|\.svg|\.json)$/
const expectedRouteRegex = /^\/foo(?:\/([^\/#\?]+?))(|\.svg|\.json)$/
let mockCamp
let mockHandleRequest
@@ -373,9 +373,10 @@ describe('BaseService', function () {
const expectedFormat = 'svg'
expect(mockSendBadge).to.have.been.calledOnce
expect(mockSendBadge).to.have.been.calledWith(expectedFormat, {
text: ['cat', 'Hello namedParamA: bar with queryParamA: ?'],
label: 'cat',
message: 'Hello namedParamA: bar with queryParamA: ?',
color: 'lightgrey',
template: 'flat',
style: 'flat',
namedLogo: undefined,
logo: undefined,
logoWidth: undefined,
@@ -518,7 +519,7 @@ describe('BaseService', function () {
await serviceInstance._request({ url })
expect(register.getSingleMetricAsString('service_response_bytes'))
expect(await register.getSingleMetricAsString('service_response_bytes'))
.to.contain(
'service_response_bytes_bucket{le="65536",category="other",family="undefined",service="dummy_service_with_service_response_size_metric_enabled"} 0\n'
)
@@ -544,7 +545,7 @@ describe('BaseService', function () {
await serviceInstance._request({ url })
expect(
register.getSingleMetricAsString('service_response_bytes')
await register.getSingleMetricAsString('service_response_bytes')
).to.not.contain('service_response_bytes_bucket')
})
})

View File

@@ -160,12 +160,10 @@ module.exports = function coalesceBadge(
}
return {
text: [
// Use `coalesce()` to support empty labels and messages, as in the
// static badge.
coalesce(overrideLabel, serviceLabel, defaultLabel, category),
coalesce(serviceMessage, 'n/a'),
],
// Use `coalesce()` to support empty labels and messages, as in the static
// badge.
label: coalesce(overrideLabel, serviceLabel, defaultLabel, category),
message: coalesce(serviceMessage, 'n/a'),
color: coalesce(
// In case of an error, disregard user's color override.
isError ? undefined : overrideColor,
@@ -179,7 +177,7 @@ module.exports = function coalesceBadge(
serviceLabelColor,
defaultLabelColor
),
template: style,
style,
namedLogo,
logo: logoSvgBase64,
logoWidth,

View File

@@ -7,63 +7,61 @@ const coalesceBadge = require('./coalesce-badge')
describe('coalesceBadge', function () {
describe('Label', function () {
it('uses the default label', function () {
expect(coalesceBadge({}, {}, { label: 'heyo' }).text).to.deep.equal([
'heyo',
'n/a',
])
expect(coalesceBadge({}, {}, { label: 'heyo' })).to.include({
label: 'heyo',
})
})
// This behavior isn't great and we might want to remove it.
it('uses the category as a default label', function () {
expect(
coalesceBadge({}, {}, {}, { category: 'cat' }).text
).to.deep.equal(['cat', 'n/a'])
expect(coalesceBadge({}, {}, {}, { category: 'cat' })).to.include({
label: 'cat',
})
})
it('preserves an empty label', function () {
expect(
coalesceBadge({}, { label: '', message: '10k' }, {}).text
).to.deep.equal(['', '10k'])
expect(coalesceBadge({}, { label: '', message: '10k' }, {})).to.include({
label: '',
})
})
it('overrides the label', function () {
expect(
coalesceBadge({ label: 'purr count' }, { label: 'purrs' }, {}).text
).to.deep.equal(['purr count', 'n/a'])
coalesceBadge({ label: 'purr count' }, { label: 'purrs' }, {})
).to.include({ label: 'purr count' })
})
})
describe('Message', function () {
it('applies the service message', function () {
expect(coalesceBadge({}, { message: '10k' }, {}).text).to.deep.equal([
undefined,
'10k',
])
expect(coalesceBadge({}, { message: '10k' }, {})).to.include({
message: '10k',
})
})
it('applies a numeric service message', function () {
// https://github.com/badges/shields/issues/1280
it('converts a number to a string', function () {
// While a number of badges use this, in the long run we may want
// `render()` to always return a string.
expect(coalesceBadge({}, { message: 10 }, {}).text).to.deep.equal([
undefined,
10,
])
expect(coalesceBadge({}, { message: 10 }, {})).to.include({
message: 10,
})
})
})
describe('Right color', function () {
it('uses the default color', function () {
expect(coalesceBadge({}, {}, {}).color).to.equal('lightgrey')
expect(coalesceBadge({}, {}, {})).to.include({ color: 'lightgrey' })
})
it('overrides the color', function () {
expect(
coalesceBadge({ color: '10ADED' }, { color: 'red' }, {}).color
).to.equal('10ADED')
coalesceBadge({ color: '10ADED' }, { color: 'red' }, {})
).to.include({ color: '10ADED' })
// also expected for legacy name
expect(
coalesceBadge({ colorB: 'B0ADED' }, { color: 'red' }, {}).color
).to.equal('B0ADED')
coalesceBadge({ colorB: 'B0ADED' }, { color: 'red' }, {})
).to.include({ color: 'B0ADED' })
})
context('In case of an error', function () {
@@ -73,21 +71,23 @@ describe('coalesceBadge', function () {
{ color: '10ADED' },
{ isError: true, color: 'lightgray' },
{}
).color
).to.equal('lightgray')
)
).to.include({ color: 'lightgray' })
// also expected for legacy name
expect(
coalesceBadge(
{ colorB: 'B0ADED' },
{ isError: true, color: 'lightgray' },
{}
).color
).to.equal('lightgray')
)
).to.include({ color: 'lightgray' })
})
})
it('applies the service color', function () {
expect(coalesceBadge({}, { color: 'red' }, {}).color).to.equal('red')
expect(coalesceBadge({}, { color: 'red' }, {})).to.include({
color: 'red',
})
})
})
@@ -97,20 +97,19 @@ describe('coalesceBadge', function () {
})
it('applies the service label color', function () {
expect(coalesceBadge({}, { labelColor: 'red' }, {}).labelColor).to.equal(
'red'
)
expect(coalesceBadge({}, { labelColor: 'red' }, {})).to.include({
labelColor: 'red',
})
})
it('overrides the label color', function () {
expect(
coalesceBadge({ labelColor: '42f483' }, { color: 'green' }, {})
.labelColor
).to.equal('42f483')
).to.include({ labelColor: '42f483' })
// also expected for legacy name
expect(
coalesceBadge({ colorA: 'B2f483' }, { color: 'green' }, {}).labelColor
).to.equal('B2f483')
coalesceBadge({ colorA: 'B2f483' }, { color: 'green' }, {})
).to.include({ labelColor: 'B2f483' })
})
it('converts a query-string numeric color to a string', function () {
@@ -120,8 +119,8 @@ describe('coalesceBadge', function () {
{ color: 123 },
{ color: 'green' },
{}
).color
).to.equal('123')
)
).to.include({ color: '123' })
// also expected for legacy name
expect(
coalesceBadge(
@@ -129,8 +128,8 @@ describe('coalesceBadge', function () {
{ colorB: 123 },
{ color: 'green' },
{}
).color
).to.equal('123')
)
).to.include({ color: '123' })
})
})
@@ -148,9 +147,9 @@ describe('coalesceBadge', function () {
})
it('applies the named logo', function () {
expect(coalesceBadge({}, { namedLogo: 'npm' }, {}).namedLogo).to.equal(
'npm'
)
expect(coalesceBadge({}, { namedLogo: 'npm' }, {})).to.include({
namedLogo: 'npm',
})
expect(coalesceBadge({}, { namedLogo: 'npm' }, {}).logo).to.equal(
getShieldsIcon({ name: 'npm' })
).and.not.to.be.empty
@@ -219,8 +218,8 @@ describe('coalesceBadge', function () {
it('overrides the logo with custom svg', function () {
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxu'
expect(
coalesceBadge({ logo: logoSvg }, { namedLogo: 'appveyor' }, {}).logo
).to.equal(logoSvg)
coalesceBadge({ logo: logoSvg }, { namedLogo: 'appveyor' }, {})
).to.include({ logo: logoSvg })
})
it('ignores the color when custom svg is provided', function () {
@@ -230,35 +229,36 @@ describe('coalesceBadge', function () {
{ logo: logoSvg, logoColor: 'brightgreen' },
{ namedLogo: 'appveyor' },
{}
).logo
).to.equal(logoSvg)
)
).to.include({ logo: logoSvg })
})
})
describe('Logo width', function () {
it('overrides the logoWidth', function () {
expect(coalesceBadge({ logoWidth: 20 }, {}, {}).logoWidth).to.equal(20)
expect(coalesceBadge({ logoWidth: 20 }, {}, {})).to.include({
logoWidth: 20,
})
})
it('applies the logo width', function () {
expect(
coalesceBadge({}, { namedLogo: 'npm', logoWidth: 275 }, {}).logoWidth
).to.equal(275)
coalesceBadge({}, { namedLogo: 'npm', logoWidth: 275 }, {})
).to.include({ logoWidth: 275 })
})
})
describe('Logo position', function () {
it('overrides the logoPosition', function () {
expect(
coalesceBadge({ logoPosition: -10 }, {}, {}).logoPosition
).to.equal(-10)
expect(coalesceBadge({ logoPosition: -10 }, {}, {})).to.include({
logoPosition: -10,
})
})
it('applies the logo position', function () {
expect(
coalesceBadge({}, { namedLogo: 'npm', logoPosition: -10 }, {})
.logoPosition
).to.equal(-10)
).to.include({ logoPosition: -10 })
})
})
@@ -279,20 +279,24 @@ describe('coalesceBadge', function () {
describe('Style', function () {
it('falls back to flat with invalid style', function () {
expect(coalesceBadge({ style: 'pill' }, {}, {}).template).to.equal('flat')
expect(coalesceBadge({ style: 7 }, {}, {}).template).to.equal('flat')
expect(coalesceBadge({ style: undefined }, {}, {}).template).to.equal(
'flat'
)
expect(coalesceBadge({ style: 'pill' }, {}, {})).to.include({
style: 'flat',
})
expect(coalesceBadge({ style: 7 }, {}, {})).to.include({
style: 'flat',
})
expect(coalesceBadge({ style: undefined }, {}, {})).to.include({
style: 'flat',
})
})
it('replaces legacy popout styles', function () {
expect(coalesceBadge({ style: 'popout' }, {}, {}).template).to.equal(
'flat'
)
expect(
coalesceBadge({ style: 'popout-square' }, {}, {}).template
).to.equal('flat-square')
expect(coalesceBadge({ style: 'popout' }, {}, {})).to.include({
style: 'flat',
})
expect(coalesceBadge({ style: 'popout-square' }, {}, {})).to.include({
style: 'flat-square',
})
})
})
@@ -300,8 +304,7 @@ describe('coalesceBadge', function () {
it('overrides the cache length', function () {
expect(
coalesceBadge({ style: 'pill' }, { cacheSeconds: 123 }, {})
.cacheLengthSeconds
).to.equal(123)
).to.include({ cacheLengthSeconds: 123 })
})
})
})

View File

@@ -124,12 +124,7 @@ function transformExample(inExample, index, ServiceClass) {
documentation,
} = validateExample(inExample, index, ServiceClass)
const {
text: [label, message],
color,
template: style,
namedLogo,
} = coalesceBadge(
const { label, message, color, style, namedLogo } = coalesceBadge(
{},
staticPreview,
ServiceClass.defaultBadgeData,

View File

@@ -3,7 +3,6 @@
const BaseService = require('./base')
const BaseJsonService = require('./base-json')
const BaseGraphqlService = require('./base-graphql')
const NonMemoryCachingBaseService = require('./base-non-memory-caching')
const BaseStaticService = require('./base-static')
const BaseSvgScrapingService = require('./base-svg-scraping')
const BaseXmlService = require('./base-xml')
@@ -22,7 +21,6 @@ module.exports = {
BaseService,
BaseJsonService,
BaseGraphqlService,
NonMemoryCachingBaseService,
BaseStaticService,
BaseSvgScrapingService,
BaseXmlService,

View File

@@ -1,7 +1,6 @@
'use strict'
const request = require('request')
const queryString = require('query-string')
const makeBadge = require('../../badge-maker/lib/make-badge')
const { setCacheHeaders } = require('./cache-headers')
const {
@@ -10,27 +9,10 @@ const {
ShieldsRuntimeError,
} = require('./errors')
const { makeSend } = require('./legacy-result-sender')
const LruCache = require('./lru-cache')
const coalesceBadge = require('./coalesce-badge')
const userAgent = 'Shields.io/2003a'
// We avoid calling the vendor's server for computation of the information in a
// number of badges.
const minAccuracy = 0.75
// The quotient of (vendor) data change frequency by badge request frequency
// must be lower than this to trigger sending the cached data *before*
// updating our data from the vendor's server.
// Indeed, the accuracy of our badges are:
// A(Δt) = 1 - min(# data change over Δt, # requests over Δt)
// / (# requests over Δt)
// = 1 - max(1, df) / rf
const freqRatioMax = 1 - minAccuracy
// Request cache size of 5MB (~5000 bytes/image).
const requestCache = new LruCache(1000)
// These query parameters are available to any badge. They are handled by
// `coalesceBadge`.
const globalQueryParams = new Set([
@@ -121,8 +103,6 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
return
}
const reqTime = new Date()
// `defaultCacheLengthSeconds` can be overridden by
// `serviceDefaultCacheLengthSeconds` (either by category or on a badge-
// by-badge basis). Then in turn that can be overridden by
@@ -151,49 +131,10 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
filteredQueryParams[key] = queryParams[key]
})
// Use sindresorhus query-string because it sorts the keys, whereas the
// builtin querystring module relies on the iteration order.
const stringified = queryString.stringify(filteredQueryParams)
const cacheIndex = `${match[0]}?${stringified}`
// Should we return the data right away?
const cached = requestCache.get(cacheIndex)
let cachedVersionSent = false
if (cached !== undefined) {
// A request was made not long ago.
const tooSoon = +reqTime - cached.time < cached.interval
if (tooSoon || cached.dataChange / cached.reqs <= freqRatioMax) {
const svg = makeBadge(cached.data.badgeData)
setCacheHeadersOnResponse(
ask.res,
cached.data.badgeData.cacheLengthSeconds
)
makeSend(cached.data.format, ask.res, end)(svg)
cachedVersionSent = true
// We do not wish to call the vendor servers.
if (tooSoon) {
return
}
}
}
// In case our vendor servers are unresponsive.
let serverUnresponsive = false
const serverResponsive = setTimeout(() => {
serverUnresponsive = true
if (cachedVersionSent) {
return
}
if (requestCache.has(cacheIndex)) {
const cached = requestCache.get(cacheIndex)
const svg = makeBadge(cached.data.badgeData)
setCacheHeadersOnResponse(
ask.res,
cached.data.badgeData.cacheLengthSeconds
)
makeSend(cached.data.format, ask.res, end)(svg)
return
}
ask.res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
const badgeData = coalesceBadge(
filteredQueryParams,
@@ -206,8 +147,6 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
makeSend(extension, ask.res, end)(svg)
}, 25000)
// Only call vendor servers when last request is older than…
let cacheInterval = 5000 // milliseconds
function cachingRequest(uri, options, callback) {
if (typeof options === 'function' && !callback) {
callback = options
@@ -223,20 +162,7 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
options.headers['User-Agent'] = userAgent
let bufferLength = 0
const r = request(options, (err, res, body) => {
if (res != null && res.headers != null) {
const cacheControl = res.headers['cache-control']
if (cacheControl != null) {
const age = cacheControl.match(/max-age=([0-9]+)/)
// Would like to get some more test coverage on this before changing it.
// eslint-disable-next-line no-self-compare
if (age != null && +age[1] === +age[1]) {
cacheInterval = +age[1] * 1000
}
}
}
callback(err, res, body)
})
const r = request(options, callback)
r.on('data', chunk => {
bufferLength += chunk.length
if (bufferLength > fetchLimitBytes) {
@@ -264,30 +190,11 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
return
}
clearTimeout(serverResponsive)
// Check for a change in the data.
let dataHasChanged = false
if (
cached !== undefined &&
cached.data.badgeData.text[1] !== badgeData.text[1]
) {
dataHasChanged = true
}
// Add format to badge data.
badgeData.format = format
// Update information in the cache.
const updatedCache = {
reqs: cached ? cached.reqs + 1 : 1,
dataChange: cached ? cached.dataChange + (dataHasChanged ? 1 : 0) : 1,
time: +reqTime,
interval: cacheInterval,
data: { format, badgeData },
}
requestCache.set(cacheIndex, updatedCache)
if (!cachedVersionSent) {
const svg = makeBadge(badgeData)
setCacheHeadersOnResponse(ask.res, badgeData.cacheLengthSeconds)
makeSend(format, ask.res, end)(svg)
}
const svg = makeBadge(badgeData)
setCacheHeadersOnResponse(ask.res, badgeData.cacheLengthSeconds)
makeSend(format, ask.res, end)(svg)
},
cachingRequest
)
@@ -299,15 +206,8 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
}
}
function clearRequestCache() {
requestCache.clear()
}
module.exports = {
handleRequest,
promisify,
clearRequestCache,
// Expose for testing.
_requestCache: requestCache,
userAgent,
}

View File

@@ -6,11 +6,7 @@ const portfinder = require('portfinder')
const Camp = require('@shields_io/camp')
const got = require('../got-test-client')
const coalesceBadge = require('./coalesce-badge')
const {
handleRequest,
clearRequestCache,
_requestCache,
} = require('./legacy-request-handler')
const { handleRequest } = require('./legacy-request-handler')
async function performTwoRequests(baseUrl, first, second) {
expect((await got(`${baseUrl}${first}`)).statusCode).to.equal(200)
@@ -83,7 +79,6 @@ describe('The request handler', function () {
camp.on('listening', () => done())
})
afterEach(function (done) {
clearRequestCache()
if (camp) {
camp.close(() => done())
camp = null
@@ -196,57 +191,18 @@ describe('The request handler', function () {
describe('caching', function () {
describe('standard query parameters', function () {
let handlerCallCount
beforeEach(function () {
handlerCallCount = 0
})
function register({ cacheHeaderConfig }) {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(
cacheHeaderConfig,
(queryParams, match, sendBadge, request) => {
++handlerCallCount
fakeHandler(queryParams, match, sendBadge, request)
}
)
)
}
context('With standard cache settings', function () {
beforeEach(function () {
register({ cacheHeaderConfig: standardCacheHeaders })
})
it('should cache identical requests', async function () {
await performTwoRequests(
baseUrl,
'/testing/123.svg',
'/testing/123.svg'
)
expect(handlerCallCount).to.equal(1)
})
it('should differentiate known query parameters', async function () {
await performTwoRequests(
baseUrl,
'/testing/123.svg?label=foo',
'/testing/123.svg?label=bar'
)
expect(handlerCallCount).to.equal(2)
})
it('should ignore unknown query parameters', async function () {
await performTwoRequests(
baseUrl,
'/testing/123.svg?foo=1',
'/testing/123.svg?foo=2'
)
expect(handlerCallCount).to.equal(1)
})
})
it('should set the expires header to current time + defaultCacheLengthSeconds', async function () {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 900 } })
const { headers } = await got(`${baseUrl}/testing/123.json`)
@@ -277,7 +233,6 @@ describe('The request handler', function () {
handleRequest(
{ defaultCacheLengthSeconds: 300 },
(queryParams, match, sendBadge, request) => {
++handlerCallCount
createFakeHandlerWithCacheLength(400)(
queryParams,
match,
@@ -298,7 +253,6 @@ describe('The request handler', function () {
handleRequest(
{ defaultCacheLengthSeconds: 300 },
(queryParams, match, sendBadge, request) => {
++handlerCallCount
createFakeHandlerWithCacheLength(200)(
queryParams,
match,
@@ -345,21 +299,6 @@ describe('The request handler', function () {
'no-cache, no-store, must-revalidate'
)
})
describe('the cache key', function () {
beforeEach(function () {
register({ cacheHeaderConfig: standardCacheHeaders })
})
const expectedCacheKey = '/testing/123.json?color=123&label=foo'
it('should match expected and use canonical order - 1', async function () {
await got(`${baseUrl}/testing/123.json?color=123&label=foo`)
expect(_requestCache.cache).to.have.keys(expectedCacheKey)
})
it('should match expected and use canonical order - 2', async function () {
await got(`${baseUrl}/testing/123.json?label=foo&color=123`)
expect(_requestCache.cache).to.have.keys(expectedCacheKey)
})
})
})
describe('custom query parameters', function () {

View File

@@ -1,136 +0,0 @@
'use strict'
// In-memory KV, remove the oldest data when the capacity is reached.
const typeEnum = {
unit: 0,
heap: 1,
}
// In bytes.
let heapSize
function computeHeapSize() {
return (heapSize = process.memoryUsage().heapTotal)
}
let heapSizeTimeout
function getHeapSize() {
if (heapSizeTimeout == null) {
// Compute the heap size every 60 seconds.
heapSizeTimeout = setInterval(computeHeapSize, 60 * 1000)
return computeHeapSize()
} else {
return heapSize
}
}
function CacheSlot(key, value) {
this.key = key
this.value = value
this.older = null // Newest slot that is older than this slot.
this.newer = null // Oldest slot that is newer than this slot.
}
function Cache(capacity, type) {
type = type || 'unit'
this.capacity = capacity
this.type = typeEnum[type]
this.cache = new Map() // Maps cache keys to CacheSlots.
this.newest = null // Newest slot in the cache.
this.oldest = null
}
Cache.prototype = {
set: function addToCache(cacheKey, cached) {
let slot = this.cache.get(cacheKey)
if (slot === undefined) {
slot = new CacheSlot(cacheKey, cached)
this.cache.set(cacheKey, slot)
}
this.makeNewest(slot)
const numItemsToRemove = this.limitReached()
if (numItemsToRemove > 0) {
for (let i = 0; i < numItemsToRemove; i++) {
this.removeOldest()
}
}
},
get: function getFromCache(cacheKey) {
const slot = this.cache.get(cacheKey)
if (slot !== undefined) {
this.makeNewest(slot)
return slot.value
}
},
has: function hasInCache(cacheKey) {
return this.cache.has(cacheKey)
},
makeNewest: function makeNewestSlot(slot) {
const previousNewest = this.newest
if (previousNewest === slot) {
return
}
const older = slot.older
const newer = slot.newer
if (older !== null) {
older.newer = newer
} else if (newer !== null) {
this.oldest = newer
}
if (newer !== null) {
newer.older = older
}
this.newest = slot
if (previousNewest !== null) {
slot.older = previousNewest
slot.newer = null
previousNewest.newer = slot
} else {
// If previousNewest is null, the cache used to be empty.
this.oldest = slot
}
},
removeOldest: function removeOldest() {
const cacheKey = this.oldest.key
if (this.oldest !== null) {
this.oldest = this.oldest.newer
if (this.oldest !== null) {
this.oldest.older = null
}
}
this.cache.delete(cacheKey)
},
// Returns the number of elements to remove if we're past the limit.
limitReached: function heuristic() {
if (this.type === typeEnum.unit) {
// Remove the excess.
return Math.max(0, this.cache.size - this.capacity)
} else if (this.type === typeEnum.heap) {
if (getHeapSize() >= this.capacity) {
console.log('LRU HEURISTIC heap:', getHeapSize())
// Remove half of them.
return this.cache.size >> 1
} else {
return 0
}
} else {
console.error(`Unknown heuristic '${this.type}' for LRU cache.`)
return 1
}
},
clear: function () {
this.cache.clear()
this.newest = null
this.oldest = null
},
}
module.exports = Cache

View File

@@ -1,134 +0,0 @@
'use strict'
const { expect } = require('chai')
const LRU = require('./lru-cache')
function expectCacheSlots(cache, keys) {
expect(cache.cache.size).to.equal(keys.length)
const slots = keys.map(k => cache.cache.get(k))
const first = slots[0]
const last = slots.slice(-1)[0]
expect(cache.oldest).to.equal(first)
expect(cache.newest).to.equal(last)
expect(first.older).to.be.null
expect(last.newer).to.be.null
for (let i = 0; i + 1 < slots.length; ++i) {
const current = slots[i]
const next = slots[i + 1]
expect(current.newer).to.equal(next)
expect(next.older).to.equal(current)
}
}
describe('The LRU cache', function () {
it('should support a zero capacity', function () {
const cache = new LRU(0)
cache.set('key', 'value')
expect(cache.cache.size).to.equal(0)
})
it('should support a one capacity', function () {
const cache = new LRU(1)
cache.set('key1', 'value1')
expectCacheSlots(cache, ['key1'])
cache.set('key2', 'value2')
expectCacheSlots(cache, ['key2'])
expect(cache.get('key1')).to.be.undefined
expect(cache.get('key2')).to.equal('value2')
})
it('should remove the oldest element when reaching capacity', function () {
const cache = new LRU(2)
cache.set('key1', 'value1')
cache.set('key2', 'value2')
cache.set('key3', 'value3')
cache.cache.get('key1')
expectCacheSlots(cache, ['key2', 'key3'])
expect(cache.cache.get('key1')).to.be.undefined
expect(cache.get('key1')).to.be.undefined
expect(cache.get('key2')).to.equal('value2')
expect(cache.get('key3')).to.equal('value3')
})
it('should make sure that resetting a key in cache makes it newest', function () {
const cache = new LRU(2)
cache.set('key', 'value')
cache.set('key2', 'value2')
expectCacheSlots(cache, ['key', 'key2'])
cache.set('key', 'value')
expectCacheSlots(cache, ['key2', 'key'])
})
describe('getting a key in the cache', function () {
context('when the requested key is oldest', function () {
it('should leave the keys in the expected order', function () {
const cache = new LRU(2)
cache.set('key1', 'value1')
cache.set('key2', 'value2')
expectCacheSlots(cache, ['key1', 'key2'])
expect(cache.get('key1')).to.equal('value1')
expectCacheSlots(cache, ['key2', 'key1'])
})
})
context('when the requested key is newest', function () {
it('should leave the keys in the expected order', function () {
const cache = new LRU(2)
cache.set('key1', 'value1')
cache.set('key2', 'value2')
expect(cache.get('key2')).to.equal('value2')
expectCacheSlots(cache, ['key1', 'key2'])
})
})
context('when the requested key is in the middle', function () {
it('should leave the keys in the expected order', function () {
const cache = new LRU(3)
cache.set('key1', 'value1')
cache.set('key2', 'value2')
cache.set('key3', 'value3')
expectCacheSlots(cache, ['key1', 'key2', 'key3'])
expect(cache.get('key2')).to.equal('value2')
expectCacheSlots(cache, ['key1', 'key3', 'key2'])
})
})
})
it('should clear', function () {
// Set up.
const cache = new LRU(2)
cache.set('key1', 'value1')
cache.set('key2', 'value2')
// Confidence check.
expect(cache.get('key1')).to.equal('value1')
expect(cache.get('key2')).to.equal('value2')
// Run.
cache.clear()
// Test.
expect(cache.get('key1')).to.be.undefined
expect(cache.get('key2')).to.be.undefined
expect(cache.cache.size).to.equal(0)
})
})

View File

@@ -22,7 +22,7 @@ module.exports = class InfluxMetrics {
const request = {
uri: this._config.url,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: this.metrics(),
body: await this.metrics(),
timeout: this._config.timeoutMillseconds,
auth,
}
@@ -51,8 +51,8 @@ module.exports = class InfluxMetrics {
)
}
metrics() {
return promClientJsonToInfluxV2(this._metricInstance.metrics(), {
async metrics() {
return promClientJsonToInfluxV2(await this._metricInstance.metrics(), {
env: this._config.envLabel,
application: 'shields',
instance: this._instanceId,

View File

@@ -36,7 +36,7 @@ describe('Influx metrics', function () {
instanceIdEnvVarName: 'INSTANCE_ID',
})
expect(influxMetrics.metrics()).to.contain('instance=instance3')
expect(await influxMetrics.metrics()).to.contain('instance=instance3')
})
it('should use a hostname as an instance label', async function () {
@@ -46,7 +46,9 @@ describe('Influx metrics', function () {
}
const influxMetrics = new InfluxMetrics(metricInstance, customConfig)
expect(influxMetrics.metrics()).to.be.contain('instance=test-hostname')
expect(await influxMetrics.metrics()).to.be.contain(
'instance=test-hostname'
)
})
it('should use a random string as an instance label', async function () {
@@ -55,7 +57,7 @@ describe('Influx metrics', function () {
}
const influxMetrics = new InfluxMetrics(metricInstance, customConfig)
expect(influxMetrics.metrics()).to.be.match(/instance=\w+ /)
expect(await influxMetrics.metrics()).to.be.match(/instance=\w+ /)
})
it('should use a hostname alias as an instance label', async function () {
@@ -66,7 +68,7 @@ describe('Influx metrics', function () {
}
const influxMetrics = new InfluxMetrics(metricInstance, customConfig)
expect(influxMetrics.metrics()).to.be.contain(
expect(await influxMetrics.metrics()).to.be.contain(
'instance=test-hostname-alias'
)
})

View File

@@ -2,26 +2,26 @@
const groupBy = require('lodash.groupby')
function promClientJsonToInfluxV2(metrics, extraLabels = {}) {
// TODO Replace with Array.prototype.flatMap() after migrating to Node.js >= 11
const flatMap = (f, arr) => arr.reduce((acc, x) => acc.concat(f(x)), [])
return flatMap(metric => {
const valuesByLabels = groupBy(metric.values, value =>
JSON.stringify(Object.entries(value.labels).sort())
)
return Object.values(valuesByLabels).map(metricsWithSameLabel => {
const labels = Object.entries(metricsWithSameLabel[0].labels)
.concat(Object.entries(extraLabels))
.sort((a, b) => a[0].localeCompare(b[0]))
.map(labelEntry => `${labelEntry[0]}=${labelEntry[1]}`)
.join(',')
const labelsFormatted = labels ? `,${labels}` : ''
const values = metricsWithSameLabel
.sort((a, b) => a.metricName.localeCompare(b.metricName))
.map(value => `${value.metricName || metric.name}=${value.value}`)
.join(',')
return `prometheus${labelsFormatted} ${values}`
})
}, metrics).join('\n')
return metrics
.flatMap(metric => {
const valuesByLabels = groupBy(metric.values, value =>
JSON.stringify(Object.entries(value.labels).sort())
)
return Object.values(valuesByLabels).map(metricsWithSameLabel => {
const labels = Object.entries(metricsWithSameLabel[0].labels)
.concat(Object.entries(extraLabels))
.sort((a, b) => a[0].localeCompare(b[0]))
.map(labelEntry => `${labelEntry[0]}=${labelEntry[1]}`)
.join(',')
const labelsFormatted = labels ? `,${labels}` : ''
const values = metricsWithSameLabel
.sort((a, b) => a.metricName.localeCompare(b.metricName))
.map(value => `${value.metricName || metric.name}=${value.value}`)
.join(',')
return `prometheus${labelsFormatted} ${values}`
})
}, metrics)
.join('\n')
}
module.exports = { promClientJsonToInfluxV2 }

View File

@@ -22,7 +22,7 @@ describe('Metric format converters', function () {
expect(influx).to.be.equal('prometheus counter1=11')
})
it('converts a counter (from prometheus registry)', function () {
it('converts a counter (from prometheus registry)', async function () {
const register = new prometheus.Registry()
const counter = new prometheus.Counter({
name: 'counter1',
@@ -31,7 +31,7 @@ describe('Metric format converters', function () {
})
counter.inc(11)
const influx = promClientJsonToInfluxV2(register.getMetricsAsJSON())
const influx = promClientJsonToInfluxV2(await register.getMetricsAsJSON())
expect(influx).to.be.equal('prometheus counter1=11')
})
@@ -52,7 +52,7 @@ describe('Metric format converters', function () {
expect(influx).to.be.equal('prometheus gauge1=20')
})
it('converts a gauge (from prometheus registry)', function () {
it('converts a gauge (from prometheus registry)', async function () {
const register = new prometheus.Registry()
const gauge = new prometheus.Gauge({
name: 'gauge1',
@@ -61,7 +61,7 @@ describe('Metric format converters', function () {
})
gauge.inc(20)
const influx = promClientJsonToInfluxV2(register.getMetricsAsJSON())
const influx = promClientJsonToInfluxV2(await register.getMetricsAsJSON())
expect(influx).to.be.equal('prometheus gauge1=20')
})
@@ -101,7 +101,7 @@ prometheus histogram1_count=3,histogram1_sum=111`)
)
})
it('converts a histogram (from prometheus registry)', function () {
it('converts a histogram (from prometheus registry)', async function () {
const register = new prometheus.Registry()
const histogram = new prometheus.Histogram({
name: 'histogram1',
@@ -113,7 +113,7 @@ prometheus histogram1_count=3,histogram1_sum=111`)
histogram.observe(10)
histogram.observe(1)
const influx = promClientJsonToInfluxV2(register.getMetricsAsJSON())
const influx = promClientJsonToInfluxV2(await register.getMetricsAsJSON())
expect(sortLines(influx)).to.be.equal(
sortLines(`prometheus,le=+Inf histogram1_bucket=3
@@ -151,7 +151,7 @@ prometheus summary1_count=3,summary1_sum=111`)
)
})
it('converts a summary (from prometheus registry)', function () {
it('converts a summary (from prometheus registry)', async function () {
const register = new prometheus.Registry()
const summary = new prometheus.Summary({
name: 'summary1',
@@ -163,7 +163,7 @@ prometheus summary1_count=3,summary1_sum=111`)
summary.observe(10)
summary.observe(1)
const influx = promClientJsonToInfluxV2(register.getMetricsAsJSON())
const influx = promClientJsonToInfluxV2(await register.getMetricsAsJSON())
expect(sortLines(influx)).to.be.equal(
sortLines(`prometheus,quantile=0.99 summary1=100

View File

@@ -76,9 +76,9 @@ module.exports = class PrometheusMetrics {
async registerMetricsEndpoint(server) {
const { register } = this
server.route(/^\/metrics$/, (data, match, end, ask) => {
server.route(/^\/metrics$/, async (data, match, end, ask) => {
ask.res.setHeader('Content-Type', register.contentType)
ask.res.end(register.metrics())
ask.res.end(await register.metrics())
})
}
@@ -90,8 +90,8 @@ module.exports = class PrometheusMetrics {
}
}
metrics() {
return this.register.getMetricsAsJSON()
async metrics() {
return await this.register.getMetricsAsJSON()
}
/**

View File

@@ -6,6 +6,7 @@
const path = require('path')
const url = require('url')
const { URL } = url
const cloudflareMiddleware = require('cloudflare-middleware')
const bytes = require('bytes')
const Camp = require('@shields_io/camp')
const originalJoi = require('joi')
@@ -14,10 +15,7 @@ const GithubConstellation = require('../../services/github/github-constellation'
const suggest = require('../../services/suggest')
const { loadServiceClasses } = require('../base-service/loader')
const { makeSend } = require('../base-service/legacy-result-sender')
const {
handleRequest,
clearRequestCache,
} = require('../base-service/legacy-request-handler')
const { handleRequest } = require('../base-service/legacy-request-handler')
const { clearRegularUpdateCache } = require('../legacy/regular-update')
const { rasterRedirectUrl } = require('../badge-urls/make-badge-url')
const log = require('./log')
@@ -89,10 +87,10 @@ const publicConfigSchema = Joi.object({
.integer()
.min(1)
.when('enabled', { is: true, then: Joi.required() }),
intervalSeconds: Joi.number()
.integer()
.min(1)
.when('enabled', { is: true, then: Joi.required() }),
intervalSeconds: Joi.number().integer().min(1).when('enabled', {
is: true,
then: Joi.required(),
}),
instanceIdFrom: Joi.string()
.equal('hostname', 'env-var', 'random')
.when('enabled', { is: true, then: Joi.required() }),
@@ -117,9 +115,6 @@ const publicConfigSchema = Joi.object({
cors: {
allowedOrigin: Joi.array().items(optionalUrl).required(),
},
persistence: {
dir: Joi.string().required(),
},
services: Joi.object({
bitbucketServer: defaultService,
drone: defaultService,
@@ -148,6 +143,10 @@ const publicConfigSchema = Joi.object({
rateLimit: Joi.boolean().required(),
handleInternalErrors: Joi.boolean().required(),
fetchLimit: Joi.string().regex(/^[0-9]+(b|kb|mb|gb|tb)$/i),
documentRoot: Joi.string().default(
path.resolve(__dirname, '..', '..', 'public')
),
requireCloudflare: Joi.boolean().required(),
}).required()
const privateConfigSchema = Joi.object({
@@ -185,6 +184,11 @@ const privateMetricsInfluxConfigSchema = privateConfigSchema.append({
influx_username: Joi.string().required(),
influx_password: Joi.string().required(),
})
function addHandlerAtIndex(camp, index, handlerFn) {
camp.stack.splice(index, 0, handlerFn)
}
/**
* The Server is based on the web framework Scoutcamp. It creates
* an http server, sets up helpers for token persistence and monitoring.
@@ -223,7 +227,6 @@ class Server {
}
this.githubConstellation = new GithubConstellation({
persistence: publicConfig.persistence,
service: publicConfig.services.github,
private: privateConfig,
})
@@ -277,6 +280,23 @@ class Server {
})
}
// See https://www.viget.com/articles/heroku-cloudflare-the-right-way/
requireCloudflare() {
// Set `req.ip`, which is expected by `cloudflareMiddleware()`. This is set
// by Express but not Scoutcamp.
addHandlerAtIndex(this.camp, 0, function (req, res, next) {
// On Heroku, `req.socket.remoteAddress` is the Heroku router. However,
// the router ensures that the last item in the `X-Forwarded-For` header
// is the real origin.
// https://stackoverflow.com/a/18517550/893113
req.ip = process.env.DYNO
? req.headers['x-forwarded-for'].split(', ').pop()
: req.socket.remoteAddress
next()
})
addHandlerAtIndex(this.camp, 1, cloudflareMiddleware())
}
/**
* Set up Scoutcamp routes for 404/not found responses
*/
@@ -294,7 +314,8 @@ class Server {
end
)(
makeBadge({
text: ['410', `${format} no longer available`],
label: '410',
message: `${format} no longer available`,
color: 'lightgray',
format: 'svg',
})
@@ -309,7 +330,8 @@ class Server {
end
)(
makeBadge({
text: ['404', 'raster badges not available'],
label: '404',
message: 'raster badges not available',
color: 'lightgray',
format: 'svg',
})
@@ -327,7 +349,8 @@ class Server {
end
)(
makeBadge({
text: ['404', 'badge not found'],
label: '404',
message: 'badge not found',
color: 'red',
format,
})
@@ -408,19 +431,25 @@ class Server {
ssl: { isSecure: secure, cert, key },
cors: { allowedOrigin },
rateLimit,
requireCloudflare,
} = this.config.public
log(`Server is starting up: ${this.baseUrl}`)
const camp = (this.camp = Camp.create({
documentRoot: path.resolve(__dirname, '..', '..', 'public'),
documentRoot: this.config.public.documentRoot,
port,
hostname,
secure,
staticMaxAge: 300,
cert,
key,
}))
if (requireCloudflare) {
this.requireCloudflare()
}
const { metricInstance } = this
this.cleanupMonitor = sysMonitor.setRoutes(
{ rateLimit },
@@ -453,7 +482,6 @@ class Server {
static resetGlobalState() {
// This state should be migrated to instance state. When possible, do not add new
// global state.
clearRequestCache()
clearRegularUpdateCache()
}

View File

@@ -1,8 +1,11 @@
'use strict'
const path = require('path')
const { expect } = require('chai')
const isSvg = require('is-svg')
const config = require('config')
const nock = require('nock')
const sinon = require('sinon')
const got = require('../got-test-client')
const Server = require('./server')
const { createTestServer } = require('./in-process-server-test-helpers')
@@ -13,7 +16,11 @@ describe('The server', function () {
before('Start the server', async function () {
// Fixes https://github.com/badges/shields/issues/2611
this.timeout(10000)
server = await createTestServer()
server = await createTestServer({
public: {
documentRoot: path.resolve(__dirname, 'test-public'),
},
})
baseUrl = server.baseUrl
await server.start()
})
@@ -45,6 +52,16 @@ describe('The server', function () {
.and.to.include('apple')
})
it('should serve front-end with default maxAge', async function () {
const { headers } = await got(`${baseUrl}/`)
expect(headers['cache-control']).to.equal('max-age=300, s-maxage=300')
})
it('should serve badges with custom maxAge', async function () {
const { headers } = await got(`${baseUrl}npm/l/express`)
expect(headers['cache-control']).to.equal('max-age=3600, s-maxage=3600')
})
it('should redirect colorscheme PNG badges as configured', async function () {
const { statusCode, headers } = await got(
`${baseUrl}:fruit-apple-green.png`,
@@ -168,6 +185,28 @@ describe('The server', function () {
})
})
context('`requireCloudflare` is enabled', function () {
let server
afterEach(async function () {
if (server) {
server.stop()
}
})
it('should reject requests from localhost with an empty 200 response', async function () {
this.timeout(10000)
server = await createTestServer({ public: { requireCloudflare: true } })
await server.start()
const { statusCode, body } = await got(
`${server.baseUrl}badge/foo-bar-blue.svg`
)
expect(statusCode).to.be.equal(200)
expect(body).to.equal('')
})
})
describe('configuration', function () {
let server
afterEach(async function () {
@@ -329,4 +368,67 @@ describe('The server', function () {
})
})
})
describe('running with metrics enabled', function () {
let server, baseUrl, scope, clock
const metricsPushIntervalSeconds = 1
before('Start the server', async function () {
// Fixes https://github.com/badges/shields/issues/2611
this.timeout(10000)
process.env.INSTANCE_ID = 'test-instance'
server = await createTestServer({
public: {
metrics: {
prometheus: { enabled: true },
influx: {
enabled: true,
url: 'http://localhost:1112/metrics',
instanceIdFrom: 'env-var',
instanceIdEnvVarName: 'INSTANCE_ID',
envLabel: 'localhost-env',
intervalSeconds: metricsPushIntervalSeconds,
},
},
},
private: {
influx_username: 'influx-username',
influx_password: 'influx-password',
},
})
clock = sinon.useFakeTimers()
baseUrl = server.baseUrl
await server.start()
})
after('Shut down the server', async function () {
if (server) {
await server.stop()
}
server = undefined
nock.cleanAll()
delete process.env.INSTANCE_ID
clock.restore()
})
it('should push custom metrics', async function () {
scope = nock('http://localhost:1112', {
reqheaders: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
.post(
'/metrics',
/prometheus,application=shields,category=static,env=localhost-env,family=static-badge,instance=test-instance,service=static_badge service_requests_total=1\n/
)
.basicAuth({ user: 'influx-username', pass: 'influx-password' })
.reply(200)
await got(`${baseUrl}badge/fruit-apple-green.svg`)
await clock.tickAsync(1000 * metricsPushIntervalSeconds + 500)
expect(scope.isDone()).to.be.equal(
true,
`pending mocks: ${scope.pendingMocks()}`
)
})
})
})

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>shields.io</title>
</head>
<body>
concise, consistent, legible
</body>
</html>

View File

@@ -1,53 +0,0 @@
'use strict'
const fsos = require('fsos')
const TokenPersistence = require('./token-persistence')
class FsTokenPersistence extends TokenPersistence {
constructor({ path }) {
super()
this.path = path
}
async initialize() {
let contents
try {
contents = await fsos.get(this.path)
} catch (e) {
if (e.code === 'ENOENT') {
contents = '[]'
} else {
throw e
}
}
const tokens = JSON.parse(contents)
this._tokens = new Set(tokens)
return tokens
}
async save() {
const tokens = Array.from(this._tokens)
await fsos.set(this.path, JSON.stringify(tokens))
}
async onTokenAdded(token) {
/* istanbul ignore if */
if (!this._tokens) {
throw Error('initialize() has not been called')
}
this._tokens.add(token)
await this.save()
}
async onTokenRemoved(token) {
/* istanbul ignore if */
if (!this._tokens) {
throw Error('initialize() has not been called')
}
this._tokens.delete(token)
await this.save()
}
}
module.exports = FsTokenPersistence

View File

@@ -1,72 +0,0 @@
'use strict'
const fs = require('fs')
const tmp = require('tmp')
const readFile = require('fs-readfile-promise')
const { expect } = require('chai')
const FsTokenPersistence = require('./fs-token-persistence')
describe('File system token persistence', function () {
let path, persistence
beforeEach(function () {
path = tmp.tmpNameSync()
persistence = new FsTokenPersistence({ path })
})
context('when the file does not exist', function () {
it('does nothing', async function () {
const tokens = await persistence.initialize()
expect(tokens).to.deep.equal([])
})
it('saving creates an empty file', async function () {
await persistence.initialize()
await persistence.save()
const json = JSON.parse(await readFile(path))
expect(json).to.deep.deep.equal([])
})
})
context('when the file exists', function () {
const initialTokens = ['a', 'b', 'c'].map(char => char.repeat(40))
beforeEach(async function () {
fs.writeFileSync(path, JSON.stringify(initialTokens))
})
it('loads the contents', async function () {
const tokens = await persistence.initialize()
expect(tokens).to.deep.equal(initialTokens)
})
context('when tokens are added', function () {
it('saves the change', async function () {
const newToken = 'e'.repeat(40)
const expected = Array.from(initialTokens)
expected.push(newToken)
await persistence.initialize()
await persistence.noteTokenAdded(newToken)
const savedTokens = JSON.parse(await readFile(path))
expect(savedTokens).to.deep.equal(expected)
})
})
context('when tokens are removed', function () {
it('saves the change', async function () {
const expected = Array.from(initialTokens)
const toRemove = expected.pop()
await persistence.initialize()
await persistence.noteTokenRemoved(toRemove)
const savedTokens = JSON.parse(await readFile(path))
expect(savedTokens).to.deep.equal(expected)
})
})
})
})

View File

@@ -3,13 +3,13 @@
const { URL } = require('url')
const Redis = require('ioredis')
const log = require('../server/log')
const TokenPersistence = require('./token-persistence')
module.exports = class RedisTokenPersistence extends TokenPersistence {
module.exports = class RedisTokenPersistence {
constructor({ url, key }) {
super()
this.url = url
this.key = key
this.noteTokenAdded = this.noteTokenAdded.bind(this)
this.noteTokenRemoved = this.noteTokenRemoved.bind(this)
}
async initialize() {
@@ -40,4 +40,20 @@ module.exports = class RedisTokenPersistence extends TokenPersistence {
async onTokenRemoved(token) {
await this.redis.srem(this.key, token)
}
async noteTokenAdded(token) {
try {
await this.onTokenAdded(token)
} catch (e) {
log.error(e)
}
}
async noteTokenRemoved(token) {
try {
await this.onTokenRemoved(token)
} catch (e) {
log.error(e)
}
}
}

View File

@@ -1,44 +0,0 @@
'use strict'
const log = require('../server/log')
// This is currently bound to the legacy github auth code. That will be
// replaced with a dependency-injected token provider.
class TokenPersistence {
constructor() {
this.noteTokenAdded = this.noteTokenAdded.bind(this)
this.noteTokenRemoved = this.noteTokenRemoved.bind(this)
}
async initialize() {
throw Error('initialize() is not implemented')
}
async stop() {}
async onTokenAdded(token) {
throw Error('onTokenAdded() is not implemented')
}
async noteTokenAdded(token) {
try {
await this.onTokenAdded(token)
} catch (e) {
log.error(e)
}
}
async onTokenRemoved(token) {
throw Error('onTokenRemoved() is not implemented')
}
async noteTokenRemoved(token) {
try {
await this.onTokenRemoved(token)
} catch (e) {
log.error(e)
}
}
}
module.exports = TokenPersistence

View File

@@ -131,11 +131,11 @@ if (allFiles.length > 100) {
)
}
if (diff.includes("require('joi')")) {
if (diff.includes("require('@hapi/joi')")) {
fail(
[
`Found import of 'joi' in \`${file}\`. <br>`,
"Joi must be imported as '@hapi/joi'.",
`Found import of '@hapi/joi' in \`${file}\`. <br>`,
"Joi must be imported as 'joi'.",
].join('')
)
}

View File

@@ -226,7 +226,7 @@ Description of the code:
- [text-formatters.js](https://github.com/badges/shields/blob/master/services/text-formatters.js)
- [version.js](https://github.com/badges/shields/blob/master/services/version.js)
3. Our badge will query a JSON API so we will extend `BaseJsonService` instead of `BaseService`. This contains some helpers to reduce the need for boilerplate when calling a JSON API.
4. We perform input validation by defining a schema which we expect the JSON we receive to conform to. This is done using [Joi](https://github.com/hapijs/joi). Defining a schema means we can ensure the JSON we receive meets our expectations and throw an error if we receive unexpected input without having to explicitly code validation checks. The schema also acts as a filter on the JSON object. Any properties we're going to reference need to be validated, otherwise they will be filtered out. In this case our schema declares that we expect to receive an object which must have a property called 'version', which is a string.
4. We perform input validation by defining a schema which we expect the JSON we receive to conform to. This is done using [Joi](https://github.com/hapijs/joi). Defining a schema means we can ensure the JSON we receive meets our expectations and throw an error if we receive unexpected input without having to explicitly code validation checks. The schema also acts as a filter on the JSON object. Any properties we're going to reference need to be validated, otherwise they will be filtered out. In this case our schema declares that we expect to receive an object which must have a property called 'version', which is a string. There is further documentation on [input validation](input-validation.md).
5. Our module exports a class which extends `BaseJsonService`
6. Returns the name of the category to sort this badge into (eg. "build"). Used to sort the examples on the main [shields.io](https://shields.io) website. [Here](https://github.com/badges/shields/blob/master/services/categories.js) is the list of the valid categories. See [section 4.4](#44-adding-an-example-to-the-front-page) for more details on examples.
7. As with our previous badge, we need to declare a route. This time we will capture a variable called `gem`.
@@ -311,7 +311,7 @@ Save, run `npm start`, and you can see it [locally](http://127.0.0.1:3000/).
If you update `examples`, you don't have to restart the server. Run `npm run defs` in another terminal window and the frontend will update.
### (4.5) Write Tests <!-- Change the link below when you change the heading -->
### (4.5) Write Tests<!-- Change the link below when you change the heading -->
[write tests]: #45-write-tests

View File

@@ -125,10 +125,9 @@ test this kind of logic through unit tests (e.g. of `render()` and
registered.)
2. Scoutcamp invokes a callback with the four parameters:
`( queryParams, match, end, ask )`. This callback is defined in
[`legacy-request-handler`][legacy-request-handler]. If the badge result
is found in a relatively small in-memory cache, the response is sent
immediately. Otherwise a timeout is set to handle unresponsive service
code and the next callback is invoked: the legacy handler function.
[`legacy-request-handler`][legacy-request-handler]. A timeout is set to
handle unresponsive service code and the next callback is invoked: the
legacy handler function.
3. The legacy handler function receives
`( queryParams, match, sendBadge, request )`. Its job is to extract data
from the regex `match` and `queryParams`, invoke `request` to fetch
@@ -162,8 +161,8 @@ test this kind of logic through unit tests (e.g. of `render()` and
services defaults to produce an object that fully describes the badge to
be rendered.
9. `sendBadge` is invoked with that object. It does some housekeeping on the
timeout and caches the result. Then it renders the badge to svg or raster
and pushes out the result over the HTTPS connection.
timeout. Then it renders the badge to svg or raster and pushes out the
result over the HTTPS connection.
[error reporting]: https://github.com/badges/shields/blob/master/doc/production-hosting.md#error-reporting
[coalescebadge]: https://github.com/badges/shields/blob/master/core/base-service/coalesce-badge.js

50
doc/input-validation.md Normal file
View File

@@ -0,0 +1,50 @@
# Input Data Validation
When we receive input data from an upstream API, we perform input validation to:
- Ensure we won't throw a runtime error trying to render a badge
- Ensure we won't render badges with spurious or unexpected output e.g: ![](https://img.shields.io/badge/version-null-blue) ![](https://img.shields.io/badge/coverage-NaN%25-red) ![](https://img.shields.io/badge/build-undefined-red) ![](https://img.shields.io/badge/coverage---10%25-critical) etc
- Express and document our understanding of the input data
## Writing schemas and validation
- The default validation mechanism should be to use [Joi](https://github.com/sideway/joi) to define a schema for the input data. Validation against Joi schemas is implemented in the base classes and inherited by every service class that extends them. Sometimes additional manual validation is needed which can't be covered by Joi and plugins in which case we implement it by hand.
- If validation is implemented manually (because we need to enforce a constraint that can't be expressed with Joi), invalid data should throw an [InvalidResponse](https://contributing.shields.io/module-core_base-service_errors-InvalidResponse.html) exception.
- Our definition of "valid" should not be stricter than the upstream API's definition of "valid".
- The schema/validation we choose is informed by the assumptions we're making about the data. e.g:
- If we're going to use a value, make sure it exists.
- If we need to multiply it by something, we check it's a number.
- If we're going to call `.split()` on it, we make sure it's a string.
- If we're going to address `foo[0]`, `foo` must be an array.
- If we're going to sort a version on the assumption it is a semver, check it's a semver
- We don't need to validate characteristics we don't rely on. For example, if we're just going to render a version on a badge with the same exact value from the API response and do not need to sort or transform the value, then it doesn't matter what format the version number is in. We can use a very relaxed schema to validate in this case, e.g. `Joi.string().required()`
- If theory (docs) and practice (real-world API responses) conflict, real-world outputs take precedence over documented behaviour. e.g: if the docs say version is a semver but we learn that there are real-world packages where the version number is `0.3b` or `1.2.1.27` then we should accept those values in preference to enforcing the documented API behaviour.
- Shields is descriptive rather than prescriptive. We reflect the established norms of the communities we serve.
- It is fine to define a single schema which is applied to multiple badges. For example, we could define a schema that says:
```js
const schema = Joi.object({
license: Joi.string().required(),
version: Joi.string().required(),
}).required()
```
and have both the license and version badges validate the response against that schema.
- For build status badges there is a shared [isBuildStatus](https://github.com/badges/shields/blob/master/services/build-status.js) validator. In most cases build status badges should use `isBuildStatus` or input validation and `renderBuildStatusBadge` should be used for rendering. Any additional status values can be added to the relevant color arrays.
## Identifying problems
- If we know of a real-world example of a package/repo/etc that causes us to render an invalid value on a badge (e.g: ![](https://img.shields.io/badge/version-null-blue) ![](https://img.shields.io/badge/coverage-NaN%25-red) ![](https://img.shields.io/badge/build-undefined-red) ) our input validation is broken and we should fix it.
- If we know of a real-world example of a package/repo/etc that causes us to throw an unhandled runtime exception, our input validation is broken and we should fix it.
- We should not fail to render a badge because of a validation failure on a field that isn't necessary to render the badge. In the above example of a shared license/version schema: If we become aware of a real-world example of a package/repo/etc that has a `version` key but not a `license` key then we should split the schema (or make `version` optional and handle the error in code).

View File

@@ -14,55 +14,43 @@ Production hosting is managed by the Shields ops team:
[operations issues]: https://github.com/badges/shields/issues?q=is%3Aissue+is%3Aopen+label%3Aoperations
[ops discord]: https://discordapp.com/channels/308323056592486420/480747695879749633
| Component | Subcomponent | People with access |
| ----------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------ |
| shields-production-us | Account owner | @paulmelnikow |
| shields-production-us | Full access | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| shields-production-us | Access management | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| Compose.io Redis | Account owner | @paulmelnikow |
| Compose.io Redis | Account access | @paulmelnikow |
| Compose.io Redis | Database connection credentials | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| Zeit Now | Team owner | @paulmelnikow |
| Zeit Now | Team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| Raster server | Full access as team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| shields-server.com redirector | Full access as team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| Legacy badge servers | Account owner | @espadrine |
| Legacy badge servers | ssh, logs | @espadrine |
| Legacy badge servers | Deployment | @espadrine, @paulmelnikow |
| Legacy badge servers | Admin endpoints | @espadrine, @paulmelnikow |
| Cloudflare (CDN) | Account owner | @espadrine |
| Cloudflare (CDN) | Access management | @espadrine |
| Cloudflare (CDN) | Admin access | @calebcartwright, @chris48s, @espadrine, @paulmelnikow, @PyvesB |
| Twitch | OAuth app | @PyvesB |
| Discord | OAuth app | @PyvesB |
| YouTube | Account owner | @PyvesB |
| OpenStreetMap (for Wheelmap) | Account owner | @paulmelnikow |
| DNS | Account owner | @olivierlacan |
| DNS | Read-only account access | @espadrine, @paulmelnikow, @chris48s |
| Sentry | Error reports | @espadrine, @paulmelnikow |
| Frontend | Deployment | Technically anyone with push access but in practice must be deployed with the badge server |
| Metrics server | Owner | @platan |
| UptimeRobot | Account owner | @paulmelnikow |
| More metrics | Owner | @RedSparr0w |
| Netlify (documentation site) | Owner | @chris48s |
There are [too many bottlenecks][issue 2577]!
[issue 2577]: https://github.com/badges/shields/issues/2577
| Component | Subcomponent | People with access |
| ----------------------------- | ------------------------------- | --------------------------------------------------------------- |
| shields-production-us | Account owner | @paulmelnikow |
| shields-production-us | Full access | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| shields-production-us | Access management | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| Compose.io Redis | Account owner | @paulmelnikow |
| Compose.io Redis | Account access | @paulmelnikow |
| Compose.io Redis | Database connection credentials | @calebcartwright, @chris48s, @paulmelnikow, @pyvesb |
| Zeit Now | Team owner | @paulmelnikow |
| Zeit Now | Team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| Raster server | Full access as team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| shields-server.com redirector | Full access as team members | @paulmelnikow, @chris48s, @calebcartwright, @platan |
| Cloudflare (CDN) | Account owner | @espadrine |
| Cloudflare (CDN) | Access management | @espadrine |
| Cloudflare (CDN) | Admin access | @calebcartwright, @chris48s, @espadrine, @paulmelnikow, @PyvesB |
| Twitch | OAuth app | @PyvesB |
| Discord | OAuth app | @PyvesB |
| YouTube | Account owner | @PyvesB |
| OpenStreetMap (for Wheelmap) | Account owner | @paulmelnikow |
| DNS | Account owner | @olivierlacan |
| DNS | Read-only account access | @espadrine, @paulmelnikow, @chris48s |
| Sentry | Error reports | @espadrine, @paulmelnikow |
| Metrics server | Owner | @platan |
| UptimeRobot | Account owner | @paulmelnikow |
| More metrics | Owner | @RedSparr0w |
## Attached state
Shields has mercifully little persistent state:
1. The GitHub tokens we collect are saved on each server in a cloud Redis database.
They can also be fetched from the [GitHub auth admin endpoint][] for debugging.
2. The server keeps a few caches in memory. These are neither persisted nor
inspectable.
- The [request cache][]
- The [regular-update cache][]
1. The GitHub tokens we collect are saved on each server in a cloud Redis
database. They can also be fetched from the [GitHub auth admin endpoint][]
for debugging.
2. The server keeps the [regular-update cache][] in memory. It is neither
persisted nor inspectable.
[github auth admin endpoint]: https://github.com/badges/shields/blob/master/services/github/auth/admin.js
[request cache]: https://github.com/badges/shields/blob/master/core/base-service/legacy-request-handler.js#L29-L30
[regular-update cache]: https://github.com/badges/shields/blob/master/core/legacy/regular-update.js
## Configuration
@@ -90,32 +78,17 @@ files:
[shields-io-production.yml]: ../config/shields-io-production.yml
[default.yml]: ../config/default.yml
The project ships with `dotenv`, however there is no `.env` in production.
## Badge CDN
Sitting in front of the three servers is a Cloudflare Free account which
provides several services:
- Global CDN, caching, and SSL gateway for `img.shields.io`
- Global CDN, caching, and SSL gateway for `img.shields.io` and `shields.io`
- Analytics through the Cloudflare dashboard
- DNS hosting for `shields.io`
- DNS resolution for `shields.io` (and subdomains)
Cloudflare is configured to respect the servers' cache headers.
## Frontend
The frontend is served by [GitHub Pages][] via the [gh-pages branch][gh-pages]. SSL is enforced.
`shields.io` resolves to the GitHub Pages hosts. It is not proxied through
Cloudflare.
Technically any maintainer can push to `gh-pages`, but in practice the frontend must be deployed
with the badge server via the deployment process described below.
[github pages]: https://pages.github.com/
[gh-pages]: https://github.com/badges/shields/tree/gh-pages
## Raster server
The raster server `raster.shields.io` (a.k.a. the rasterizing proxy) is
@@ -125,28 +98,14 @@ hosted on [Zeit Now][]. It's managed in the
[zeit now]: https://zeit.co/now
[svg-to-image-proxy]: https://github.com/badges/svg-to-image-proxy
## Deployment
### Heroku Deployment
The deployment is done in two stages: the badge server (heroku) and the front-end (gh-pages).
### Heroku
Both the badge server and frontend are served from Heroku.
After merging a commit to master, heroku should create a staging deploy. Check this has deployed correctly in the `shields-staging` pipeline and review http://shields-staging.herokuapp.com/
If we're happy with it, "promote to production". This will deploy what's on staging to the `shields-production-eu` and `shields-production-us` pieplines.
### Frontend
To deploy the front-end to GH pages, use a clean clone of the shields repo.
```sh
$ git pull # update the working copy
$ npm ci # install dependencies (devDependencies are needed to build the frontend)
$ make deploy-gh-pages # build the frontend and push it to the gh-pages branch
```
No secrets are required to build or deploy the frontend.
## DNS
DNS is registered with [DNSimple][].
@@ -169,6 +128,13 @@ the server. It's generously donated by [Sentry][sentry home]. We bundle
[sentry home]: https://sentry.io/shields/
[sentry configuration]: https://github.com/badges/shields/blob/master/doc/self-hosting.md#sentry
## URLs
The canonical and only recommended domain for badge URLs is `img.shields.io`. Currently it is possible to request badges on both `img.shields.io` and `shields.io` i.e: https://img.shields.io/badge/build-passing-brightgreen and https://shields.io/badge/build-passing-brightgreen will both work. However:
- We never show or generate the `img.`-less URL format on https://shields.io/
- We make no guarantees about the `img.`-less URL format. At some future point we may remove the ability to serve badges on `shields.io` (without `img.`) without any warning. `img.shields.io` should always be used for badge urls.
## Monitoring
Overall server performance and requests by service are monitored using
@@ -188,19 +154,3 @@ Request performance is monitored in two places:
[monitor]: https://shields.redsparr0w.com/1568/
[notifications]: http://shields.redsparr0w.com/discord_notification
[monitor discord]: https://discordapp.com/channels/308323056592486420/470700909182320646
## Legacy servers
There are three legacy servers on OVH VPSs which are currently used for proxying.
| Cname | Hostname | Type | IP | Location |
| --------------------------- | -------------------- | ---- | -------------- | ------------------ |
| [s0.servers.shields.io][s0] | vps71670.vps.ovh.ca | VPS | 192.99.59.72 | Quebec, Canada |
| [s1.servers.shields.io][s1] | vps244529.ovh.net | VPS | 51.254.114.150 | Gravelines, France |
| [s2.servers.shields.io][s2] | vps117870.vps.ovh.ca | VPS | 149.56.96.133 | Quebec, Canada |
[s0]: https://s0.servers.shields.io/index.html
[s1]: https://s1.servers.shields.io/index.html
[s2]: https://s2.servers.shields.io/index.html
The only way to inspect the commit on the server is with `git ls-remote`.

View File

@@ -184,19 +184,30 @@ Start the server using the Sentry DSN. You can set it:
sudo SENTRY_DSN=https://xxx:yyy@sentry.io/zzz node server
```
- or by `sentry_dsn` secret property defined in `private/secret.json`
Or via config as you would do with [server secrets](server-secrets.md):
```yml
private:
sentry_dsn: ...
```
```sh
sudo node server
```
### Prometheus
Shields uses [prom-client](https://github.com/siimon/prom-client) to provide [default metrics](https://prometheus.io/docs/instrumenting/writing_clientlibs/#standard-and-runtime-collectors). These metrics are disabled by default.
You can enable them by `METRICS_PROMETHEUS_ENABLED` environment variable.
You can enable them by `METRICS_PROMETHEUS_ENABLED` and `METRICS_PROMETHEUS_ENDPOINT_ENABLED` environment variables.
```bash
METRICS_PROMETHEUS_ENABLED=true npm start
METRICS_PROMETHEUS_ENABLED=true METRICS_PROMETHEUS_ENDPOINT_ENABLED=true npm start
```
Metrics are available at `/metrics` resource.
### Cloudflare
Shields uses Cloudflare as a downstream CDN. If your installation does the same,
you can configure your server to only accept requests coming from Cloudflare's IPs.
Set `public.requireCloudflare: true`.

View File

@@ -66,7 +66,7 @@ t.create('Build status')
- Note that when we call our badge, we are allowing it to communicate with an external service without mocking the response. We write tests which interact with external services, which is unusual practice in unit testing. We do this because one of the purposes of service tests is to notify us if a badge has broken due to an upstream API change. For this reason it is important for at least one test to call the live API without mocking the interaction.
- All badges on shields can be requested in a number of formats. As well as calling https://img.shields.io/wercker/build/wercker/go-wercker-api.svg to generate ![](https://img.shields.io/wercker/build/wercker/go-wercker-api.svg) we can also call https://img.shields.io/wercker/build/wercker/go-wercker-api.json to request the same content as JSON. When writing service tests, we request the badge in JSON format so it is easier to make assertions about the content.
- We don't need to explicitly call `/wercker/build/wercker/go-wercker-api.json` here, only `/build/wercker/go-wercker-api.json`. When we create a tester object with `createServiceTester()` the URL base defined in our service class (in this case `/wercker`) is used as the base URL for any requests made by the tester object.
3. `expectBadge()` is a helper function which accepts either a string literal or a [Joi][] schema for the different fields.
3. `expectBadge()` is a helper function which accepts either a string literal, a [RegExp][] or a [Joi][] schema for the different fields.
Joi is a validation library that is build into IcedFrisby which you can use to
match based on a set of allowed strings, regexes, or specific values. You can
refer to their [API reference][joi api].
@@ -82,6 +82,7 @@ harness will call it for you.
[icedfrisby api]: https://github.com/MarkHerhold/IcedFrisby/blob/master/API.md
[joi]: https://github.com/hapijs/joi
[joi api]: https://github.com/hapijs/joi/blob/master/API.md
[regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
### (3) Running the Tests

View File

@@ -11,13 +11,6 @@ import {
CopiedContentIndicatorHandle,
} from './copied-content-indicator'
function getBaseUrlFromWindowLocation(): string {
// Default to the current hostname for when there is no `BASE_URL` set
// at build time (as in most PaaS deploys).
const { protocol, hostname } = window.location
return `${protocol}//${hostname}`
}
export default function Customizer({
baseUrl,
title,
@@ -39,9 +32,7 @@ export default function Customizer({
}): JSX.Element {
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/35572
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/28884#issuecomment-471341041
const indicatorRef = useRef<
CopiedContentIndicatorHandle
>() as React.MutableRefObject<CopiedContentIndicatorHandle>
const indicatorRef = useRef<CopiedContentIndicatorHandle>() as React.MutableRefObject<CopiedContentIndicatorHandle>
const [path, setPath] = useState('')
const [queryString, setQueryString] = useState<string>()
const [pathIsComplete, setPathIsComplete] = useState<boolean>()
@@ -50,7 +41,7 @@ export default function Customizer({
function generateBuiltBadgeUrl(): string {
const suffix = queryString ? `?${queryString}` : ''
return `${baseUrl || getBaseUrlFromWindowLocation()}${path}${suffix}`
return `${baseUrl}${path}${suffix}`
}
function renderLivePreview(): JSX.Element {

View File

@@ -91,15 +91,15 @@ export function constructPath({
if (typeof token === 'string') {
return token.trim()
} else {
const { delimiter, name, optional } = token
const { prefix, name, modifier } = token
const value = namedParams[name]
if (value) {
return `${delimiter}${value.trim()}`
} else if (optional) {
return `${prefix}${value.trim()}`
} else if (modifier === '?' || modifier === '*') {
return ''
} else {
isComplete = false
return `${delimiter}:${name}`
return `${prefix}:${name}`
}
}
})
@@ -221,14 +221,15 @@ export default function PathBuilder({
tokenIndex: number,
namedParamIndex: number
): JSX.Element {
const { delimiter, optional } = token
const { prefix, modifier } = token
const optional = modifier === '?' || modifier === '*'
const name = `${token.name}`
const exampleValue = exampleParams[name] || '(not set)'
return (
<React.Fragment key={token.name}>
{renderLiteral(delimiter, tokenIndex, false)}
{renderLiteral(prefix, tokenIndex, false)}
<PathBuilderColumn pathContainsOnlyLiterals={false} withHorizPadding>
<NamedParamLabelContainer>
<BuilderLabel htmlFor={name}>{humanizeString(name)}</BuilderLabel>

View File

@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import { staticBadgeUrl } from '../../../core/badge-urls/make-badge-url'
import { baseUrl } from '../../constants'
import { getBaseUrl } from '../../constants'
import { shieldsLogos, simpleIcons } from '../../lib/supported-features'
import Meta from '../meta'
import Header from '../header'
@@ -19,6 +19,7 @@ const StyledTable = styled.table`
`
function NamedLogoTable({ logoNames }: { logoNames: string[] }): JSX.Element {
const baseUrl = getBaseUrl()
return (
<StyledTable>
<thead>

View File

@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'
import styled from 'styled-components'
// @ts-ingnore
import { staticBadgeUrl } from '../../../core/badge-urls/make-badge-url'
import { baseUrl } from '../../constants'
import { getBaseUrl } from '../../constants'
import Meta from '../meta'
// @ts-ignore
import Header from '../header'
@@ -123,13 +123,14 @@ const examples = [
]
function StyleTable({ style }: { style: string }): JSX.Element {
const baseUrl = getBaseUrl()
return (
<StyledTable>
<thead>
<tr>
<td>Description</td>
<td>Badges (new)</td>
<td>Badges (old)</td>
<td>Badges (img.shields.io)</td>
</tr>
</thead>
<tbody>

View File

@@ -11,7 +11,7 @@ import {
RenderableExample,
} from '../lib/service-definitions'
import ServiceDefinitionSetHelper from '../lib/service-definitions/service-definition-set-helper'
import { baseUrl } from '../constants'
import { getBaseUrl } from '../constants'
import Meta from './meta'
import Header from './header'
import SuggestionAndSearch from './suggestion-and-search'
@@ -54,6 +54,7 @@ export default function Main({
setSelectedExampleIsSuggestion,
] = useState(false)
const searchTimeout = useRef(0)
const baseUrl = getBaseUrl()
function performSearch(query: string): void {
setSearchIsInProgress(false)

View File

@@ -1 +1,33 @@
export const baseUrl = process.env.GATSBY_BASE_URL || ''
const baseUrl = process.env.GATSBY_BASE_URL
export function getBaseUrl(): string {
if (baseUrl) {
return baseUrl
}
/*
This is a special case for production.
We want to be able to build the front end with no value set for
`GATSBY_BASE_URL` so that we can deploy a build to staging
and then promote the exact same build to production.
When deployed to staging, we want the frontend on
https://staging.shields.io/ to generate badges with the base
https://staging.shields.io/
When we promote to production we want https://shields.io/ and
https://www.shields.io/ to both generate badges with the base
https://img.shields.io/
*/
try {
const { protocol, hostname } = window.location
if (['shields.io', 'www.shields.io'].includes(hostname)) {
return 'https://img.shields.io'
}
return `${protocol}//${hostname}`
} catch (e) {
// server-side rendering
return ''
}
}

View File

@@ -21,19 +21,11 @@ export function removeRegexpFromPattern(pattern: string): string {
if (typeof token === 'string') {
return token
} else {
const { delimiter, optional, repeat, name, pattern } = token
const { prefix, modifier, name, pattern } = token
if (typeof name === 'number') {
return `${delimiter}(${pattern})`
return `${prefix}(${pattern})`
} else {
let modifier = ''
if (optional && !repeat) {
modifier = '?'
} else if (!optional && repeat) {
modifier = '+'
} else if (optional && repeat) {
modifier = '*'
}
return `${delimiter}:${name}${modifier}`
return `${prefix}:${name}${modifier}`
}
}
})

View File

@@ -1,6 +1,6 @@
import React from 'react'
import styled from 'styled-components'
import { baseUrl } from '../constants'
import { getBaseUrl } from '../constants'
import Meta from '../components/meta'
import Header from '../components/header'
import Footer from '../components/footer'
@@ -19,6 +19,7 @@ const SponsorContainer = styled.div`
`
export default function SponsorsPage(): JSX.Element {
const baseUrl = getBaseUrl()
return (
<MainContainer>
<GlobalStyle />
@@ -114,9 +115,6 @@ export default function SponsorsPage(): JSX.Element {
<li>
<a href="https://lgtm.com/">LGTM</a>
</li>
<li>
<a href="https://www.netlify.com/">Netlify</a>
</li>
<li>
<a href="https://uptimerobot.com/">Uptime Robot</a>
</li>

View File

@@ -1,7 +1,7 @@
import React from 'react'
import styled, { css } from 'styled-components'
import { staticBadgeUrl } from '../../core/badge-urls/make-badge-url'
import { baseUrl } from '../constants'
import { getBaseUrl } from '../constants'
import Meta from '../components/meta'
import Header from '../components/header'
import Footer from '../components/footer'
@@ -89,6 +89,7 @@ const Schema = styled.dl`
`
export default function EndpointPage(): JSX.Element {
const baseUrl = getBaseUrl()
return (
<MainContainer>
<GlobalStyle />
@@ -209,7 +210,7 @@ export default function EndpointPage(): JSX.Element {
<dt>logoColor</dt>
<dd>
Default: none. Same meaning as the query string. Can be overridden by
the query string.
the query string. Only works for named logos.
</dd>
<dt>logoWidth</dt>
<dd>

View File

@@ -1,5 +1,7 @@
'use strict'
const path = require('path')
module.exports = {
siteMetadata: {
title: 'Shields.io: Quality metadata badges for open source projects',
@@ -11,7 +13,7 @@ module.exports = {
{
resolve: 'gatsby-plugin-page-creator',
options: {
path: `${__dirname}/frontend/pages`,
path: path.join(__dirname, 'frontend', 'pages'),
},
},
'gatsby-plugin-react-helmet',

View File

@@ -12,7 +12,7 @@ const envFlag = require('node-env-flag')
const includeDevPages = envFlag(process.env.INCLUDE_DEV_PAGES, true)
const { categories } = yaml.safeLoad(
const { categories } = yaml.load(
fs.readFileSync('./service-definitions.yml', 'utf8')
)

View File

@@ -6,6 +6,7 @@ const {
prependPrefix,
isDataUrl,
prepareNamedLogo,
getSimpleIcon,
makeLogo,
} = require('./logos')
@@ -98,6 +99,13 @@ describe('Logo helpers', function () {
})
})
test(getSimpleIcon, () => {
// https://github.com/badges/shields/issues/4016
given({ name: 'get' }).expect(undefined)
// https://github.com/badges/shields/issues/4263
given({ name: 'get', color: 'blue' }).expect(undefined)
})
test(makeLogo, () => {
forCases([
given('npm', { logo: 'image/svg+xml;base64,PHN2ZyB4bWxu' }),

View File

@@ -1,15 +0,0 @@
'use strict'
const fs = require('fs')
const path = require('path')
const config = require('config').util.toObject()
const legacySecretsPath = path.join(__dirname, '..', 'private', 'secret.json')
if (fs.existsSync(legacySecretsPath)) {
console.error(
`Legacy secrets file found at ${legacySecretsPath}. It should be deleted and secrets replaced with environment variables or config/local.yml`
)
process.exit(1)
}
module.exports = config.private

12876
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,47 +22,45 @@
"url": "https://github.com/badges/shields"
},
"dependencies": {
"joi": "17.2.1",
"@sentry/node": "^5.24.2",
"@shields_io/camp": "^18.0.0",
"@sentry/node": "^5.30.0",
"@shields_io/camp": "^18.1.1",
"badge-maker": "file:badge-maker",
"bytes": "^3.1.0",
"camelcase": "^5.3.1",
"chai-as-promised": "^7.1.1",
"camelcase": "^6.2.0",
"chalk": "^4.1.0",
"check-node-version": "^4.0.3",
"chrome-web-store-item-property": "~1.2.0",
"config": "^3.3.2",
"cross-env": "^7.0.2",
"decamelize": "^3.2.0",
"dotenv": "^8.2.0",
"cloudflare-middleware": "^1.0.4",
"config": "^3.3.3",
"cross-env": "^7.0.3",
"decamelize": "^5.0.0",
"emojic": "^1.1.16",
"escape-string-regexp": "^4.0.0",
"fast-xml-parser": "^3.17.4",
"fsos": "^1.1.6",
"fast-xml-parser": "^3.17.6",
"glob": "^7.1.6",
"graphql": "^14.7.0",
"graphql-tag": "^2.11.0",
"ioredis": "4.17.3",
"ioredis": "4.19.4",
"joi": "17.3.0",
"joi-extension-semver": "5.0.0",
"js-yaml": "^3.14.0",
"jsonpath": "~1.0.2",
"js-yaml": "^4.0.0",
"jsonpath": "~1.1.0",
"lodash.countby": "^4.6.0",
"lodash.groupby": "^4.6.0",
"lodash.times": "^4.3.2",
"moment": "^2.29.0",
"moment": "^2.29.1",
"node-env-flag": "^0.1.0",
"parse-link-header": "^1.0.1",
"path-to-regexp": "^5.0.0",
"pretty-bytes": "^5.4.1",
"path-to-regexp": "^6.2.0",
"pretty-bytes": "^5.5.0",
"priorityqueuejs": "^2.0.0",
"prom-client": "^11.5.3",
"query-string": "^6.13.2",
"prom-client": "^13.0.0",
"query-string": "^6.13.8",
"request": "~2.88.2",
"semver": "~7.3.2",
"simple-icons": "3.10.0",
"xmldom": "~0.2.1",
"xpath": "~0.0.29"
"semver": "~7.3.4",
"simple-icons": "4.6.0",
"webextension-store-meta": "^1.0.3",
"xmldom": "~0.4.0",
"xpath": "~0.0.32"
},
"scripts": {
"coverage:test:core": "nyc npm run test:core",
@@ -97,8 +95,6 @@
"check-types:package": "tsd badge-maker",
"check-types:frontend": "tsc --noEmit --project .",
"depcheck": "check-node-version --node \">= 12.0\"",
"fix-issue-5294": "rimraf node_modules/@types/react-native",
"postinstall": "run-s --silent depcheck fix-issue-5294",
"prebuild": "run-s --silent depcheck",
"features": "node scripts/export-supported-features-cli.js > supported-features.json",
"defs": "node scripts/export-service-definitions-cli.js > service-definitions.yml",
@@ -116,10 +112,10 @@
"e2e": "start-server-and-test start http://localhost:3000 test:e2e",
"e2e-on-build": "cross-env CYPRESS_baseUrl=http://localhost:8080 start-server-and-test start:server:e2e-on-build http://localhost:8080 test:e2e",
"badge": "cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true node scripts/badge-cli.js",
"build-docs": "rimraf api-docs/ && jsdoc --pedantic -c ./jsdoc.json ."
"build-docs": "rimraf api-docs/ && jsdoc --pedantic -c ./jsdoc.json . && echo 'contributing.shields.io' > api-docs/CNAME"
},
"lint-staged": {
"**/*.js": [
"**/*.@(js|ts|tsx)": [
"eslint --fix",
"prettier --write"
],
@@ -142,108 +138,105 @@
]
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/polyfill": "^7.11.5",
"@babel/register": "7.11.5",
"@babel/core": "^7.12.10",
"@babel/polyfill": "^7.12.1",
"@babel/register": "7.12.10",
"@mapbox/react-click-to-select": "^2.2.0",
"@types/chai": "^4.2.12",
"@types/chai": "^4.2.14",
"@types/lodash.debounce": "^4.0.6",
"@types/lodash.groupby": "^4.6.6",
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.2",
"@types/mocha": "^8.2.0",
"@types/node": "^14.14.21",
"@types/react-helmet": "^6.1.0",
"@types/react-modal": "^3.10.6",
"@types/react-select": "^3.0.21",
"@types/styled-components": "5.1.3",
"@types/react-select": "^3.1.2",
"@types/styled-components": "5.1.7",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"babel-plugin-inline-react-svg": "^1.1.1",
"babel-plugin-inline-react-svg": "^1.1.2",
"babel-plugin-istanbul": "^6.0.0",
"babel-preset-gatsby": "^0.5.1",
"caller": "^1.0.1",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai-datetime": "^1.7.0",
"chai-string": "^1.4.0",
"cheerio": "^1.0.0-rc.3",
"child-process-promise": "^2.2.1",
"clipboard-copy": "^3.1.0",
"clipboard-copy": "^4.0.1",
"concurrently": "^5.3.0",
"cypress": "^5.3.0",
"danger": "^10.4.1",
"cypress": "^6.2.1",
"danger": "^10.6.0",
"danger-plugin-no-test-shortcuts": "^2.0.0",
"deepmerge": "^4.2.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.12.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-jsx": "^10.0.0",
"eslint-config-standard-react": "^11.0.1",
"eslint-plugin-chai-friendly": "^0.6.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsdoc": "^30.6.3",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^30.7.13",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-no-extension-in-require": "^0.2.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.3",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^2.5.1",
"eslint-plugin-sort-class-members": "^1.8.0",
"eslint-plugin-standard": "^4.0.1",
"fetch-ponyfill": "^6.1.1",
"eslint-plugin-sort-class-members": "^1.9.0",
"fetch-ponyfill": "^7.0.0",
"form-data": "^3.0.0",
"fs-readfile-promise": "^3.0.1",
"gatsby": "2.24.65",
"gatsby": "2.30.2",
"gatsby-plugin-catch-links": "^2.3.10",
"gatsby-plugin-page-creator": "^2.3.30",
"gatsby-plugin-page-creator": "^2.8.0",
"gatsby-plugin-react-helmet": "^3.3.9",
"gatsby-plugin-remove-trailing-slashes": "^2.3.10",
"gatsby-plugin-styled-components": "^3.3.9",
"gatsby-plugin-typescript": "^2.4.16",
"got": "11.7.0",
"gatsby-plugin-typescript": "^2.5.0",
"got": "11.8.1",
"humanize-string": "^2.1.0",
"husky": "^4.3.0",
"husky": "^4.3.7",
"icedfrisby": "4.0.0",
"icedfrisby-nock": "^2.0.0",
"is-png": "^2.0.0",
"is-svg": "^4.2.1",
"js-yaml-loader": "^1.2.2",
"jsdoc": "^3.6.6",
"lint-staged": "^10.4.0",
"lint-staged": "^10.5.3",
"lodash.debounce": "^4.0.8",
"lodash.difference": "^4.5.0",
"minimist": "^1.2.5",
"mocha": "^7.2.0",
"mocha": "^8.2.1",
"mocha-env-reporter": "^4.0.0",
"mocha-junit-reporter": "^2.0.0",
"mocha-yaml-loader": "^1.0.3",
"nock": "13.0.4",
"node-mocks-http": "^1.9.0",
"nodemon": "^2.0.4",
"nock": "13.0.5",
"node-mocks-http": "^1.10.0",
"nodemon": "^2.0.7",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"opn-cli": "^5.0.0",
"portfinder": "^1.0.28",
"prettier": "2.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-error-overlay": "^6.0.7",
"prettier": "2.2.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-error-overlay": "^6.0.8",
"react-helmet": "^6.1.0",
"react-modal": "^3.11.2",
"react-modal": "^3.12.1",
"react-pose": "^4.0.10",
"react-select": "^3.1.0",
"react-select": "^3.2.0",
"read-all-stdin-sync": "^1.0.5",
"redis-server": "^1.2.2",
"require-hacker": "^3.0.1",
"rimraf": "^3.0.2",
"sazerac": "^2.0.0",
"sinon": "^9.1.0",
"sinon": "^9.2.3",
"sinon-chai": "^3.5.0",
"snap-shot-it": "^7.9.3",
"start-server-and-test": "1.11.5",
"styled-components": "^5.2.0",
"tmp": "0.2.1",
"tsd": "^0.13.1",
"ts-mocha": "^7.0.0",
"typescript": "^4.0.3"
"start-server-and-test": "1.11.7",
"styled-components": "^5.2.1",
"ts-mocha": "^8.0.0",
"tsd": "^0.14.0",
"typescript": "^4.1.3"
},
"engines": {
"node": "^12.18.3",

1
readme-logo.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="198" height="58"><rect rx="8" x="140" width="55" height="58" fill="#555" /><g stroke="#555" stroke-width="8"><path d="M135.5 54a8 8 0 0 0 8.5 -8.5"/><rect x="4" y="4" rx="8" width="190" height="50" fill="none"/></g><g fill="#555"><path d="m23.906 33.641c.953-.083 1.906-.167 2.859-.25.108 2.099 1.511 4.139 3.578 4.722 2.438.895 5.357.799 7.559-.658 1.49-1.129 1.861-3.674.324-4.925-1.557-1.322-3.685-1.504-5.576-2.057-2.343-.565-4.912-1.133-6.611-2.979-1.805-2.088-1.627-5.485.292-7.443 2.041-2.113 5.222-2.55 8.02-2.274 2.46.244 5.058 1.343 6.252 3.635.426.908 1.095 2.241.656 3.108-.888.173-1.81.148-2.715.245-.077-2.084-1.727-4.073-3.863-4.234-1.902-.317-4.02-.252-5.691.802-1.398.989-1.849 3.363-.381 4.494 1.281 1.01 2.962 1.199 4.482 1.642 2.66.627 5.602 1.118 7.596 3.158 2 2.188 1.893 5.84-.088 8.01-2.01 2.32-5.304 2.972-8.237 2.713-2.585-.147-5.319-1.024-6.916-3.184-.987-1.288-1.517-2.905-1.542-4.523"/><path d="m45.953 41c0-7.635 0-15.271 0-22.906.938 0 1.875 0 2.813 0 0 2.74 0 5.479 0 8.219 1.391-1.721 3.69-2.523 5.86-2.236 1.975.154 4.03 1.371 4.513 3.402.504 1.973.278 4.02.33 6.04 0 2.495 0 4.989 0 7.484-.938 0-1.875 0-2.813 0-.009-3.675.018-7.351-.014-11.03-.026-1.342-.627-2.835-2-3.282-2.187-.802-5.077.393-5.609 2.773-.417 1.764-.216 3.586-.264 5.381 0 2.051 0 4.102 0 6.153-.938 0-1.875 0-2.813 0"/><path d="m63.781 21.328v-3.234h2.813v3.234zm0 19.672v-16.594h2.813v16.594z"/><path d="m82.25 35.656c.969.12 1.938.24 2.906.359-.702 3.464-4.348 5.767-7.781 5.386-3.235-.066-6.43-2.328-7.06-5.598-.843-3.307-.404-7.285 2.101-9.784 3.082-3 8.699-2.618 11.235.892 1.374 1.85 1.676 4.267 1.578 6.51-4.125 0-8.25 0-12.375 0-.142 2.889 2.267 6 5.346 5.658 1.881-.162 3.613-1.566 4.045-3.423m-9.234-4.547c3.089 0 6.177 0 9.266 0 .129-2.774-2.616-5.422-5.419-4.713-2.174.427-3.912 2.474-3.846 4.713"/><path d="m88.64 41v-22.906h2.813v22.906z"/><path d="m106.59 41c0-.698 0-1.396 0-2.094-1.412 2.442-4.776 3.067-7.233 1.949-2.378-1.02-3.971-3.403-4.345-5.924-.507-2.761-.123-5.768 1.389-8.167 1.863-2.705 5.968-3.642 8.711-1.741.422.228 1.028 1.144 1.294 1.018-.006-2.649-.0001-5.298-.003-7.948.932 0 1.865 0 2.797 0 0 7.635 0 15.271 0 22.906-.87 0-1.74 0-2.61 0m-8.89-8.281c-.075 2.246.637 4.861 2.79 5.952 2 1.023 4.682-.047 5.488-2.134.897-1.996.746-4.278.388-6.382-.425-1.95-2.046-3.804-4.158-3.805-1.903-.065-3.633 1.363-4.099 3.181-.327 1.028-.394 2.116-.408 3.188"/><path d="m112.52 36.05c.927-.146 1.854-.292 2.781-.438.126 1.69 1.513 3.244 3.239 3.365 1.398.212 3.01.12 4.12-.851.807-.749 1.1-2.243.159-3.01-.908-.723-2.115-.812-3.182-1.172-1.797-.485-3.713-.848-5.243-1.97-1.83-1.551-1.868-4.679-.099-6.293 1.577-1.507 3.918-1.784 6-1.594 1.685.176 3.54.749 4.535 2.217.464.715.708 1.549.844 2.384-.917.125-1.833.25-2.75.375-.121-1.569-1.653-2.762-3.19-2.695-1.246-.082-2.702.012-3.608.982-.624.724-.543 1.971.314 2.481.998.706 2.269.757 3.389 1.173 1.754.512 3.647.848 5.141 1.965 1.686 1.476 1.728 4.244.396 5.966-1.298 1.788-3.597 2.417-5.709 2.448-1.466-.007-2.984-.214-4.299-.893-1.599-.909-2.585-2.655-2.84-4.444"/></g><g fill="#fff"><path d="m151.11 41v-22.906h3.03v22.906z"/><path d="m158.55 29.844c-.277-4.765 2.335-9.977 7.05-11.551 4.902-1.757 11.226.197 13.477 5.098 2.266 4.706 1.89 10.92-1.767 14.833-4.554 4.948-13.81 3.976-17.08-1.954-1.111-1.946-1.679-4.188-1.68-6.426m3.125.047c-.377 4.273 2.892 8.844 7.375 8.951 3.791.221 7.557-2.653 7.997-6.497.794-3.731.139-8.292-3.107-10.696-3.788-2.814-10.05-1.104-11.591 3.444-.54 1.539-.642 3.181-.675 4.798"/></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -9,4 +9,4 @@ const definitions = collectDefinitions()
// https://github.com/nodeca/js-yaml/issues/356#issuecomment-312430599
const cleaned = JSON.parse(JSON.stringify(definitions))
process.stdout.write(yaml.safeDump(cleaned, { flowLevel: 5 }))
process.stdout.write(yaml.dump(cleaned, { flowLevel: 5 }))

View File

@@ -1,50 +0,0 @@
'use strict'
const { promises: fs } = require('fs')
const Redis = require('ioredis')
const key = 'githubUserTokens'
async function loadTokens() {
const contents = await fs.readFile('all_tokens_uniq.json', 'utf8')
const tokens = JSON.parse(contents)
console.log(`${tokens.length} tokens loaded`)
return tokens
}
function createClient() {
const redis = new Redis(process.env.REDIS_URL, {
tls: { servername: new URL(process.env.REDIS_URL).hostname },
})
redis.on('error', err => {
console.error(err)
})
return redis
}
async function load() {
const redis = createClient()
const tokens = await loadTokens()
await redis.sadd(key, tokens)
await redis.quit()
}
async function list() {
const redis = createClient()
const tokens = await redis.smembers(key)
console.log(`${tokens.length} tokens loaded`)
await redis.quit()
}
;(async () => {
try {
// await load()
await list()
} catch (e) {
console.error(e)
process.exit(1)
}
})()
// Appease the linter.
module.exports = { load, list }

View File

@@ -5,7 +5,6 @@ console.log(config)
const GithubConstellation = require('../services/github/github-constellation')
const { persistence } = new GithubConstellation({
persistence: config.public.persistence,
service: config.public.services.github,
private: config.private,
})

35
scripts/run_package_tests.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
# https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/3
# Start off less strict to work around various nvm errors.
set -e
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
nvm install $NODE_VERSION
nvm use $NODE_VERSION
# Stricter.
set -euo pipefail
node --version
# Install the shields.io dependencies.
if [[ "$NODE_VERSION" == "v10" ]]; then
# Avoid a depcheck error.
npm ci --ignore-scripts
else
npm ci
fi
# Run the package tests.
npm run test:package
npm run check-types:package
# Delete the shields.io dependencies.
rm -rf node_modules/
# Run a smoke test (render a badge with the CLI) with only the package
# dependencies installed.
cd badge-maker
npm link
badge cactus grown :green @flat

View File

@@ -4,8 +4,6 @@
const fs = require('fs')
const path = require('path')
require('dotenv').config()
// Set up Sentry reporting as early in the process as possible.
const config = require('config').util.toObject()
const Sentry = require('@sentry/node')
@@ -37,6 +35,13 @@ if (process.argv[3]) {
console.log('Configuration:')
console.dir(config.public, { depth: null })
if (fs.existsSync('.env')) {
console.error(
'Legacy .env file found. It should be deleted and replaced with environment variables or config/local.yml'
)
process.exit(1)
}
const legacySecretsPath = path.join(__dirname, 'private', 'secret.json')
if (fs.existsSync(legacySecretsPath)) {
console.error(

View File

@@ -18,7 +18,9 @@ class AnsibleGalaxyContent extends BaseJsonService {
}
}
module.exports = class AnsibleGalaxyContentQualityScore extends AnsibleGalaxyContent {
module.exports = class AnsibleGalaxyContentQualityScore extends (
AnsibleGalaxyContent
) {
static category = 'analysis'
static route = { base: 'ansible/quality', pattern: ':projectId' }

View File

@@ -100,10 +100,8 @@ module.exports = class AppVeyorTests extends AppVeyorBase {
},
]
static get defaultBadgeData() {
return {
label: 'tests',
}
static defaultBadgeData = {
label: 'tests',
}
static render({

View File

@@ -168,30 +168,22 @@ class AurMaintainer extends BaseAurService {
}
class AurLastModified extends BaseAurService {
static get category() {
return 'activity'
static category = 'activity'
static route = {
base: 'aur/last-modified',
pattern: ':packageName',
}
static get route() {
return {
base: 'aur/last-modified',
pattern: ':packageName',
}
}
static examples = [
{
title: 'AUR last modified',
namedParams: { packageName: 'google-chrome' },
staticPreview: this.render({ date: new Date().getTime() }),
},
]
static get examples() {
return [
{
title: 'AUR last modified',
namedParams: { packageName: 'google-chrome' },
staticPreview: this.render({ date: new Date().getTime() }),
},
]
}
static get defaultBadgeData() {
return { label: 'last modified' }
}
static defaultBadgeData = { label: 'last modified' }
static render({ date }) {
const color = ageColor(date)

18
services/aur/aur.spec.js Normal file
View File

@@ -0,0 +1,18 @@
'use strict'
const { test, given } = require('sazerac')
const { AurVersion } = require('./aur.service')
describe('AurVersion', function () {
test(AurVersion.render, () => {
given({ version: '1:1.1.42.622-1', outOfDate: 1 }).expect({
color: 'orange',
message: 'v1:1.1.42.622-1',
})
given({ version: '7', outOfDate: null }).expect({
color: 'blue',
message: 'v7',
})
})
})

View File

@@ -22,14 +22,6 @@ t.create('version (valid)')
color: 'blue',
})
t.create('version (valid, out of date)')
.get('/version/gog-gemini-rue.json')
.expectBadge({
label: 'aur',
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
color: 'orange',
})
t.create('version (not found)')
.get('/version/not-a-package.json')
.expectBadge({ label: 'aur', message: 'package not found' })

View File

@@ -15,12 +15,10 @@ const latestBuildSchema = Joi.object({
}).required()
module.exports = class AzureDevOpsBase extends BaseJsonService {
static get auth() {
return {
passKey: 'azure_devops_token',
authorizedOrigins: ['https://dev.azure.com'],
defaultToEmptyStringForUser: true,
}
static auth = {
passKey: 'azure_devops_token',
authorizedOrigins: ['https://dev.azure.com'],
defaultToEmptyStringForUser: true,
}
async fetch({ url, options, schema, errorMessages }) {

View File

@@ -1,22 +1,19 @@
'use strict'
const chromeWebStore = require('chrome-web-store-item-property')
const ChromeWebStore = require('webextension-store-meta/lib/chrome-web-store')
const checkErrorResponse = require('../../core/base-service/check-error-response')
const { BaseService, Inaccessible } = require('..')
module.exports = class BaseChromeWebStoreService extends BaseService {
async fetch({ storeId }) {
try {
return await chromeWebStore(storeId)
return await ChromeWebStore.load({ id: storeId })
} catch (e) {
if (e.statusCode === undefined) {
const statusCode = parseInt(e.message)
if (isNaN(statusCode)) {
throw new Inaccessible({ underlyingError: e })
}
/*
chrome-web-store-item-property's `HTTPError` object has a
`statusCode` property so we can pass `e` to `checkErrorResponse`
to throw the correct `ShieldsRuntimeError` for us.
*/
e.statusCode = statusCode
return checkErrorResponse({})({ buffer: '', res: e })
}
}

View File

@@ -1,6 +1,7 @@
'use strict'
const { currencyFromCode } = require('../text-formatters')
const { NotFound } = require('..')
const BaseChromeWebStoreService = require('./chrome-web-store-base')
module.exports = class ChromeWebStorePrice extends BaseChromeWebStoreService {
@@ -25,7 +26,12 @@ module.exports = class ChromeWebStorePrice extends BaseChromeWebStoreService {
}
async handle({ storeId }) {
const { priceCurrency, price } = await this.fetch({ storeId })
const chromeWebStore = await this.fetch({ storeId })
const priceCurrency = chromeWebStore.priceCurrency()
const price = chromeWebStore.price()
if (priceCurrency == null || price == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return this.constructor.render({ priceCurrency, price })
}
}

View File

@@ -1,33 +1,115 @@
'use strict'
const { deprecatedService } = require('..')
const { floorCount: floorCountColor } = require('../color-formatters')
const { metric, starRating } = require('../text-formatters')
const { NotFound } = require('..')
const BaseChromeWebStoreService = require('./chrome-web-store-base')
const commonAttrs = {
category: 'rating',
label: 'rating',
dateAdded: new Date('2020-09-06'),
class BaseChromeWebStoreRating extends BaseChromeWebStoreService {
static category = 'rating'
static defaultBadgeData = { label: 'rating' }
}
module.exports = [
deprecatedService({
route: {
base: 'chrome-web-store/rating',
pattern: ':storeId',
class ChromeWebStoreRating extends BaseChromeWebStoreRating {
static route = {
base: 'chrome-web-store/rating',
pattern: ':storeId',
}
static examples = [
{
title: 'Chrome Web Store',
namedParams: { storeId: 'ogffaloegjglncjfehdfplabnoondfjo' },
staticPreview: this.render({ rating: '3.67' }),
},
...commonAttrs,
}),
deprecatedService({
route: {
base: 'chrome-web-store/rating-count',
pattern: ':storeId',
]
static render({ rating }) {
rating = Math.round(rating * 100) / 100
return {
message: `${rating}/5`,
color: floorCountColor(rating, 2, 3, 4),
}
}
async handle({ storeId }) {
const chromeWebStore = await this.fetch({ storeId })
const rating = chromeWebStore.ratingValue()
if (rating == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return this.constructor.render({ rating })
}
}
class ChromeWebStoreRatingCount extends BaseChromeWebStoreRating {
static route = {
base: 'chrome-web-store/rating-count',
pattern: ':storeId',
}
static examples = [
{
title: 'Chrome Web Store',
namedParams: { storeId: 'ogffaloegjglncjfehdfplabnoondfjo' },
staticPreview: this.render({ ratingCount: 12 }),
},
...commonAttrs,
}),
deprecatedService({
route: {
base: 'chrome-web-store/stars',
pattern: ':storeId',
]
static render({ ratingCount }) {
return {
message: `${metric(ratingCount)} total`,
color: floorCountColor(ratingCount, 5, 50, 500),
}
}
async handle({ storeId }) {
const chromeWebStore = await this.fetch({
storeId,
property: 'ratingCount',
})
const ratingCount = chromeWebStore.ratingCount()
if (ratingCount == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return this.constructor.render({ ratingCount })
}
}
class ChromeWebStoreRatingStars extends BaseChromeWebStoreRating {
static route = {
base: 'chrome-web-store/stars',
pattern: ':storeId',
}
static examples = [
{
title: 'Chrome Web Store',
namedParams: { storeId: 'ogffaloegjglncjfehdfplabnoondfjo' },
staticPreview: this.render({ rating: '3.75' }),
},
...commonAttrs,
}),
]
]
static render({ rating }) {
return {
message: starRating(rating),
color: floorCountColor(rating, 2, 3, 4),
}
}
async handle({ storeId }) {
const chromeWebStore = await this.fetch({ storeId })
const rating = chromeWebStore.ratingValue()
if (rating == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return this.constructor.render({ rating })
}
}
module.exports = {
ChromeWebStoreRating,
ChromeWebStoreRatingCount,
ChromeWebStoreRatingStars,
}

View File

@@ -1,5 +1,7 @@
'use strict'
const Joi = require('joi')
const { isStarRating } = require('../test-validators')
const { ServiceTester } = require('../tester')
const t = (module.exports = new ServiceTester({
@@ -9,13 +11,37 @@ const t = (module.exports = new ServiceTester({
}))
t.create('Rating')
.get('/rating/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.expectBadge({
label: 'rating',
message: Joi.string().regex(/^\d\.?\d+?\/5$/),
})
t.create('Rating (not found)')
.get('/rating/invalid-name-of-addon.json')
.expectBadge({ label: 'rating', message: 'no longer available' })
.expectBadge({ label: 'rating', message: 'not found' })
t.create('Rating Count')
.get('/rating-count/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.expectBadge({
label: 'rating',
message: Joi.string().regex(/^\d+?\stotal$/),
})
t.create('Rating Count (not found)')
.get('/rating-count/invalid-name-of-addon.json')
.expectBadge({ label: 'rating', message: 'no longer available' })
.expectBadge({ label: 'rating', message: 'not found' })
t.create('Stars')
.get('/stars/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.expectBadge({ label: 'rating', message: 'no longer available' })
.expectBadge({ label: 'rating', message: isStarRating })
t.create('Stars (not found)')
.get('/stars/invalid-name-of-addon.json')
.expectBadge({ label: 'rating', message: 'not found' })
// Keep this "inaccessible" test, since this service does not use BaseService#_request.
t.create('Rating (inaccessible)')
.get('/rating/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.networkOff()
.expectBadge({ label: 'rating', message: 'inaccessible' })

View File

@@ -27,13 +27,12 @@ class ChromeWebStoreUsers extends BaseChromeWebStoreService {
}
async handle({ storeId }) {
const data = await this.fetch({ storeId })
if (!data.interactionCount || !data.interactionCount.UserDownloads) {
throw new NotFound({ prettyMessage: 'count not found' })
const chromeWebStore = await this.fetch({ storeId })
const downloads = chromeWebStore.users()
if (downloads == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return this.constructor.render({
downloads: data.interactionCount.UserDownloads,
})
return this.constructor.render({ downloads })
}
}

View File

@@ -2,17 +2,6 @@
const { isMetric } = require('../test-validators')
const { ServiceTester } = require('../tester')
const pageWithoutUserDownloads = `<!DOCTYPE html>
<html>
<body>
<span>
<meta itemprop="url" content="https://chrome.google.com/webstore/detail/night-video-tuner/ogffaloegjglncjfehdfplabnoondfjo"/>
<!--
<meta itemprop="interactionCount" content="UserDownloads:547"/>
-->
</span>
</body>
</html>`
const t = (module.exports = new ServiceTester({
id: 'ChromeWebStoreUsers',
@@ -30,19 +19,6 @@ t.create('Users')
.get('/users/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.expectBadge({ label: 'users', message: isMetric })
t.create('Users (count not found)')
.get('/users/ogffaloegjglncjfehdfplabnoondfjo.json')
.intercept(nock =>
nock('https://chrome.google.com')
.get('/webstore/detail/ogffaloegjglncjfehdfplabnoondfjo?hl=en&gl=US')
.reply(200, pageWithoutUserDownloads)
)
.expectBadge({
label: 'users',
message: 'count not found',
color: 'red',
})
t.create('Users (not found)')
.get('/users/invalid-name-of-addon.json')
.expectBadge({ label: 'users', message: 'not found' })

View File

@@ -1,6 +1,7 @@
'use strict'
const { renderVersionBadge } = require('../version')
const { NotFound } = require('..')
const BaseChromeWebStoreService = require('./chrome-web-store-base')
module.exports = class ChromeWebStoreVersion extends BaseChromeWebStoreService {
@@ -18,7 +19,11 @@ module.exports = class ChromeWebStoreVersion extends BaseChromeWebStoreService {
static defaultBadgeData = { label: 'chrome web store' }
async handle({ storeId }) {
const data = await this.fetch({ storeId })
return renderVersionBadge({ version: data.version })
const chromeWebStore = await this.fetch({ storeId })
const version = chromeWebStore.version()
if (version == null) {
throw new NotFound({ prettyMessage: 'not found' })
}
return renderVersionBadge({ version })
}
}

View File

@@ -1,74 +1,13 @@
'use strict'
const Joi = require('joi')
const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
const { BaseJsonService } = require('..')
const { deprecatedService } = require('..')
const schema = Joi.object({
status: Joi.alternatives().try(isBuildStatus, Joi.equal('unknown')),
}).required()
const statusMap = {
unstable: 'yellow',
running: 'blue',
}
module.exports = class ContinuousPhp extends BaseJsonService {
static category = 'build'
static route = {
module.exports = deprecatedService({
category: 'build',
route: {
base: 'continuousphp',
pattern: ':provider/:user/:repo/:branch*',
}
static examples = [
{
title: 'continuousphp',
pattern: ':provider/:user/:repo',
namedParams: {
provider: 'git-hub',
user: 'doctrine',
repo: 'dbal',
},
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
},
{
title: 'continuousphp',
pattern: ':provider/:user/:repo/:branch',
namedParams: {
provider: 'git-hub',
user: 'doctrine',
repo: 'dbal',
branch: 'master',
},
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
},
]
static defaultBadgeData = { label: 'continuousphp' }
static render({ status }) {
const badge = renderBuildStatusBadge({ label: 'build', status })
const customColor = statusMap[status]
if (customColor) {
badge.color = customColor
}
return badge
}
async fetch({ provider, user, repo, branch }) {
const url = `https://status.continuousphp.com/${provider}/${user}/${repo}/status-info`
return this._requestJson({
schema,
url,
options: { qs: { branch } },
errorMessages: {
404: 'project not found',
},
})
}
async handle({ provider, user, repo, branch }) {
const json = await this.fetch({ provider, user, repo, branch })
return this.constructor.render({ status: json.status })
}
}
pattern: ':various+',
},
label: 'continuousphp',
dateAdded: new Date('2020-12-12'),
})

View File

@@ -1,19 +0,0 @@
'use strict'
const { test, given } = require('sazerac')
const ContinuousPhp = require('./continuousphp.service')
describe('ContinuousPhp', function () {
test(ContinuousPhp.render, () => {
given({ status: 'unstable' }).expect({
label: 'build',
message: 'unstable',
color: 'yellow',
})
given({ status: 'running' }).expect({
label: 'build',
message: 'running',
color: 'blue',
})
})
})

View File

@@ -1,23 +1,22 @@
'use strict'
const Joi = require('joi')
const { isBuildStatus } = require('../build-status')
const t = (module.exports = require('../tester').createServiceTester())
const { ServiceTester } = require('../tester')
t.create('build status on default branch')
const t = (module.exports = new ServiceTester({
id: 'continuousphp',
title: 'Continuousphp',
}))
t.create('no longer available (previously build status on default branch)')
.get('/git-hub/doctrine/dbal.json')
.expectBadge({
label: 'build',
message: Joi.alternatives().try(isBuildStatus, Joi.equal('unknown')),
label: 'continuousphp',
message: 'no longer available',
})
t.create('build status on named branch')
t.create('no longer available (previously build status on named branch)')
.get('/git-hub/doctrine/dbal/develop.json')
.expectBadge({
label: 'build',
message: Joi.alternatives().try(isBuildStatus, Joi.equal('unknown')),
label: 'continuousphp',
message: 'no longer available',
})
t.create('unknown repo')
.get('/git-hub/this-repo/does-not-exist.json')
.expectBadge({ label: 'continuousphp', message: 'project not found' })

View File

@@ -1,11 +1,11 @@
'use strict'
const { NonMemoryCachingBaseService } = require('..')
const { BaseService } = require('..')
const serverStartTime = new Date(new Date().toGMTString())
let bitFlip = false
module.exports = class Debug extends NonMemoryCachingBaseService {
module.exports = class Debug extends BaseService {
static category = 'debug'
static route = { base: 'debug', pattern: ':variant(time|starttime|flip)' }

View File

@@ -2935,10 +2935,111 @@ const versionDataWithTag = [
{ name: '2.6', images: [] },
]
const versionDataWithVaryingArchitectures = [
{
name: '3.9.5',
images: [
{
digest:
'sha256:fa5361fbf636d3ac50cb529dab20d810eb466de2079f5710cef4cbada29cf499',
architecture: 'ppc64le',
},
{
digest:
'sha256:97e9e9a15ef94526018e2fabfdfff14781e58b87f989d2e70543f296dcad26c6',
architecture: 's390x',
},
{
digest:
'sha256:cae6522b6a351615e547ae9222c9a05d172bc5c3240eec03072d4e1d0429a17a',
architecture: 'arm64',
},
],
},
{
name: '3.9',
images: [
{
digest:
'sha256:c7b3e8392e08c971e98627e2bddd10c7fa9d2eae797a16bc94de9709bb9300d0',
architecture: '386',
},
{
digest:
'sha256:5292cebaf695db860087c5582d340a406613891b2819092747b0388da47936c8',
architecture: 'arm',
},
],
},
{
name: '3.8.5',
images: [
{
digest:
'sha256:dabea2944dcc2b86482b4f0b0fb62da80e0673e900c46c0e03b45919881a5d84',
architecture: 'arm',
},
{
digest:
'sha256:514ec80ffbe1a2ab1d9a3d5e6082296296a1d8b6870246edf897228e5df2367d',
architecture: 's390x',
},
{
digest:
'sha256:ab3fe83c0696e3f565c9b4a734ec309ae9bd0d74c192de4590fd6dc2ef717815',
architecture: 'amd64',
},
],
},
{
name: '3.8',
images: [
{
digest:
'sha256:cf35b4fa14e23492df67af08ced54a15e68ad00cac545b437b1994340f20648c',
architecture: '386',
},
{
digest:
'sha256:514ec80ffbe1a2ab1d9a3d5e6082296296a1d8b6870246edf897228e5df2367d',
architecture: 's390x',
},
{
digest:
'sha256:402d21757a03a114d273bbe372fa4b9eca567e8b6c332fa7ebf982b902207242',
architecture: 'ppc64le',
},
],
},
{
name: '3.10.4',
images: [
{
digest:
'sha256:2632d6288d34d7175021683f6e363fa7c0fa8866a565eb285e36e3b856545e82',
architecture: 'arm',
},
{
digest:
'sha256:9afbfccb806687f6979661622f0c04dc534769e742465b107f84a830cbb8e77a',
architecture: 'arm',
},
{
digest:
'sha256:33158d51a7a549207e508a42bf46493f23e1e99fbc011eb3f3742e8b349a2be9',
architecture: 'ppc64le',
},
],
},
{ name: '2.7', images: [] },
{ name: '2.6', images: [] },
]
module.exports = {
sizeDataNoTagSemVerSort,
versionDataNoTagDateSort,
versionPagedDataNoTagDateSort,
versionDataNoTagSemVerSort,
versionDataWithTag,
versionDataWithVaryingArchitectures,
}

View File

@@ -28,6 +28,23 @@ const buildSchema = Joi.object({
const queryParamSchema = Joi.object({
sort: Joi.string().valid('date', 'semver').default('date'),
arch: Joi.string()
// Valid architecture values: https://golang.org/doc/install/source#environment (GOARCH)
.valid(
'amd64',
'arm',
'arm64',
's390x',
'386',
'ppc64',
'ppc64le',
'wasm',
'mips',
'mipsle',
'mips64',
'mips64le'
)
.default('amd64'),
}).required()
module.exports = class DockerVersion extends BaseJsonService {
@@ -38,7 +55,7 @@ module.exports = class DockerVersion extends BaseJsonService {
title: 'Docker Image Version (latest by date)',
pattern: ':user/:repo',
namedParams: { user: '_', repo: 'alpine' },
queryParams: { sort: 'date' },
queryParams: { sort: 'date', arch: 'amd64' },
staticPreview: this.render({ version: '3.9.5' }),
},
{
@@ -73,7 +90,7 @@ module.exports = class DockerVersion extends BaseJsonService {
})
}
transform({ tag, sort, data, pagedData }) {
transform({ tag, sort, data, pagedData, arch = 'amd64' }) {
let version
if (!tag && sort === 'date') {
@@ -81,9 +98,7 @@ module.exports = class DockerVersion extends BaseJsonService {
if (version !== 'latest') {
return { version }
}
const imageTag = data.results[0].images.find(
i => i.architecture === 'amd64'
) // Digest is the unique field that we utilise to match images
const imageTag = data.results[0].images.find(i => i.architecture === arch) // Digest is the unique field that we utilise to match images
if (!imageTag) {
throw new InvalidResponse({
prettyMessage: 'digest not found for latest tag',
@@ -102,12 +117,18 @@ module.exports = class DockerVersion extends BaseJsonService {
if (Object.keys(version.images).length === 0) {
return { version: version.name }
}
const { digest } = version.images.find(i => i.architecture === 'amd64')
const image = version.images.find(i => i.architecture === arch)
if (!image) {
throw new InvalidResponse({
prettyMessage: 'digest not found for given tag',
})
}
const { digest } = image
return { version: getDigestSemVerMatches({ data, digest }) }
}
}
async handle({ user, repo, tag }, { sort }) {
async handle({ user, repo, tag }, { sort, arch }) {
let data, pagedData
if (!tag && sort === 'date') {
@@ -130,7 +151,13 @@ module.exports = class DockerVersion extends BaseJsonService {
})
}
const { version } = await this.transform({ tag, sort, data, pagedData })
const { version } = await this.transform({
tag,
sort,
data,
pagedData,
arch,
})
return this.constructor.render({ version })
}
}

View File

@@ -9,6 +9,7 @@ const {
versionPagedDataNoTagDateSort,
versionDataNoTagSemVerSort,
versionDataWithTag,
versionDataWithVaryingArchitectures,
} = require('./docker-fixtures')
describe('DockerVersion', function () {
@@ -48,6 +49,24 @@ describe('DockerVersion', function () {
}).expect({
version: '3.10.4',
})
// tag & custom architecture
given({
tag: '3.9',
data: versionDataWithVaryingArchitectures,
arch: 'arm',
}).expect({
version: '3.9',
})
// sort & custom architecture
given({
data: versionDataWithVaryingArchitectures,
sort: 'semver',
arch: 'ppc64le',
}).expect({
version: '3.10.4',
})
})
it('throws InvalidResponse error with latest tag and no amd64 architecture digests', function () {
@@ -78,4 +97,80 @@ describe('DockerVersion', function () {
.to.throw(InvalidResponse)
.with.property('prettyMessage', 'digest not found for latest tag')
})
// https://github.com/badges/shields/issues/5535
it('throws InvalidResponse error with custom tag and no amd64 architecture digests', function () {
expect(() => {
DockerVersion.prototype.transform({
tag: '3.10',
data: [
{
name: '3.10',
images: [
{
architecture: 'arm64',
digest:
'sha256:597bd5c319cc09d6bb295b4ef23cac50ec7c373fff5fe923cfd246ec09967b31',
},
{
architecture: 'arm',
digest:
'sha256:c5ea49127cd44d0f50eafda229a056bb83b6e691883c56fd863d42675fae3909',
},
],
},
],
})
})
.to.throw(InvalidResponse)
.with.property('prettyMessage', 'digest not found for given tag')
})
it('throws InvalidResponse error with custom tag and no matching architecture digests', function () {
expect(() => {
DockerVersion.prototype.transform({
tag: '3.10',
arch: '386',
data: [
{
name: '3.9',
images: [
{
digest:
'sha256:ab3fe83c0696e3f565c9b4a734ec309ae9bd0d74c192de4590fd6dc2ef717815',
architecture: 'amd64',
},
{
digest:
'sha256:c7b3e8392e08c971e98627e2bddd10c7fa9d2eae797a16bc94de9709bb9300d0',
architecture: '386',
},
{
digest:
'sha256:5292cebaf695db860087c5582d340a406613891b2819092747b0388da47936c8',
architecture: 'arm',
},
],
},
{
name: '3.10',
images: [
{
architecture: 'arm',
digest:
'sha256:c5ea49127cd44d0f50eafda229a056bb83b6e691883c56fd863d42675fae3909',
},
{
architecture: 'arm64',
digest:
'sha256:597bd5c319cc09d6bb295b4ef23cac50ec7c373fff5fe923cfd246ec09967b31',
},
],
},
],
})
})
.to.throw(InvalidResponse)
.with.property('prettyMessage', 'digest not found for given tag')
})
})

View File

@@ -12,7 +12,9 @@ const favoritesResponseSchema = Joi.object({
}),
}).required()
module.exports = class EclipseMarketplaceFavorites extends EclipseMarketplaceBase {
module.exports = class EclipseMarketplaceFavorites extends (
EclipseMarketplaceBase
) {
static category = 'other'
static route = this.buildRoute('eclipse-marketplace/favorites')
static examples = [

View File

@@ -11,7 +11,9 @@ const licenseResponseSchema = Joi.object({
}),
}).required()
module.exports = class EclipseMarketplaceLicense extends EclipseMarketplaceBase {
module.exports = class EclipseMarketplaceLicense extends (
EclipseMarketplaceBase
) {
static category = 'license'
static route = this.buildRoute('eclipse-marketplace/l')
static examples = [

View File

@@ -12,7 +12,9 @@ const versionResponseSchema = Joi.object({
}),
}).required()
module.exports = class EclipseMarketplaceVersion extends EclipseMarketplaceBase {
module.exports = class EclipseMarketplaceVersion extends (
EclipseMarketplaceBase
) {
static category = 'version'
static route = this.buildRoute('eclipse-marketplace/v')
static examples = [

View File

@@ -66,6 +66,7 @@ async function fetchEndpointData(
schema: anySchema,
url,
errorMessages,
options: { gzip: true },
})
return validateEndpointData(json, {
prettyErrorMessage: validationPrettyErrorMessage,

View File

@@ -1,5 +1,6 @@
'use strict'
const zlib = require('zlib')
const { expect } = require('chai')
const { getShieldsIcon } = require('../../lib/logos')
const t = (module.exports = require('../tester').createServiceTester())
@@ -119,7 +120,7 @@ t.create('logoWidth')
logoWidth: 30,
})
t.create('Invalid schema)')
t.create('Invalid schema')
.get('.json?url=https://example.com/badge')
.intercept(nock =>
nock('https://example.com/').get('/badge').reply(200, {
@@ -131,7 +132,7 @@ t.create('Invalid schema)')
message: 'invalid properties: schemaVersion, label, message',
})
t.create('Invalid schema)')
t.create('Invalid schema')
.get('.json?url=https://example.com/badge')
.intercept(nock =>
nock('https://example.com/').get('/badge').reply(200, {
@@ -258,3 +259,19 @@ t.create('Invalid url').get('.json?url=https:/').expectBadge({
label: 'custom badge',
message: 'invalid query parameter: url',
})
// https://github.com/badges/shields/issues/5868
t.create('gzipped endpoint')
.get('.json?url=https://example.com/badge')
.intercept(nock =>
nock('https://example.com/')
.get('/badge')
.reply(
200,
zlib.gzipSync(
JSON.stringify({ schemaVersion: 1, label: '', message: 'yo' })
),
{ 'Content-Encoding': 'gzip' }
)
)
.expectBadge({ label: '', message: 'yo' })

View File

@@ -0,0 +1,111 @@
'use strict'
const Joi = require('joi')
const { BaseJsonService, NotFound } = require('..')
const {
renderVersionBadge,
searchServiceUrl,
stripBuildMetadata,
selectVersion,
} = require('../nuget/nuget-helpers')
const schema = Joi.object({
items: Joi.array()
.items(
Joi.object({
items: Joi.array().items(
Joi.object({
catalogEntry: Joi.object({
version: Joi.string().required(),
}).required(),
})
),
}).required()
)
.max(1)
.default([]),
}).required()
class FeedzVersionService extends BaseJsonService {
static category = 'version'
static route = {
base: 'feedz',
pattern: ':which(v|vpre)/:organization/:repository/:packageName',
}
static examples = [
{
title: 'Feedz',
pattern: 'v/:organization/:repository/:packageName',
namedParams: {
organization: 'shieldstests',
repository: 'mongodb',
packageName: 'MongoDB.Driver.Core',
},
staticPreview: this.render({ version: '2.10.4' }),
},
{
title: 'Feedz (with prereleases)',
pattern: 'vpre/:organization/:repository/:packageName',
namedParams: {
organization: 'shieldstests',
repository: 'mongodb',
packageName: 'MongoDB.Driver.Core',
},
staticPreview: this.render({ version: '2.11.0-beta2' }),
},
]
static defaultBadgeData = {
label: 'feedz',
}
static render(props) {
return renderVersionBadge(props)
}
apiUrl({ organization, repository }) {
return `https://f.feedz.io/${organization}/${repository}/nuget`
}
async fetch({ baseUrl, packageName }) {
const registrationsBaseUrl = await searchServiceUrl(
baseUrl,
'RegistrationsBaseUrl'
)
return await this._requestJson({
schema,
url: `${registrationsBaseUrl}${packageName}/index.json`,
errorMessages: {
404: 'repository or package not found',
},
})
}
transform({ json, includePrereleases }) {
if (json.items.length === 1 && json.items[0].items.length > 0) {
const versions = json.items[0].items.map(i =>
stripBuildMetadata(i.catalogEntry.version)
)
return selectVersion(versions, includePrereleases)
} else {
throw new NotFound({ prettyMessage: 'package not found' })
}
}
async handle({ which, organization, repository, packageName }) {
const includePrereleases = which === 'vpre'
const baseUrl = this.apiUrl({ organization, repository })
const json = await this.fetch({ baseUrl, packageName })
const version = this.transform({ json, includePrereleases })
return this.constructor.render({
version,
feed: FeedzVersionService.defaultBadgeData.label,
})
}
}
module.exports = {
FeedzVersionService,
}

View File

@@ -0,0 +1,69 @@
'use strict'
const { test, given } = require('sazerac')
const { FeedzVersionService } = require('./feedz.service')
function json(versions) {
return {
items: [
{
items: versions.map(v => ({
catalogEntry: {
version: v,
},
})),
},
],
}
}
function noItemsJson() {
return {
items: [],
}
}
describe('Feedz service', function () {
test(FeedzVersionService.prototype.apiUrl, () => {
given({ organization: 'shieldstests', repository: 'public' }).expect(
'https://f.feedz.io/shieldstests/public/nuget'
)
})
test(FeedzVersionService.prototype.transform, () => {
given({ json: json(['1.0.0']), includePrereleases: false }).expect('1.0.0')
given({ json: json(['1.0.0', '1.0.1']), includePrereleases: false }).expect(
'1.0.1'
)
given({
json: json(['1.0.0', '1.0.1-beta1']),
includePrereleases: false,
}).expect('1.0.0')
given({
json: json(['1.0.0', '1.0.1-beta1']),
includePrereleases: true,
}).expect('1.0.1-beta1')
given({
json: json(['1.0.0+1', '1.0.1-beta1+1']),
includePrereleases: false,
}).expect('1.0.0')
given({
json: json(['1.0.0+1', '1.0.1-beta1+1']),
includePrereleases: true,
}).expect('1.0.1-beta1')
given({ json: json([]), includePrereleases: false }).expectError(
'Not Found: package not found'
)
given({ json: json([]), includePrereleases: true }).expectError(
'Not Found: package not found'
)
given({ json: noItemsJson(), includePrereleases: false }).expectError(
'Not Found: package not found'
)
given({ json: noItemsJson(), includePrereleases: true }).expectError(
'Not Found: package not found'
)
})
})

View File

@@ -0,0 +1,89 @@
'use strict'
const { ServiceTester } = require('../tester')
const t = (module.exports = new ServiceTester({
id: 'feedz',
title: 'Feedz',
pathPrefix: '',
}))
// The `shieldstests/public` repo is specifically made for these tests. It contains following packages:
// - Shields.NoV1: 0.1.0
// - Shields.TestPackage: 0.0.1, 0.1.0-pre, 1.0.0
// - Shields.TestPreOnly: 0.1.0-pre
// The source code of these packages is here: https://github.com/jakubfijalkowski/shields-test-packages
// version
t.create('version (valid)')
.get('/feedz/v/shieldstests/public/Shields.TestPackage.json')
.expectBadge({
label: 'feedz',
message: 'v1.0.0',
color: 'blue',
})
t.create('version (yellow badge)')
.get('/feedz/v/shieldstests/public/Shields.TestPreOnly.json')
.expectBadge({
label: 'feedz',
message: 'v0.1.0-pre',
color: 'yellow',
})
t.create('version (orange badge)')
.get('/feedz/v/shieldstests/public/Shields.NoV1.json')
.expectBadge({
label: 'feedz',
message: 'v0.1.0',
color: 'orange',
})
t.create('repository (not found)')
.get('/feedz/v/foo/bar/not-a-real-package.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })
t.create('version (not found)')
.get('/feedz/v/shieldstests/public/not-a-real-package.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })
t.create('non-existing repository')
.get('/feedz/v/shieldstests/does-not-exist/Shields.TestPackage.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })
// version (pre)
t.create('version (pre) (valid)')
.get('/feedz/vpre/shieldstests/public/Shields.TestPackage.json')
.expectBadge({
label: 'feedz',
message: 'v1.0.0',
color: 'blue',
})
t.create('version (pre) (yellow badge)')
.get('/feedz/vpre/shieldstests/public/Shields.TestPreOnly.json')
.expectBadge({
label: 'feedz',
message: 'v0.1.0-pre',
color: 'yellow',
})
t.create('version (pre) (orange badge)')
.get('/feedz/vpre/shieldstests/public/Shields.NoV1.json')
.expectBadge({
label: 'feedz',
message: 'v0.1.0',
color: 'orange',
})
t.create('repository (pre) (not found)')
.get('/feedz/vpre/foo/bar/not-a-real-package.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })
t.create('version (pre) (not found)')
.get('/feedz/vpre/shieldstests/public/not-a-real-package.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })
t.create('non-existing repository')
.get('/feedz/vpre/shieldstests/does-not-exist/Shields.TestPackage.json')
.expectBadge({ label: 'feedz', message: 'repository or package not found' })

Some files were not shown because too many files have changed in this diff Show More