@modern-js/module-tools-docs 2.60.0 → 2.60.2
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 +4 -0
- package/docs/en/api/config/dev.md +2 -2
- package/docs/en/guide/basic/command-preview.md +0 -16
- package/docs/en/guide/intro/welcome.md +0 -1
- package/docs/zh/api/config/dev.md +2 -2
- package/docs/zh/guide/basic/command-preview.md +0 -16
- package/docs/zh/guide/intro/welcome.md +0 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
};
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
You can modify the webpack configuration of the Storybook Preview-iframe via `dev.storybook.webpack`. The usage can be found in the [`tools.webpack`](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpack) configuration of Modern.js
|
|
32
|
+
You can modify the webpack configuration of the Storybook Preview-iframe via `dev.storybook.webpack`. The usage can be found in the [`tools.webpack`](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpack) configuration of Modern.js.
|
|
33
33
|
|
|
34
34
|

|
|
35
35
|
|
|
@@ -66,4 +66,4 @@ export default {
|
|
|
66
66
|
};
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
You can modify the webpack configuration of the Storybook Preview-iframe via `dev.storybook.webpackChain`. You can refer to Modern.js
|
|
69
|
+
You can modify the webpack configuration of the Storybook Preview-iframe via `dev.storybook.webpackChain`. You can refer to Modern.js's [`tools.webpackChain`](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpackchain) configuration for how to use it.
|
|
@@ -69,22 +69,6 @@ The Modern.js Module provides the ability to use debugging tools, which can be s
|
|
|
69
69
|
|
|
70
70
|
The officially supported debugging tool is [Rspress](https://rspress.dev/), so you can run `modern dev` or `modern dev doc` to execute it after you run `modern new` to enable it.
|
|
71
71
|
|
|
72
|
-
## `modern lint`
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
Usage: modern lint [options] [. .files]
|
|
76
|
-
|
|
77
|
-
lint and fix source files
|
|
78
|
-
|
|
79
|
-
Options:
|
|
80
|
-
--no-fix disable auto fix source file
|
|
81
|
-
-h, --help display help for command
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Run [ESLint](https://eslint.org/) to check the syntax of the code. Usually, we only need to check the part of the code that was changed in this commit with [lint-staged](https://github.com/okonet/lint-staged) during the `-git commit` phase.
|
|
85
|
-
|
|
86
|
-
- The `-no-fix` argument turns off the ability to automatically fix lint error code.
|
|
87
|
-
|
|
88
72
|
## `modern change`
|
|
89
73
|
|
|
90
74
|
```bash
|
|
@@ -9,7 +9,6 @@ Modern.js Module is a modules engineering solution for Modern.js, as well as a c
|
|
|
9
9
|
If you are planning to develop a project of the npm package type, then you came to the right place! Modern.js provides a professional Modern.js Module. It gives you:
|
|
10
10
|
|
|
11
11
|
- **Simple project initialization**: simply execute the `npx @modern-js/create project-dir` command, followed by a few interactive questions, to create a complete module type project. The created project also supports the choice of two package managers, [**pnpm**](https://pnpm.io/) and [**Yarn**](https://classic.yarnpkg.com/).
|
|
12
|
-
- **Code formatting**: In Modern.js Module, you can execute `modern lint` to format the code. The initialized module project includes the [ESLint](https://eslint.org/docs/latest/user-guide/core-concepts#what-is-eslint) ruleset for Modern.js for most scenarios.
|
|
13
12
|
- **Comprehensive build capabilities and faster builds**: Modern.js Module provides high-performance build capabilities based on [esbuild](https://esbuild.github.io/getting-started/) and [SWC](https://swc.rs/), and provides rich configurations for different build scenarios.
|
|
14
13
|
- **Storybook debugging tools**: Modern.js Module provides [Storybook](https://storybook.js.org/) debugging tools for debugging module projects. After installing the Storybook plugin for Modern.js Module, you can start it with the `storybook dev` command. You can use Storybook not only for debugging components, but also for other types of modules.
|
|
15
14
|
- **Versioning based on Changesets**: When you need to record changes to a project, you can use the `modern change` command to generate a Markdown file containing the changes; when you need to upgrade a project, you can use the `modern bump` command to analyze and upgrade the version through the Markdown file; when you need to release a project, you can use the `modern release` command to release the project; Modern.js Module implements these commands based on [Changesets](https://github.com/changesets/changesets).
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
};
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
你可以通过 `dev.storybook.webpack` 来修改 Storybook Preview-iframe 的 webpack 配置。使用方式可以参考 Modern.js
|
|
32
|
+
你可以通过 `dev.storybook.webpack` 来修改 Storybook Preview-iframe 的 webpack 配置。使用方式可以参考 Modern.js 的 [`tools.webpack`](https://modernjs.dev/builder/api/config-tools.html#toolswebpack) 配置。
|
|
33
33
|
|
|
34
34
|

|
|
35
35
|
|
|
@@ -66,4 +66,4 @@ export default {
|
|
|
66
66
|
};
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
你可以通过 `dev.storybook.webpackChain` 来修改 Storybook Preview-iframe 的 webpack 配置。使用方式可以参考 Modern.js
|
|
69
|
+
你可以通过 `dev.storybook.webpackChain` 来修改 Storybook Preview-iframe 的 webpack 配置。使用方式可以参考 Modern.js 的 [`tools.webpackChain`](https://modernjs.dev/builder/api/config-tools.html#toolswebpackchain) 配置。
|
|
@@ -69,22 +69,6 @@ Modern.js Module 提供了使用调试工具的能力,可以通过 `modern dev
|
|
|
69
69
|
|
|
70
70
|
目前官方支持的调试工具有 [Rspress](https://rspress.dev/),因此在你执行 `modern new` 命令开启它后,就可以执行 `modern dev` 或者 `modern dev doc` 执行它。
|
|
71
71
|
|
|
72
|
-
## `modern lint`
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
Usage: modern lint [options] [...files]
|
|
76
|
-
|
|
77
|
-
lint and fix source files
|
|
78
|
-
|
|
79
|
-
Options:
|
|
80
|
-
--no-fix disable auto fix source file
|
|
81
|
-
-h, --help display help for command
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
运行 [ESLint](https://eslint.org/) 检查代码语法情况。通常情况下,我们只需要在 `git commit` 阶段通过 [lint-staged](https://github.com/okonet/lint-staged) 检查本次提交修改的部分代码。
|
|
85
|
-
|
|
86
|
-
- `--no-fix` 参数设置后可以关闭自动修复 lint 错误代码的能力。
|
|
87
|
-
|
|
88
72
|
## `modern change`
|
|
89
73
|
|
|
90
74
|
```bash
|
|
@@ -9,7 +9,6 @@ Modern.js Module 是 Modern.js 的模块工程解决方案,同时也是核心
|
|
|
9
9
|
如果你正打算开发一个 npm 包类型的项目,那么你就来对地方了!Modern.js 提供了专业的模块工程解决方案。它带来了:
|
|
10
10
|
|
|
11
11
|
- **简单的项目初始化**:仅需执行 `npx @modern-js/create project-dir` 命令,然后进行几个交互问题,就可以创建一个完整的模块类型项目。创建的项目还支持选择 [**pnpm**](https://pnpm.io/)、[**Yarn**](https://classic.yarnpkg.com/) 两种包管理器。
|
|
12
|
-
- **代码格式化**:在模块工程项目中,你可以执行 `modern lint` 来对代码进行格式化。同时初始化的模块工程项目里包含了 Modern.js 的 [ESLint](https://eslint.org/docs/latest/user-guide/core-concepts#what-is-eslint) 规则集,可以满足大部分场景下的需求。
|
|
13
12
|
- **全面的构建能力和更快的构建速度**:Modern.js Module 基于 [esbuild](https://esbuild.github.io/getting-started/) 和 [SWC](https://swc.rs/) 提供了高性能的构建能力,并且为不同构建模块的场景提供了丰富的配置。
|
|
14
13
|
- **Storybook 调试工具**:Modern.js Module 为调试模块项目提供了 [Storybook](https://storybook.js.org/) 调试工具。在安装了 Modern.js Module 的 Storybook 插件后,你可以使用 `storybook dev` 命令来启动它。你不仅可以使用 Storybook 对组件进行调试,也可以使用在其他类型的模块上。
|
|
15
14
|
- **基于 Changesets 实现的版本管理**:当需要对项目记录变更内容的时候,可以使用 `modern change` 命令生成包含变更内容的 Markdown 文件;当需要对项目进行版本升级的时候,可以使用 `modern bump` 命令通过 Markdown 文件分析并升级版本;当需要发布项目的时候,可以使用 `modern release` 命令对项目进行发布。Modern.js Module 基于 [Changesets](https://github.com/changesets/changesets) 实现了这些命令。
|
package/package.json
CHANGED
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"directory": "packages/document/module-doc"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "2.60.
|
|
12
|
+
"version": "2.60.2",
|
|
13
13
|
"main": "index.js",
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@modern-js/doc-plugin-auto-sidebar": "2.58.1",
|
|
16
|
-
"@rspress/shared": "1.
|
|
16
|
+
"@rspress/shared": "1.31.0",
|
|
17
17
|
"react": "^18.2.0",
|
|
18
18
|
"react-dom": "^18.2.0",
|
|
19
|
-
"rspress": "1.
|
|
19
|
+
"rspress": "1.31.0"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "rspress dev",
|
|
23
|
-
"build
|
|
23
|
+
"build": "rspress build",
|
|
24
24
|
"preview": "rspress preview"
|
|
25
25
|
}
|
|
26
26
|
}
|