From 8b0d562ad9f1cc86997176e1ae5237481ce9da30 Mon Sep 17 00:00:00 2001 From: jj_ranalli Date: Thu, 13 Apr 2023 18:31:22 +0200 Subject: [PATCH 1/2] fix: prompt --- lib/summarizePullRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/summarizePullRequest.ts b/lib/summarizePullRequest.ts index 1ed2426..d866f32 100644 --- a/lib/summarizePullRequest.ts +++ b/lib/summarizePullRequest.ts @@ -38,7 +38,7 @@ export async function summarizePullRequest(payload: any, octokit: Octokit) { // If there are changes, trigger workflow if (codeDiff.length != 0) { - const systemPrompt = `You are a Git diff assistant. Always begin with "This PR". Given a code diff, you provide a simple description in prose, in less than 300 chars, which sums up the changes. Continue with "\n\n### Detailed summary\n" and make a comprehensive list of all changes. Be concise. Always wrap file names, functions, objects and similar in backticks (\`).${ + const systemPrompt = `You are a Git diff assistant. Always begin with "This PR". Given a code diff, you provide a simple description in prose, in less than 300 chars, which sums up the changes. Continue with "\n\n### Detailed summary\n" and make a comprehensive list of all changes, excluding any eventual skipped files. Be concise. Always wrap file names, functions, objects and similar in backticks (\`).${ skippedFiles.length != 0 ? ` After the list, conclude with "\n\n> " and mention that the following files were skipped due to too many changes: ${skippedFiles.join( "," From 835b0fc8ec5937afe4687f57d20dd6bf4fd48a1f Mon Sep 17 00:00:00 2001 From: jj_ranalli Date: Sat, 15 Apr 2023 02:26:05 +0200 Subject: [PATCH 2/2] chore: metadata, fixes and prettier --- .prettierrc | 16 ++ .vscode/settings.json | 2 +- app/{components => _components}/Homepage.tsx | 12 +- app/{components => _components}/TrustedBy.tsx | 4 +- .../TrustedByList.tsx | 16 +- {public/favicon => app}/favicon.ico | Bin app/github/route.ts | 8 +- app/head.tsx | 24 -- .../AppLayout/AppLayout.tsx | 2 +- .../AppLayout/index.ts | 0 .../BackgroundImage/BackgroundImage.tsx | 0 .../BackgroundImage/index.ts | 0 .../Container/Container.tsx | 4 +- .../Container/index.ts | 0 .../DropdownMenu/DropdownMenu.tsx | 9 +- .../DropdownMenu/index.ts | 0 .../DropdownMenuElement.tsx | 0 .../DropdownMenuElement/index.ts | 0 .../Footer/Footer.tsx | 2 +- .../Footer/index.ts | 0 app/layout/_components/Metadata/Metadata.tsx | 46 ++++ .../_components/Metadata/MetadataConfig.tsx | 9 + app/layout/_components/Metadata/index.ts | 2 + .../Modal/Modal.tsx | 16 +- .../Modal/index.ts | 0 .../Navbar/Navbar.tsx | 12 +- .../Navbar/index.ts | 0 .../Social/Social.tsx | 2 +- .../Social/index.ts | 0 .../{components => _components}/index.ts | 2 +- .../AppContext/AppContext.tsx | 3 +- .../{context => _context}/AppContext/index.ts | 0 app/layout/{context => _context}/index.ts | 0 .../components/DefaultHead/DefaultHead.tsx | 52 ---- app/layout/components/DefaultHead/index.ts | 1 - app/layout/index.tsx | 7 +- .../og_image.png => app/opengraph-image.png | Bin app/page.tsx | 2 +- app/profile/components/ProfilePage.tsx | 2 +- app/robots.ts | 12 + app/sitemap.ts | 20 ++ .../twitter_card.png => app/twitter_image.png | Bin components/icons/Arrow.tsx | 2 +- components/icons/Chevron.tsx | 2 +- components/icons/Delete.tsx | 2 +- components/icons/Info.tsx | 2 +- components/icons/Nightwind.tsx | 3 +- components/icons/Refresh.tsx | 2 +- components/ui/ActionScreen/ActionScreen.tsx | 8 +- components/ui/Button/Button.tsx | 2 +- components/ui/CardBasic/CardBasic.tsx | 2 +- .../ui/CollapsibleItem/CollapsibleItem.tsx | 12 +- components/ui/Input/Input.tsx | 12 +- components/ui/Input/index.ts | 2 +- components/ui/InputSwitch/InputSwitch.tsx | 4 +- components/ui/InputTextarea/InputTextarea.tsx | 8 +- components/ui/ListIterator/ListIterator.tsx | 2 +- components/ui/MySwitch/MySwitch.tsx | 6 +- components/ui/NoteText/NoteText.tsx | 2 +- components/ui/Question/Question.tsx | 6 +- lib/cors.ts | 2 +- lib/summarizePullRequest.ts | 5 +- next-env.d.ts | 1 - package-lock.json | 258 ++++++++++++------ package.json | 4 +- pages/sitemap.xml.ts | 39 --- public/favicon/android-chrome-192x192.png | Bin 5300 -> 0 bytes public/favicon/android-chrome-512x512.png | Bin 17965 -> 0 bytes public/favicon/apple-touch-icon.png | Bin 4718 -> 0 bytes public/favicon/favicon-16x16.png | Bin 343 -> 0 bytes public/favicon/favicon-32x32.png | Bin 688 -> 0 bytes public/favicon/site.webmanifest | 1 - public/robots.txt | 2 - scripts/summarize.ts | 5 +- styles/global/base.css | 2 +- styles/global/fonts.css | 2 +- styles/home.css | 2 +- tailwind.config.ts | 7 +- 78 files changed, 388 insertions(+), 308 deletions(-) create mode 100644 .prettierrc rename app/{components => _components}/Homepage.tsx (90%) rename app/{components => _components}/TrustedBy.tsx (65%) rename app/{components => _components}/TrustedByList.tsx (91%) rename {public/favicon => app}/favicon.ico (100%) delete mode 100644 app/head.tsx rename app/layout/{components => _components}/AppLayout/AppLayout.tsx (77%) rename app/layout/{components => _components}/AppLayout/index.ts (100%) rename app/layout/{components => _components}/BackgroundImage/BackgroundImage.tsx (100%) rename app/layout/{components => _components}/BackgroundImage/index.ts (100%) rename app/layout/{components => _components}/Container/Container.tsx (75%) rename app/layout/{components => _components}/Container/index.ts (100%) rename app/layout/{components => _components}/DropdownMenu/DropdownMenu.tsx (82%) rename app/layout/{components => _components}/DropdownMenu/index.ts (100%) rename app/layout/{components => _components}/DropdownMenuElement/DropdownMenuElement.tsx (100%) rename app/layout/{components => _components}/DropdownMenuElement/index.ts (100%) rename app/layout/{components => _components}/Footer/Footer.tsx (92%) rename app/layout/{components => _components}/Footer/index.ts (100%) create mode 100644 app/layout/_components/Metadata/Metadata.tsx create mode 100644 app/layout/_components/Metadata/MetadataConfig.tsx create mode 100644 app/layout/_components/Metadata/index.ts rename app/layout/{components => _components}/Modal/Modal.tsx (73%) rename app/layout/{components => _components}/Modal/index.ts (100%) rename app/layout/{components => _components}/Navbar/Navbar.tsx (77%) rename app/layout/{components => _components}/Navbar/index.ts (100%) rename app/layout/{components => _components}/Social/Social.tsx (97%) rename app/layout/{components => _components}/Social/index.ts (100%) rename app/layout/{components => _components}/index.ts (89%) rename app/layout/{context => _context}/AppContext/AppContext.tsx (99%) rename app/layout/{context => _context}/AppContext/index.ts (100%) rename app/layout/{context => _context}/index.ts (100%) delete mode 100644 app/layout/components/DefaultHead/DefaultHead.tsx delete mode 100644 app/layout/components/DefaultHead/index.ts rename public/og_image.png => app/opengraph-image.png (100%) create mode 100644 app/robots.ts create mode 100644 app/sitemap.ts rename public/twitter_card.png => app/twitter_image.png (100%) delete mode 100644 pages/sitemap.xml.ts delete mode 100644 public/favicon/android-chrome-192x192.png delete mode 100644 public/favicon/android-chrome-512x512.png delete mode 100644 public/favicon/apple-touch-icon.png delete mode 100644 public/favicon/favicon-16x16.png delete mode 100644 public/favicon/favicon-32x32.png delete mode 100644 public/favicon/site.webmanifest delete mode 100644 public/robots.txt diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..6036fc3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "trailingComma": "none", + "singleQuote": false, + "semi": false, + "importOrder": ["^[./]"], + "importOrderMergeDuplicateImports": true, + "importOrderBuiltinModulesToTop": true, + "importOrderCombineTypeAndValueImports": true, + "plugins": [ + "@ianvs/prettier-plugin-sort-imports", + "prettier-plugin-tailwindcss" + ], + "pluginSearchDirs": false +} diff --git a/.vscode/settings.json b/.vscode/settings.json index d067910..fae8e3d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "typescript.tsdk": "node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true -} \ No newline at end of file +} diff --git a/app/components/Homepage.tsx b/app/_components/Homepage.tsx similarity index 90% rename from app/components/Homepage.tsx rename to app/_components/Homepage.tsx index 7cbb94e..ef8bed1 100644 --- a/app/components/Homepage.tsx +++ b/app/_components/Homepage.tsx @@ -1,12 +1,12 @@ import { Button } from "@components/ui" -import { Footer } from "app/layout/components" +import { Footer } from "app/layout/_components" import { TrustedBy } from "./TrustedBy" export function Homepage() { return (
-
+
-
-
-
+
+
+

PR-Codex

-

+

A github app to summarize code diffs in pull requests. Powered by ChatGPT.

diff --git a/app/components/TrustedBy.tsx b/app/_components/TrustedBy.tsx similarity index 65% rename from app/components/TrustedBy.tsx rename to app/_components/TrustedBy.tsx index 1d788ae..8193f7b 100644 --- a/app/components/TrustedBy.tsx +++ b/app/_components/TrustedBy.tsx @@ -4,8 +4,8 @@ export const revalidate = 60 * 60 * 3 // 3 hours export function TrustedBy() { return ( -
-

+
+

Trusted by

{/* @ts-expect-error Async Server Component */} diff --git a/app/components/TrustedByList.tsx b/app/_components/TrustedByList.tsx similarity index 91% rename from app/components/TrustedByList.tsx rename to app/_components/TrustedByList.tsx index 8dfd220..755784e 100644 --- a/app/components/TrustedByList.tsx +++ b/app/_components/TrustedByList.tsx @@ -1,10 +1,10 @@ +import Fork from "@components/icons/Fork" +import Star from "@components/icons/Star" +import { ListIterator } from "@components/ui" import { getInstallations } from "@utils/github/getInstallations" import { getRepositories } from "@utils/github/getRepositories" -import Image from "next/image" import { githubColors } from "@utils/githubColors" -import Star from "@components/icons/Star" -import Fork from "@components/icons/Fork" -import { ListIterator } from "@components/ui" +import Image from "next/image" export async function TrustedByList() { const installations = await getInstallations() @@ -53,14 +53,14 @@ export async function TrustedByList() { {topUsersRepos.map((repo) => (
-
+
@@ -76,7 +76,7 @@ export async function TrustedByList() { {repo.full_name}

-

+

{repo.description}

@@ -84,7 +84,7 @@ export async function TrustedByList() { {repo.language && (
- - - {appTitle} - - - - - - - - - ) -} diff --git a/app/layout/components/AppLayout/AppLayout.tsx b/app/layout/_components/AppLayout/AppLayout.tsx similarity index 77% rename from app/layout/components/AppLayout/AppLayout.tsx rename to app/layout/_components/AppLayout/AppLayout.tsx index b9721ca..c8a8814 100644 --- a/app/layout/components/AppLayout/AppLayout.tsx +++ b/app/layout/_components/AppLayout/AppLayout.tsx @@ -3,7 +3,7 @@ import { Footer, Modal, Navbar } from ".." export default function AppLayout({ children }: { children: React.ReactNode }) { return ( <> -
+
{/* */} {children} {/*