Skip to content

Commit 7b0b8e4

Browse files
committed
Fix language boxes
1 parent 59472bb commit 7b0b8e4

31 files changed

+314
-2383
lines changed

data/code.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
]
1212
},
1313
"C# / .NET": {
14-
"Server Libraries": [
14+
"Server": [
1515
{
1616
"name": "graphql-dotnet",
1717
"description": "GraphQL for .NET",
@@ -38,7 +38,7 @@
3838
"github": "ChilliCream/hotchocolate"
3939
}
4040
],
41-
"GraphQL Clients": [
41+
"Client": [
4242
{
4343
"name": "GraphQL.Client",
4444
"description": "A GraphQL Client for .NET.",
@@ -60,7 +60,7 @@
6060
]
6161
},
6262
"Clojure": {
63-
"Server Libraries": [
63+
"Server": [
6464
{
6565
"name": "alumbra",
6666
"description": "A set of reusable GraphQL components for Clojure conforming to the data structures given in [alumbra.spec](https://github.com/alumbra/alumbra.spec).",
@@ -82,7 +82,7 @@
8282
"url": "https://github.com/walmartlabs/lacinia"
8383
}
8484
],
85-
"GraphQL Clients": [
85+
"Client": [
8686
{
8787
"name": "regraph",
8888
"description": "A GraphQL client implemented in Clojurescript with support for websockets.",
@@ -92,7 +92,7 @@
9292
]
9393
},
9494
"D": {
95-
"Server Libraries": [
95+
"Server": [
9696
{
9797
"name": "graphqld",
9898
"description": "A GraphQL implementaiton for the D Programming Language.",
@@ -102,7 +102,7 @@
102102
]
103103
},
104104
"Elixir": {
105-
"GraphQL Clients": [
105+
"Client": [
106106
{
107107
"name": "Neuron",
108108
"description": "A GraphQL client for Elixir",
@@ -116,7 +116,7 @@
116116
"url": "https://github.com/annkissam/common_graphql_client"
117117
}
118118
],
119-
"Server Libraries": [
119+
"Server": [
120120
{
121121
"name": "absinthe",
122122
"description": "GraphQL implementation for Elixir.",
@@ -132,7 +132,7 @@
132132
]
133133
},
134134
"Elm": {
135-
"GraphQL Clients": [
135+
"Client": [
136136
{
137137
"name": "dillonkearns/elm-graphql",
138138
"description": "Library and command-line code generator to create type-safe Elm code for a GraphQL endpoint.",
@@ -142,7 +142,7 @@
142142
]
143143
},
144144
"Erlang": {
145-
"Server Libraries": [
145+
"Server": [
146146
{
147147
"name": "graphql-erlang",
148148
"description": "GraphQL implementation in Erlang.",
@@ -152,7 +152,7 @@
152152
]
153153
},
154154
"Flutter": {
155-
"GraphQL Clients": [
155+
"Client": [
156156
{
157157
"name": "graphql",
158158
"description": "A GraphQL client implementation in Flutter.",
@@ -162,7 +162,7 @@
162162
]
163163
},
164164
"Go": {
165-
"Server Libraries": [
165+
"Server": [
166166
{
167167
"name": "graphql-go",
168168
"description": "An implementation of GraphQL for Go / Golang.",
@@ -206,7 +206,7 @@
206206
"github": "appointy/jaal"
207207
}
208208
],
209-
"GraphQL Clients": [
209+
"Client": [
210210
{
211211
"name": "graphql",
212212
"description": "A GraphQL client implementation in Go.",
@@ -216,7 +216,7 @@
216216
]
217217
},
218218
"Groovy": {
219-
"Server Libraries": [
219+
"Server": [
220220
{
221221
"name": "gorm-graphql",
222222
"howto": "**Core Library** - The GORM GraphQL library provides functionality to generate a GraphQL schema based on your GORM entities. In addition to mapping domain classes to a GraphQL schema, the core library also provides default implementations of \"data fetchers\" to query, update, and delete data through executions of the schema.\n\n**Grails Plugin** - In a addition to the Core Library, the GORM GraphQL Grails Plugin:\n\n- Provides a controller to receive and respond to GraphQL requests through HTTP, based on their guidelines.\n\n- Generates the schema at startup with spring bean configuration to make it easy to extend.\n\n- Includes a [GraphiQL](https://github.com/graphql/graphiql) browser enabled by default in development. The browser is accessible at /graphql/browser.\n\n- Overrides the default data binder to use the data binding provided by Grails\n- Provides a [trait](https://grails.github.io/gorm-graphql/latest/api/org/grails/gorm/graphql/plugin/testing/GraphQLSpec.html) to make integration testing of your GraphQL endpoints easier\n\nSee [the documentation](https://grails.github.io/gorm-graphql/latest/guide/index.html) for more information.",
@@ -232,7 +232,7 @@
232232
]
233233
},
234234
"Haskell": {
235-
"Server Libraries": [
235+
"Server": [
236236
{
237237
"name": "Morpheus GraphQL",
238238
"description": "A Haskell library for building GraphQL APIs.",
@@ -241,7 +241,7 @@
241241
"github": "morpheusgraphql/morpheus-graphql"
242242
}
243243
],
244-
"GraphQL Clients": [
244+
"Client": [
245245
{
246246
"name": "morpheus-graphql-client",
247247
"description": "A strongly-typed GraphQL client implementation in Haksell.",
@@ -251,7 +251,7 @@
251251
]
252252
},
253253
"Java / Android": {
254-
"Server Libraries": [
254+
"Server": [
255255
{
256256
"name": "graphql-java",
257257
"description": "A Java library for building GraphQL APIs.",
@@ -260,7 +260,7 @@
260260
"url": "https://github.com/graphql-java/graphql-java"
261261
}
262262
],
263-
"GraphQL Clients": [
263+
"Client": [
264264
{
265265
"name": "Apollo Android",
266266
"description": "A strongly-typed, caching GraphQL client for Android, written in Java.",
@@ -276,7 +276,7 @@
276276
]
277277
},
278278
"JavaScript": {
279-
"Server Libraries": [
279+
"Server": [
280280
{
281281
"name": "GraphQL.js",
282282
"description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
@@ -302,7 +302,7 @@
302302
"github": "apollographql/apollo-server"
303303
}
304304
],
305-
"GraphQL Clients": [
305+
"Client": [
306306
{
307307
"name": "Relay",
308308
"description": "Facebook's framework for building React applications that talk to a GraphQL backend.",
@@ -469,7 +469,7 @@
469469
]
470470
},
471471
"Julia": {
472-
"GraphQL Clients": [
472+
"Client": [
473473
{
474474
"name": "Diana.jl",
475475
"description": "A Julia GraphQL server implementation.",
@@ -479,7 +479,7 @@
479479
]
480480
},
481481
"Kotlin": {
482-
"Server Libraries": [
482+
"Server": [
483483
{
484484
"name": "graphql-kotlin",
485485
"description": "A set of libraries for running GraphQL server in Kotlin.",
@@ -489,7 +489,7 @@
489489
]
490490
},
491491
"Perl": {
492-
"Server Libraries": [
492+
"Server": [
493493
{
494494
"name": "graphql-perl",
495495
"description": "A Perl port of GraphQL reference implementation",
@@ -500,7 +500,7 @@
500500
]
501501
},
502502
"PHP": {
503-
"Server Libraries": [
503+
"Server": [
504504
{
505505
"name": "graphql-php",
506506
"description": "A PHP port of GraphQL reference implementation",
@@ -573,7 +573,7 @@
573573
]
574574
},
575575
"Python": {
576-
"Server Libraries": [
576+
"Server": [
577577
{
578578
"name": "Graphene",
579579
"description": "A Python library for building GraphQL APIs.",
@@ -582,7 +582,7 @@
582582
"github": "graphql-python/graphene"
583583
}
584584
],
585-
"GraphQL Clients": [
585+
"Client": [
586586
{
587587
"name": "GQL",
588588
"description": "A GraphQL client in Python.",
@@ -604,7 +604,7 @@
604604
]
605605
},
606606
"R": {
607-
"Server Libraries": [
607+
"Server": [
608608
{
609609
"name": "ghql",
610610
"description": "General purpose GraphQL R client",
@@ -614,7 +614,7 @@
614614
]
615615
},
616616
"Ruby": {
617-
"Server Libraries": [
617+
"Server": [
618618
{
619619
"name": "graphql-ruby",
620620
"description": "A Ruby library for building GraphQL APIs.",
@@ -633,7 +633,7 @@
633633
]
634634
},
635635
"Rust": {
636-
"Server Libraries": [
636+
"Server": [
637637
{
638638
"name": "graphql-rust/juniper",
639639
"description": "GraphQL server library for Rust",
@@ -643,7 +643,7 @@
643643
]
644644
},
645645
"Scala": {
646-
"Server Libraries": [
646+
"Server": [
647647
{
648648
"name": "Sangria",
649649
"description": "A Scala GraphQL library that supports [Relay](https://facebook.github.io/relay/).",
@@ -654,7 +654,7 @@
654654
]
655655
},
656656
"OCaml / Reason": {
657-
"Server Libraries": [
657+
"Server": [
658658
{
659659
"name": "ocaml-graphql-server",
660660
"description": "GraphQL server library for OCaml and Reason",
@@ -664,15 +664,15 @@
664664
]
665665
},
666666
"Swift / Objective-C iOS": {
667-
"Server Libraries": [
667+
"Server": [
668668
{
669669
"name": "Graphiti",
670670
"description": "Swift library for building GraphQL schemas/types fast, safely and easily.",
671671
"url": "https://github.com/GraphQLSwift/Graphiti",
672672
"github": "GraphQLSwift/Graphiti"
673673
}
674674
],
675-
"GraphQL Clients": [
675+
"Client": [
676676
{
677677
"name": "Apollo iOS",
678678
"description": "A GraphQL client for iOS that returns results as query-specific Swift types, and integrates with Xcode to show your Swift source and GraphQL side by side, with inline validation errors.",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
"gatsby-transformer-remark": "2.9.0",
2727
"graphql": "15.4.0",
2828
"marked": "1.2.2",
29+
"numbro": "2.3.2",
2930
"prism-react-renderer": "1.1.1",
3031
"prismjs": "1.22.0",
3132
"react": "17.0.1",
3233
"react-dom": "17.0.1",
33-
"react-helmet": "6.1.0"
34+
"react-helmet": "6.1.0",
35+
"timeago.js": "4.0.2"
3436
},
3537
"devDependencies": {
3638
"@types/codemirror": "0.0.98",

scripts/sort-libraries.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const fetch = require(`node-fetch`)
1+
const fetch = require(`node-fetch`);
2+
const numbro = require("numbro");
3+
const timeago = require('timeago.js');
24

35
const getGitHubStats = async githubRepo => {
46
const [owner, repoName] = githubRepo.split("/")
@@ -38,6 +40,14 @@ const getGitHubStats = async githubRepo => {
3840
totalCount
3941
}
4042
description
43+
licenseInfo {
44+
name
45+
}
46+
releases(last: 1) {
47+
nodes {
48+
publishedAt
49+
}
50+
}
4151
}
4252
}
4353
}
@@ -56,6 +66,9 @@ const getGitHubStats = async githubRepo => {
5666
},
5767
})
5868
const responseJson = await response.json()
69+
if (responseJson && responseJson.errors) {
70+
throw JSON.stringify(responseJson.errors);
71+
}
5972
if (!responseJson || !responseJson.data) {
6073
throw `GitHub returned empty response for ${owner}/${repoName}`
6174
}
@@ -75,9 +88,20 @@ const getGitHubStats = async githubRepo => {
7588
hasCommitsInLast3Months = true;
7689
}
7790
})
91+
const formattedStars = numbro(stars).format({
92+
average: true,
93+
});
94+
let lastRelease;
95+
if (repo.releases?.nodes?.length) {
96+
lastRelease = repo.releases.nodes[0].publishedAt;
97+
}
7898
return {
7999
hasCommitsInLast3Months,
80100
stars,
101+
formattedStars,
102+
license: repo.licenseInfo?.name,
103+
lastRelease,
104+
formattedLastRelease: lastRelease && timeago.format(lastRelease),
81105
}
82106
}
83107

0 commit comments

Comments
 (0)