@stats-organization/github-readme-stats-core 2.1.4 → 2.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.
Files changed (182) hide show
  1. package/build/api/gist.d.ts +2 -7
  2. package/build/api/gist.d.ts.map +1 -1
  3. package/build/api/gist.js +28 -26
  4. package/build/api/index.d.ts +3 -8
  5. package/build/api/index.d.ts.map +1 -1
  6. package/build/api/index.js +32 -36
  7. package/build/api/pin.d.ts +2 -7
  8. package/build/api/pin.d.ts.map +1 -1
  9. package/build/api/pin.js +18 -33
  10. package/build/api/top-langs.d.ts +2 -7
  11. package/build/api/top-langs.d.ts.map +1 -1
  12. package/build/api/top-langs.js +32 -44
  13. package/build/api/wakatime.d.ts +2 -7
  14. package/build/api/wakatime.d.ts.map +1 -1
  15. package/build/api/wakatime.js +28 -26
  16. package/build/calculateRank.d.ts +12 -11
  17. package/build/calculateRank.d.ts.map +1 -1
  18. package/build/calculateRank.js +18 -18
  19. package/build/cards/common-options.d.ts +13 -0
  20. package/build/cards/common-options.d.ts.map +1 -0
  21. package/build/cards/common-options.js +1 -0
  22. package/build/cards/gist.d.ts +11 -16
  23. package/build/cards/gist.d.ts.map +1 -1
  24. package/build/cards/gist.js +26 -31
  25. package/build/cards/repo.d.ts +19 -16
  26. package/build/cards/repo.d.ts.map +1 -1
  27. package/build/cards/repo.js +79 -72
  28. package/build/cards/stats.d.ts +29 -44
  29. package/build/cards/stats.d.ts.map +1 -1
  30. package/build/cards/stats.js +118 -173
  31. package/build/cards/top-languages.d.ts +81 -77
  32. package/build/cards/top-languages.d.ts.map +1 -1
  33. package/build/cards/top-languages.js +186 -184
  34. package/build/cards/wakatime.d.ts +21 -11
  35. package/build/cards/wakatime.d.ts.map +1 -1
  36. package/build/cards/wakatime.js +92 -109
  37. package/build/common/Card.d.ts +41 -14
  38. package/build/common/Card.d.ts.map +1 -1
  39. package/build/common/Card.js +92 -31
  40. package/build/common/I18n.d.ts +4 -2
  41. package/build/common/I18n.d.ts.map +1 -1
  42. package/build/common/color.d.ts +91 -15
  43. package/build/common/color.d.ts.map +1 -1
  44. package/build/common/color.js +163 -17
  45. package/build/common/config.d.ts +2 -1
  46. package/build/common/config.d.ts.map +1 -1
  47. package/build/common/config.js +16 -26
  48. package/build/common/constants.d.ts +2 -1
  49. package/build/common/constants.d.ts.map +1 -1
  50. package/build/common/date.d.ts +37 -0
  51. package/build/common/date.d.ts.map +1 -0
  52. package/build/common/date.js +31 -0
  53. package/build/common/html.js +1 -1
  54. package/build/common/http.d.ts +37 -5
  55. package/build/common/http.d.ts.map +1 -1
  56. package/build/common/http.js +29 -6
  57. package/build/common/icons.d.ts +1 -0
  58. package/build/common/icons.d.ts.map +1 -1
  59. package/build/common/icons.js +1 -0
  60. package/build/common/languageColors.d.ts +11 -0
  61. package/build/common/languageColors.d.ts.map +1 -0
  62. package/build/common/languageColors.js +15 -0
  63. package/build/common/languageColors.json +10 -1
  64. package/build/common/ops.d.ts +27 -33
  65. package/build/common/ops.d.ts.map +1 -1
  66. package/build/common/ops.js +31 -48
  67. package/build/common/render.d.ts +154 -113
  68. package/build/common/render.d.ts.map +1 -1
  69. package/build/common/render.js +209 -92
  70. package/build/common/retryer.d.ts +15 -6
  71. package/build/common/retryer.d.ts.map +1 -1
  72. package/build/common/retryer.js +2 -0
  73. package/build/fetchers/gist.d.ts +6 -21
  74. package/build/fetchers/gist.d.ts.map +1 -1
  75. package/build/fetchers/gist.js +28 -64
  76. package/build/fetchers/repo.d.ts +12 -11
  77. package/build/fetchers/repo.d.ts.map +1 -1
  78. package/build/fetchers/repo.js +27 -68
  79. package/build/fetchers/stats.d.ts +24 -17
  80. package/build/fetchers/stats.d.ts.map +1 -1
  81. package/build/fetchers/stats.js +302 -184
  82. package/build/fetchers/top-languages.d.ts +10 -15
  83. package/build/fetchers/top-languages.d.ts.map +1 -1
  84. package/build/fetchers/top-languages.js +52 -103
  85. package/build/fetchers/types.d.ts +130 -0
  86. package/build/fetchers/types.d.ts.map +1 -0
  87. package/build/fetchers/types.js +1 -0
  88. package/build/fetchers/wakatime.d.ts +9 -5
  89. package/build/fetchers/wakatime.d.ts.map +1 -1
  90. package/build/fetchers/wakatime.js +8 -4
  91. package/build/graphql/contributionsDocument.d.ts +18 -0
  92. package/build/graphql/contributionsDocument.d.ts.map +1 -0
  93. package/build/graphql/contributionsDocument.js +30 -0
  94. package/build/graphql/generated/common.d.ts +42 -0
  95. package/build/graphql/generated/common.d.ts.map +1 -0
  96. package/build/graphql/generated/common.js +2 -0
  97. package/build/graphql/generated/gist.d.ts +44 -0
  98. package/build/graphql/generated/gist.d.ts.map +1 -0
  99. package/build/graphql/generated/gist.js +27 -0
  100. package/build/graphql/generated/repo.d.ts +67 -0
  101. package/build/graphql/generated/repo.d.ts.map +1 -0
  102. package/build/graphql/generated/repo.js +30 -0
  103. package/build/graphql/generated/stats.d.ts +150 -0
  104. package/build/graphql/generated/stats.d.ts.map +1 -0
  105. package/build/graphql/generated/stats.js +95 -0
  106. package/build/graphql/generated/top-languages.d.ts +54 -0
  107. package/build/graphql/generated/top-languages.d.ts.map +1 -0
  108. package/build/graphql/generated/top-languages.js +27 -0
  109. package/build/graphql/graphqlDocument.d.ts +22 -0
  110. package/build/graphql/graphqlDocument.d.ts.map +1 -0
  111. package/build/graphql/graphqlDocument.js +8 -0
  112. package/build/graphql/reposContributedToDocument.d.ts +27 -0
  113. package/build/graphql/reposContributedToDocument.d.ts.map +1 -0
  114. package/build/graphql/reposContributedToDocument.js +59 -0
  115. package/build/index.d.ts +3 -1
  116. package/build/index.d.ts.map +1 -1
  117. package/build/index.js +2 -1
  118. package/build/themes/index.d.ts +32 -0
  119. package/build/themes/index.d.ts.map +1 -1
  120. package/build/themes/index.js +28 -0
  121. package/build/translations.d.ts +17 -0
  122. package/build/translations.d.ts.map +1 -1
  123. package/build/translations.js +17 -0
  124. package/package.json +14 -8
  125. package/src/_emoji-name-map.d.ts +10 -0
  126. package/src/_github-username-regex.d.ts +4 -0
  127. package/src/api/gist.js +31 -31
  128. package/src/api/index.js +40 -42
  129. package/src/api/pin.js +20 -38
  130. package/src/api/top-langs.js +36 -49
  131. package/src/api/wakatime.js +31 -31
  132. package/src/{calculateRank.js → calculateRank.ts} +29 -19
  133. package/src/cards/common-options.ts +13 -0
  134. package/src/cards/{gist.js → gist.ts} +37 -37
  135. package/src/cards/{repo.js → repo.ts} +107 -79
  136. package/src/cards/{stats.js → stats.ts} +173 -210
  137. package/src/cards/{top-languages.js → top-languages.ts} +325 -243
  138. package/src/cards/{wakatime.js → wakatime.ts} +158 -127
  139. package/src/common/Card.ts +123 -43
  140. package/src/common/I18n.ts +6 -2
  141. package/src/common/color.ts +240 -28
  142. package/src/common/config.ts +22 -29
  143. package/src/common/constants.ts +3 -1
  144. package/src/common/date.ts +45 -0
  145. package/src/common/html.ts +1 -1
  146. package/src/common/http.ts +71 -0
  147. package/src/common/icons.ts +1 -0
  148. package/src/common/languageColors.json +10 -1
  149. package/src/common/languageColors.ts +19 -0
  150. package/src/common/ops.ts +158 -0
  151. package/src/common/render.ts +652 -0
  152. package/src/common/retryer.ts +21 -12
  153. package/src/fetchers/gist.ts +79 -0
  154. package/src/fetchers/repo.ts +114 -0
  155. package/src/fetchers/stats.ts +743 -0
  156. package/src/fetchers/top-languages.ts +135 -0
  157. package/src/fetchers/{types.d.ts → types.ts} +28 -20
  158. package/src/fetchers/{wakatime.js → wakatime.ts} +19 -5
  159. package/src/graphql/contributionsDocument.ts +44 -0
  160. package/src/graphql/generated/common.ts +26 -0
  161. package/src/graphql/generated/gist.ts +59 -0
  162. package/src/graphql/generated/repo.ts +90 -0
  163. package/src/graphql/generated/stats.ts +194 -0
  164. package/src/graphql/generated/top-languages.ts +75 -0
  165. package/src/graphql/graphqlDocument.ts +25 -0
  166. package/src/graphql/queries/gist.graphql +25 -0
  167. package/src/graphql/queries/repo.graphql +28 -0
  168. package/src/graphql/queries/stats.graphql +120 -0
  169. package/src/graphql/queries/top-languages.graphql +34 -0
  170. package/src/graphql/reposContributedToDocument.ts +86 -0
  171. package/src/index.ts +3 -1
  172. package/src/themes/index.ts +33 -0
  173. package/src/translations.ts +17 -0
  174. package/src/cards/types.d.ts +0 -78
  175. package/src/common/http.js +0 -19
  176. package/src/common/ops.js +0 -170
  177. package/src/common/render.js +0 -440
  178. package/src/fetchers/gist.js +0 -112
  179. package/src/fetchers/repo.js +0 -161
  180. package/src/fetchers/stats.js +0 -474
  181. package/src/fetchers/top-languages.js +0 -175
  182. package/src/themes/README.md +0 -229
@@ -0,0 +1,75 @@
1
+ // Generated file — see .github/CONTRIBUTING.md
2
+
3
+ /** Internal type. DO NOT USE DIRECTLY. */
4
+ type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
5
+ import type * as Types from "./common.js";
6
+
7
+ import { graphqlDocument } from "../graphqlDocument.js";
8
+ export type TopLanguageFragment = {
9
+ size: number;
10
+ node: { color: string | null; name: string };
11
+ };
12
+
13
+ export type TopLanguagesRepositoryFragment = {
14
+ name: string;
15
+ languages: {
16
+ edges: Array<{
17
+ size: number;
18
+ node: { color: string | null; name: string };
19
+ } | null> | null;
20
+ } | null;
21
+ };
22
+
23
+ export type TopLanguagesQueryVariables = Exact<{
24
+ login: string;
25
+ ownerAffiliations?:
26
+ | Array<Types.RepositoryAffiliation | null | undefined>
27
+ | Types.RepositoryAffiliation
28
+ | null
29
+ | undefined;
30
+ }>;
31
+
32
+ export type TopLanguagesQuery = {
33
+ user: {
34
+ repositories: {
35
+ nodes: Array<{
36
+ name: string;
37
+ languages: {
38
+ edges: Array<{
39
+ size: number;
40
+ node: { color: string | null; name: string };
41
+ } | null> | null;
42
+ } | null;
43
+ } | null> | null;
44
+ };
45
+ } | null;
46
+ };
47
+
48
+ export const TopLanguagesDocument = graphqlDocument<
49
+ TopLanguagesQuery,
50
+ TopLanguagesQueryVariables
51
+ >(`
52
+ query topLanguages($login: String!, $ownerAffiliations: [RepositoryAffiliation]) {
53
+ user(login: $login) {
54
+ repositories(ownerAffiliations: $ownerAffiliations, isFork: false, first: 100) {
55
+ nodes {
56
+ ...TopLanguagesRepository
57
+ }
58
+ }
59
+ }
60
+ }
61
+ fragment TopLanguagesRepository on Repository {
62
+ name
63
+ languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
64
+ edges {
65
+ ...TopLanguage
66
+ }
67
+ }
68
+ }
69
+ fragment TopLanguage on LanguageEdge {
70
+ size
71
+ node {
72
+ color
73
+ name
74
+ }
75
+ }`);
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A GraphQL query paired with the types of its result and variables.
3
+ *
4
+ * `text` is what goes over the wire; the other two members only carry types and are never assigned.
5
+ * Documents are generated from `queries/*.graphql`
6
+ * See `scripts/generate-graphql-types.js`.
7
+ */
8
+ interface GraphQLDocument<TResult, TVariables> {
9
+ readonly text: string;
10
+ readonly __result?: TResult;
11
+ readonly __variables?: TVariables;
12
+ }
13
+
14
+ /**
15
+ * Build a typed document.
16
+ *
17
+ * @param text The query text, including every fragment it spreads.
18
+ * @returns The document to pass to the function created by `createGraphQLFetcher`.
19
+ */
20
+ const graphqlDocument = <TResult, TVariables>(
21
+ text: string,
22
+ ): GraphQLDocument<TResult, TVariables> => ({ text });
23
+
24
+ export { graphqlDocument };
25
+ export type { GraphQLDocument };
@@ -0,0 +1,25 @@
1
+ fragment GistFileInfo on GistFile {
2
+ name
3
+ language {
4
+ name
5
+ }
6
+ size
7
+ }
8
+
9
+ query gistInfo($gistName: String!) {
10
+ viewer {
11
+ gist(name: $gistName) {
12
+ description
13
+ owner {
14
+ login
15
+ }
16
+ stargazerCount
17
+ forks {
18
+ totalCount
19
+ }
20
+ files {
21
+ ...GistFileInfo
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,28 @@
1
+ fragment RepoInfo on Repository {
2
+ name
3
+ nameWithOwner
4
+ isPrivate
5
+ isArchived
6
+ isTemplate
7
+ stargazerCount
8
+ description
9
+ primaryLanguage {
10
+ color
11
+ id
12
+ name
13
+ }
14
+ forkCount
15
+ }
16
+
17
+ query getRepo($login: String!, $repo: String!) {
18
+ user(login: $login) {
19
+ repository(name: $repo) {
20
+ ...RepoInfo
21
+ }
22
+ }
23
+ organization(login: $login) {
24
+ repository(name: $repo) {
25
+ ...RepoInfo
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,120 @@
1
+ fragment RepoNode on Repository {
2
+ name
3
+ stargazerCount
4
+ }
5
+
6
+ fragment RepoStars on User {
7
+ repositories(
8
+ first: 100
9
+ after: $after
10
+ ownerAffiliations: $ownerAffiliations
11
+ orderBy: { direction: DESC, field: STARGAZERS }
12
+ ) {
13
+ totalCount
14
+ nodes {
15
+ ...RepoNode
16
+ }
17
+ pageInfo {
18
+ hasNextPage
19
+ endCursor
20
+ }
21
+ }
22
+ }
23
+
24
+ query userRepos(
25
+ $login: String!
26
+ $after: String
27
+ $ownerAffiliations: [RepositoryAffiliation]
28
+ ) {
29
+ user(login: $login) {
30
+ ...RepoStars
31
+ }
32
+ }
33
+
34
+ query userInfo(
35
+ $login: String!
36
+ $after: String
37
+ $includeMergedPullRequests: Boolean!
38
+ $includeDiscussions: Boolean!
39
+ $includeDiscussionsAnswers: Boolean!
40
+ $startTime: DateTime = null
41
+ $ownerAffiliations: [RepositoryAffiliation]
42
+ $includeUserRepositories: Boolean!
43
+ ) {
44
+ user(login: $login) {
45
+ name
46
+ login
47
+ commits: contributionsCollection(from: $startTime) {
48
+ totalCommitContributions
49
+ }
50
+ reviews: contributionsCollection {
51
+ totalPullRequestReviewContributions
52
+ }
53
+ repositoriesContributedTo(
54
+ first: 1
55
+ contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]
56
+ includeUserRepositories: $includeUserRepositories
57
+ ) {
58
+ totalCount
59
+ }
60
+ pullRequests(first: 1) {
61
+ totalCount
62
+ }
63
+ mergedPullRequests: pullRequests(states: MERGED)
64
+ @include(if: $includeMergedPullRequests) {
65
+ totalCount
66
+ }
67
+ openIssues: issues(states: OPEN) {
68
+ totalCount
69
+ }
70
+ closedIssues: issues(states: CLOSED) {
71
+ totalCount
72
+ }
73
+ followers {
74
+ totalCount
75
+ }
76
+ repositoryDiscussions @include(if: $includeDiscussions) {
77
+ totalCount
78
+ }
79
+ repositoryDiscussionComments(onlyAnswers: true)
80
+ @include(if: $includeDiscussionsAnswers) {
81
+ totalCount
82
+ }
83
+ contributionsCollection {
84
+ contributionYears
85
+ }
86
+ ...RepoStars
87
+ }
88
+ }
89
+
90
+ fragment YearContributions on ContributionsCollection {
91
+ contributionCalendar {
92
+ totalContributions
93
+ }
94
+ }
95
+
96
+ fragment RangeContributionsByRepo on ContributionsCollection {
97
+ commitContributionsByRepository(maxRepositories: $maxRepositories) {
98
+ repository {
99
+ nameWithOwner
100
+ }
101
+ }
102
+ issueContributionsByRepository(maxRepositories: $maxRepositories) {
103
+ repository {
104
+ nameWithOwner
105
+ }
106
+ }
107
+ pullRequestContributionsByRepository(maxRepositories: $maxRepositories) {
108
+ repository {
109
+ nameWithOwner
110
+ }
111
+ }
112
+ repositoryContributions(first: $maxRepositories)
113
+ @include(if: $includeOwnRepos) {
114
+ nodes {
115
+ repository {
116
+ nameWithOwner
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,34 @@
1
+ fragment TopLanguage on LanguageEdge {
2
+ size
3
+ node {
4
+ color
5
+ name
6
+ }
7
+ }
8
+
9
+ fragment TopLanguagesRepository on Repository {
10
+ name
11
+ languages(first: 10, orderBy: { field: SIZE, direction: DESC }) {
12
+ edges {
13
+ ...TopLanguage
14
+ }
15
+ }
16
+ }
17
+
18
+ query topLanguages(
19
+ $login: String!
20
+ $ownerAffiliations: [RepositoryAffiliation]
21
+ ) {
22
+ user(login: $login) {
23
+ # do not fetch forks
24
+ repositories(
25
+ ownerAffiliations: $ownerAffiliations
26
+ isFork: false
27
+ first: 100
28
+ ) {
29
+ nodes {
30
+ ...TopLanguagesRepository
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,86 @@
1
+ import type { GitHubDateRange } from "../common/date.js";
2
+ import { toGitHubDateTime } from "../common/date.js";
3
+
4
+ import type { RangeContributionsByRepoFragment } from "./generated/stats.js";
5
+ import { graphqlDocument } from "./graphqlDocument.js";
6
+
7
+ /** max value GitHub allows for `first/maxRepositories` */
8
+ const MAX_REPOSITORIES_LIMIT = 100;
9
+
10
+ interface ReposContributedToQueryVariables {
11
+ login: string;
12
+ maxRepositories: number;
13
+ }
14
+
15
+ interface ReposContributedToQuery {
16
+ user: Record<`range_${number}`, RangeContributionsByRepoFragment> | null;
17
+ }
18
+
19
+ /**
20
+ * Build a query for the repositories a user contributed to within multiple time
21
+ * ranges. One aliased `contributionsCollection` field per range, so all ranges
22
+ * are fetched in a single request. The shape is only known at runtime.
23
+ *
24
+ * Mirrors the `contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]`
25
+ * filter used by `repositoriesContributedTo` in `stats.graphql`.
26
+ *
27
+ * @param ranges Ranges to fetch, one `range_<index>` alias each.
28
+ * @param includeOwnRepos Whether to select `repositoryContributions`.
29
+ * @returns Document for `createGraphQLFetcher`.
30
+ */
31
+ const buildReposContributedToDocument = (
32
+ ranges: Array<GitHubDateRange>,
33
+ includeOwnRepos: boolean,
34
+ ) => {
35
+ const rangeFields = ranges
36
+ .map(
37
+ ({ from, to }, index) =>
38
+ `range_${index}: contributionsCollection(from: "${toGitHubDateTime(from)}", to: "${toGitHubDateTime(to)}") { ...RangeContributionsByRepo }`,
39
+ )
40
+ .join("\n");
41
+
42
+ // `repositoryContributions` only ever returns repos the user owns,
43
+ // so it is left out rather than gated with @include: an excluded field still counts toward the query's node cost.
44
+ // stats.graphql carries the directive so the generated type marks the field optional.
45
+ const ownRepoField = includeOwnRepos
46
+ ? `repositoryContributions(first: $maxRepositories) {
47
+ nodes {
48
+ repository {
49
+ nameWithOwner
50
+ }
51
+ }
52
+ }`
53
+ : "";
54
+
55
+ // fragment must match queries/stats.graphql, which generates its type
56
+ return graphqlDocument<
57
+ ReposContributedToQuery,
58
+ ReposContributedToQueryVariables
59
+ >(`
60
+ query userReposContributedTo($login: String!, $maxRepositories: Int!) {
61
+ user(login: $login) {
62
+ ${rangeFields}
63
+ }
64
+ }
65
+ fragment RangeContributionsByRepo on ContributionsCollection {
66
+ commitContributionsByRepository(maxRepositories: $maxRepositories) {
67
+ repository {
68
+ nameWithOwner
69
+ }
70
+ }
71
+ issueContributionsByRepository(maxRepositories: $maxRepositories) {
72
+ repository {
73
+ nameWithOwner
74
+ }
75
+ }
76
+ pullRequestContributionsByRepository(maxRepositories: $maxRepositories) {
77
+ repository {
78
+ nameWithOwner
79
+ }
80
+ }
81
+ ${ownRepoField}
82
+ }`);
83
+ };
84
+
85
+ export { buildReposContributedToDocument, MAX_REPOSITORIES_LIMIT };
86
+ export type { ReposContributedToQuery };
package/src/index.ts CHANGED
@@ -9,7 +9,8 @@ export { retryer } from "./common/retryer.js";
9
9
 
10
10
  export { renderError } from "./common/render.js";
11
11
 
12
- export { dateDiff, clampValue } from "./common/ops.js";
12
+ export { clampValue } from "./common/ops.js";
13
+ export { dateDiff } from "./common/date.js";
13
14
 
14
15
  export { logger } from "./common/log.js";
15
16
  export { request } from "./common/http.js";
@@ -23,3 +24,4 @@ export { default as wakatime } from "./api/wakatime.js";
23
24
  export { getConfig, loadConfigFromEnv } from "./common/config.js";
24
25
 
25
26
  export { themes } from "./themes/index.js";
27
+ export type { ThemeName } from "./themes/index.js";
@@ -23,6 +23,34 @@ export const themes = {
23
23
  text_color: "434d58",
24
24
  bg_color: "fffefe",
25
25
  },
26
+ light_github: {
27
+ title_color: "0969da",
28
+ icon_color: "0969da",
29
+ text_color: "59636e",
30
+ bg_color: "ffffff",
31
+ border_color: "d1d9e0",
32
+ },
33
+ dark_github: {
34
+ title_color: "4493f8",
35
+ icon_color: "4493f8",
36
+ text_color: "9198a1",
37
+ bg_color: "0d1117",
38
+ border_color: "3d444d",
39
+ },
40
+ light_github_repocard: {
41
+ title_color: "0969da",
42
+ icon_color: "59636e",
43
+ text_color: "59636e",
44
+ bg_color: "ffffff",
45
+ border_color: "d1d9e0",
46
+ },
47
+ dark_github_repocard: {
48
+ title_color: "4493f8",
49
+ icon_color: "9198a1",
50
+ text_color: "9198a1",
51
+ bg_color: "0d1117",
52
+ border_color: "3d444d",
53
+ },
26
54
  transparent: {
27
55
  title_color: "006AFF",
28
56
  icon_color: "0579C3",
@@ -474,3 +502,8 @@ export const themes = {
474
502
  bg_color: "35,4158d0,c850c0,ffcc70",
475
503
  },
476
504
  } as const satisfies Record<string, Theme>;
505
+
506
+ /**
507
+ * Name of one of the {@link themes}.
508
+ */
509
+ export type ThemeName = keyof typeof themes;
@@ -362,6 +362,9 @@ const statCardLocales = ({
362
362
  no: "Bidro til (i fjor)",
363
363
  be: "Уклад (за мінулы год)",
364
364
  },
365
+ "statcard.all-time-contribs": {
366
+ en: "Contributed to (all time)",
367
+ },
365
368
  "statcard.reviews": {
366
369
  en: "Total PRs Reviewed",
367
370
  ar: "طلبات السحب التي تم مراجعتها",
@@ -511,18 +514,27 @@ const statCardLocales = ({
511
514
  },
512
515
  "statcard.prs-authored": {
513
516
  en: "PRs Created",
517
+ "zh-tw": "建立的拉取請求",
514
518
  },
515
519
  "statcard.prs-commented": {
516
520
  en: "PRs Commented",
521
+ "zh-tw": "參與討論的拉取請求",
517
522
  },
518
523
  "statcard.prs-reviewed": {
519
524
  en: "PRs Reviewed",
525
+ "zh-tw": "審核的拉取請求",
520
526
  },
521
527
  "statcard.issues-authored": {
522
528
  en: "Issues Created",
529
+ "zh-tw": "建立的議題",
523
530
  },
524
531
  "statcard.issues-commented": {
525
532
  en: "Issues Commented",
533
+ "zh-tw": "參與討論的議題",
534
+ },
535
+ "statcard.contributions": {
536
+ en: "Total Contributions",
537
+ "zh-tw": "總貢獻數量",
526
538
  },
527
539
  "statcard.prs-merged": {
528
540
  en: "Total PRs Merged",
@@ -724,18 +736,23 @@ const repoCardLocales = {
724
736
  },
725
737
  "repocard.prs-authored": {
726
738
  en: "my created PRs",
739
+ "zh-tw": "我所創建的拉取請求",
727
740
  },
728
741
  "repocard.prs-commented": {
729
742
  en: "my commented PRs",
743
+ "zh-tw": "我所參與的拉取請求",
730
744
  },
731
745
  "repocard.prs-reviewed": {
732
746
  en: "my reviewed PRs",
747
+ "zh-tw": "我所審核的拉取請求",
733
748
  },
734
749
  "repocard.issues-authored": {
735
750
  en: "my created issues",
751
+ "zh-tw": "我所創建的議題",
736
752
  },
737
753
  "repocard.issues-commented": {
738
754
  en: "my commented issues",
755
+ "zh-tw": "我所參與的議題",
739
756
  },
740
757
  };
741
758
 
@@ -1,78 +0,0 @@
1
- type ThemeNames = keyof typeof import("../themes/index.ts");
2
- type RankIcon = "default" | "github" | "percentile";
3
-
4
- interface CommonOptions {
5
- title_color: string;
6
- icon_color: string;
7
- text_color: string;
8
- bg_color: string;
9
- theme: ThemeNames;
10
- border_radius: number;
11
- border_color: string;
12
- locale: string;
13
- hide_border: boolean;
14
- }
15
-
16
- export type StatCardOptions = CommonOptions & {
17
- hide: Array<string>;
18
- show_icons: boolean;
19
- hide_title: boolean;
20
- card_width: number;
21
- hide_rank: boolean;
22
- include_all_commits: boolean;
23
- commits_year: number;
24
- line_height: number | string;
25
- custom_title: string;
26
- disable_animations: boolean;
27
- number_format: string;
28
- number_precision: number;
29
- ring_color: string;
30
- text_bold: boolean;
31
- rank_icon: RankIcon;
32
- show: Array<string>;
33
- };
34
-
35
- export type RepoCardOptions = CommonOptions & {
36
- show_owner: boolean;
37
- browser_rendering: boolean;
38
- description_lines_count: number;
39
- card_width_input;
40
- show: Array<string>;
41
- show_icons: boolean;
42
- number_format: string;
43
- text_bold: boolean;
44
- line_height: number | string;
45
- username;
46
- };
47
-
48
- export type TopLangOptions = CommonOptions & {
49
- hide_title: boolean;
50
- card_width: number;
51
- hide: Array<string>;
52
- layout: "compact" | "normal" | "donut" | "donut-vertical" | "pie";
53
- custom_title: string;
54
- langs_count: number;
55
- disable_animations: boolean;
56
- hide_progress: boolean;
57
- hide_values: boolean;
58
- prog_bar_bg_color: string;
59
- stats_format: "percentages" | "bytes";
60
- };
61
-
62
- export type WakaTimeOptions = CommonOptions & {
63
- hide_title: boolean;
64
- hide: Array<string>;
65
- card_width: number;
66
- line_height: string;
67
- hide_progress: boolean;
68
- custom_title: string;
69
- layout: "compact" | "normal";
70
- langs_count: number;
71
- display_format: "time" | "percent";
72
- disable_animations: boolean;
73
- };
74
-
75
- export type GistCardOptions = CommonOptions & {
76
- show_owner: boolean;
77
- browser_rendering: boolean;
78
- };
@@ -1,19 +0,0 @@
1
- import axios from "axios";
2
-
3
- /**
4
- * Send GraphQL request to GitHub API.
5
- *
6
- * @param {import('axios').AxiosRequestConfig['data']} data Request data.
7
- * @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
8
- * @returns {Promise<any>} Request response.
9
- */
10
- const request = (data, headers) => {
11
- return axios({
12
- url: "https://api.github.com/graphql",
13
- method: "post",
14
- headers,
15
- data,
16
- });
17
- };
18
-
19
- export { request };