From 5faa5ca87f8ac3dcbbfa4a46542a5f3a71e4016b Mon Sep 17 00:00:00 2001
From: Dimitri POSTOLOV
Date: Wed, 27 Nov 2024 01:12:05 +0700
Subject: [PATCH 01/58] improve
---
examples/blog/app/tags/[tag]/page.jsx | 2 +-
packages/nextra-theme-blog/tsup.config.ts | 2 +-
.../nextra-theme-docs/src/components/footer/switchers.ts | 1 -
.../nextra-theme-docs/src/components/last-updated.tsx | 2 +-
.../nextra-theme-docs/src/components/theme-switch.tsx | 2 +-
packages/nextra/src/client/components/banner/index.tsx | 2 +-
packages/nextra/src/env.d.ts | 9 ---------
packages/nextra/tsup.config.ts | 2 +-
8 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/examples/blog/app/tags/[tag]/page.jsx b/examples/blog/app/tags/[tag]/page.jsx
index fabeec43d1..39eb22f0e2 100644
--- a/examples/blog/app/tags/[tag]/page.jsx
+++ b/examples/blog/app/tags/[tag]/page.jsx
@@ -17,7 +17,7 @@ export default async function TagPage(props) {
const params = await props.params
return (
<>
- {generateMetadata({ params }).title}
+ {(await generateMetadata({ params })).title}
{(await getPosts())
.filter(post =>
post.frontMatter.tags.includes(decodeURIComponent(params.tag))
diff --git a/packages/nextra-theme-blog/tsup.config.ts b/packages/nextra-theme-blog/tsup.config.ts
index 698449a786..1b179dbdab 100644
--- a/packages/nextra-theme-blog/tsup.config.ts
+++ b/packages/nextra-theme-blog/tsup.config.ts
@@ -5,7 +5,7 @@ import packageJson from './package.json'
export default defineConfig([
{
name: packageJson.name,
- entry: [...defaultEntry, '!src/types.ts'],
+ entry: defaultEntry,
format: 'esm',
dts: true,
outExtension: () => ({ js: '.js' }),
diff --git a/packages/nextra-theme-docs/src/components/footer/switchers.ts b/packages/nextra-theme-docs/src/components/footer/switchers.ts
index 51d974530d..8b9a774c71 100644
--- a/packages/nextra-theme-docs/src/components/footer/switchers.ts
+++ b/packages/nextra-theme-docs/src/components/footer/switchers.ts
@@ -10,5 +10,4 @@ export const Switchers: FC<{ children: ReactNode }> = ({ children }) => {
if (hideSidebar && (darkMode || i18n.length)) {
return children
}
- return null
}
diff --git a/packages/nextra-theme-docs/src/components/last-updated.tsx b/packages/nextra-theme-docs/src/components/last-updated.tsx
index e6af08b24e..a3819b893c 100644
--- a/packages/nextra-theme-docs/src/components/last-updated.tsx
+++ b/packages/nextra-theme-docs/src/components/last-updated.tsx
@@ -13,7 +13,7 @@ export const LastUpdated: FC<{
const pathname = usePathname()
if (!date) {
- return null
+ return
}
const dateLocale = i18n.length ? pathname.split('/', 2)[1] : locale
diff --git a/packages/nextra-theme-docs/src/components/theme-switch.tsx b/packages/nextra-theme-docs/src/components/theme-switch.tsx
index 33837b25df..93e983641e 100644
--- a/packages/nextra-theme-docs/src/components/theme-switch.tsx
+++ b/packages/nextra-theme-docs/src/components/theme-switch.tsx
@@ -17,7 +17,7 @@ export const ThemeSwitch: FC = ({ lite, className }) => {
const mounted = useMounted()
const { darkMode, themeSwitch } = useThemeConfig()
if (!darkMode) {
- return null
+ return
}
const IconToUse = mounted && resolvedTheme === 'dark' ? MoonIcon : SunIcon
const id = mounted ? (theme as keyof typeof themeSwitch) : 'light'
diff --git a/packages/nextra/src/client/components/banner/index.tsx b/packages/nextra/src/client/components/banner/index.tsx
index d8803d7eae..04bdb62fcd 100644
--- a/packages/nextra/src/client/components/banner/index.tsx
+++ b/packages/nextra/src/client/components/banner/index.tsx
@@ -11,7 +11,7 @@ export const Banner: FC<{
storageKey?: string
}> = ({ children, dismissible = true, storageKey = 'nextra-banner' }) => {
if (!children) {
- return null
+ return
}
const hideBannerScript = `try{document.querySelector('.${CLASS_NAME}').classList.toggle('x:hidden',localStorage.getItem(${JSON.stringify(storageKey)}))}catch(e){}`
diff --git a/packages/nextra/src/env.d.ts b/packages/nextra/src/env.d.ts
index cadb95abda..cb66531575 100644
--- a/packages/nextra/src/env.d.ts
+++ b/packages/nextra/src/env.d.ts
@@ -1,12 +1,3 @@
-declare module 'title' {
- export default function title(
- title: string,
- special?: {
- special: string[]
- }
- )
-}
-
declare namespace globalThis {
var pagefind: {
search: (query: string) => Promise<{
diff --git a/packages/nextra/tsup.config.ts b/packages/nextra/tsup.config.ts
index 0fb134523c..b0f64518d8 100644
--- a/packages/nextra/tsup.config.ts
+++ b/packages/nextra/tsup.config.ts
@@ -8,7 +8,7 @@ import { CWD, IS_PRODUCTION } from './src/server/constants.js'
export default defineConfig({
name: packageJson.name,
- entry: [...defaultEntry, '!src/types.ts', 'src/**/*.svg'],
+ entry: [...defaultEntry, 'src/**/*.svg'],
format: 'esm',
dts: true,
splitting: IS_PRODUCTION,
From bddce1057d31c5308ef047b0c1308ddca8435ba7 Mon Sep 17 00:00:00 2001
From: Dimitri POSTOLOV
Date: Wed, 27 Nov 2024 01:13:14 +0700
Subject: [PATCH 02/58] aa
---
docs/app/page.tsx | 2 +-
packages/nextra-theme-docs/src/components/footer/index.tsx | 2 +-
packages/nextra-theme-docs/src/components/navbar/index.tsx | 2 +-
packages/nextra-theme-docs/src/components/pagination.tsx | 2 +-
packages/nextra-theme-docs/src/components/sidebar.tsx | 2 +-
packages/nextra-theme-docs/src/components/toc.tsx | 2 +-
packages/nextra-theme-docs/src/mdx-components/heading.tsx | 2 +-
packages/nextra-theme-docs/src/mdx-components/index.tsx | 2 +-
packages/nextra-theme-docs/src/style.css | 2 +-
packages/nextra/src/client/components/search.tsx | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/app/page.tsx b/docs/app/page.tsx
index 8882d74145..e0ab0d9923 100644
--- a/docs/app/page.tsx
+++ b/docs/app/page.tsx
@@ -39,7 +39,7 @@ const IndexPage: FC = () => {
-
+
> = ({
-
+