@modern-js/module-tools-docs 2.53.0 → 2.54.1

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,19 @@
1
1
  # @modern-js/module-tools-docs
2
2
 
3
+ ## 2.54.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 44ef03f: fix: remove test command doc
8
+
9
+ fix: 移除 test 命令相关文档
10
+
11
+ ## 2.54.0
12
+
13
+ ### Patch Changes
14
+
15
+ - 38537fc: optimize the doc content
16
+
3
17
  ## 2.53.0
4
18
 
5
19
  ### Patch Changes
@@ -878,7 +878,7 @@ For more information about JSX Transform, you can refer to the following links:
878
878
 
879
879
  - [React Blog - Introducing the New JSX Transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html).
880
880
  - [esbuild - JSX](https://esbuild.github.io/api/#jsx).
881
- :::
881
+ :::
882
882
 
883
883
  ## metafile
884
884
 
@@ -70,20 +70,6 @@ The Modern.js Module provides the ability to use debugging tools, which can be s
70
70
 
71
71
  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.
72
72
 
73
- ## `modern test`
74
-
75
- ```bash
76
- Usage: modern test [options]
77
-
78
- Options:
79
- -u --updateSnapshot use this flag to re-record snapshots.
80
- --watch watch files for changes and rerun tests related to changed files.
81
- -h, --help show command help
82
- ```
83
-
84
- You need to execute `modern new` to turn on the test function before you can execute the `modern test` command.
85
- The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
86
-
87
73
  ## `modern lint`
88
74
 
89
75
  ```bash
@@ -97,7 +97,7 @@ export const libs = {
97
97
 
98
98
  In this case `babel-plugin-import` may also cause `Comps` to become `undefined`. So you need to remove the corresponding `babel-plugin-import` as well.
99
99
 
100
- ### Cannot find module http
100
+ ### Cannot find module 'http'
101
101
 
102
102
  If the output reports an error like `Cannot find module 'http'` at browser runtime, it means that your output has bundled node modules.
103
103
  This may occur if some of your dependencies support both browser and node, such as `axios`, in which case you only need to set the [platform](/api/config/build-config.html#platform) to `browser`.
@@ -17,7 +17,7 @@ In addition to the Addon, other configurations may also have differences. For ex
17
17
  - v6:[Document](https://storybook.js.org/docs/6.5/react/writing-stories/decorators#global-decorators)
18
18
  - v7:[Document](https://storybook.js.org/docs/react/writing-stories/decorators#global-decorators)
19
19
 
20
- ## Cannot find module 'react-dom/package.json
20
+ ## Cannot find module 'react-dom/package.json'
21
21
 
22
22
  When debug Storybook, the following problem occurs:
23
23
 
@@ -12,7 +12,6 @@ If you are planning to develop a project of the npm package type, then you came
12
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
13
  - **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
14
  - **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
- - **Testing capabilities with Jest**: When you need to test a module, you can use the `modern test` command of Modern.js Module, which not only integrates with [Jest](https://jestjs.io/), but also provides an API for configuring [Jest](https://jestjs.io/docs/configuration).
16
15
  - **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).
17
16
  - **Extensible plugin mechanism**: Want to integrate additional debugging tools for your project? Or maybe you want to do some extra processing during the build process, Modern.js Module provides a plugin mechanism and plugin hooks that cover both the `dev` command and the `build` command process. You can use them to extend the capabilities of your project.
18
17
  - **Lots more!** Modern.js Module will continue to optimize its build and debug features in the future. If there are important issues to be solved in module project building, or if a mainstream module project debugging tool or pattern emerges, then they will probably be supported by Modern.js Module.
@@ -70,20 +70,6 @@ Modern.js Module 提供了使用调试工具的能力,可以通过 `modern dev
70
70
 
71
71
  目前官方支持的调试工具有 [Rspress](https://rspress.dev/),因此在你执行 `modern new` 命令开启它后,就可以执行 `modern dev` 或者 `modern dev doc` 执行它。
72
72
 
73
- ## `modern test`
74
-
75
- ```bash
76
- Usage: modern test [options]
77
-
78
- Options:
79
- -u --updateSnapshot 使用此选项来更新快照
80
- --watch 监视文件的变更并重新运行相关的测试
81
- -h, --help 显示命令帮助
82
- ```
83
-
84
- 需要先执行 `modern new` 开启测试功能,然后才可以执行 `modern test` 命令。
85
- `modern test` 命令会自动将 `tests/*.test.(js|ts|jsx|tsx)` 文件当做测试用例运行。
86
-
87
73
  ## `modern lint`
88
74
 
89
75
  ```bash
@@ -39,15 +39,15 @@ export default defineConfig({
39
39
 
40
40
  `buildPreset` 代表着提前准备好的一组或者多组构建相关的配置,只需要使用 `buildPreset` 对应的预设值,就可以省去麻烦且复杂的配置工作,得到符合预期的产物。
41
41
 
42
- Modern.js Module 主要内置了两套构建预设,包括:
42
+ Modern.js Module 主要内置了两套构建预设,包括:
43
43
 
44
44
  - `npm-component`: 用于构建组件库。
45
- - `npm-library`: 用于打包其他库类型的项目,如工具库。
45
+ - `npm-library`: 用于打包其他库类型的项目,如工具库。
46
46
 
47
47
  同时,还提供一些变体,例如 `npm-library-with-umd` 和 `npm-library-es5`,顾名思义,分别对应带有 umd 产物和支持到 es5 语法的库预设。
48
- 详细配置可以查看其[API](/api/config/build-preset)。
48
+ 详细配置可以查看其 [API](/api/config/build-preset)
49
49
 
50
- 除此之外,我们也可以完全自定义构建配置:
50
+ 除此之外,我们也可以完全自定义构建配置:
51
51
 
52
52
  ## 构建配置
53
53
 
@@ -97,7 +97,7 @@ export const libs = {
97
97
 
98
98
  此时 `babel-plugin-import` 也可能会导致 `Comps` 变为 `undefined`。因此也需要移除对应的 `babel-plugin-import`。
99
99
 
100
- ### Cannot find module http
100
+ ### Cannot find module 'http'
101
101
 
102
102
  如果产物在浏览器运行时报了类似 `Cannot find module 'http'` 的错误,说明你的产物打包进了 node 模块。
103
103
  这可能会发生于你的依赖里有一些同时支持 browser 和 node 的三方包,例如 `axios`,此时只需要将 [platform](/api/config/build-config.html#platform) 设置为 `browser` 即可。
@@ -17,7 +17,7 @@ Modern.js Module 目前使用的 Storybook 版本是 v6,如果使用了 v7 版
17
17
  - v6:[文档链接](https://storybook.js.org/docs/6.5/react/writing-stories/decorators#global-decorators)
18
18
  - v7:[文档链接](https://storybook.js.org/docs/react/writing-stories/decorators#global-decorators)
19
19
 
20
- ## Cannot find module 'react-dom/package.json
20
+ ## Cannot find module 'react-dom/package.json'
21
21
 
22
22
  在执行 Storybook 调试的时候,出现下面的报错提示:
23
23
 
@@ -12,7 +12,6 @@ Modern.js Module 是 Modern.js 的模块工程解决方案,同时也是核心
12
12
  - **代码格式化**:在模块工程项目中,你可以执行 `modern lint` 来对代码进行格式化。同时初始化的模块工程项目里包含了 Modern.js 的 [ESLint](https://eslint.org/docs/latest/user-guide/core-concepts#what-is-eslint) 规则集,可以满足大部分场景下的需求。
13
13
  - **全面的构建能力和更快的构建速度**:Modern.js Module 基于 [esbuild](https://esbuild.github.io/getting-started/) 和 [SWC](https://swc.rs/) 提供了高性能的构建能力,并且为不同构建模块的场景提供了丰富的配置。
14
14
  - **Storybook 调试工具**:Modern.js Module 为调试模块项目提供了 [Storybook](https://storybook.js.org/) 调试工具。在安装了 Modern.js Module 的 Storybook 插件后,你可以使用 `storybook dev` 命令来启动它。你不仅可以使用 Storybook 对组件进行调试,也可以使用在其他类型的模块上。
15
- - **集成 Jest 的测试能力**:在需要对模块测试的时候,可以使用 Modern.js Module 的 `modern test` 命令。Modern.js Module 不仅集成了 [Jest](https://jestjs.io/),同时也提供了配置 [Jest](https://jestjs.io/docs/configuration) 的 API。
16
15
  - **基于 Changesets 实现的版本管理**:当需要对项目记录变更内容的时候,可以使用 `modern change` 命令生成包含变更内容的 Markdown 文件;当需要对项目进行版本升级的时候,可以使用 `modern bump` 命令通过 Markdown 文件分析并升级版本;当需要发布项目的时候,可以使用 `modern release` 命令对项目进行发布。Modern.js Module 基于 [Changesets](https://github.com/changesets/changesets) 实现了这些命令。
17
16
  - **可扩展性的插件机制**:想要为项目集成其他的调试工具?又或者是想要在构建过程中做一些额外处理?Modern.js Module 提供了插件机制和插件钩子,插件钩子覆盖了 `dev` 命令和 `build` 命令两个流程。你可以通过它们为项目进行能力的扩展。
18
17
  - **还有更多**:Modern.js Module 在未来还会不断地在构建、调试功能上进行优化。如果在模块项目构建上存在需要解决的重要问题,又或者是某个主流的模块项目调试工具、模式出现的时候,那么它们很可能成为 Modern.js Module 将要支持功能。
package/package.json CHANGED
@@ -9,14 +9,14 @@
9
9
  "directory": "packages/document/module-doc"
10
10
  },
11
11
  "license": "MIT",
12
- "version": "2.53.0",
12
+ "version": "2.54.1",
13
13
  "main": "index.js",
14
14
  "devDependencies": {
15
15
  "react": "^18.2.0",
16
16
  "react-dom": "^18.2.0",
17
17
  "rspress": "1.18.2",
18
18
  "@rspress/shared": "1.18.2",
19
- "@modern-js/doc-plugin-auto-sidebar": "2.53.0"
19
+ "@modern-js/doc-plugin-auto-sidebar": "2.54.1"
20
20
  },
21
21
  "scripts": {
22
22
  "dev": "rspress dev",