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

24 lines889 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 type { Route } from "./+types/blob";
2import { BlobView } from "../../components/repo-view";
API and MCP server, Rust identity service, registration, site redesign3import { highlight } from "../../lib/highlight.server";
Rust repos service with shipping; pull requests kept in the model4import { repos } from "../../lib/services.server";
Initial g1t: services, event bus, intents and attempts5import { getViewer, unwrap } from "../../lib/session.server";
6
7export function meta({ params }: Route.MetaArgs) {
8 return [{ title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }];
9}
10
11export async function loader({ params, context }: Route.LoaderArgs) {
12 const path = { namespace: params.owner, name: params.repo };
API and MCP server, Rust identity service, registration, site redesign13 const blob = unwrap(
Rust repos service with shipping; pull requests kept in the model14 await repos.blob(path, getViewer(context), params.ref, params["*"] ?? ""),
Initial g1t: services, event bus, intents and attempts15 );
API and MCP server, Rust identity service, registration, site redesign16 return {
17 blob,
18 html: blob.text == null ? null : await highlight(blob.path, blob.text),
19 };
Initial g1t: services, event bus, intents and attempts20}
21
22export default function Blob({ loaderData }: Route.ComponentProps) {
API and MCP server, Rust identity service, registration, site redesign23 return <BlobView blob={loaderData.blob} html={loaderData.html} />;
Initial g1t: services, event bus, intents and attempts24}