ref0-git 0.0.0 → 0.3.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 +127 -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 +562 -0
  197. package/app/apps/github/src/palette/recent.ts +116 -0
  198. package/app/apps/github/src/palette/rows.tsx +487 -0
  199. package/app/apps/github/src/palette/server.ts +107 -0
  200. package/app/apps/github/src/palette/targets.ts +306 -0
  201. package/app/apps/github/src/policy.ts +606 -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 +528 -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 +69 -0
  336. package/dist/cli/helpers.mjs +184 -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 +136 -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 +80 -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 +203 -0
  368. package/dist/init/node-app.mjs +189 -0
  369. package/dist/init/node.mjs +460 -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 +384 -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,34 @@
1
+ import {
2
+ GitMergeIcon,
3
+ GitPullRequestClosedIcon,
4
+ GitPullRequestDraftIcon,
5
+ GitPullRequestIcon,
6
+ } from 'lucide-react';
7
+
8
+ import { fills, tones } from './tones.ts';
9
+
10
+ /** Where a pull request stands, as its icon and its badge say. */
11
+ export type PullStatus = 'open' | 'draft' | 'merged' | 'closed';
12
+
13
+ /** Each status's icon, its name, and its colours, as an icon and as a fill, as GitHub's tell them apart. */
14
+ export const pullStatuses: Readonly<
15
+ Record<
16
+ PullStatus,
17
+ {
18
+ readonly Icon: typeof GitPullRequestIcon;
19
+ readonly name: string;
20
+ readonly tone: string;
21
+ readonly fill: string;
22
+ }
23
+ >
24
+ > = {
25
+ open: { Icon: GitPullRequestIcon, name: 'Open', tone: tones.open, fill: fills.open },
26
+ draft: { Icon: GitPullRequestDraftIcon, name: 'Draft', tone: tones.draft, fill: fills.draft },
27
+ merged: { Icon: GitMergeIcon, name: 'Merged', tone: tones.merged, fill: fills.merged },
28
+ closed: {
29
+ Icon: GitPullRequestClosedIcon,
30
+ name: 'Closed',
31
+ tone: tones.unmerged,
32
+ fill: fills.unmerged,
33
+ },
34
+ };
@@ -0,0 +1,41 @@
1
+ /** The values a page last used, by key, up to `most` of them. */
2
+ export interface Recent<V> {
3
+ /** The value kept for `key`, which becomes the newest, or undefined for none. */
4
+ readonly get: (key: string) => V | undefined;
5
+ /** Keeps `value` for `key` as the newest, and drops the oldest once past `most`. */
6
+ readonly set: (key: string, value: V) => void;
7
+ /** How many it keeps now. */
8
+ readonly size: () => number;
9
+ }
10
+
11
+ /**
12
+ * At most `most` values, by key, the least recently used dropped first, so a long session's
13
+ * values stay bounded. A `Map` iterates in the order its keys were set, so its first key is the
14
+ * oldest, and a read sets its key again to make it the newest.
15
+ */
16
+ export const recentOf = <V>(most: number): Recent<V> => {
17
+ const kept = new Map<string, V>();
18
+
19
+ return {
20
+ get: (key) => {
21
+ const value = kept.get(key);
22
+ if (value === undefined) return undefined;
23
+
24
+ kept.delete(key);
25
+ kept.set(key, value);
26
+
27
+ return value;
28
+ },
29
+ set: (key, value) => {
30
+ kept.delete(key);
31
+ kept.set(key, value);
32
+
33
+ for (const oldest of kept.keys()) {
34
+ if (kept.size <= most) break;
35
+
36
+ kept.delete(oldest);
37
+ }
38
+ },
39
+ size: () => kept.size,
40
+ };
41
+ };
@@ -0,0 +1,78 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip.tsx';
4
+
5
+ /** The same date on the server and in every browser, whatever their zone. */
6
+ const day = new Intl.DateTimeFormat('en', { dateStyle: 'medium', timeZone: 'UTC' });
7
+
8
+ /**
9
+ * The full moment in UTC, which its words say, for its name and tooltip. It's the same on the
10
+ * server, while hydrating and after, as the app's other dates are.
11
+ */
12
+ const moment = new Intl.DateTimeFormat('en', {
13
+ dateStyle: 'medium',
14
+ timeStyle: 'long',
15
+ timeZone: 'UTC',
16
+ });
17
+
18
+ const relative = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
19
+
20
+ const minute = 60_000;
21
+
22
+ const hour = 60 * minute;
23
+
24
+ const days = 24 * hour;
25
+
26
+ /**
27
+ * When `at` was, as GitHub words it beside `now`: "just now", "5 minutes ago", "3 hours ago" or
28
+ * "yesterday" within 30 days, and "on Nov 20, 2026" before that, or for a time ahead of `now`.
29
+ */
30
+ export const relativeTo = (at: Date, now: number): string => {
31
+ const ago = now - at.getTime();
32
+ if (ago < -minute || ago >= 30 * days) return `on ${day.format(at)}`;
33
+
34
+ if (ago < minute) return 'just now';
35
+
36
+ if (ago < hour) return relative.format(-Math.floor(ago / minute), 'minute');
37
+
38
+ if (ago < days) return relative.format(-Math.floor(ago / hour), 'hour');
39
+
40
+ return relative.format(-Math.floor(ago / days), 'day');
41
+ };
42
+
43
+ /** The clock, once a minute in the browser. `undefined` on the server and while hydrating. */
44
+ const useNow = () => {
45
+ const [now, setNow] = useState<number>();
46
+
47
+ useEffect(() => {
48
+ setNow(Date.now());
49
+ const tick = setInterval(() => setNow(Date.now()), minute);
50
+
51
+ return () => clearInterval(tick);
52
+ }, []);
53
+
54
+ return now;
55
+ };
56
+
57
+ /**
58
+ * When something happened, worded like GitHub's "3 hours ago". Its name for a screen reader is the
59
+ * full moment, which a pointer's tooltip shows too. It isn't a tab stop, since it isn't a control
60
+ * and a list of them would add a stop for each row. The server and the first paint say
61
+ * "on Nov 20, 2026", so hydration matches, and the browser words it by its own clock after that.
62
+ * The moment is in UTC throughout.
63
+ */
64
+ export function RelativeTime({ at }: { readonly at: string | Date }) {
65
+ const now = useNow();
66
+ const date = new Date(at);
67
+ const label = now === undefined ? `on ${day.format(date)}` : relativeTo(date, now);
68
+ const full = moment.format(date);
69
+
70
+ return (
71
+ <Tooltip>
72
+ <TooltipTrigger render={<time dateTime={date.toISOString()} aria-label={full} />}>
73
+ {label}
74
+ </TooltipTrigger>
75
+ <TooltipContent>{full}</TooltipContent>
76
+ </Tooltip>
77
+ );
78
+ }
@@ -0,0 +1,91 @@
1
+ import { queryOptions, type QueryClient } from '@tanstack/react-query';
2
+ import * as Schema from 'effect/Schema';
3
+
4
+ /**
5
+ * Repo icons' hashes, as `GET /icons?repos=` answers them for the repos a page shows: every
6
+ * `RepoIcon` drawn in one task asks one request between them, so a list of 30 repos is one read,
7
+ * not 30 images that may 404.
8
+ */
9
+
10
+ /** The repo an icon is of, by its owner and name. */
11
+ export interface IconOf {
12
+ readonly owner: string;
13
+ readonly repo: string;
14
+ }
15
+
16
+ /** The most names the route takes at once, as `iconHashesMost` on the server. */
17
+ const namesMost = 100;
18
+
19
+ const Hashes = Schema.Record(Schema.String, Schema.NullOr(Schema.String));
20
+
21
+ const hashesOf = Schema.decodeUnknownSync(Hashes);
22
+
23
+ /** A name waiting for the next batch, with whoever asked for it. */
24
+ interface Waiting {
25
+ readonly name: string;
26
+ readonly askers: Array<{
27
+ readonly resolve: (hash: string | null) => void;
28
+ readonly reject: (error: Error) => void;
29
+ }>;
30
+ }
31
+
32
+ /** The names asked since the last batch went, by their name without case. */
33
+ let waiting = new Map<string, Waiting>();
34
+
35
+ /** Asks one batch's names, and settles each asker with its hash, or the batch's failure. */
36
+ const ask = async (batch: readonly Waiting[]) => {
37
+ const settle = (each: (waiting: Waiting) => void) => batch.forEach(each);
38
+
39
+ try {
40
+ const repos = batch.map((each) => each.name).join(',');
41
+ const answer = await fetch(`/icons?repos=${encodeURIComponent(repos)}`);
42
+ if (!answer.ok) throw new Error(`The repos' icons didn't load: ${answer.status}`);
43
+
44
+ const hashes = Object.entries(hashesOf(await answer.json()));
45
+ const byName = new Map(hashes.map(([name, hash]) => [name.toLowerCase(), hash]));
46
+
47
+ settle((each) => {
48
+ const hash = byName.get(each.name.toLowerCase()) ?? null;
49
+ each.askers.forEach((asker) => asker.resolve(hash));
50
+ });
51
+ } catch (error) {
52
+ const failed = error instanceof Error ? error : new Error("The repos' icons didn't load");
53
+ settle((each) => each.askers.forEach((asker) => asker.reject(failed)));
54
+ }
55
+ };
56
+
57
+ /** Sends what's waiting, `namesMost` names a request. */
58
+ const send = () => {
59
+ const batch = [...waiting.values()];
60
+ waiting = new Map();
61
+
62
+ for (let at = 0; at < batch.length; at += namesMost) void ask(batch.slice(at, at + namesMost));
63
+ };
64
+
65
+ /** `place`'s icon hash, asked with every other one asked in the same task. */
66
+ const batched = (place: IconOf) =>
67
+ new Promise<string | null>((resolve, reject) => {
68
+ const name = `${place.owner}/${place.repo}`;
69
+ const key = name.toLowerCase();
70
+ if (waiting.size === 0) setTimeout(send, 0);
71
+
72
+ const held = waiting.get(key) ?? { name, askers: [] };
73
+ held.askers.push({ resolve, reject });
74
+ waiting.set(key, held);
75
+ });
76
+
77
+ /**
78
+ * A repo's icon hash, or `null` while it has none: read with the page's other repos', kept five
79
+ * minutes, and set at once by the page that uploads or removes it.
80
+ */
81
+ export const iconHashAt = (place: IconOf) =>
82
+ queryOptions({
83
+ queryKey: ['repo-icon', place.owner.toLowerCase(), place.repo.toLowerCase()],
84
+ queryFn: () => batched(place),
85
+ staleTime: 5 * 60_000,
86
+ retry: false,
87
+ });
88
+
89
+ /** Every `RepoIcon` of `place` on the page shows `hash`: an upload's, or `null` once removed. */
90
+ export const setIconHash = (queries: QueryClient, place: IconOf, hash: string | null) =>
91
+ queries.setQueryData(iconHashAt(place).queryKey, hash);
@@ -0,0 +1,196 @@
1
+ import { useMutation } from '@tanstack/react-query';
2
+ import { useNavigate } from '@tanstack/react-router';
3
+ import * as Schema from 'effect/Schema';
4
+ import { type FormEvent, useState } from 'react';
5
+ import { toast } from 'sonner';
6
+
7
+ import { hostAnswer } from '../../clients/host-answer.ts';
8
+ import { ownerProblem } from '../../names/owners.ts';
9
+ import { repoProblem } from '../../names/repos.ts';
10
+ import { Alert, AlertDescription } from '../ui/alert.tsx';
11
+ import { Button } from '../ui/button.tsx';
12
+ import {
13
+ Field,
14
+ FieldContent,
15
+ FieldDescription,
16
+ FieldError,
17
+ FieldGroup,
18
+ FieldLabel,
19
+ FieldLegend,
20
+ FieldSet,
21
+ } from '../ui/field.tsx';
22
+ import { Input } from '../ui/input.tsx';
23
+ import { RadioGroup, RadioGroupItem } from '../ui/radio-group.tsx';
24
+ import {
25
+ Select,
26
+ SelectContent,
27
+ SelectGroup,
28
+ SelectItem,
29
+ SelectTrigger,
30
+ SelectValue,
31
+ } from '../ui/select.tsx';
32
+
33
+ /** What the form sends: whose repository, and what it's called and shows. */
34
+ export interface NewRepo {
35
+ readonly owner: string;
36
+ readonly name: string;
37
+ readonly description: string;
38
+ readonly private: boolean;
39
+ }
40
+
41
+ /** Why `repo` can't be made, field by field, before anything is sent. */
42
+ export const newRepoProblems = (repo: NewRepo) => ({
43
+ owner: ownerProblem(repo.owner),
44
+ name: repoProblem(repo.name),
45
+ });
46
+
47
+ /** The two visibilities, each with what it means for who reads the repository. */
48
+ const visibilities = [
49
+ ['public', 'Public', 'Anyone can read it. You choose who writes.'],
50
+ ['private', 'Private', 'Only you, and those you let in, can read it.'],
51
+ ] as const;
52
+
53
+ const MadeRepo = Schema.Struct({ full_name: Schema.String });
54
+
55
+ /**
56
+ * `repo`, made under the viewer's login or the org's: GitHub's two create routes, as the viewer
57
+ * through the host's sign-in, since no token reaches a repo's creation (#347). A refusal is in
58
+ * the drop-in's own words.
59
+ */
60
+ const create = (repo: NewRepo) =>
61
+ hostAnswer(
62
+ {
63
+ operation: 'repo.create',
64
+ owner: repo.owner,
65
+ name: repo.name,
66
+ description: repo.description,
67
+ private: repo.private,
68
+ },
69
+ MadeRepo,
70
+ );
71
+
72
+ /**
73
+ * `/new`'s form: an owner from the switcher's, a name, a description and a visibility. It starts
74
+ * under `start` when that's one of `owners`, or else under the viewer.
75
+ */
76
+ export function NewRepoForm({
77
+ viewer,
78
+ owners,
79
+ start,
80
+ }: {
81
+ readonly viewer: string;
82
+ readonly owners: readonly string[];
83
+ readonly start?: string | undefined;
84
+ }) {
85
+ const navigate = useNavigate();
86
+ const [repo, setRepo] = useState<NewRepo>({
87
+ owner: owners.find((owner) => owner.toLowerCase() === start?.toLowerCase()) ?? viewer,
88
+ name: '',
89
+ description: '',
90
+ private: false,
91
+ });
92
+ const [tried, setTried] = useState(false);
93
+ const made = useMutation({
94
+ mutationFn: () => create(repo),
95
+ onSuccess: async () => {
96
+ toast.success(`Created ${repo.owner}/${repo.name}`);
97
+ await navigate({ to: '/$owner', params: { owner: repo.owner } });
98
+ },
99
+ });
100
+ const problems = newRepoProblems(repo);
101
+
102
+ const submit = (event: FormEvent<HTMLFormElement>) => {
103
+ event.preventDefault();
104
+ setTried(true);
105
+
106
+ if (problems.owner !== undefined || problems.name !== undefined) return;
107
+
108
+ made.mutate();
109
+ };
110
+
111
+ return (
112
+ <form noValidate onSubmit={submit} className="flex flex-col gap-4">
113
+ <FieldGroup>
114
+ <Field data-invalid={tried && problems.owner !== undefined}>
115
+ <FieldLabel htmlFor="repo-owner" required>
116
+ Owner
117
+ </FieldLabel>
118
+ <Select
119
+ items={owners.map((owner) => ({ value: owner, label: owner }))}
120
+ value={repo.owner}
121
+ onValueChange={(owner: string | null) =>
122
+ setRepo({ ...repo, owner: owner ?? repo.owner })
123
+ }
124
+ >
125
+ <SelectTrigger
126
+ id="repo-owner"
127
+ aria-required
128
+ aria-invalid={tried && problems.owner !== undefined}
129
+ className="w-full sm:w-64"
130
+ >
131
+ <SelectValue />
132
+ </SelectTrigger>
133
+ <SelectContent>
134
+ <SelectGroup>
135
+ {owners.map((owner) => (
136
+ <SelectItem key={owner} value={owner}>
137
+ {owner}
138
+ </SelectItem>
139
+ ))}
140
+ </SelectGroup>
141
+ </SelectContent>
142
+ </Select>
143
+ {tried && <FieldError>{problems.owner}</FieldError>}
144
+ </Field>
145
+ <Field data-invalid={tried && problems.name !== undefined}>
146
+ <FieldLabel htmlFor="repo-name" required>
147
+ Repository name
148
+ </FieldLabel>
149
+ <Input
150
+ id="repo-name"
151
+ required
152
+ aria-invalid={tried && problems.name !== undefined}
153
+ value={repo.name}
154
+ onChange={(event) => setRepo({ ...repo, name: event.target.value })}
155
+ />
156
+ {tried && <FieldError>{problems.name}</FieldError>}
157
+ </Field>
158
+ <Field>
159
+ <FieldLabel htmlFor="repo-description">Description</FieldLabel>
160
+ <Input
161
+ id="repo-description"
162
+ value={repo.description}
163
+ onChange={(event) => setRepo({ ...repo, description: event.target.value })}
164
+ />
165
+ <FieldDescription>Optional.</FieldDescription>
166
+ </Field>
167
+ <FieldSet>
168
+ <FieldLegend variant="label">Visibility</FieldLegend>
169
+ <RadioGroup
170
+ aria-label="Visibility"
171
+ value={repo.private ? 'private' : 'public'}
172
+ onValueChange={(picked) => setRepo({ ...repo, private: picked === 'private' })}
173
+ >
174
+ {visibilities.map(([value, name, says]) => (
175
+ <Field key={value} orientation="horizontal">
176
+ <RadioGroupItem id={`repo-visibility-${value}`} value={value} />
177
+ <FieldContent>
178
+ <FieldLabel htmlFor={`repo-visibility-${value}`}>{name}</FieldLabel>
179
+ <FieldDescription>{says}</FieldDescription>
180
+ </FieldContent>
181
+ </Field>
182
+ ))}
183
+ </RadioGroup>
184
+ </FieldSet>
185
+ </FieldGroup>
186
+ {made.isError && (
187
+ <Alert variant="destructive">
188
+ <AlertDescription>{made.error.message}</AlertDescription>
189
+ </Alert>
190
+ )}
191
+ <Button type="submit" className="self-end" disabled={made.isPending}>
192
+ Create repository
193
+ </Button>
194
+ </form>
195
+ );
196
+ }
@@ -0,0 +1,47 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { BookMarkedIcon } from 'lucide-react';
3
+
4
+ import { cn } from '#/lib/cn';
5
+
6
+ import { avatarUrl } from '../avatar-url.ts';
7
+ import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar.tsx';
8
+ import { iconHashAt, type IconOf } from './icon-hashes.ts';
9
+
10
+ /** The icon's size by the place it's in: a line of text's, or a settings page's preview. */
11
+ const sizes = {
12
+ default: 'size-4',
13
+ xl: 'size-16',
14
+ } as const;
15
+
16
+ /**
17
+ * A repo's icon, clipped round with nothing behind it, or a bare `BookMarked` while it has none or
18
+ * it hasn't loaded, at the size and colour of the icons around it, so a row with an icon and one
19
+ * without line up. It's decorative, since the repo's name is written beside it. Its hash comes
20
+ * from one batched read for the page's repos, so a repo with no icon, or one not yet read, shows
21
+ * `BookMarked` and asks for no image; one with an icon loads it at its own `?v=`, which the
22
+ * browser keeps.
23
+ */
24
+ export function RepoIcon({
25
+ owner,
26
+ repo,
27
+ size = 'default',
28
+ className,
29
+ }: IconOf & { readonly size?: keyof typeof sizes; readonly className?: string }) {
30
+ const place = { owner, repo };
31
+ const { data: hash } = useQuery(iconHashAt(place));
32
+
33
+ return (
34
+ <Avatar
35
+ data-slot="repo-icon"
36
+ className={cn('after:hidden', sizes[size], className)}
37
+ aria-hidden
38
+ >
39
+ {hash === undefined || hash === null ? null : (
40
+ <AvatarImage src={avatarUrl(place, hash)} alt="" />
41
+ )}
42
+ <AvatarFallback className="rounded-none bg-transparent text-muted-foreground">
43
+ <BookMarkedIcon className="size-full" />
44
+ </AvatarFallback>
45
+ </Avatar>
46
+ );
47
+ }