@stats-forge/github-stats-forge-core 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/build/api/api-result.d.ts +6 -7
- package/build/api/api-result.d.ts.map +1 -1
- package/build/api/api-result.js +4 -5
- package/build/api/contributed-to.d.ts +23 -0
- package/build/api/contributed-to.d.ts.map +1 -0
- package/build/api/contributed-to.js +43 -0
- package/build/api/gist.d.ts +8 -22
- package/build/api/gist.d.ts.map +1 -1
- package/build/api/gist.js +14 -36
- package/build/api/handler.d.ts +16 -0
- package/build/api/handler.d.ts.map +1 -0
- package/build/api/handler.js +29 -0
- package/build/api/index.d.ts +13 -12
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +1 -0
- package/build/api/params.d.ts +21 -12
- package/build/api/params.d.ts.map +1 -1
- package/build/api/params.js +41 -19
- package/build/api/pin.d.ts +11 -31
- package/build/api/pin.d.ts.map +1 -1
- package/build/api/pin.js +35 -63
- package/build/api/stats.d.ts +15 -16
- package/build/api/stats.d.ts.map +1 -1
- package/build/api/stats.js +60 -99
- package/build/api/top-langs.d.ts +13 -18
- package/build/api/top-langs.d.ts.map +1 -1
- package/build/api/top-langs.js +35 -72
- package/build/api/wakatime.d.ts +11 -17
- package/build/api/wakatime.d.ts.map +1 -1
- package/build/api/wakatime.js +27 -64
- package/build/calculateRank.d.ts +0 -9
- package/build/calculateRank.d.ts.map +1 -1
- package/build/calculateRank.js +12 -17
- package/build/cards/contributed-to.d.ts +19 -0
- package/build/cards/contributed-to.d.ts.map +1 -0
- package/build/cards/contributed-to.js +242 -0
- package/build/cards/gist.d.ts +3 -4
- package/build/cards/gist.d.ts.map +1 -1
- package/build/cards/gist.js +38 -43
- package/build/cards/options.d.ts +1 -1
- package/build/cards/repo.d.ts +14 -5
- package/build/cards/repo.d.ts.map +1 -1
- package/build/cards/repo.js +93 -103
- package/build/cards/stats.d.ts +18 -11
- package/build/cards/stats.d.ts.map +1 -1
- package/build/cards/stats.js +191 -222
- package/build/cards/top-languages.d.ts +18 -33
- package/build/cards/top-languages.d.ts.map +1 -1
- package/build/cards/top-languages.js +196 -387
- package/build/cards/wakatime.d.ts +17 -8
- package/build/cards/wakatime.d.ts.map +1 -1
- package/build/cards/wakatime.js +133 -187
- package/build/common/Card.d.ts +20 -59
- package/build/common/Card.d.ts.map +1 -1
- package/build/common/Card.js +131 -198
- package/build/common/I18n.d.ts +1 -7
- package/build/common/I18n.d.ts.map +1 -1
- package/build/common/I18n.js +7 -8
- package/build/common/brand.d.ts +76 -0
- package/build/common/brand.d.ts.map +1 -0
- package/build/common/brand.js +73 -0
- package/build/common/color.d.ts +4 -17
- package/build/common/color.d.ts.map +1 -1
- package/build/common/color.js +67 -49
- package/build/common/config.d.ts +4 -14
- package/build/common/config.d.ts.map +1 -1
- package/build/common/config.js +3 -16
- package/build/common/constants.d.ts +6 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +5 -1
- package/build/common/date.d.ts +50 -5
- package/build/common/date.d.ts.map +1 -1
- package/build/common/date.js +104 -4
- package/build/common/emojiMap.d.ts +8 -0
- package/build/common/emojiMap.d.ts.map +1 -0
- package/build/common/emojiMap.js +10 -0
- package/build/common/emojiMap.json +1915 -0
- package/build/common/error.d.ts +1 -10
- package/build/common/error.d.ts.map +1 -1
- package/build/common/error.js +1 -10
- package/build/common/fmt.d.ts +3 -15
- package/build/common/fmt.d.ts.map +1 -1
- package/build/common/fmt.js +7 -35
- package/build/common/http.d.ts +2 -7
- package/build/common/http.d.ts.map +1 -1
- package/build/common/http.js +8 -17
- package/build/common/icons.d.ts +20 -20
- package/build/common/icons.d.ts.map +1 -1
- package/build/common/icons.js +108 -67
- package/build/common/languageColors.d.ts +0 -1
- package/build/common/languageColors.d.ts.map +1 -1
- package/build/common/languageColors.js +1 -4
- package/build/common/languageColors.json +18 -2
- package/build/common/ops.d.ts +11 -17
- package/build/common/ops.d.ts.map +1 -1
- package/build/common/ops.js +22 -39
- package/build/common/render.d.ts +34 -82
- package/build/common/render.d.ts.map +1 -1
- package/build/common/render.js +225 -259
- package/build/common/retryer.d.ts +2 -7
- package/build/common/retryer.d.ts.map +1 -1
- package/build/common/retryer.js +4 -11
- package/build/fetchers/contributed-to.d.ts +62 -0
- package/build/fetchers/contributed-to.d.ts.map +1 -0
- package/build/fetchers/contributed-to.js +184 -0
- package/build/fetchers/gist.d.ts +2 -5
- package/build/fetchers/gist.d.ts.map +1 -1
- package/build/fetchers/gist.js +1 -5
- package/build/fetchers/graphql-error.d.ts +13 -0
- package/build/fetchers/graphql-error.d.ts.map +1 -0
- package/build/fetchers/graphql-error.js +29 -0
- package/build/fetchers/index.d.ts +13 -12
- package/build/fetchers/index.d.ts.map +1 -1
- package/build/fetchers/index.js +1 -0
- package/build/fetchers/repo.d.ts +2 -11
- package/build/fetchers/repo.d.ts.map +1 -1
- package/build/fetchers/repo.js +20 -33
- package/build/fetchers/stats.d.ts +16 -40
- package/build/fetchers/stats.d.ts.map +1 -1
- package/build/fetchers/stats.js +89 -271
- package/build/fetchers/top-languages.d.ts +2 -9
- package/build/fetchers/top-languages.d.ts.map +1 -1
- package/build/fetchers/top-languages.js +16 -47
- package/build/fetchers/types.d.ts +25 -1
- package/build/fetchers/types.d.ts.map +1 -1
- package/build/fetchers/wakatime.d.ts +2 -6
- package/build/fetchers/wakatime.d.ts.map +1 -1
- package/build/fetchers/wakatime.js +1 -5
- package/build/graphql/contributionsCollection.d.ts +9 -0
- package/build/graphql/contributionsCollection.d.ts.map +1 -0
- package/build/graphql/contributionsCollection.js +12 -0
- package/build/graphql/contributionsDocument.d.ts +6 -6
- package/build/graphql/contributionsDocument.d.ts.map +1 -1
- package/build/graphql/contributionsDocument.js +8 -16
- package/build/graphql/generated/contributed-to.d.ts +22 -0
- package/build/graphql/generated/contributed-to.d.ts.map +1 -0
- package/build/graphql/generated/contributed-to.js +11 -0
- package/build/graphql/generated/gist.d.ts +1 -1
- package/build/graphql/generated/repo.d.ts +1 -1
- package/build/graphql/generated/stats.d.ts +16 -4
- package/build/graphql/generated/stats.d.ts.map +1 -1
- package/build/graphql/generated/stats.js +2 -2
- package/build/graphql/generated/top-languages.d.ts +2 -2
- package/build/graphql/graphqlDocument.d.ts +1 -2
- package/build/graphql/graphqlDocument.d.ts.map +1 -1
- package/build/graphql/graphqlDocument.js +0 -1
- package/build/graphql/reposContributedToDocument.d.ts +4 -5
- package/build/graphql/reposContributedToDocument.d.ts.map +1 -1
- package/build/graphql/reposContributedToDocument.js +11 -7
- package/build/markup/css.d.ts +35 -0
- package/build/markup/css.d.ts.map +1 -0
- package/build/markup/css.js +64 -0
- package/build/markup/element.d.ts +41 -0
- package/build/markup/element.d.ts.map +1 -0
- package/build/markup/element.js +127 -0
- package/build/markup/html.d.ts +13 -0
- package/build/markup/html.d.ts.map +1 -0
- package/build/markup/html.js +27 -0
- package/build/markup/index.d.ts +9 -0
- package/build/markup/index.d.ts.map +1 -0
- package/build/markup/index.js +6 -0
- package/build/markup/serialize.d.ts +16 -0
- package/build/markup/serialize.d.ts.map +1 -0
- package/build/markup/serialize.js +17 -0
- package/build/themes/index.d.ts +332 -333
- package/build/themes/index.d.ts.map +1 -1
- package/build/themes/index.js +1 -1
- package/build/translations.d.ts +66 -7
- package/build/translations.d.ts.map +1 -1
- package/build/translations.js +686 -629
- package/package.json +17 -26
- package/src/api/api-result.ts +10 -9
- package/src/api/contributed-to.ts +84 -0
- package/src/api/gist.ts +22 -46
- package/src/api/handler.ts +42 -0
- package/src/api/index.ts +13 -12
- package/src/api/params.ts +74 -29
- package/src/api/pin.ts +38 -65
- package/src/api/stats.ts +81 -118
- package/src/api/top-langs.ts +38 -80
- package/src/api/wakatime.ts +35 -73
- package/src/calculateRank.ts +12 -23
- package/src/cards/contributed-to.ts +373 -0
- package/src/cards/gist.ts +55 -49
- package/src/cards/options.ts +1 -1
- package/src/cards/repo.ts +134 -120
- package/src/cards/stats.ts +262 -252
- package/src/cards/top-languages.ts +315 -422
- package/src/cards/wakatime.ts +207 -225
- package/src/common/Card.ts +207 -214
- package/src/common/I18n.ts +7 -8
- package/src/common/brand.ts +109 -0
- package/src/common/color.ts +80 -57
- package/src/common/config.ts +5 -18
- package/src/common/constants.ts +8 -2
- package/src/common/date.ts +135 -5
- package/src/common/emojiMap.json +1915 -0
- package/src/common/emojiMap.ts +13 -0
- package/src/common/error.ts +2 -11
- package/src/common/fmt.ts +7 -44
- package/src/common/http.ts +9 -15
- package/src/common/icons.ts +122 -42
- package/src/common/languageColors.json +18 -2
- package/src/common/languageColors.ts +1 -4
- package/src/common/ops.ts +31 -48
- package/src/common/render.ts +334 -284
- package/src/common/retryer.ts +8 -15
- package/src/fetchers/contributed-to.ts +271 -0
- package/src/fetchers/gist.ts +8 -12
- package/src/fetchers/graphql-error.ts +36 -0
- package/src/fetchers/index.ts +15 -12
- package/src/fetchers/repo.ts +27 -40
- package/src/fetchers/stats.ts +157 -366
- package/src/fetchers/top-languages.ts +27 -55
- package/src/fetchers/types.ts +27 -1
- package/src/fetchers/wakatime.ts +5 -9
- package/src/graphql/contributionsCollection.ts +18 -0
- package/src/graphql/contributionsDocument.ts +14 -19
- package/src/graphql/generated/contributed-to.ts +25 -0
- package/src/graphql/generated/gist.ts +1 -1
- package/src/graphql/generated/repo.ts +1 -1
- package/src/graphql/generated/stats.ts +21 -8
- package/src/graphql/generated/top-languages.ts +2 -2
- package/src/graphql/graphqlDocument.ts +1 -2
- package/src/graphql/queries/contributed-to.graphql +8 -0
- package/src/graphql/queries/stats.graphql +14 -2
- package/src/graphql/reposContributedToDocument.ts +16 -15
- package/src/markup/css.ts +118 -0
- package/src/markup/element.ts +246 -0
- package/src/markup/html.ts +34 -0
- package/src/markup/index.ts +9 -0
- package/src/markup/serialize.ts +27 -0
- package/src/themes/index.ts +1 -1
- package/src/translations.ts +699 -629
- package/build/cards/index.d.ts +0 -11
- package/build/cards/index.d.ts.map +0 -1
- package/build/cards/index.js +0 -7
- package/build/common/html.d.ts +0 -8
- package/build/common/html.d.ts.map +0 -1
- package/build/common/html.js +0 -14
- package/build/index.d.ts +0 -15
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -10
- package/src/_emoji-name-map.d.ts +0 -10
- package/src/_github-username-regex.d.ts +0 -4
- package/src/cards/index.ts +0 -21
- package/src/common/html.ts +0 -17
- package/src/index.ts +0 -18
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import emojiMapJson from './emojiMap.json' with { type: 'json' };
|
|
2
|
+
|
|
3
|
+
// The generated JSON types has literal keys; index it as a plain lookup table.
|
|
4
|
+
const emojiMap: Record<string, string> = emojiMapJson;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a GitHub emoji shortcode to its unicode character.
|
|
8
|
+
*
|
|
9
|
+
* @returns The emoji, or `undefined` when GitHub has no such shortcode.
|
|
10
|
+
*/
|
|
11
|
+
const getEmoji = (name: string): string | undefined => emojiMap[name];
|
|
12
|
+
|
|
13
|
+
export { getEmoji };
|
package/src/common/error.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OWNER_AFFILIATIONS } from './constants.
|
|
1
|
+
import { OWNER_AFFILIATIONS } from './constants.ts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file One error type for everything a card render can fail on.
|
|
@@ -65,10 +65,6 @@ class CardError extends Error {
|
|
|
65
65
|
readonly secondaryMessage: string | undefined;
|
|
66
66
|
readonly param: string | undefined;
|
|
67
67
|
|
|
68
|
-
/**
|
|
69
|
-
* @param message First line of the error card.
|
|
70
|
-
* @param init Why it failed, and what to draw under the message.
|
|
71
|
-
*/
|
|
72
68
|
constructor(message: string, init: CardErrorInit) {
|
|
73
69
|
super(message);
|
|
74
70
|
this.name = 'CardError';
|
|
@@ -85,8 +81,6 @@ class CardError extends Error {
|
|
|
85
81
|
/**
|
|
86
82
|
* A param the endpoint cannot render with.
|
|
87
83
|
*
|
|
88
|
-
* @param param Name of the param.
|
|
89
|
-
* @param secondaryMessage What is wrong with it.
|
|
90
84
|
* @returns The error.
|
|
91
85
|
*/
|
|
92
86
|
static invalidParam(param: string, secondaryMessage: string): CardError {
|
|
@@ -99,10 +93,8 @@ class CardError extends Error {
|
|
|
99
93
|
|
|
100
94
|
/**
|
|
101
95
|
* A param the endpoint cannot render without.
|
|
96
|
+
* `param` carries the first; the message names them all.
|
|
102
97
|
*
|
|
103
|
-
* @param params Names of the missing params.
|
|
104
|
-
* `param` carries the first; the message names them all.
|
|
105
|
-
* @param secondaryMessage Where to pass them, when the endpoint can say.
|
|
106
98
|
* @returns The error.
|
|
107
99
|
*/
|
|
108
100
|
static missingParam(params: Array<string>, secondaryMessage?: string): CardError {
|
|
@@ -118,7 +110,6 @@ class CardError extends Error {
|
|
|
118
110
|
* Anything thrown that is not already a `CardError`:
|
|
119
111
|
* an upstream failure, since the query itself got this far.
|
|
120
112
|
*
|
|
121
|
-
* @param err Whatever was thrown.
|
|
122
113
|
* @returns The error, unchanged when it already was one.
|
|
123
114
|
*/
|
|
124
115
|
static from(err: unknown): CardError {
|
package/src/common/fmt.ts
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
import { encodeHTML } from './html.js';
|
|
2
|
-
import { splitWrappedText } from './render.js';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Retrieves num with suffix k(thousands) precise to given decimal places.
|
|
6
3
|
*
|
|
7
|
-
* @param num The number to format.
|
|
8
|
-
* @param precision The number of decimal places to include.
|
|
9
4
|
* @returns The formatted number.
|
|
10
5
|
*/
|
|
11
6
|
const kFormatter = (num: number, precision?: number): string | number => {
|
|
12
7
|
const abs = Math.abs(num);
|
|
13
8
|
const sign = Math.sign(num);
|
|
14
9
|
|
|
15
|
-
if (typeof precision === 'number' && !isNaN(precision)) {
|
|
16
|
-
return (sign * (abs / 1000)).toFixed(precision)
|
|
10
|
+
if (typeof precision === 'number' && !Number.isNaN(precision)) {
|
|
11
|
+
return `${(sign * (abs / 1000)).toFixed(precision)}k`;
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
if (abs < 1000) {
|
|
20
15
|
return sign * abs;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
|
-
return `${sign * parseFloat((abs / 1000).toFixed(1))}k`;
|
|
18
|
+
return `${sign * Number.parseFloat((abs / 1000).toFixed(1))}k`;
|
|
24
19
|
};
|
|
25
20
|
|
|
26
21
|
/**
|
|
27
22
|
* Convert bytes to a human-readable string representation.
|
|
28
23
|
*
|
|
29
|
-
* @param bytes The number of bytes to convert.
|
|
30
|
-
* @returns The human-readable representation of bytes.
|
|
31
24
|
* @throws {Error} If bytes is negative or too large.
|
|
25
|
+
*
|
|
26
|
+
* @returns The human-readable representation of bytes.
|
|
32
27
|
*/
|
|
33
28
|
const formatBytes = (bytes: number): string => {
|
|
34
29
|
if (bytes < 0) {
|
|
@@ -48,39 +43,7 @@ const formatBytes = (bytes: number): string => {
|
|
|
48
43
|
throw new Error('Bytes is too large to convert to a human-readable string');
|
|
49
44
|
}
|
|
50
45
|
|
|
51
|
-
return `${(bytes /
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Split text over multiple lines based on the card width.
|
|
56
|
-
*
|
|
57
|
-
* @param text Text to split.
|
|
58
|
-
* @param width Available wrap width in px.
|
|
59
|
-
* @param fontSize Font size in px.
|
|
60
|
-
* @param maxLines Maximum number of lines.
|
|
61
|
-
* @returns Array of lines.
|
|
62
|
-
*/
|
|
63
|
-
const wrapTextMultiline = (
|
|
64
|
-
text: string,
|
|
65
|
-
width: number,
|
|
66
|
-
fontSize: number,
|
|
67
|
-
maxLines = 3,
|
|
68
|
-
): Array<string> => {
|
|
69
|
-
const wrapped = splitWrappedText(text, fontSize, width);
|
|
70
|
-
const lines = wrapped.map((line) => encodeHTML(line.trim())).slice(0, maxLines); // Only consider maxLines lines
|
|
71
|
-
|
|
72
|
-
// Add "..." to the last line if the text exceeds maxLines
|
|
73
|
-
if (wrapped.length > maxLines) {
|
|
74
|
-
const lastIndex = maxLines - 1;
|
|
75
|
-
const lastLine = lines[lastIndex];
|
|
76
|
-
if (lastLine !== undefined) {
|
|
77
|
-
lines[lastIndex] = `${lastLine}...`;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Remove empty lines if text fits in less than maxLines lines
|
|
82
|
-
const multiLineText = lines.filter(Boolean);
|
|
83
|
-
return multiLineText;
|
|
46
|
+
return `${(bytes / base ** i).toFixed(1)} ${unit}`;
|
|
84
47
|
};
|
|
85
48
|
|
|
86
|
-
export { kFormatter, formatBytes
|
|
49
|
+
export { kFormatter, formatBytes };
|
package/src/common/http.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphQLDocument } from '../graphql/graphqlDocument.
|
|
1
|
+
import type { GraphQLDocument } from '../graphql/graphqlDocument.ts';
|
|
2
2
|
|
|
3
3
|
const GITHUB_GRAPHQL_API = 'https://api.github.com/graphql';
|
|
4
4
|
|
|
@@ -35,9 +35,6 @@ interface FetcherContext {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @param fetchImpl Transport to send the request with.
|
|
39
|
-
* @param url Absolute URL to request.
|
|
40
|
-
* @param init Request init forwarded to the transport.
|
|
41
38
|
* @returns The response; a JSON body parsed, anything else left as text.
|
|
42
39
|
*/
|
|
43
40
|
const httpRequest = async <TData>(
|
|
@@ -70,20 +67,19 @@ type GraphQLResponse<TResult> = HttpResponse<{
|
|
|
70
67
|
}>;
|
|
71
68
|
|
|
72
69
|
/**
|
|
73
|
-
* @param document Generated query document.
|
|
74
|
-
* @param scheme `Authorization` scheme for the token.
|
|
75
70
|
* @returns A fetcher `retryer` can drive.
|
|
76
71
|
*/
|
|
77
|
-
const createGraphQLFetcher =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
const createGraphQLFetcher =
|
|
73
|
+
<TResult, TVariables>(
|
|
74
|
+
document: GraphQLDocument<TResult, TVariables>,
|
|
75
|
+
scheme: 'bearer' | 'token',
|
|
76
|
+
) =>
|
|
77
|
+
(
|
|
82
78
|
variables: TVariables,
|
|
83
79
|
token: string,
|
|
84
80
|
{ fetch }: FetcherContext,
|
|
85
|
-
): Promise<GraphQLResponse<TResult>> =>
|
|
86
|
-
|
|
81
|
+
): Promise<GraphQLResponse<TResult>> =>
|
|
82
|
+
httpRequest(fetch, GITHUB_GRAPHQL_API, {
|
|
87
83
|
method: 'POST',
|
|
88
84
|
headers: {
|
|
89
85
|
Authorization: `${scheme} ${token}`,
|
|
@@ -91,8 +87,6 @@ const createGraphQLFetcher = <TResult, TVariables>(
|
|
|
91
87
|
},
|
|
92
88
|
body: JSON.stringify({ query: document.text, variables }),
|
|
93
89
|
});
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
90
|
|
|
97
91
|
export { createGraphQLFetcher, defaultFetch, httpRequest };
|
|
98
92
|
export type { FetcherContext, FetchLike, GraphQLResponse, HttpResponse };
|
package/src/common/icons.ts
CHANGED
|
@@ -23,57 +23,137 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
23
23
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
24
|
SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
+
import type { Child } from '../markup/index.ts';
|
|
27
|
+
import { el } from '../markup/index.ts';
|
|
26
28
|
|
|
27
29
|
const icons = {
|
|
28
|
-
star:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
star: el('path', {
|
|
31
|
+
'fill-rule': 'evenodd',
|
|
32
|
+
d: 'M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z',
|
|
33
|
+
}),
|
|
34
|
+
commits: el('path', {
|
|
35
|
+
'fill-rule': 'evenodd',
|
|
36
|
+
d: 'M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z',
|
|
37
|
+
}),
|
|
38
|
+
prs: el('path', {
|
|
39
|
+
'fill-rule': 'evenodd',
|
|
40
|
+
d: 'M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z',
|
|
41
|
+
}),
|
|
42
|
+
prs_merged: el('path', {
|
|
43
|
+
'fill-rule': 'evenodd',
|
|
44
|
+
d: 'M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z',
|
|
45
|
+
}),
|
|
46
|
+
prs_merged_percentage: el('path', {
|
|
47
|
+
'fill-rule': 'evenodd',
|
|
48
|
+
d: 'M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0zM4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z',
|
|
49
|
+
}),
|
|
50
|
+
issues: el('path', {
|
|
51
|
+
'fill-rule': 'evenodd',
|
|
52
|
+
d: 'M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z',
|
|
53
|
+
}),
|
|
54
|
+
repo: el('path', {
|
|
55
|
+
'fill-rule': 'evenodd',
|
|
56
|
+
d: 'M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z',
|
|
57
|
+
}),
|
|
58
|
+
fork: el('path', {
|
|
59
|
+
'fill-rule': 'evenodd',
|
|
60
|
+
d: 'M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z',
|
|
61
|
+
}),
|
|
62
|
+
reviews: el('path', {
|
|
63
|
+
'fill-rule': 'evenodd',
|
|
64
|
+
d: 'M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z',
|
|
65
|
+
}),
|
|
66
|
+
discussions_started: el('path', {
|
|
67
|
+
'fill-rule': 'evenodd',
|
|
68
|
+
d: 'M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z',
|
|
69
|
+
}),
|
|
70
|
+
discussions_answered: el('path', {
|
|
71
|
+
'fill-rule': 'evenodd',
|
|
72
|
+
d: 'M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z',
|
|
73
|
+
}),
|
|
74
|
+
comments: el('path', {
|
|
75
|
+
d: 'M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z',
|
|
76
|
+
}),
|
|
77
|
+
contributions: el('path', {
|
|
78
|
+
d: 'M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z',
|
|
79
|
+
}),
|
|
80
|
+
gist: el('path', {
|
|
81
|
+
'fill-rule': 'evenodd',
|
|
82
|
+
d: 'M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z',
|
|
83
|
+
}),
|
|
84
|
+
pulse: el('path', {
|
|
85
|
+
d: 'M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.529a.751.751 0 0 1-1.392 0L6 4.769l-1.304 3.26A.751.751 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z',
|
|
86
|
+
}),
|
|
87
|
+
code: el('path', {
|
|
88
|
+
d: 'M4.72 3.22a.75.75 0 0 1 1.06 1.06L2.06 8l3.72 3.72a.75.75 0 1 1-1.06 1.06L.47 8.53a.75.75 0 0 1 0-1.06Zm6.56 0a.75.75 0 1 0-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 1 0 1.06 1.06l4.25-4.25a.75.75 0 0 0 0-1.06Z',
|
|
89
|
+
}),
|
|
90
|
+
clock: el('path', {
|
|
91
|
+
d: 'M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7-3.25v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.75.75 0 0 1 7 8.25v-3.5a.75.75 0 0 1 1.5 0Z',
|
|
92
|
+
}),
|
|
43
93
|
};
|
|
44
94
|
|
|
95
|
+
/** Attributes every rank glyph shares, so the three variants differ only where they mean to. */
|
|
96
|
+
const RANK_TEXT = {
|
|
97
|
+
x: -5,
|
|
98
|
+
'alignment-baseline': 'central',
|
|
99
|
+
'dominant-baseline': 'central',
|
|
100
|
+
'text-anchor': 'middle',
|
|
101
|
+
} as const;
|
|
102
|
+
|
|
45
103
|
/**
|
|
46
104
|
* Get rank icon
|
|
47
105
|
*
|
|
48
|
-
* @
|
|
49
|
-
* @param rankLevel - The rank level.
|
|
50
|
-
* @param percentile - The rank percentile.
|
|
51
|
-
* @returns The SVG code of the rank icon
|
|
106
|
+
* @returns The rank icon.
|
|
52
107
|
*/
|
|
53
|
-
const rankIcon = (
|
|
54
|
-
switch (
|
|
55
|
-
case 'github':
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
108
|
+
const rankIcon = (kind: string, rankLevel: string, percentile: number): Child => {
|
|
109
|
+
switch (kind) {
|
|
110
|
+
case 'github': {
|
|
111
|
+
return el(
|
|
112
|
+
'svg',
|
|
113
|
+
{
|
|
114
|
+
x: -38,
|
|
115
|
+
y: -30,
|
|
116
|
+
height: 66,
|
|
117
|
+
width: 66,
|
|
118
|
+
'aria-hidden': 'true',
|
|
119
|
+
viewBox: '0 0 16 16',
|
|
120
|
+
version: '1.1',
|
|
121
|
+
'data-view-component': 'true',
|
|
122
|
+
'data-testid': 'github-rank-icon',
|
|
123
|
+
},
|
|
124
|
+
el('path', {
|
|
125
|
+
d: 'M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z',
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
case 'percentile': {
|
|
130
|
+
return [
|
|
131
|
+
el(
|
|
132
|
+
'text',
|
|
133
|
+
{
|
|
134
|
+
...RANK_TEXT,
|
|
135
|
+
y: -12,
|
|
136
|
+
'data-testid': 'percentile-top-header',
|
|
137
|
+
class: 'rank-percentile-header',
|
|
138
|
+
},
|
|
139
|
+
'Top',
|
|
140
|
+
),
|
|
141
|
+
el(
|
|
142
|
+
'text',
|
|
143
|
+
{
|
|
144
|
+
...RANK_TEXT,
|
|
145
|
+
y: 12,
|
|
146
|
+
'data-testid': 'percentile-rank-value',
|
|
147
|
+
class: 'rank-percentile-text',
|
|
148
|
+
},
|
|
149
|
+
`${percentile.toFixed(1)}%`,
|
|
150
|
+
),
|
|
151
|
+
];
|
|
152
|
+
}
|
|
70
153
|
case 'default':
|
|
71
|
-
default:
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
${rankLevel}
|
|
75
|
-
</text>
|
|
76
|
-
`;
|
|
154
|
+
default: {
|
|
155
|
+
return el('text', { ...RANK_TEXT, y: 3, 'data-testid': 'level-rank-icon' }, rankLevel);
|
|
156
|
+
}
|
|
77
157
|
}
|
|
78
158
|
};
|
|
79
159
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"Adobe Font Metrics": "#fa0f00",
|
|
21
21
|
"Agda": "#315665",
|
|
22
22
|
"Aiken": "#640ff8",
|
|
23
|
+
"Aleo": "#154BF9",
|
|
23
24
|
"Alloy": "#64C800",
|
|
24
25
|
"Alpine Abuild": "#0D597F",
|
|
25
26
|
"Altium Designer": "#A89663",
|
|
@@ -42,10 +43,13 @@
|
|
|
42
43
|
"AutoIt": "#1C3552",
|
|
43
44
|
"Avro IDL": "#0040FF",
|
|
44
45
|
"Awk": "#c30e9b",
|
|
46
|
+
"B": "#da7666",
|
|
45
47
|
"B (Formal Method)": "#8aa8c5",
|
|
46
48
|
"B4X": "#00e4ff",
|
|
47
49
|
"BAML": "#a855f7",
|
|
48
50
|
"BASIC": "#ff0000",
|
|
51
|
+
"BBCode": "#CAFF42",
|
|
52
|
+
"BIRD2": "#b6d7e4",
|
|
49
53
|
"BQN": "#2b7067",
|
|
50
54
|
"Ballerina": "#FF5000",
|
|
51
55
|
"Batchfile": "#C1F12E",
|
|
@@ -167,6 +171,7 @@
|
|
|
167
171
|
"FIGlet Font": "#FFDDBB",
|
|
168
172
|
"FIRRTL": "#2f632f",
|
|
169
173
|
"FLUX": "#88ccff",
|
|
174
|
+
"FPP": "#d37327",
|
|
170
175
|
"Factor": "#636746",
|
|
171
176
|
"Fancy": "#7b9db4",
|
|
172
177
|
"Fantom": "#14253c",
|
|
@@ -263,6 +268,7 @@
|
|
|
263
268
|
"ISPC": "#2D68B1",
|
|
264
269
|
"Idris": "#b30000",
|
|
265
270
|
"Ignore List": "#000000",
|
|
271
|
+
"ImHex Pattern Language": "#3a6be0",
|
|
266
272
|
"ImageJ Macro": "#99AAFF",
|
|
267
273
|
"Imba": "#16cec6",
|
|
268
274
|
"Inno Setup": "#264b99",
|
|
@@ -272,6 +278,7 @@
|
|
|
272
278
|
"Isabelle ROOT": "#FEFE00",
|
|
273
279
|
"J": "#9EEDFF",
|
|
274
280
|
"JAR Manifest": "#b07219",
|
|
281
|
+
"JASS": "#FF0303",
|
|
275
282
|
"JCL": "#d90e09",
|
|
276
283
|
"JFlex": "#DBCA00",
|
|
277
284
|
"JSON": "#292929",
|
|
@@ -335,6 +342,7 @@
|
|
|
335
342
|
"Literate Haskell": "#5e5086",
|
|
336
343
|
"LiveCode Script": "#0c5ba5",
|
|
337
344
|
"LiveScript": "#499886",
|
|
345
|
+
"Lobster": "#f95428",
|
|
338
346
|
"Logtalk": "#295b9a",
|
|
339
347
|
"LookML": "#652B81",
|
|
340
348
|
"Lua": "#000080",
|
|
@@ -360,6 +368,7 @@
|
|
|
360
368
|
"Mermaid": "#ff3670",
|
|
361
369
|
"Meson": "#007800",
|
|
362
370
|
"Metal": "#8f14e9",
|
|
371
|
+
"MiniScript": "#4B4A56",
|
|
363
372
|
"MiniYAML": "#ff1111",
|
|
364
373
|
"MiniZinc": "#06a9e6",
|
|
365
374
|
"Mint": "#02b046",
|
|
@@ -474,6 +483,7 @@
|
|
|
474
483
|
"Qt Script": "#00b841",
|
|
475
484
|
"Quake": "#882233",
|
|
476
485
|
"QuakeC": "#975777",
|
|
486
|
+
"Quartus Simulation IP": "#58C42E",
|
|
477
487
|
"QuickBASIC": "#008080",
|
|
478
488
|
"Quint": "#9d6ce5",
|
|
479
489
|
"R": "#198CE7",
|
|
@@ -501,6 +511,7 @@
|
|
|
501
511
|
"Regular Expression": "#009a00",
|
|
502
512
|
"Ren'Py": "#ff7f7f",
|
|
503
513
|
"Rez": "#FFDAB3",
|
|
514
|
+
"Rhai": "#FBA63B",
|
|
504
515
|
"Ring": "#2D54CB",
|
|
505
516
|
"Riot": "#A71E49",
|
|
506
517
|
"RobotFramework": "#00c0b5",
|
|
@@ -514,6 +525,7 @@
|
|
|
514
525
|
"Rust": "#dea584",
|
|
515
526
|
"SAS": "#B34936",
|
|
516
527
|
"SCSS": "#c6538c",
|
|
528
|
+
"SIP": "#4E8D83",
|
|
517
529
|
"SPARQL": "#0C4597",
|
|
518
530
|
"SQF": "#3F3F3F",
|
|
519
531
|
"SQL": "#e38c00",
|
|
@@ -522,7 +534,7 @@
|
|
|
522
534
|
"STL": "#373b5e",
|
|
523
535
|
"SVG": "#ff9900",
|
|
524
536
|
"Sail": "#259dd5",
|
|
525
|
-
"
|
|
537
|
+
"Salt": "#57bcad",
|
|
526
538
|
"Sass": "#a53b70",
|
|
527
539
|
"Scala": "#c22d40",
|
|
528
540
|
"Scaml": "#bd181a",
|
|
@@ -587,6 +599,7 @@
|
|
|
587
599
|
"Textile": "#ffe7ac",
|
|
588
600
|
"Thrift": "#D12127",
|
|
589
601
|
"Toit": "#c2c9fb",
|
|
602
|
+
"Tolk": "#30A1F5",
|
|
590
603
|
"Tor Config": "#59316b",
|
|
591
604
|
"Tree-sitter Query": "#8ea64c",
|
|
592
605
|
"Turing": "#cf142b",
|
|
@@ -610,9 +623,11 @@
|
|
|
610
623
|
"Velocity Template Language": "#507cff",
|
|
611
624
|
"Vento": "#ff0080",
|
|
612
625
|
"Verilog": "#b2b7f8",
|
|
626
|
+
"Verse": "#518ef8",
|
|
627
|
+
"Vespa Schema Definition": "#61D790",
|
|
613
628
|
"Vim Help File": "#199f4b",
|
|
614
|
-
"Vim Script": "#199f4b",
|
|
615
629
|
"Vim Snippet": "#199f4b",
|
|
630
|
+
"Vim script": "#199f4b",
|
|
616
631
|
"Visual Basic .NET": "#945db7",
|
|
617
632
|
"Visual Basic 6.0": "#2c6353",
|
|
618
633
|
"Volt": "#1F1F1F",
|
|
@@ -672,6 +687,7 @@
|
|
|
672
687
|
"reStructuredText": "#141414",
|
|
673
688
|
"sed": "#64b970",
|
|
674
689
|
"templ": "#66D0DD",
|
|
690
|
+
"ucode": "#00b8d4",
|
|
675
691
|
"vCard": "#ee2647",
|
|
676
692
|
"wisp": "#7582D1",
|
|
677
693
|
"xBase": "#403a40"
|
|
@@ -9,11 +9,8 @@ const languageColors: Record<string, string> = languageColorsJson;
|
|
|
9
9
|
/**
|
|
10
10
|
* Resolves a language's brand color from the generated table.
|
|
11
11
|
*
|
|
12
|
-
* @param name Language name as GitHub spells it.
|
|
13
12
|
* @returns The language's hex color, or the default gray when it is unknown.
|
|
14
13
|
*/
|
|
15
|
-
const getLanguageColor = (name: string): string =>
|
|
16
|
-
return languageColors[name] ?? DEFAULT_LANG_COLOR;
|
|
17
|
-
};
|
|
14
|
+
const getLanguageColor = (name: string): string => languageColors[name] ?? DEFAULT_LANG_COLOR;
|
|
18
15
|
|
|
19
16
|
export { DEFAULT_LANG_COLOR, getLanguageColor };
|