g1t/apps/web/app/routes/repo/blob.tsx

25 lines885 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Initial g1t: services, event bus, intents and attempts1import { env } from "cloudflare:workers";
2
3import type { Route } from "./+types/blob";
4import { BlobView } from "../../components/repo-view";
API and MCP server, Rust identity service, registration, site redesign5import { highlight } from "../../lib/highlight.server";
Initial g1t: services, event bus, intents and attempts6import { getViewer, unwrap } from "../../lib/session.server";
7
8export function meta({ params }: Route.MetaArgs) {
9 return [{ title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }];
10}
11
12export async function loader({ params, context }: Route.LoaderArgs) {
13 const path = { namespace: params.owner, name: params.repo };
API and MCP server, Rust identity service, registration, site redesign14 const blob = unwrap(
Initial g1t: services, event bus, intents and attempts15 await env.REPOS.blob(path, getViewer(context), params.ref, params["*"] ?? ""),
16 );
API and MCP server, Rust identity service, registration, site redesign17 return {
18 blob,
19 html: blob.text == null ? null : await highlight(blob.path, blob.text),
20 };
Initial g1t: services, event bus, intents and attempts21}
22
23export default function Blob({ loaderData }: Route.ComponentProps) {
API and MCP server, Rust identity service, registration, site redesign24 return <BlobView blob={loaderData.blob} html={loaderData.html} />;
Initial g1t: services, event bus, intents and attempts25}