Skip to content

Commit 61aace6

Browse files
committed
feat: add GitHub Packages registry to benchmarks
Add GitHub Packages (npm.pkg.github.com) as a fifth registry in the benchmark suite alongside npm, vlt, AWS CodeArtifact, and Cloudsmith. Backend: - Add GitHub registry config to scripts/registry/common.sh - GH_REGISTRY env var provides the URL (without protocol) - GH_AUTH_TOKEN env var provides the auth token - Registry URL is prefixed with 'https:' for npm config - Add GitHub to hyperfine commands in registry-clean.sh and registry-lockfile.sh - Add GitHub to REGISTRY_COLORS in generate-chart.js (#6336b8) - Add GH_REGISTRY and GH_AUTH_TOKEN secrets to CI workflow - Update bench CLI: AVAILABLE_REGISTRIES, usage text, examples Frontend: - Add 'github' to PackageManager union type and all data interfaces - Add GitHub icon component (Octicons mark-github logo) - GitHub icon renders white in dark mode (same pattern as vlt) - Add GitHub to icon map, display names ('GitHub' / 'npm.pkg.github.com') - Add to history data package managers list
1 parent 2cac036 commit 61aace6

13 files changed

Lines changed: 65 additions & 7 deletions

File tree

.github/workflows/benchmark.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
VLT_REGISTRY_AUTH_TOKEN: ${{ secrets.VLT_REGISTRY_AUTH_TOKEN }}
133133
CLOUDSMITH_REGISTRY: ${{ secrets.CLOUDSMITH_REGISTRY }}
134134
CLOUDSMITH_AUTH_TOKEN: ${{ secrets.CLOUDSMITH_AUTH_TOKEN }}
135+
GH_REGISTRY: ${{ secrets.GH_REGISTRY }}
136+
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
135137
run: |
136138
./bench run \
137139
--fixtures="${{ matrix.fixture }}" \

app/src/components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const LeaderBoardItem = ({
289289
{Icon && (
290290
<Icon
291291
size={28}
292-
className={cn(packageManager === "vlt" && "dark:text-white")}
292+
className={cn((packageManager === "vlt" || packageManager === "github") && "dark:text-white")}
293293
/>
294294
)}
295295
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { createLucideIcon } from "lucide-react";
2+
3+
export const Github = createLucideIcon("Github", [
4+
[
5+
"path",
6+
{
7+
d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",
8+
fill: "currentColor",
9+
key: "1",
10+
strokeWidth: "0",
11+
},
12+
],
13+
]);

app/src/components/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export * from "./bar-chart.tsx";
1313
// ecosystem icons
1414
export * from "./astro.tsx";
1515
export * from "./aws.tsx";
16+
export * from "./github.tsx";
1617
export * from "./berry.tsx";
1718
export * from "./bun.tsx";
1819
export * from "./cloudsmith.tsx";

app/src/hooks/use-history-data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const PACKAGE_MANAGERS = [
2121
"node",
2222
"aws",
2323
"cloudsmith",
24+
"github",
2425
];
2526

2627
interface UseHistoryDataReturn {

app/src/lib/get-icons.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Bun,
77
Cloudsmith,
88
Deno,
9+
Github,
910
Next,
1011
Node,
1112
Npm,
@@ -26,6 +27,7 @@ const packageManagerMap: Partial<Record<PackageManager, LucideIcon>> = {
2627
aws: Aws,
2728
bun: Bun,
2829
cloudsmith: Cloudsmith,
30+
github: Github,
2931
deno: Deno,
3032
node: Node,
3133
npm: Npm,

app/src/lib/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,14 @@ export function getPackageManagerDisplayName(
466466
if (packageManager === "aws")
467467
return "codeartifact.us-east-1.amazonaws.com";
468468
if (packageManager === "cloudsmith") return "npm.cloudsmith.io";
469+
if (packageManager === "github") return "npm.pkg.github.com";
469470
}
470471
if (packageManager === "berry") return "yarn (berry)";
471472
if (packageManager === "zpm") return "yarn (zpm)";
472473
if (packageManager === "turbo") return "turborepo";
473474
if (packageManager === "aws") return "AWS CodeArtifact";
474475
if (packageManager === "cloudsmith") return "Cloudsmith";
476+
if (packageManager === "github") return "GitHub";
475477
return packageManager;
476478
}
477479

app/src/types/chart-data.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export type PackageManager =
1111
| "turbo"
1212
| "node"
1313
| "aws"
14-
| "cloudsmith";
14+
| "cloudsmith"
15+
| "github";
1516

1617
export type Fixture =
1718
| "next"
@@ -52,6 +53,7 @@ export interface PackageManagerVersions {
5253
node?: string;
5354
aws?: string;
5455
cloudsmith?: string;
56+
github?: string;
5557
}
5658

5759
export interface BaseFixtureResult {
@@ -72,6 +74,7 @@ export interface PackageManagerData {
7274
node?: number;
7375
aws?: number;
7476
cloudsmith?: number;
77+
github?: number;
7578

7679
npm_stddev?: number;
7780
yarn_stddev?: number;
@@ -86,6 +89,7 @@ export interface PackageManagerData {
8689
node_stddev?: number;
8790
aws_stddev?: number;
8891
cloudsmith_stddev?: number;
92+
github_stddev?: number;
8993

9094
npm_fill?: string;
9195
yarn_fill?: string;
@@ -100,6 +104,7 @@ export interface PackageManagerData {
100104
node_fill?: string;
101105
aws_fill?: string;
102106
cloudsmith_fill?: string;
107+
github_fill?: string;
103108

104109
npm_count?: number;
105110
yarn_count?: number;
@@ -114,6 +119,7 @@ export interface PackageManagerData {
114119
node_count?: number;
115120
aws_count?: number;
116121
cloudsmith_count?: number;
122+
github_count?: number;
117123

118124
npm_dnf?: boolean;
119125
yarn_dnf?: boolean;
@@ -128,6 +134,7 @@ export interface PackageManagerData {
128134
node_dnf?: boolean;
129135
aws_dnf?: boolean;
130136
cloudsmith_dnf?: boolean;
137+
github_dnf?: boolean;
131138
}
132139

133140
export type FixtureResult = BaseFixtureResult & PackageManagerData;
@@ -167,6 +174,7 @@ export interface PackageCountData {
167174
node?: PackageCountEntry;
168175
aws?: PackageCountEntry;
169176
cloudsmith?: PackageCountEntry;
177+
github?: PackageCountEntry;
170178
}
171179

172180
export interface PackageCountTableRow {

bench

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ AVAILABLE_REGISTRIES=(
4343
vlt
4444
aws
4545
cloudsmith
46+
github
4647
)
4748

4849
usage() {
@@ -56,7 +57,7 @@ Usage:
5657
Options:
5758
--fixtures Comma or space-separated fixture names (default: next)
5859
--pms Comma or space-separated package managers (default: all)
59-
--registries Comma-separated registries for registry-* variations (default: npm,vlt,aws,cloudsmith)
60+
--registries Comma-separated registries for registry-* variations (default: npm,vlt,aws,cloudsmith,github)
6061
--variation Comma or space-separated benchmark variations (default: clean)
6162
--runs Hyperfine runs (default: scripts/variations/common.sh default)
6263
--warmup Hyperfine warmup runs (default: scripts/variations/common.sh default)
@@ -78,6 +79,7 @@ Examples:
7879
./bench run --variation=registry-lockfile --registries=npm,vlt
7980
CODEARTIFACT_AUTH_TOKEN=<token> ./bench run --variation=registry-clean --fixtures=next --registries=aws
8081
CLOUDSMITH_REGISTRY=<url> CLOUDSMITH_AUTH_TOKEN=<token> ./bench run --variation=registry-clean --fixtures=next --registries=cloudsmith
82+
GH_REGISTRY=<url> GH_AUTH_TOKEN=<token> ./bench run --variation=registry-clean --fixtures=next --registries=github
8183
./bench chart --fixtures=next --variation=clean
8284
./bench process
8385
EOF
@@ -448,7 +450,7 @@ run_bench() {
448450
if [[ -n "$registries_env" ]]; then
449451
echo " registries: $registries_env"
450452
else
451-
echo " registries: npm,vlt,aws,cloudsmith (default)"
453+
echo " registries: npm,vlt,aws,cloudsmith,github (default)"
452454
fi
453455
fi
454456

scripts/generate-chart.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const REGISTRY_COLORS = {
4040
vlt: "#000000",
4141
aws: "#ff9900",
4242
cloudsmith: "#2a6fe1",
43+
github: "#6336b8",
4344
};
4445

4546
const parseNumeric = (value) => {

0 commit comments

Comments
 (0)