Skip to content

Commit 32c719a

Browse files
authored
docs: add README.zh-CN.md and update some chapters (#797)
1 parent 45ff407 commit 32c719a

File tree

6 files changed

+128
-65
lines changed

6 files changed

+128
-65
lines changed

README.md

Lines changed: 17 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,15 @@
1212
<a href="https://github.com/web-infra-dev/rslib/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="license" /></a>
1313
</p>
1414

15-
Rslib is a library development tool that leverages the well-designed configurations and plugins of [Rsbuild](https://rsbuild.dev), empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack.
16-
17-
## ✨ Why Rslib?
18-
19-
In the past, we typically did not use webpack or Rspack to build ESM packages because they often included excessive runtime code, making them less friendly to package consumers. However, the community has developed a vast ecosystem around webpack and Rspack, which provides powerful features like tree shaking, code splitting, module federation and more.
20-
21-
So we decided to create Rslib. It improves the quality of ESM output from Rspack and webpack, leverages their extensive ecosystem, and utilizes Rsbuild's excellent out-of-the-box configuration. Rslib aims to provide a superior developer experience and explore new possibilities based on the Rspack architecture.
22-
23-
![](https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png)
15+
English | [简体中文](./README.zh-CN.md)
2416

25-
Rslib is still in its early stages and under active development. We are building Rslib by working in two main parts:
17+
Rslib is a library development tool that leverages the well-designed configurations and plugins of [Rsbuild](https://rsbuild.dev), empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack.
2618

27-
- [bundler support track](https://github.com/web-infra-dev/rslib/issues/45): Improve the quality of ESM / CJS outputs by contributing to Rspack and webpack.
28-
- [Rslib features track](https://github.com/web-infra-dev/rslib/issues/46): Develop the core features of Rslib.
19+
Rslib aims to provide library developers with:
2920

30-
The roadmap may change as we move forward.
21+
- **Easy Library Creation**: Easily create high-quality JavaScript and TypeScript libraries in a simple and intuitive way.
22+
- **Simple Build Configuration**: Provides out-of-the-box build capabilities to meet the diverse needs of library development scenarios with simple configurations.
23+
- **Comprehensive Development Workflow**: Contains best practices for building, debugging, documentation, and testing during library development to help improve development efficiency and experience.
3124

3225
## 🔥 Features
3326

@@ -39,6 +32,14 @@ Rslib has the following features:
3932
- **Declaration file generation**: Including isolated declarations.
4033
- **Advanced features**: Module Federation, asset compression, PostCSS, Lightning CSS, and more.
4134

35+
## 🎯 Ecosystem
36+
37+
Rslib is implemented based on Rsbuild and fully reuses the capabilities and ecosystem of Rsbuild.
38+
39+
The following diagram illustrates the relationship between Rslib and other tools in the ecosystem:
40+
41+
<img src="https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />
42+
4243
## 📚 Getting started
4344

4445
To get started with Rslib, see the [Quick Start](https://lib.rsbuild.dev/guide/start/quick-start).
@@ -58,55 +59,15 @@ To get started with Rslib, see the [Quick Start](https://lib.rsbuild.dev/guide/s
5859

5960
## 🤝 Contribution
6061

61-
> New contributors welcome!
62+
> [!NOTE]
63+
> We highly value any contributions to Rslib!
6264
6365
Please read the [Contributing Guide](https://github.com/web-infra-dev/rslib/blob/main/CONTRIBUTING.md).
6466

6567
### Contributors
6668

6769
<a href="https://github.com/web-infra-dev/rslib/graphs/contributors" target="_blank">
68-
<table>
69-
<tr>
70-
<th colspan="2">
71-
<br/>
72-
<img src="https://contrib.rocks/image?repo=web-infra-dev/rslib&columns=16&max=96"><br/><br/>
73-
</th>
74-
</tr>
75-
<tr>
76-
<td>
77-
<picture>
78-
<source
79-
media="(prefers-color-scheme: dark)"
80-
srcset="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=2x3&color_scheme=dark"
81-
/>
82-
<img
83-
alt="Contributors of web-infra-dev/rslib"
84-
src="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=2x3&color_scheme=light"
85-
/>
86-
</picture>
87-
</td>
88-
<td rowspan="2">
89-
<picture>
90-
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=new&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=4x7&color_scheme=dark">
91-
<img alt="New trends of web-infra-dev" src="https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=new&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=4x7&color_scheme=light">
92-
</picture>
93-
</td>
94-
</tr>
95-
<tr>
96-
<td>
97-
<picture>
98-
<source
99-
media="(prefers-color-scheme: dark)"
100-
srcset="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=2x3&color_scheme=dark"
101-
/>
102-
<img
103-
alt="Contributors of web-infra-dev/rslib"
104-
src="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_90_days&owner_id=87694465&repo_ids=766839449&image_size=2x3&color_scheme=light"
105-
/>
106-
</picture>
107-
</td>
108-
</tr>
109-
</table>
70+
<img src="https://contrib.rocks/image?repo=web-infra-dev/rslib&columns=24">
11071
</a>
11172

11273
### Code of conduct

README.zh-CN.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<picture>
2+
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
3+
</picture>
4+
5+
# Rslib
6+
7+
<p>
8+
<a href="https://discord.gg/FQfm7VqU"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat-square&logo=discord&colorA=564341&colorB=F8F5FF" alt="Discord channel" /></a>
9+
<a href="https://npmjs.com/package/@rslib/core?activeTab=readme"><img src="https://img.shields.io/npm/v/@rslib/core?style=flat-square&colorA=564341&colorB=F8F5FF" alt="npm version" /></a>
10+
<a href="https://npmcharts.com/compare/@rslib/core?minimal=true"><img src="https://img.shields.io/npm/dm/@rslib/core.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="downloads" /></a>
11+
<a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/@rslib/core.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="node version"></a>
12+
<a href="https://github.com/web-infra-dev/rslib/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="license" /></a>
13+
</p>
14+
15+
[English](./README.md) | 简体中文
16+
17+
Rslib 是一个库开发工具,它基于 [Rsbuild](https://rsbuild.dev/zh) 精心设计的配置和插件,使库开发者得以复用 webpack 和 Rspack 繁荣的知识和生态系统。
18+
19+
Rslib 旨在为库开发者提供:
20+
21+
- **便捷的库创建**:以简单直观的方式,轻松创建高质量的 JavaScript 和 TypeScript 库。
22+
- **简洁的构建配置**:提供开箱即用的构建能力,以简洁的配置,满足库开发场景的多样化需求。
23+
- **完善的开发流程**:包含库开发过程中构建、调试、文档和测试等环节的最佳实践,帮助提升开发效率与体验。
24+
25+
## 🔥 功能
26+
27+
Rslib 提供了以下功能:
28+
29+
- **多种语言的编译**: TypeScript、JSX、Sass、Less、CSS Modules、Wasm 等。
30+
- **灵活的构建模式**: Bundle 和 bundleless 模式以满足不同的需求。
31+
- **多种输出格式**: ESM、CJS 和 UMD 以实现最大兼容性。
32+
- **类型声明文件生成**: 包括 isolated declarations。
33+
- **进阶功能**: 模块联邦、资源压缩、PostCSS、Lightning CSS 等。
34+
35+
## 🎯 生态
36+
37+
Rslib 基于 Rsbuild 实现,并完全复用 Rsbuild 的能力和生态系统。
38+
39+
下图说明了 Rsbuild 与生态中其他工具之间的关系:
40+
41+
<img src="https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />
42+
43+
## 📚 快速上手
44+
45+
你可以参考 [快速上手](https://lib.rsbuild.dev/zh/guide/start/quick-start) 来开始体验 Rslib。
46+
47+
## 🦀 链接
48+
49+
- [Rspack](https://github.com/web-infra-dev/rspack): 基于 Rust 的高性能打包工具。
50+
- [Rsbuild](https://github.com/web-infra-dev/rsbuild): 由 Rspack 驱动的构建工具。
51+
- [Rspress](https://github.com/web-infra-dev/rspress): 基于 Rsbuild 的静态站点生成器。
52+
- [Rsdoctor](https://github.com/web-infra-dev/rsdoctor): 针对 Rspack 和 webpack 的一站式构建分析工具。
53+
- [Modern.js](https://github.com/web-infra-dev/modern.js): 基于 Rsbuild 的渐进式 React 框架。
54+
- [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack): 与 Rspack 和 Rsbuild 相关的精彩内容列表。
55+
- [rspack-examples](https://github.com/rspack-contrib/rspack-examples): Rspack、Rsbuild、Rspress 和 Rsdoctor 的示例项目。
56+
- [storybook-rsbuild](https://github.com/rspack-contrib/storybook-rsbuild): 基于 Rsbuild 构建的 Storybook。
57+
- [rsbuild-plugin-template](https://github.com/rspack-contrib/rsbuild-plugin-template): 使用此模板创建你的 Rsbuild 插件。
58+
- [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources): Rspack、Rsbuild、Rslib、Rspress 和 Rsdoctor 的设计资源。
59+
60+
## 🤝 参与贡献
61+
62+
> [!NOTE]
63+
> 我们非常欢迎任何对 Rslib 的贡献!
64+
65+
请阅读 [贡献指南](https://github.com/web-infra-dev/rslib/blob/main/CONTRIBUTING.md)
66+
67+
### 贡献者
68+
69+
<a href="https://github.com/web-infra-dev/rslib/graphs/contributors" target="_blank">
70+
<img src="https://contrib.rocks/image?repo=web-infra-dev/rslib&columns=24">
71+
</a>
72+
73+
### 行为准则
74+
75+
本仓库采纳了字节跳动的开源项目行为准则。请点击 [行为准则](./CODE_OF_CONDUCT.md) 查看更多的信息。
76+
77+
## 🧑‍💻 社区
78+
79+
欢迎加入我们的 [Discord](https://discord.gg/FQfm7VqU) 交流频道!Rstack 团队和用户都在那里活跃,并且我们一直期待着各种贡献。
80+
81+
你也可以加入 [飞书群](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=3c3vca77-bfc0-4ef5-b62b-9c5c9c92f1b4) 与大家一起交流。
82+
83+
## 🌟 质量
84+
85+
Rslib 通过 [Web Infra QoS](https://web-infra-qos.netlify.app?product=rslib&metrics=bundle-size) 来观测核心指标的变化情况,比如 bundle size、compile speed 和 install size。
86+
87+
## 🙏 致谢
88+
89+
Rslib 的一些实现参考了社区中杰出的项目,对他们表示感谢:
90+
91+
- [esbuild](https://github.com/evanw/esbuild),由 [Evan Wallace](https://github.com/evanw) 创建。
92+
- [tsup](https://github.com/egoist/tsup), 由 [EGOIST](https://github.com/egoist) 创建。
93+
94+
Rslib 网站由 [Netlify](https://www.netlify.com/) 提供支持。
95+
96+
## 📖 License
97+
98+
Rslib 项目基于 [MIT 协议](https://github.com/web-infra-dev/rslib/blob/main/LICENSE)

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
}
7676
},
7777
"engines": {
78-
"node": ">=16.0.0"
78+
"node": ">=16.7.0"
7979
},
8080
"publishConfig": {
8181
"access": "public",

packages/plugin-dts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}
5858
},
5959
"engines": {
60-
"node": ">=16.0.0"
60+
"node": ">=16.7.0"
6161
},
6262
"publishConfig": {
6363
"access": "public",

website/docs/en/guide/start/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Rslib provides a comprehensive set of build features for library development, in
1010
- **Declaration file generation**: Including isolated declarations.
1111
- **Advanced features**: Module Federation, asset compression, PostCSS, Lightning CSS, and more.
1212

13-
## 🚀 Why Rslib
13+
## Why Rslib
1414

15-
In developing component or utility libraries, developers need to focus not only on implementing project logic but also on handling non-code tasks such as building, debugging, documentation, and testing. Many existing community tools and solutions can address some of these requirements; however, for developers who are not familiar with these tools, meeting these demands often involves tedious configuration or coordinating multiple tools.
15+
During the development of component or utility libraries, developers need to focus not only on implementing project logic, but also on handling tasks that are separate from the code itself, such as building, debugging, documentation, and testing. Although many community tools and solutions can address some of these needs, developers who are not familiar with them often face cumbersome configuration requirements or need to coordinate multiple tools to meet these demands.
1616

17-
Based on Rspack and Rsbuild, Rslib offers a comprehensive solution tailored to the diverse needs of library development. It effectively addresses issues like an underdeveloped tooling ecosystem, high costs for module standard compatibility, and insufficient output optimization. Rslib improves upon webpack's limited support for library ESM outputs, enabling the production of high-quality, tree-shakeable ESM builds. Additionally, Rslib fully capitalizes on the build performance advantages of Rspack and leverages the strengths of both the webpack and Rspack ecosystems to robustly support features such as Module Federation.
17+
Based on Rspack and Rsbuild, Rslib offers a comprehensive solution tailored to the diverse requirements of library development, effectively addressing issues such as incomplete tool ecosystems, high costs for module standard compatibility, and insufficient output optimization. Rslib optimizes webpack's limited support for library ESM outputs, reducing redundant runtime code and generating high-quality ESM outputs that are tree-shaking friendly for library consumers. Additionally, Rslib fully leverages the build performance advantages of Rspack and capitalizes the strengths of both the webpack and Rspack ecosystems to robustly support features such as Module Federation.
1818

19-
Furthermore, by sharing a unified configuration, Rslib resolves the challenge of reusing build configurations between application projects and library projects, thereby reducing configuration overhead and enhancing developer productivity and experience.
19+
Furthermore, Rslib utilizes Rsbuild's out-of-the-box configuration to facilitate configuration sharing between application and library projects, resolving the challenge of reusing build configurations between application projects and library projects, thereby reducing the configuration overhead for developers and improving development efficiency and experience.
20+
21+
In the future, Rslib will explore additional possibilities by leveraging the new features of Rspack.
2022

2123
## 🔥 Features
2224

website/docs/zh/guide/start/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Rslib 提供了丰富的构建功能,包括:
1010
- **类型声明文件生成**: 包括 isolated declarations。
1111
- **进阶功能**: 模块联邦、资源压缩、PostCSS、Lightning CSS 等。
1212

13-
## 🚀 为什么选择 Rslib
13+
## 为什么选择 Rslib
1414

1515
在开发组件库或工具库时,开发者不仅需要关注项目逻辑的实现,还需考虑项目的构建、调试、文档和测试等与代码逻辑无关的工作。现有许多社区工具与方案通常能较好地满足其中部分需求,但对于不熟悉这些工具与方案的开发者来说,往往需要繁琐的配置工作或多种工具配合使用,以满足这些需求。
1616

17-
Rslib 基于 Rspack 与 Rsbuild 实现,针对库开发场景的多样化需求,提供了一套完整的解决方案,有效解决了库开发中的工具生态不完善、模块规范兼容成本高、产物优化不足等问题。Rslib 对 webpack 对 library ESM 产物支持不足的情况进行了优化,可以产出支持 tree-shaking 的高质量 ESM 产物。同时,Rslib 充分发挥了 Rspack 带来的构建性能优势,并利用 webpack / Rspack 生态的优势,很好地支持了模块联邦等功能。
17+
Rslib 基于 Rspack 与 Rsbuild 实现,针对库开发场景的多样化需求,提供了一套完整的解决方案,有效解决了库开发中的工具生态不完善、模块规范兼容成本高、产物优化不足等问题。Rslib 对 webpack 对 library ESM 产物支持不足的情况进行了优化,减少了冗余的运行时代码,可以产出对库消费者友好的支持 tree-shaking 的高质量 ESM 产物。同时,Rslib 充分发挥了 Rspack 带来的构建性能优势,并利用 webpack / Rspack 生态的优势,很好地支持了模块联邦等功能。
1818

19-
此外,Rslib 可以通过共享一套统一的配置,解决应用项目与库项目之间构建配置难以复用的问题,进而降低开发者的配置成本,提升开发效率与体验。
19+
此外,Rslib 可以利用 Rsbuild 开箱即用的配置,与应用项目实现配置共享,解决应用项目与库项目之间构建配置难以复用的问题,进而降低开发者的配置成本,提升开发效率与体验。
20+
21+
未来,Rslib 将基于 Rspack 的新特性,探索更多的可能性。
2022

2123
## 🔥 特性
2224

0 commit comments

Comments
 (0)