@shiinasaku/github-card 2.0.0 → 4.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.
- package/README.md +134 -293
- package/dist/card.d.ts +16 -0
- package/dist/lib.d.ts +13 -0
- package/dist/lib.js +1209 -0
- package/dist/types.d.ts +37 -0
- package/dist/utils/colors.d.ts +2 -0
- package/dist/utils/font.d.ts +2 -0
- package/dist/utils/format.d.ts +3 -0
- package/dist/utils/icons.d.ts +9 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/languages.d.ts +2 -0
- package/dist/utils/themes.d.ts +16 -0
- package/package.json +29 -18
- package/src/card.ts +634 -113
- package/src/env.d.ts +4 -0
- package/src/github.ts +351 -483
- package/src/index.ts +147 -134
- package/src/input.css +1 -0
- package/src/tailwind.css +3837 -0
- package/src/types.ts +1 -0
- package/src/utils/colors.ts +85 -0
- package/src/utils/font.ts +3 -19
- package/src/utils/format.ts +16 -16
- package/src/utils/github-client.ts +193 -0
- package/src/utils/icons.ts +2 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/themes.ts +154 -19
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface UserProfile {
|
|
2
|
+
login: string;
|
|
3
|
+
name: string | null;
|
|
4
|
+
avatarUrl: string;
|
|
5
|
+
bio: string | null;
|
|
6
|
+
pronouns: string | null;
|
|
7
|
+
twitter: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface UserStats {
|
|
10
|
+
stars: number;
|
|
11
|
+
repos: number;
|
|
12
|
+
prs: number;
|
|
13
|
+
issues: number;
|
|
14
|
+
commits: number;
|
|
15
|
+
}
|
|
16
|
+
export interface LanguageStat {
|
|
17
|
+
name: string;
|
|
18
|
+
size: number;
|
|
19
|
+
color: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ProfileData {
|
|
22
|
+
user: UserProfile;
|
|
23
|
+
stats: UserStats;
|
|
24
|
+
languages: LanguageStat[];
|
|
25
|
+
}
|
|
26
|
+
export interface CardOptions {
|
|
27
|
+
theme?: string;
|
|
28
|
+
title_color?: string;
|
|
29
|
+
text_color?: string;
|
|
30
|
+
icon_color?: string;
|
|
31
|
+
bg_color?: string;
|
|
32
|
+
border_color?: string;
|
|
33
|
+
hide_border?: boolean;
|
|
34
|
+
compact?: boolean;
|
|
35
|
+
hide?: string[];
|
|
36
|
+
animate?: boolean;
|
|
37
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { resolveColors, themes, type Theme } from "./themes";
|
|
2
|
+
export { kFormat, escapeXml, wrapText } from "./format";
|
|
3
|
+
export { getLangColor } from "./languages";
|
|
4
|
+
export { icons, icon } from "./icons";
|
|
5
|
+
export { FONT_FACE, FONT_FAMILY } from "./font";
|
|
6
|
+
export * from "./colors";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Theme = {
|
|
2
|
+
bg: string;
|
|
3
|
+
title: string;
|
|
4
|
+
text: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
border: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const themes: Record<string, Theme>;
|
|
9
|
+
export declare function resolveColors(opts: {
|
|
10
|
+
theme?: string;
|
|
11
|
+
bg_color?: string;
|
|
12
|
+
title_color?: string;
|
|
13
|
+
text_color?: string;
|
|
14
|
+
icon_color?: string;
|
|
15
|
+
border_color?: string;
|
|
16
|
+
}): Theme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shiinasaku/github-card",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Beautiful GitHub stats SVG cards. Embed in README, use as API, or render programmatically.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"badge",
|
|
@@ -26,28 +26,37 @@
|
|
|
26
26
|
"url": "https://github.com/ShiinaSaku/Github-Card.git"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
|
+
"dist",
|
|
29
30
|
"src",
|
|
30
31
|
"fonts",
|
|
31
32
|
"README.md",
|
|
32
33
|
"LICENSE"
|
|
33
34
|
],
|
|
34
35
|
"type": "module",
|
|
35
|
-
"main": "./
|
|
36
|
-
"module": "./
|
|
37
|
-
"types": "./
|
|
36
|
+
"main": "./dist/lib.js",
|
|
37
|
+
"module": "./dist/lib.js",
|
|
38
|
+
"types": "./dist/lib.d.ts",
|
|
38
39
|
"exports": {
|
|
39
40
|
".": {
|
|
40
|
-
"types": "./
|
|
41
|
-
"
|
|
41
|
+
"types": "./dist/lib.d.ts",
|
|
42
|
+
"bun": "./src/lib.ts",
|
|
43
|
+
"import": "./dist/lib.js",
|
|
44
|
+
"default": "./dist/lib.js"
|
|
42
45
|
},
|
|
43
46
|
"./server": {
|
|
44
47
|
"types": "./src/index.ts",
|
|
45
48
|
"import": "./src/index.ts"
|
|
46
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public",
|
|
54
|
+
"provenance": true
|
|
47
55
|
},
|
|
48
56
|
"scripts": {
|
|
49
57
|
"dev": "bun run --watch src/index.ts",
|
|
50
|
-
"build": "bun build src/
|
|
58
|
+
"build": "bun build src/lib.ts --outfile dist/lib.js --format esm --target node && tsc -p tsconfig.build.json",
|
|
59
|
+
"prepublishOnly": "bun run build",
|
|
51
60
|
"fmt": "oxfmt",
|
|
52
61
|
"fmt:check": "oxfmt --check",
|
|
53
62
|
"lint": "oxlint",
|
|
@@ -57,16 +66,18 @@
|
|
|
57
66
|
"test:coverage": "bun test --coverage"
|
|
58
67
|
},
|
|
59
68
|
"dependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"elysia": "latest"
|
|
69
|
+
"@elysia/cors": "^1.4.2",
|
|
70
|
+
"@elysia/openapi": "^1.4.15",
|
|
71
|
+
"@elysia/server-timing": "^1.4.1",
|
|
72
|
+
"elysia": "^1.4.29"
|
|
65
73
|
},
|
|
66
74
|
"devDependencies": {
|
|
67
|
-
"@
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
75
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
76
|
+
"@types/bun": "^1.3.14",
|
|
77
|
+
"oxfmt": "0.60.0",
|
|
78
|
+
"oxlint": "1.75.0",
|
|
79
|
+
"tailwindcss": "^4.3.3",
|
|
80
|
+
"typescript": "^7.0.2"
|
|
81
|
+
},
|
|
82
|
+
"packageManager": "bun@1.3.14"
|
|
72
83
|
}
|