@modern-js/main-doc 0.0.0-next-1686813930651 → 0.0.0-next-1686834137560
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,10 +1,11 @@
|
|
|
1
1
|
# @modern-js/main-doc
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-1686834137560
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Updated dependencies [4d4dca08f]
|
|
8
|
+
- @modern-js/builder-doc@0.0.0-next-1686834137560
|
|
8
9
|
|
|
9
10
|
## 2.23.0
|
|
10
11
|
|
|
@@ -11,10 +11,10 @@ Before using this option, you need to install and register the `@modern-js/plugi
|
|
|
11
11
|
# npm
|
|
12
12
|
npm add @modern-js/plugin-proxy -D
|
|
13
13
|
|
|
14
|
-
#yarn
|
|
14
|
+
# yarn
|
|
15
15
|
yarn add @modern-js/plugin-proxy -D
|
|
16
16
|
|
|
17
|
-
#pnpm
|
|
17
|
+
# pnpm
|
|
18
18
|
pnpm add @modern-js/plugin-proxy -D
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -8,14 +8,10 @@ sidebar_position: 1
|
|
|
8
8
|
- **Type:** `'babel-jest' | 'ts-jest'`
|
|
9
9
|
- **Default:** `babel-jest`
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
First you need to enable the "Unit Test" function using [new](/apis/app/commands#modern-new) command.
|
|
11
|
+
First need to run `new` command to enable [Unit Test / Integration Test] features.
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Configure the compiler for source code when executing tests: [babel-jest](https://www.npmjs.com/package/babel-jest) or [ts-jest](https://github.com/kulshekhar/ts-jest). `babel-jest` is used by default.
|
|
17
|
-
|
|
18
|
-
:::info Additional information
|
|
19
|
-
`Babel-jest` can also compile TS files, but there is no type error. If you need to check the TS type when running tests, then use `ts-jest`.
|
|
13
|
+
Configure the compilation tool used during test execution. By default, `babel-jest` is used. You can configure it to use either [babel-jest](https://www.npmjs.com/package/babel-jest) or [ts-jest](https://github.com/kulshekhar/ts-jest).
|
|
20
14
|
|
|
15
|
+
:::info Additional
|
|
16
|
+
`babel-jest` can compile TypeScript files but does not perform type checking. If you want to perform type checking on your TypeScript files while running test cases, you can use `ts-jest`.
|
|
21
17
|
:::
|
|
@@ -6,9 +6,9 @@ sidebar_position: 5
|
|
|
6
6
|
|
|
7
7
|
## Browserslist Configuration
|
|
8
8
|
|
|
9
|
-
Modern.js supports setting the browserslist for your web applications. You can set the [Browserslist](https://browsersl.ist/) in the `.browserslistrc` file.
|
|
9
|
+
Modern.js supports setting the browserslist for your web applications. You can set the value of [Browserslist](https://browsersl.ist/) in the `.browserslistrc` file.
|
|
10
10
|
|
|
11
|
-
When you create a new Modern.js project, it includes a `.browserslistrc` configuration by default, which means that JavaScript code will be compiled to ES6.
|
|
11
|
+
When you create a new Modern.js project, it will includes a `.browserslistrc` configuration by default, which means that the JavaScript code will be compiled to ES6.
|
|
12
12
|
|
|
13
13
|
```yaml title=".browserslistrc"
|
|
14
14
|
chrome >= 51
|
|
@@ -22,32 +22,11 @@ ios_saf >= 10
|
|
|
22
22
|
Please refer to [Modern.js Builder - Browserslist](https://modernjs.dev/builder/en/guide/advanced/browserslist) for more information.
|
|
23
23
|
:::
|
|
24
24
|
|
|
25
|
-
## Browserslist
|
|
26
|
-
|
|
27
|
-
Modern.js supports the `browserslist` field in the `package.json` file, or a `.browserslistrc` file to specify the target browser range covered by the project.
|
|
28
|
-
|
|
29
|
-
This value is used by ['@babel/preset-env'] (https://babeljs.io/docs/en/babel-preset-env) and ['autoprefixer'] (https://github.com/postcss/autoprefixer) to determine the JavaScript syntax features to be converted and the CSS browser prefix to be added.
|
|
30
|
-
|
|
31
|
-
The default value in Modern.js as follow:
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
['> 0.01%', 'not dead', 'not op_mini all'];
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
You can learn how to customize the browserslist [here](https://github.com/browserslist/browserslist).
|
|
38
|
-
|
|
39
|
-
See Modern.js Builder docs to learn more [Browserslist](https://modernjs.dev/builder/en/guide/advanced/browserslist.html) info.
|
|
40
|
-
|
|
41
|
-
:::note
|
|
42
|
-
Modern.js also supports configuring [output.override Browserslist](/configure/app/output/override-browserslist) to override the default browserslist value.
|
|
43
|
-
|
|
44
|
-
:::
|
|
45
|
-
|
|
46
25
|
## Polyfill
|
|
47
26
|
|
|
48
27
|
### Polyfill At Compile
|
|
49
28
|
|
|
50
|
-
Modern.js
|
|
29
|
+
Modern.js defaults to importing corresponding polyfill code from [core-js] (https://github.com/zloirock/core-js) during compilation.
|
|
51
30
|
|
|
52
31
|
By default, the required Polyfill code will be introduced according to the settings of the Browserslist, so there is no need to worry about the Polyfill problem of the project source code and third-party dependencies, but because it contains some Polyfill code that is not used, the final bundle size may be increased.
|
|
53
32
|
|
|
@@ -8,9 +8,12 @@ sidebar_position: 1
|
|
|
8
8
|
- **类型:** `'babel-jest' | 'ts-jest'`
|
|
9
9
|
- **默认值:** `babel-jest`
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
:::caution Caution
|
|
12
|
+
请先在当前应用项目根目录使用 [new](/apis/app/commands#modern-new) 启用测试功能。
|
|
13
|
+
:::
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
`babel-jest` 也可以编译 TS 文件,但不会类型报错,如果你需要跑测试的时候对 TS 类型进行校验,那么请使用 `ts-jest`。
|
|
15
|
+
配置执行测试时的编译工具,默认使用 `babel-jest`。可配置为 [babel-jest](https://www.npmjs.com/package/babel-jest) 或 [ts-jest](https://github.com/kulshekhar/ts-jest)。
|
|
15
16
|
|
|
17
|
+
:::info 补充信息
|
|
18
|
+
`babel-jest` 可以编译 TS 文件,但没有类型校验。如果你希望运行测试用例的时,能对 TS 类型进行校验,可以使用 `ts-jest`。
|
|
16
19
|
:::
|
package/package.json
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-1686834137560",
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
|
21
21
|
"access": "public",
|
|
22
22
|
"provenance": true
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@modern-js/builder-doc": "0.0.0-next-
|
|
25
|
+
"@modern-js/builder-doc": "0.0.0-next-1686834137560"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"classnames": "^2",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"fs-extra": "^10",
|
|
35
35
|
"@types/node": "^16",
|
|
36
36
|
"@types/fs-extra": "^9",
|
|
37
|
-
"@modern-js/doc
|
|
38
|
-
"@modern-js/doc-
|
|
39
|
-
"@modern-js/
|
|
37
|
+
"@modern-js/builder-doc": "0.0.0-next-1686834137560",
|
|
38
|
+
"@modern-js/doc-tools": "0.0.0-next-1686834137560",
|
|
39
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1686834137560"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "modern dev",
|