@urmzd/github-insights 2.0.1 → 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.
- package/.githooks/commit-msg +4 -0
- package/.githooks/pre-commit +4 -0
- package/AGENTS.md +32 -19
- package/CHANGELOG.md +54 -0
- package/CONTRIBUTING.md +18 -19
- package/README.md +21 -24
- package/action.yml +1 -1
- package/assets/insights/index.svg +45 -4
- package/assets/insights/metrics-constellation.svg +55 -0
- package/assets/insights/metrics-impact.svg +55 -0
- package/assets/insights/metrics-rhythm.svg +55 -0
- package/assets/insights/metrics-velocity.svg +55 -0
- package/examples/classic/README.md +36 -2
- package/examples/classic/index.svg +45 -4
- package/examples/classic/metrics-constellation.svg +55 -0
- package/examples/classic/metrics-impact.svg +55 -0
- package/examples/classic/metrics-rhythm.svg +55 -0
- package/examples/classic/metrics-velocity.svg +55 -0
- package/examples/ecosystem/README.md +39 -28
- package/examples/ecosystem/index.svg +45 -4
- package/examples/ecosystem/metrics-constellation.svg +55 -0
- package/examples/ecosystem/metrics-impact.svg +55 -0
- package/examples/ecosystem/metrics-rhythm.svg +55 -0
- package/examples/ecosystem/metrics-velocity.svg +55 -0
- package/examples/minimal/README.md +36 -2
- package/examples/minimal/index.svg +45 -4
- package/examples/minimal/metrics-constellation.svg +55 -0
- package/examples/minimal/metrics-impact.svg +55 -0
- package/examples/minimal/metrics-rhythm.svg +55 -0
- package/examples/minimal/metrics-velocity.svg +55 -0
- package/examples/modern/README.md +62 -50
- package/examples/modern/index.svg +45 -4
- package/examples/modern/metrics-constellation.svg +55 -0
- package/examples/modern/metrics-impact.svg +55 -0
- package/examples/modern/metrics-rhythm.svg +55 -0
- package/examples/modern/metrics-velocity.svg +55 -0
- package/llms.txt +4 -4
- package/package.json +1 -1
- package/skills/github-insights/SKILL.md +35 -81
- package/sr.yaml +9 -0
- package/src/api.ts +3 -141
- package/src/components/contribution-rhythm.tsx +152 -0
- package/src/components/full-svg.test.tsx +4 -1
- package/src/components/full-svg.tsx +14 -7
- package/src/components/impact-trail.tsx +90 -0
- package/src/components/language-velocity.tsx +181 -0
- package/src/components/project-constellation.tsx +97 -0
- package/src/components/section.test.tsx +5 -3
- package/src/components/section.tsx +5 -13
- package/src/components/style-defs.tsx +44 -3
- package/src/index.ts +34 -47
- package/src/metrics.test.ts +50 -57
- package/src/metrics.ts +293 -97
- package/src/readme.test.ts +2 -4
- package/src/templates.test.ts +116 -16
- package/src/templates.ts +68 -27
- package/src/theme.ts +11 -1
- package/src/types.ts +31 -7
- package/assets/insights/metrics-calendar.svg +0 -14
- package/assets/insights/metrics-complexity.svg +0 -14
- package/assets/insights/metrics-contributions.svg +0 -14
- package/assets/insights/metrics-expertise.svg +0 -14
- package/assets/insights/metrics-languages.svg +0 -14
- package/assets/insights/metrics-pulse.svg +0 -14
- package/examples/classic/metrics-calendar.svg +0 -14
- package/examples/classic/metrics-complexity.svg +0 -14
- package/examples/classic/metrics-contributions.svg +0 -14
- package/examples/classic/metrics-expertise.svg +0 -14
- package/examples/classic/metrics-languages.svg +0 -14
- package/examples/classic/metrics-pulse.svg +0 -14
- package/examples/ecosystem/metrics-calendar.svg +0 -14
- package/examples/ecosystem/metrics-complexity.svg +0 -14
- package/examples/ecosystem/metrics-contributions.svg +0 -14
- package/examples/ecosystem/metrics-expertise.svg +0 -14
- package/examples/ecosystem/metrics-languages.svg +0 -14
- package/examples/ecosystem/metrics-pulse.svg +0 -14
- package/examples/minimal/metrics-calendar.svg +0 -14
- package/examples/minimal/metrics-complexity.svg +0 -14
- package/examples/minimal/metrics-contributions.svg +0 -14
- package/examples/minimal/metrics-expertise.svg +0 -14
- package/examples/minimal/metrics-languages.svg +0 -14
- package/examples/minimal/metrics-pulse.svg +0 -14
- package/examples/modern/metrics-calendar.svg +0 -14
- package/examples/modern/metrics-complexity.svg +0 -14
- package/examples/modern/metrics-contributions.svg +0 -14
- package/examples/modern/metrics-expertise.svg +0 -14
- package/examples/modern/metrics-languages.svg +0 -14
- package/examples/modern/metrics-pulse.svg +0 -14
- package/src/components/bar-chart.test.tsx +0 -38
- package/src/components/bar-chart.tsx +0 -54
- package/src/components/contribution-calendar.test.tsx +0 -44
- package/src/components/contribution-calendar.tsx +0 -94
- package/src/components/contribution-cards.test.tsx +0 -36
- package/src/components/contribution-cards.tsx +0 -58
- package/src/components/donut-chart.test.tsx +0 -36
- package/src/components/donut-chart.tsx +0 -102
- package/src/components/project-cards.test.tsx +0 -46
- package/src/components/project-cards.tsx +0 -66
- package/src/components/stat-cards.test.tsx +0 -32
- package/src/components/stat-cards.tsx +0 -57
- package/src/components/tech-highlights.test.tsx +0 -63
- package/src/components/tech-highlights.tsx +0 -109
- package/teasr.toml +0 -14
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Fragment, h } from "../jsx-factory.js";
|
|
2
|
-
import { escapeXml, truncate, wrapText } from "../svg-utils.js";
|
|
3
|
-
import { BAR_COLORS, LAYOUT } from "../theme.js";
|
|
4
|
-
import type { RenderResult, TechHighlight } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export function renderTechHighlights(
|
|
7
|
-
highlights: TechHighlight[],
|
|
8
|
-
y: number,
|
|
9
|
-
): RenderResult {
|
|
10
|
-
if (highlights.length === 0) return { svg: "", height: 0 };
|
|
11
|
-
|
|
12
|
-
const { padX, barHeight, barMaxWidth } = LAYOUT;
|
|
13
|
-
const labelMaxChars = 60;
|
|
14
|
-
const skillMaxChars = 120;
|
|
15
|
-
const skillLineHeight = 16;
|
|
16
|
-
const labelLineHeight = 26;
|
|
17
|
-
const scoreX = padX + barMaxWidth + 10;
|
|
18
|
-
const skillY = 16;
|
|
19
|
-
const rowGap = 14;
|
|
20
|
-
|
|
21
|
-
let svg = "";
|
|
22
|
-
let height = 0;
|
|
23
|
-
|
|
24
|
-
for (let hi = 0; hi < highlights.length; hi++) {
|
|
25
|
-
const group = highlights[hi];
|
|
26
|
-
const color = BAR_COLORS[hi % BAR_COLORS.length];
|
|
27
|
-
const score = Math.max(0, Math.min(100, group.score));
|
|
28
|
-
const fillWidth = (score / 100) * barMaxWidth;
|
|
29
|
-
|
|
30
|
-
const baseY = y + height;
|
|
31
|
-
|
|
32
|
-
// Category label (uppercase, left-aligned, on its own line)
|
|
33
|
-
svg += (
|
|
34
|
-
<text x={padX} y={baseY + 14} className="t t-subhdr">
|
|
35
|
-
{escapeXml(truncate(group.category.toUpperCase(), labelMaxChars))}
|
|
36
|
-
</text>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
// Bar track (full width, low opacity)
|
|
40
|
-
svg += (
|
|
41
|
-
<rect
|
|
42
|
-
x={padX}
|
|
43
|
-
y={baseY + labelLineHeight}
|
|
44
|
-
width={barMaxWidth}
|
|
45
|
-
height={barHeight}
|
|
46
|
-
rx={4}
|
|
47
|
-
fill={color}
|
|
48
|
-
fill-opacity="0.15"
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
// Bar fill (proportional to score)
|
|
53
|
-
if (fillWidth > 0) {
|
|
54
|
-
svg += (
|
|
55
|
-
<rect
|
|
56
|
-
x={padX}
|
|
57
|
-
y={baseY + labelLineHeight}
|
|
58
|
-
width={fillWidth}
|
|
59
|
-
height={barHeight}
|
|
60
|
-
rx={4}
|
|
61
|
-
fill={color}
|
|
62
|
-
fill-opacity="0.85"
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Score label (right of bar)
|
|
68
|
-
svg += (
|
|
69
|
-
<text
|
|
70
|
-
x={scoreX}
|
|
71
|
-
y={baseY + labelLineHeight + barHeight / 2 + 4}
|
|
72
|
-
className="t t-value"
|
|
73
|
-
>
|
|
74
|
-
{`${score}%`}
|
|
75
|
-
</text>
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// Skill items text (below bar, muted, wrapped to avoid overflow)
|
|
79
|
-
const skillText = group.items
|
|
80
|
-
.map((item) => truncate(item, 30))
|
|
81
|
-
.join(" \u00B7 ");
|
|
82
|
-
|
|
83
|
-
const skillLines = wrapText(skillText, skillMaxChars);
|
|
84
|
-
for (let li = 0; li < skillLines.length; li++) {
|
|
85
|
-
svg += (
|
|
86
|
-
<text
|
|
87
|
-
x={padX}
|
|
88
|
-
y={
|
|
89
|
-
baseY + labelLineHeight + barHeight + skillY + li * skillLineHeight
|
|
90
|
-
}
|
|
91
|
-
className="t t-card-detail"
|
|
92
|
-
>
|
|
93
|
-
{escapeXml(skillLines[li])}
|
|
94
|
-
</text>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
height +=
|
|
99
|
-
labelLineHeight +
|
|
100
|
-
barHeight +
|
|
101
|
-
skillY +
|
|
102
|
-
(skillLines.length - 1) * skillLineHeight +
|
|
103
|
-
rowGap;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return { svg, height };
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
void Fragment;
|
package/teasr.toml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[server]
|
|
2
|
-
command = "npx serve metrics --listen 3123"
|
|
3
|
-
url = "http://localhost:3123"
|
|
4
|
-
timeout = 10000
|
|
5
|
-
|
|
6
|
-
[output]
|
|
7
|
-
dir = "./showcase"
|
|
8
|
-
formats = ["png"]
|
|
9
|
-
|
|
10
|
-
[[scenes]]
|
|
11
|
-
type = "web"
|
|
12
|
-
url = "/index.svg"
|
|
13
|
-
name = "metrics-svg"
|
|
14
|
-
viewport = { width = 1200, height = 900 }
|