@shiinasaku/github-card 4.1.0 → 5.0.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/dist/types.d.ts CHANGED
@@ -9,9 +9,10 @@ export interface UserProfile {
9
9
  export interface UserStats {
10
10
  stars: number;
11
11
  repos: number;
12
- prs: number;
13
- issues: number;
14
- commits: number;
12
+ /** null means unavailable, not zero (for example, organization activity totals). */
13
+ prs: number | null;
14
+ issues: number | null;
15
+ commits: number | null;
15
16
  }
16
17
  export interface LanguageStat {
17
18
  name: string;
@@ -33,5 +34,9 @@ export interface CardOptions {
33
34
  hide_border?: boolean;
34
35
  compact?: boolean;
35
36
  hide?: string[];
37
+ hide_langs?: string[];
38
+ show_langs?: string[];
36
39
  animate?: boolean;
40
+ /** Stable namespace for multiple cards embedded in the same SVG document. */
41
+ idPrefix?: string;
37
42
  }
@@ -1,2 +1,4 @@
1
- export declare const FONT_FAMILY = "ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"";
1
+ /** System font stack — no shipped font, respects the user's OS. */
2
+ export declare const FONT_FAMILY = "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"";
3
+ /** @deprecated No shipped font — kept for API backwards compatibility. */
2
4
  export declare const FONT_FACE = "";
@@ -1,3 +1,10 @@
1
1
  export declare function kFormat(num: number): string;
2
+ /**
3
+ * Approximate rendered width of a string in SVG user units for the default
4
+ * sans-serif stack. Widths are per-character averages tuned to the card's
5
+ * font sizes and weights, so layout can reserve enough space without relying
6
+ * on browser text measurement (which is unavailable server-side).
7
+ */
8
+ export declare function measureText(text: string, size: number, weight?: number): number;
2
9
  export declare function escapeXml(str: string): string;
3
10
  export declare function wrapText(input: string, maxLen: number, maxLines: number): string[];
@@ -6,4 +6,6 @@ export declare const icons: {
6
6
  repo: string;
7
7
  x: string;
8
8
  };
9
- export declare function icon(name: keyof typeof icons, color: string, size?: number): string;
9
+ type IconName = keyof typeof icons;
10
+ export declare function icon(name: IconName, color: string, size?: number): string;
11
+ export {};
@@ -1,6 +1,5 @@
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";
1
+ export { resolveColors, themes } from "./themes";
2
+ export { kFormat, escapeXml, wrapText, measureText } from "./format";
3
+ export { icon } from "./icons";
4
+ export { FONT_FAMILY } from "./font";
5
+ export { resolveTw } from "./colors";
@@ -1,2 +1 @@
1
- export declare const langColors: Record<string, string>;
2
1
  export declare function getLangColor(lang: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shiinasaku/github-card",
3
- "version": "4.1.0",
3
+ "version": "5.0.0",
4
4
  "description": "Beautiful GitHub stats SVG cards. Embed in README, use as API, or render programmatically.",
5
5
  "keywords": [
6
6
  "badge",
@@ -23,12 +23,11 @@
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "https://github.com/ShiinaSaku/Github-Card.git"
26
+ "url": "git+https://github.com/ShiinaSaku/Github-Card.git"
27
27
  },
28
28
  "files": [
29
29
  "dist",
30
30
  "src",
31
- "fonts",
32
31
  "README.md",
33
32
  "LICENSE"
34
33
  ],
@@ -57,27 +56,25 @@
57
56
  "dev": "bun run --watch src/index.ts",
58
57
  "build": "bun build src/lib.ts --outfile dist/lib.js --format esm --target node && tsc -p tsconfig.build.json",
59
58
  "prepublishOnly": "bun run build",
60
- "fmt": "oxfmt",
61
- "fmt:check": "oxfmt --check",
62
- "lint": "oxlint",
63
- "lint:fix": "oxlint --fix",
64
- "typecheck": "tsc --noEmit --skipLibCheck",
59
+ "fmt": "bun fmt",
60
+ "fmt:check": "bun fmt --check",
61
+ "typecheck": "bun check",
65
62
  "test": "bun test",
66
63
  "test:coverage": "bun test --coverage"
67
64
  },
68
65
  "dependencies": {
69
- "@elysia/cors": "^1.4.2",
70
- "@elysia/openapi": "^1.4.15",
71
- "@elysia/server-timing": "^1.4.1",
72
- "elysia": "^1.4.29"
66
+ "@elysia/cors": "2.0.0-rc.1",
67
+ "@elysia/openapi": "2.0.0-rc.1",
68
+ "@elysia/server-timing": "2.0.0-rc.0",
69
+ "culori": "^4.0.2",
70
+ "elysia": "2.0.0-rc.3"
73
71
  },
74
72
  "devDependencies": {
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"
73
+ "@resvg/resvg-js": "^2.6.2",
74
+ "@types/bun": "^1.4.4",
75
+ "@types/culori": "^4.0.1",
76
+ "@xmldom/xmldom": "^0.9.12",
77
+ "typescript": "^6.0.3"
81
78
  },
82
- "packageManager": "bun@1.3.14"
79
+ "packageManager": "bun@1.4.4"
83
80
  }