~james/core

core/web/src/fixtures/blobHeaderWorstCase.ts -rw-r--r-- 2.7 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import type { ComponentProps } from "svelte";
import type BlobHeader from "#lib/components/repo/BlobHeader.svelte";

type BlobHeaderProps = ComponentProps<typeof BlobHeader>;

const repo = { ownerHandle: "alice", repoName: "tangled", ref: "main" };
const path = "web/src/lib/components/repo/BlobView.svelte";

const demo: BlobHeaderProps = {
	repo,
	path,
	rawHref: `/alice/tangled/raw/main/${path}`,
	historyHref: `/alice/tangled/history/main/${path}`,
	kind: "code",
	language: "Svelte",
	sizeLabel: "4.2 kB",
	lines: 87,
	showBlame: true,
	copyText: "export const answer = 42;\n",
	onsearch: () => {}
};

// git caps neither ref names nor paths, and enry names run to 34 characters
const worstPath =
	"tools/windows/legacy-build/Benachrichtigungseinstellungen/NorthwindIndustriesHoldings.Platform.Integrations.Notifications.sln";
const worstRepo = {
	ownerHandle: "aleksandra-wisniewska-kowalczyk.northwind-industries-holdings.example.com",
	repoName: "northwind-industries-holdings-platform-monorepo",
	ref: "dependabot/cargo/crates/knot2/tokio-rustls-0.26.4-security-advisory"
};

const worst: BlobHeaderProps = {
	repo: worstRepo,
	path: worstPath,
	rawHref: `/alice/tangled/raw/main/${worstPath}`,
	historyHref: `/alice/tangled/history/main/${worstPath}`,
	kind: "code",
	language: "Microsoft Visual Studio Solution",
	sizeLabel: "118 MB",
	lines: 1284731,
	showWrap: true,
	showBlame: true,
	blameLoading: true,
	copyText: "Microsoft Visual Studio Solution File, Format Version 12.00\n",
	onsearch: () => {}
};

const markup: BlobHeaderProps = {
	...worst,
	path: "docs/Paramètres de confidentialité et de sécurité — guide d'administration.md",
	language: "Markdown",
	kind: "markup",
	view: "rendered",
	sizeLabel: "48 kB",
	lines: 1284
};

const commit: BlobHeaderProps = {
	...demo,
	repo: { ...repo, ref: "9f8e7d6c5b4a3c2d1e0f9a8b7c6d5e4f3a2b1c0d" },
	language: "Jupyter Notebook",
	lines: 1
};

const empty: BlobHeaderProps = {
	...demo,
	path: "web/static/.gitkeep",
	language: null,
	sizeLabel: "0 B",
	lines: 0,
	copyText: "",
	showBlame: false
};

const image: BlobHeaderProps = {
	...demo,
	path: "web/static/screenshots/IMG_20250914_183022_HDR_portrait_edited_edited.HEIC",
	kind: "image",
	language: null,
	sizeLabel: "12 MB",
	lines: null,
	copyText: null,
	showBlame: false,
	onsearch: undefined
};

const string: BlobHeaderProps = {
	...worst,
	repo: null,
	path: "discord-compact-composer.css",
	rawHref: "/strings/erin.tngl.sh/3mrkjth7weu22/raw",
	historyHref: null,
	language: "CSS",
	timeLabel: "Created 11mo ago",
	blameLoading: false,
	showBlame: false
};

export const blobHeaderDatasets = { demo, worst, markup, commit, empty, image, string };

export type BlobHeaderDatasetName = keyof typeof blobHeaderDatasets;