From 601ff0173fcab6fcfdb5547cbd2ff9b784042565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sof=C3=ADa=20Aritz?= Date: Mon, 15 Jun 2026 21:23:39 +0200 Subject: [PATCH] License headers and linting --- README.md | 10 +++++++++- src/app/actions.ts | 2 +- src/app/api/tap/webhook/route.ts | 4 ++-- src/app/profile/[did]/page.tsx | 14 +++++--------- src/components/ContentPageLayout.tsx | 5 +++-- src/components/EmptyActivity.tsx | 6 ------ src/components/EntryCard.tsx | 2 -- src/components/LoginForm.tsx | 8 ++++---- src/lib/announcements.tsx | 2 +- src/lib/auth/client.ts | 2 +- src/lib/db/index.ts | 2 +- 11 files changed, 27 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index a0524c9..e41a5d7 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,12 @@ Everest is part of the ATmosphere. 4. Run `yarn tap` to start Tap. * Repositories are dynamically added by the server. 5. Run `yarn dev` to start the development server. -6. Open [http://localhost:3000](http://localhost:3000) with your browser. \ No newline at end of file +6. Open [http://localhost:3000](http://localhost:3000) with your browser. + +### Development + +Before submitting any changes, ensure that the following steps have been performed: + +1. The code has been linted: `yarn lint` + * Many errors and warnings can be fixed with `yarn lint --fix`. +2. Any news files have the required license headers: `yarn license-headers`. \ No newline at end of file diff --git a/src/app/actions.ts b/src/app/actions.ts index 10a07bf..9ce7aab 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -34,7 +34,7 @@ const isValidURL = (url: string) => { }; const error = (message?: string) => { return { success: false as const, message, } }; -const success = = {}>(data?: T) => { +const success = = Record>(data?: T) => { return { success: true as const, ...data } as { success: true } & T; }; diff --git a/src/app/api/tap/webhook/route.ts b/src/app/api/tap/webhook/route.ts index 5edf976..697179e 100644 --- a/src/app/api/tap/webhook/route.ts +++ b/src/app/api/tap/webhook/route.ts @@ -86,7 +86,7 @@ export async function POST(request: NextRequest) { console.log("[tap/webhook] |> event.action=create|update for record", uri.toString()); if (event.collection === com.sofiaritz.everest.entry.$type) { - let record = tryParseRecord( + const record = tryParseRecord( event.record, com.sofiaritz.everest.entry.$parse, ); if (!record) return NextResponse.json({ success: false }); @@ -101,7 +101,7 @@ export async function POST(request: NextRequest) { indexedAt: new Date(), }); } else if (event.collection === com.sofiaritz.everest.graph.follow.$type) { - let record = tryParseRecord( + const record = tryParseRecord( event.record, com.sofiaritz.everest.graph.follow.$parse, ); if (!record) return NextResponse.json({ success: false }); diff --git a/src/app/profile/[did]/page.tsx b/src/app/profile/[did]/page.tsx index 6e5f3ee..5d16bf7 100644 --- a/src/app/profile/[did]/page.tsx +++ b/src/app/profile/[did]/page.tsx @@ -17,16 +17,13 @@ */ import { EntryCard } from "@/components/EntryCard"; -import { EntryDialog } from "@/components/EntryDialog"; -import { ProfileDropdown } from "@/components/ProfileDropdown"; import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty"; import { getSession } from "@/lib/auth/session"; import { getAccountAvatar, getAccountEntries, getAccountHandle, getNetworkEntries } from "@/lib/db/queries"; -import { MountainSnow, Astroid, Sprout } from "lucide-react"; +import { Sprout } from "lucide-react"; import { FollowButton } from "@/components/FollowButton"; -import { ANNOUNCEMENTS } from "@/lib/announcements"; -import { AnnouncementCard } from "@/components/AnnouncementCard"; import { ContentPageLayout } from "@/components/ContentPageLayout"; +import Image from "next/image"; export default async function Page({ params }: PageProps<"/profile/[did]">) { const { did } = await params; @@ -39,9 +36,8 @@ export default async function Page({ params }: PageProps<"/profile/[did]">) { const isLoggedIn = session != null; const isSelf = isLoggedIn && session.did === profileDid; - let handle, avatar, activityEntries; + let handle, avatar; if (isLoggedIn) { - activityEntries = await getNetworkEntries(session.did, 10); handle = await getAccountHandle(session.did) ?? session.did; // FIXME(sofiaritz.com): Find proper fallback avatar = await getAccountAvatar(session.did) ?? `https://api.dicebear.com/10.x/lorelei-neutral/svg?seed=${session.did}`; @@ -56,7 +52,7 @@ export default async function Page({ params }: PageProps<"/profile/[did]">) { currentUser={isLoggedIn ? { handle: handle!, avatar: avatar!, did: profileDid } : undefined} >
- {profileHandle}) { - It's eerly silent over here... + It's eerly silent over here... Looks like this user has not shared anything yet diff --git a/src/components/ContentPageLayout.tsx b/src/components/ContentPageLayout.tsx index 90ea100..6d1a65a 100644 --- a/src/components/ContentPageLayout.tsx +++ b/src/components/ContentPageLayout.tsx @@ -22,6 +22,7 @@ import { EntryDialog } from "@/components/EntryDialog"; import { ProfileDropdown } from "@/components/ProfileDropdown"; import { ANNOUNCEMENTS } from "@/lib/announcements"; import { AnnouncementCard } from "@/components/AnnouncementCard"; +import Link from "next/link"; export function ContentPageLayout({ children, isLoggedIn, currentUser }: { children: ReactNode; @@ -35,12 +36,12 @@ export function ContentPageLayout({ children, isLoggedIn, currentUser }: { return (
- +

Everest

-
+

Share and discover indie websites submitted by people all over the net! diff --git a/src/components/EmptyActivity.tsx b/src/components/EmptyActivity.tsx index 14ffd44..6c6b393 100644 --- a/src/components/EmptyActivity.tsx +++ b/src/components/EmptyActivity.tsx @@ -18,10 +18,8 @@ "use client" -import { Button } from "@/components/ui/button" import { Empty, - EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, @@ -30,10 +28,6 @@ import { import { MoonStar } from "lucide-react" export function EmptyActivity() { - function handleLogin() { - window.location.href = "/auth/login"; - } - return ( diff --git a/src/components/EntryCard.tsx b/src/components/EntryCard.tsx index 2c5eb15..1de3781 100644 --- a/src/components/EntryCard.tsx +++ b/src/components/EntryCard.tsx @@ -18,8 +18,6 @@ import { EntryTable } from "@/lib/db"; import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card"; -import { getSession } from "@/lib/auth/session"; -import { Agent } from "@atproto/api"; import { ExternalLink } from "lucide-react"; import { Separator } from "./ui/separator"; import { Badge } from "./ui/badge"; diff --git a/src/components/LoginForm.tsx b/src/components/LoginForm.tsx index a6ff9a8..7ef6125 100644 --- a/src/components/LoginForm.tsx +++ b/src/components/LoginForm.tsx @@ -19,10 +19,10 @@ "use client" import { useState } from "react" -import { Button } from "./ui/button"; -import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./ui/card"; -import { Label } from "./ui/label"; -import { Input } from "./ui/input"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; +import { Input } from "@/components/ui/input"; export function LoginForm() { const [handle, setHandle] = useState(""); diff --git a/src/lib/announcements.tsx b/src/lib/announcements.tsx index ffa0b34..46c169e 100644 --- a/src/lib/announcements.tsx +++ b/src/lib/announcements.tsx @@ -28,7 +28,7 @@ export const ANNOUNCEMENTS: { uid: number; title: string; message: ReactNode; au Please share with me any suggestions and bug reports , - they're highly appreciated! + they're highly appreciated! ), author: "SofĂ­a", diff --git a/src/lib/auth/client.ts b/src/lib/auth/client.ts index 658ee0a..f450ae9 100644 --- a/src/lib/auth/client.ts +++ b/src/lib/auth/client.ts @@ -16,7 +16,7 @@ * Everest. If not, see . */ -import { buildAtprotoLoopbackClientMetadata, JoseKey, Keyset, NodeOAuthClient, NodeSavedSession, NodeSavedState, OAuthClientMetadata, OAuthClientMetadataInput } from "@atproto/oauth-client-node"; +import { buildAtprotoLoopbackClientMetadata, JoseKey, Keyset, NodeOAuthClient, NodeSavedSession, NodeSavedState, OAuthClientMetadataInput } from "@atproto/oauth-client-node"; import { getDb } from "../db"; export const SCOPE = "atproto account:email transition:generic"; diff --git a/src/lib/db/index.ts b/src/lib/db/index.ts index 023236e..43ce6fa 100644 --- a/src/lib/db/index.ts +++ b/src/lib/db/index.ts @@ -16,7 +16,7 @@ * Everest. If not, see . */ -import { Generated, Kysely, PostgresDialect } from "kysely"; +import { Kysely, PostgresDialect } from "kysely"; import { Pool } from "pg"; let db: Kysely | null = null; -- 2.51.2