@stats-forge/github-stats-forge-core 0.0.1 → 0.1.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.
Files changed (208) hide show
  1. package/README.md +0 -10
  2. package/build/api/api-result.d.ts +6 -7
  3. package/build/api/api-result.d.ts.map +1 -1
  4. package/build/api/api-result.js +4 -5
  5. package/build/api/gist.d.ts +3 -10
  6. package/build/api/gist.d.ts.map +1 -1
  7. package/build/api/gist.js +4 -11
  8. package/build/api/index.d.ts +12 -12
  9. package/build/api/params.d.ts +11 -8
  10. package/build/api/params.d.ts.map +1 -1
  11. package/build/api/params.js +16 -14
  12. package/build/api/pin.d.ts +3 -19
  13. package/build/api/pin.d.ts.map +1 -1
  14. package/build/api/pin.js +6 -22
  15. package/build/api/stats.d.ts +10 -4
  16. package/build/api/stats.d.ts.map +1 -1
  17. package/build/api/stats.js +6 -32
  18. package/build/api/top-langs.d.ts +12 -6
  19. package/build/api/top-langs.d.ts.map +1 -1
  20. package/build/api/top-langs.js +6 -26
  21. package/build/api/wakatime.d.ts +13 -5
  22. package/build/api/wakatime.d.ts.map +1 -1
  23. package/build/api/wakatime.js +4 -21
  24. package/build/calculateRank.d.ts +0 -9
  25. package/build/calculateRank.d.ts.map +1 -1
  26. package/build/calculateRank.js +12 -17
  27. package/build/cards/gist.d.ts +2 -4
  28. package/build/cards/gist.d.ts.map +1 -1
  29. package/build/cards/gist.js +27 -36
  30. package/build/cards/options.d.ts +1 -1
  31. package/build/cards/repo.d.ts +2 -4
  32. package/build/cards/repo.d.ts.map +1 -1
  33. package/build/cards/repo.js +61 -93
  34. package/build/cards/stats.d.ts +3 -8
  35. package/build/cards/stats.d.ts.map +1 -1
  36. package/build/cards/stats.js +119 -165
  37. package/build/cards/top-languages.d.ts +5 -31
  38. package/build/cards/top-languages.d.ts.map +1 -1
  39. package/build/cards/top-languages.js +176 -384
  40. package/build/cards/wakatime.d.ts +4 -6
  41. package/build/cards/wakatime.d.ts.map +1 -1
  42. package/build/cards/wakatime.js +118 -185
  43. package/build/common/Card.d.ts +14 -62
  44. package/build/common/Card.d.ts.map +1 -1
  45. package/build/common/Card.js +97 -199
  46. package/build/common/I18n.d.ts +0 -6
  47. package/build/common/I18n.d.ts.map +1 -1
  48. package/build/common/I18n.js +3 -6
  49. package/build/common/color.d.ts +4 -17
  50. package/build/common/color.d.ts.map +1 -1
  51. package/build/common/color.js +67 -49
  52. package/build/common/config.d.ts +4 -14
  53. package/build/common/config.d.ts.map +1 -1
  54. package/build/common/config.js +3 -16
  55. package/build/common/constants.d.ts +4 -2
  56. package/build/common/constants.d.ts.map +1 -1
  57. package/build/common/constants.js +3 -1
  58. package/build/common/date.d.ts +0 -2
  59. package/build/common/date.d.ts.map +1 -1
  60. package/build/common/date.js +0 -2
  61. package/build/common/emojiMap.d.ts +8 -0
  62. package/build/common/emojiMap.d.ts.map +1 -0
  63. package/build/common/emojiMap.js +10 -0
  64. package/build/common/emojiMap.json +1915 -0
  65. package/build/common/error.d.ts +1 -10
  66. package/build/common/error.d.ts.map +1 -1
  67. package/build/common/error.js +1 -10
  68. package/build/common/fmt.d.ts +3 -15
  69. package/build/common/fmt.d.ts.map +1 -1
  70. package/build/common/fmt.js +7 -35
  71. package/build/common/http.d.ts +2 -7
  72. package/build/common/http.d.ts.map +1 -1
  73. package/build/common/http.js +8 -17
  74. package/build/common/icons.d.ts +18 -20
  75. package/build/common/icons.d.ts.map +1 -1
  76. package/build/common/icons.js +103 -67
  77. package/build/common/languageColors.d.ts +0 -1
  78. package/build/common/languageColors.d.ts.map +1 -1
  79. package/build/common/languageColors.js +1 -4
  80. package/build/common/languageColors.json +18 -2
  81. package/build/common/ops.d.ts +3 -14
  82. package/build/common/ops.d.ts.map +1 -1
  83. package/build/common/ops.js +19 -30
  84. package/build/common/render.d.ts +28 -82
  85. package/build/common/render.d.ts.map +1 -1
  86. package/build/common/render.js +175 -211
  87. package/build/common/retryer.d.ts +2 -7
  88. package/build/common/retryer.d.ts.map +1 -1
  89. package/build/common/retryer.js +4 -11
  90. package/build/fetchers/gist.d.ts +2 -5
  91. package/build/fetchers/gist.d.ts.map +1 -1
  92. package/build/fetchers/gist.js +1 -5
  93. package/build/fetchers/index.d.ts +12 -12
  94. package/build/fetchers/repo.d.ts +2 -11
  95. package/build/fetchers/repo.d.ts.map +1 -1
  96. package/build/fetchers/repo.js +20 -33
  97. package/build/fetchers/stats.d.ts +2 -32
  98. package/build/fetchers/stats.d.ts.map +1 -1
  99. package/build/fetchers/stats.js +27 -86
  100. package/build/fetchers/top-languages.d.ts +2 -9
  101. package/build/fetchers/top-languages.d.ts.map +1 -1
  102. package/build/fetchers/top-languages.js +15 -31
  103. package/build/fetchers/types.d.ts +1 -1
  104. package/build/fetchers/wakatime.d.ts +2 -6
  105. package/build/fetchers/wakatime.d.ts.map +1 -1
  106. package/build/fetchers/wakatime.js +1 -5
  107. package/build/graphql/contributionsDocument.d.ts +3 -3
  108. package/build/graphql/contributionsDocument.d.ts.map +1 -1
  109. package/build/graphql/contributionsDocument.js +0 -1
  110. package/build/graphql/generated/gist.d.ts +1 -1
  111. package/build/graphql/generated/repo.d.ts +1 -1
  112. package/build/graphql/generated/stats.d.ts +3 -3
  113. package/build/graphql/generated/top-languages.d.ts +2 -2
  114. package/build/graphql/graphqlDocument.d.ts +0 -1
  115. package/build/graphql/graphqlDocument.d.ts.map +1 -1
  116. package/build/graphql/graphqlDocument.js +0 -1
  117. package/build/graphql/reposContributedToDocument.d.ts +4 -5
  118. package/build/graphql/reposContributedToDocument.d.ts.map +1 -1
  119. package/build/graphql/reposContributedToDocument.js +0 -2
  120. package/build/markup/css.d.ts +35 -0
  121. package/build/markup/css.d.ts.map +1 -0
  122. package/build/markup/css.js +64 -0
  123. package/build/markup/element.d.ts +41 -0
  124. package/build/markup/element.d.ts.map +1 -0
  125. package/build/markup/element.js +127 -0
  126. package/build/markup/html.d.ts +13 -0
  127. package/build/markup/html.d.ts.map +1 -0
  128. package/build/markup/html.js +27 -0
  129. package/build/markup/index.d.ts +9 -0
  130. package/build/markup/index.d.ts.map +1 -0
  131. package/build/markup/index.js +6 -0
  132. package/build/markup/serialize.d.ts +16 -0
  133. package/build/markup/serialize.d.ts.map +1 -0
  134. package/build/markup/serialize.js +17 -0
  135. package/build/themes/index.d.ts +332 -333
  136. package/build/themes/index.d.ts.map +1 -1
  137. package/build/themes/index.js +1 -1
  138. package/build/translations.d.ts +2 -6
  139. package/build/translations.d.ts.map +1 -1
  140. package/build/translations.js +621 -628
  141. package/package.json +17 -26
  142. package/src/api/api-result.ts +10 -9
  143. package/src/api/gist.ts +11 -18
  144. package/src/api/index.ts +12 -12
  145. package/src/api/params.ts +27 -21
  146. package/src/api/pin.ts +13 -28
  147. package/src/api/stats.ts +13 -39
  148. package/src/api/top-langs.ts +13 -33
  149. package/src/api/wakatime.ts +11 -28
  150. package/src/calculateRank.ts +12 -23
  151. package/src/cards/gist.ts +40 -43
  152. package/src/cards/options.ts +1 -1
  153. package/src/cards/repo.ts +97 -107
  154. package/src/cards/stats.ts +165 -184
  155. package/src/cards/top-languages.ts +297 -413
  156. package/src/cards/wakatime.ts +193 -221
  157. package/src/common/Card.ts +165 -217
  158. package/src/common/I18n.ts +3 -6
  159. package/src/common/color.ts +80 -57
  160. package/src/common/config.ts +5 -18
  161. package/src/common/constants.ts +5 -2
  162. package/src/common/date.ts +0 -2
  163. package/src/common/emojiMap.json +1915 -0
  164. package/src/common/emojiMap.ts +13 -0
  165. package/src/common/error.ts +2 -11
  166. package/src/common/fmt.ts +7 -44
  167. package/src/common/http.ts +9 -15
  168. package/src/common/icons.ts +117 -42
  169. package/src/common/languageColors.json +18 -2
  170. package/src/common/languageColors.ts +1 -4
  171. package/src/common/ops.ts +26 -34
  172. package/src/common/render.ts +279 -232
  173. package/src/common/retryer.ts +8 -15
  174. package/src/fetchers/gist.ts +8 -12
  175. package/src/fetchers/index.ts +12 -12
  176. package/src/fetchers/repo.ts +27 -40
  177. package/src/fetchers/stats.ts +44 -102
  178. package/src/fetchers/top-languages.ts +26 -40
  179. package/src/fetchers/types.ts +1 -1
  180. package/src/fetchers/wakatime.ts +5 -9
  181. package/src/graphql/contributionsDocument.ts +7 -5
  182. package/src/graphql/generated/gist.ts +1 -1
  183. package/src/graphql/generated/repo.ts +1 -1
  184. package/src/graphql/generated/stats.ts +2 -2
  185. package/src/graphql/generated/top-languages.ts +2 -2
  186. package/src/graphql/graphqlDocument.ts +0 -1
  187. package/src/graphql/reposContributedToDocument.ts +6 -7
  188. package/src/markup/css.ts +118 -0
  189. package/src/markup/element.ts +246 -0
  190. package/src/markup/html.ts +34 -0
  191. package/src/markup/index.ts +9 -0
  192. package/src/markup/serialize.ts +27 -0
  193. package/src/themes/index.ts +1 -1
  194. package/src/translations.ts +622 -629
  195. package/build/cards/index.d.ts +0 -11
  196. package/build/cards/index.d.ts.map +0 -1
  197. package/build/cards/index.js +0 -7
  198. package/build/common/html.d.ts +0 -8
  199. package/build/common/html.d.ts.map +0 -1
  200. package/build/common/html.js +0 -14
  201. package/build/index.d.ts +0 -15
  202. package/build/index.d.ts.map +0 -1
  203. package/build/index.js +0 -10
  204. package/src/_emoji-name-map.d.ts +0 -10
  205. package/src/_github-username-regex.d.ts +0 -4
  206. package/src/cards/index.ts +0 -21
  207. package/src/common/html.ts +0 -17
  208. 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 };
@@ -1,4 +1,4 @@
1
- import { OWNER_AFFILIATIONS } from './constants.js';
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) + 'k';
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 / Math.pow(base, i)).toFixed(1)} ${unit}`;
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, wrapTextMultiline };
49
+ export { kFormatter, formatBytes };
@@ -1,4 +1,4 @@
1
- import type { GraphQLDocument } from '../graphql/graphqlDocument.js';
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 = <TResult, TVariables>(
78
- document: GraphQLDocument<TResult, TVariables>,
79
- scheme: 'bearer' | 'token',
80
- ) => {
81
- return (
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
- return httpRequest(fetch, GITHUB_GRAPHQL_API, {
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 };
@@ -23,57 +23,132 @@ 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: `<path fill-rule="evenodd" 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"/>`,
29
- commits: `<path fill-rule="evenodd" 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"/>`,
30
- prs: `<path fill-rule="evenodd" 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"/>`,
31
- prs_merged: `<path fill-rule="evenodd" 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" />`,
32
- prs_merged_percentage: `<path fill-rule="evenodd" 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" />`,
33
- issues: `<path fill-rule="evenodd" 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"/>`,
34
- icon: `<path fill-rule="evenodd" 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"/>`,
35
- contribs: `<path fill-rule="evenodd" 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"/>`,
36
- fork: `<path fill-rule="evenodd" 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"></path>`,
37
- reviews: `<path fill-rule="evenodd" 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"/>`,
38
- discussions_started: `<path fill-rule="evenodd" 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" />`,
39
- discussions_answered: `<path fill-rule="evenodd" 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" />`,
40
- comments: `<path 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" />`,
41
- contributions: `<path 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"/>`,
42
- gist: `<path fill-rule="evenodd" 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" />`,
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
+ icon: 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
+ contribs: el('path', {
59
+ 'fill-rule': 'evenodd',
60
+ 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',
61
+ }),
62
+ fork: el('path', {
63
+ 'fill-rule': 'evenodd',
64
+ 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',
65
+ }),
66
+ reviews: el('path', {
67
+ 'fill-rule': 'evenodd',
68
+ 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',
69
+ }),
70
+ discussions_started: el('path', {
71
+ 'fill-rule': 'evenodd',
72
+ 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',
73
+ }),
74
+ discussions_answered: el('path', {
75
+ 'fill-rule': 'evenodd',
76
+ 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',
77
+ }),
78
+ comments: el('path', {
79
+ 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',
80
+ }),
81
+ contributions: el('path', {
82
+ 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',
83
+ }),
84
+ gist: el('path', {
85
+ 'fill-rule': 'evenodd',
86
+ 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',
87
+ }),
43
88
  };
44
89
 
90
+ /** Attributes every rank glyph shares, so the three variants differ only where they mean to. */
91
+ const RANK_TEXT = {
92
+ x: -5,
93
+ 'alignment-baseline': 'central',
94
+ 'dominant-baseline': 'central',
95
+ 'text-anchor': 'middle',
96
+ } as const;
97
+
45
98
  /**
46
99
  * Get rank icon
47
100
  *
48
- * @param rankIcon - The rank icon type.
49
- * @param rankLevel - The rank level.
50
- * @param percentile - The rank percentile.
51
- * @returns The SVG code of the rank icon
101
+ * @returns The rank icon.
52
102
  */
53
- const rankIcon = (rankIcon: string, rankLevel: string, percentile: number): string => {
54
- switch (rankIcon) {
55
- case 'github':
56
- return `
57
- <svg x="-38" y="-30" height="66" width="66" aria-hidden="true" viewBox="0 0 16 16" version="1.1" data-view-component="true" data-testid="github-rank-icon">
58
- <path 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"></path>
59
- </svg>
60
- `;
61
- case 'percentile':
62
- return `
63
- <text x="-5" y="-12" alignment-baseline="central" dominant-baseline="central" text-anchor="middle" data-testid="percentile-top-header" class="rank-percentile-header">
64
- Top
65
- </text>
66
- <text x="-5" y="12" alignment-baseline="central" dominant-baseline="central" text-anchor="middle" data-testid="percentile-rank-value" class="rank-percentile-text">
67
- ${percentile.toFixed(1)}%
68
- </text>
69
- `;
103
+ const rankIcon = (kind: string, rankLevel: string, percentile: number): Child => {
104
+ switch (kind) {
105
+ case 'github': {
106
+ return el(
107
+ 'svg',
108
+ {
109
+ x: -38,
110
+ y: -30,
111
+ height: 66,
112
+ width: 66,
113
+ 'aria-hidden': 'true',
114
+ viewBox: '0 0 16 16',
115
+ version: '1.1',
116
+ 'data-view-component': 'true',
117
+ 'data-testid': 'github-rank-icon',
118
+ },
119
+ el('path', {
120
+ 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',
121
+ }),
122
+ );
123
+ }
124
+ case 'percentile': {
125
+ return [
126
+ el(
127
+ 'text',
128
+ {
129
+ ...RANK_TEXT,
130
+ y: -12,
131
+ 'data-testid': 'percentile-top-header',
132
+ class: 'rank-percentile-header',
133
+ },
134
+ 'Top',
135
+ ),
136
+ el(
137
+ 'text',
138
+ {
139
+ ...RANK_TEXT,
140
+ y: 12,
141
+ 'data-testid': 'percentile-rank-value',
142
+ class: 'rank-percentile-text',
143
+ },
144
+ `${percentile.toFixed(1)}%`,
145
+ ),
146
+ ];
147
+ }
70
148
  case 'default':
71
- default:
72
- return `
73
- <text x="-5" y="3" alignment-baseline="central" dominant-baseline="central" text-anchor="middle" data-testid="level-rank-icon">
74
- ${rankLevel}
75
- </text>
76
- `;
149
+ default: {
150
+ return el('text', { ...RANK_TEXT, y: 3, 'data-testid': 'level-rank-icon' }, rankLevel);
151
+ }
77
152
  }
78
153
  };
79
154
 
@@ -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
- "SaltStack": "#646464",
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 };