fix: make it build
This commit is contained in:
@@ -7,10 +7,10 @@ import { Skeleton } from '@/components/ui/skeleton'
|
|||||||
import { getDb } from '@/lib/db'
|
import { getDb } from '@/lib/db'
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
params: {
|
params: Promise<{
|
||||||
owner: string
|
owner: string
|
||||||
repo: string
|
repo: string
|
||||||
}
|
}>
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getReadmeContent(owner: string, repo: string) {
|
async function getReadmeContent(owner: string, repo: string) {
|
||||||
@@ -49,7 +49,8 @@ async function getReadmeContent(owner: string, repo: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
||||||
const data = await getReadmeContent(params.owner, params.repo)
|
const { owner, repo } = await params
|
||||||
|
const data = await getReadmeContent(owner, repo)
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return {
|
return {
|
||||||
@@ -69,7 +70,8 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function ReadmePage({ params }: PageProps) {
|
export default async function ReadmePage({ params }: PageProps) {
|
||||||
const data = await getReadmeContent(params.owner, params.repo)
|
const { owner, repo } = await params
|
||||||
|
const data = await getReadmeContent(owner, repo)
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
notFound()
|
notFound()
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ interface RepositoryDetailResponse {
|
|||||||
marked.use({
|
marked.use({
|
||||||
breaks: true,
|
breaks: true,
|
||||||
gfm: true,
|
gfm: true,
|
||||||
headerIds: true,
|
|
||||||
mangle: false,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
marked.use(
|
marked.use(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
import { Suspense } from 'react'
|
||||||
import { useSearchParams, useRouter } from 'next/navigation'
|
import { useSearchParams, useRouter } from 'next/navigation'
|
||||||
import { Search, Star, Filter, SlidersHorizontal, ExternalLink } from 'lucide-react'
|
import { Search, Star, Filter, SlidersHorizontal, ExternalLink } from 'lucide-react'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
@@ -50,7 +51,7 @@ interface StatsResponse {
|
|||||||
categories: { name: string; count: number }[]
|
categories: { name: string; count: number }[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SearchPage() {
|
function SearchPageContent() {
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@@ -370,3 +371,11 @@ export default function SearchPage() {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function SearchPage() {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
|
<SearchPageContent />
|
||||||
|
</Suspense>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export function CommandMenu({ open, setOpen }: CommandMenuProps) {
|
|||||||
const fetchData = React.useCallback(async () => {
|
const fetchData = React.useCallback(async () => {
|
||||||
const response = await fetch(`/api/search?q=${encodeURIComponent(search)}`)
|
const response = await fetch(`/api/search?q=${encodeURIComponent(search)}`)
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
setResults(...data.results);
|
setResults(data.results);
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|||||||
@@ -1282,7 +1282,6 @@ export const EditorFormatUnderline = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BubbleMenuButton
|
<BubbleMenuButton
|
||||||
// @ts-expect-error "TipTap extensions are not typed"
|
|
||||||
command={() => editor.chain().focus().toggleUnderline().run()}
|
command={() => editor.chain().focus().toggleUnderline().run()}
|
||||||
hideName={hideName}
|
hideName={hideName}
|
||||||
icon={UnderlineIcon}
|
icon={UnderlineIcon}
|
||||||
@@ -1343,7 +1342,6 @@ export const EditorLinkSelector = ({
|
|||||||
const href = getUrlFromString(url);
|
const href = getUrlFromString(url);
|
||||||
|
|
||||||
if (href) {
|
if (href) {
|
||||||
// @ts-expect-error "TipTap extensions are not typed"
|
|
||||||
editor.chain().focus().setLink({ href }).run();
|
editor.chain().focus().setLink({ href }).run();
|
||||||
onOpenChange?.(false);
|
onOpenChange?.(false);
|
||||||
}
|
}
|
||||||
@@ -1388,7 +1386,6 @@ export const EditorLinkSelector = ({
|
|||||||
<Button
|
<Button
|
||||||
className="flex h-8 items-center rounded-sm p-1 text-destructive transition-all hover:bg-destructive-foreground dark:hover:bg-destructive"
|
className="flex h-8 items-center rounded-sm p-1 text-destructive transition-all hover:bg-destructive-foreground dark:hover:bg-destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// @ts-expect-error "TipTap extensions are not typed"
|
|
||||||
editor.chain().focus().unsetLink().run();
|
editor.chain().focus().unsetLink().run();
|
||||||
onOpenChange?.(false);
|
onOpenChange?.(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
22
eslint.config.mjs
Normal file
22
eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { dirname } from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
});
|
||||||
|
|
||||||
|
const eslintConfig = [
|
||||||
|
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
@@ -70,13 +70,14 @@
|
|||||||
"zustand": "^4.5.0"
|
"zustand": "^4.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@types/better-sqlite3": "^7.6.9",
|
"@types/better-sqlite3": "^7.6.9",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^18",
|
"@types/react": "^18",
|
||||||
"@types/react-dom": "^18",
|
"@types/react-dom": "^18",
|
||||||
"autoprefixer": "^10.4.18",
|
"autoprefixer": "^10.4.18",
|
||||||
"eslint": "^8",
|
"eslint": "^9.38.0",
|
||||||
"eslint-config-next": "14.2.0",
|
"eslint-config-next": "16.0.0",
|
||||||
"shadcn": "^3.5.0",
|
"shadcn": "^3.5.0",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|||||||
781
pnpm-lock.yaml
generated
781
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user