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,231 @@
|
|
|
1
|
+
import { bucketLine, bucketName, devVars, looseAdapterEnd, looseInfraImport, mergePackage, secretFiles } from "./cloudflare.mjs";
|
|
2
|
+
import { ignoring, lines, listed, withCli } from "./files.mjs";
|
|
3
|
+
import { bucketLines, firstImports, infraImports, partsOf, storeLines } from "./node.mjs";
|
|
4
|
+
import { specOf } from "./versions.mjs";
|
|
5
|
+
import { looseObjects } from "./git-module.mjs";
|
|
6
|
+
import { filled, platforms, templates, unless } from "./template.mjs";
|
|
7
|
+
import { blockOf, catalogOf } from "./workspace.mjs";
|
|
8
|
+
import { appPackages } from "./metadata.mjs";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import * as Predicate from "effect/Predicate";
|
|
11
|
+
import * as Schema from "effect/Schema";
|
|
12
|
+
// src/init/app.ts
|
|
13
|
+
/**
|
|
14
|
+
* Files `init` writes for the choices, rather than copies, and the platform descriptors, which
|
|
15
|
+
* the CLI's templates carry for `doctor`.
|
|
16
|
+
*/
|
|
17
|
+
const written = /* @__PURE__ */ new Set([
|
|
18
|
+
"src/git.ts",
|
|
19
|
+
"src/env.ts",
|
|
20
|
+
"wrangler.jsonc",
|
|
21
|
+
"package.json",
|
|
22
|
+
"src/platform.ts"
|
|
23
|
+
]);
|
|
24
|
+
/** A local secrets file anywhere, `.env` or `.dev.vars` and each variant, such as `.env.local`, but the examples. */
|
|
25
|
+
const localSecrets = /(^|\/)\.(env|dev\.vars)(\.(?!example$)[^/]*)?$/;
|
|
26
|
+
/** Folders `init` copies nothing from: tests' helpers and fixtures, and what a run or a build makes. */
|
|
27
|
+
const skipped = /(^|\/)(node_modules|dist|\.wrangler|testing|fixtures)\//;
|
|
28
|
+
/** Whether `init` copies anything under the app's folder or file at `path`, so a walk enters it. */
|
|
29
|
+
const entered = (path) => !skipped.test(`${path}/`);
|
|
30
|
+
/**
|
|
31
|
+
* Whether `init` copies the app's file at `path`: not a test, a `testing/` or `fixtures/` folder,
|
|
32
|
+
* what a run or a build makes, the local secrets, the ignores `init` merges, or one it writes.
|
|
33
|
+
*/
|
|
34
|
+
const copied = (path) => !written.has(path) && entered(path) && !/\.test\.tsx?$|^\.gitignore$|^tsconfig\.test\.json$/.test(path) && !localSecrets.test(path);
|
|
35
|
+
/** The workspace's `overrides:`, as npm writes them: `vite@*` as `vite`, `catalog:` written out. */
|
|
36
|
+
const overridesOf = (workspace, catalog) => Object.fromEntries(blockOf(workspace, "overrides").flatMap((line) => {
|
|
37
|
+
const entry = /^ {2}'?([^':#\s][^':]*?)(?:@\*)?'?: '?([^'\s]+)'?$/.exec(line);
|
|
38
|
+
if (entry === null) return [];
|
|
39
|
+
const spec = entry[2] ?? "";
|
|
40
|
+
return [[entry[1] ?? "", spec === "catalog:" ? catalog.get(entry[1] ?? "") ?? spec : spec]];
|
|
41
|
+
}));
|
|
42
|
+
const Manifest = Schema.Record(Schema.String, Schema.Json);
|
|
43
|
+
const Specs = Schema.Record(Schema.String, Schema.String);
|
|
44
|
+
const ManifestText = Schema.fromJsonString(Manifest);
|
|
45
|
+
const decodeManifest = Schema.decodeUnknownSync(ManifestText);
|
|
46
|
+
const decodeSpecs = Schema.decodeUnknownSync(Specs);
|
|
47
|
+
const readManifest = Schema.decodeUnknownEffect(ManifestText);
|
|
48
|
+
const readSpecs = Schema.decodeUnknownEffect(Specs);
|
|
49
|
+
/** The app's `package.json` as `init` writes it: two-space JSON, as npm writes one. */
|
|
50
|
+
const encodeManifest = Schema.encodeSync(Schema.fromJsonString(Manifest, { space: 2 }));
|
|
51
|
+
/** A JSON string, quoted and escaped, for a value in JSONC text. */
|
|
52
|
+
const jsonString = Schema.encodeSync(Schema.fromJsonString(Schema.String));
|
|
53
|
+
/**
|
|
54
|
+
* The app's `package.json` from a checkout, read as `appManifest` reads it: JSON, with its scripts
|
|
55
|
+
* and both dependency lists, where it has them, strings by name. The source's loading reads it with
|
|
56
|
+
* this first, so `appManifest`'s own decodes read only what passed.
|
|
57
|
+
*/
|
|
58
|
+
const checkedManifest = Effect.fnUntraced(function* (text) {
|
|
59
|
+
const held = yield* readManifest(text);
|
|
60
|
+
for (const key of [
|
|
61
|
+
"scripts",
|
|
62
|
+
"dependencies",
|
|
63
|
+
"devDependencies"
|
|
64
|
+
]) yield* readSpecs(held[key] ?? {});
|
|
65
|
+
});
|
|
66
|
+
const appManifest = (source, name, vendor, platform = {}) => {
|
|
67
|
+
const held = decodeManifest(source.manifest);
|
|
68
|
+
const catalog = catalogOf(source.workspace);
|
|
69
|
+
const pinned = (listed, dropped) => Object.fromEntries(Object.entries(decodeSpecs(listed ?? {})).filter(([each]) => !dropped.includes(each)).map(([each, spec]) => [each, each.startsWith("@ref0/") ? specOf(each, vendor) : spec === "catalog:" ? catalog.get(each) ?? spec : spec]));
|
|
70
|
+
const scripts = platform.scripts ?? Object.fromEntries(Object.entries(decodeSpecs(held["scripts"] ?? {})).filter(([each]) => each !== "generate"));
|
|
71
|
+
const dropped = platform.dropped ?? [];
|
|
72
|
+
const nested = Object.fromEntries(appPackages.map((each) => [`@ref0/${each}`, `$@ref0/${each}`]));
|
|
73
|
+
const made = {
|
|
74
|
+
...held,
|
|
75
|
+
name,
|
|
76
|
+
scripts,
|
|
77
|
+
dependencies: {
|
|
78
|
+
...pinned(held["dependencies"], dropped),
|
|
79
|
+
...platform.dependencies
|
|
80
|
+
},
|
|
81
|
+
devDependencies: {
|
|
82
|
+
...pinned(held["devDependencies"], ["openapi-typescript", ...dropped]),
|
|
83
|
+
...platform.devDependencies
|
|
84
|
+
},
|
|
85
|
+
overrides: {
|
|
86
|
+
...overridesOf(source.workspace, catalog),
|
|
87
|
+
...nested
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return withCli(`${encodeManifest(made)}\n`, vendor);
|
|
91
|
+
};
|
|
92
|
+
/** The `@ref0/git` import of the app's `src/git.ts`, naming what the store and the queue use. */
|
|
93
|
+
const gitServerImport = (choices) => `import { ${[
|
|
94
|
+
"createGitServer",
|
|
95
|
+
choices.objects !== "packs" && "loose",
|
|
96
|
+
choices.queue === "on" && "mergeQueue",
|
|
97
|
+
choices.objects === "packs" && "packs"
|
|
98
|
+
].filter(Predicate.isString).join(", ")} } from '@ref0/git';`;
|
|
99
|
+
/** The slots both platforms' `src/git.ts` fill alike: the queue's, and the store's past the head. */
|
|
100
|
+
const bodySlots = (choices, uploads) => {
|
|
101
|
+
const queue = choices.queue === "on";
|
|
102
|
+
return {
|
|
103
|
+
queueMerge: unless(queue, ""),
|
|
104
|
+
queue: unless(queue, ""),
|
|
105
|
+
objects: unless(choices.objects === "packs", looseObjects),
|
|
106
|
+
uploads: unless(uploads, "")
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/** The app's `src/git.ts` on Cloudflare: `apps/github`'s own, its store's and queue's slots filled. */
|
|
110
|
+
const cloudflareGit = (choices) => {
|
|
111
|
+
const packs = choices.objects === "packs";
|
|
112
|
+
return filled(templates.appGit, {
|
|
113
|
+
gitImport: gitServerImport(choices),
|
|
114
|
+
queueTypes: unless(choices.queue === "on", ""),
|
|
115
|
+
infraImport: unless(packs, looseInfraImport),
|
|
116
|
+
safety: unless(packs, "binds the objects, and D1"),
|
|
117
|
+
bucket: unless(packs, ""),
|
|
118
|
+
adapterAbout: unless(packs, "/** Git's records and jobs, whose store"),
|
|
119
|
+
adapterBucket: unless(packs, looseAdapterEnd),
|
|
120
|
+
...bodySlots(choices, packs)
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
/** Better Auth's database on Node, beside the records `--records` chose (init.md's table). */
|
|
124
|
+
const peopleOn = {
|
|
125
|
+
postgres: lines("// Better Auth's own pool, never Git's: a sign-up holds one of its connections while the session's", "// Git token is minted through Git, and on one shared pool that mint would wait on itself. Its", "// transactions are on, so a sign-up that fails partway leaves no person behind.", "const people = {", " dialect: new PostgresDialect({ pool: new pg.Pool({ connectionString: need('DATABASE_URL') }) }),", " type: 'postgres' as const,", " transaction: true,", "};"),
|
|
126
|
+
turso: lines("/** People and their sessions, in `git-auth`, one more database in the group: `npm run migrate` makes it. */", "const people = {", " dialect: new LibsqlDialect({", " url: databases.url('git-auth'),", " authToken: need('TURSO_GROUP_TOKEN'),", " }),", " type: 'sqlite' as const,", "};"),
|
|
127
|
+
sqlite: lines("/** People and their sessions: Better Auth's tables in a file of their own, which `npm run migrate` makes. */", "const people = new DatabaseSync('.data/auth.db');"),
|
|
128
|
+
"durable-objects": ""
|
|
129
|
+
};
|
|
130
|
+
/** The Kysely dialect Better Auth's database is read through on Node, when it takes one. */
|
|
131
|
+
const dialectOn = {
|
|
132
|
+
postgres: "import { PostgresDialect } from 'kysely';",
|
|
133
|
+
turso: "import { LibsqlDialect } from '@libsql/kysely-libsql';",
|
|
134
|
+
sqlite: false,
|
|
135
|
+
"durable-objects": false
|
|
136
|
+
};
|
|
137
|
+
/** The app's `src/git.ts` on Node: its imports, the store, the bucket, the jobs and Better Auth's database. */
|
|
138
|
+
const nodeHead = (choices) => {
|
|
139
|
+
const packs = choices.objects === "packs";
|
|
140
|
+
const queue = choices.queue === "on";
|
|
141
|
+
const dialect = dialectOn[choices.records];
|
|
142
|
+
return lines(firstImports(choices, false), dialect !== false && `${dialect}\n`, gitServerImport(choices), queue && "import type { MergeInput, MergePlan } from '@ref0/git';", "import { tokens } from '@ref0/git/auth';", "import { engine } from '@ref0/git/engine';", "import { xdiff } from '@ref0/git/node';", "import { createRestHandler } from '@ref0/git/rest';", "import { createGitHubHandler } from '@ref0/github';", infraImports(choices), "", `import { env${partsOf(choices).length > 0 ? ", need" : ""} } from './env.ts';`, "import { admin, approvalPage, hostPolicy, hostRules } from './policy.ts';", "import { privateReposOf } from './private-repos.ts';", "import { readyAdapter, readyAuth, starterAuth } from './signin/auth.ts';", "import { avatars } from './signin/avatars.ts';", "import { clientIpHeader } from './signin/client-ip.ts';", "import { appAuth } from './signin/host-session.ts';", "import { orgsOver } from './signin/orgs.ts';", "import { sealKey } from './signin/seal.ts';", "", "/** What the app reads from `.env`, as the server's entry reads it here. */", "export { env };", "", storeLines(choices), bucketLines(choices), "", "/** Git's jobs, which `server/plugins/jobs.ts` runs in this process. */", "export const jobs = createJobQueue({ store });", "", `/** Git's records, jobs${packs ? " and packs" : ""}, whose store also keeps the local seed's progress. */`, `export const adapter = { store, ${packs ? "bucket, " : ""}jobs };`, "", peopleOn[choices.records], "");
|
|
143
|
+
};
|
|
144
|
+
/** The app's `src/git.ts` on Node: `apps/github`'s own past its head, Node's head and parts in Cloudflare's place. */
|
|
145
|
+
const nodeGit = (choices) => filled(templates.appGitNode, {
|
|
146
|
+
head: `${nodeHead(choices)}\n`,
|
|
147
|
+
engine: " engine: engine({ xdiff: await xdiff() }),",
|
|
148
|
+
database: " database: people,",
|
|
149
|
+
ipHeader: lines(" // The server's own, which `src/server.ts` sets from the caller's address on every request.", " ipHeader: clientIpHeader,", ""),
|
|
150
|
+
classes: "",
|
|
151
|
+
...bodySlots(choices, choices.bucket === "s3")
|
|
152
|
+
});
|
|
153
|
+
/** The app's `src/git.ts`: Git, the drop-in and Better Auth over the host's policy. */
|
|
154
|
+
const appGitModule = (choices) => choices.platform === "node" ? nodeGit(choices) : cloudflareGit(choices);
|
|
155
|
+
/** The app's `src/env.ts`: `apps/github`'s own, its bucket's bindings and secrets as the store has them. */
|
|
156
|
+
const appEnvModule = (choices) => {
|
|
157
|
+
const packs = choices.objects === "packs";
|
|
158
|
+
return filled(templates.appEnv, {
|
|
159
|
+
types: unless(packs, "import type { D1Database, DurableObjectNamespace } from '@cloudflare/workers-types';"),
|
|
160
|
+
bucket: unless(packs, ""),
|
|
161
|
+
signing: unless(packs, "")
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
/** Where `vp dev` serves the app, the one origin Better Auth takes a POST from until it's deployed. */
|
|
165
|
+
const devOrigin = "http://localhost:5173";
|
|
166
|
+
/** The app's `wrangler.jsonc`: `apps/github`'s own, named `name`, its bucket as the store has it. */
|
|
167
|
+
const appWrangler = (choices, name) => {
|
|
168
|
+
const packs = choices.objects === "packs";
|
|
169
|
+
return filled(templates.appWrangler, {
|
|
170
|
+
about: unless(packs, "Durable Object classes, and D1"),
|
|
171
|
+
signing: unless(packs, ""),
|
|
172
|
+
name: ` "name": ${jsonString(name)},`,
|
|
173
|
+
vars: packs ? ` "vars": { "APP_ORIGIN": "${devOrigin}", "PACKS_BUCKET": "${bucketName(name)}" },` : ` "vars": { "APP_ORIGIN": "${devOrigin}" },`,
|
|
174
|
+
bucket: bucketLine(choices, name),
|
|
175
|
+
database: ` { "binding": "AUTH_DB", "database_name": "${name}-auth", "migrations_dir": "migrations/sql" },`
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
/** Everything `init --app` writes for `choices`, named `name`, from `source`. */
|
|
179
|
+
const appOutput = (choices, name, source, secret, vendor) => {
|
|
180
|
+
const made = [...platforms.cloudflare.secrets, ...platforms.cloudflare.dev];
|
|
181
|
+
return {
|
|
182
|
+
files: [
|
|
183
|
+
...source.files.filter((file) => copied(file.path)).map((file) => ({
|
|
184
|
+
path: file.path,
|
|
185
|
+
kind: "whole",
|
|
186
|
+
text: templates.appConfigs[file.path] ?? file.text
|
|
187
|
+
})),
|
|
188
|
+
{
|
|
189
|
+
path: "tsconfig.base.json",
|
|
190
|
+
kind: "whole",
|
|
191
|
+
text: source.base
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
path: "src/git.ts",
|
|
195
|
+
kind: "whole",
|
|
196
|
+
text: appGitModule(choices)
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
path: "src/env.ts",
|
|
200
|
+
kind: "whole",
|
|
201
|
+
text: appEnvModule(choices)
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
path: "wrangler.jsonc",
|
|
205
|
+
kind: "whole",
|
|
206
|
+
text: appWrangler(choices, name)
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
path: "package.json",
|
|
210
|
+
kind: "merge",
|
|
211
|
+
merge: (current) => current === void 0 ? appManifest(source, name, vendor) : mergePackage(choices, name, false, vendor)(current)
|
|
212
|
+
},
|
|
213
|
+
devVars(made, secret),
|
|
214
|
+
{
|
|
215
|
+
path: ".gitignore",
|
|
216
|
+
kind: "merge",
|
|
217
|
+
merge: (current) => ignoring(current, [
|
|
218
|
+
"node_modules",
|
|
219
|
+
".wrangler",
|
|
220
|
+
"dist"
|
|
221
|
+
], secretFiles)
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
manual: [],
|
|
225
|
+
needs: [],
|
|
226
|
+
packages: appPackages.map((each) => `@ref0/${each}`),
|
|
227
|
+
secret: `${listed(made)}, made for wrangler dev, in .dev.vars`,
|
|
228
|
+
next: "Make the app's tables in the folder with `npx wrangler d1 migrations apply AUTH_DB --local`, then check it"
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
export { appEnvModule, appGitModule, appManifest, appOutput, appPackages, appWrangler, checkedManifest, copied, entered };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { lines } from "./files.mjs";
|
|
2
|
+
import { fileRoutes, matcherImport, routeHandler } from "./routes.mjs";
|
|
3
|
+
// src/init/astro.ts
|
|
4
|
+
/**
|
|
5
|
+
* What `init` writes in an Astro project on Node: an endpoint for each route, rendered on request
|
|
6
|
+
* by `@astrojs/node`, and the adapter's step where the config has none or keeps its body limit.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A route's endpoint under `src/pages/`, where a rest parameter matches an empty path too, and a
|
|
10
|
+
* parameter such as `:repo` is the segment `[repo]`, with the text that follows it in the segment.
|
|
11
|
+
*/
|
|
12
|
+
const pathOf = (route) => {
|
|
13
|
+
const tail = {
|
|
14
|
+
rest: "/[...path]",
|
|
15
|
+
optional: "/[...path]",
|
|
16
|
+
segment: "/[id]",
|
|
17
|
+
none: ""
|
|
18
|
+
}[route.tail];
|
|
19
|
+
return `src/pages/${route.at.replace(/:(\w+)/g, "[$1]")}${tail}.ts`;
|
|
20
|
+
};
|
|
21
|
+
/** One endpoint: every method to Git's handler, rendered on request, never at build time. */
|
|
22
|
+
const endpoint = (choices, route, module) => {
|
|
23
|
+
const path = pathOf(route);
|
|
24
|
+
return {
|
|
25
|
+
path,
|
|
26
|
+
kind: "whole",
|
|
27
|
+
text: lines(`// ${route.says} Written by \`ref0-git init\`.`, "import type { APIRoute } from 'astro';", "", matcherImport(choices), "", "// Loaded on the first request, so `astro build` opens no database and needs no secret.", ...routeHandler(choices, path, module), "", "export const prerender = false;", "", "export const ALL: APIRoute = ({ request }) => git(request);", "")
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** Astro's endpoints for `choices`, over `framework`'s server module. */
|
|
31
|
+
const astroRouteFiles = (choices, framework) => fileRoutes(choices).map((route) => endpoint(choices, route, framework.serverModule));
|
|
32
|
+
/**
|
|
33
|
+
* The adapter's step: `@astrojs/node` where the config has no adapter, and its `bodySizeLimit`,
|
|
34
|
+
* 1 GiB by default, lifted where the config doesn't set it, so a larger push isn't cut off. The
|
|
35
|
+
* limit is the adapter's, for every route, so the step says it lifts the app's own too.
|
|
36
|
+
*/
|
|
37
|
+
const astroSteps = (framework) => {
|
|
38
|
+
const config = framework.config;
|
|
39
|
+
const node = framework.adapter?.name === "node";
|
|
40
|
+
const call = node ? framework.adapter?.call ?? "node" : "node";
|
|
41
|
+
if (node && config?.text.includes("bodySizeLimit")) return [];
|
|
42
|
+
return [{
|
|
43
|
+
path: config?.path ?? "astro.config.mjs",
|
|
44
|
+
why: "yours",
|
|
45
|
+
says: node ? "Lift @astrojs/node's 1 GiB bodySizeLimit, which cuts off a larger push, for every route, the app's own too" : "Serve Astro on Node with @astrojs/node, standalone, with no body limit for any route, the app's own too: astro add node installs it",
|
|
46
|
+
lines: [...node ? [] : ["import node from '@astrojs/node';", ""], `adapter: ${call}({ mode: 'standalone', bodySizeLimit: 0 }),`]
|
|
47
|
+
}];
|
|
48
|
+
};
|
|
49
|
+
export { astroRouteFiles, astroSteps };
|