Skip to content

Commit a825040

Browse files
committed
update all deps
1 parent 5a1ba02 commit a825040

Some content is hidden

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

48 files changed

+1981
-2024
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_PROXY_URL="https://classcharts-proxy.veloi.workers.dev"

app/(docs)/[[...slug]]/page.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { openapi, source } from "@/app/source";
1+
import { source } from "@/app/source";
22
import type { Metadata } from "next";
33
import {
44
DocsPage,
@@ -7,14 +7,14 @@ import {
77
DocsTitle,
88
} from "fumadocs-ui/page";
99
import { notFound } from "next/navigation";
10-
import defaultMdxComponents from "fumadocs-ui/mdx";
10+
import { getMDXComponents } from "@/mdx-components";
1111

1212
export default async function Page({
1313
params,
1414
}: {
15-
params: { slug?: string[] };
15+
params: Promise<{ slug?: string[] }>;
1616
}) {
17-
const page = source.getPage(params.slug);
17+
const page = source.getPage((await params).slug);
1818
if (!page) notFound();
1919

2020
const MDX = page.data.body;
@@ -24,9 +24,7 @@ export default async function Page({
2424
<DocsTitle>{page.data.title}</DocsTitle>
2525
<DocsDescription>{page.data.description}</DocsDescription>
2626
<DocsBody>
27-
<MDX
28-
components={{ ...defaultMdxComponents, APIPage: openapi.APIPage }}
29-
/>
27+
<MDX components={getMDXComponents()} />
3028
</DocsBody>
3129
</DocsPage>
3230
);
@@ -36,8 +34,10 @@ export async function generateStaticParams() {
3634
return source.generateParams();
3735
}
3836

39-
export function generateMetadata({ params }: { params: { slug?: string[] } }) {
40-
const page = source.getPage(params.slug);
37+
export async function generateMetadata({
38+
params,
39+
}: { params: Promise<{ slug?: string[] }> }) {
40+
const page = source.getPage((await params).slug);
4141
if (!page) notFound();
4242

4343
return {

app/(docs)/layout.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { DocsLayout } from 'fumadocs-ui/layout';
2-
import type { ReactNode } from 'react';
3-
import { baseOptions } from '../layout.config';
4-
import { source } from '@/app/source';
1+
import { DocsLayout } from "fumadocs-ui/layouts/notebook";
2+
import type { ReactNode } from "react";
3+
import { baseOptions } from "../layout.config";
4+
import { source } from "@/app/source";
55

66
export default function Layout({ children }: { children: ReactNode }) {
7-
return (
8-
<DocsLayout tree={source.pageTree} {...baseOptions}>
9-
{children}
10-
</DocsLayout>
11-
);
7+
return (
8+
<DocsLayout tree={source.pageTree} {...baseOptions}>
9+
{children}
10+
</DocsLayout>
11+
);
1212
}

app/global.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
2+
@import "fumadocs-ui/css/neutral.css";
3+
@import "fumadocs-ui/css/preset.css";
4+
5+
@source '../node_modules/fumadocs-openapi/dist/**/*.js';
46

57
:root {
6-
--fd-sidebar-width: 375px;
7-
--primary: 221.2 83.2% 53.3%;
8+
--fd-layout-width: 1400px;
9+
--color-fd-primary: oklch(62.3% 0.214 259.815);
810
}
911

1012
.dark {
11-
--primary: 213.1 93.9% 67.8%;
13+
--color-fd-primary: oklch(70.7% 0.165 254.624);
1214
}

app/layout.config.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type HomeLayoutProps } from "fumadocs-ui/home-layout";
1+
import { type BaseLayoutProps } from "fumadocs-ui/layouts/shared";
22

33
/**
44
* Shared layout configurations
@@ -7,9 +7,10 @@ import { type HomeLayoutProps } from "fumadocs-ui/home-layout";
77
* Home Layout: app/(home)/layout.tsx
88
* Docs Layout: app/docs/layout.tsx
99
*/
10-
export const baseOptions: HomeLayoutProps = {
11-
nav: {
12-
title: <span className="text-lg md:ml-2">ClassCharts API Docs</span>,
13-
transparentMode: "top",
14-
},
10+
export const baseOptions: BaseLayoutProps = {
11+
nav: {
12+
title: <span className="text-lg">ClassCharts API Docs</span>,
13+
transparentMode: "top",
14+
},
15+
githubUrl: "https://github.com/classchartsapi/api-docs",
1516
};

app/static.json/route.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NextResponse } from "next/server";
2+
import { type DocumentRecord } from "fumadocs-core/search/algolia";
3+
import { source } from "../source";
4+
5+
export const revalidate = false;
6+
7+
export function GET() {
8+
const results: DocumentRecord[] = [];
9+
10+
for (const page of source.getPages()) {
11+
results.push({
12+
_id: page.url,
13+
structured: page.data.structuredData,
14+
url: page.url,
15+
title: page.data.title,
16+
description: page.data.description,
17+
});
18+
}
19+
20+
return NextResponse.json(results);
21+
}

components/search.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID;
88
const apiKey = process.env.NEXT_PUBLIC_ALGOLIA_API_KEY;
99
const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX;
1010

11-
if (!appId || !apiKey || !indexName) throw new Error("Algolia credentials");
11+
const client = appId && apiKey && algo(appId, apiKey);
1212

13-
const client = algo(appId, apiKey);
13+
const index = client && indexName && client.initIndex(indexName);
1414

15-
const index = client.initIndex(indexName);
16-
17-
export default function CustomSearchDialog(
18-
props: SharedProps,
19-
): React.ReactElement {
15+
export default function CustomSearchDialog(props: SharedProps) {
16+
if (!index) return null;
2017
return <SearchDialog index={index} {...props} showAlgolia />;
2118
}

content/docs/global-api/get-academic-report.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ _openapi:
1212
- content: Get academic report by ID
1313
---
1414

15-
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/getacademicreport/{id}","method":"get"}]} hasHead={false} />
15+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
16+
17+
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/getacademicreport/{id}","method":"get"}]} webhooks={[]} hasHead={false} />

content/docs/global-api/get-attendance.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ _openapi:
1212
- content: Gets the student's attendance
1313
---
1414

15-
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/attendance/{studentId}","method":"get"}]} hasHead={false} />
15+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
16+
17+
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/attendance/{studentId}","method":"get"}]} webhooks={[]} hasHead={false} />

content/docs/global-api/get-on-report-card-summary-comment.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ _openapi:
1212
- content: Get on report card summary comment by date
1313
---
1414

15-
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/getpupilreportcardsummarycomment/{id}","method":"get"}]} hasHead={false} />
15+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
16+
17+
<APIPage document={"./openapi/clientapi.yaml"} operations={[{"path":"/getpupilreportcardsummarycomment/{id}","method":"get"}]} webhooks={[]} hasHead={false} />

0 commit comments

Comments
 (0)