Skip to content

Upgrade nextra docs #1599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 26, 2025
Merged

Upgrade nextra docs #1599

merged 7 commits into from
Jun 26, 2025

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jun 26, 2025

This pull request includes significant updates to the website project, focusing on migrating to the latest versions of dependencies, restructuring the project for improved modularity, and updating configuration files. Key changes include the adoption of TypeScript for configuration files, updates to dependencies, and the removal of unused or outdated code.

Dependency and Configuration Updates:

  • Updated next, nextra, and nextra-theme-docs dependencies to their latest versions in package.json to ensure compatibility with the latest features and fixes. Added pagefind for enhanced search functionality. [1] [2]
  • Replaced JavaScript configuration files with TypeScript equivalents (next.config.ts, _meta.ts) for better type safety and maintainability. [1] [2] [3] [4]
  • Introduced eslint.config.mjs with FlatCompat to align with modern ESLint configuration standards.

Project Restructuring:

  • Migrated MDX component handling to a centralized utility in mdx-components.jsx and replaced legacy MDX imports with updated paths. [1] [2]
  • Consolidated routing logic and metadata generation for dynamic pages in src/app/[[...mdxPath]]/page.jsx. (website/src/app/[[...mdxPath]]/page.jsxR1-R27)
  • Reorganized _meta.js files into TypeScript (_meta.ts) and updated their structure to use satisfies MetaRecord for stricter type validation. [1] [2] [3]

Codebase Cleanup:

  • Removed outdated scripts and unused components, such as pages/_app.js and pages/playground/_meta.js. [1] [2]
  • Simplified the RemoteSource component to use async/await and removed unnecessary state management.
  • Deleted legacy files and configurations, including next-sitemap.config.js and next.config.mjs, in favor of updated equivalents. [1] [2]

Functional Enhancements:

  • Added a new PlaygroundPage component in src/app/playground/page.tsx for improved modularity and maintainability.
  • Enhanced the home layout by marking it as a client component and aligning it with Next.js 13 standards.

Miscellaneous:

  • Updated .gitignore to include _pagefind/ and adjusted ignored paths for better clarity.
  • Refactored the build process in package.json by introducing prebuild and postbuild steps for better separation of concerns.

These changes collectively modernize the codebase, enhance maintainability, and prepare the project for future development.

@samchon samchon requested a review from Copilot June 26, 2025 16:24
@samchon samchon self-assigned this Jun 26, 2025
@samchon samchon added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels Jun 26, 2025
Copy link

socket-security bot commented Jun 26, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednextra@​3.3.1 ⏵ 4.2.1797 +1610072 +197 +1100
Updatednextra-theme-docs@​3.3.1 ⏵ 4.2.1799 +110074 +397 +1100
Addedpagefind@​1.3.01001008582100

View full report

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the website project by migrating configs to TypeScript, updating dependencies (Next.js, Nextra, etc.), restructuring imports for modularity, and cleaning up legacy files.

  • Switched JS configs to .ts/.tsx and added ESLint Flat Config
  • Updated key dependencies and introduced pagefind search
  • Centralized MDX components, refactored RemoteSource, and removed deprecated pages

Reviewed Changes

Copilot reviewed 47 out of 55 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/tsconfig.json Added Next.js plugin and updated include for .next types
website/theme.config.tsx Removed legacy Nextra theme config
website/src/movies/PlaygroundMovie.tsx Renamed component, added "use client"
website/src/movies/HomeStrengthMovie.tsx Updated import path for HomeCodeBlock
website/src/movies/HomeHeroMovie.tsx Updated import paths for home components
website/src/content/index.mdx Adjusted imports for HomeLayout and HomeStrengthMovie
website/src/content/docs/validators/*.mdx Updated RemoteSource import paths
website/src/content/docs/validators/_meta.ts Added satisfies MetaRecord
website/src/content/docs/utilization/_meta.ts Added satisfies MetaRecord
website/src/content/docs/setup.mdx Updated RemoteSource import path
website/src/content/docs/random.mdx Updated RemoteSource import path
website/src/content/docs/protobuf/*.mdx Updated RemoteSource import paths
website/src/content/docs/protobuf/_meta.ts Added satisfies MetaRecord
website/src/content/docs/misc.mdx Updated RemoteSource import path
website/src/content/docs/llm/*.mdx Updated RemoteSource and snippet imports
website/src/content/docs/llm/_meta.ts Added satisfies MetaRecord
website/src/content/docs/json/*.mdx Updated RemoteSource import paths
website/src/content/docs/json/_meta.ts Added satisfies MetaRecord
website/src/content/docs/_meta.ts Added satisfies MetaRecord, removed newWindow props
website/src/content/_meta.ts Added satisfies MetaRecord, configured hidden/display/theme
website/src/components/home/HomeLayout.tsx Added "use client" for MUI styled component
website/src/components/RemoteSource.tsx Refactored to async function, switched MDX compiler/import
website/src/app/playground/page.tsx Introduced new app-router PlaygroundPage
website/src/app/layout.jsx Migrated layout to app router with Nextra theme docs
website/src/app/[[...mdxPath]]/page.jsx Consolidated dynamic MDX routing and metadata
website/pages/playground/index.mdx Removed legacy pages folder (migrated to app router)
website/pages/playground/_meta.js Deleted old playground metadata
website/pages/_app.js Removed deprecated _app.js
website/package.json Restructured build scripts, bumped Next.js/Nextra versions, added pagefind
website/next.config.ts Added TypeScript Next.js config with Nextra wrapper
website/next.config.mjs Removed old JS config
website/next-sitemap.config.js Updated string quote style
website/mdx-components.jsx Created centralized MDX component hook
website/eslint.config.mjs Added FlatCompat for ESLint
website/.gitignore Updated ignored paths for Next.js and _pagefind
Comments suppressed due to low confidence (2)

website/next.config.ts:1

  • You removed theme.config.tsx but did not pass a themeConfig option to Nextra. If you rely on a custom theme config, add the themeConfig path to nextra({ themeConfig: './theme.config.tsx' }).
import nextra from "nextra";

website/src/movies/PlaygroundMovie.tsx:1

  • React hooks (useState, useEffect) are used in this component but React and the hooks are not imported. Add import React, { useState, useEffect } from "react"; at the top.
"use client";

@samchon samchon merged commit 99b6b3e into master Jun 26, 2025
4 checks passed
@samchon samchon deleted the feat/nextra branch June 26, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant