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 attempts | 1 | import { env } from "cloudflare:workers"; |
| 2 | ||
| 3 | import type { Route } from "./+types/code"; | |
| 4 | import { TreeView } from "../../components/repo-view"; | |
| 5 | import { getViewer, unwrap } from "../../lib/session.server"; | |
| 6 | ||
| 7 | export async function loader({ params, context }: Route.LoaderArgs) { | |
| 8 | const path = { namespace: params.owner, name: params.repo }; | |
| 9 | return unwrap(await env.REPOS.tree(path, getViewer(context), null, "")); | |
| 10 | } | |
| 11 | ||
| 12 | export default function Code({ loaderData }: Route.ComponentProps) { | |
| 13 | return <TreeView tree={loaderData} />; | |
| 14 | } |