@modern-js/module-tools-docs 2.61.0 → 2.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @modern-js/module-tools-docs
2
2
 
3
+ ## 2.62.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 02a2461: docs: add migration tip for Modern.js Module
8
+
3
9
  ## 2.61.0
4
10
 
5
11
  ## 2.60.6
@@ -1074,6 +1074,36 @@ export default defineConfig({
1074
1074
  });
1075
1075
  ```
1076
1076
 
1077
+
1078
+ ### resolve.tsconfig
1079
+
1080
+ Used to configure enhanced-resolve in [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin) to support resolution of alias in tsconfig.json and nested `@` alias conflicts.
1081
+
1082
+ - **Type**:
1083
+
1084
+ ```ts
1085
+ type Tsconfig = {
1086
+ configFile: string,
1087
+ references?: string[] | undefined,
1088
+ };
1089
+ ```
1090
+
1091
+ - **Default**: `{ configFile: './tsconfig.json', references: undefined }`
1092
+ - **Version**: `>=MAJOR_VERSION.61.1`
1093
+
1094
+ ```js title="modern.config.ts"
1095
+ export default defineConfig({
1096
+ buildConfig: {
1097
+ resolve: {
1098
+ tsConfig: {
1099
+ configFile: './tsconfig.json',
1100
+ }
1101
+ },
1102
+ },
1103
+ });
1104
+ ```
1105
+
1106
+
1077
1107
  ## shims
1078
1108
 
1079
1109
  When building CommonJS/ESM artifacts, inject some polyfill code such as `__dirname` which can only be used in CommonJS.
@@ -4,36 +4,19 @@ sidebar_position: 3
4
4
 
5
5
  # Quick Start
6
6
 
7
- ## 3 minute demo
8
-
9
- 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.
7
+ :::tip
10
8
 
11
- ### Create new project
9
+ 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.
12
10
 
13
- **If you want to create a complete Modern.js Module, you can execute the following command:**
11
+ 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.
14
12
 
15
- ```bash
16
- npx @modern-js/create your-project-dir-name
17
- ```
13
+ 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.
18
14
 
19
- :::info
20
- Execute `npx @modern-js/create -h` for more command line arguments
21
15
  :::
22
16
 
23
- Next, in the issue interaction, follow the options below.
24
-
25
- ```text
26
- ? Please select the type of project you want to create: Npm Module
27
- ? Please fill in the project name: library
28
- ? Please select the programming language: TS
29
- ? Please select the package manager: pnpm
30
- ```
31
-
32
- > The project name is the value of the `"name"` field in `package.json`.
33
-
34
- 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.
17
+ ## 3 minute demo
35
18
 
36
- 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.
19
+ 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.
37
20
 
38
21
  ### Add to an existing project
39
22
 
@@ -1061,6 +1061,35 @@ export default defineConfig({
1061
1061
  });
1062
1062
  ```
1063
1063
 
1064
+ ### resolve.tsconfig
1065
+
1066
+ 用于配置 enhanced-resolve 中的 [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin),来支持解析 tsconfig.json 中的 alias 和嵌套 `@` 别名冲突的问题。
1067
+
1068
+ - 类型:
1069
+
1070
+ ```ts
1071
+ type Tsconfig = {
1072
+ configFile: string,
1073
+ references?: string[] | undefined,
1074
+ };
1075
+ ```
1076
+
1077
+ - 默认值: `{ configFile: config.tsconfig, references: undefined }`
1078
+ - 版本:`>=MAJOR_VERSION.61.1`
1079
+
1080
+ ```js title="modern.config.ts"
1081
+ export default defineConfig({
1082
+ buildConfig: {
1083
+ resolve: {
1084
+ tsConfig: {
1085
+ configFile: './tsconfig.json',
1086
+ }
1087
+ },
1088
+ },
1089
+ });
1090
+ ```
1091
+
1092
+
1064
1093
  ## shims
1065
1094
 
1066
1095
  在构建 cjs / esm 产物时注入一些垫片代码。
@@ -4,36 +4,19 @@ sidebar_position: 3
4
4
 
5
5
  # 快速开始
6
6
 
7
- ## 三分钟快速上手
8
-
9
- 想要实际体验 Modern.js Module?首先你需要安装 [Node.js LTS](https://github.com/nodejs/Release),并确保 Node 版本大于等于 **16.0.0**。我们推荐使用 Node.js 18 的 LTS 版本。
7
+ :::tip
10
8
 
11
- ### 创建新项目
9
+ 我们不再推荐创建新的 Modern.js Module 项目,因为我们已经基于 Rsbuild 开发了 Rslib,它是下一代的 Library 开发工具,将提供更好的构建性能和插件生态,你可以参考 [Rslib 仓库](https://github.com/web-infra-dev/rslib) 了解更多信息。
12
10
 
13
- **如果你想要创建一个完整的 Modern.js Module 项目,可以执行以下命令:**
11
+ Modern.js 后续将专注于构建一流的全栈 React 框架,Modern.js Module 会被逐渐废弃。我们已经为 Modern.js Module 项目提供了 [迁移指南](https://lib.rsbuild.dev/guide/migration/modernjs-module),你可以参考该指南将 Modern.js Module 项目迁移到 Rslib。
14
12
 
15
- ```bash
16
- npx @modern-js/create your-project-dir-name
17
- ```
13
+ Modern.js Module 的 npm 包和文档将继续保持可用,我们不再向 Modern.js Module 添加新功能,但会提供必要的 bug fixes。
18
14
 
19
- :::info
20
- 执行 `npx @modern-js/create -h` 查看更多命令行参数
21
15
  :::
22
16
 
23
- 接着在问题交互中,按照如下选择:
24
-
25
- ```bash
26
- ? 请选择你想创建的工程类型:Npm 模块
27
- ? 请填写项目名称:library
28
- ? 请选择开发语言:TS
29
- ? 请选择包管理工具:pnpm
30
- ```
31
-
32
- > 项目名称为 `package.json` 中的 `"name"` 字段值。
33
-
34
- 接着就会开始初始化项目的流程。在项目目录和文件生成以及依赖安装完毕后,此时就创建了一个完整的 Modern.js Module 项目。
17
+ ## 三分钟快速上手
35
18
 
36
- 我们可以直接执行 `pnpm build` 命令启动项目的构建,执行 `pnpm build --watch` 命令开启构建的观察模式。
19
+ 想要实际体验 Modern.js Module?首先你需要安装 [Node.js LTS](https://github.com/nodejs/Release),并确保 Node 版本大于等于 **16.0.0**。我们推荐使用 Node.js 18 的 LTS 版本。
37
20
 
38
21
  ### 接入已有项目
39
22
 
package/package.json CHANGED
@@ -9,14 +9,14 @@
9
9
  "directory": "packages/document/module-doc"
10
10
  },
11
11
  "license": "MIT",
12
- "version": "2.61.0",
12
+ "version": "2.62.0",
13
13
  "main": "index.js",
14
14
  "devDependencies": {
15
15
  "@modern-js/doc-plugin-auto-sidebar": "2.58.1",
16
- "@rspress/shared": "1.35.3",
16
+ "@rspress/shared": "1.35.4",
17
17
  "react": "^18.3.1",
18
18
  "react-dom": "^18.3.1",
19
- "rspress": "1.35.3"
19
+ "rspress": "1.35.4"
20
20
  },
21
21
  "scripts": {
22
22
  "dev": "rspress dev",