Skip to content

Commit

Permalink
docs: add migration tip for Modern.js Module (#6532)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Nov 13, 2024
1 parent 982b3d8 commit 02a2461
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-toes-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-js/module-tools-docs': patch
---

docs: add migration tip for Modern.js Module
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,19 @@ sidebar_position: 3

# Quick Start

## 3 minute demo

Want to experience Modern.js Module in action? The only prerequisite you need is [Node.js LTS](https://github.com/nodejs/Release) and make sure your Node version is **>= 16.0.0**.We recommend using the LTS version of Node.js 18.
:::tip

### Create new project
We no longer recommend creating new Modern.js Module projects, as we have developed Rslib based on Rsbuild, which is the next-generation Library development tool that will provide better build performance and plugin ecosystem. You can refer to the [Rslib repository](https://github.com/web-infra-dev/rslib) for more information.

**If you want to create a complete Modern.js Module, you can execute the following command:**
Modern.js will focus on building a first-class full-stack React framework, and Modern.js Module will be gradually deprecated. We have provided a [migration guide](https://lib.rsbuild.dev/guide/migration/modernjs-module) for Modern.js Module projects, which you can follow to migrate your Modern.js Module project to Rslib.

```bash
npx @modern-js/create your-project-dir-name
```
The npm packages and documentation for Modern.js Module will remain available. We will no longer add new features to Modern.js Module but will provide necessary bug fixes.

:::info
Execute `npx @modern-js/create -h` for more command line arguments
:::

Next, in the issue interaction, follow the options below.

```text
? Please select the type of project you want to create: Npm Module
? Please fill in the project name: library
? Please select the programming language: TS
? Please select the package manager: pnpm
```

> The project name is the value of the `"name"` field in `package.json`.
Then the process of initializing the project will start. After the project directory and files are generated and the dependencies are installed, a complete module project is created.
## 3 minute demo

We can start the project build directly with the `pnpm build` command, and start the build in watching mode with the `pnpm build --watch` command.
Want to experience Modern.js Module in action? The only prerequisite you need is [Node.js LTS](https://github.com/nodejs/Release) and make sure your Node version is **>= 16.0.0**.We recommend using the LTS version of Node.js 18.

### Add to an existing project

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,19 @@ sidebar_position: 3

# 快速开始

## 三分钟快速上手

想要实际体验 Modern.js Module?首先你需要安装 [Node.js LTS](https://github.com/nodejs/Release),并确保 Node 版本大于等于 **16.0.0**。我们推荐使用 Node.js 18 的 LTS 版本。
:::tip

### 创建新项目
我们不再推荐创建新的 Modern.js Module 项目,因为我们已经基于 Rsbuild 开发了 Rslib,它是下一代的 Library 开发工具,将提供更好的构建性能和插件生态,你可以参考 [Rslib 仓库](https://github.com/web-infra-dev/rslib) 了解更多信息。

**如果你想要创建一个完整的 Modern.js Module 项目,可以执行以下命令:**
Modern.js 后续将专注于构建一流的全栈 React 框架,Modern.js Module 会被逐渐废弃。我们已经为 Modern.js Module 项目提供了 [迁移指南](https://lib.rsbuild.dev/guide/migration/modernjs-module),你可以参考该指南将 Modern.js Module 项目迁移到 Rslib。

```bash
npx @modern-js/create your-project-dir-name
```
Modern.js Module 的 npm 包和文档将继续保持可用,我们不再向 Modern.js Module 添加新功能,但会提供必要的 bug fixes。

:::info
执行 `npx @modern-js/create -h` 查看更多命令行参数
:::

接着在问题交互中,按照如下选择:

```bash
? 请选择你想创建的工程类型:Npm 模块
? 请填写项目名称:library
? 请选择开发语言:TS
? 请选择包管理工具:pnpm
```

> 项目名称为 `package.json` 中的 `"name"` 字段值。
接着就会开始初始化项目的流程。在项目目录和文件生成以及依赖安装完毕后,此时就创建了一个完整的 Modern.js Module 项目。
## 三分钟快速上手

我们可以直接执行 `pnpm build` 命令启动项目的构建,执行 `pnpm build --watch` 命令开启构建的观察模式
想要实际体验 Modern.js Module?首先你需要安装 [Node.js LTS](https://github.com/nodejs/Release),并确保 Node 版本大于等于 **16.0.0**。我们推荐使用 Node.js 18 的 LTS 版本

### 接入已有项目

Expand Down

0 comments on commit 02a2461

Please sign in to comment.