Skip to content

g1t/apps/web/app/routes.ts

219 lines12,817 bytesCodeBlame
1import { type RouteConfig, index, route } from "@react-router/dev/routes";
2
3export default [
4 index("routes/home.tsx"),
5 route("login", "routes/login.tsx"),
6 // The second step of signing in, for an account with two-factor authentication.
7 route("login/two-factor", "routes/login-two-factor.tsx"),
8 route("register", "routes/register.tsx"),
9 // An invite link: who sent it, then sign-up or joining. `invite` is reserved.
10 route("invite/:code", "routes/invite.tsx"),
11 route("logout", "routes/logout.tsx"),
12 route("verify", "routes/verify.tsx"),
13 route("forgot", "routes/forgot.tsx"),
14 route("reset", "routes/reset.tsx"),
15 route("device", "routes/device.tsx"),
16 route("oauth/authorize", "routes/oauth-authorize.tsx"),
17 route("new", "routes/new.tsx"),
18 // GitHub: signing in with it, and bringing repositories across through
19 // g1t's GitHub App. `auth` and `integrations` are reserved names.
20 route("new/github", "routes/new-github.tsx"),
21 route("auth/github", "routes/auth-github.ts"),
22 route("auth/github/callback", "routes/auth-github-callback.tsx"),
23 route("auth/github/username", "routes/auth-github-username.tsx"),
24 route("integrations/github/install", "routes/github-install.ts"),
25 route("integrations/github/setup", "routes/github-setup.tsx"),
26 // Your own settings: one page each, so links can name the one they mean.
27 // `/settings` goes to the first; an old link's `#anchor` to its page.
28 route("settings", "routes/settings/layout.tsx", [
29 index("routes/settings/index.tsx"),
30 route("profile", "routes/settings/profile.tsx"),
31 route("emails", "routes/settings/emails.tsx"),
32 route("notifications", "routes/settings/notifications.tsx"),
33 route("invites", "routes/settings/invites.tsx"),
34 route("keys", "routes/settings/keys.tsx"),
35 route("tokens", "routes/settings/tokens.tsx"),
36 route("github", "routes/settings/github.tsx"),
37 route("applications", "routes/settings/applications.tsx"),
38 route("two-factor", "routes/settings/two-factor.tsx"),
39 route("security-log", "routes/settings/security-log.tsx"),
40 ]),
41 // The account menu's header: name, primary email and invites left.
42 route("settings/menu.json", "routes/settings-menu-json.ts"),
43 // People, apart from workspaces: `u` is a reserved name.
44 route("u/:username", "routes/user.tsx"),
45 route("explore", "routes/explore.tsx", { id: "explore" }),
46 route("pricing", "routes/pricing.tsx"),
47 route("search", "routes/search.tsx"),
48 // Each person's inbox, and what its panel in the top bar fetches.
49 route("inbox", "routes/inbox.tsx"),
50 route("inbox.json", "routes/inbox-json.ts"),
51 // What the command palette shows as someone types.
52 route("search.json", "routes/search-json.ts"),
53 route("workspaces/new", "routes/workspace/new.tsx"),
54 // Trust pages: reserved names, like the rest above.
55 route("policies", "routes/policies.tsx"),
56 route("policies/:policy", "routes/policy.tsx"),
57 route("security", "routes/security.tsx"),
58 route("support", "routes/support.tsx"),
59 // Status moved to status.g1t.sh (apps/status); old links go there.
60 route("status", "routes/status.tsx"),
61 route("status.json", "routes/status-json.ts"),
62 route(".well-known/security.txt", "routes/security-txt.ts"),
63 // Releases of the self-hosted runner and the g1t CLI, from R2.
64 route("downloads/:tool/*", "routes/downloads-runner.ts"),
65 // A workspace's own pages sit under `-`, which no repository can be named.
66 route(":owner", "routes/workspace/layout.tsx", [
67 index("routes/workspace/overview.tsx"),
68 // Its pages, each in the sidebar: Overview (above), Projects, People, Insights; Teams and Packages below.
69 route("-/projects", "routes/workspace/projects.tsx"),
70 route("-/people", "routes/workspace/people.tsx"),
71 route("-/insights", "routes/workspace/tab-soon.tsx", { id: "routes/workspace/insights" }),
72 // Pinning its projects, for the person signed in.
73 route("-/pins", "routes/workspace/pins.ts"),
74 // Pages that moved: Members is People, and the overview is the workspace.
75 route("-/members", "routes/workspace/moved.ts", { id: "routes/workspace/moved-members" }),
76 route("-/overview", "routes/workspace/moved.ts", { id: "routes/workspace/moved-overview" }),
77 // Teams: the list, a new one, and each team's pages.
78 route("-/teams", "routes/workspace/teams.tsx"),
79 route("-/teams/new", "routes/workspace/team-new.tsx"),
80 route("-/teams/:team", "routes/workspace/team/layout.tsx", [
81 index("routes/workspace/team/members.tsx"),
82 route("teams", "routes/workspace/team/teams.tsx"),
83 route("repositories", "routes/workspace/team/repositories.tsx"),
84 route("settings", "routes/workspace/team/settings.tsx"),
85 ]),
86 route("-/tokens", "routes/workspace/tokens.tsx"),
87 route("-/usage", "routes/workspace/usage.tsx"),
88 route("-/gateway", "routes/workspace/gateway.tsx"),
89 route("-/billing", "routes/workspace/billing.tsx"),
90 route("-/billing/entries", "routes/workspace/statement-entries.ts"),
91 route("-/billing/statement.csv", "routes/workspace/statement-csv.ts"),
92 route("-/integrations", "routes/workspace/integrations.tsx"),
93 route("-/webhooks", "routes/workspace/webhooks.tsx"),
94 route("-/secrets", "routes/workspace/secrets.tsx"),
95 route("-/runners", "routes/workspace/runners.tsx"),
96 route("-/actions", "routes/workspace/actions-settings.tsx"),
97 route("-/packages", "routes/workspace/packages.tsx"),
98 route("-/packages/:ecosystem/*", "routes/workspace/package.tsx"),
99 route("-/settings", "routes/workspace/settings.tsx"),
100 route("-/repositories", "routes/workspace/repositories.tsx"),
101 route("-/agents", "routes/workspace/agents.tsx"),
102 route("-/memory", "routes/workspace/memory.tsx"),
103 route("-/context", "routes/workspace/context.tsx"),
104 route("-/security", "routes/workspace/security.tsx"),
105 route("-/security/patterns", "routes/workspace/security-patterns.tsx"),
106 route("-/security/bypass-requests", "routes/workspace/security-bypass.tsx"),
107 route("-/security/settings", "routes/workspace/security-settings.tsx"),
108 route("-/audit", "routes/workspace/audit.tsx"),
109 route("-/audit/export", "routes/workspace/audit-export.ts"),
110 route("-/guardrails", "routes/workspace/guardrails.tsx"),
111 route("-/rules", "routes/workspace/rules.tsx"),
112 route("-/rules/:id", "routes/workspace/ruleset.tsx"),
113 // What the workspace will have across its projects.
114 route("-/soon/:feature", "routes/workspace/soon.tsx"),
115 ]),
116 // Why a line is the way it is, fetched by the blame view.
117 route(":owner/:repo/why/:hash", "routes/repo/why.ts"),
118 // A project's agent runs as JSON, and stopping or messaging one.
119 route(":owner/:repo/agents.json", "routes/repo/agents-live.ts"),
120 // Its branch names, for changing the branch a pull request merges into.
121 route(":owner/:repo/branches.json", "routes/repo/branch-names.ts"),
122 // What a project's agent runs did, from the audit log, for the Agent panel.
123 route(":owner/:repo/audit.json", "routes/repo/audit-live.ts"),
124 // An invitation to a repository, answered by someone who cannot see it yet.
125 route(":owner/:repo/invitations", "routes/repo/invitations.tsx"),
126 // The Files page's About as JSON, asked again while it is first worked out.
127 route(":owner/:repo/about.json", "routes/repo/about-json.ts"),
128 // Starring it, from the header's Star button.
129 route(":owner/:repo/star", "routes/repo/star.ts"),
130 // Subscribing to its issues and pull requests, and watching it.
131 route(":owner/:repo/notifications", "routes/repo/notifications.ts"),
132 // A starter CI workflow, opened as a pull request (components/add-ci.tsx).
133 route(":owner/:repo/add-ci", "routes/repo/add-ci.ts"),
134 // A screenshot of a project's production, for its overview.
135 route(":owner/:repo/production.jpg", "routes/repo/production-screenshot.ts"),
136 // A project: its overview first, its repository's code under Code. The
137 // 1:1 project of a repository has the repository's name, so every
138 // repository address below keeps working.
139 route(":owner/:repo", "routes/repo/layout.tsx", [
140 index("routes/repo/overview.tsx"),
141 route("code", "routes/repo/code.tsx"),
142 route("tree/:ref/*", "routes/repo/tree.tsx"),
143 route("blob/:ref/*", "routes/repo/blob.tsx"),
144 route("archive/*", "routes/repo/archive.ts"),
145 route("commits", "routes/repo/commits.tsx"),
146 route("branches", "routes/repo/branches.tsx"),
147 route("tags", "routes/repo/tags.tsx"),
148 route("releases", "routes/repo/releases.tsx"),
149 route("releases/new", "routes/repo/release-new.tsx"),
150 route("releases/tag/*", "routes/repo/release.tsx"),
151 route("contributors", "routes/repo/contributors.tsx"),
152 route("activity", "routes/repo/activity.tsx"),
153 route("stargazers", "routes/repo/stargazers.tsx"),
154 route("compare/*", "routes/repo/compare.tsx", { id: "routes/repo/compare-range" }),
155 route("compare", "routes/repo/compare.tsx"),
156 route("commit/:hash", "routes/repo/commit.tsx"),
157 // A check run reported on a commit: its report, annotations and buttons.
158 route("checks/:id", "routes/repo/check-run.tsx"),
159 route("labels", "routes/repo/labels.tsx"),
160 route("milestones", "routes/repo/milestones.tsx"),
161 route("milestones/:number", "routes/repo/milestone.tsx"),
162 route("issues", "routes/repo/issues.tsx"),
163 route("issues/new", "routes/repo/issue-new.tsx"),
164 route("issues/:number", "routes/repo/issue.tsx"),
165 route("pulls", "routes/repo/pulls.tsx"),
166 route("pulls/new", "routes/repo/pull-new.tsx"),
167 route("pull/:number", "routes/repo/pull.tsx"),
168 route("queue", "routes/repo/queue.tsx"),
169 route("agents", "routes/repo/agents.tsx"),
170 route("usage", "routes/repo/usage.tsx"),
171 route("agents/runs/:id", "routes/repo/agents-run.tsx"),
172 route("sessions", "routes/repo/sessions.tsx"),
173 route("sessions/:number", "routes/repo/session.tsx"),
174 route("memory", "routes/repo/memory.tsx"),
175 route("actions", "routes/repo/actions.tsx"),
176 route("actions/runs/:id", "routes/repo/actions-run.tsx"),
177 route("actions/runs/:id/artifacts/:name", "routes/repo/actions-artifact.ts"),
178 route("actions/jobs/:job/log", "routes/repo/actions-log.ts"),
179 route("deployments", "routes/repo/deployments.tsx"),
180 route("deployments/:id", "routes/repo/deployment.tsx"),
181 // Security: an overview, then a page for each part. Old links to
182 // `security?tab=…` are sent on by the overview.
183 route("security", "routes/repo/security-overview.tsx"),
184 route("security/secret-scanning", "routes/repo/security-secrets.tsx"),
185 route("security/secret-scanning/patterns", "routes/repo/security-patterns.tsx"),
186 route("security/secret-scanning/:id", "routes/repo/security-secret.tsx"),
187 route("security/code-scanning", "routes/repo/security-code.tsx"),
188 route("security/code-scanning/setup", "routes/repo/security-code-setup.ts"),
189 route("security/code-scanning/:number", "routes/repo/security-code-alert.tsx"),
190 route("security/vulnerabilities", "routes/repo/security.tsx"),
191 route("security/dependency-graph", "routes/repo/security-graph.tsx"),
192 route("security/dependency-graph/sbom.json", "routes/repo/security-sbom.ts"),
193 route("security/dependency-updates", "routes/repo/security-updates.tsx"),
194 route("security/pulls/:number", "routes/repo/security-pull.tsx"),
195 route("security/settings", "routes/repo/security-settings.tsx"),
196 route("plans", "routes/repo/plans.tsx"),
197 route("plans/:id", "routes/repo/plan.tsx"),
198 route("settings", "routes/repo/settings.tsx"),
199 route("settings/repository", "routes/repo/settings-repository.tsx"),
200 route("settings/access", "routes/repo/settings-access.tsx"),
201 route("settings/branches", "routes/repo/settings-branches.tsx"),
202 route("settings/rules", "routes/repo/settings-rules.tsx"),
203 route("settings/rules/:id", "routes/repo/settings-ruleset.tsx"),
204 route("settings/webhooks", "routes/repo/webhooks.tsx"),
205 route("settings/secrets", "routes/repo/secrets.tsx"),
206 route("settings/actions", "routes/repo/settings-actions.tsx"),
207 route("settings/environments", "routes/repo/settings-environments.tsx"),
208 route("settings/runners", "routes/repo/settings-runners.tsx"),
209 route("settings/deployments", "routes/repo/settings-deployments.tsx"),
210 route("settings/domains", "routes/repo/settings-domains.tsx"),
211 route("settings/dependencies", "routes/repo/settings-dependencies.tsx"),
212 route("settings/guardrails", "routes/repo/settings-guardrails.tsx"),
213 route("settings/agents", "routes/repo/settings-agents.tsx"),
214 // What the project will have: one page for each Soon in its menu.
215 route("soon/:feature", "routes/repo/soon.tsx"),
216 ]),
217 // Anything else: a 404 that still knows who is signed in.
218 route("*", "routes/not-found.tsx"),
219] satisfies RouteConfig;