Skip to content

Commit 4746c0c

Browse files
committed
Merge branch 'dev' into codex-init
2 parents 12155fb + 1884524 commit 4746c0c

86 files changed

Lines changed: 621 additions & 411 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"trailingComma": "none",
5+
"singleQuote": false,
6+
"semi": false,
7+
"importOrder": ["^[./]"],
8+
"importOrderMergeDuplicateImports": true,
9+
"importOrderBuiltinModulesToTop": true,
10+
"importOrderCombineTypeAndValueImports": true,
11+
"plugins": [
12+
"@ianvs/prettier-plugin-sort-imports",
13+
"prettier-plugin-tailwindcss"
14+
],
15+
"pluginSearchDirs": false
16+
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib",
33
"typescript.enablePromptUseWorkspaceTsdk": true
4-
}
4+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Button } from "@components/ui"
2-
import { Footer } from "app/layout/components"
2+
import { Footer } from "app/layout/_components"
33
import { TrustedBy } from "./TrustedBy"
44

55
export function Homepage() {
66
return (
77
<div className="overflow-hidden">
88
<div className="relative isolate pt-14">
9-
<div className="absolute inset-x-0 overflow-hidden -top-40 -z-10 transform-gpu blur-3xl sm:-top-80">
9+
<div className="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80">
1010
<svg
1111
className="relative left-[calc(50%-11rem)] -z-10 h-[21.1875rem] max-w-none -translate-x-1/2 rotate-[30deg] sm:left-[calc(50%-30rem)] sm:h-[42.375rem]"
1212
viewBox="0 0 1155 678"
@@ -31,13 +31,13 @@ export function Homepage() {
3131
</defs>
3232
</svg>
3333
</div>
34-
<div className="pt-24 pb-16 sm:pt-32">
35-
<div className="px-6 mx-auto max-w-7xl lg:px-8">
36-
<div className="max-w-2xl mx-auto text-center">
34+
<div className="pb-16 pt-24 sm:pt-32">
35+
<div className="mx-auto max-w-7xl px-6 lg:px-8">
36+
<div className="mx-auto max-w-2xl text-center">
3737
<h1 className="text-4xl font-bold tracking-tight text-white sm:text-6xl">
3838
PR-Codex
3939
</h1>
40-
<p className="max-w-[40rem] mx-auto mt-6 text-lg leading-8 text-gray-300">
40+
<p className="mx-auto mt-6 max-w-[40rem] text-lg leading-8 text-gray-300">
4141
A github app to summarize code diffs in pull requests. Powered
4242
by ChatGPT.
4343
</p>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export const revalidate = 60 * 60 * 3 // 3 hours
44

55
export function TrustedBy() {
66
return (
7-
<div className="max-w-lg px-4 pt-24 pb-16 mx-auto md:max-w-screen-xl md:px-8">
8-
<h2 className="mb-12 text-2xl font-bold tracking-tight text-center text-gray-400">
7+
<div className="mx-auto max-w-lg px-4 pb-16 pt-24 md:max-w-screen-xl md:px-8">
8+
<h2 className="mb-12 text-center text-2xl font-bold tracking-tight text-gray-400">
99
Trusted by
1010
</h2>
1111
{/* @ts-expect-error Async Server Component */}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import Fork from "@components/icons/Fork"
2+
import Star from "@components/icons/Star"
3+
import { ListIterator } from "@components/ui"
14
import { getInstallations } from "@utils/github/getInstallations"
25
import { getRepositories } from "@utils/github/getRepositories"
3-
import Image from "next/image"
46
import { githubColors } from "@utils/githubColors"
5-
import Star from "@components/icons/Star"
6-
import Fork from "@components/icons/Fork"
7-
import { ListIterator } from "@components/ui"
7+
import Image from "next/image"
88

99
export async function TrustedByList() {
1010
const installations = await getInstallations()
@@ -53,14 +53,14 @@ export async function TrustedByList() {
5353
<ListIterator initItems={6}>
5454
{topUsersRepos.map((repo) => (
5555
<a
56-
className="w-full p-4 border border-gray-700 rounded-md bg-[#0d1117] hover:bg-gray-800/60 h-48 flex flex-col justify-between"
56+
className="flex h-48 w-full flex-col justify-between rounded-md border border-gray-700 bg-[#0d1117] p-4 hover:bg-gray-800/60"
5757
key={repo.id}
5858
target="_blank"
5959
rel="noreferrer"
6060
href={repo.html_url}
6161
>
6262
<div>
63-
<div className="flex items-center mb-4">
63+
<div className="mb-4 flex items-center">
6464
<div
6565
//target="_blank" rel="noreferrer" href={repo.owner.html_url}
6666
>
@@ -76,15 +76,15 @@ export async function TrustedByList() {
7676
{repo.full_name}
7777
</p>
7878
</div>
79-
<p className="text-sm text-gray-400 line-clamp-3">
79+
<p className="line-clamp-3 text-sm text-gray-400">
8080
{repo.description}
8181
</p>
8282
</div>
8383
<div className="flex items-center gap-5">
8484
{repo.language && (
8585
<div className="flex items-center">
8686
<div
87-
className="w-4 h-4 mr-2 rounded-full bg-red-50"
87+
className="mr-2 h-4 w-4 rounded-full bg-red-50"
8888
style={{
8989
backgroundColor: githubColors[repo.language]?.color
9090
}}

app/github/route.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
export const fetchCache = "force-no-store"
2-
3-
import { NextRequest, NextResponse } from "next/server"
4-
import { summarizePullRequest } from "@lib/summarizePullRequest"
51
import { handleGithubAuth } from "@lib/handleGithubAuth"
2+
import { replyIssueComment } from "@lib/replyIssueComment"
3+
import { summarizePullRequest } from "@lib/summarizePullRequest"
4+
import { NextRequest, NextResponse } from "next/server"
5+
6+
export const fetchCache = "force-no-store"
67

78
export async function POST(req: NextRequest) {
89
const payload = await req.json()
910

1011
try {
1112
if (payload.action == "opened" || payload.action == "synchronize") {
13+
// If a PR is opened or updated, summarize it
1214
const octokit = await handleGithubAuth(payload)
1315

1416
await summarizePullRequest(payload, octokit)
17+
} else if (payload.action == "created") {
18+
if (payload.comment.body.includes("/codex-ask")) {
19+
// If a comment is created, reply to it
20+
const octokit = await handleGithubAuth(payload)
21+
22+
await replyIssueComment(payload, octokit)
23+
}
1524
}
1625

1726
return NextResponse.json("ok")

app/head.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/layout/components/AppLayout/AppLayout.tsx renamed to app/layout/_components/AppLayout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Footer, Modal, Navbar } from ".."
33
export default function AppLayout({ children }: { children: React.ReactNode }) {
44
return (
55
<>
6-
<div className="relative flex flex-col justify-between min-h-screen">
6+
<div className="relative flex min-h-screen flex-col justify-between">
77
{/* <Navbar /> */}
88
{children}
99
{/* <Footer /> */}

0 commit comments

Comments
 (0)