Compare commits

...

97 Commits

Author SHA1 Message Date
github-actions[bot]
1954963cd3 Changelog for Release server-2022-08-01 (#8268)
* Update Changelog

* Update CHANGELOG.md

Co-authored-by: release[bot] <actions@users.noreply.github.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2022-08-01 20:41:52 +01:00
Érico Andrei
fbb2ff3619 [pypi] Add Framework Version Badges support (#8261)
* [pypi] Add Framework Version Badges support
* Fix redirect from Django versions
* Fix staticPreview
* Refactor service to remove duplication
* Rename to Versions from Framework Classifiers
* Refactor render and handle to thrown an exception

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-08-01 20:17:12 +01:00
dependabot[bot]
9e29d3d3f2 chore(deps): bump parse-url from 6.0.0 to 6.0.5 (#8265)
Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 6.0.0 to 6.0.5.
- [Release notes](https://github.com/IonicaBizau/parse-url/releases)
- [Commits](https://github.com/IonicaBizau/parse-url/compare/6.0.0...6.0.5)

---
updated-dependencies:
- dependency-name: parse-url
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 21:40:34 +00:00
dependabot[bot]
1fad0888b2 chore(deps): bump simple-icons from 7.4.0 to 7.5.0 (#8256)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 7.4.0 to 7.5.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/7.4.0...7.5.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-30 20:32:01 +00:00
dependabot[bot]
4bf0675de2 chore(deps): bump ioredis from 5.2.1 to 5.2.2 (#8259)
Bumps [ioredis](https://github.com/luin/ioredis) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/luin/ioredis/compare/v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-30 20:25:47 +00:00
dependabot[bot]
4fb2896597 chore(deps): bump got from 12.1.0 to 12.3.0 (#8258)
Bumps [got](https://github.com/sindresorhus/got) from 12.1.0 to 12.3.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v12.1.0...v12.3.0)

---
updated-dependencies:
- dependency-name: got
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-30 20:18:21 +00:00
dependabot[bot]
647a466399 chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8255)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.7 to 5.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.31.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-30 20:01:09 +00:00
dependabot[bot]
bf15ad1f3a chore(deps): bump @sentry/node from 7.7.0 to 7.8.0 (#8257)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.7.0 to 7.8.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/7.7.0...7.8.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 09:59:11 -05:00
guoxudong
202d72d365 feat: add [GitlabForks] server (#8208)
* feat: add gitlab forks server

* add test case

* fix

* fix test

* link message to /forks

Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2022-07-28 21:05:54 +00:00
Érico Andrei
efa705d925 Update PyPI api according to https://warehouse.pypa.io/api-reference/json.html (#8251) 2022-07-28 20:04:30 +00:00
GuillaumeG
5234ecde93 Add [galaxytoolshed] Activity (#8164)
* feat(galaxytoolshed): add release-date

* fix(services): galaxytoolshed, rename "release" to "created"

* fix(services): galaxytoolshed, neutral color

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-26 01:48:39 +00:00
dependabot[bot]
345da16365 chore(deps-dev): bump babel-preset-gatsby from 2.14.0 to 2.19.0 (#8235)
Bumps [babel-preset-gatsby](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/babel-preset-gatsby) from 2.14.0 to 2.19.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/babel-preset-gatsby/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/babel-preset-gatsby@2.19.0/packages/babel-preset-gatsby)

---
updated-dependencies:
- dependency-name: babel-preset-gatsby
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 15:03:17 +00:00
Paula Barszcz
37a36f5fea Fix wording in code-walkthrough.md (#8240)
Fix wording and number of parameters in code-walkthrough.md

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:49:53 +00:00
Paula Barszcz
3f63990049 Fix typo in service-tests.md (#8239)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:40:47 +00:00
dependabot[bot]
0605a074e9 chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8224)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.5 to 5.30.7.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.7/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:33:41 +00:00
dependabot[bot]
74ada5af29 chore(deps-dev): bump nock from 13.2.8 to 13.2.9 (#8217)
Bumps [nock](https://github.com/nock/nock) from 13.2.8 to 13.2.9.
- [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.2.8...v13.2.9)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:27:00 +00:00
dependabot[bot]
04d5a9d4d1 chore(deps-dev): bump concurrently from 7.2.2 to 7.3.0 (#8228)
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.2.2 to 7.3.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.2.2...v7.3.0)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:18:57 +00:00
dependabot[bot]
f185167b7d chore(deps): bump dayjs from 1.11.3 to 1.11.4 (#8223)
Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.3 to 1.11.4.
- [Release notes](https://github.com/iamkun/dayjs/releases)
- [Changelog](https://github.com/iamkun/dayjs/blob/v1.11.4/CHANGELOG.md)
- [Commits](https://github.com/iamkun/dayjs/compare/v1.11.3...v1.11.4)

---
updated-dependencies:
- dependency-name: dayjs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-23 14:12:16 +00:00
dependabot[bot]
567cae8e9c chore(deps-dev): bump eslint-plugin-mocha from 10.0.5 to 10.1.0 (#8234)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 10.0.5 to 10.1.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/10.0.5...10.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 22:08:03 +00:00
dependabot[bot]
b7da0f8a56 chore(deps-dev): bump @babel/register from 7.18.6 to 7.18.9 (#8227)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.18.6 to 7.18.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.18.9/packages/babel-register)

---
updated-dependencies:
- dependency-name: "@babel/register"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 22:00:41 +00:00
dependabot[bot]
19363f2245 chore(deps): bump @sentry/node from 7.6.0 to 7.7.0 (#8231)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.6.0 to 7.7.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/7.6.0...7.7.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:41:40 +00:00
dependabot[bot]
ba6fdfb5a6 chore(deps): bump ioredis from 5.2.0 to 5.2.1 (#8220)
Bumps [ioredis](https://github.com/luin/ioredis) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/luin/ioredis/compare/v5.2.0...v5.2.1)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:33:01 +00:00
dependabot[bot]
9bfca5a575 chore(deps-dev): bump @babel/core from 7.18.6 to 7.18.9 (#8218)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.6 to 7.18.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.18.9/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:26:50 +00:00
dependabot[bot]
324e6be067 chore(deps-dev): bump gatsby-plugin-catch-links from 4.11.0 to 4.19.0 (#8233)
Bumps [gatsby-plugin-catch-links](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-catch-links) from 4.11.0 to 4.19.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-catch-links/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-catch-links@4.19.0/packages/gatsby-plugin-catch-links)

---
updated-dependencies:
- dependency-name: gatsby-plugin-catch-links
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:19:16 +00:00
dependabot[bot]
15a7b074f4 chore(deps-dev): bump gatsby-plugin-styled-components (#8225)
Bumps [gatsby-plugin-styled-components](https://github.com/gatsbyjs/gatsby/tree/HEAD/packages/gatsby-plugin-styled-components) from 5.11.0 to 5.19.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-styled-components/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-styled-components@5.19.0/packages/gatsby-plugin-styled-components)

---
updated-dependencies:
- dependency-name: gatsby-plugin-styled-components
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:13:10 +00:00
dependabot[bot]
35fbbad90e chore(deps-dev): bump c8 from 7.11.3 to 7.12.0 (#8230)
Bumps [c8](https://github.com/bcoe/c8) from 7.11.3 to 7.12.0.
- [Release notes](https://github.com/bcoe/c8/releases)
- [Changelog](https://github.com/bcoe/c8/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bcoe/c8/compare/v7.11.3...v7.12.0)

---
updated-dependencies:
- dependency-name: c8
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 21:05:09 +00:00
dependabot[bot]
fe8031af27 chore(deps): bump file-type from 16.5.3 to 16.5.4 (#8237)
Bumps [file-type](https://github.com/sindresorhus/file-type) from 16.5.3 to 16.5.4.
- [Release notes](https://github.com/sindresorhus/file-type/releases)
- [Commits](https://github.com/sindresorhus/file-type/compare/v16.5.3...v16.5.4)

---
updated-dependencies:
- dependency-name: file-type
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 20:58:18 +00:00
dependabot[bot]
5cc21ce040 chore(deps-dev): bump @typescript-eslint/parser from 5.27.0 to 5.30.7 (#8229)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.27.0 to 5.30.7.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.7/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 20:51:18 +00:00
dependabot[bot]
7621603bef chore(deps-dev): bump cypress from 10.3.0 to 10.3.1 (#8222)
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.3.0 to 10.3.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/v10.3.0...v10.3.1)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-22 20:42:00 +00:00
dependabot[bot]
786149ccbe chore(deps-dev): bump jsdoc from 3.6.10 to 3.6.11 (#8216)
Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 3.6.10 to 3.6.11.
- [Release notes](https://github.com/jsdoc/jsdoc/releases)
- [Changelog](https://github.com/jsdoc/jsdoc/blob/3.6.11/CHANGES.md)
- [Commits](https://github.com/jsdoc/jsdoc/compare/3.6.10...3.6.11)

---
updated-dependencies:
- dependency-name: jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-22 20:31:53 +00:00
Jonah Lawrence
60125707ad [greasyfork] Add Greasy Fork rating badges (#8087)
* Add greasy fork rating badges

* refactor: combine rating classes

* refactor: remove Base from class name

* Change to a single badge with all values

* Add unit tests for GreasyForkRatingCount.render

* Average totals in color algorithm

* chore(deps): bump moment from 2.29.3 to 2.29.4 (#8170)

Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [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.3...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8183)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.0 to 5.30.5.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.5/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* chore(deps): bump @sentry/node from 7.4.1 to 7.5.1 (#8174)

Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.4.1 to 7.5.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/7.4.1...7.5.1)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* chore(deps): bump simple-icons from 7.3.0 to 7.4.0 (#8181)

Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 7.3.0 to 7.4.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/7.3.0...7.4.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* chore(deps-dev): bump nodemon from 2.0.18 to 2.0.19 (#8179)

Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.18 to 2.0.19.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.18...v2.0.19)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* Add [ROS] version service (#8169)

* Add [ROS] version service

* review feedback

* add spaces

* add spaces round pipe in [conda] badge (#8189)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* refactor(deps): Replace moment with dayjs (#8192)

* chore(deps): bump @sentry/node from 7.5.1 to 7.6.0 (#8197)

Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.5.1 to 7.6.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/7.5.1...7.6.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix missing `dayjs` -> `moment` (#8204)

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

* chore(deps): bump ioredis from 5.1.0 to 5.2.0 (#8201)

Bumps [ioredis](https://github.com/luin/ioredis) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/luin/ioredis/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* chore(deps): bump fast-xml-parser from 4.0.8 to 4.0.9 (#8203)

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.0.8...v4.0.9)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* revert rebase

* Add test for all good ratings

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: Jacob Bandes-Storch <jacob@bandes-stor.ch>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
Co-authored-by: chase <c@chse.dev>
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2022-07-21 22:14:29 -05:00
chris48s
c64bb7e1f3 Fix heroku review apps (sort of) (#8213)
* constrain to node 16 in engines

* disable strict-engine check for node 17 builds in CI

* override settings with env vars

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-21 17:57:28 +01:00
dependabot[bot]
e1c1a021f9 chore(deps): bump terser from 5.9.0 to 5.14.2 (#8206)
Bumps [terser](https://github.com/terser/terser) from 5.9.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 21:14:04 -05:00
dependabot[bot]
daf5ad5b2a chore(deps): bump fast-xml-parser from 4.0.8 to 4.0.9 (#8203)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.0.8...v4.0.9)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-17 19:59:22 -05:00
dependabot[bot]
a9e67c8b19 chore(deps): bump ioredis from 5.1.0 to 5.2.0 (#8201)
Bumps [ioredis](https://github.com/luin/ioredis) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/luin/ioredis/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-17 15:29:18 +00:00
chase
62cabe0b32 Fix missing dayjs -> moment (#8204)
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2022-07-16 20:02:42 +00:00
dependabot[bot]
ae7960244d chore(deps): bump @sentry/node from 7.5.1 to 7.6.0 (#8197)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.5.1 to 7.6.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/7.5.1...7.6.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-16 14:16:24 -05:00
Jonah Lawrence
e8686395b1 refactor(deps): Replace moment with dayjs (#8192) 2022-07-14 20:34:38 -05:00
chris48s
6a77a5991a add spaces round pipe in [conda] badge (#8189)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-12 20:16:09 +00:00
Jacob Bandes-Storch
7cfd3f5d25 Add [ROS] version service (#8169)
* Add [ROS] version service

* review feedback

* add spaces
2022-07-12 19:54:44 +00:00
dependabot[bot]
a668340706 chore(deps-dev): bump nodemon from 2.0.18 to 2.0.19 (#8179)
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.18 to 2.0.19.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.18...v2.0.19)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-10 16:37:44 +00:00
dependabot[bot]
9f11656dae chore(deps): bump simple-icons from 7.3.0 to 7.4.0 (#8181)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 7.3.0 to 7.4.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/7.3.0...7.4.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-10 16:31:49 +00:00
dependabot[bot]
b6f198e718 chore(deps): bump @sentry/node from 7.4.1 to 7.5.1 (#8174)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.4.1 to 7.5.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/7.4.1...7.5.1)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-10 16:23:12 +00:00
dependabot[bot]
acf77ac62f chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8183)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.0 to 5.30.5.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.5/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-10 16:16:53 +00:00
dependabot[bot]
7ea9e01194 chore(deps): bump moment from 2.29.3 to 2.29.4 (#8170)
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [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.3...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-08 23:45:41 +00:00
dependabot[bot]
cd6527d82b chore(deps-dev): bump danger from 11.0.7 to 11.1.1 (#8172)
Bumps [danger](https://github.com/danger/danger-js) from 11.0.7 to 11.1.1.
- [Release notes](https://github.com/danger/danger-js/releases)
- [Changelog](https://github.com/danger/danger-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/danger/danger-js/compare/11.0.7...11.1.1)

---
updated-dependencies:
- dependency-name: danger
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-08 17:29:55 -05:00
guoxudong
e9c08512ce feat: add [gitlabissues] service (#8108)
* feat: add gitlab issues service

* fixes based on review

* fixes based on review

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-04 22:38:05 +00:00
chris48s
8f03cf6025 add docs on nouns in route (#8141)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-04 22:10:37 +00:00
github-actions[bot]
241790631b Changelog for Release server-2022-07-03 (#8163)
* Update Changelog

Co-authored-by: release[bot] <actions@users.noreply.github.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2022-07-03 19:10:06 +01:00
dependabot[bot]
9af4fa926b chore(deps): bump qs from 6.10.5 to 6.11.0 (#8157)
Bumps [qs](https://github.com/ljharb/qs) from 6.10.5 to 6.11.0.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.5...v6.11.0)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-03 17:52:57 +00:00
dependabot[bot]
ae1be3060e chore(deps-dev): bump nock from 13.2.7 to 13.2.8 (#8152)
Bumps [nock](https://github.com/nock/nock) from 13.2.7 to 13.2.8.
- [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.2.7...v13.2.8)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 21:12:15 +00:00
dependabot[bot]
0c6886dc50 chore(deps-dev): bump @babel/register from 7.17.7 to 7.18.6 (#8156)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.17.7 to 7.18.6.
- [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.18.6/packages/babel-register)

---
updated-dependencies:
- dependency-name: "@babel/register"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 21:04:51 +00:00
chris48s
076ee25bfb moar fixes for [gitlab] auth (#8162)
* fix auth in gitlab contributors badge

* fix gitlab auth for badges that use fetchPaginatedArrayData()

* add a test covering fetchPaginatedArrayData auth

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 20:57:36 +00:00
dependabot[bot]
3998055a3e chore(deps): bump simple-icons from 7.2.0 to 7.3.0 (#8158)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/7.2.0...7.3.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 20:48:21 +00:00
dependabot[bot]
27fd324f15 chore(deps): bump ioredis from 5.0.6 to 5.1.0 (#8148)
Bumps [ioredis](https://github.com/luin/ioredis) from 5.0.6 to 5.1.0.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/luin/ioredis/compare/v5.0.6...v5.1.0)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 20:42:36 +00:00
GuillaumeG
7d088eb725 Add [galaxytoolshed] services (#8114)
* feat(services): galaxytoolshed, downloads badge

* ci: support new circle PR url variable (#8135)

* refactor(galaxytoolshed): rm unused code

* refactor(galaxytoolshed): update schema

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2022-07-02 15:35:29 -05:00
dependabot[bot]
2fb331fcc0 chore(deps-dev): bump cypress from 10.2.0 to 10.3.0 (#8159)
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.2.0 to 10.3.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/v10.2.0...v10.3.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 20:27:18 +00:00
Prashant Rawat
613cfff7bc Docstrings for licenses service (#8160)
* add docstrings for licenses service

* update type description

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 20:18:58 +00:00
dependabot[bot]
166dcb2c84 chore(deps-dev): bump tsd from 0.21.0 to 0.22.0 (#8155)
Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/SamVerschueren/tsd/releases)
- [Commits](https://github.com/SamVerschueren/tsd/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: tsd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 17:32:24 +00:00
dependabot[bot]
3719eaf0c2 chore(deps-dev): bump lint-staged from 13.0.2 to 13.0.3 (#8150)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.0.2 to 13.0.3.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.0.2...v13.0.3)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 17:16:41 +00:00
dependabot[bot]
e987117dbc chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8153)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.28.0 to 5.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 17:10:56 +00:00
dependabot[bot]
4e62a5583c chore(deps): bump @sentry/node from 7.2.0 to 7.4.1 (#8151)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.2.0 to 7.4.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/7.2.0...7.4.1)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 17:02:29 +00:00
dependabot[bot]
8ab0225997 chore(deps-dev): bump @babel/core from 7.18.5 to 7.18.6 (#8149)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.5 to 7.18.6.
- [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.18.6/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-07-02 16:56:49 +00:00
Caleb Cartwright
3c6ca5d59c fix [gitlab] auth (#8145)
* fix(gitlab): use oauth header, add private repo test

* tests(gitlab): fix nock header match on unit test
2022-07-01 16:42:09 -05:00
chris48s
0ceb558bb4 change routes for [gitlab] license and contributors badges (#8140) 2022-06-30 20:56:05 +01:00
Caleb Cartwright
65d12efe32 ci: support new circle PR url variable (#8135) 2022-06-28 06:03:17 -05:00
dependabot[bot]
16fdf3251b chore(deps-dev): bump eslint-plugin-react from 7.30.0 to 7.30.1 (#8123)
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.30.0 to 7.30.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.30.0...v7.30.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:51:02 +00:00
dependabot[bot]
7aab131bc2 chore(deps-dev): bump nodemon from 2.0.16 to 2.0.18 (#8118)
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.16 to 2.0.18.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.16...v2.0.18)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:44:15 +00:00
dependabot[bot]
f55d9057a7 chore(deps): bump simple-icons from 7.0.0 to 7.2.0 (#8116)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 7.0.0 to 7.2.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/7.0.0...7.2.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:38:33 +00:00
dependabot[bot]
ff66e1db7d chore(deps-dev): bump eslint-plugin-jsdoc from 39.3.2 to 39.3.3 (#8119)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.3.2 to 39.3.3.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.3.2...v39.3.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:32:46 +00:00
dependabot[bot]
f2b7da902e chore(deps-dev): bump typescript from 4.7.3 to 4.7.4 (#8117)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.3 to 4.7.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.3...v4.7.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:24:55 +00:00
dependabot[bot]
01b5ab7f4e chore(deps): bump actions/dependency-review-action from 1 to 2 (#8111)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 1 to 2.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:16:06 +00:00
dependabot[bot]
ce4c59cb56 chore(deps): bump @sentry/node from 7.1.1 to 7.2.0 (#8126)
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.1.1 to 7.2.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/7.1.1...7.2.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-24 20:11:16 +00:00
dependabot[bot]
685a9d0219 chore(deps-dev): bump cypress from 10.1.0 to 10.2.0 (#8131)
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.1.0 to 10.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/v10.1.0...v10.2.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-24 20:05:22 +00:00
Caleb Cartwright
1468601294 increase cache length on AUR version badge, run [AUR] (#8110)
* refactor(aurversion): increase cache length

* chore: appease linter

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-22 22:22:23 +00:00
dependabot[bot]
c87a215d0e chore(deps): bump simple-icons from 6.23.0 to 7.0.0 (#8039)
* chore(deps): bump simple-icons from 6.23.0 to 7.0.0

Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 6.23.0 to 7.0.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/6.23.0...7.0.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* refactor: update icon loading to handle SI v7

* refactor: use SI slugs directly

Co-authored-by: dependabot[bot] <49699333+dependabot[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>
2022-06-22 22:12:17 +00:00
Jonah Lawrence
e7aecb1a3b Use GraphQL to fix GitHub file count badges [github] (#8112)
* fix: Use graphQL for github file count badges

* Add test for repo not found and update transform tests

* Fix extensions in transform test

* Mark type and extension as required

* Simpler type transform since only file, dir supported
2022-06-22 18:57:56 +01:00
chris48s
347e3839b8 update targets for [bower] service tests (#8107)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-18 17:34:28 +00:00
chris48s
fd123f7238 accept version with suffix in [ore] service tests (#8106) 2022-06-18 17:27:12 +00:00
guoxudong
bb81467f9a style: unified self-managed gitlab instance name (#8105) 2022-06-18 14:00:53 +00:00
dependabot[bot]
2374962dc0 chore(deps-dev): bump concurrently from 7.2.1 to 7.2.2 (#8092)
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.2.1 to 7.2.2.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.2.1...v7.2.2)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-18 00:24:54 +00:00
dependabot[bot]
e4ad888bf9 chore(deps-dev): bump lint-staged from 13.0.1 to 13.0.2 (#8091)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.0.1...v13.0.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 20:13:52 +00:00
dependabot[bot]
0ae55c7e32 chore(deps-dev): bump nock from 13.2.6 to 13.2.7 (#8094)
Bumps [nock](https://github.com/nock/nock) from 13.2.6 to 13.2.7.
- [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.2.6...v13.2.7)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 20:08:05 +00:00
dependabot[bot]
2818894143 chore(deps-dev): bump cypress from 10.0.3 to 10.1.0 (#8097)
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.0.3 to 10.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/v10.0.3...v10.1.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 20:02:25 +00:00
guoxudong
b9c63ec687 feat: add [gitlab] contributors service (#8084)
* feat: add gitlab contributors service

* add validate and test case

* fix base on review

* remove 2 test case

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:56:04 +00:00
dependabot[bot]
e388608d96 chore(deps-dev): bump @typescript-eslint/eslint-plugin (#8100)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.27.1 to 5.28.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.28.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:48:38 +00:00
dependabot[bot]
d41e5ed347 chore(deps-dev): bump @babel/core from 7.18.2 to 7.18.5 (#8096)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.2 to 7.18.5.
- [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.18.5/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:42:36 +00:00
dependabot[bot]
d8a302eb36 chore(deps): bump @actions/core in /.github/actions/close-bot (#8095)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:36:56 +00:00
dependabot[bot]
f4f80dabf9 chore(deps-dev): bump prettier from 2.6.2 to 2.7.1 (#8093)
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.2 to 2.7.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.6.2...2.7.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:28:27 +00:00
dependabot[bot]
11812beb46 chore(deps-dev): bump eslint-plugin-react-hooks from 4.5.0 to 4.6.0 (#8098)
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-hooks
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-17 19:21:41 +00:00
dependabot[bot]
dff38affa2 chore(deps-dev): bump tsd from 0.20.0 to 0.21.0 (#8101)
Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/SamVerschueren/tsd/releases)
- [Commits](https://github.com/SamVerschueren/tsd/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: tsd
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-17 19:15:04 +00:00
Jonah Lawrence
ec1ff376a5 fix: display greasy fork dd correctly (#8088) 2022-06-16 19:09:31 +00:00
Jonah Lawrence
8f7164f96b [greasyfork] Add Greasy Fork service badges (#8080)
* feat: greasy fork service badges

* fix: default export, remove keywords

* fix: key name in ratingCount

* feat: add good, bad, ok rating count

* ci: fix tests

* refactor: move total installs to downloads

* fix: badge appearing undefined

* fix: error renaming

* change example number

* feat: Add Greasy Fork license badge

* Remove " License" suffix

* update example

* refactor: resolve review comments

* revert: Remove the rating badges

* fix text: license not found

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

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2022-06-16 01:19:12 +00:00
Jonah Lawrence
42233228b4 Fix typos in endpoint badge docs (#8085) 2022-06-16 01:00:22 +00:00
guoxudong
00e9f2dfaa fix: gitlab licence service docs and example (#8083)
* fix: fix gitlab licence service docs and example

* Update services/gitlab/gitlab-license.service.js

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-14 16:10:16 -05:00
Prashant Rawat
51748c6faf add docstrings for endpoint-common service (#8079)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-06-14 17:33:09 +00:00
guoxudong
2d7d8c5b78 fix(gitlab service test): fix gitlab pipeline & tag(nested group) service test, run [gitlabtag gitlabpipeline] (#8076)
* fix(gitlab service test): fix gitlab pipeline & tag(nested group) service test

* rm .tool-verdions file
2022-06-13 23:35:00 +00:00
84 changed files with 3059 additions and 1169 deletions

View File

@@ -149,6 +149,8 @@ jobs:
main@node-17:
docker:
- image: cimg/node:17.9
environment:
NPM_CONFIG_ENGINE_STRICT: 'false'
<<: *main_steps
@@ -163,6 +165,8 @@ jobs:
docker:
- image: cimg/node:17.9
- image: redis
environment:
NPM_CONFIG_ENGINE_STRICT: 'false'
<<: *integration_steps
@@ -239,6 +243,8 @@ jobs:
services@node-17:
docker:
- image: cimg/node:17.9
environment:
NPM_CONFIG_ENGINE_STRICT: 'false'
<<: *services_steps

View File

@@ -9,14 +9,14 @@
"version": "0.0.0",
"license": "CC0",
"dependencies": {
"@actions/core": "^1.8.2",
"@actions/core": "^1.9.0",
"@actions/github": "^5.0.3"
}
},
"node_modules/@actions/core": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.2.tgz",
"integrity": "sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA==",
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.0.tgz",
"integrity": "sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA==",
"dependencies": {
"@actions/http-client": "^2.0.1"
}
@@ -226,9 +226,9 @@
},
"dependencies": {
"@actions/core": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.2.tgz",
"integrity": "sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA==",
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.0.tgz",
"integrity": "sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA==",
"requires": {
"@actions/http-client": "^2.0.1"
}

View File

@@ -10,7 +10,7 @@
"author": "chris48s",
"license": "CC0",
"dependencies": {
"@actions/core": "^1.8.2",
"@actions/core": "^1.9.0",
"@actions/github": "^5.0.3"
}
}

View File

@@ -8,4 +8,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1
uses: actions/dependency-review-action@v2

View File

@@ -4,6 +4,32 @@ Note: this changelog is for the shields.io server. The changelog for the badge-m
---
## server-2022-08-01
- [pypi] Add Framework Version Badges support [#8261](https://github.com/badges/shields/issues/8261)
- feat: add [GitlabForks] server [#8208](https://github.com/badges/shields/issues/8208)
- Update PyPI api according to https://warehouse.pypa.io/api-reference/json.html [#8251](https://github.com/badges/shields/issues/8251)
- Add [galaxytoolshed] Activity [#8164](https://github.com/badges/shields/issues/8164)
- [greasyfork] Add Greasy Fork rating badges [#8087](https://github.com/badges/shields/issues/8087)
- refactor(deps): Replace moment with dayjs [#8192](https://github.com/badges/shields/issues/8192)
- add spaces round pipe in [conda] badge [#8189](https://github.com/badges/shields/issues/8189)
- Add [ROS] version service [#8169](https://github.com/badges/shields/issues/8169)
- feat: add [gitlabissues] service [#8108](https://github.com/badges/shields/issues/8108)
- Dependency updates
## server-2022-07-03
- Add [galaxytoolshed] services [#8114](https://github.com/badges/shields/issues/8114)
- fix [gitlab] auth [#8145](https://github.com/badges/shields/issues/8145) [#8162](https://github.com/badges/shields/issues/8162)
- increase cache length on AUR version badge, run [AUR] [#8110](https://github.com/badges/shields/issues/8110)
- Use GraphQL to fix GitHub file count badges [github] [#8112](https://github.com/badges/shields/issues/8112)
- feat: add [gitlab] contributors service [#8084](https://github.com/badges/shields/issues/8084)
- [greasyfork] Add Greasy Fork service badges [#8080](https://github.com/badges/shields/issues/8080)
- Add [gitlablicense] services [#8024](https://github.com/badges/shields/issues/8024)
- [Spack] Package Manager: Update Domain [#8046](https://github.com/badges/shields/issues/8046)
- switch [jitpack] to use latestOk endpoint [#8041](https://github.com/badges/shields/issues/8041)
- Dependency updates
## server-2022-06-01
- Update GitLab logo (2022) [#7984](https://github.com/badges/shields/issues/7984)

View File

@@ -35,6 +35,16 @@
"WEBLATE_API_KEY": {
"description": "Configure the API key to be used for the Weblate service.",
"required": false
},
"METRICS_INFLUX_ENABLED": {
"description": "Disable influx metrics",
"value": "false",
"required": false
},
"REQUIRE_CLOUDFLARE": {
"description": "Allow direct traffic",
"value": "false",
"required": false
}
},
"formation": {

View File

@@ -59,7 +59,9 @@ function _inferPullRequestFromTravisEnv(env) {
}
function _inferPullRequestFromCircleEnv(env) {
return parseGithubPullRequestUrl(env.CI_PULL_REQUEST)
return parseGithubPullRequestUrl(
env.CI_PULL_REQUEST || env.CIRCLE_PULL_REQUEST
)
}
/**

View File

@@ -3,6 +3,9 @@
- The format of new badges should be of the form `/SERVICE/NOUN/PARAMETERS?QUERYSTRING` e.g:
`/github/issues/:user/:repo`. The service is github, the
badge is for issues, and the parameters are `:user/:repo`.
- The `NOUN` part of the route is:
- singular if the badge message represents a single entity, such as the current status of a build (e.g: `/build`), or a more abstract or aggregate representation of the thing (e.g.: `/coverage`, `/quality`)
- plural if there are (or may) be many of the thing (e.g: `/dependencies`, `/stars`)
- Parameters should always be part of the route if they are required to display a badge e.g: `:packageName`.
- Common optional params like, `:branch` or `:tag` should also be passed as part of the route.
- Query string parameters should be used when:

View File

@@ -58,7 +58,7 @@ The tests are also divided into several parts:
[redis-token-persistence.integration]: https://github.com/badges/shields/blob/master/core/token-pooling/redis-token-persistence.integration.js
[github-api-provider.integration]: https://github.com/badges/shields/blob/master/services/github/github-api-provider.integration.js
Our goal is for the core code is to reach 100% coverage of the code in the
Our goal is to reach 100% coverage of the code in the
frontend, core, and service helper functions when the unit and functional
tests are run.
@@ -95,7 +95,7 @@ test this kind of logic through unit tests (e.g. of `render()` and
callback with the four parameters `( queryParams, match, end, ask )` which
is created in a legacy helper function in
[`legacy-request-handler.js`][legacy-request-handler]. This callback
delegates to a callback in `BaseService.register` with four different
delegates to a callback in `BaseService.register` with three different
parameters `( queryParams, match, sendBadge )`, which
then runs `BaseService.invoke`. `BaseService.invoke` instantiates the
service and runs `BaseService#handle`.

View File

@@ -67,7 +67,7 @@ t.create('Build status')
- 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, 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
Joi is a validation library that is built 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].
4. We expect `label` to be a string literal `"build"`.

View File

@@ -134,7 +134,7 @@ export default function EndpointPage(): JSX.Element {
</p>
<p>
The endpoint badge is a better alternative than redirecting to the
static badge enpoint or generating SVG on your server:
static badge endpoint or generating SVG on your server:
</p>
<ol>
<li>
@@ -142,7 +142,7 @@ export default function EndpointPage(): JSX.Element {
Content and presentation are separate.
</a>{' '}
The service provider authors the badge, and Shields takes input from
the user to format it. As a service provider you author the badge
the user to format it. As a service provider, you author the badge
but don't have to concern yourself with styling. You don't even have
to pass the formatting options through to Shields.
</li>
@@ -152,12 +152,12 @@ export default function EndpointPage(): JSX.Element {
</li>
<li>
A JSON response is easy to implement; easier than an HTTP redirect.
It is trivial in almost any framework, and is more compatible with
It is trivial in almost any framework and is more compatible with
hosting environments such as{' '}
<a href="https://runkit.com/docs/endpoint">RunKit endpoints</a>.
</li>
<li>
As a service provider you can rely on the Shields CDN. There's no
As a service provider, you can rely on the Shields CDN. There's no
need to study the HTTP headers. Adjusting cache behavior is as
simple as setting a property in the JSON response.
</li>
@@ -197,7 +197,7 @@ export default function EndpointPage(): JSX.Element {
<dd>
Default: <code>false</code>. <code>true</code> to treat this as an
error badge. This prevents the user from overriding the color. In the
future it may affect cache behavior.
future, it may affect cache behavior.
</dd>
<dt>namedLogo</dt>
<dd>

View File

@@ -1,4 +1,4 @@
import originalSimpleIcons from 'simple-icons'
import * as originalSimpleIcons from 'simple-icons/icons'
import { svg2base64 } from './svg-helpers.js'
function loadSimpleIcons() {
@@ -14,10 +14,10 @@ function loadSimpleIcons() {
// https://github.com/badges/shields/issues/4273
Object.keys(originalSimpleIcons).forEach(key => {
const icon = originalSimpleIcons[key]
const title = icon.title.toLowerCase()
const legacyTitle = title.replace(/ /g, '-')
const { title, slug, hex } = icon
icon.base64 = {
default: svg2base64(icon.svg.replace('<svg', `<svg fill="#${icon.hex}"`)),
default: svg2base64(icon.svg.replace('<svg', `<svg fill="#${hex}"`)),
light: svg2base64(icon.svg.replace('<svg', `<svg fill="whitesmoke"`)),
dark: svg2base64(icon.svg.replace('<svg', `<svg fill="#333"`)),
}
@@ -26,14 +26,17 @@ function loadSimpleIcons() {
// (e.g. 'Hive'). If a by-title reference we generate for
// backwards compatibility collides with a proper slug from Simple Icons
// then do nothing, so that the proper slug will always map to the correct icon.
if (!(title in originalSimpleIcons)) {
simpleIcons[title] = icon
// Starting in v7, the exported object with the full icon set has updated the keys
// to include a lowercase `si` prefix, and utilizes proper case naming conventions.
if (!(`si${title}` in originalSimpleIcons)) {
simpleIcons[title.toLowerCase()] = icon
}
if (!(legacyTitle in originalSimpleIcons)) {
simpleIcons[legacyTitle] = icon
const legacyTitle = title.replace(/ /g, '-')
if (!(`si${legacyTitle}` in originalSimpleIcons)) {
simpleIcons[legacyTitle.toLowerCase()] = icon
}
simpleIcons[key] = icon
simpleIcons[slug] = icon
})
return simpleIcons
}

1873
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
"@fontsource/lato": "^4.5.8",
"@fontsource/lekton": "^4.5.9",
"@renovate/pep440": "^1.0.0",
"@sentry/node": "^7.1.1",
"@sentry/node": "^7.8.0",
"@shields_io/camp": "^18.1.1",
"badge-maker": "file:badge-maker",
"bytes": "^3.1.2",
@@ -34,16 +34,17 @@
"cloudflare-middleware": "^1.0.4",
"config": "^3.3.7",
"cross-env": "^7.0.3",
"dayjs": "^1.11.4",
"decamelize": "^3.2.0",
"emojic": "^1.1.17",
"escape-string-regexp": "^4.0.0",
"fast-xml-parser": "^4.0.8",
"fast-xml-parser": "^4.0.9",
"glob": "^8.0.3",
"global-agent": "^3.0.0",
"got": "^12.1.0",
"got": "^12.3.0",
"graphql": "^15.6.1",
"graphql-tag": "^2.12.6",
"ioredis": "5.0.6",
"ioredis": "5.2.2",
"joi": "17.6.0",
"joi-extension-semver": "5.0.0",
"js-yaml": "^4.1.0",
@@ -51,17 +52,16 @@
"lodash.countby": "^4.6.0",
"lodash.groupby": "^4.6.0",
"lodash.times": "^4.3.2",
"moment": "^2.29.3",
"node-env-flag": "^0.1.0",
"parse-link-header": "^2.0.0",
"path-to-regexp": "^6.2.1",
"pretty-bytes": "^6.0.0",
"priorityqueuejs": "^2.0.0",
"prom-client": "^14.0.1",
"qs": "^6.10.5",
"qs": "^6.11.0",
"query-string": "^7.1.1",
"semver": "~7.3.7",
"simple-icons": "6.23.0",
"simple-icons": "7.5.0",
"webextension-store-meta": "^1.0.5",
"xmldom": "~0.6.0",
"xpath": "~0.0.32"
@@ -141,9 +141,9 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/core": "^7.18.9",
"@babel/polyfill": "^7.12.1",
"@babel/register": "7.17.7",
"@babel/register": "7.18.9",
"@istanbuljs/schema": "^0.1.3",
"@mapbox/react-click-to-select": "^2.2.1",
"@types/chai": "^4.3.1",
@@ -155,11 +155,11 @@
"@types/react-modal": "^3.13.1",
"@types/react-select": "^4.0.17",
"@types/styled-components": "5.1.25",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.0",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.30.7",
"babel-plugin-inline-react-svg": "^2.0.1",
"babel-preset-gatsby": "^2.14.0",
"c8": "^7.11.3",
"babel-preset-gatsby": "^2.19.0",
"c8": "^7.12.0",
"caller": "^1.1.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
@@ -167,9 +167,9 @@
"chai-string": "^1.4.0",
"child-process-promise": "^2.2.1",
"clipboard-copy": "^4.0.1",
"concurrently": "^7.2.1",
"cypress": "^10.0.3",
"danger": "^11.0.7",
"concurrently": "^7.3.0",
"cypress": "^10.3.1",
"danger": "^11.1.1",
"danger-plugin-no-test-shortcuts": "^2.0.0",
"deepmerge": "^4.2.2",
"eslint": "^7.32.0",
@@ -180,30 +180,30 @@
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.3.2",
"eslint-plugin-mocha": "^10.0.5",
"eslint-plugin-jsdoc": "^39.3.3",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-no-extension-in-require": "^0.2.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sort-class-members": "^1.14.1",
"fetch-ponyfill": "^7.1.0",
"form-data": "^4.0.0",
"gatsby": "4.6.2",
"gatsby-plugin-catch-links": "^4.11.0",
"gatsby-plugin-catch-links": "^4.19.0",
"gatsby-plugin-page-creator": "^4.7.0",
"gatsby-plugin-react-helmet": "^5.10.0",
"gatsby-plugin-remove-trailing-slashes": "^4.9.0",
"gatsby-plugin-styled-components": "^5.11.0",
"gatsby-plugin-styled-components": "^5.19.0",
"gatsby-plugin-typescript": "^4.11.1",
"humanize-string": "^2.1.0",
"icedfrisby": "4.0.0",
"icedfrisby-nock": "^2.1.0",
"is-svg": "^4.3.2",
"js-yaml-loader": "^1.2.2",
"jsdoc": "^3.6.10",
"lint-staged": "^13.0.1",
"jsdoc": "^3.6.11",
"lint-staged": "^13.0.3",
"lodash.debounce": "^4.0.8",
"lodash.difference": "^4.5.0",
"minimist": "^1.2.6",
@@ -211,13 +211,13 @@
"mocha-env-reporter": "^4.0.0",
"mocha-junit-reporter": "^2.0.2",
"mocha-yaml-loader": "^1.0.3",
"nock": "13.2.6",
"nock": "13.2.9",
"node-mocks-http": "^1.11.0",
"nodemon": "^2.0.16",
"nodemon": "^2.0.19",
"npm-run-all": "^4.1.5",
"open-cli": "^7.0.1",
"portfinder": "^1.0.28",
"prettier": "2.6.2",
"prettier": "2.7.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-error-overlay": "^6.0.11",
@@ -236,12 +236,12 @@
"start-server-and-test": "1.14.0",
"styled-components": "^5.3.5",
"ts-mocha": "^10.0.0",
"tsd": "^0.20.0",
"typescript": "^4.7.3",
"tsd": "^0.22.0",
"typescript": "^4.7.4",
"url": "^0.11.0"
},
"engines": {
"node": ">=16.13.0",
"node": "^16.13.0",
"npm": ">=8.0.0"
},
"type": "module",

View File

@@ -108,9 +108,7 @@ class AurVotes extends BaseAurService {
class AurVersion extends BaseAurService {
static category = 'version'
static route = { base: 'aur/version', pattern: ':packageName' }
static examples = [
{
title: 'AUR version',
@@ -119,6 +117,8 @@ class AurVersion extends BaseAurService {
},
]
static _cacheLength = 3600
static render({ version, outOfDate }) {
const color = outOfDate === null ? 'blue' : 'orange'
return { message: addv(version), color }

View File

@@ -1,5 +1,7 @@
import Joi from 'joi'
import { isVPlusDottedVersionAtLeastOne } from '../test-validators.js'
import {
isVPlusDottedVersionAtLeastOne,
isVPlusDottedVersionNClausesWithOptionalSuffix,
} from '../test-validators.js'
import { ServiceTester } from '../tester.js'
export const t = new ServiceTester({
id: 'BowerVersion',
@@ -7,21 +9,17 @@ export const t = new ServiceTester({
pathPrefix: '/bower',
})
const isBowerPrereleaseVersion = Joi.string().regex(
/^v\d+(\.\d+)?(\.\d+)?(-?[.\w\d])+?$/
)
t.create('version').timeout(10000).get('/v/bootstrap.json').expectBadge({
t.create('version').timeout(10000).get('/v/angular.json').expectBadge({
label: 'bower',
message: isVPlusDottedVersionAtLeastOne,
})
t.create('pre version') // e.g. bower|v0.2.5-alpha-rc-pre
t.create('pre version')
.timeout(10000)
.get('/v/bootstrap.json?include_prereleases')
.get('/v/angular.json?include_prereleases')
.expectBadge({
label: 'bower',
message: isBowerPrereleaseVersion,
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
})
t.create('Version for Invalid Package')

View File

@@ -5,7 +5,7 @@
* @module
*/
import moment from 'moment'
import dayjs from 'dayjs'
import pep440 from '@renovate/pep440'
/**
@@ -182,7 +182,7 @@ function colorScale(steps, colors, reversed) {
*/
function age(date) {
const colorByAge = colorScale([7, 30, 180, 365, 730], undefined, true)
const daysElapsed = moment().diff(moment(date), 'days')
const daysElapsed = dayjs().diff(dayjs(date), 'days')
return colorByAge(daysElapsed)
}

View File

@@ -31,7 +31,7 @@ export default class CondaVersion extends BaseCondaService {
static render({ variant, channel, version }) {
return {
label: variant === 'vn' ? channel : `conda|${channel}`,
label: variant === 'vn' ? channel : `conda | ${channel}`,
message: versionText(version),
color: versionColor(version),
}

View File

@@ -3,7 +3,7 @@ import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('version').get('/v/conda-forge/zlib.json').expectBadge({
label: 'conda|conda-forge',
label: 'conda | conda-forge',
message: isVPlusTripleDottedVersion,
})

View File

@@ -1,3 +1,9 @@
/**
* Common functions and utilities for tasks related to endpoint badges.
*
* @module
*/
import Joi from 'joi'
import validate from '../core/base-service/validate.js'
import { InvalidResponse } from './index.js'
@@ -14,6 +20,11 @@ const optionalNumberWhenAnyLogoPresent = Joi.alternatives()
.conditional('namedLogo', { is: Joi.string().required(), then: Joi.number() })
.conditional('logoSvg', { is: Joi.string().required(), then: Joi.number() })
/**
* Joi schema for validating endpoint.
*
* @type {object}
*/
const endpointSchema = Joi.object({
schemaVersion: 1,
label: Joi.string().allow('').required(),
@@ -33,9 +44,18 @@ const endpointSchema = Joi.object({
.oxor('namedLogo', 'logoSvg')
.required()
// Strictly validate according to the endpoint schema. This rejects unknown /
// invalid keys. Optionally it prints those keys in the message in order to
// provide detailed feedback.
/**
* Strictly validate the data according to the endpoint schema.
* This rejects unknown/invalid keys.
* Optionally it prints those keys in the message to provide detailed feedback.
*
* @param {object} data Object containing the data for validation
* @param {object} attrs Refer to individual attributes
* @param {string} [attrs.prettyErrorMessage] If provided then error message is set to this value
* @param {boolean} [attrs.includeKeys] If true then includes error details in error message, defaults to false
* @throws {InvalidResponse|Error} Error if Joi validation fails due to invalid or no schema
* @returns {object} Value if Joi validation is success
*/
function validateEndpointData(
data,
{ prettyErrorMessage = 'invalid response data', includeKeys = false } = {}
@@ -56,6 +76,17 @@ function validateEndpointData(
const anySchema = Joi.any()
/**
* Fetches data from the endpoint and validates the data.
*
* @param {object} serviceInstance Instance of Endpoint class
* @param {object} attrs Refer to individual attributes
* @param {string} attrs.url Endpoint URL
* @param {object} attrs.errorMessages Object containing error messages for different error codes
* @param {string} attrs.validationPrettyErrorMessage If provided then the error message is set to this value
* @param {boolean} attrs.includeKeys If true then includes error details in error message
* @returns {object} Data fetched from endpoint
*/
async function fetchEndpointData(
serviceInstance,
{ url, errorMessages, validationPrettyErrorMessage, includeKeys }

View File

@@ -0,0 +1,41 @@
import { formatDate } from '../text-formatters.js'
import BaseGalaxyToolshedService from './galaxytoolshed-base.js'
export default class GalaxyToolshedCreatedDate extends BaseGalaxyToolshedService {
static category = 'activity'
static route = {
base: 'galaxytoolshed/created-date',
pattern: ':repository/:owner',
}
static examples = [
{
title: 'Galaxy Toolshed (created date)',
namedParams: {
repository: 'sra_tools',
owner: 'iuc',
},
staticPreview: this.render({
date: this.render({ date: '2022-01-01' }),
}),
},
]
static defaultBadgeData = {
label: 'created date',
color: 'blue',
}
static render({ date }) {
return { message: formatDate(date) }
}
async handle({ repository, owner }) {
const response = await this.fetchLastOrderedInstallableRevisionsSchema({
repository,
owner,
})
const { create_time: date } = response[0]
return this.constructor.render({ date })
}
}

View File

@@ -0,0 +1,23 @@
import { isFormattedDate } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Created Date')
.get('/sra_tools/iuc.json')
.expectBadge({ label: 'created date', message: isFormattedDate })
t.create('Created Date - repository not found')
.get('/sra_tool/iuc.json')
.expectBadge({ label: 'created date', message: 'not found' })
t.create('Created Date - owner not found')
.get('/sra_tools/iu.json')
.expectBadge({ label: 'created date', message: 'not found' })
t.create('Created Date - changesetRevision not found')
.get('/bioqc/badilla.json')
.expectBadge({
label: 'created date',
message: 'changesetRevision not found',
})

View File

@@ -0,0 +1,55 @@
import Joi from 'joi'
import { nonNegativeInteger } from '../validators.js'
import { NotFound, BaseJsonService } from '../index.js'
const orderedInstallableRevisionsSchema = Joi.array()
.items(Joi.string())
.required()
const repositoryRevisionInstallInfoSchema = Joi.array()
.ordered(
Joi.object({
create_time: Joi.date().required(),
times_downloaded: nonNegativeInteger,
}).required()
)
.items(Joi.any())
export default class BaseGalaxyToolshedService extends BaseJsonService {
static defaultBadgeData = { label: 'galaxytoolshed' }
static baseUrl = 'https://toolshed.g2.bx.psu.edu'
async fetchOrderedInstallableRevisionsSchema({ repository, owner }) {
return this._requestJson({
schema: orderedInstallableRevisionsSchema,
url: `${this.constructor.baseUrl}/api/repositories/get_ordered_installable_revisions?name=${repository}&owner=${owner}`,
})
}
async fetchRepositoryRevisionInstallInfoSchema({
repository,
owner,
changesetRevision,
}) {
return this._requestJson({
schema: repositoryRevisionInstallInfoSchema,
url: `${this.constructor.baseUrl}/api/repositories/get_repository_revision_install_info?name=${repository}&owner=${owner}&changeset_revision=${changesetRevision}`,
})
}
async fetchLastOrderedInstallableRevisionsSchema({ repository, owner }) {
const changesetRevisions =
await this.fetchOrderedInstallableRevisionsSchema({
repository,
owner,
})
if (!Array.isArray(changesetRevisions) || !changesetRevisions.length) {
throw new NotFound({ prettyMessage: 'changesetRevision not found' })
}
return this.fetchRepositoryRevisionInstallInfoSchema({
repository,
owner,
changesetRevision: changesetRevisions[0],
})
}
}

View File

@@ -0,0 +1,34 @@
import { renderDownloadsBadge } from '../downloads.js'
import BaseGalaxyToolshedService from './galaxytoolshed-base.js'
export default class GalaxyToolshedDownloads extends BaseGalaxyToolshedService {
static category = 'downloads'
static route = {
base: 'galaxytoolshed/downloads',
pattern: ':repository/:owner',
}
static examples = [
{
title: 'Galaxy Toolshed - Downloads',
namedParams: {
repository: 'sra_tools',
owner: 'iuc',
},
staticPreview: renderDownloadsBadge({ downloads: 10000 }),
},
]
static defaultBadgeData = {
label: 'downloads',
}
async handle({ repository, owner }) {
const response = await this.fetchLastOrderedInstallableRevisionsSchema({
repository,
owner,
})
const { times_downloaded: downloads } = response[0]
return renderDownloadsBadge({ downloads })
}
}

View File

@@ -0,0 +1,28 @@
import { isMetric } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('downloads - raw').get('/sra_tools/iuc.json').expectBadge({
label: 'downloads',
message: isMetric,
})
t.create('downloads - repository not found')
.get('/sra_tool/iuc.json')
.expectBadge({
label: 'downloads',
message: 'not found',
})
t.create('downloads - owner not found').get('/sra_tools/iu.json').expectBadge({
label: 'downloads',
message: 'not found',
})
t.create('downloads - changesetRevision not found')
.get('/bioqc/badilla.json')
.expectBadge({
label: 'downloads',
message: 'changesetRevision not found',
})

View File

@@ -1,11 +1,11 @@
import path from 'path'
import Joi from 'joi'
import gql from 'graphql-tag'
import { metric } from '../text-formatters.js'
import { InvalidParameter } from '../index.js'
import { ConditionalGithubAuthV3Service } from './github-auth-service.js'
import { GithubAuthV4Service } from './github-auth-service.js'
import {
documentation as commonDocumentation,
errorMessagesFor,
transformErrors,
} from './github-helpers.js'
const documentation = `${commonDocumentation}
@@ -22,28 +22,29 @@ const documentation = `${commonDocumentation}
</p>
`
const schema = Joi.alternatives(
/*
alternative empty object schema to provide a custom error message
in the event a file path is provided by the user instead of a directory
*/
Joi.object({}).required(),
Joi.array()
.items(
Joi.object({
path: Joi.string().required(),
type: Joi.string().required(),
const schema = Joi.object({
data: Joi.object({
repository: Joi.object({
object: Joi.object({
entries: Joi.array().items(
Joi.object({
type: Joi.string().required(),
extension: Joi.string().allow('').required(),
})
),
})
)
.required()
)
.allow(null)
.required(),
}).required(),
}).required(),
}).required()
const queryParamSchema = Joi.object({
type: Joi.any().valid('dir', 'file'),
extension: Joi.string(),
})
export default class GithubDirectoryFileCount extends ConditionalGithubAuthV3Service {
export default class GithubDirectoryFileCount extends GithubAuthV4Service {
static category = 'size'
static route = {
@@ -103,7 +104,7 @@ export default class GithubDirectoryFileCount extends ConditionalGithubAuthV3Ser
title: 'GitHub repo file count (file extension)',
pattern: ':user/:repo/:path',
namedParams: { user: 'badges', repo: 'shields', path: 'services' },
queryParams: { extension: 'js' },
queryParams: { type: 'file', extension: 'js' },
staticPreview: this.render({ count: 1 }),
documentation,
},
@@ -118,10 +119,25 @@ export default class GithubDirectoryFileCount extends ConditionalGithubAuthV3Ser
}
async fetch({ user, repo, path = '' }) {
return this._requestJson({
url: `/repos/${user}/${repo}/contents/${path}`,
const expression = `HEAD:${path}`
return this._requestGraphql({
query: gql`
query RepoFiles($user: String!, $repo: String!, $expression: String!) {
repository(owner: $user, name: $repo) {
object(expression: $expression) {
... on Tree {
entries {
type
extension
}
}
}
}
}
`,
variables: { user, repo, expression },
schema,
errorMessages: errorMessagesFor('repo or directory not found'),
transformErrors,
})
}
@@ -137,11 +153,12 @@ export default class GithubDirectoryFileCount extends ConditionalGithubAuthV3Ser
}
if (type) {
files = files.filter(file => file.type === type)
const objectType = type === 'dir' ? 'tree' : 'blob'
files = files.filter(file => file.type === objectType)
}
if (extension) {
files = files.filter(file => path.extname(file.path) === `.${extension}`)
files = files.filter(file => file.extension === `.${extension}`)
}
return {
@@ -150,7 +167,13 @@ export default class GithubDirectoryFileCount extends ConditionalGithubAuthV3Ser
}
async handle({ user, repo, path }, { type, extension }) {
const content = await this.fetch({ user, repo, path })
const json = await this.fetch({ user, repo, path })
if (json.data.repository.object === null) {
throw new InvalidParameter({
prettyMessage: 'directory not found',
})
}
const content = json.data.repository.object.entries
const { count } = this.constructor.transform(content, { type, extension })
return this.constructor.render({ count })
}

View File

@@ -5,12 +5,12 @@ import GithubDirectoryFileCount from './github-directory-file-count.service.js'
describe('GithubDirectoryFileCount', function () {
const contents = [
{ path: 'a', type: 'dir' },
{ path: 'b', type: 'dir' },
{ path: 'c.js', type: 'file' },
{ path: 'd.js', type: 'file' },
{ path: 'e.txt', type: 'file' },
{ path: 'f', type: 'submodule' },
{ extension: '', type: 'tree' },
{ extension: '', type: 'tree' },
{ extension: '.js', type: 'blob' },
{ extension: '.js', type: 'blob' },
{ extension: '.txt', type: 'blob' },
{ extension: '', type: 'commit' },
]
test(GithubDirectoryFileCount.transform, () => {

View File

@@ -14,11 +14,18 @@ t.create('directory file count (custom path)')
message: isMetric,
})
t.create('directory file count (repo not found)')
.get('/badges/not_existing_repository.json')
.expectBadge({
label: 'files',
message: 'repo not found',
})
t.create('directory file count (directory not found)')
.get('/badges/shields/not_existing_directory.json')
.expectBadge({
label: 'files',
message: 'repo or directory not found',
message: 'directory not found',
})
t.create('directory file count (not a directory)')

View File

@@ -1,6 +1,6 @@
import gql from 'graphql-tag'
import Joi from 'joi'
import moment from 'moment'
import dayjs from 'dayjs'
import { metric, maybePluralize } from '../text-formatters.js'
import { nonNegativeInteger } from '../validators.js'
import { GithubAuthV4Service } from './github-auth-service.js'
@@ -121,7 +121,7 @@ export default class GithubHacktoberfestCombinedStatus extends GithubAuthV4Servi
// The global cutoff time is 11/1 noon UTC.
// https://github.com/badges/shields/pull/4109#discussion_r330782093
// We want to show "1 day left" on the last day so we add 1.
daysLeft = moment(`${year}-11-01 12:00:00 Z`).diff(moment(), 'days') + 1
daysLeft = dayjs(`${year}-11-01 12:00:00 Z`).diff(dayjs(), 'days') + 1
}
if (daysLeft < 0) {
return {
@@ -205,10 +205,7 @@ export default class GithubHacktoberfestCombinedStatus extends GithubAuthV4Servi
}
static getCalendarPosition(year) {
const daysToStart = moment(`${year}-10-01 00:00:00 Z`).diff(
moment(),
'days'
)
const daysToStart = dayjs(`${year}-10-01 00:00:00 Z`).diff(dayjs(), 'days')
const isBefore = daysToStart > 0
return { daysToStart, isBefore }
}

View File

@@ -1,4 +1,4 @@
import moment from 'moment'
import dayjs from 'dayjs'
import Joi from 'joi'
import { age } from '../color-formatters.js'
import { formatDate } from '../text-formatters.js'
@@ -51,7 +51,7 @@ export default class GithubReleaseDate extends GithubAuthV3Service {
static defaultBadgeData = { label: 'release date' }
static render({ date }) {
const releaseDate = moment(date)
const releaseDate = dayjs(date)
return {
message: formatDate(releaseDate),
color: age(releaseDate),

View File

@@ -8,7 +8,7 @@ export default class GitLabBase extends BaseJsonService {
async fetch({ url, options, schema, errorMessages }) {
return this._requestJson(
this.authHelper.withBasicAuth({
this.authHelper.withBearerAuthHeader({
schema,
url,
options,
@@ -18,10 +18,12 @@ export default class GitLabBase extends BaseJsonService {
}
async fetchPage({ page, requestParams, schema }) {
const { res, buffer } = await this._request({
...requestParams,
...{ options: { searchParams: { page } } },
})
const { res, buffer } = await this._request(
this.authHelper.withBearerAuthHeader({
...requestParams,
...{ options: { searchParams: { page } } },
})
)
const json = this._parseJson(buffer)
const data = this.constructor._validate(json, schema)
@@ -35,7 +37,7 @@ export default class GitLabBase extends BaseJsonService {
errorMessages,
firstPageOnly = false,
}) {
const requestParams = this.authHelper.withBasicAuth({
const requestParams = {
url,
options: {
headers: { Accept: 'application/json' },
@@ -43,7 +45,7 @@ export default class GitLabBase extends BaseJsonService {
...options,
},
errorMessages,
})
}
const {
res: { headers },

View File

@@ -0,0 +1,12 @@
import { redirector } from '../index.js'
// https://github.com/badges/shields/issues/8138
export default redirector({
category: 'build',
route: {
base: 'gitlab/v/contributor',
pattern: ':project+',
},
transformPath: ({ project }) => `/gitlab/contributors/${project}`,
dateAdded: new Date('2022-06-29'),
})

View File

@@ -0,0 +1,9 @@
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Contributors redirect')
.get('/gitlab-org/gitlab', {
followRedirect: false,
})
.expectStatus(301)
.expectHeader('Location', '/gitlab/contributors/gitlab-org/gitlab.svg')

View File

@@ -0,0 +1,78 @@
import Joi from 'joi'
import { optionalUrl, nonNegativeInteger } from '../validators.js'
import { renderContributorBadge } from '../contributor-count.js'
import GitLabBase from './gitlab-base.js'
const schema = Joi.object({ 'x-total': nonNegativeInteger }).required()
const queryParamSchema = Joi.object({
gitlab_url: optionalUrl,
}).required()
const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab )
</p>
`
const customDocumentation = `
<p>
Note that only network-accessible jihulab.com and other self-managed GitLab instances are supported.
You may use your GitLab Project Id (e.g. 13953) or your Project Path (e.g. gitlab-cn/gitlab ) in <a href="https://jihulab.com">https://jihulab.com</a>
</p>
`
export default class GitlabContributors extends GitLabBase {
static category = 'activity'
static route = {
base: 'gitlab/contributors',
pattern: ':project+',
queryParamSchema,
}
static examples = [
{
title: 'GitLab contributors',
namedParams: {
project: 'gitlab-org/gitlab',
},
staticPreview: this.render({ contributorCount: 418 }),
documentation,
},
{
title: 'GitLab (self-managed) contributors',
queryParams: { gitlab_url: 'https://jihulab.com' },
namedParams: {
project: 'gitlab-cn/gitlab',
},
staticPreview: this.render({ contributorCount: 415 }),
documentation: customDocumentation,
},
]
static defaultBadgeData = { label: 'contributors' }
static render({ contributorCount }) {
return renderContributorBadge({ contributorCount })
}
async handle({ project }, { gitlab_url: baseUrl = 'https://gitlab.com' }) {
// https://docs.gitlab.com/ee/api/repositories.html#contributors
const { res } = await this._request(
this.authHelper.withBearerAuthHeader({
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(
project
)}/repository/contributors`,
options: { searchParams: { page: '1', per_page: '1' } },
errorMessages: {
404: 'project not found',
},
})
)
const data = this.constructor._validate(res.headers, schema)
// The total number of contributors is in the `x-total` field in the headers.
// https://docs.gitlab.com/ee/api/index.html#other-pagination-headers
const contributorCount = data['x-total']
return this.constructor.render({ contributorCount })
}
}

View File

@@ -0,0 +1,42 @@
import { createServiceTester } from '../tester.js'
import { isMetric } from '../test-validators.js'
import { noToken } from '../test-helpers.js'
import _noGitLabToken from './gitlab-contributors.service.js'
export const t = await createServiceTester()
const noGitLabToken = noToken(_noGitLabToken)
t.create('Contributors')
.get('/guoxudong.io/shields-test/licenced-test.json')
.expectBadge({
label: 'contributors',
message: isMetric,
})
t.create('Contributors (repo not found)')
.get('/guoxudong.io/shields-test/do-not-exist.json')
.expectBadge({
label: 'contributors',
message: 'project not found',
})
t.create('Mocking the missing x-total header')
.get('/group/project.json')
.intercept(nock =>
nock('https://gitlab.com')
.get(
'/api/v4/projects/group%2Fproject/repository/contributors?page=1&per_page=1'
)
.reply(200)
)
.expectBadge({
label: 'contributors',
message: 'invalid response data',
})
t.create('Contributors (private repo)')
.skipWhen(noGitLabToken)
.get('/shields-ops-group/test.json')
.expectBadge({
label: 'contributors',
message: isMetric,
})

View File

@@ -68,14 +68,14 @@ export default class GitlabCoverage extends BaseSvgScrapingService {
documentation,
},
{
title: 'Gitlab code coverage (self-hosted)',
title: 'Gitlab code coverage (self-managed)',
namedParams: { user: 'GNOME', repo: 'at-spi2-core', branch: 'master' },
queryParams: { gitlab_url: 'https://gitlab.gnome.org' },
staticPreview: this.render({ coverage: 93 }),
documentation,
},
{
title: 'Gitlab code coverage (self-hosted, specific job)',
title: 'Gitlab code coverage (self-managed, specific job)',
namedParams: { user: 'GNOME', repo: 'libhandy', branch: 'master' },
queryParams: {
gitlab_url: 'https://gitlab.gnome.org',

View File

@@ -0,0 +1,77 @@
import Joi from 'joi'
import { optionalUrl, nonNegativeInteger } from '../validators.js'
import { metric } from '../text-formatters.js'
import GitLabBase from './gitlab-base.js'
const schema = Joi.object({
forks_count: nonNegativeInteger,
}).required()
const queryParamSchema = Joi.object({
gitlab_url: optionalUrl,
}).required()
const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab ).
Note that only internet-accessible GitLab instances are supported, for example https://jihulab.com, https://gitlab.gnome.org, or https://gitlab.com/.
</p>
`
export default class GitlabForks extends GitLabBase {
static category = 'social'
static route = {
base: 'gitlab/forks',
pattern: ':project+',
queryParamSchema,
}
static examples = [
{
title: 'GitLab forks',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'Fork',
message: '6.4k',
style: 'social',
},
documentation,
},
]
static defaultBadgeData = { label: 'forks', namedLogo: 'gitlab' }
static render({ baseUrl, project, forkCount }) {
return {
message: metric(forkCount),
color: 'blue',
link: [
`${baseUrl}/${project}/-/forks/new`,
`${baseUrl}/${project}/-/forks`,
],
}
}
async fetch({ project, baseUrl }) {
// https://docs.gitlab.com/ee/api/projects.html#get-single-project
return super.fetch({
schema,
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(project)}`,
errorMessages: {
404: 'project not found',
},
})
}
async handle({ project }, { gitlab_url: baseUrl = 'https://gitlab.com' }) {
const { forks_count: forkCount } = await this.fetch({
project,
baseUrl,
})
return this.constructor.render({ baseUrl, project, forkCount })
}
}

View File

@@ -0,0 +1,35 @@
import { isMetric } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Forks')
.get('/gitlab-org/gitlab.json')
.expectBadge({
label: 'forks',
message: isMetric,
color: 'blue',
link: [
'https://gitlab.com/gitlab-org/gitlab/-/forks/new',
'https://gitlab.com/gitlab-org/gitlab/-/forks',
],
})
t.create('Forks (self-managed)')
.get('/gitlab-cn/gitlab.json?gitlab_url=https://jihulab.com')
.expectBadge({
label: 'forks',
message: isMetric,
color: 'blue',
link: [
'https://jihulab.com/gitlab-cn/gitlab/-/forks/new',
'https://jihulab.com/gitlab-cn/gitlab/-/forks',
],
})
t.create('Forks (project not found)')
.get('/user1/gitlab-does-not-have-this-repo.json')
.expectBadge({
label: 'forks',
message: 'project not found',
})

View File

@@ -0,0 +1,286 @@
import Joi from 'joi'
import { optionalUrl, nonNegativeInteger } from '../validators.js'
import { metric } from '../text-formatters.js'
import GitLabBase from './gitlab-base.js'
const schema = Joi.object({
statistics: Joi.object({
counts: Joi.object({
all: nonNegativeInteger,
closed: nonNegativeInteger,
opened: nonNegativeInteger,
}).required(),
}).allow(null),
}).required()
const queryParamSchema = Joi.object({
labels: Joi.string(),
gitlab_url: optionalUrl,
}).required()
const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab ).
Note that only internet-accessible GitLab instances are supported, for example https://jihulab.com, https://gitlab.gnome.org, or https://gitlab.com/.
</p>
`
const labelDocumentation = `
<p>
If you want to use multiple labels then please use commas (<code>,</code>) to separate them, e.g. <code>foo,bar</code>.
</p>
`
export default class GitlabIssues extends GitLabBase {
static category = 'issue-tracking'
static route = {
base: 'gitlab/issues',
pattern: ':variant(all|open|closed):raw(-raw)?/:project+',
queryParamSchema,
}
static examples = [
{
title: 'GitLab issues',
pattern: 'open/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'issues',
message: '44k open',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab issues',
pattern: 'open-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'open issues',
message: '44k',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab issues by-label',
pattern: 'open/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: {
labels: 'test,failure::new',
gitlab_url: 'https://gitlab.com',
},
staticPreview: {
label: 'test,failure::new issues',
message: '16 open',
color: 'yellow',
},
documentation: documentation + labelDocumentation,
},
{
title: 'GitLab issues by-label',
pattern: 'open-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: {
labels: 'test,failure::new',
gitlab_url: 'https://gitlab.com',
},
staticPreview: {
label: 'open test,failure::new issues',
message: '16',
color: 'yellow',
},
documentation: documentation + labelDocumentation,
},
{
title: 'GitLab closed issues',
pattern: 'closed/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'issues',
message: '72k closed',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab closed issues',
pattern: 'closed-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'closed issues',
message: '72k ',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab closed issues by-label',
pattern: 'closed/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: {
labels: 'test,failure::new',
gitlab_url: 'https://gitlab.com',
},
staticPreview: {
label: 'test,failure::new issues',
message: '4 closed',
color: 'yellow',
},
documentation: documentation + labelDocumentation,
},
{
title: 'GitLab closed issues by-label',
pattern: 'closed-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: {
labels: 'test,failure::new',
gitlab_url: 'https://gitlab.com',
},
staticPreview: {
label: 'closed test,failure::new issues',
message: '4',
color: 'yellow',
},
documentation: documentation + labelDocumentation,
},
{
title: 'GitLab all issues',
pattern: 'all/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'issues',
message: '115k all',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab all issues',
pattern: 'all-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: { gitlab_url: 'https://gitlab.com' },
staticPreview: {
label: 'all issues',
message: '115k',
color: 'yellow',
},
documentation,
},
{
title: 'GitLab all issues by-label',
pattern: 'all-raw/:project+',
namedParams: {
project: 'gitlab-org/gitlab',
},
queryParams: {
labels: 'test,failure::new',
gitlab_url: 'https://gitlab.com',
},
staticPreview: {
label: 'all test,failure::new issues',
message: '20',
color: 'yellow',
},
documentation: documentation + labelDocumentation,
},
]
static defaultBadgeData = { label: 'issues', color: 'informational' }
static render({ variant, raw, labels, issueCount }) {
const state = variant
const isMultiLabel = labels && labels.includes(',')
const labelText = labels ? `${isMultiLabel ? `${labels}` : labels} ` : ''
let labelPrefix = ''
let messageSuffix = ''
if (raw !== undefined) {
labelPrefix = `${state} `
} else {
messageSuffix = state
}
return {
label: `${labelPrefix}${labelText}issues`,
message: `${metric(issueCount)}${
messageSuffix ? ' ' : ''
}${messageSuffix}`,
color: issueCount > 0 ? 'yellow' : 'brightgreen',
}
}
async fetch({ project, baseUrl, labels }) {
// https://docs.gitlab.com/ee/api/issues_statistics.html#get-project-issues-statistics
return super.fetch({
schema,
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(
project
)}/issues_statistics`,
options: labels ? { searchParams: { labels } } : undefined,
errorMessages: {
404: 'project not found',
},
})
}
static transform({ variant, statistics }) {
const state = variant
let issueCount
switch (state) {
case 'open':
issueCount = statistics.counts.opened
break
case 'closed':
issueCount = statistics.counts.closed
break
case 'all':
issueCount = statistics.counts.all
break
}
return issueCount
}
async handle(
{ variant, raw, project },
{ gitlab_url: baseUrl = 'https://gitlab.com', labels }
) {
const { statistics } = await this.fetch({
project,
baseUrl,
labels,
})
return this.constructor.render({
variant,
raw,
labels,
issueCount: this.constructor.transform({ variant, statistics }),
})
}
}

View File

@@ -0,0 +1,147 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
import {
isMetric,
isMetricOpenIssues,
isMetricClosedIssues,
} from '../test-validators.js'
export const t = await createServiceTester()
t.create('Issues (project not found)')
.get('/open/guoxudong.io/shields-test/do-not-exist.json')
.expectBadge({
label: 'issues',
message: 'project not found',
})
/**
* Opened issue number case
*/
t.create('Opened issues')
.get('/open/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'issues',
message: isMetricOpenIssues,
})
t.create('Open issues raw')
.get('/open-raw/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'open issues',
message: isMetric,
})
t.create('Open issues by label is > zero')
.get('/open/guoxudong.io/shields-test/issue-test.json?labels=discussion')
.expectBadge({
label: 'discussion issues',
message: isMetricOpenIssues,
})
t.create('Open issues by multi-word label is > zero')
.get(
'/open/guoxudong.io/shields-test/issue-test.json?labels=discussion,enhancement'
)
.expectBadge({
label: 'discussion,enhancement issues',
message: isMetricOpenIssues,
})
t.create('Open issues by label (raw)')
.get('/open-raw/guoxudong.io/shields-test/issue-test.json?labels=discussion')
.expectBadge({
label: 'open discussion issues',
message: isMetric,
})
t.create('Opened issues by Scoped labels')
.get('/open/gitlab-org%2Fgitlab.json?labels=test,failure::new')
.expectBadge({
label: 'test,failure::new issues',
message: isMetricOpenIssues,
})
/**
* Closed issue number case
*/
t.create('Closed issues')
.get('/closed/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'issues',
message: isMetricClosedIssues,
})
t.create('Closed issues raw')
.get('/closed-raw/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'closed issues',
message: isMetric,
})
t.create('Closed issues by label is > zero')
.get('/closed/guoxudong.io/shields-test/issue-test.json?labels=bug')
.expectBadge({
label: 'bug issues',
message: isMetricClosedIssues,
})
t.create('Closed issues by multi-word label is > zero')
.get('/closed/guoxudong.io/shields-test/issue-test.json?labels=bug,critical')
.expectBadge({
label: 'bug,critical issues',
message: isMetricClosedIssues,
})
t.create('Closed issues by label (raw)')
.get('/closed-raw/guoxudong.io/shields-test/issue-test.json?labels=bug')
.expectBadge({
label: 'closed bug issues',
message: isMetric,
})
/**
* All issue number case
*/
t.create('All issues')
.get('/all/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'issues',
message: Joi.string().regex(
/^([0-9]+[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY]) all$/
),
})
t.create('All issues raw')
.get('/all-raw/guoxudong.io/shields-test/issue-test.json')
.expectBadge({
label: 'all issues',
message: isMetric,
})
t.create('All issues by label is > zero')
.get('/all/guoxudong.io/shields-test/issue-test.json?labels=discussion')
.expectBadge({
label: 'discussion issues',
message: Joi.string().regex(
/^([0-9]+[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY]) all$/
),
})
t.create('All issues by multi-word label is > zero')
.get(
'/all/guoxudong.io/shields-test/issue-test.json?labels=discussion,enhancement'
)
.expectBadge({
label: 'discussion,enhancement issues',
message: Joi.string().regex(
/^([0-9]+[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY]) all$/
),
})
t.create('All issues by label (raw)')
.get('/all-raw/guoxudong.io/shields-test/issue-test.json?labels=discussion')
.expectBadge({
label: 'all discussion issues',
message: isMetric,
})

View File

@@ -0,0 +1,12 @@
import { redirector } from '../index.js'
// https://github.com/badges/shields/issues/8138
export default redirector({
category: 'build',
route: {
base: 'gitlab/v/license',
pattern: ':project+',
},
transformPath: ({ project }) => `/gitlab/license/${project}`,
dateAdded: new Date('2022-06-29'),
})

View File

@@ -0,0 +1,9 @@
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('License redirect')
.get('/gitlab-org/gitlab', {
followRedirect: false,
})
.expectStatus(301)
.expectHeader('Location', '/gitlab/license/gitlab-org/gitlab.svg')

View File

@@ -15,21 +15,22 @@ const queryParamSchema = Joi.object({
const documentation = `
<p>
You may use your GitLab Project Id (e.g. 13083) or your Project Path (e.g. gitlab-org/gitlab-foss )
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab )
</p>
`
const customDocumentation = `
<p>
Note that only internet-accessible GitLab instances are supported, for example https://jihulab.com, https://gitlab.gnome.org, or https://gitlab.com/.
You may use your GitLab Project Id (e.g. 13953) or your Project Path (e.g. gitlab-cn/gitlab ) in <a href="https://jihulab.com">https://jihulab.com</a>
</p>
`
const commonProps = {
namedParams: {
project: 'gitlab-org/gitlab-foss',
},
documentation,
}
export default class GitlabLicense extends GitLabBase {
static category = 'license'
static route = {
base: 'gitlab/v/license',
base: 'gitlab/license',
pattern: ':project+',
queryParamSchema,
}
@@ -37,22 +38,28 @@ export default class GitlabLicense extends GitLabBase {
static examples = [
{
title: 'GitLab',
...commonProps,
namedParams: {
project: 'gitlab-org/gitlab',
},
staticPreview: {
label: 'license',
message: 'MIT License',
color: 'green',
},
documentation,
},
{
title: 'GitLab (custom server)',
...commonProps,
title: 'GitLab (self-managed)',
namedParams: {
project: 'gitlab-cn/gitlab',
},
queryParams: { gitlab_url: 'https://jihulab.com' },
staticPreview: {
label: 'license',
message: 'MIT License',
color: 'green',
},
documentation: customDocumentation,
},
]

View File

@@ -1,6 +1,9 @@
import { licenseToColor } from '../licenses.js'
import { createServiceTester } from '../tester.js'
import { noToken } from '../test-helpers.js'
import _noGitLabToken from './gitlab-license.service.js'
export const t = await createServiceTester()
const noGitLabToken = noToken(_noGitLabToken)
const publicDomainLicenseColor = licenseToColor('MIT License')
const unknownLicenseColor = licenseToColor()
@@ -55,3 +58,12 @@ t.create('Mocking License')
message: 'Apache License 2.0',
color: unknownLicenseColor,
})
t.create('License (private repo)')
.skipWhen(noGitLabToken)
.get('/shields-ops-group/test.json')
.expectBadge({
label: 'license',
message: 'MIT License',
color: `${publicDomainLicenseColor}`,
})

View File

@@ -54,7 +54,7 @@ class GitlabPipelineStatus extends BaseSvgScrapingService {
documentation,
},
{
title: 'Gitlab pipeline status (self-hosted)',
title: 'Gitlab pipeline status (self-managed)',
namedParams: { project: 'GNOME/pango' },
queryParams: { gitlab_url: 'https://gitlab.gnome.org', branch: 'master' },
staticPreview: this.render({ status: 'passed' }),

View File

@@ -15,7 +15,7 @@ t.create('Pipeline status')
t.create('Pipeline status (nested groups)')
.get(
'/pipeline-status/megabyte-labs/dockerfile/ci-pipeline/ansible-lint.json?branch=master'
'/pipeline-status/megabyte-labs/docker/ci-pipeline/ansible.json?branch=master'
)
.expectBadge({
label: 'build',

View File

@@ -65,7 +65,7 @@ export default class GitLabRelease extends GitLabBase {
staticPreview: renderVersionBadge({ version: 'v5.0.0-beta.1' }),
},
{
title: 'GitLab Release (custom instance)',
title: 'GitLab Release (self-managed)',
namedParams: {
project: 'GNOME/librsvg',
},

View File

@@ -0,0 +1,48 @@
import { expect } from 'chai'
import nock from 'nock'
import { cleanUpNockAfterEach, defaultContext } from '../test-helpers.js'
import GitLabRelease from './gitlab-release.service.js'
describe('GitLabRelease', function () {
describe('auth', function () {
cleanUpNockAfterEach()
const fakeToken = 'abc123'
const config = {
public: {
services: {
gitlab: {
authorizedOrigins: ['https://gitlab.com'],
},
},
},
private: {
gitlab_token: fakeToken,
},
}
it('sends the auth information as configured', async function () {
const scope = nock('https://gitlab.com/')
.get('/api/v4/projects/foo%2Fbar/releases?page=1')
// This ensures that the expected credentials are actually being sent with the HTTP request.
// Without this the request wouldn't match and the test would fail.
.matchHeader('Authorization', `Bearer ${fakeToken}`)
.reply(200, [{ name: '1.9', tag_name: '1.9' }])
expect(
await GitLabRelease.invoke(
defaultContext,
config,
{ project: 'foo/bar' },
{}
)
).to.deep.equal({
label: undefined,
message: 'v1.9',
color: 'blue',
})
scope.done()
})
})
})

View File

@@ -36,7 +36,7 @@ t.create('Release (release display name)')
.get('/gitlab-org/gitlab.json?display_name=release')
.expectBadge({ label: 'release', message: isGitLabDisplayVersion })
t.create('Release (custom instance')
t.create('Release (custom instance)')
.get('/GNOME/librsvg.json?gitlab_url=https://gitlab.gnome.org')
.expectBadge({ label: 'release', message: isSemver, color: 'blue' })

View File

@@ -62,7 +62,7 @@ export default class GitlabTag extends GitLabBase {
staticPreview: this.render({ version: 'v5.0.0-beta.1', sort: 'semver' }),
},
{
title: 'GitLab tag (custom instance)',
title: 'GitLab tag (self-managed)',
namedParams: {
project: 'GNOME/librsvg',
},

View File

@@ -26,7 +26,7 @@ describe('GitLabTag', function () {
.get('/api/v4/projects/foo%2Fbar/repository/tags?order_by=updated')
// This ensures that the expected credentials are actually being sent with the HTTP request.
// Without this the request wouldn't match and the test would fail.
.basicAuth({ user: '', pass: fakeToken })
.matchHeader('Authorization', `Bearer ${fakeToken}`)
.reply(200, [{ name: '1.9' }])
expect(

View File

@@ -7,7 +7,7 @@ t.create('Tag (latest by date)')
.expectBadge({ label: 'tag', message: 'v2.0.0', color: 'blue' })
t.create('Tag (nested groups)')
.get('/megabyte-labs/docker/ci-pipeline/ansible-lint.json')
.get('/megabyte-labs/docker/ci-pipeline/ansible.json')
.expectBadge({ label: 'tag', message: isSemver, color: 'blue' })
t.create('Tag (project id latest by date)')

View File

@@ -0,0 +1,24 @@
import Joi from 'joi'
import { nonNegativeInteger } from '../validators.js'
import { BaseJsonService } from '../index.js'
const schema = Joi.object({
daily_installs: nonNegativeInteger,
total_installs: nonNegativeInteger,
good_ratings: nonNegativeInteger,
ok_ratings: nonNegativeInteger,
bad_ratings: nonNegativeInteger,
version: Joi.string().required(),
license: Joi.string().allow(null).required(),
}).required()
export default class BaseGreasyForkService extends BaseJsonService {
static defaultBadgeData = { label: 'greasy fork' }
async fetch({ scriptId }) {
return this._requestJson({
schema,
url: `https://greasyfork.org/scripts/${scriptId}.json`,
})
}
}

View File

@@ -0,0 +1,35 @@
import { renderDownloadsBadge } from '../downloads.js'
import BaseGreasyForkService from './greasyfork-base.js'
export default class GreasyForkInstalls extends BaseGreasyForkService {
static category = 'downloads'
static route = { base: 'greasyfork', pattern: ':variant(dt|dd)/:scriptId' }
static examples = [
{
title: 'Greasy Fork',
pattern: 'dd/:scriptId',
namedParams: { scriptId: '407466' },
staticPreview: renderDownloadsBadge({ downloads: 17, interval: 'day' }),
},
{
title: 'Greasy Fork',
pattern: 'dt/:scriptId',
namedParams: { scriptId: '407466' },
staticPreview: renderDownloadsBadge({ downloads: 3420 }),
},
]
static defaultBadgeData = { label: 'installs' }
async handle({ variant, scriptId }) {
const data = await this.fetch({ scriptId })
if (variant === 'dd') {
const downloads = data.daily_installs
const interval = 'day'
return renderDownloadsBadge({ downloads, interval })
}
const downloads = data.total_installs
return renderDownloadsBadge({ downloads })
}
}

View File

@@ -0,0 +1,19 @@
import { createServiceTester } from '../tester.js'
import { isMetric, isMetricOverTimePeriod } from '../test-validators.js'
export const t = await createServiceTester()
t.create('Daily Installs')
.get('/dd/407466.json')
.expectBadge({ label: 'installs', message: isMetricOverTimePeriod })
t.create('Daily Installs (not found)')
.get('/dd/000000.json')
.expectBadge({ label: 'installs', message: 'not found' })
t.create('Total Installs')
.get('/dt/407466.json')
.expectBadge({ label: 'installs', message: isMetric })
t.create('Total Installs (not found)')
.get('/dt/000000.json')
.expectBadge({ label: 'installs', message: 'not found' })

View File

@@ -0,0 +1,34 @@
import { renderLicenseBadge } from '../licenses.js'
import { InvalidResponse } from '../index.js'
import BaseGreasyForkService from './greasyfork-base.js'
export default class GreasyForkLicense extends BaseGreasyForkService {
static category = 'license'
static route = { base: 'greasyfork', pattern: 'l/:scriptId' }
static examples = [
{
title: 'Greasy Fork',
namedParams: { scriptId: '407466' },
staticPreview: renderLicenseBadge({ licenses: ['MIT'] }),
},
]
static defaultBadgeData = { label: 'license' }
transform({ data }) {
if (data.license === null) {
throw new InvalidResponse({
prettyMessage: 'license not found',
})
}
// remove suffix " License" from data.license
return { license: data.license.replace(/ License$/, '') }
}
async handle({ scriptId }) {
const data = await this.fetch({ scriptId })
const { license } = this.transform({ data })
return renderLicenseBadge({ licenses: [license] })
}
}

View File

@@ -0,0 +1,11 @@
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('License (valid)').get('/l/407466.json').expectBadge({
label: 'license',
message: 'MIT',
})
t.create('License (not found)')
.get('/l/000000.json')
.expectBadge({ label: 'license', message: 'not found' })

View File

@@ -0,0 +1,40 @@
import { floorCount as floorCountColor } from '../color-formatters.js'
import { metric } from '../text-formatters.js'
import BaseGreasyForkService from './greasyfork-base.js'
export default class GreasyForkRatingCount extends BaseGreasyForkService {
static category = 'rating'
static route = { base: 'greasyfork', pattern: 'rating-count/:scriptId' }
static examples = [
{
title: 'Greasy Fork',
namedParams: { scriptId: '407466' },
staticPreview: this.render({ good: 17, ok: 2, bad: 3 }),
},
]
static defaultBadgeData = { label: 'rating' }
static render({ good, ok, bad }) {
let color = 'lightgrey'
const total = good + bad + ok
if (total > 0) {
const score = (good * 3 + ok * 2 + bad * 1) / total - 1
color = floorCountColor(score, 1, 1.5, 2)
}
return {
message: `${metric(good)} good, ${metric(ok)} ok, ${metric(bad)} bad`,
color,
}
}
async handle({ scriptId }) {
const data = await this.fetch({ scriptId })
return this.constructor.render({
good: data.good_ratings,
ok: data.ok_ratings,
bad: data.bad_ratings,
})
}
}

View File

@@ -0,0 +1,31 @@
import { test, given } from 'sazerac'
import GreasyForkRatingCount from './greasyfork-rating.service.js'
describe('GreasyForkRatingCount', function () {
test(GreasyForkRatingCount.render, () => {
given({ good: 0, ok: 0, bad: 30 }).expect({
message: '0 good, 0 ok, 30 bad',
color: 'red',
})
given({ good: 10, ok: 20, bad: 30 }).expect({
message: '10 good, 20 ok, 30 bad',
color: 'yellow',
})
given({ good: 10, ok: 20, bad: 10 }).expect({
message: '10 good, 20 ok, 10 bad',
color: 'yellowgreen',
})
given({ good: 20, ok: 10, bad: 0 }).expect({
message: '20 good, 10 ok, 0 bad',
color: 'green',
})
given({ good: 30, ok: 0, bad: 0 }).expect({
message: '30 good, 0 ok, 0 bad',
color: 'brightgreen',
})
given({ good: 0, ok: 0, bad: 0 }).expect({
message: '0 good, 0 ok, 0 bad',
color: 'lightgrey',
})
})
})

View File

@@ -0,0 +1,14 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Rating Count')
.get('/rating-count/407466.json')
.expectBadge({
label: 'rating',
message: Joi.string().regex(/^\d+ good, \d+ ok, \d+ bad$/),
})
t.create('Rating Count (not found)')
.get('/rating-count/000000.json')
.expectBadge({ label: 'rating', message: 'not found' })

View File

@@ -0,0 +1,20 @@
import { renderVersionBadge } from '../version.js'
import BaseGreasyForkService from './greasyfork-base.js'
export default class GreasyForkVersion extends BaseGreasyForkService {
static category = 'version'
static route = { base: 'greasyfork', pattern: 'v/:scriptId' }
static examples = [
{
title: 'Greasy Fork',
namedParams: { scriptId: '407466' },
staticPreview: renderVersionBadge({ version: '3.9.3' }),
},
]
async handle({ scriptId }) {
const data = await this.fetch({ scriptId })
return renderVersionBadge({ version: data.version })
}
}

View File

@@ -0,0 +1,12 @@
import { isVPlusDottedVersionAtLeastOne } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Version').get('/v/407466.json').expectBadge({
label: 'greasy fork',
message: isVPlusDottedVersionAtLeastOne,
})
t.create('Version (not found)')
.get('/v/000000.json')
.expectBadge({ label: 'greasy fork', message: 'not found' })

View File

@@ -1,3 +1,9 @@
/**
* Common functions and utilities for tasks related to license badges.
*
* @module
*/
import toArray from '../core/base-service/to-array.js'
const licenseTypes = {
@@ -88,6 +94,11 @@ const licenseTypes = {
},
}
/**
* Mapping of licenses to their corresponding color and priority.
*
* @type {object}
*/
const licenseToColorMap = {}
Object.keys(licenseTypes).forEach(licenseType => {
const { spdxLicenseIds, aliases, color, priority } = licenseTypes[licenseType]
@@ -99,6 +110,12 @@ Object.keys(licenseTypes).forEach(licenseType => {
})
})
/**
* Maps the license to its corresponding color and priority and sorts the list of mapped licenses by priority.
*
* @param {string | string[]} licenses License or list of licenses
* @returns {string} Color corresponding to the license or the list of licenses
*/
function licenseToColor(licenses) {
if (!Array.isArray(licenses)) {
licenses = [licenses]
@@ -113,6 +130,17 @@ function licenseToColor(licenses) {
return color
}
/**
* Handles rendering concerns of license badges.
* Determines the message of the badge by joining the licenses in a comma-separated format.
* Sets the badge color to the provided value, if not provided then the color is used from licenseToColorMap.
*
* @param {object} attrs Refer to individual attributes
* @param {string} [attrs.license] License to render, required if badge contains only one license
* @param {string[]} [attrs.licenses] List of licenses to render, required if badge contains multiple licenses
* @param {string} [attrs.color] If provided then the badge will use this color value
* @returns {object} Badge with message and color properties
*/
function renderLicenseBadge({ license, licenses, color }) {
if (licenses === undefined) {
licenses = toArray(license)

View File

@@ -1,4 +1,4 @@
import moment from 'moment'
import dayjs from 'dayjs'
import semver from 'semver'
import { getCachedResource } from '../../core/base-service/resource-cache.js'
@@ -23,7 +23,7 @@ async function getVersion(version) {
}
function ltsVersionsScraper(versions) {
const currentDate = moment().format(dateFormat)
const currentDate = dayjs().format(dateFormat)
return Object.keys(versions).filter(function (version) {
const data = versions[version]
return data.lts && data.lts < currentDate && data.end > currentDate

View File

@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import moment from 'moment'
import dayjs from 'dayjs'
const dateFormat = 'YYYY-MM-DD'
@@ -67,7 +67,7 @@ const mockVersionsSha = () => nock => {
}
const mockReleaseSchedule = () => nock => {
const currentDate = moment()
const currentDate = dayjs()
const schedule = {
'v0.10': {
start: '2013-03-11',

View File

@@ -1,10 +1,10 @@
import { isVPlusDottedVersionAtLeastOne } from '../test-validators.js'
import { isVPlusDottedVersionNClausesWithOptionalSuffix } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Nucleus (pluginId nucleus)').get('/nucleus.json').expectBadge({
label: 'version',
message: isVPlusDottedVersionAtLeastOne,
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
})
t.create('Invalid Plugin (pluginId 1)').get('/1.json').expectBadge({

View File

@@ -9,16 +9,11 @@ const schema = Joi.object({
license: Joi.string().allow('').allow(null),
classifiers: Joi.array().items(Joi.string()).required(),
}).required(),
releases: Joi.object()
.pattern(
Joi.string(),
Joi.array()
.items(
Joi.object({
packagetype: Joi.string().required(),
})
)
.required()
urls: Joi.array()
.items(
Joi.object({
packagetype: Joi.string().required(),
})
)
.required(),
}).required()

View File

@@ -1,45 +1,12 @@
import PypiBase from './pypi-base.js'
import { sortDjangoVersions, parseClassifiers } from './pypi-helpers.js'
import { redirector } from '../index.js'
export default class PypiDjangoVersions extends PypiBase {
static category = 'platform-support'
static route = this.buildRoute('pypi/djversions')
static examples = [
{
title: 'PyPI - Django Version',
pattern: ':packageName',
namedParams: { packageName: 'djangorestframework' },
staticPreview: this.render({ versions: ['1.11', '2.0', '2.1'] }),
keywords: ['python'],
},
]
static defaultBadgeData = { label: 'django versions' }
static render({ versions }) {
if (versions.length > 0) {
return {
message: sortDjangoVersions(versions).join(' | '),
color: 'blue',
}
} else {
return {
message: 'missing',
color: 'red',
}
}
}
async handle({ egg }) {
const packageData = await this.fetch({ egg })
const versions = parseClassifiers(
packageData,
/^Framework :: Django :: ([\d.]+)$/
)
return this.constructor.render({ versions })
}
}
export default redirector({
category: 'platform-support',
route: {
base: 'pypi/djversions',
pattern: ':packageName*',
},
transformPath: ({ packageName }) =>
`/pypi/frameworkversions/django/${packageName}`,
dateAdded: new Date('2022-07-28'),
})

View File

@@ -1,32 +1,24 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
const isPipeSeparatedDjangoVersions = Joi.string().regex(
/^([1-9]\.[0-9]+(?: \| )?)+$/
t.create(
'redirect supported django versions (valid, package version in request)'
)
t.create('supported django versions (valid, package version in request)')
.get('/djangorestframework/3.7.3.json')
.expectBadge({
label: 'django versions',
message: isPipeSeparatedDjangoVersions,
})
.expectRedirect(
'/pypi/frameworkversions/django/djangorestframework/3.7.3.json'
)
t.create('supported django versions (valid, no package version specified)')
t.create(
'redirect supported django versions (valid, no package version specified)'
)
.get('/djangorestframework.json')
.expectBadge({
label: 'django versions',
message: isPipeSeparatedDjangoVersions,
})
.expectRedirect('/pypi/frameworkversions/django/djangorestframework.json')
t.create('supported django versions (no versions specified)')
t.create('redirect supported django versions (no versions specified)')
.get('/django/1.11.json')
.expectBadge({ label: 'django versions', message: 'missing' })
.expectRedirect('/pypi/frameworkversions/django/django/1.11.json')
t.create('supported django versions (invalid)')
t.create('redirect supported django versions (invalid)')
.get('/not-a-package.json')
.expectBadge({
label: 'django versions',
message: 'package or version not found',
})
.expectRedirect('/pypi/frameworkversions/django/not-a-package.json')

View File

@@ -0,0 +1,103 @@
import { InvalidResponse } from '../index.js'
import PypiBase from './pypi-base.js'
import { sortPypiVersions, parseClassifiers } from './pypi-helpers.js'
const frameworkNameMap = {
'aws-cdk': {
name: 'AWS CDK',
classifier: 'AWS CDK',
},
django: {
name: 'Django',
classifier: 'Django',
},
'django-cms': {
name: 'Django CMS',
classifier: 'Django CMS',
},
jupyterlab: {
name: 'JupyterLab',
classifier: 'Jupyter :: JupyterLab',
},
odoo: {
name: 'Odoo',
classifier: 'Odoo',
},
plone: {
name: 'Plone',
classifier: 'Plone',
},
wagtail: {
name: 'Wagtail',
classifier: 'Wagtail',
},
zope: {
name: 'Zope',
classifier: 'Zope',
},
}
const documentation = `
<p>
This service currently support the following Frameworks: <br/>
${Object.values(frameworkNameMap).map(obj => `<strong>${obj.name}</strong>`)}
</p>
`
export default class PypiFrameworkVersion extends PypiBase {
static category = 'platform-support'
static route = {
base: 'pypi/frameworkversions',
pattern: `:frameworkName(${Object.keys(frameworkNameMap).join(
'|'
)})/:packageName*`,
}
static examples = [
{
title: 'PyPI - Versions from Framework Classifiers',
namedParams: {
frameworkName: 'Plone',
packageName: 'plone.volto',
},
staticPreview: this.render({
name: 'Plone',
versions: ['5.2', '6.0'],
}),
keywords: ['python'],
documentation,
},
]
static defaultBadgeData = { label: 'versions' }
static render({ name, versions }) {
name = name ? name.toLowerCase() : ''
const label = `${name} versions`
return {
label,
message: sortPypiVersions(versions).join(' | '),
color: 'blue',
}
}
async handle({ frameworkName, packageName }) {
const classifier = frameworkNameMap[frameworkName]
? frameworkNameMap[frameworkName].classifier
: frameworkName
const name = frameworkNameMap[frameworkName]
? frameworkNameMap[frameworkName].name
: frameworkName
const regex = new RegExp(`^Framework :: ${classifier} :: ([\\d.]+)$`)
const packageData = await this.fetch({ egg: packageName })
const versions = parseClassifiers(packageData, regex)
if (versions.length === 0) {
throw new InvalidResponse({
prettyMessage: `${name} versions are missing for ${packageName}`,
})
}
return this.constructor.render({ name, versions })
}
}

View File

@@ -0,0 +1,164 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
const isPipeSeparatedFrameworkVersions = Joi.string().regex(
/^([1-9]+(\.[0-9]+)?(?: \| )?)+$/
)
t.create('supported django versions (valid, package version in request)')
.get('/django/djangorestframework/3.7.3.json')
.expectBadge({
label: 'django versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported django versions (valid, no package version specified)')
.get('/django/djangorestframework.json')
.expectBadge({
label: 'django versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported django versions (no versions specified)')
.get('/django/django/1.11.json')
.expectBadge({
label: 'versions',
message: 'Django versions are missing for django/1.11',
})
t.create('supported django versions (invalid)')
.get('/django/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported plone versions (valid, package version in request)')
.get('/plone/plone.rest/1.6.2.json')
.expectBadge({ label: 'plone versions', message: '4.3 | 5.0 | 5.1 | 5.2' })
t.create('supported plone versions (valid, no package version specified)')
.get('/plone/plone.rest.json')
.expectBadge({
label: 'plone versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported plone versions (invalid)')
.get('/plone/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported zope versions (valid, package version in request)')
.get('/zope/plone/5.2.9.json')
.expectBadge({ label: 'zope versions', message: '4' })
t.create('supported zope versions (valid, no package version specified)')
.get('/zope/Plone.json')
.expectBadge({
label: 'zope versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported zope versions (invalid)')
.get('/zope/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported wagtail versions (valid, package version in request)')
.get('/wagtail/wagtail-headless-preview/0.3.0.json')
.expectBadge({ label: 'wagtail versions', message: '2 | 3' })
t.create('supported wagtail versions (valid, no package version specified)')
.get('/wagtail/wagtail-headless-preview.json')
.expectBadge({
label: 'wagtail versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported wagtail versions (invalid)')
.get('/wagtail/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported django cms versions (valid, package version in request)')
.get('/django-cms/djangocms-ads/1.1.0.json')
.expectBadge({
label: 'django cms versions',
message: '3.7 | 3.8 | 3.9 | 3.10',
})
t.create('supported django cms versions (valid, no package version specified)')
.get('/django-cms/djangocms-ads.json')
.expectBadge({
label: 'django cms versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported django cms versions (invalid)')
.get('/django-cms/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported odoo versions (valid, package version in request)')
.get('/odoo/odoo-addon-sale-tier-validation/15.0.1.0.0.6.json')
.expectBadge({ label: 'odoo versions', message: '15.0' })
t.create('supported odoo versions (valid, no package version specified)')
.get('/odoo/odoo-addon-sale-tier-validation.json')
.expectBadge({
label: 'odoo versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported odoo versions (invalid)')
.get('/odoo/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported aws cdk versions (valid, package version in request)')
.get('/aws-cdk/aws-cdk.aws-glue-alpha/2.34.0a0.json')
.expectBadge({ label: 'aws cdk versions', message: '2' })
t.create('supported aws cdk versions (valid, no package version specified)')
.get('/aws-cdk/aws-cdk.aws-glue-alpha.json')
.expectBadge({
label: 'aws cdk versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported aws cdk versions (invalid)')
.get('/aws-cdk/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})
t.create('supported jupyterlab versions (valid, package version in request)')
.get('/jupyterlab/structured-text/0.0.2.json')
.expectBadge({ label: 'jupyterlab versions', message: '3' })
t.create('supported jupyterlab versions (valid, no package version specified)')
.get('/jupyterlab/structured-text.json')
.expectBadge({
label: 'jupyterlab versions',
message: isPipeSeparatedFrameworkVersions,
})
t.create('supported jupyterlab versions (invalid)')
.get('/jupyterlab/not-a-package.json')
.expectBadge({
label: 'versions',
message: 'package or version not found',
})

View File

@@ -6,7 +6,7 @@
our own functions to parse and sort django versions
*/
function parseDjangoVersionString(str) {
function parsePypiVersionString(str) {
if (typeof str !== 'string') {
return false
}
@@ -20,18 +20,12 @@ function parseDjangoVersionString(str) {
}
// Sort an array of django versions low to high.
function sortDjangoVersions(versions) {
function sortPypiVersions(versions) {
return versions.sort((a, b) => {
if (
parseDjangoVersionString(a).major === parseDjangoVersionString(b).major
) {
return (
parseDjangoVersionString(a).minor - parseDjangoVersionString(b).minor
)
if (parsePypiVersionString(a).major === parsePypiVersionString(b).major) {
return parsePypiVersionString(a).minor - parsePypiVersionString(b).minor
} else {
return (
parseDjangoVersionString(a).major - parseDjangoVersionString(b).major
)
return parsePypiVersionString(a).major - parsePypiVersionString(b).major
}
})
}
@@ -88,16 +82,12 @@ function getLicenses(packageData) {
}
function getPackageFormats(packageData) {
const {
info: { version },
releases,
} = packageData
const releasesForVersion = releases[version]
const { urls } = packageData
return {
hasWheel: releasesForVersion.some(({ packagetype }) =>
hasWheel: urls.some(({ packagetype }) =>
['wheel', 'bdist_wheel'].includes(packagetype)
),
hasEgg: releasesForVersion.some(({ packagetype }) =>
hasEgg: urls.some(({ packagetype }) =>
['egg', 'bdist_egg'].includes(packagetype)
),
}
@@ -105,8 +95,8 @@ function getPackageFormats(packageData) {
export {
parseClassifiers,
parseDjangoVersionString,
sortDjangoVersions,
parsePypiVersionString,
sortPypiVersions,
getLicenses,
getPackageFormats,
}

View File

@@ -1,8 +1,8 @@
import { test, given, forCases } from 'sazerac'
import {
parseClassifiers,
parseDjangoVersionString,
sortDjangoVersions,
parsePypiVersionString,
sortPypiVersions,
getLicenses,
getPackageFormats,
} from './pypi-helpers.js'
@@ -60,7 +60,7 @@ describe('PyPI helpers', function () {
given(classifiersFixture, /^(?!.*)*$/).expect([])
})
test(parseDjangoVersionString, function () {
test(parsePypiVersionString, function () {
given('1').expect({ major: 1, minor: 0 })
given('1.0').expect({ major: 1, minor: 0 })
given('7.2').expect({ major: 7, minor: 2 })
@@ -69,7 +69,7 @@ describe('PyPI helpers', function () {
given('foo').expect({ major: 0, minor: 0 })
})
test(sortDjangoVersions, function () {
test(sortPypiVersions, function () {
// Each of these includes a different variant: 2.0, 2, and 2.0rc1.
given(['2.0', '1.9', '10', '1.11', '2.1', '2.11']).expect([
'1.9',
@@ -164,34 +164,17 @@ describe('PyPI helpers', function () {
test(getPackageFormats, () => {
given({
info: { version: '2.19.1' },
releases: {
'1.0.4': [{ packagetype: 'sdist' }],
'2.19.1': [{ packagetype: 'bdist_wheel' }, { packagetype: 'sdist' }],
},
urls: [{ packagetype: 'bdist_wheel' }, { packagetype: 'sdist' }],
}).expect({ hasWheel: true, hasEgg: false })
given({
info: { version: '1.0.4' },
releases: {
'1.0.4': [{ packagetype: 'sdist' }],
'2.19.1': [{ packagetype: 'bdist_wheel' }, { packagetype: 'sdist' }],
},
urls: [{ packagetype: 'sdist' }],
}).expect({ hasWheel: false, hasEgg: false })
given({
info: { version: '0.8.2' },
releases: {
0.8: [{ packagetype: 'sdist' }],
'0.8.1': [
{ packagetype: 'bdist_egg' },
{ packagetype: 'bdist_egg' },
{ packagetype: 'sdist' },
],
'0.8.2': [
{ packagetype: 'bdist_egg' },
{ packagetype: 'bdist_egg' },
{ packagetype: 'sdist' },
],
},
urls: [
{ packagetype: 'bdist_egg' },
{ packagetype: 'bdist_egg' },
{ packagetype: 'sdist' },
],
}).expect({ hasWheel: false, hasEgg: true })
})
})

View File

@@ -24,7 +24,7 @@ t.create('license (from trove classifier)')
license: '',
classifiers: ['License :: OSI Approved :: MIT License'],
},
releases: {},
urls: [],
})
)
.expectBadge({
@@ -46,7 +46,7 @@ t.create('license (as acronym from trove classifier)')
'License :: OSI Approved :: GNU General Public License (GPL)',
],
},
releases: {},
urls: [],
})
)
.expectBadge({

View File

@@ -43,7 +43,7 @@ t.create('no trove classifiers')
license: 'foo',
classifiers: [],
},
releases: {},
urls: [],
})
)
.expectBadge({

View File

@@ -0,0 +1,154 @@
import gql from 'graphql-tag'
import Joi from 'joi'
import yaml from 'js-yaml'
import { renderVersionBadge } from '../version.js'
import { GithubAuthV4Service } from '../github/github-auth-service.js'
import { NotFound, InvalidResponse } from '../index.js'
const tagsSchema = Joi.object({
data: Joi.object({
repository: Joi.object({
refs: Joi.object({
edges: Joi.array()
.items({
node: Joi.object({
name: Joi.string().required(),
}).required(),
})
.required(),
}).required(),
}).required(),
}).required(),
}).required()
const contentSchema = Joi.object({
data: Joi.object({
repository: Joi.object({
object: Joi.object({
text: Joi.string().required(),
}).allow(null),
}).required(),
}).required(),
}).required()
const distroSchema = Joi.object({
repositories: Joi.object().required(),
})
const packageSchema = Joi.object({
release: Joi.object({
version: Joi.string().required(),
}).required(),
})
export default class RosVersion extends GithubAuthV4Service {
static category = 'version'
static route = { base: 'ros/v', pattern: ':distro/:packageName' }
static examples = [
{
title: 'ROS Package Index',
namedParams: { distro: 'humble', packageName: 'vision_msgs' },
staticPreview: {
...renderVersionBadge({ version: '4.0.0' }),
label: 'ros | humble',
},
},
]
static defaultBadgeData = { label: 'ros' }
async handle({ distro, packageName }) {
const tagsJson = await this._requestGraphql({
query: gql`
query ($refPrefix: String!) {
repository(owner: "ros", name: "rosdistro") {
refs(
refPrefix: $refPrefix
first: 30
orderBy: { field: TAG_COMMIT_DATE, direction: DESC }
) {
edges {
node {
name
}
}
}
}
}
`,
variables: { refPrefix: `refs/tags/${distro}/` },
schema: tagsSchema,
})
// Filter for tags that look like dates: humble/2022-06-10
const tags = tagsJson.data.repository.refs.edges
.map(edge => edge.node.name)
.filter(tag => /^\d+-\d+-\d+$/.test(tag))
.sort()
.reverse()
const ref = tags[0] ? `refs/tags/${distro}/${tags[0]}` : 'refs/heads/master'
const prettyRef = tags[0] ? `${distro}/${tags[0]}` : 'master'
const contentJson = await this._requestGraphql({
query: gql`
query ($expression: String!) {
repository(owner: "ros", name: "rosdistro") {
object(expression: $expression) {
... on Blob {
text
}
}
}
}
`,
variables: {
expression: `${ref}:${distro}/distribution.yaml`,
},
schema: contentSchema,
})
if (!contentJson.data.repository.object) {
throw new NotFound({
prettyMessage: `distribution.yaml not found: ${distro}@${prettyRef}`,
})
}
const version = this.constructor._parseReleaseVersionFromDistro(
contentJson.data.repository.object.text,
packageName
)
return { ...renderVersionBadge({ version }), label: `ros | ${distro}` }
}
static _parseReleaseVersionFromDistro(distroYaml, packageName) {
let distro
try {
distro = yaml.load(distroYaml)
} catch (err) {
throw new InvalidResponse({
prettyMessage: 'unparseable distribution.yml',
underlyingError: err,
})
}
const validatedDistro = this._validate(distro, distroSchema, {
prettyErrorMessage: 'invalid distribution.yml',
})
if (!validatedDistro.repositories[packageName]) {
throw new NotFound({ prettyMessage: `package not found: ${packageName}` })
}
const packageInfo = this._validate(
validatedDistro.repositories[packageName],
packageSchema,
{
prettyErrorMessage: `invalid section for ${packageName} in distribution.yml`,
}
)
// Strip off "release inc" suffix
return packageInfo.release.version.replace(/-\d+$/, '')
}
}

View File

@@ -0,0 +1,44 @@
import { expect } from 'chai'
import RosVersion from './ros-version.service.js'
describe('parseReleaseVersionFromDistro', function () {
it('returns correct version', function () {
expect(
RosVersion._parseReleaseVersionFromDistro(
`
%YAML 1.1
# ROS distribution file
# see REP 143: http://ros.org/reps/rep-0143.html
---
release_platforms:
debian:
- bullseye
rhel:
- '8'
ubuntu:
- jammy
repositories:
vision_msgs:
doc:
type: git
url: https://github.com/ros-perception/vision_msgs.git
version: ros2
release:
tags:
release: release/humble/{package}/{version}
url: https://github.com/ros2-gbp/vision_msgs-release.git
version: 4.0.0-2
source:
test_pull_requests: true
type: git
url: https://github.com/ros-perception/vision_msgs.git
version: ros2
status: developed
type: distribution
version: 2
`,
'vision_msgs'
)
).to.equal('4.0.0')
})
})

View File

@@ -0,0 +1,28 @@
import { isSemver } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('gets the package version of vision_msgs in active distro')
.get('/humble/vision_msgs.json')
.expectBadge({ label: 'ros | humble', message: isSemver })
t.create('gets the package version of vision_msgs in EOL distro')
.get('/lunar/vision_msgs.json')
.expectBadge({ label: 'ros | lunar', message: isSemver })
t.create('returns not found for invalid package')
.get('/humble/this package does not exist - ros test.json')
.expectBadge({
label: 'ros',
color: 'red',
message: 'package not found: this package does not exist - ros test',
})
t.create('returns error for invalid distro')
.get('/xxxxxx/vision_msgs.json')
.expectBadge({
label: 'ros',
color: 'red',
message: 'distribution.yaml not found: xxxxxx@master',
})

View File

@@ -1,5 +1,5 @@
import Joi from 'joi'
import moment from 'moment'
import dayjs from 'dayjs'
import { renderDownloadsBadge } from '../downloads.js'
import { nonNegativeInteger } from '../validators.js'
import { BaseJsonService } from '../index.js'
@@ -15,15 +15,15 @@ const intervalMap = {
},
dw: {
// 6 days, since date range is inclusive,
startDate: endDate => moment(endDate).subtract(6, 'days'),
startDate: endDate => dayjs(endDate).subtract(6, 'days'),
interval: 'week',
},
dm: {
startDate: endDate => moment(endDate).subtract(30, 'days'),
startDate: endDate => dayjs(endDate).subtract(30, 'days'),
interval: 'month',
},
dt: {
startDate: () => moment(0),
startDate: () => dayjs(0),
},
}
@@ -78,7 +78,7 @@ export default class Sourceforge extends BaseJsonService {
folder ? `${folder}/` : ''
}stats/json`
// get yesterday since today is incomplete
const endDate = moment().subtract(24, 'hours')
const endDate = dayjs().subtract(24, 'hours')
const startDate = intervalMap[interval].startDate(endDate)
const options = {
searchParams: {

View File

@@ -1,4 +1,4 @@
import moment from 'moment'
import dayjs from 'dayjs'
import Joi from 'joi'
import { nonNegativeInteger } from '../validators.js'
import { BaseJsonService } from '../index.js'
@@ -19,10 +19,10 @@ export default class StackExchangeMonthlyQuestions extends BaseJsonService {
static examples = [
{
title: 'Stack Exchange monthly questions',
namedParams: { stackexchangesite: 'stackoverflow', query: 'momentjs' },
namedParams: { stackexchangesite: 'stackoverflow', query: 'dayjs' },
staticPreview: this.render({
stackexchangesite: 'stackoverflow',
query: 'momentjs',
query: 'dayjs',
numValue: 2000,
}),
keywords: ['stackexchange', 'stackoverflow'],
@@ -41,12 +41,12 @@ export default class StackExchangeMonthlyQuestions extends BaseJsonService {
}
async handle({ stackexchangesite, query }) {
const today = moment().toDate()
const prevMonthStart = moment(today)
const today = dayjs().toDate()
const prevMonthStart = dayjs(today)
.subtract(1, 'months')
.startOf('month')
.unix()
const prevMonthEnd = moment(today)
const prevMonthEnd = dayjs(today)
.subtract(1, 'months')
.endOf('month')
.unix()

View File

@@ -2,10 +2,10 @@ import { isMetricOverTimePeriod } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Monthly Questions for StackOverflow Momentjs')
.get('/stackoverflow/qm/momentjs.json')
t.create('Monthly Questions for StackOverflow dayjs')
.get('/stackoverflow/qm/dayjs.json')
.expectBadge({
label: 'stackoverflow momentjs questions',
label: 'stackoverflow dayjs questions',
message: isMetricOverTimePeriod,
})

View File

@@ -79,6 +79,8 @@ const isMetricWithPattern = nestedRegexp => {
const isMetricOpenIssues = isMetricWithPattern(/ open/)
const isMetricClosedIssues = isMetricWithPattern(/ closed/)
const isMetricOverMetric = isMetricWithPattern(
/\/([1-9][0-9]*[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY])/
)
@@ -167,6 +169,7 @@ export {
isMetricAllowNegative,
isMetricWithPattern,
isMetricOpenIssues,
isMetricClosedIssues,
isMetricOverMetric,
isMetricOverTimePeriod,
isZeroOverTimePeriod,

View File

@@ -2,8 +2,11 @@
* Commonly-used functions for formatting text in badge labels. Includes
* ordinal numbers, currency codes, star ratings, versions, etc.
*/
import moment from 'moment'
moment().format()
import dayjs from 'dayjs'
import calendar from 'dayjs/plugin/calendar.js'
import relativeTime from 'dayjs/plugin/relativeTime.js'
dayjs.extend(calendar)
dayjs.extend(relativeTime)
function starRating(rating, max = 5) {
const flooredRating = Math.floor(rating)
@@ -109,7 +112,7 @@ function maybePluralize(singular, countable, plural) {
}
function formatDate(d) {
const date = moment(d)
const date = dayjs(d)
const dateString = date.calendar(null, {
lastDay: '[yesterday]',
sameDay: '[today]',
@@ -117,12 +120,12 @@ function formatDate(d) {
sameElse: 'MMMM YYYY',
})
// Trim current year from date string
return dateString.replace(` ${moment().year()}`, '').toLowerCase()
return dateString.replace(` ${dayjs().year()}`, '').toLowerCase()
}
function formatRelativeDate(timestamp) {
return moment()
.to(moment.unix(parseInt(timestamp, 10)))
return dayjs()
.to(dayjs.unix(parseInt(timestamp, 10)))
.toLowerCase()
}

View File

@@ -1,14 +1,16 @@
import moment from 'moment'
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat.js'
import { InvalidResponse } from '../index.js'
import { formatDate } from '../text-formatters.js'
import { age as ageColor } from '../color-formatters.js'
import { documentation, BaseWordpress } from './wordpress-base.js'
dayjs.extend(customParseFormat)
const extensionData = {
plugin: {
capt: 'Plugin',
exampleSlug: 'bbpress',
lastUpdateFormat: 'YYYY-MM-DD hh:mma GMT',
lastUpdateFormat: 'YYYY-MM-DD hh:mma [GMT]',
},
theme: {
capt: 'Theme',
@@ -50,7 +52,7 @@ function LastUpdateForType(extensionType) {
}
transform(lastUpdate) {
const date = moment(lastUpdate, lastUpdateFormat)
const date = dayjs(lastUpdate, lastUpdateFormat)
if (date.isValid()) {
return date.format('YYYY-MM-DD')