mirror of
https://github.com/LibreChat-AI/librechat.ai.git
synced 2026-03-27 10:48:32 +07:00
refactor: remove Nextra, migrate to App Router, redesign Toolkit (#531)
* refactor: remove Nextra shims, migrate pages/ to app router, upgrade ESLint to v9 - Remove all nextra-shims and legacy pages/ directory - Migrate subscribe, unsubscribe, and toolkit pages to app router - Restructure config docs with guide-first setup steps and Tabs components - Rewrite Docker install, OpenRouter, and custom endpoints docs - Add Quick Start guide, Google Search docs, and image generation cross-links - Update .gitignore * feat: redesign toolkit and integrate into docs sidebar Move credentials generator and YAML validator into the docs under a new "Tools > Toolkit" sidebar section. Old /toolkit routes redirect to /docs/toolkit. Credentials generator: 2-column field grid, per-field copy buttons, copy-all as .env block, empty state placeholder, design system tokens. YAML validator: full-width theme-aware Ace Editor (chrome/twilight), drag-and-drop overlay, result banners with icons, clear button, no print margin. Remove unused .error-marker and .custom-btn from style.css. --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -59,15 +59,10 @@ const nonPermanentRedirects = [
|
||||
['/docs/user_guides/plugins', '/docs/features/agents'],
|
||||
['/docs/features/plugins', '/docs/features/agents'],
|
||||
['/docs/configuration/librechat_yaml/setup', '/docs/configuration/librechat_yaml'],
|
||||
['/toolkit/yaml_checker', '/toolkit/yaml-checker'],
|
||||
['/toolkit/creds_generator', '/toolkit/creds-generator'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Nextra compatibility shims - redirect nextra imports to local stubs
|
||||
* so the existing pages/ directory can build during the Fumadocs migration.
|
||||
* These will be removed once all pages/ content is migrated to app/.
|
||||
*/
|
||||
const nextraShims = resolve(process.cwd(), 'lib/nextra-shims');
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const config = {
|
||||
typescript: {
|
||||
@@ -76,15 +71,6 @@ const config = {
|
||||
turbopack: {},
|
||||
pageExtensions: ['mdx', 'md', 'jsx', 'js', 'tsx', 'ts'],
|
||||
webpack(webpackConfig, options) {
|
||||
// Nextra compatibility: redirect nextra imports to local shims
|
||||
webpackConfig.resolve.alias = {
|
||||
...webpackConfig.resolve.alias,
|
||||
'nextra/context': resolve(nextraShims, 'context.tsx'),
|
||||
'nextra/components': resolve(nextraShims, 'components.tsx'),
|
||||
nextra: resolve(nextraShims, 'index.ts'),
|
||||
'nextra-theme-docs': resolve(nextraShims, 'theme-docs.tsx'),
|
||||
};
|
||||
|
||||
/**
|
||||
* Fumadocs MDX loader: only applied to content/ directory files.
|
||||
* These are processed by fumadocs-mdx for the app/ router docs.
|
||||
@@ -105,37 +91,24 @@ const config = {
|
||||
});
|
||||
|
||||
/**
|
||||
* Basic MDX loader for pages/ directory and components/ directory files.
|
||||
* Provides minimal MDX compilation so existing pages/ content
|
||||
* can compile during the migration period.
|
||||
* Uses a custom providerImportSource that provides the same
|
||||
* components Nextra used to auto-inject (Callout, Steps, etc.).
|
||||
* MDX loader for components/ directory files.
|
||||
* These are MDX files imported directly as React components
|
||||
* (e.g. changelog content, repeated sections).
|
||||
*/
|
||||
webpackConfig.module.rules.push({
|
||||
test: /\.mdx?$/,
|
||||
include: [resolve(process.cwd(), 'pages'), resolve(process.cwd(), 'components')],
|
||||
include: [resolve(process.cwd(), 'components')],
|
||||
use: [
|
||||
options.defaultLoaders.babel,
|
||||
{
|
||||
loader: '@mdx-js/loader',
|
||||
options: {
|
||||
providerImportSource: resolve(process.cwd(), 'lib/nextra-shims/mdx-components.tsx'),
|
||||
providerImportSource: resolve(process.cwd(), 'lib/mdx-provider.ts'),
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
/**
|
||||
* Replace Nextra _meta files with a dummy React component export
|
||||
* so Next.js doesn't fail when encountering them as pages.
|
||||
*/
|
||||
webpackConfig.module.rules.push({
|
||||
test: /pages[\\/].*_meta\.(ts|js|tsx|jsx)$/,
|
||||
use: {
|
||||
loader: resolve(process.cwd(), 'lib/nextra-shims/meta-loader.cjs'),
|
||||
},
|
||||
});
|
||||
|
||||
return webpackConfig;
|
||||
},
|
||||
transpilePackages: ['react-tweet', 'geist'],
|
||||
|
||||
Reference in New Issue
Block a user