ref0-git 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/app/apps/github/.dev.vars.example +6 -0
  2. package/app/apps/github/README.md +70 -0
  3. package/app/apps/github/THIRD_PARTY_NOTICES.md +214 -0
  4. package/app/apps/github/components.json +25 -0
  5. package/app/apps/github/generated/git-rest.ts +10444 -0
  6. package/app/apps/github/generated/routeTree.gen.ts +1242 -0
  7. package/app/apps/github/migrations/postgres/0001_auth.sql +46 -0
  8. package/app/apps/github/migrations/sql/0001_auth.sql +19 -0
  9. package/app/apps/github/migrations/sql/0002_passkeys.sql +9 -0
  10. package/app/apps/github/migrations/sql/0003_orgs.sql +22 -0
  11. package/app/apps/github/migrations/sql/0004_avatars.sql +6 -0
  12. package/app/apps/github/package.json +80 -0
  13. package/app/apps/github/src/branches/branch-list.tsx +385 -0
  14. package/app/apps/github/src/branches/branches.ts +55 -0
  15. package/app/apps/github/src/clients/allowed.ts +213 -0
  16. package/app/apps/github/src/clients/at-most.ts +17 -0
  17. package/app/apps/github/src/clients/avatars.ts +410 -0
  18. package/app/apps/github/src/clients/cached.ts +65 -0
  19. package/app/apps/github/src/clients/calls.ts +160 -0
  20. package/app/apps/github/src/clients/clients.ts +82 -0
  21. package/app/apps/github/src/clients/graphql.ts +50 -0
  22. package/app/apps/github/src/clients/host-answer.ts +28 -0
  23. package/app/apps/github/src/clients/host-calls.ts +382 -0
  24. package/app/apps/github/src/clients/icon-bytes.ts +203 -0
  25. package/app/apps/github/src/clients/proxy.ts +59 -0
  26. package/app/apps/github/src/clients/session-ended.ts +18 -0
  27. package/app/apps/github/src/clients/transfers.ts +212 -0
  28. package/app/apps/github/src/code/breadcrumbs.tsx +50 -0
  29. package/app/apps/github/src/code/code-page.tsx +147 -0
  30. package/app/apps/github/src/code/code-tree.tsx +338 -0
  31. package/app/apps/github/src/code/controls.tsx +230 -0
  32. package/app/apps/github/src/code/file-view.tsx +450 -0
  33. package/app/apps/github/src/code/files.ts +332 -0
  34. package/app/apps/github/src/code/folder-list.tsx +122 -0
  35. package/app/apps/github/src/code/go-to-file.tsx +131 -0
  36. package/app/apps/github/src/code/highlighted.tsx +58 -0
  37. package/app/apps/github/src/code/lines.ts +46 -0
  38. package/app/apps/github/src/code/load.ts +147 -0
  39. package/app/apps/github/src/code/markdown-files.ts +58 -0
  40. package/app/apps/github/src/code/places.ts +88 -0
  41. package/app/apps/github/src/code/ref-pages.ts +179 -0
  42. package/app/apps/github/src/code/ref-switcher.tsx +203 -0
  43. package/app/apps/github/src/code/refs.ts +142 -0
  44. package/app/apps/github/src/code/repo-home.tsx +240 -0
  45. package/app/apps/github/src/code/repo.ts +105 -0
  46. package/app/apps/github/src/code/saved-reads.ts +199 -0
  47. package/app/apps/github/src/code/saved.ts +110 -0
  48. package/app/apps/github/src/code/tree-fold.ts +186 -0
  49. package/app/apps/github/src/code/trees.ts +136 -0
  50. package/app/apps/github/src/components/avatar-picture.ts +53 -0
  51. package/app/apps/github/src/components/avatar-url.ts +16 -0
  52. package/app/apps/github/src/components/confirm-action.tsx +100 -0
  53. package/app/apps/github/src/components/count.tsx +24 -0
  54. package/app/apps/github/src/components/create-button.tsx +38 -0
  55. package/app/apps/github/src/components/file-icons/file-icons.css +225 -0
  56. package/app/apps/github/src/components/file-icons/file-icons.tsx +138 -0
  57. package/app/apps/github/src/components/filter.tsx +35 -0
  58. package/app/apps/github/src/components/hotkeys/hotkeys.tsx +255 -0
  59. package/app/apps/github/src/components/item-list.tsx +65 -0
  60. package/app/apps/github/src/components/language-dot.tsx +29 -0
  61. package/app/apps/github/src/components/list-toolbar.tsx +82 -0
  62. package/app/apps/github/src/components/markdown/editor.tsx +57 -0
  63. package/app/apps/github/src/components/markdown/markdown.css +177 -0
  64. package/app/apps/github/src/components/markdown/markdown.tsx +82 -0
  65. package/app/apps/github/src/components/owner-card.tsx +196 -0
  66. package/app/apps/github/src/components/pull-status.tsx +34 -0
  67. package/app/apps/github/src/components/recent.ts +41 -0
  68. package/app/apps/github/src/components/relative-time.tsx +78 -0
  69. package/app/apps/github/src/components/repos/icon-hashes.ts +91 -0
  70. package/app/apps/github/src/components/repos/new-repo-form.tsx +196 -0
  71. package/app/apps/github/src/components/repos/repo-icon.tsx +47 -0
  72. package/app/apps/github/src/components/repos/repo-list.tsx +528 -0
  73. package/app/apps/github/src/components/repos/your-repos.tsx +124 -0
  74. package/app/apps/github/src/components/review-state.tsx +75 -0
  75. package/app/apps/github/src/components/route-dialog.tsx +137 -0
  76. package/app/apps/github/src/components/save-button.tsx +58 -0
  77. package/app/apps/github/src/components/shell/app-shell.tsx +164 -0
  78. package/app/apps/github/src/components/shell/create-org-dialog.tsx +118 -0
  79. package/app/apps/github/src/components/shell/create-row.tsx +49 -0
  80. package/app/apps/github/src/components/shell/link-menu.tsx +94 -0
  81. package/app/apps/github/src/components/shell/nav-user.tsx +97 -0
  82. package/app/apps/github/src/components/shell/owner-repos.tsx +247 -0
  83. package/app/apps/github/src/components/shell/owner-switcher.tsx +104 -0
  84. package/app/apps/github/src/components/shell/repo-switcher.tsx +179 -0
  85. package/app/apps/github/src/components/shell/sections.ts +31 -0
  86. package/app/apps/github/src/components/shell/submenu-chevron.ts +147 -0
  87. package/app/apps/github/src/components/signin/device-card.tsx +139 -0
  88. package/app/apps/github/src/components/signin/login-form.tsx +88 -0
  89. package/app/apps/github/src/components/signin/signin-page.tsx +33 -0
  90. package/app/apps/github/src/components/signin/signup-form.tsx +106 -0
  91. package/app/apps/github/src/components/states/live-status.tsx +42 -0
  92. package/app/apps/github/src/components/states/states.tsx +126 -0
  93. package/app/apps/github/src/components/tab-indicator.tsx +143 -0
  94. package/app/apps/github/src/components/theme-choice.tsx +108 -0
  95. package/app/apps/github/src/components/theme-provider.tsx +126 -0
  96. package/app/apps/github/src/components/tones.ts +23 -0
  97. package/app/apps/github/src/components/ui/alert-dialog.tsx +187 -0
  98. package/app/apps/github/src/components/ui/alert.tsx +78 -0
  99. package/app/apps/github/src/components/ui/avatar.tsx +106 -0
  100. package/app/apps/github/src/components/ui/badge.tsx +51 -0
  101. package/app/apps/github/src/components/ui/breadcrumb.tsx +124 -0
  102. package/app/apps/github/src/components/ui/button-group.tsx +87 -0
  103. package/app/apps/github/src/components/ui/button.tsx +61 -0
  104. package/app/apps/github/src/components/ui/calendar.tsx +221 -0
  105. package/app/apps/github/src/components/ui/card.tsx +102 -0
  106. package/app/apps/github/src/components/ui/checkbox.tsx +26 -0
  107. package/app/apps/github/src/components/ui/collapsible.tsx +19 -0
  108. package/app/apps/github/src/components/ui/combobox.tsx +304 -0
  109. package/app/apps/github/src/components/ui/command.tsx +208 -0
  110. package/app/apps/github/src/components/ui/dialog.tsx +156 -0
  111. package/app/apps/github/src/components/ui/dropdown-menu.tsx +290 -0
  112. package/app/apps/github/src/components/ui/empty.tsx +100 -0
  113. package/app/apps/github/src/components/ui/field.tsx +236 -0
  114. package/app/apps/github/src/components/ui/hover-card.tsx +48 -0
  115. package/app/apps/github/src/components/ui/input-group.tsx +163 -0
  116. package/app/apps/github/src/components/ui/input.tsx +19 -0
  117. package/app/apps/github/src/components/ui/item.tsx +201 -0
  118. package/app/apps/github/src/components/ui/kbd.tsx +27 -0
  119. package/app/apps/github/src/components/ui/label.tsx +33 -0
  120. package/app/apps/github/src/components/ui/popover.tsx +87 -0
  121. package/app/apps/github/src/components/ui/radio-group.tsx +35 -0
  122. package/app/apps/github/src/components/ui/select.tsx +198 -0
  123. package/app/apps/github/src/components/ui/separator.tsx +22 -0
  124. package/app/apps/github/src/components/ui/sheet.tsx +138 -0
  125. package/app/apps/github/src/components/ui/sidebar.tsx +724 -0
  126. package/app/apps/github/src/components/ui/skeleton.tsx +13 -0
  127. package/app/apps/github/src/components/ui/sonner.tsx +47 -0
  128. package/app/apps/github/src/components/ui/styles.css +242 -0
  129. package/app/apps/github/src/components/ui/table.tsx +113 -0
  130. package/app/apps/github/src/components/ui/tabs.tsx +79 -0
  131. package/app/apps/github/src/components/ui/textarea.tsx +17 -0
  132. package/app/apps/github/src/components/ui/title.ts +6 -0
  133. package/app/apps/github/src/components/ui/toggle-group.tsx +89 -0
  134. package/app/apps/github/src/components/ui/toggle.tsx +42 -0
  135. package/app/apps/github/src/components/ui/tooltip.tsx +63 -0
  136. package/app/apps/github/src/components/user-avatar.tsx +145 -0
  137. package/app/apps/github/src/components/view-tabs.tsx +42 -0
  138. package/app/apps/github/src/context/context.ts +133 -0
  139. package/app/apps/github/src/diffs/blobs.ts +94 -0
  140. package/app/apps/github/src/diffs/diff-view.tsx +155 -0
  141. package/app/apps/github/src/diffs/files.ts +121 -0
  142. package/app/apps/github/src/diffs/hunks.tsx +454 -0
  143. package/app/apps/github/src/diffs/patch.ts +131 -0
  144. package/app/apps/github/src/diffs/rows.ts +137 -0
  145. package/app/apps/github/src/history/commit-diff.ts +54 -0
  146. package/app/apps/github/src/history/commit-list.tsx +207 -0
  147. package/app/apps/github/src/history/commit-page.tsx +147 -0
  148. package/app/apps/github/src/history/history.ts +129 -0
  149. package/app/apps/github/src/hooks/allowed.ts +31 -0
  150. package/app/apps/github/src/hooks/answers.ts +65 -0
  151. package/app/apps/github/src/hooks/avatars.ts +54 -0
  152. package/app/apps/github/src/hooks/draft.ts +38 -0
  153. package/app/apps/github/src/hooks/open-counts.ts +127 -0
  154. package/app/apps/github/src/hooks/profiles.ts +120 -0
  155. package/app/apps/github/src/hooks/repos.ts +440 -0
  156. package/app/apps/github/src/hooks/use-mobile.ts +19 -0
  157. package/app/apps/github/src/hooks/viewer.ts +39 -0
  158. package/app/apps/github/src/inbox/count.ts +70 -0
  159. package/app/apps/github/src/inbox/inbox-item.tsx +66 -0
  160. package/app/apps/github/src/inbox/inbox-page.tsx +572 -0
  161. package/app/apps/github/src/inbox/marks.ts +130 -0
  162. package/app/apps/github/src/inbox/release-tags.ts +65 -0
  163. package/app/apps/github/src/inbox/search.ts +97 -0
  164. package/app/apps/github/src/inbox/subjects.ts +184 -0
  165. package/app/apps/github/src/inbox/subscription-controls.tsx +184 -0
  166. package/app/apps/github/src/inbox/subscriptions.ts +189 -0
  167. package/app/apps/github/src/inbox/threads.ts +198 -0
  168. package/app/apps/github/src/issues/changes.ts +332 -0
  169. package/app/apps/github/src/issues/counts.ts +62 -0
  170. package/app/apps/github/src/issues/issue-list.tsx +682 -0
  171. package/app/apps/github/src/issues/issue-page.tsx +533 -0
  172. package/app/apps/github/src/issues/issues.ts +566 -0
  173. package/app/apps/github/src/issues/label-dialog.tsx +310 -0
  174. package/app/apps/github/src/issues/labels-page.tsx +119 -0
  175. package/app/apps/github/src/issues/new-issue.tsx +79 -0
  176. package/app/apps/github/src/issues/parts.tsx +71 -0
  177. package/app/apps/github/src/issues/picker.tsx +298 -0
  178. package/app/apps/github/src/issues/search.ts +238 -0
  179. package/app/apps/github/src/issues/sidebar.tsx +236 -0
  180. package/app/apps/github/src/lib/cn.ts +8 -0
  181. package/app/apps/github/src/lib/highlighting.ts +13 -0
  182. package/app/apps/github/src/live/follow.ts +129 -0
  183. package/app/apps/github/src/live/sse.ts +74 -0
  184. package/app/apps/github/src/live/use-follow.ts +37 -0
  185. package/app/apps/github/src/markdown/README.md +53 -0
  186. package/app/apps/github/src/markdown/allowed-html.ts +69 -0
  187. package/app/apps/github/src/markdown/context.ts +206 -0
  188. package/app/apps/github/src/markdown/images.ts +81 -0
  189. package/app/apps/github/src/markdown/lookup.ts +122 -0
  190. package/app/apps/github/src/markdown/patches.ts +299 -0
  191. package/app/apps/github/src/markdown/query.ts +25 -0
  192. package/app/apps/github/src/markdown/references.ts +158 -0
  193. package/app/apps/github/src/markdown/render.ts +103 -0
  194. package/app/apps/github/src/names/owners.ts +51 -0
  195. package/app/apps/github/src/names/repos.ts +24 -0
  196. package/app/apps/github/src/palette/palette.tsx +547 -0
  197. package/app/apps/github/src/palette/recent.ts +116 -0
  198. package/app/apps/github/src/palette/rows.tsx +455 -0
  199. package/app/apps/github/src/palette/server.ts +104 -0
  200. package/app/apps/github/src/palette/targets.ts +306 -0
  201. package/app/apps/github/src/policy.ts +600 -0
  202. package/app/apps/github/src/private-repos.ts +47 -0
  203. package/app/apps/github/src/pulls/compare-page.tsx +342 -0
  204. package/app/apps/github/src/pulls/files-tab.tsx +776 -0
  205. package/app/apps/github/src/pulls/live.ts +124 -0
  206. package/app/apps/github/src/pulls/merge-box.tsx +367 -0
  207. package/app/apps/github/src/pulls/merge-button.ts +86 -0
  208. package/app/apps/github/src/pulls/pull-list.tsx +235 -0
  209. package/app/apps/github/src/pulls/pull-page.tsx +474 -0
  210. package/app/apps/github/src/pulls/pull.ts +468 -0
  211. package/app/apps/github/src/pulls/pulls.ts +318 -0
  212. package/app/apps/github/src/pulls/review.ts +350 -0
  213. package/app/apps/github/src/pulls/search.ts +130 -0
  214. package/app/apps/github/src/queue/queue-page.tsx +405 -0
  215. package/app/apps/github/src/queue/queue.ts +231 -0
  216. package/app/apps/github/src/releases/latest-release.tsx +55 -0
  217. package/app/apps/github/src/releases/overview.tsx +30 -0
  218. package/app/apps/github/src/releases/release-form.tsx +353 -0
  219. package/app/apps/github/src/releases/release-list.tsx +173 -0
  220. package/app/apps/github/src/releases/release-view.tsx +183 -0
  221. package/app/apps/github/src/releases/releases.ts +308 -0
  222. package/app/apps/github/src/releases/tag-list.tsx +134 -0
  223. package/app/apps/github/src/router.tsx +46 -0
  224. package/app/apps/github/src/routes/$owner/$repo/_code/blob/$.tsx +33 -0
  225. package/app/apps/github/src/routes/$owner/$repo/_code/tree/$.tsx +28 -0
  226. package/app/apps/github/src/routes/$owner/$repo/_code.tsx +11 -0
  227. package/app/apps/github/src/routes/$owner/$repo/_releases/releases/index.tsx +19 -0
  228. package/app/apps/github/src/routes/$owner/$repo/_releases/tags.tsx +19 -0
  229. package/app/apps/github/src/routes/$owner/$repo/_releases.tsx +23 -0
  230. package/app/apps/github/src/routes/$owner/$repo/branches.tsx +39 -0
  231. package/app/apps/github/src/routes/$owner/$repo/commit/$sha.tsx +34 -0
  232. package/app/apps/github/src/routes/$owner/$repo/commits/$.tsx +42 -0
  233. package/app/apps/github/src/routes/$owner/$repo/compare/$.tsx +19 -0
  234. package/app/apps/github/src/routes/$owner/$repo/index.tsx +24 -0
  235. package/app/apps/github/src/routes/$owner/$repo/issues/$number.tsx +50 -0
  236. package/app/apps/github/src/routes/$owner/$repo/issues/index.tsx +53 -0
  237. package/app/apps/github/src/routes/$owner/$repo/issues/new.tsx +43 -0
  238. package/app/apps/github/src/routes/$owner/$repo/labels.tsx +22 -0
  239. package/app/apps/github/src/routes/$owner/$repo/pull/$number/checks.tsx +15 -0
  240. package/app/apps/github/src/routes/$owner/$repo/pull/$number/commits.tsx +15 -0
  241. package/app/apps/github/src/routes/$owner/$repo/pull/$number/files.tsx +15 -0
  242. package/app/apps/github/src/routes/$owner/$repo/pull/$number/index.tsx +19 -0
  243. package/app/apps/github/src/routes/$owner/$repo/pull/$number/route.tsx +52 -0
  244. package/app/apps/github/src/routes/$owner/$repo/pulls/index.tsx +48 -0
  245. package/app/apps/github/src/routes/$owner/$repo/queue.tsx +22 -0
  246. package/app/apps/github/src/routes/$owner/$repo/releases/edit/$.tsx +58 -0
  247. package/app/apps/github/src/routes/$owner/$repo/releases/new.tsx +40 -0
  248. package/app/apps/github/src/routes/$owner/$repo/releases/tag/$.tsx +35 -0
  249. package/app/apps/github/src/routes/$owner/$repo/route.tsx +102 -0
  250. package/app/apps/github/src/routes/$owner/$repo/settings/access.tsx +9 -0
  251. package/app/apps/github/src/routes/$owner/$repo/settings/hooks/index.tsx +16 -0
  252. package/app/apps/github/src/routes/$owner/$repo/settings/hooks/new.tsx +25 -0
  253. package/app/apps/github/src/routes/$owner/$repo/settings/index.tsx +17 -0
  254. package/app/apps/github/src/routes/$owner/$repo/settings/route.tsx +28 -0
  255. package/app/apps/github/src/routes/$owner/$repo/settings/rules.tsx +12 -0
  256. package/app/apps/github/src/routes/$owner/$repo/tokens.tsx +16 -0
  257. package/app/apps/github/src/routes/$owner/index.tsx +45 -0
  258. package/app/apps/github/src/routes/-nav.tsx +293 -0
  259. package/app/apps/github/src/routes/-root-testing.ts +107 -0
  260. package/app/apps/github/src/routes/__root.tsx +225 -0
  261. package/app/apps/github/src/routes/api.auth.$.ts +18 -0
  262. package/app/apps/github/src/routes/downloads/$owner/$repo/$asset.tsx +10 -0
  263. package/app/apps/github/src/routes/file-icons[.]svg.ts +21 -0
  264. package/app/apps/github/src/routes/icons/$owner/$repo.tsx +14 -0
  265. package/app/apps/github/src/routes/icons/$owner/index.tsx +14 -0
  266. package/app/apps/github/src/routes/icons/index.tsx +12 -0
  267. package/app/apps/github/src/routes/index.tsx +48 -0
  268. package/app/apps/github/src/routes/login.tsx +24 -0
  269. package/app/apps/github/src/routes/login_.code.tsx +31 -0
  270. package/app/apps/github/src/routes/new.tsx +91 -0
  271. package/app/apps/github/src/routes/notifications.tsx +20 -0
  272. package/app/apps/github/src/routes/orgs/$owner/issues.tsx +8 -0
  273. package/app/apps/github/src/routes/orgs/$owner/pulls.tsx +8 -0
  274. package/app/apps/github/src/routes/orgs/$owner/releases.tsx +8 -0
  275. package/app/apps/github/src/routes/orgs/$owner/route.tsx +25 -0
  276. package/app/apps/github/src/routes/orgs/$owner/settings.tsx +30 -0
  277. package/app/apps/github/src/routes/orgs/$owner/tokens.tsx +15 -0
  278. package/app/apps/github/src/routes/settings.tsx +54 -0
  279. package/app/apps/github/src/routes/signup.tsx +24 -0
  280. package/app/apps/github/src/routes/uploads/$owner/$repo/$release.tsx +10 -0
  281. package/app/apps/github/src/seed/acme.ts +498 -0
  282. package/app/apps/github/src/seed/licenses.ts +114 -0
  283. package/app/apps/github/src/seed/seed.ts +538 -0
  284. package/app/apps/github/src/server.ts +97 -0
  285. package/app/apps/github/src/settings/account-avatar.tsx +43 -0
  286. package/app/apps/github/src/settings/avatar-section.tsx +140 -0
  287. package/app/apps/github/src/settings/avatar.ts +58 -0
  288. package/app/apps/github/src/settings/general-settings.tsx +439 -0
  289. package/app/apps/github/src/settings/general.ts +73 -0
  290. package/app/apps/github/src/settings/hook-form.tsx +195 -0
  291. package/app/apps/github/src/settings/hook-list.tsx +166 -0
  292. package/app/apps/github/src/settings/hooks.ts +87 -0
  293. package/app/apps/github/src/settings/org-settings.tsx +228 -0
  294. package/app/apps/github/src/settings/orgs.ts +116 -0
  295. package/app/apps/github/src/settings/rule-list.tsx +72 -0
  296. package/app/apps/github/src/settings/rules.ts +27 -0
  297. package/app/apps/github/src/settings/settings-layout.tsx +114 -0
  298. package/app/apps/github/src/signin/approval.ts +186 -0
  299. package/app/apps/github/src/signin/auth-client.ts +127 -0
  300. package/app/apps/github/src/signin/auth.ts +753 -0
  301. package/app/apps/github/src/signin/avatars.ts +126 -0
  302. package/app/apps/github/src/signin/client-ip.ts +39 -0
  303. package/app/apps/github/src/signin/credentials.ts +26 -0
  304. package/app/apps/github/src/signin/device-code.ts +95 -0
  305. package/app/apps/github/src/signin/device-prompt.ts +125 -0
  306. package/app/apps/github/src/signin/errors.ts +135 -0
  307. package/app/apps/github/src/signin/host-session.ts +68 -0
  308. package/app/apps/github/src/signin/orgs.ts +283 -0
  309. package/app/apps/github/src/signin/owner-names.ts +183 -0
  310. package/app/apps/github/src/signin/person-lock.ts +104 -0
  311. package/app/apps/github/src/signin/seal.ts +88 -0
  312. package/app/apps/github/src/signin/seed-people.ts +92 -0
  313. package/app/apps/github/src/signin/session.ts +48 -0
  314. package/app/apps/github/src/signin/unborn.ts +110 -0
  315. package/app/apps/github/src/signin/viewer-orgs.ts +47 -0
  316. package/app/apps/github/src/signin/viewer.ts +74 -0
  317. package/app/apps/github/src/signin/with-headers.ts +14 -0
  318. package/app/apps/github/src/tokens/tokens-page.tsx +529 -0
  319. package/app/apps/github/src/tokens/tokens.ts +54 -0
  320. package/app/apps/github/tsconfig.json +25 -0
  321. package/app/apps/github/tsconfig.worker.json +24 -0
  322. package/app/apps/github/vite.config.ts +21 -0
  323. package/app/pnpm-workspace.yaml +216 -0
  324. package/app/tsconfig.base.json +127 -0
  325. package/dist/LICENSE +202 -0
  326. package/dist/cli/child.mjs +42 -0
  327. package/dist/cli/commands.mjs +23 -0
  328. package/dist/cli/credentials.mjs +84 -0
  329. package/dist/cli/documents.mjs +214 -0
  330. package/dist/cli/events.mjs +55 -0
  331. package/dist/cli/failure.mjs +105 -0
  332. package/dist/cli/folders.mjs +32 -0
  333. package/dist/cli/git-remote-ref0.d.mts +1 -0
  334. package/dist/cli/git-remote-ref0.mjs +29 -0
  335. package/dist/cli/git.mjs +48 -0
  336. package/dist/cli/helpers.mjs +51 -0
  337. package/dist/cli/hosts.mjs +127 -0
  338. package/dist/cli/node.mjs +15 -0
  339. package/dist/cli/output.mjs +135 -0
  340. package/dist/cli/prompt.mjs +35 -0
  341. package/dist/cli/queue.mjs +215 -0
  342. package/dist/cli/ref0-git.d.mts +1 -0
  343. package/dist/cli/ref0-git.mjs +144 -0
  344. package/dist/cli/repos.mjs +162 -0
  345. package/dist/cli/resources.mjs +131 -0
  346. package/dist/cli/run-end.mjs +57 -0
  347. package/dist/cli/runtime.mjs +50 -0
  348. package/dist/cli/setup.mjs +1410 -0
  349. package/dist/cli/sign-in.mjs +162 -0
  350. package/dist/cli/sign-ins.mjs +79 -0
  351. package/dist/cli/sqlite.mjs +28 -0
  352. package/dist/cli/tokens.mjs +141 -0
  353. package/dist/cli/vendor.mjs +123 -0
  354. package/dist/init/app.mjs +231 -0
  355. package/dist/init/astro.mjs +49 -0
  356. package/dist/init/choices.mjs +497 -0
  357. package/dist/init/cloudflare.mjs +324 -0
  358. package/dist/init/create.mjs +151 -0
  359. package/dist/init/detect.mjs +297 -0
  360. package/dist/init/files.mjs +75 -0
  361. package/dist/init/frameworks.mjs +248 -0
  362. package/dist/init/git-module.mjs +49 -0
  363. package/dist/init/github-routes.mjs +66 -0
  364. package/dist/init/jsonc.mjs +143 -0
  365. package/dist/init/metadata.mjs +48 -0
  366. package/dist/init/mounts.mjs +109 -0
  367. package/dist/init/next.mjs +205 -0
  368. package/dist/init/node-app.mjs +189 -0
  369. package/dist/init/node.mjs +458 -0
  370. package/dist/init/nuxt.mjs +115 -0
  371. package/dist/init/output.mjs +21 -0
  372. package/dist/init/plan.mjs +82 -0
  373. package/dist/init/range-major.mjs +257 -0
  374. package/dist/init/react-router.mjs +59 -0
  375. package/dist/init/routes.mjs +148 -0
  376. package/dist/init/shell.mjs +4 -0
  377. package/dist/init/stores.mjs +51 -0
  378. package/dist/init/sveltekit.mjs +139 -0
  379. package/dist/init/template.mjs +142 -0
  380. package/dist/init/templates.mjs +343 -0
  381. package/dist/init/vercel.mjs +383 -0
  382. package/dist/init/versions.mjs +32 -0
  383. package/dist/init/workspace.mjs +20 -0
  384. package/package.json +48 -6
  385. package/README.md +0 -5
@@ -0,0 +1,15 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { CommitChecks } from '../../../../../pulls/pull-page.tsx';
4
+ import { usePull } from './route.tsx';
5
+
6
+ export const Route = createFileRoute('/$owner/$repo/pull/$number/checks')({
7
+ component: Checks,
8
+ });
9
+
10
+ function Checks() {
11
+ const { place, pull } = usePull();
12
+ if (pull === null) return null;
13
+
14
+ return <CommitChecks place={place} sha={pull.head.sha} />;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { PullCommits } from '../../../../../pulls/pull-page.tsx';
4
+ import { usePull } from './route.tsx';
5
+
6
+ export const Route = createFileRoute('/$owner/$repo/pull/$number/commits')({
7
+ component: Commits,
8
+ });
9
+
10
+ function Commits() {
11
+ const { place, pull } = usePull();
12
+ if (pull === null) return null;
13
+
14
+ return <PullCommits place={place} pull={pull} />;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { PullFiles } from '../../../../../pulls/files-tab.tsx';
4
+ import { usePull } from './route.tsx';
5
+
6
+ export const Route = createFileRoute('/$owner/$repo/pull/$number/files')({
7
+ component: Files,
8
+ });
9
+
10
+ function Files() {
11
+ const { place, pull } = usePull();
12
+ if (pull === null) return null;
13
+
14
+ return <PullFiles place={place} pull={pull} />;
15
+ }
@@ -0,0 +1,19 @@
1
+ import { createFileRoute, getRouteApi } from '@tanstack/react-router';
2
+
3
+ import { PullConversation } from '../../../../../pulls/pull-page.tsx';
4
+ import { usePull } from './route.tsx';
5
+
6
+ /** The repo's layout, whose loader read the repo. */
7
+ const repoLayout = getRouteApi('/$owner/$repo');
8
+
9
+ export const Route = createFileRoute('/$owner/$repo/pull/$number/')({
10
+ component: Conversation,
11
+ });
12
+
13
+ function Conversation() {
14
+ const { repo } = repoLayout.useLoaderData();
15
+ const { place, pull } = usePull();
16
+ if (pull === null) return null;
17
+
18
+ return <PullConversation place={place} repo={repo} pull={pull} />;
19
+ }
@@ -0,0 +1,52 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { createFileRoute, getRouteApi, notFound, Outlet } from '@tanstack/react-router';
3
+
4
+ import { cached } from '../../../../../clients/cached.ts';
5
+ import { CodeNotFound } from '../../../../../code/code-page.tsx';
6
+ import { LoadFailed } from '../../../../../components/states/states.tsx';
7
+ import { PullHeader } from '../../../../../pulls/pull-page.tsx';
8
+ import { pullAt } from '../../../../../pulls/pull.ts';
9
+
10
+ /** A pull request's number as its URL writes it: digits, from 1. */
11
+ const numberOf = (text: string) => (/^[1-9]\d{0,9}$/.test(text) ? Number(text) : undefined);
12
+
13
+ export const Route = createFileRoute('/$owner/$repo/pull/$number')({
14
+ loader: async ({ params, context }) => {
15
+ const number = numberOf(params.number);
16
+ if (number === undefined) throw notFound();
17
+
18
+ const pull = await cached(context.queryClient, pullAt(params, number));
19
+ if (pull === null) throw notFound();
20
+
21
+ return { number };
22
+ },
23
+ component: PullLayout,
24
+ notFoundComponent: CodeNotFound,
25
+ errorComponent: ({ error }) => (
26
+ <LoadFailed message={error instanceof Error ? error.message : "The pull request didn't load"} />
27
+ ),
28
+ });
29
+
30
+ const layout = getRouteApi('/$owner/$repo/pull/$number');
31
+
32
+ /** The pull request a tab shows, from the query its layout's loader filled. */
33
+ export const usePull = () => {
34
+ const { number } = layout.useLoaderData();
35
+ const { owner, repo } = layout.useParams();
36
+ const place = { owner, repo };
37
+
38
+ return { place, pull: useQuery(pullAt(place, number)).data ?? null };
39
+ };
40
+
41
+ /** A pull request's header and tabs, over the tab its path names. */
42
+ function PullLayout() {
43
+ const { place, pull } = usePull();
44
+ if (pull === null) return null;
45
+
46
+ return (
47
+ <div className="flex flex-col gap-section">
48
+ <PullHeader place={place} pull={pull} />
49
+ <Outlet />
50
+ </div>
51
+ );
52
+ }
@@ -0,0 +1,48 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+ import { flow } from 'effect/Function';
3
+ import * as Option from 'effect/Option';
4
+ import * as Schema from 'effect/Schema';
5
+
6
+ import { cached, readPagesAhead } from '../../../../clients/cached.ts';
7
+ import { LoadFailed } from '../../../../components/states/states.tsx';
8
+ import { vocabularyOf } from '../../../../issues/issues.ts';
9
+ import { PullList } from '../../../../pulls/pull-list.tsx';
10
+ import { pullList } from '../../../../pulls/pulls.ts';
11
+ import { asViewer, defaultPullQuery, pullFilterOf } from '../../../../pulls/search.ts';
12
+
13
+ /** The search box's text, as the list's URL carries it in `q`. */
14
+ const PullSearch = Schema.Struct({ q: Schema.optional(Schema.String) });
15
+
16
+ /** The list's URL query, read: one it can't read is the default's. */
17
+ const searchOf = flow(
18
+ Schema.decodeUnknownOption(PullSearch),
19
+ Option.getOrElse((): typeof PullSearch.Type => ({})),
20
+ );
21
+
22
+ export const Route = createFileRoute('/$owner/$repo/pulls/')({
23
+ validateSearch: searchOf,
24
+ loaderDeps: ({ search }) => ({ q: search.q ?? defaultPullQuery }),
25
+ loader: async ({ params, context, deps }) => {
26
+ const client = context.queryClient;
27
+ const vocabulary = await cached(client, vocabularyOf(params));
28
+ const filter = asViewer(pullFilterOf(deps.q), context.viewer?.login);
29
+ await readPagesAhead(client, pullList(params, filter, vocabulary));
30
+
31
+ return { q: deps.q };
32
+ },
33
+ component: PullsPage,
34
+ errorComponent: ({ error }) => (
35
+ <LoadFailed
36
+ message={error instanceof Error ? error.message : "The pull requests didn't load"}
37
+ />
38
+ ),
39
+ });
40
+
41
+ /** The repo's pull requests, under the search box's filter. */
42
+ function PullsPage() {
43
+ const { q } = Route.useLoaderData();
44
+ const params = Route.useParams();
45
+ const { viewer } = Route.useRouteContext();
46
+
47
+ return <PullList place={params} query={q} viewer={viewer?.login} />;
48
+ }
@@ -0,0 +1,22 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { readPagesAhead } from '../../../clients/cached.ts';
4
+ import { LoadFailed } from '../../../components/states/states.tsx';
5
+ import { QueuePage } from '../../../queue/queue-page.tsx';
6
+ import { queueEntries } from '../../../queue/queue.ts';
7
+
8
+ export const Route = createFileRoute('/$owner/$repo/queue')({
9
+ // Its page draws its own heading, so the shell draws none.
10
+ staticData: { ownHeading: true },
11
+ loader: ({ params, context }) => readPagesAhead(context.queryClient, queueEntries(params)),
12
+ head: ({ params }) => ({ meta: [{ title: `Merge queue · ${params.owner}/${params.repo}` }] }),
13
+ component: QueueRoute,
14
+ errorComponent: ({ error }) => (
15
+ <LoadFailed message={error instanceof Error ? error.message : "The merge queue didn't load"} />
16
+ ),
17
+ });
18
+
19
+ /** The repo's merge queue. */
20
+ function QueueRoute() {
21
+ return <QueuePage place={Route.useParams()} />;
22
+ }
@@ -0,0 +1,58 @@
1
+ import { createFileRoute, getRouteApi, notFound, useRouteContext } from '@tanstack/react-router';
2
+
3
+ import { cached, readPagesAhead } from '../../../../../clients/cached.ts';
4
+ import { CodeNotFound } from '../../../../../code/code-page.tsx';
5
+ import { releaseEditHref } from '../../../../../code/places.ts';
6
+ import { RouteDialog } from '../../../../../components/route-dialog.tsx';
7
+ import { LoadFailed, SignedOut } from '../../../../../components/states/states.tsx';
8
+ import { ReleaseForm } from '../../../../../releases/release-form.tsx';
9
+ import { ReleaseList } from '../../../../../releases/release-list.tsx';
10
+ import { releaseAt, releaseList } from '../../../../../releases/releases.ts';
11
+
12
+ /** The repo's layout, whose loader read the repo. */
13
+ const layout = getRouteApi('/$owner/$repo');
14
+
15
+ export const Route = createFileRoute('/$owner/$repo/releases/edit/$')({
16
+ loader: async ({ params, context }) => {
17
+ const release = await cached(context.queryClient, releaseAt(params, params._splat ?? ''));
18
+ if (release === null) throw notFound();
19
+
20
+ await readPagesAhead(context.queryClient, releaseList(params));
21
+
22
+ return { release };
23
+ },
24
+ component: EditReleasePage,
25
+ notFoundComponent: CodeNotFound,
26
+ errorComponent: ({ error }) => (
27
+ <LoadFailed message={error instanceof Error ? error.message : "The release didn't load"} />
28
+ ),
29
+ });
30
+
31
+ /**
32
+ * A release's edit form, for someone signed in, as it was when the page loaded, in a dialog over
33
+ * the repo's releases.
34
+ */
35
+ function EditReleasePage() {
36
+ const params = Route.useParams();
37
+ const { release } = Route.useLoaderData();
38
+ const { repo } = layout.useLoaderData();
39
+ const { viewer } = useRouteContext({ from: '__root__' });
40
+
41
+ // The way back is the release's edit page, so a tag holding `#` or `?` stays in its path.
42
+ if (viewer === null) {
43
+ return <SignedOut returnTo={releaseEditHref(params, params._splat ?? '')} what="this form" />;
44
+ }
45
+
46
+ return (
47
+ <>
48
+ <ReleaseList place={params} />
49
+ <RouteDialog
50
+ title={`Edit ${release.name}`}
51
+ closeTo={`/${params.owner}/${params.repo}/releases`}
52
+ wide
53
+ >
54
+ <ReleaseForm place={params} target={repo.defaultBranch} release={release} />
55
+ </RouteDialog>
56
+ </>
57
+ );
58
+ }
@@ -0,0 +1,40 @@
1
+ import { readPagesAhead } from '../../../../clients/cached.ts';
2
+
3
+ import { createFileRoute, getRouteApi, useRouteContext } from '@tanstack/react-router';
4
+
5
+ import { RouteDialog } from '../../../../components/route-dialog.tsx';
6
+ import { SignedOut } from '../../../../components/states/states.tsx';
7
+ import { ReleaseForm } from '../../../../releases/release-form.tsx';
8
+ import { ReleaseList } from '../../../../releases/release-list.tsx';
9
+ import { releaseList } from '../../../../releases/releases.ts';
10
+
11
+ /** The repo's layout, whose loader read the repo. */
12
+ const layout = getRouteApi('/$owner/$repo');
13
+
14
+ export const Route = createFileRoute('/$owner/$repo/releases/new')({
15
+ loader: ({ params, context }) => readPagesAhead(context.queryClient, releaseList(params)),
16
+ component: NewReleasePage,
17
+ });
18
+
19
+ /**
20
+ * A new release's form, for someone signed in, in a dialog over the repo's releases: a new tag is
21
+ * made from the default branch.
22
+ */
23
+ function NewReleasePage() {
24
+ const params = Route.useParams();
25
+ const { repo } = layout.useLoaderData();
26
+ const { viewer } = useRouteContext({ from: '__root__' });
27
+
28
+ if (viewer === null) {
29
+ return <SignedOut returnTo={`/${params.owner}/${params.repo}/releases/new`} what="this form" />;
30
+ }
31
+
32
+ return (
33
+ <>
34
+ <ReleaseList place={params} />
35
+ <RouteDialog title="New release" closeTo={`/${params.owner}/${params.repo}/releases`} wide>
36
+ <ReleaseForm place={params} target={repo.defaultBranch} />
37
+ </RouteDialog>
38
+ </>
39
+ );
40
+ }
@@ -0,0 +1,35 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { createFileRoute, notFound } from '@tanstack/react-router';
3
+
4
+ import { cached } from '../../../../../clients/cached.ts';
5
+ import { CodeNotFound } from '../../../../../code/code-page.tsx';
6
+ import { LoadFailed } from '../../../../../components/states/states.tsx';
7
+ import { ReleasePage } from '../../../../../releases/release-list.tsx';
8
+ import { releaseAt } from '../../../../../releases/releases.ts';
9
+
10
+ export const Route = createFileRoute('/$owner/$repo/releases/tag/$')({
11
+ // Its page draws its own heading, so the shell draws none.
12
+ staticData: { ownHeading: true },
13
+ loader: async ({ params, context }) => {
14
+ const tag = params._splat ?? '';
15
+ const release = await cached(context.queryClient, releaseAt(params, tag));
16
+ if (release === null) throw notFound();
17
+
18
+ return { tag };
19
+ },
20
+ component: Release,
21
+ notFoundComponent: CodeNotFound,
22
+ errorComponent: ({ error }) => (
23
+ <LoadFailed message={error instanceof Error ? error.message : "The release didn't load"} />
24
+ ),
25
+ });
26
+
27
+ /** A release's page, redrawn from its query as each change lands. */
28
+ function Release() {
29
+ const { tag } = Route.useLoaderData();
30
+ const params = Route.useParams();
31
+ const release = useQuery(releaseAt(params, tag)).data;
32
+ if (release === undefined || release === null) return null;
33
+
34
+ return <ReleasePage place={params} release={release} />;
35
+ }
@@ -0,0 +1,102 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { createFileRoute, notFound, Outlet } from '@tanstack/react-router';
3
+ import { LockIcon } from 'lucide-react';
4
+
5
+ import { cached, readAhead } from '../../../clients/cached.ts';
6
+ import { OwnerCard } from '../../../components/owner-card.tsx';
7
+ import { CodeNotFound } from '../../../code/code-page.tsx';
8
+ import { Go } from '../../../code/controls.tsx';
9
+ import { repoAt } from '../../../code/repo.ts';
10
+ import { RepoIcon } from '../../../components/repos/repo-icon.tsx';
11
+ import { LoadFailed } from '../../../components/states/states.tsx';
12
+ import { Badge } from '../../../components/ui/badge.tsx';
13
+ import { allowedHere } from '../../../hooks/allowed.ts';
14
+ import { WatchMenu } from '../../../inbox/subscription-controls.tsx';
15
+ import { ownerAt } from '../../../hooks/repos.ts';
16
+ import { ownerProblem } from '../../../names/owners.ts';
17
+ import { repoProblem } from '../../../names/repos.ts';
18
+
19
+ export const Route = createFileRoute('/$owner/$repo')({
20
+ loader: async ({ params, context }) => {
21
+ // One of the app's own pages is no one's repository, whatever the host says.
22
+ if (ownerProblem(params.owner) !== undefined || repoProblem(params.repo) !== undefined)
23
+ throw notFound();
24
+
25
+ // What the viewer may do here, and its owner, read beside the repo, so the server draws the
26
+ // sections and controls it allows, such as Settings, and the owner as an org or a person,
27
+ // rather than the browser adding them once it asks.
28
+ const [repo] = await Promise.all([
29
+ cached(context.queryClient, repoAt(params)),
30
+ readAhead(context.queryClient, allowedHere(params)),
31
+ readAhead(context.queryClient, ownerAt(params.owner, context.viewer?.login)),
32
+ ]);
33
+
34
+ // A repo the viewer can't read gives exactly the page a missing one gives, with nothing of
35
+ // what they may do there in the page's data.
36
+ if (repo === null) {
37
+ context.queryClient.removeQueries({ queryKey: allowedHere(params).queryKey });
38
+ throw notFound();
39
+ }
40
+
41
+ return { repo };
42
+ },
43
+ head: ({ params }) => ({ meta: [{ title: `${params.owner}/${params.repo}` }] }),
44
+ component: RepoLayout,
45
+ notFoundComponent: RepoNotFound,
46
+ errorComponent: ({ error }) => (
47
+ <LoadFailed message={error instanceof Error ? error.message : "The repository didn't load"} />
48
+ ),
49
+ });
50
+
51
+ /**
52
+ * A repository's pages under its name: the code pages, the issues', the pull requests' and the
53
+ * releases'. A private repository's pages read only for those it's shared with.
54
+ */
55
+ function RepoLayout() {
56
+ const { repo } = Route.useLoaderData();
57
+ const { viewer } = Route.useRouteContext();
58
+ // The owner, as the loader read it beside the repo, so its card reads an org's profile at once.
59
+ const owner = useQuery(ownerAt(repo.owner, viewer?.login)).data;
60
+
61
+ return (
62
+ <>
63
+ {/* The top bar's crumbs lead to the repository; its header names it, as a repo's identity
64
+ rather than the page's heading, and who reads it, with what it is on a line under. */}
65
+ <header className="flex flex-col gap-1">
66
+ <div className="flex flex-wrap items-center gap-x-3 gap-y-2">
67
+ <p className="flex min-w-0 items-center gap-1.5 text-lg wrap-anywhere">
68
+ <RepoIcon owner={repo.owner} repo={repo.name} />
69
+ <OwnerCard login={repo.owner} account={owner?.kind === 'org' ? 'org' : 'user'}>
70
+ {repo.owner}
71
+ </OwnerCard>
72
+ <span aria-hidden className="text-muted-foreground">
73
+ /
74
+ </span>
75
+ <Go href={`/${repo.owner}/${repo.name}`} className="font-semibold hover:underline">
76
+ {repo.name}
77
+ </Go>
78
+ </p>
79
+ <Badge variant="outline">
80
+ {repo.private && <LockIcon data-icon="inline-start" />}
81
+ {repo.private ? 'Private' : 'Public'}
82
+ </Badge>
83
+ <div className="ml-auto">
84
+ <WatchMenu place={{ owner: repo.owner, repo: repo.name }} />
85
+ </div>
86
+ </div>
87
+ {repo.description !== null && repo.description !== '' && (
88
+ <p className="min-w-0 text-sm wrap-anywhere text-muted-foreground">{repo.description}</p>
89
+ )}
90
+ </header>
91
+ <Outlet />
92
+ </>
93
+ );
94
+ }
95
+
96
+ /**
97
+ * Not found at a repository's name: the top bar names only what the URL says, so a private one
98
+ * the viewer can't read gives exactly the page a missing one gives.
99
+ */
100
+ function RepoNotFound() {
101
+ return <CodeNotFound />;
102
+ }
@@ -0,0 +1,9 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { AccessPage } from '../../../../settings/settings-layout.tsx';
4
+
5
+ export const Route = createFileRoute('/$owner/$repo/settings/access')({ component: Access });
6
+
7
+ function Access() {
8
+ return <AccessPage place={Route.useParams()} />;
9
+ }
@@ -0,0 +1,16 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { readAhead } from '../../../../../clients/cached.ts';
4
+ import { HookList } from '../../../../../settings/hook-list.tsx';
5
+ import { hookList } from '../../../../../settings/hooks.ts';
6
+
7
+ export const Route = createFileRoute('/$owner/$repo/settings/hooks/')({
8
+ // The webhooks, read before the page draws, as its layout reads what the viewer may do.
9
+ loader: ({ params, context }) =>
10
+ context.viewer === null ? undefined : readAhead(context.queryClient, hookList(params)),
11
+ component: Hooks,
12
+ });
13
+
14
+ function Hooks() {
15
+ return <HookList place={Route.useParams()} />;
16
+ }
@@ -0,0 +1,25 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { RouteDialog } from '../../../../../components/route-dialog.tsx';
4
+ import { HookForm } from '../../../../../settings/hook-form.tsx';
5
+ import { HookList } from '../../../../../settings/hook-list.tsx';
6
+
7
+ export const Route = createFileRoute('/$owner/$repo/settings/hooks/new')({ component: NewHook });
8
+
9
+ /** A new webhook's form, in a dialog over the repo's webhooks. */
10
+ function NewHook() {
11
+ const place = Route.useParams();
12
+
13
+ return (
14
+ <>
15
+ <HookList place={place} />
16
+ <RouteDialog
17
+ title="Add webhook"
18
+ description="Each event you pick reaches this URL as a POST."
19
+ closeTo={`/${place.owner}/${place.repo}/settings/hooks`}
20
+ >
21
+ <HookForm place={place} />
22
+ </RouteDialog>
23
+ </>
24
+ );
25
+ }
@@ -0,0 +1,17 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { readAhead } from '../../../../clients/cached.ts';
4
+ import { generalSettings } from '../../../../settings/general.ts';
5
+ import { GeneralSettings } from '../../../../settings/general-settings.tsx';
6
+
7
+ export const Route = createFileRoute('/$owner/$repo/settings/')({
8
+ // The settings, read before the page draws, as its layout reads what the viewer may do.
9
+ loader: ({ params, context }) =>
10
+ context.viewer === null ? undefined : readAhead(context.queryClient, generalSettings(params)),
11
+ component: General,
12
+ });
13
+
14
+ /** The settings' first page: the repo's General settings, as GitHub's. */
15
+ function General() {
16
+ return <GeneralSettings place={Route.useParams()} />;
17
+ }
@@ -0,0 +1,28 @@
1
+ import { createFileRoute, Outlet, useLocation, useRouteContext } from '@tanstack/react-router';
2
+
3
+ import { SignedOut } from '../../../../components/states/states.tsx';
4
+ import { SettingsLayout } from '../../../../settings/settings-layout.tsx';
5
+
6
+ export const Route = createFileRoute('/$owner/$repo/settings')({ component: Settings });
7
+
8
+ /** A repo's settings, for someone signed in whom the drop-in lets change them. */
9
+ function Settings() {
10
+ const params = Route.useParams();
11
+ const { viewer } = useRouteContext({ from: '__root__' });
12
+ const current = useLocation().pathname.split('/')[4] ?? '';
13
+
14
+ if (viewer === null) {
15
+ return (
16
+ <SignedOut
17
+ returnTo={`/${params.owner}/${params.repo}/settings`}
18
+ what="this repository's settings"
19
+ />
20
+ );
21
+ }
22
+
23
+ return (
24
+ <SettingsLayout place={params} current={current}>
25
+ <Outlet />
26
+ </SettingsLayout>
27
+ );
28
+ }
@@ -0,0 +1,12 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { readAhead } from '../../../../clients/cached.ts';
4
+ import { RuleList } from '../../../../settings/rule-list.tsx';
5
+ import { ruleList } from '../../../../settings/rules.ts';
6
+
7
+ export const Route = createFileRoute('/$owner/$repo/settings/rules')({
8
+ // The host's rules, read before the page draws, as its layout reads what the viewer may do.
9
+ loader: ({ context }) =>
10
+ context.viewer === null ? undefined : readAhead(context.queryClient, ruleList),
11
+ component: RuleList,
12
+ });
@@ -0,0 +1,16 @@
1
+ import { createFileRoute, useRouteContext } from '@tanstack/react-router';
2
+
3
+ import { SignedOut } from '../../../components/states/states.tsx';
4
+ import { TokensPage } from '../../../tokens/tokens-page.tsx';
5
+
6
+ export const Route = createFileRoute('/$owner/$repo/tokens')({ component: Tokens });
7
+
8
+ /** The signed-in person's tokens that reach the repo. */
9
+ function Tokens() {
10
+ const { owner, repo } = Route.useParams();
11
+ const { viewer } = useRouteContext({ from: '__root__' });
12
+ if (viewer === null)
13
+ return <SignedOut returnTo={`/${owner}/${repo}/tokens`} what="your tokens" />;
14
+
15
+ return <TokensPage login={viewer.login} within={{ owner, repo }} />;
16
+ }
@@ -0,0 +1,45 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+
3
+ import { RepoList } from '../../components/repos/repo-list.tsx';
4
+ import { LoadFailed, ReadOnly, SignedOut } from '../../components/states/states.tsx';
5
+ import { filterOf, ownerLoader, ownerLoaderDeps, readSearch, searchOf } from '../../hooks/repos.ts';
6
+
7
+ export const Route = createFileRoute('/$owner/')({
8
+ validateSearch: (query) => searchOf(filterOf(readSearch(query))),
9
+ loaderDeps: ownerLoaderDeps,
10
+ loader: ownerLoader,
11
+ component: OwnerPage,
12
+ errorComponent: ({ error }) => (
13
+ <LoadFailed message={error instanceof Error ? error.message : "The owner didn't load"} />
14
+ ),
15
+ });
16
+
17
+ /**
18
+ * An owner's repositories: the viewer's, an org's or a person's. The viewer makes repositories in
19
+ * their own and their orgs', and reads anyone else's. A visitor signs in first: Git lists repos
20
+ * only for someone signed in, since a list would show private names.
21
+ */
22
+ function OwnerPage() {
23
+ const { owner, member } = Route.useLoaderData();
24
+ const { viewer } = Route.useRouteContext();
25
+ const navigate = Route.useNavigate();
26
+ const filter = filterOf(Route.useSearch());
27
+
28
+ if (viewer === null) {
29
+ return <SignedOut returnTo={`/${owner.login}`} what={`${owner.login}'s repositories`} />;
30
+ }
31
+
32
+ const owns = owner.kind === 'viewer' || (owner.kind === 'org' && member);
33
+
34
+ return (
35
+ <>
36
+ {!owns && <ReadOnly owner={owner.login} />}
37
+ <RepoList
38
+ owner={owner}
39
+ owns={owns}
40
+ filter={filter}
41
+ onFilter={(next) => void navigate({ search: searchOf(next), replace: true })}
42
+ />
43
+ </>
44
+ );
45
+ }