ref0-git 0.0.0-stage → 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.
- package/app/apps/github/.dev.vars.example +6 -0
- package/app/apps/github/README.md +70 -0
- package/app/apps/github/THIRD_PARTY_NOTICES.md +214 -0
- package/app/apps/github/components.json +25 -0
- package/app/apps/github/generated/git-rest.ts +10444 -0
- package/app/apps/github/generated/routeTree.gen.ts +1242 -0
- package/app/apps/github/migrations/postgres/0001_auth.sql +46 -0
- package/app/apps/github/migrations/sql/0001_auth.sql +19 -0
- package/app/apps/github/migrations/sql/0002_passkeys.sql +9 -0
- package/app/apps/github/migrations/sql/0003_orgs.sql +22 -0
- package/app/apps/github/migrations/sql/0004_avatars.sql +6 -0
- package/app/apps/github/package.json +80 -0
- package/app/apps/github/src/branches/branch-list.tsx +385 -0
- package/app/apps/github/src/branches/branches.ts +55 -0
- package/app/apps/github/src/clients/allowed.ts +213 -0
- package/app/apps/github/src/clients/at-most.ts +17 -0
- package/app/apps/github/src/clients/avatars.ts +410 -0
- package/app/apps/github/src/clients/cached.ts +65 -0
- package/app/apps/github/src/clients/calls.ts +160 -0
- package/app/apps/github/src/clients/clients.ts +82 -0
- package/app/apps/github/src/clients/graphql.ts +50 -0
- package/app/apps/github/src/clients/host-answer.ts +28 -0
- package/app/apps/github/src/clients/host-calls.ts +382 -0
- package/app/apps/github/src/clients/icon-bytes.ts +203 -0
- package/app/apps/github/src/clients/proxy.ts +59 -0
- package/app/apps/github/src/clients/session-ended.ts +18 -0
- package/app/apps/github/src/clients/transfers.ts +212 -0
- package/app/apps/github/src/code/breadcrumbs.tsx +50 -0
- package/app/apps/github/src/code/code-page.tsx +147 -0
- package/app/apps/github/src/code/code-tree.tsx +338 -0
- package/app/apps/github/src/code/controls.tsx +230 -0
- package/app/apps/github/src/code/file-view.tsx +450 -0
- package/app/apps/github/src/code/files.ts +332 -0
- package/app/apps/github/src/code/folder-list.tsx +122 -0
- package/app/apps/github/src/code/go-to-file.tsx +131 -0
- package/app/apps/github/src/code/highlighted.tsx +58 -0
- package/app/apps/github/src/code/lines.ts +46 -0
- package/app/apps/github/src/code/load.ts +147 -0
- package/app/apps/github/src/code/markdown-files.ts +58 -0
- package/app/apps/github/src/code/places.ts +88 -0
- package/app/apps/github/src/code/ref-pages.ts +179 -0
- package/app/apps/github/src/code/ref-switcher.tsx +203 -0
- package/app/apps/github/src/code/refs.ts +142 -0
- package/app/apps/github/src/code/repo-home.tsx +240 -0
- package/app/apps/github/src/code/repo.ts +105 -0
- package/app/apps/github/src/code/saved-reads.ts +199 -0
- package/app/apps/github/src/code/saved.ts +110 -0
- package/app/apps/github/src/code/tree-fold.ts +186 -0
- package/app/apps/github/src/code/trees.ts +136 -0
- package/app/apps/github/src/components/avatar-picture.ts +53 -0
- package/app/apps/github/src/components/avatar-url.ts +16 -0
- package/app/apps/github/src/components/confirm-action.tsx +100 -0
- package/app/apps/github/src/components/count.tsx +24 -0
- package/app/apps/github/src/components/create-button.tsx +38 -0
- package/app/apps/github/src/components/file-icons/file-icons.css +225 -0
- package/app/apps/github/src/components/file-icons/file-icons.tsx +138 -0
- package/app/apps/github/src/components/filter.tsx +35 -0
- package/app/apps/github/src/components/hotkeys/hotkeys.tsx +255 -0
- package/app/apps/github/src/components/item-list.tsx +65 -0
- package/app/apps/github/src/components/language-dot.tsx +29 -0
- package/app/apps/github/src/components/list-toolbar.tsx +82 -0
- package/app/apps/github/src/components/markdown/editor.tsx +57 -0
- package/app/apps/github/src/components/markdown/markdown.css +177 -0
- package/app/apps/github/src/components/markdown/markdown.tsx +82 -0
- package/app/apps/github/src/components/owner-card.tsx +196 -0
- package/app/apps/github/src/components/pull-status.tsx +34 -0
- package/app/apps/github/src/components/recent.ts +41 -0
- package/app/apps/github/src/components/relative-time.tsx +78 -0
- package/app/apps/github/src/components/repos/icon-hashes.ts +91 -0
- package/app/apps/github/src/components/repos/new-repo-form.tsx +196 -0
- package/app/apps/github/src/components/repos/repo-icon.tsx +47 -0
- package/app/apps/github/src/components/repos/repo-list.tsx +528 -0
- package/app/apps/github/src/components/repos/your-repos.tsx +124 -0
- package/app/apps/github/src/components/review-state.tsx +75 -0
- package/app/apps/github/src/components/route-dialog.tsx +137 -0
- package/app/apps/github/src/components/save-button.tsx +58 -0
- package/app/apps/github/src/components/shell/app-shell.tsx +164 -0
- package/app/apps/github/src/components/shell/create-org-dialog.tsx +118 -0
- package/app/apps/github/src/components/shell/create-row.tsx +49 -0
- package/app/apps/github/src/components/shell/link-menu.tsx +94 -0
- package/app/apps/github/src/components/shell/nav-user.tsx +97 -0
- package/app/apps/github/src/components/shell/owner-repos.tsx +247 -0
- package/app/apps/github/src/components/shell/owner-switcher.tsx +104 -0
- package/app/apps/github/src/components/shell/repo-switcher.tsx +179 -0
- package/app/apps/github/src/components/shell/sections.ts +31 -0
- package/app/apps/github/src/components/shell/submenu-chevron.ts +147 -0
- package/app/apps/github/src/components/signin/device-card.tsx +139 -0
- package/app/apps/github/src/components/signin/login-form.tsx +88 -0
- package/app/apps/github/src/components/signin/signin-page.tsx +33 -0
- package/app/apps/github/src/components/signin/signup-form.tsx +106 -0
- package/app/apps/github/src/components/states/live-status.tsx +42 -0
- package/app/apps/github/src/components/states/states.tsx +126 -0
- package/app/apps/github/src/components/tab-indicator.tsx +143 -0
- package/app/apps/github/src/components/theme-choice.tsx +108 -0
- package/app/apps/github/src/components/theme-provider.tsx +126 -0
- package/app/apps/github/src/components/tones.ts +23 -0
- package/app/apps/github/src/components/ui/alert-dialog.tsx +187 -0
- package/app/apps/github/src/components/ui/alert.tsx +78 -0
- package/app/apps/github/src/components/ui/avatar.tsx +106 -0
- package/app/apps/github/src/components/ui/badge.tsx +51 -0
- package/app/apps/github/src/components/ui/breadcrumb.tsx +124 -0
- package/app/apps/github/src/components/ui/button-group.tsx +87 -0
- package/app/apps/github/src/components/ui/button.tsx +61 -0
- package/app/apps/github/src/components/ui/calendar.tsx +221 -0
- package/app/apps/github/src/components/ui/card.tsx +102 -0
- package/app/apps/github/src/components/ui/checkbox.tsx +26 -0
- package/app/apps/github/src/components/ui/collapsible.tsx +19 -0
- package/app/apps/github/src/components/ui/combobox.tsx +304 -0
- package/app/apps/github/src/components/ui/command.tsx +208 -0
- package/app/apps/github/src/components/ui/dialog.tsx +156 -0
- package/app/apps/github/src/components/ui/dropdown-menu.tsx +290 -0
- package/app/apps/github/src/components/ui/empty.tsx +100 -0
- package/app/apps/github/src/components/ui/field.tsx +236 -0
- package/app/apps/github/src/components/ui/hover-card.tsx +48 -0
- package/app/apps/github/src/components/ui/input-group.tsx +163 -0
- package/app/apps/github/src/components/ui/input.tsx +19 -0
- package/app/apps/github/src/components/ui/item.tsx +201 -0
- package/app/apps/github/src/components/ui/kbd.tsx +27 -0
- package/app/apps/github/src/components/ui/label.tsx +33 -0
- package/app/apps/github/src/components/ui/popover.tsx +87 -0
- package/app/apps/github/src/components/ui/radio-group.tsx +35 -0
- package/app/apps/github/src/components/ui/select.tsx +198 -0
- package/app/apps/github/src/components/ui/separator.tsx +22 -0
- package/app/apps/github/src/components/ui/sheet.tsx +138 -0
- package/app/apps/github/src/components/ui/sidebar.tsx +724 -0
- package/app/apps/github/src/components/ui/skeleton.tsx +13 -0
- package/app/apps/github/src/components/ui/sonner.tsx +47 -0
- package/app/apps/github/src/components/ui/styles.css +242 -0
- package/app/apps/github/src/components/ui/table.tsx +113 -0
- package/app/apps/github/src/components/ui/tabs.tsx +79 -0
- package/app/apps/github/src/components/ui/textarea.tsx +17 -0
- package/app/apps/github/src/components/ui/title.ts +6 -0
- package/app/apps/github/src/components/ui/toggle-group.tsx +89 -0
- package/app/apps/github/src/components/ui/toggle.tsx +42 -0
- package/app/apps/github/src/components/ui/tooltip.tsx +63 -0
- package/app/apps/github/src/components/user-avatar.tsx +145 -0
- package/app/apps/github/src/components/view-tabs.tsx +42 -0
- package/app/apps/github/src/context/context.ts +133 -0
- package/app/apps/github/src/diffs/blobs.ts +94 -0
- package/app/apps/github/src/diffs/diff-view.tsx +155 -0
- package/app/apps/github/src/diffs/files.ts +121 -0
- package/app/apps/github/src/diffs/hunks.tsx +454 -0
- package/app/apps/github/src/diffs/patch.ts +131 -0
- package/app/apps/github/src/diffs/rows.ts +137 -0
- package/app/apps/github/src/history/commit-diff.ts +54 -0
- package/app/apps/github/src/history/commit-list.tsx +207 -0
- package/app/apps/github/src/history/commit-page.tsx +147 -0
- package/app/apps/github/src/history/history.ts +129 -0
- package/app/apps/github/src/hooks/allowed.ts +31 -0
- package/app/apps/github/src/hooks/answers.ts +65 -0
- package/app/apps/github/src/hooks/avatars.ts +54 -0
- package/app/apps/github/src/hooks/draft.ts +38 -0
- package/app/apps/github/src/hooks/open-counts.ts +127 -0
- package/app/apps/github/src/hooks/profiles.ts +120 -0
- package/app/apps/github/src/hooks/repos.ts +440 -0
- package/app/apps/github/src/hooks/use-mobile.ts +19 -0
- package/app/apps/github/src/hooks/viewer.ts +39 -0
- package/app/apps/github/src/inbox/count.ts +70 -0
- package/app/apps/github/src/inbox/inbox-item.tsx +66 -0
- package/app/apps/github/src/inbox/inbox-page.tsx +572 -0
- package/app/apps/github/src/inbox/marks.ts +130 -0
- package/app/apps/github/src/inbox/release-tags.ts +65 -0
- package/app/apps/github/src/inbox/search.ts +97 -0
- package/app/apps/github/src/inbox/subjects.ts +184 -0
- package/app/apps/github/src/inbox/subscription-controls.tsx +184 -0
- package/app/apps/github/src/inbox/subscriptions.ts +189 -0
- package/app/apps/github/src/inbox/threads.ts +198 -0
- package/app/apps/github/src/issues/changes.ts +332 -0
- package/app/apps/github/src/issues/counts.ts +62 -0
- package/app/apps/github/src/issues/issue-list.tsx +682 -0
- package/app/apps/github/src/issues/issue-page.tsx +533 -0
- package/app/apps/github/src/issues/issues.ts +566 -0
- package/app/apps/github/src/issues/label-dialog.tsx +310 -0
- package/app/apps/github/src/issues/labels-page.tsx +119 -0
- package/app/apps/github/src/issues/new-issue.tsx +79 -0
- package/app/apps/github/src/issues/parts.tsx +71 -0
- package/app/apps/github/src/issues/picker.tsx +298 -0
- package/app/apps/github/src/issues/search.ts +238 -0
- package/app/apps/github/src/issues/sidebar.tsx +236 -0
- package/app/apps/github/src/lib/cn.ts +8 -0
- package/app/apps/github/src/lib/highlighting.ts +13 -0
- package/app/apps/github/src/live/follow.ts +129 -0
- package/app/apps/github/src/live/sse.ts +74 -0
- package/app/apps/github/src/live/use-follow.ts +37 -0
- package/app/apps/github/src/markdown/README.md +53 -0
- package/app/apps/github/src/markdown/allowed-html.ts +69 -0
- package/app/apps/github/src/markdown/context.ts +206 -0
- package/app/apps/github/src/markdown/images.ts +81 -0
- package/app/apps/github/src/markdown/lookup.ts +122 -0
- package/app/apps/github/src/markdown/patches.ts +299 -0
- package/app/apps/github/src/markdown/query.ts +25 -0
- package/app/apps/github/src/markdown/references.ts +158 -0
- package/app/apps/github/src/markdown/render.ts +103 -0
- package/app/apps/github/src/names/owners.ts +51 -0
- package/app/apps/github/src/names/repos.ts +24 -0
- package/app/apps/github/src/palette/palette.tsx +547 -0
- package/app/apps/github/src/palette/recent.ts +116 -0
- package/app/apps/github/src/palette/rows.tsx +455 -0
- package/app/apps/github/src/palette/server.ts +104 -0
- package/app/apps/github/src/palette/targets.ts +306 -0
- package/app/apps/github/src/policy.ts +600 -0
- package/app/apps/github/src/private-repos.ts +47 -0
- package/app/apps/github/src/pulls/compare-page.tsx +342 -0
- package/app/apps/github/src/pulls/files-tab.tsx +776 -0
- package/app/apps/github/src/pulls/live.ts +124 -0
- package/app/apps/github/src/pulls/merge-box.tsx +367 -0
- package/app/apps/github/src/pulls/merge-button.ts +86 -0
- package/app/apps/github/src/pulls/pull-list.tsx +235 -0
- package/app/apps/github/src/pulls/pull-page.tsx +474 -0
- package/app/apps/github/src/pulls/pull.ts +468 -0
- package/app/apps/github/src/pulls/pulls.ts +318 -0
- package/app/apps/github/src/pulls/review.ts +350 -0
- package/app/apps/github/src/pulls/search.ts +130 -0
- package/app/apps/github/src/queue/queue-page.tsx +405 -0
- package/app/apps/github/src/queue/queue.ts +231 -0
- package/app/apps/github/src/releases/latest-release.tsx +55 -0
- package/app/apps/github/src/releases/overview.tsx +30 -0
- package/app/apps/github/src/releases/release-form.tsx +353 -0
- package/app/apps/github/src/releases/release-list.tsx +173 -0
- package/app/apps/github/src/releases/release-view.tsx +183 -0
- package/app/apps/github/src/releases/releases.ts +308 -0
- package/app/apps/github/src/releases/tag-list.tsx +134 -0
- package/app/apps/github/src/router.tsx +46 -0
- package/app/apps/github/src/routes/$owner/$repo/_code/blob/$.tsx +33 -0
- package/app/apps/github/src/routes/$owner/$repo/_code/tree/$.tsx +28 -0
- package/app/apps/github/src/routes/$owner/$repo/_code.tsx +11 -0
- package/app/apps/github/src/routes/$owner/$repo/_releases/releases/index.tsx +19 -0
- package/app/apps/github/src/routes/$owner/$repo/_releases/tags.tsx +19 -0
- package/app/apps/github/src/routes/$owner/$repo/_releases.tsx +23 -0
- package/app/apps/github/src/routes/$owner/$repo/branches.tsx +39 -0
- package/app/apps/github/src/routes/$owner/$repo/commit/$sha.tsx +34 -0
- package/app/apps/github/src/routes/$owner/$repo/commits/$.tsx +42 -0
- package/app/apps/github/src/routes/$owner/$repo/compare/$.tsx +19 -0
- package/app/apps/github/src/routes/$owner/$repo/index.tsx +24 -0
- package/app/apps/github/src/routes/$owner/$repo/issues/$number.tsx +50 -0
- package/app/apps/github/src/routes/$owner/$repo/issues/index.tsx +53 -0
- package/app/apps/github/src/routes/$owner/$repo/issues/new.tsx +43 -0
- package/app/apps/github/src/routes/$owner/$repo/labels.tsx +22 -0
- package/app/apps/github/src/routes/$owner/$repo/pull/$number/checks.tsx +15 -0
- package/app/apps/github/src/routes/$owner/$repo/pull/$number/commits.tsx +15 -0
- package/app/apps/github/src/routes/$owner/$repo/pull/$number/files.tsx +15 -0
- package/app/apps/github/src/routes/$owner/$repo/pull/$number/index.tsx +19 -0
- package/app/apps/github/src/routes/$owner/$repo/pull/$number/route.tsx +52 -0
- package/app/apps/github/src/routes/$owner/$repo/pulls/index.tsx +48 -0
- package/app/apps/github/src/routes/$owner/$repo/queue.tsx +22 -0
- package/app/apps/github/src/routes/$owner/$repo/releases/edit/$.tsx +58 -0
- package/app/apps/github/src/routes/$owner/$repo/releases/new.tsx +40 -0
- package/app/apps/github/src/routes/$owner/$repo/releases/tag/$.tsx +35 -0
- package/app/apps/github/src/routes/$owner/$repo/route.tsx +102 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/access.tsx +9 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/hooks/index.tsx +16 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/hooks/new.tsx +25 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/index.tsx +17 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/route.tsx +28 -0
- package/app/apps/github/src/routes/$owner/$repo/settings/rules.tsx +12 -0
- package/app/apps/github/src/routes/$owner/$repo/tokens.tsx +16 -0
- package/app/apps/github/src/routes/$owner/index.tsx +45 -0
- package/app/apps/github/src/routes/-nav.tsx +293 -0
- package/app/apps/github/src/routes/-root-testing.ts +107 -0
- package/app/apps/github/src/routes/__root.tsx +225 -0
- package/app/apps/github/src/routes/api.auth.$.ts +18 -0
- package/app/apps/github/src/routes/downloads/$owner/$repo/$asset.tsx +10 -0
- package/app/apps/github/src/routes/file-icons[.]svg.ts +21 -0
- package/app/apps/github/src/routes/icons/$owner/$repo.tsx +14 -0
- package/app/apps/github/src/routes/icons/$owner/index.tsx +14 -0
- package/app/apps/github/src/routes/icons/index.tsx +12 -0
- package/app/apps/github/src/routes/index.tsx +48 -0
- package/app/apps/github/src/routes/login.tsx +24 -0
- package/app/apps/github/src/routes/login_.code.tsx +31 -0
- package/app/apps/github/src/routes/new.tsx +91 -0
- package/app/apps/github/src/routes/notifications.tsx +20 -0
- package/app/apps/github/src/routes/orgs/$owner/issues.tsx +8 -0
- package/app/apps/github/src/routes/orgs/$owner/pulls.tsx +8 -0
- package/app/apps/github/src/routes/orgs/$owner/releases.tsx +8 -0
- package/app/apps/github/src/routes/orgs/$owner/route.tsx +25 -0
- package/app/apps/github/src/routes/orgs/$owner/settings.tsx +30 -0
- package/app/apps/github/src/routes/orgs/$owner/tokens.tsx +15 -0
- package/app/apps/github/src/routes/settings.tsx +54 -0
- package/app/apps/github/src/routes/signup.tsx +24 -0
- package/app/apps/github/src/routes/uploads/$owner/$repo/$release.tsx +10 -0
- package/app/apps/github/src/seed/acme.ts +498 -0
- package/app/apps/github/src/seed/licenses.ts +114 -0
- package/app/apps/github/src/seed/seed.ts +538 -0
- package/app/apps/github/src/server.ts +97 -0
- package/app/apps/github/src/settings/account-avatar.tsx +43 -0
- package/app/apps/github/src/settings/avatar-section.tsx +140 -0
- package/app/apps/github/src/settings/avatar.ts +58 -0
- package/app/apps/github/src/settings/general-settings.tsx +439 -0
- package/app/apps/github/src/settings/general.ts +73 -0
- package/app/apps/github/src/settings/hook-form.tsx +195 -0
- package/app/apps/github/src/settings/hook-list.tsx +166 -0
- package/app/apps/github/src/settings/hooks.ts +87 -0
- package/app/apps/github/src/settings/org-settings.tsx +228 -0
- package/app/apps/github/src/settings/orgs.ts +116 -0
- package/app/apps/github/src/settings/rule-list.tsx +72 -0
- package/app/apps/github/src/settings/rules.ts +27 -0
- package/app/apps/github/src/settings/settings-layout.tsx +114 -0
- package/app/apps/github/src/signin/approval.ts +186 -0
- package/app/apps/github/src/signin/auth-client.ts +127 -0
- package/app/apps/github/src/signin/auth.ts +753 -0
- package/app/apps/github/src/signin/avatars.ts +126 -0
- package/app/apps/github/src/signin/client-ip.ts +39 -0
- package/app/apps/github/src/signin/credentials.ts +26 -0
- package/app/apps/github/src/signin/device-code.ts +95 -0
- package/app/apps/github/src/signin/device-prompt.ts +125 -0
- package/app/apps/github/src/signin/errors.ts +135 -0
- package/app/apps/github/src/signin/host-session.ts +68 -0
- package/app/apps/github/src/signin/orgs.ts +283 -0
- package/app/apps/github/src/signin/owner-names.ts +183 -0
- package/app/apps/github/src/signin/person-lock.ts +104 -0
- package/app/apps/github/src/signin/seal.ts +88 -0
- package/app/apps/github/src/signin/seed-people.ts +92 -0
- package/app/apps/github/src/signin/session.ts +48 -0
- package/app/apps/github/src/signin/unborn.ts +110 -0
- package/app/apps/github/src/signin/viewer-orgs.ts +47 -0
- package/app/apps/github/src/signin/viewer.ts +74 -0
- package/app/apps/github/src/signin/with-headers.ts +14 -0
- package/app/apps/github/src/tokens/tokens-page.tsx +529 -0
- package/app/apps/github/src/tokens/tokens.ts +54 -0
- package/app/apps/github/tsconfig.json +25 -0
- package/app/apps/github/tsconfig.worker.json +24 -0
- package/app/apps/github/vite.config.ts +21 -0
- package/app/pnpm-workspace.yaml +216 -0
- package/app/tsconfig.base.json +127 -0
- package/dist/LICENSE +202 -0
- package/dist/cli/child.mjs +42 -0
- package/dist/cli/commands.mjs +23 -0
- package/dist/cli/credentials.mjs +84 -0
- package/dist/cli/documents.mjs +214 -0
- package/dist/cli/events.mjs +55 -0
- package/dist/cli/failure.mjs +105 -0
- package/dist/cli/folders.mjs +32 -0
- package/dist/cli/git-remote-ref0.d.mts +1 -0
- package/dist/cli/git-remote-ref0.mjs +29 -0
- package/dist/cli/git.mjs +48 -0
- package/dist/cli/helpers.mjs +51 -0
- package/dist/cli/hosts.mjs +127 -0
- package/dist/cli/node.mjs +15 -0
- package/dist/cli/output.mjs +135 -0
- package/dist/cli/prompt.mjs +35 -0
- package/dist/cli/queue.mjs +215 -0
- package/dist/cli/ref0-git.d.mts +1 -0
- package/dist/cli/ref0-git.mjs +144 -0
- package/dist/cli/repos.mjs +162 -0
- package/dist/cli/resources.mjs +131 -0
- package/dist/cli/run-end.mjs +57 -0
- package/dist/cli/runtime.mjs +50 -0
- package/dist/cli/setup.mjs +1410 -0
- package/dist/cli/sign-in.mjs +162 -0
- package/dist/cli/sign-ins.mjs +79 -0
- package/dist/cli/sqlite.mjs +28 -0
- package/dist/cli/tokens.mjs +141 -0
- package/dist/cli/vendor.mjs +123 -0
- package/dist/init/app.mjs +231 -0
- package/dist/init/astro.mjs +49 -0
- package/dist/init/choices.mjs +497 -0
- package/dist/init/cloudflare.mjs +324 -0
- package/dist/init/create.mjs +151 -0
- package/dist/init/detect.mjs +297 -0
- package/dist/init/files.mjs +75 -0
- package/dist/init/frameworks.mjs +248 -0
- package/dist/init/git-module.mjs +49 -0
- package/dist/init/github-routes.mjs +66 -0
- package/dist/init/jsonc.mjs +143 -0
- package/dist/init/metadata.mjs +48 -0
- package/dist/init/mounts.mjs +109 -0
- package/dist/init/next.mjs +205 -0
- package/dist/init/node-app.mjs +189 -0
- package/dist/init/node.mjs +458 -0
- package/dist/init/nuxt.mjs +115 -0
- package/dist/init/output.mjs +21 -0
- package/dist/init/plan.mjs +82 -0
- package/dist/init/range-major.mjs +257 -0
- package/dist/init/react-router.mjs +59 -0
- package/dist/init/routes.mjs +148 -0
- package/dist/init/shell.mjs +4 -0
- package/dist/init/stores.mjs +51 -0
- package/dist/init/sveltekit.mjs +139 -0
- package/dist/init/template.mjs +142 -0
- package/dist/init/templates.mjs +343 -0
- package/dist/init/vercel.mjs +383 -0
- package/dist/init/versions.mjs +32 -0
- package/dist/init/workspace.mjs +20 -0
- package/package.json +52 -3
- package/README.md +0 -3
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router';
|
|
3
|
+
import { ArrowLeftIcon, GitCompareArrowsIcon, GitPullRequestIcon } from 'lucide-react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Go } from '../code/controls.tsx';
|
|
7
|
+
import { repoHref, type RepoPlace } from '../code/places.ts';
|
|
8
|
+
import { RefSwitcher } from '../code/ref-switcher.tsx';
|
|
9
|
+
import { HotkeyHint, hotkeys } from '../components/hotkeys/hotkeys.tsx';
|
|
10
|
+
import { MarkdownEditor } from '../components/markdown/editor.tsx';
|
|
11
|
+
import { Alert, AlertDescription, AlertTitle } from '../components/ui/alert.tsx';
|
|
12
|
+
import { Button, buttonVariants } from '../components/ui/button.tsx';
|
|
13
|
+
import {
|
|
14
|
+
Empty,
|
|
15
|
+
EmptyContent,
|
|
16
|
+
EmptyDescription,
|
|
17
|
+
EmptyHeader,
|
|
18
|
+
EmptyMedia,
|
|
19
|
+
EmptyTitle,
|
|
20
|
+
} from '../components/ui/empty.tsx';
|
|
21
|
+
import { Field, FieldGroup, FieldLabel } from '../components/ui/field.tsx';
|
|
22
|
+
import { Input } from '../components/ui/input.tsx';
|
|
23
|
+
import { Skeleton } from '../components/ui/skeleton.tsx';
|
|
24
|
+
import { DiffView } from '../diffs/diff-view.tsx';
|
|
25
|
+
import { comparedFiles } from '../diffs/files.ts';
|
|
26
|
+
import { CommitDays, titleOf } from '../history/commit-list.tsx';
|
|
27
|
+
import { useAllowed } from '../hooks/allowed.ts';
|
|
28
|
+
import { pullHref } from './pull-list.tsx';
|
|
29
|
+
import {
|
|
30
|
+
baseheadOf,
|
|
31
|
+
comparedCommitsShown,
|
|
32
|
+
comparisonOf,
|
|
33
|
+
openPull,
|
|
34
|
+
openPullOf,
|
|
35
|
+
type Basehead,
|
|
36
|
+
type Comparison,
|
|
37
|
+
} from './pulls.ts';
|
|
38
|
+
|
|
39
|
+
/** A ref's name as a URL's path: each of its segments escaped, its slashes kept. */
|
|
40
|
+
const refPath = (name: string) => name.split('/').map(encodeURIComponent).join('/');
|
|
41
|
+
|
|
42
|
+
/** The compare page for `basehead`, or for choosing one. */
|
|
43
|
+
export const compareHref = (place: RepoPlace, basehead?: Basehead) =>
|
|
44
|
+
basehead === undefined
|
|
45
|
+
? `${repoHref(place)}/compare`
|
|
46
|
+
: `${repoHref(place)}/compare/${refPath(basehead.base)}...${refPath(basehead.head)}`;
|
|
47
|
+
|
|
48
|
+
/** What the compare page's path names: two revisions, and the head's repo when it's another's. */
|
|
49
|
+
export interface Compare extends Basehead {
|
|
50
|
+
/** Whether the reader chose a head: until then, `head` is the base. */
|
|
51
|
+
readonly chosen: boolean;
|
|
52
|
+
/** The owner `owner:branch` names for the head, when it isn't the repo's. */
|
|
53
|
+
readonly fork: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* What the compare page's path names: `base...head`, `head` alone against the default branch,
|
|
58
|
+
* or nothing yet. A side may be `owner:branch`, as GitHub's are, and the repo's own owner is
|
|
59
|
+
* dropped from it.
|
|
60
|
+
*/
|
|
61
|
+
export const compareOf = (place: RepoPlace, splat: string, defaultBranch: string): Compare => {
|
|
62
|
+
const parts = splat.split('...');
|
|
63
|
+
const [base, head] = parts.length === 2 ? parts : [defaultBranch, splat];
|
|
64
|
+
const sideOf = (side: string) => {
|
|
65
|
+
const colon = side.indexOf(':');
|
|
66
|
+
|
|
67
|
+
return colon === -1
|
|
68
|
+
? { owner: undefined, name: side }
|
|
69
|
+
: { owner: side.slice(0, colon), name: side.slice(colon + 1) };
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const from = sideOf(head ?? '');
|
|
73
|
+
const into = sideOf(base ?? defaultBranch);
|
|
74
|
+
const fork = [from.owner, into.owner].find(
|
|
75
|
+
(owner) => owner !== undefined && owner !== place.owner,
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
base: into.name === '' ? defaultBranch : into.name,
|
|
80
|
+
head: from.name === '' ? (into.name === '' ? defaultBranch : into.name) : from.name,
|
|
81
|
+
chosen: from.name !== '',
|
|
82
|
+
fork,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** A new pull request's form for `basehead`: its title and description, opened ready or as a draft. */
|
|
87
|
+
function OpenForm({
|
|
88
|
+
place,
|
|
89
|
+
basehead,
|
|
90
|
+
comparison,
|
|
91
|
+
}: {
|
|
92
|
+
readonly place: RepoPlace;
|
|
93
|
+
readonly basehead: Basehead;
|
|
94
|
+
readonly comparison: Comparison;
|
|
95
|
+
}) {
|
|
96
|
+
const client = useQueryClient();
|
|
97
|
+
const navigate = useNavigate();
|
|
98
|
+
// One commit's message is the pull request's, as GitHub's form starts it; more name the branch.
|
|
99
|
+
const [only] = comparison.commits.length === 1 ? comparison.commits : [];
|
|
100
|
+
const [title, setTitle] = useState(only === undefined ? basehead.head : titleOf(only.message));
|
|
101
|
+
const [body, setBody] = useState(
|
|
102
|
+
only === undefined ? '' : only.message.slice(titleOf(only.message).length).trim(),
|
|
103
|
+
);
|
|
104
|
+
const opened = useMutation({
|
|
105
|
+
mutationFn: (draft: boolean) =>
|
|
106
|
+
openPull(place, { ...basehead, title: title.trim(), body, draft }),
|
|
107
|
+
onSuccess: async (number) => {
|
|
108
|
+
await client.invalidateQueries({ queryKey: ['pulls', place.owner, place.repo] });
|
|
109
|
+
await navigate({ href: pullHref(place, number) });
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
const blocked = opened.isPending || title.trim() === '';
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<form
|
|
116
|
+
aria-label="Open a pull request"
|
|
117
|
+
className="flex flex-col gap-3 border p-3"
|
|
118
|
+
onSubmit={(event) => {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
|
|
121
|
+
if (!blocked) opened.mutate(false);
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<FieldGroup>
|
|
125
|
+
<Field>
|
|
126
|
+
<FieldLabel htmlFor="pull-title" required>
|
|
127
|
+
Title
|
|
128
|
+
</FieldLabel>
|
|
129
|
+
<Input
|
|
130
|
+
id="pull-title"
|
|
131
|
+
value={title}
|
|
132
|
+
required
|
|
133
|
+
onChange={(event) => setTitle(event.target.value)}
|
|
134
|
+
/>
|
|
135
|
+
</Field>
|
|
136
|
+
<Field>
|
|
137
|
+
<FieldLabel>Description</FieldLabel>
|
|
138
|
+
<MarkdownEditor
|
|
139
|
+
repo={`${place.owner}/${place.repo}`}
|
|
140
|
+
label="Description"
|
|
141
|
+
value={body}
|
|
142
|
+
onChange={setBody}
|
|
143
|
+
placeholder="Add a description"
|
|
144
|
+
/>
|
|
145
|
+
</Field>
|
|
146
|
+
</FieldGroup>
|
|
147
|
+
<div className="flex flex-wrap justify-end gap-2">
|
|
148
|
+
<Button
|
|
149
|
+
type="button"
|
|
150
|
+
variant="outline"
|
|
151
|
+
disabled={blocked}
|
|
152
|
+
onClick={() => opened.mutate(true)}
|
|
153
|
+
>
|
|
154
|
+
Create draft pull request
|
|
155
|
+
</Button>
|
|
156
|
+
<Button type="submit" disabled={blocked} data-hotkey={hotkeys.submit}>
|
|
157
|
+
Create pull request
|
|
158
|
+
<HotkeyHint keys={hotkeys.submit} />
|
|
159
|
+
</Button>
|
|
160
|
+
</div>
|
|
161
|
+
{opened.error !== null && (
|
|
162
|
+
<Alert variant="destructive">
|
|
163
|
+
<AlertDescription>{opened.error.message}</AlertDescription>
|
|
164
|
+
</Alert>
|
|
165
|
+
)}
|
|
166
|
+
</form>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Why there's nothing to compare, and what the reader might compare instead. */
|
|
171
|
+
function NothingToCompare({ children }: { readonly children: React.ReactNode }) {
|
|
172
|
+
return (
|
|
173
|
+
<Empty className="border">
|
|
174
|
+
<EmptyHeader>
|
|
175
|
+
<EmptyMedia variant="icon">
|
|
176
|
+
<GitCompareArrowsIcon />
|
|
177
|
+
</EmptyMedia>
|
|
178
|
+
<EmptyTitle>There isn't anything to compare</EmptyTitle>
|
|
179
|
+
{children}
|
|
180
|
+
</EmptyHeader>
|
|
181
|
+
</Empty>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** What `basehead`'s comparison shows: the open form or its open pull request, its commits and its diff. */
|
|
186
|
+
function Compared({ place, basehead }: { readonly place: RepoPlace; readonly basehead: Basehead }) {
|
|
187
|
+
const comparison = useQuery(comparisonOf(place, basehead));
|
|
188
|
+
const open = useQuery(openPullOf(place, basehead));
|
|
189
|
+
const allowed = useAllowed(place);
|
|
190
|
+
const { base, head } = basehead;
|
|
191
|
+
|
|
192
|
+
if (comparison.error !== null) {
|
|
193
|
+
return (
|
|
194
|
+
<Alert variant="destructive">
|
|
195
|
+
<AlertDescription>
|
|
196
|
+
{comparison.error.message}. Reload the page to try again.
|
|
197
|
+
</AlertDescription>
|
|
198
|
+
</Alert>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (comparison.data === undefined) return <Skeleton className="h-40" />;
|
|
203
|
+
|
|
204
|
+
if (comparison.data === null) {
|
|
205
|
+
return (
|
|
206
|
+
<NothingToCompare>
|
|
207
|
+
<EmptyDescription>
|
|
208
|
+
{base} and {head} share no history, or one of them isn't a branch, tag or commit of{' '}
|
|
209
|
+
{place.owner}/{place.repo}.
|
|
210
|
+
</EmptyDescription>
|
|
211
|
+
</NothingToCompare>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const found = comparison.data;
|
|
216
|
+
|
|
217
|
+
if (found.ahead === 0) {
|
|
218
|
+
return (
|
|
219
|
+
<NothingToCompare>
|
|
220
|
+
<EmptyDescription>
|
|
221
|
+
{base} is up to date with all commits from {head}.
|
|
222
|
+
{found.behind > 0 && ' Try switching the base for your comparison.'}
|
|
223
|
+
</EmptyDescription>
|
|
224
|
+
{found.behind > 0 && (
|
|
225
|
+
<EmptyContent>
|
|
226
|
+
<Go
|
|
227
|
+
href={compareHref(place, { base: head, head: base })}
|
|
228
|
+
className={buttonVariants({ variant: 'outline' })}
|
|
229
|
+
>
|
|
230
|
+
Compare {head}...{base}
|
|
231
|
+
</Go>
|
|
232
|
+
</EmptyContent>
|
|
233
|
+
)}
|
|
234
|
+
</NothingToCompare>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const shown = found.commits.length;
|
|
239
|
+
const repo = `${place.owner}/${place.repo}`;
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<div className="flex flex-col gap-4">
|
|
243
|
+
{open.data != null ? (
|
|
244
|
+
<Alert>
|
|
245
|
+
<GitPullRequestIcon />
|
|
246
|
+
<AlertTitle>#{open.data} is open for these branches</AlertTitle>
|
|
247
|
+
<AlertDescription>
|
|
248
|
+
<Go href={pullHref(place, open.data)} className="underline">
|
|
249
|
+
View pull request
|
|
250
|
+
</Go>
|
|
251
|
+
</AlertDescription>
|
|
252
|
+
</Alert>
|
|
253
|
+
) : (
|
|
254
|
+
open.data === null &&
|
|
255
|
+
allowed.has('pull.create') && (
|
|
256
|
+
<OpenForm
|
|
257
|
+
key={baseheadOf(basehead)}
|
|
258
|
+
place={place}
|
|
259
|
+
basehead={basehead}
|
|
260
|
+
comparison={found}
|
|
261
|
+
/>
|
|
262
|
+
)
|
|
263
|
+
)}
|
|
264
|
+
<section aria-label="Commits" className="flex flex-col gap-3">
|
|
265
|
+
<h3 className="text-sm font-semibold">
|
|
266
|
+
{found.ahead} {found.ahead === 1 ? 'commit' : 'commits'}
|
|
267
|
+
{found.ahead > shown && `, the first ${comparedCommitsShown} shown`}
|
|
268
|
+
</h3>
|
|
269
|
+
<CommitDays
|
|
270
|
+
at={{ ...place, ref: { name: head, kind: 'branch' }, path: '' }}
|
|
271
|
+
rows={found.commits}
|
|
272
|
+
/>
|
|
273
|
+
</section>
|
|
274
|
+
<section aria-label="Files changed">
|
|
275
|
+
<DiffView
|
|
276
|
+
list={comparedFiles(repo, {
|
|
277
|
+
base: found.mergeBase,
|
|
278
|
+
head: found.head,
|
|
279
|
+
files: found.files,
|
|
280
|
+
})}
|
|
281
|
+
revisions={{ repo, base: found.mergeBase, head: found.head }}
|
|
282
|
+
/>
|
|
283
|
+
</section>
|
|
284
|
+
</div>
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* GitHub's compare page: a base and a head to compare, what the head has that the base hasn't,
|
|
290
|
+
* and the form that opens a pull request of it, or the one open already.
|
|
291
|
+
*/
|
|
292
|
+
export function ComparePage({
|
|
293
|
+
place,
|
|
294
|
+
compare,
|
|
295
|
+
}: {
|
|
296
|
+
readonly place: RepoPlace;
|
|
297
|
+
readonly compare: Compare;
|
|
298
|
+
}) {
|
|
299
|
+
const { base, head, chosen, fork } = compare;
|
|
300
|
+
|
|
301
|
+
return (
|
|
302
|
+
<div className="flex flex-col gap-4">
|
|
303
|
+
<header className="flex flex-col gap-1">
|
|
304
|
+
<h2 className="text-xl font-semibold">
|
|
305
|
+
{chosen ? 'Comparing changes' : 'Compare changes'}
|
|
306
|
+
</h2>
|
|
307
|
+
<p className="text-sm text-muted-foreground">
|
|
308
|
+
Choose two branches to see what's changed or to start a new pull request.
|
|
309
|
+
</p>
|
|
310
|
+
</header>
|
|
311
|
+
<div className="flex flex-wrap items-center gap-2 border bg-muted/50 p-2">
|
|
312
|
+
<GitCompareArrowsIcon aria-hidden className="size-3.5 text-muted-foreground" />
|
|
313
|
+
<RefSwitcher
|
|
314
|
+
side="base"
|
|
315
|
+
size="sm"
|
|
316
|
+
place={place}
|
|
317
|
+
here={{ name: base, kind: 'branch' }}
|
|
318
|
+
hrefOf={(ref) => compareHref(place, { base: ref, head })}
|
|
319
|
+
/>
|
|
320
|
+
<ArrowLeftIcon aria-hidden className="size-3.5 text-muted-foreground" />
|
|
321
|
+
<RefSwitcher
|
|
322
|
+
side="compare"
|
|
323
|
+
size="sm"
|
|
324
|
+
place={place}
|
|
325
|
+
here={{ name: head, kind: 'branch' }}
|
|
326
|
+
hrefOf={(ref) => compareHref(place, { base, head: ref })}
|
|
327
|
+
/>
|
|
328
|
+
</div>
|
|
329
|
+
{fork !== undefined ? (
|
|
330
|
+
<Alert>
|
|
331
|
+
<AlertTitle>This host compares branches of one repository</AlertTitle>
|
|
332
|
+
<AlertDescription>
|
|
333
|
+
{fork}'s branches aren't here: a pull request from a fork opens once Git can compare
|
|
334
|
+
across repositories. Pick branches of {place.owner}/{place.repo}.
|
|
335
|
+
</AlertDescription>
|
|
336
|
+
</Alert>
|
|
337
|
+
) : (
|
|
338
|
+
chosen && <Compared place={place} basehead={{ base, head }} />
|
|
339
|
+
)}
|
|
340
|
+
</div>
|
|
341
|
+
);
|
|
342
|
+
}
|