Skip to content

Commit

Permalink
docs: init Rslib website (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 authored Sep 9, 2024
1 parent 656332e commit d842231
Show file tree
Hide file tree
Showing 44 changed files with 4,092 additions and 71 deletions.
3,440 changes: 3,369 additions & 71 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packages:
- 'website'
- 'packages/*'
- 'scripts/*'
- 'e2e/**'
Expand Down
21 changes: 21 additions & 0 deletions website/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024-present Bytedance, Inc. and its affiliates.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Rslib Website

This website is built with [Rspress](https://github.com/web-infra-dev/rspress), the document content can be written using markdown or mdx syntax. You can refer to the [Rspress Website](https://rspress.dev/) for detailed usage.

## Contributing

Currently Rslib provides documentation in English and Chinese. If you can use Chinese, please update both documents at the same time. Otherwise, just update the English documentation.

### Image Assets

For images you use in the document, it's better to upload them to the [rspack-contrib/rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) repository, so the size of the current repository doesn't get too big.

After you upload the images there, they will be automatically deployed under the <https://assets.rspack.dev/>.
7 changes: 7 additions & 0 deletions website/docs/en/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"text": "Guide",
"link": "/guide/start/",
"activeMatch": "/guide/"
}
]
12 changes: 12 additions & 0 deletions website/docs/en/guide/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"type": "dir",
"name": "start",
"label": "Getting Started"
},
{
"type": "dir",
"name": "basic",
"label": "Basic"
}
]
1 change: 1 addition & 0 deletions website/docs/en/guide/basic/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["configure-rslib"]
1 change: 1 addition & 0 deletions website/docs/en/guide/basic/configure-rslib.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Configure Rslib
1 change: 1 addition & 0 deletions website/docs/en/guide/start/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "quick-start", "features"]
3 changes: 3 additions & 0 deletions website/docs/en/guide/start/features.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Features

Here are all the main features supported by Rslib.
53 changes: 53 additions & 0 deletions website/docs/en/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Introduction

## 🔥 Features

## 🎯 Ecosystem

Rslib is implemented based on Rsbuild and fully reuses the capabilities and ecology of Rsbuild.

The following diagram illustrates the relationship between Rsbuild and other tools in the ecosystem:

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

## 🦀 Links

- [Rspack](https://github.com/web-infra-dev/rspack): A fast Rust-based web bundler.
- [Rsbuild](https://github.com/web-infra-dev/rsbuild): A Rspack Powered Build Tool.
- [Rspress](https://github.com/web-infra-dev/rspress): A fast static site generator based on Rsbuild.
- [Rsdoctor](https://github.com/web-infra-dev/rsdoctor): A one-stop build analyzer for Rspack and webpack.
- [Modern.js](https://github.com/web-infra-dev/modern.js): A progressive React framework based on Rsbuild.
- [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack): A curated list of awesome things related to Rspack and Rsbuild.
- [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.

## 🧑‍💻 Community

Come and chat with us on [Discord](https://discord.gg/XsaKEEk4mW)! The Rspack / Rsbuild / Rslib team and users are active there, and we're always looking for contributions.

## ✨ Next Step

You may want:

import NextSteps from '@components/NextSteps';
import Step from '@components/Step';

<NextSteps>
<Step
href="/guide/start/quick-start"
title="Quick Start"
description="Learn how to use Rslib"
/>
<Step
href="/guide/start/features"
title="All Features"
description="Learn all features of Rslib"
/>
<Step
href="/guide/basic/configure-rslib"
title="Config"
description="Learn how to configure Rslib"
/>
</NextSteps>
1 change: 1 addition & 0 deletions website/docs/en/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Quick Start
4 changes: 4 additions & 0 deletions website/docs/en/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
pageType: home
titleSuffix: ' - Rsbuild-based library build tool'
---
4 changes: 4 additions & 0 deletions website/docs/public/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/404.html"
status = 404
7 changes: 7 additions & 0 deletions website/docs/zh/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"text": "指南",
"link": "/guide/start/",
"activeMatch": "/guide/"
}
]
12 changes: 12 additions & 0 deletions website/docs/zh/guide/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"type": "dir",
"name": "start",
"label": "开始"
},
{
"type": "dir",
"name": "basic",
"label": "基础"
}
]
1 change: 1 addition & 0 deletions website/docs/zh/guide/basic/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["configure-rslib"]
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/start/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "quick-start", "features"]
3 changes: 3 additions & 0 deletions website/docs/zh/guide/start/features.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 功能导航

在这里,你可以了解到 Rslib 支持的主要功能。
55 changes: 55 additions & 0 deletions website/docs/zh/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 介绍

## 🔥 特性

## 🎯 生态

Rslib 基于 Rsbuild 实现,充分复用了 Rsbuild 的能力和生态。

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

![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、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) 与大家一起交流。

## ✨ 下一步

你可能想要:

import NextSteps from '@components/NextSteps';
import Step from '@components/Step';

<NextSteps>
<Step
href="/guide/start/quick-start"
title="快速上手"
description="了解如何使用 Rslib"
/>
<Step
href="/guide/start/features"
title="功能导航"
description="了解 Rslib 提供的所有功能"
/>
<Step
href="/guide/basic/configure-rslib"
title="查阅配置"
description="了解如何配置 Rslib"
/>
</NextSteps>
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 @@
# 快速上手
4 changes: 4 additions & 0 deletions website/docs/zh/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
pageType: home
titleSuffix: ' - 基于 Rsbuild 的库构建工具'
---
4 changes: 4 additions & 0 deletions website/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.mdx' {
let MDXComponent: () => JSX.Element;
export default MDXComponent;
}
26 changes: 26 additions & 0 deletions website/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"introduction": {
"en": "Introduction",
"zh": "介绍"
},
"quickStart": {
"en": "Quick Start",
"zh": "快速上手"
},
"subtitle": {
"en": "The Rsbuild-based Library Build Tool",
"zh": "基于 Rsbuild 的库构建工具"
},
"slogan": {
"en": "Leverage the knowledge and ecosystem of webpack and Rspack",
"zh": "复用 webpack 和 Rspack 的知识和生态"
},
"toolStackTitle": {
"en": "Tool Stack",
"zh": "工具栈"
},
"toolStackDesc": {
"en": "High-performance tool stack built around Rspack to boost modern web development",
"zh": "围绕 Rspack 打造的高性能工具栈,助力现代 Web 开发"
}
}
23 changes: 23 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "rslib-website",
"version": "0.0.1",
"private": true,
"license": "MIT",
"scripts": {
"build": "rspress build",
"dev": "rspress dev",
"preview": "rspress preview"
},
"devDependencies": {
"@rsbuild/core": "1.0.1-rc.5",
"@rslib/tsconfig": "workspace:*",
"@rstack-dev/doc-ui": "1.4.2",
"@types/node": "~18.19.39",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rspress": "1.29.0",
"rspress-plugin-font-open-sans": "1.0.0"
}
}
88 changes: 88 additions & 0 deletions website/rspress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import path from 'node:path';
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
import { defineConfig } from 'rspress/config';

export default defineConfig({
plugins: [pluginFontOpenSans()],
root: path.join(__dirname, 'docs'),
lang: 'en',
base: '/',
title: 'Rslib',
icon: 'https://assets.rspack.dev/rslib/rslib-logo.png',
logo: {
light: 'https://assets.rspack.dev/rslib/rslib-logo.png',
dark: 'https://assets.rspack.dev/rslib/rslib-logo.png',
},
ssg: {
strict: true,
},
markdown: {
checkDeadLinks: true,
},
route: {
cleanUrls: true,
// exclude document fragments from routes
exclude: ['**/zh/shared/**', '**/en/shared/**', './theme'],
},
themeConfig: {
footer: {
message: 'Copyright © 2024 ByteDance.',
},
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/web-infra-dev/rslib',
},
{
icon: 'x',
mode: 'link',
content: 'https://twitter.com/rspack_dev',
},
{
icon: 'discord',
mode: 'link',
content: 'https://discord.gg/XsaKEEk4mW',
},
],
locales: [
{
lang: 'en',
label: 'English',
title: 'Rslib',
description: 'The Rsbuild-based library build tool',
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
text: '📝 Edit this page on GitHub',
},
},
{
lang: 'zh',
label: '简体中文',
title: 'Rslib',
outlineTitle: '目录',
prevPageText: '上一页',
nextPageText: '下一页',
description: '基于 Rsbuild 的库构建工具',
editLink: {
docRepoBaseUrl:
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
text: '📝 在 GitHub 上编辑此页',
},
},
],
},
builderConfig: {
dev: {
lazyCompilation: true,
},
source: {
alias: {
'@components': path.join(__dirname, '@components'),
'@en': path.join(__dirname, 'docs/en'),
'@zh': path.join(__dirname, 'docs/zh'),
},
},
},
});
Loading

0 comments on commit d842231

Please sign in to comment.