Skip to content

Commit

Permalink
chore: deprecate gitter badge (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
amio authored Jul 9, 2024
1 parent cf6798e commit 50577c9
Show file tree
Hide file tree
Showing 43 changed files with 4 additions and 50 deletions.
39 changes: 0 additions & 39 deletions api-/gitter.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions libs/badge-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export const liveBadgeList = [
// social
'devrant',
'reddit',
// chat
'gitter',
// utilities
'opencollective',
'keybase',
Expand All @@ -55,7 +53,7 @@ export const liveBadgeList = [

export async function loadBadgeMeta() {
const liveBadgeExamples = await Promise.all(liveBadgeList.map(async id => {
const mod = await import(rel('../api-', id))
const mod = await import(rel('../api-legacy', id))
const { title, examples, handlers } = mod.default.meta

return {
Expand Down
2 changes: 1 addition & 1 deletion libs/got.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import got from 'got'

export default got.extend({
timeout: {
request: 4600,
request: 6400,
},
retry: {
limit: 0,
Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const nextConfig = {
'/xo',
// social network
'/discord',
'/gitter',
'/matrix',
'/runkit',
'/peertube',
Expand Down
6 changes: 0 additions & 6 deletions pages/api/matrix.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Got } from 'got'
import got from '../../libs/got'
import { millify } from '../../libs/utils'
import { fetchMembersCount as fetchGitterMembersCount } from '../../api-/gitter'
import { createBadgenHandler, PathArgs } from '../../libs/create-badgen-handler-next'

const BRAND_COLOR = 'black'
Expand All @@ -12,7 +11,6 @@ export default createBadgenHandler({
'/matrix/members/rust/matrix.org': 'members',
'/matrix/members/thisweekinmatrix': 'members',
'/matrix/members/archlinux/archlinux.org': 'members',
'/matrix/members/redom_redom/gitter.im': 'members'
},
handlers: {
'/matrix/members/:room/:server?': handler
Expand Down Expand Up @@ -44,10 +42,6 @@ async function handler ({ room, server = 'matrix.org' }: PathArgs) {
}

async function fetchMembersCount(roomName: string, server: string) {
if (server === 'gitter.im') {
const [gitterOrg, gitterRoom] = roomName.split('_')
return fetchGitterMembersCount(gitterOrg, gitterRoom)
}
const homeserver = await getHomeserver(server)
const client = got.extend({ prefixUrl: `${homeserver}/_matrix/client/r0` })
const roomAlias = `#${roomName}:${server}`
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
},
"include": [
"api-",
"api-legacy",
"libs",
"index.ts",
"components",
Expand Down

0 comments on commit 50577c9

Please sign in to comment.