From 0a2402175fbb978a73829b187dbafa31551d513d Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 14 Sep 2026 16:28:13 +0800 Subject: [PATCH 1/2] docs: inline homepage command copy and add project links --- website/i18n.json | 122 +------------- website/theme/components/Commands.tsx | 231 ++++++++++++++++++++++---- 2 files changed, 200 insertions(+), 153 deletions(-) diff --git a/website/i18n.json b/website/i18n.json index fedb246..9fc8c8b 100644 --- a/website/i18n.json +++ b/website/i18n.json @@ -4,7 +4,7 @@ "zh": "快速上手" }, "getStarted": { - "en": "Get Started", + "en": "Get started", "zh": "开始使用" }, "github": { @@ -27,126 +27,6 @@ "en": "One CLI unifies development, builds, testing, linting, and formatting across all your JavaScript projects. Powered by the Rspack ecosystem.", "zh": "只需一个 CLI,即可统一所有 JavaScript 项目的开发、构建、测试、代码检查与格式化。由 Rspack 生态驱动。" }, - "appCommandTitle": { - "en": "From dev to production, fast", - "zh": "从开发到构建,快人一步" - }, - "appCommandDesc": { - "en": "Powered by Rspack and Rsbuild, start a dev server quickly and build enterprise-grade web applications", - "zh": "基于 Rspack 和 Rsbuild,快速启动开发服务器,构建企业级 Web 应用" - }, - "appCommandHmr": { - "en": "Build 5–20× faster than webpack", - "zh": "构建速度比 webpack 快 5–20 倍" - }, - "appCommandProduction": { - "en": "Optimize bundles for faster runtime performance", - "zh": "全方位优化产物,运行更快" - }, - "appCommandConfig": { - "en": "A consistent bundling process for development and production", - "zh": "开发与生产采用一致的打包流程" - }, - "libCommandTitle": { - "en": "Your library, ready to ship", - "zh": "构建你的库,轻松交付" - }, - "libCommandDesc": { - "en": "Build reusable JavaScript libraries with Rslib, with the flexibility to develop shared libraries, CLI tools, and components", - "zh": "使用 Rslib 构建可复用的 JavaScript 库,灵活应对公共库、命令行和组件开发需求" - }, - "libCommandFormats": { - "en": "One configuration for ESM, CJS, Module Federation, and more", - "zh": "一份配置,输出 ESM、CJS 和模块联邦等多种格式" - }, - "libCommandModes": { - "en": "Choose bundle or bundleless output to suit your needs", - "zh": "按需选择 bundle 或 bundleless 输出模式" - }, - "libCommandTypes": { - "en": "Generate type declarations quickly with TypeScript 7", - "zh": "使用 TypeScript 7 快速生成类型声明" - }, - "testCommandTitle": { - "en": "Faster tests, instant feedback", - "zh": "更快测试,即时反馈" - }, - "testCommandDesc": { - "en": "Test JavaScript with Rstest for fast feedback from local development to CI", - "zh": "使用 Rstest 测试 JavaScript 代码,从本地开发到 CI 保持高效反馈" - }, - "testCommandConfig": { - "en": "Automatically reuse existing build configuration to reduce maintenance", - "zh": "自动复用已有构建配置,减少维护成本" - }, - "testCommandApi": { - "en": "Familiar Jest APIs", - "zh": "熟悉的 Jest API" - }, - "testCommandPerformance": { - "en": "Tests accelerated by Rspack, 20%+ faster than Jest", - "zh": "由 Rspack 加速测试,比 Jest 快 20%+" - }, - "checkCommandTitle": { - "en": "Consistent standards, faster checks", - "zh": "统一规范,更快检查" - }, - "checkCommandDesc": { - "en": "One command for linting, formatting checks, and type checking to keep team standards consistent", - "zh": "一个命令完成代码检查、格式校验和类型检查,保持团队规范一致" - }, - "checkCommandLint": { - "en": "Lint 20–40× faster than ESLint", - "zh": "代码检查速度比 ESLint 快 20–40 倍" - }, - "checkCommandFormat": { - "en": "Format 5–10× faster than Prettier", - "zh": "格式化速度比 Prettier 快 5–10 倍" - }, - "checkCommandCompatibility": { - "en": "Compatible with ESLint and Prettier configuration and plugins", - "zh": "兼容 ESLint 和 Prettier 的配置项与插件" - }, - "hooksCommandTitle": { - "en": "Checks in every commit", - "zh": "让检查融入每次提交" - }, - "hooksCommandDesc": { - "en": "Bring code checks into your Git workflow while keeping your existing lint-staged configuration and Husky workflow", - "zh": "将代码检查融入 Git 工作流,延续现有 lint-staged 配置与 Husky 工作流" - }, - "hooksCommandSetup": { - "en": "Manage repository-wide Git hooks in one place", - "zh": "统一管理仓库级 Git hooks" - }, - "hooksCommandStaged": { - "en": "Automatically check staged files", - "zh": "自动检查暂存区文件" - }, - "hooksCommandTasks": { - "en": "Run custom commands to suit your workflow", - "zh": "灵活运行自定义命令" - }, - "docCommandTitle": { - "en": "Build AI-friendly docs sites", - "zh": "生成 AI 友好的文档站" - }, - "docCommandDesc": { - "en": "Generate beautiful, AI-friendly static documentation sites with Rspress and maintain docs alongside your code", - "zh": "使用 Rspress 生成美观、AI 友好的静态文档站,让文档与代码一同维护" - }, - "docCommandMarkdown": { - "en": "Write content with Markdown and MDX", - "zh": "使用 Markdown 和 MDX 编写内容" - }, - "docCommandFeatures": { - "en": "Full-text search and multilingual support out of the box", - "zh": "开箱即用的全文搜索与多语言支持" - }, - "docCommandWorkflow": { - "en": "Automatically generate llms.txt and Markdown files for AI agents to read", - "zh": "自动生成 llms.txt 与 Markdown 文件,供 AI Agent 读取" - }, "guide": { "en": "Guide", "zh": "指南" diff --git a/website/theme/components/Commands.tsx b/website/theme/components/Commands.tsx index 322d089..d627bf1 100644 --- a/website/theme/components/Commands.tsx +++ b/website/theme/components/Commands.tsx @@ -1,4 +1,4 @@ -import { useI18n } from '@rspress/core/runtime'; +import { useLang } from '@rspress/core/runtime'; import { Link } from '@rspress/core/theme-original'; import type { ReactNode } from 'react'; import { useI18nUrl } from './utils'; @@ -117,19 +117,65 @@ function OutputFiles({ // Preserve the captured ANSI styles: uncolored numbers, bold build durations, // blue table headers, magenta totals, gray test metadata, and dim directories. export function Commands() { - const t = useI18n(); + const isZh = useLang() === 'zh'; return (
-

{t('appCommandTitle')}

-

{t('appCommandDesc')}

+

+ {isZh ? '从开发到构建,快人一步' : 'From dev to production, fast'} +

+

+ {isZh ? ( + <> + {'基于 '} + Rspack + {' 和 '} + Rsbuild + {',快速启动开发服务器,构建企业级 Web 应用'} + + ) : ( + <> + { + 'Start dev servers quickly and build enterprise-grade web applications with ' + } + Rspack + {' and '} + Rsbuild + + )} +

    -
  • {t('appCommandHmr')}
  • -
  • {t('appCommandProduction')}
  • -
  • {t('appCommandConfig')}
  • +
  • + {isZh ? ( + <> + {'构建速度比 webpack '} + + 快 5–20 倍 + + + ) : ( + <> + {'Build '} + + 5–20× faster + + {' than webpack'} + + )} +
  • +
  • + {isZh + ? '全方位优化产物,运行更快' + : 'Optimize bundles for faster runtime performance'} +
  • +
  • + {isZh + ? '开发与生产采用一致的打包流程' + : 'A consistent bundling process for development and production'} +
@@ -157,12 +203,43 @@ export function Commands() {
-

{t('libCommandTitle')}

-

{t('libCommandDesc')}

+

+ {isZh ? '构建你的库,轻松交付' : 'Your library, ready to ship'} +

+

+ {isZh ? ( + <> + {'使用 '} + Rslib + { + ' 构建可复用的 JavaScript 库,满足公共库、命令行工具和组件库的开发需求' + } + + ) : ( + <> + { + 'Build reusable JavaScript libraries, CLI tools, and UI components with ' + } + Rslib + + )} +

    -
  • {t('libCommandFormats')}
  • -
  • {t('libCommandModes')}
  • -
  • {t('libCommandTypes')}
  • +
  • + {isZh + ? '一份配置,输出 ESM、CJS 和模块联邦等多种格式' + : 'One configuration for ESM, CJS, Module Federation, and more'} +
  • +
  • + {isZh + ? '按需选择 bundle 或 bundleless 输出模式' + : 'Choose bundle or bundleless output to suit your needs'} +
  • +
  • + {isZh + ? '使用 TypeScript 7 快速生成类型声明' + : 'Generate type declarations quickly with TypeScript 7'} +
@@ -189,12 +266,38 @@ export function Commands() {
-

{t('testCommandTitle')}

-

{t('testCommandDesc')}

+

+ {isZh ? '更快测试,即时反馈' : 'Faster tests, instant feedback'} +

+

+ {isZh ? ( + <> + {'使用 '} + Rstest + {' 测试 JavaScript 代码,从本地开发到 CI 都能及时获得反馈'} + + ) : ( + <> + {'Test JavaScript with '} + Rstest + {' for fast feedback from local development to CI'} + + )} +

    -
  • {t('testCommandApi')}
  • -
  • {t('testCommandPerformance')}
  • -
  • {t('testCommandConfig')}
  • +
  • + {isZh ? '熟悉的 Jest 风格 API' : 'Familiar Jest-style APIs'} +
  • +
  • + {isZh + ? '由 Rspack 加速测试,比 Jest 快 20%+' + : 'Tests accelerated by Rspack, 20%+ faster than Jest'} +
  • +
  • + {isZh + ? '自动复用已有构建配置,减少维护成本' + : 'Automatically reuse your build configuration to reduce maintenance overhead'} +
@@ -227,12 +330,30 @@ export function Commands() { >
-

{t('checkCommandTitle')}

-

{t('checkCommandDesc')}

+

+ {isZh ? '统一规范,更快检查' : 'Fast checks, consistent code'} +

+

+ {isZh + ? '一个命令完成代码检查、格式校验和类型检查,保持团队规范一致' + : "Keep your team's code consistent with one command for linting, formatting checks, and type checking"} +

    -
  • {t('checkCommandLint')}
  • -
  • {t('checkCommandFormat')}
  • -
  • {t('checkCommandCompatibility')}
  • +
  • + {isZh + ? '代码检查速度比 ESLint 快 20–40 倍' + : 'Lint 20–40× faster than ESLint'} +
  • +
  • + {isZh + ? '格式化速度比 Prettier 快 5–10 倍' + : 'Format 5–10× faster than Prettier'} +
  • +
  • + {isZh + ? '兼容 ESLint 和 Prettier 的配置项与插件' + : 'Compatible with ESLint and Prettier configuration and plugins'} +
@@ -259,12 +380,28 @@ export function Commands() { >
-

{t('hooksCommandTitle')}

-

{t('hooksCommandDesc')}

+

+ {isZh ? '让检查融入每次提交' : 'Checks for every commit'} +

+

+ {isZh + ? '将代码检查融入 Git 工作流,复用现有 lint-staged 配置,延续熟悉的 Husky 使用方式' + : 'Add code checks to your Git workflow with familiar lint-staged configuration and Husky-style hooks'} +

    -
  • {t('hooksCommandSetup')}
  • -
  • {t('hooksCommandStaged')}
  • -
  • {t('hooksCommandTasks')}
  • +
  • + {isZh + ? '统一管理仓库级 Git hooks' + : 'Manage repository-wide Git hooks in one place'} +
  • +
  • + {isZh ? '自动检查暂存区文件' : 'Automatically check staged files'} +
  • +
  • + {isZh + ? '灵活运行自定义命令' + : 'Run custom commands to suit your workflow'} +
@@ -287,12 +424,42 @@ export function Commands() {
-

{t('docCommandTitle')}

-

{t('docCommandDesc')}

+

+ {isZh ? '生成 AI 友好的文档站' : 'Build AI-friendly docs sites'} +

+

+ {isZh ? ( + <> + {'使用 '} + Rspress + {' 打造美观、AI 友好的静态文档站,让文档与代码一同维护'} + + ) : ( + <> + { + 'Build beautiful, AI-friendly static documentation sites with ' + } + Rspress + {' and maintain them alongside your code'} + + )} +

    -
  • {t('docCommandMarkdown')}
  • -
  • {t('docCommandFeatures')}
  • -
  • {t('docCommandWorkflow')}
  • +
  • + {isZh + ? '使用 Markdown 和 MDX 编写内容' + : 'Write content in Markdown and MDX'} +
  • +
  • + {isZh + ? '开箱即用的全文搜索与多语言支持' + : 'Full-text search and multilingual support out of the box'} +
  • +
  • + {isZh + ? '自动生成 llms.txt 与 Markdown 文件,供 AI Agent 使用' + : 'Automatically generate llms.txt and Markdown files for AI agents'} +
From ca9374271c149aff958577d7b0ffe0c4c46212f2 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 14 Sep 2026 16:31:43 +0800 Subject: [PATCH 2/2] chore: recognize bundleless in spell checks --- scripts/dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt index 8c07ec8..825745e 100644 --- a/scripts/dictionary.txt +++ b/scripts/dictionary.txt @@ -1,5 +1,6 @@ # Custom Dictionary Words applypatch +bundleless cdpath clippy dirents