Skip to content

docs: initialize zh docs #514

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 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/docs/en/guide/start/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Rslib has the following features:

- **Easy to Configure**: Rslib aims to simplify library development by offering ready-to-use build capabilities, enabling developers to kickstart their library projects with minimal configuration.

- **Performance Oriented**: Rslib integrates high-performance Rust-based tools from the community, including Rspack, SWC and Lightning CSS, to deliver first-class build speed and development experience.
- **Performance Oriented**: Rslib integrates high-performance Rust-based tools from the community, including [Rspack](https://rspack.dev/), [SWC](https://swc.rs/) and [Lightning CSS](https://lightningcss.dev/), to deliver first-class build speed and development experience.

- **Plugin Ecosystem**: Powered by Rsbuild, Rslib benefits from a lightweight plugin system and a collection of high-quality official plugins. Furthermore, Rsbuild's compatibility with most webpack plugins and all Rspack plugins allows library developers to seamlessly integrate existing community or in-house plugins into their library projects.

Expand All @@ -39,7 +39,7 @@ The following diagram illustrates the relationship between Rslib and other tools
- [rspack-examples](https://github.com/rspack-contrib/rspack-examples): Examples for Rspack, Rsbuild, Rspress and Rsdoctor.
- [storybook-rsbuild](https://github.com/rspack-contrib/storybook-rsbuild): Storybook builder powered by Rsbuild.
- [rsbuild-plugin-template](https://github.com/rspack-contrib/rsbuild-plugin-template): Use this template to create your own Rsbuild plugin.
- [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources): Design resources for Rspack, Rsbuild, Rspress and Rsdoctor.
- [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources): Design resources for Rspack, Rsbuild, Rslib, Rspress and Rsdoctor.

## 🧑‍💻 Community

Expand Down
10 changes: 0 additions & 10 deletions website/docs/zh/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,5 @@
"text": "配置",
"link": "/config/",
"activeMatch": "/config/"
},
{
"text": "API",
"link": "/api/javascript-api/core",
"activeMatch": "/api/"
},
{
"text": "博客",
"link": "/blog/",
"activeMatch": "/blog/"
}
]
17 changes: 17 additions & 0 deletions website/docs/zh/config/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"type": "file",
"name": "index",
"label": "配置总览"
},
{
"type": "dir",
"name": "lib",
"label": "Lib 配置"
},
{
"type": "dir",
"name": "rsbuild",
"label": "Rsbuild 配置"
}
]
6 changes: 6 additions & 0 deletions website/docs/zh/config/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
overview: true
title: 配置总览
---

本页面列出了 Rslib 的所有配置项。详细配置请查阅 [配置 Rslib](/guide/basic/configure-rslib)。
15 changes: 15 additions & 0 deletions website/docs/zh/config/lib/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
"format",
"bundle",
"auto-extension",
"auto-external",
"redirect",
"syntax",
"external-helpers",
"banner",
"footer",
"dts",
"shims",
"id",
"umd-name"
]
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/auto-extension.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.autoExtension
5 changes: 5 additions & 0 deletions website/docs/zh/config/lib/auto-external.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
overviewHeaders: [2, 3]
---

# lib.autoExternal
5 changes: 5 additions & 0 deletions website/docs/zh/config/lib/banner.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
overviewHeaders: [2, 3]
---

# lib.banner
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/bundle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.bundle
5 changes: 5 additions & 0 deletions website/docs/zh/config/lib/dts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
overviewHeaders: [2, 3]
---

# lib.dts
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/external-helpers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.externalHelpers
5 changes: 5 additions & 0 deletions website/docs/zh/config/lib/footer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
overviewHeaders: [2, 3]
---

# lib.footer
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/format.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.format
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.id
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Lib 配置
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/redirect.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.redirect
5 changes: 5 additions & 0 deletions website/docs/zh/config/lib/shims.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
overviewHeaders: [2, 3]
---

# lib.shims
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/syntax.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.syntax
1 change: 1 addition & 0 deletions website/docs/zh/config/lib/umd-name.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib.umdName
10 changes: 10 additions & 0 deletions website/docs/zh/config/rsbuild/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
"source",
"output",
"tools",
{
"type": "file",
"name": "plugins",
"label": "plugins"
}
]
1 change: 1 addition & 0 deletions website/docs/zh/config/rsbuild/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Rsbuild 配置
1 change: 1 addition & 0 deletions website/docs/zh/config/rsbuild/output.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# output
3 changes: 3 additions & 0 deletions website/docs/zh/config/rsbuild/plugins.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { RsbuildDocBadge } from '@components/RsbuildDocBadge';

# plugins <RsbuildDocBadge path="/config/plugins" text="plugins" />
1 change: 1 addition & 0 deletions website/docs/zh/config/rsbuild/source.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# source
1 change: 1 addition & 0 deletions website/docs/zh/config/rsbuild/tools.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tools
27 changes: 27 additions & 0 deletions website/docs/zh/guide/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"type": "dir",
"name": "start",
"label": "开始"
},
{
"type": "dir",
"name": "solution",
"label": "解决方案"
},
{
"type": "dir",
"name": "basic",
"label": "基础"
},
{
"type": "dir",
"name": "advanced",
"label": "进阶"
},
{
"type": "dir",
"name": "migration",
"label": "迁移"
}
]
7 changes: 7 additions & 0 deletions website/docs/zh/guide/advanced/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
"third-party-deps",
"output-compatibility",
"dts",
"module-federation",
"storybook"
]
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/assets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 静态资源
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/css.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 样式
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/dts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 类型生成
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/module-doc.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 模块文档
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/module-federation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 模块联邦
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/monorepo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Monorepo
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/output-compatibility.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 产物兼容性
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/storybook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 使用 Storybook
1 change: 1 addition & 0 deletions website/docs/zh/guide/advanced/third-party-deps.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 处理三方依赖
8 changes: 8 additions & 0 deletions website/docs/zh/guide/basic/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"cli",
"configure-rslib",
"typescript",
"output-format",
"output-structure",
"upgrade-rslib"
]
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 命令行工具
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/configure-rslib.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 配置 Rslib
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/output-format.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 产物输出格式
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/output-structure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 产物结构
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/typescript.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 使用 Typescript
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/upgrade-rslib.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 升级 Rslib
1 change: 1 addition & 0 deletions website/docs/zh/guide/faq/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["general", "features", "exceptions"]
1 change: 1 addition & 0 deletions website/docs/zh/guide/faq/exceptions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 异常类问题
1 change: 1 addition & 0 deletions website/docs/zh/guide/faq/features.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 功能类问题
1 change: 1 addition & 0 deletions website/docs/zh/guide/faq/general.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 通用类问题
1 change: 1 addition & 0 deletions website/docs/zh/guide/migration/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["modernjs-module", "tsup"]
1 change: 1 addition & 0 deletions website/docs/zh/guide/migration/esbuild.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# esbuild
1 change: 1 addition & 0 deletions website/docs/zh/guide/migration/modernjs-module.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Modern.js Module
1 change: 1 addition & 0 deletions website/docs/zh/guide/migration/rollup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# rollup
1 change: 1 addition & 0 deletions website/docs/zh/guide/migration/tsup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tsup
1 change: 1 addition & 0 deletions website/docs/zh/guide/solution/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["nodejs", "react"]
1 change: 1 addition & 0 deletions website/docs/zh/guide/solution/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 解决方案
1 change: 1 addition & 0 deletions website/docs/zh/guide/solution/nodejs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Node.js
1 change: 1 addition & 0 deletions website/docs/zh/guide/solution/react.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# React
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "quick-start", "glossary", "npm-packages"]
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/components/CJS.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a module system used in JavaScript, particularly in server-side environments like Node.js. It was created to allow JavaScript to be used outside of the browser by providing a way to manage modules and dependencies.
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/components/ESM.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a modern module system introduced in ES2015 that allows JavaScript code to be organized into reusable, self-contained modules. ESM is now the standard for both [browser](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and [Node.js](https://nodejs.org/api/esm.html) environments, replacing older module systems like [CommonJS (CJS)](https://nodejs.org/api/modules.html) and [AMD](https://requirejs.org/docs/whyamd.html).
3 changes: 3 additions & 0 deletions website/docs/zh/guide/start/components/MF.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Module Federation is an architectural pattern for JavaScript application decomposition (similar to microservices on the server-side), allowing you to share code and resources between multiple JavaScript applications (or micro-frontends).

See [Module Federation](https://rsbuild.dev/guide/advanced/module-federation) for more details.
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/components/UMD.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UMD stands for [Universal Module Definition](https://github.com/umdjs/umd), a pattern for writing JavaScript modules that can work universally across different environments, such as both the browser and Node.js. Its primary goal is to ensure compatibility with the most popular module systems, including AMD (Asynchronous Module Definition), CommonJS (CJS), and browser globals.
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/features.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 功能导航
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/glossary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 术语表
48 changes: 48 additions & 0 deletions website/docs/zh/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 介绍

Rslib 是一个库开发工具,它基于 [Rsbuild](https://rsbuild.dev/zh/) 精心设计的配置和插件,使库开发者得以复用 webpack 和 Rspack 繁荣的知识和生态系统。

Rslib 提供了丰富的构建功能,包括:

- **多种语言的编译**: TypeScript、JSX、Sass、Less、CSS Modules、Wasm 等。
- **灵活的构建模式**: Bundle 和 bundleless 模式以满足不同的需求。
- **多种输出格式**: ESM、CJS 和 UMD 以实现最大兼容性。
- **类型声明文件生成**: 包括 isolated declarations。
- **进阶功能**: 模块联邦、资源压缩、PostCSS、Lightning CSS 等。

## 🔥 特性

Rslib 具备以下特性:

- **易于配置**: Rslib 旨在通过提供开箱即用的构建能力,简化库的开发,使库开发者能够以最少的配置启动库项目。

- **性能优先**: Rslib 集成了社区中基于 Rust 的高性能工具,包括 [Rspack](https://rspack.dev/zh/)、[SWC](https://swc.rs/) 和 [Lightning CSS](https://lightningcss.dev/),以提供一流的构建速度和开发体验。

- **插件生态**: Rslib 基于 Rsbuild 轻量级的插件系统和一系列高质量的官方插件。此外,Rsbuild 兼容大多数的 webpack 插件和所有 Rspack 插件,这意味着库开发者可以无缝集成现有的社区或公司内插件到库项目中。

## 🎯 生态

Rslib 基于 Rsbuild 实现,并完全复用 Rsbuild 的能力和生态系统。

下图说明了 Rsbuild 与生态中其他工具之间的关系:

![Rspack stack layers](https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png)

## 🦀 链接

- [Rspack](https://github.com/web-infra-dev/rspack): 基于 Rust 的高性能打包工具。
- [Rsbuild](https://github.com/web-infra-dev/rsbuild): 由 Rspack 驱动的构建工具。
- [Rspress](https://github.com/web-infra-dev/rspress): 基于 Rsbuild 的静态站点生成器。
- [Rsdoctor](https://github.com/web-infra-dev/rsdoctor): 针对 Rspack 和 webpack 的一站式构建分析工具。
- [Modern.js](https://github.com/web-infra-dev/modern.js): 基于 Rsbuild 的渐进式 React 框架。
- [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack): 与 Rspack 和 Rsbuild 相关的精彩内容列表。
- [rspack-examples](https://github.com/rspack-contrib/rspack-examples): Rspack、Rsbuild、Rspress 和 Rsdoctor 的示例项目。
- [storybook-rsbuild](https://github.com/rspack-contrib/storybook-rsbuild): 基于 Rsbuild 构建的 Storybook。
- [rsbuild-plugin-template](https://github.com/rspack-contrib/rsbuild-plugin-template): 使用此模板创建你的 Rsbuild 插件。
- [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources): Rspack、Rsbuild、Rslib、Rspress 和 Rsdoctor 的设计资源。

## 🧑‍💻 社区

欢迎加入我们的 [Discord](https://discord.gg/XsaKEEk4mW) 交流频道!Rspack / Rsbuild / Rslib 团队和用户都在那里活跃,并且我们一直期待着各种贡献。

你也可以加入 [飞书群](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=3c3vca77-bfc0-4ef5-b62b-9c5c9c92f1b4) 与大家一起交流。
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/npm-packages.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# NPM 包
1 change: 1 addition & 0 deletions website/docs/zh/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 快速上手
2 changes: 1 addition & 1 deletion website/docs/zh/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
pageType: home
titleSuffix: ' - 基于 Rsbuild 的库构建工具'
titleSuffix: ' - 基于 Rsbuild 的库开发工具'
---
2 changes: 1 addition & 1 deletion website/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"subtitle": {
"en": "Rsbuild-based Library Development Tool",
"zh": "基于 Rsbuild 的 Library 开发工具"
"zh": "基于 Rsbuild 的库开发工具"
},
"slogan": {
"en": "Create JavaScript libraries in a simple and intuitive way",
Expand Down
39 changes: 22 additions & 17 deletions website/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,28 @@ export default defineConfig({
text: '📝 Edit this page on GitHub',
},
},
// {
// lang: 'zh',
// label: '简体中文',
// title: 'Rslib',
// outlineTitle: '目录',
// prevPageText: '上一页',
// nextPageText: '下一页',
// searchPlaceholderText: '搜索文档',
// searchNoResultsText: '无法找到相关搜索结果',
// searchSuggestedQueryText: '请使用不同的关键字重试',
// description: '基于 Rsbuild 的库构建工具',
// editLink: {
// docRepoBaseUrl:
// 'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
// text: '📝 在 GitHub 上编辑此页',
// },
// },
{
lang: 'zh',
label: '简体中文',
title: 'Rslib',
outlineTitle: '目录',
prevPageText: '上一页',
nextPageText: '下一页',
searchPlaceholderText: '搜索文档',
searchNoResultsText: '无法找到相关搜索结果',
searchSuggestedQueryText: '请使用不同的关键字重试',
description: '基于 Rsbuild 的库构建工具',
overview: {
filterNameText: '过滤',
filterPlaceholderText: '输入关键词',
filterNoResultText: '未找到匹配的 API',
},
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
text: '📝 在 GitHub 上编辑此页',
},
},
],
},
builderConfig: {
Expand Down
Loading
Loading