@modern-js/main-doc 0.0.0-next-20230216043905 → 0.0.0-next-20230217040130
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +2 -3
- package/LICENSE +0 -123
- package/README.md +26 -0
- package/en/apis/app/commands.mdx +297 -0
- package/en/apis/app/hooks/_category_.json +1 -1
- package/en/apis/app/hooks/src/routes.mdx +2 -2
- package/en/apis/app/runtime/core/create-app.mdx +1 -1
- package/en/components/init-app.mdx +5 -5
- package/en/configure/app/bff/prefix.mdx +2 -3
- package/en/configure/app/bff/proxy.mdx +1 -1
- package/en/configure/app/output/ssg.mdx +3 -3
- package/en/configure/app/runtime/master-app.mdx +1 -1
- package/en/configure/app/source/entries-dir.mdx +1 -1
- package/en/configure/app/testing/transformer.mdx +1 -1
- package/en/configure/app/tools/jest.mdx +1 -1
- package/en/guides/advanced-features/ssg.mdx +8 -8
- package/en/guides/basic-features/alias.mdx +4 -4
- package/en/guides/basic-features/routes.mdx +7 -7
- package/en/guides/get-started/quick-start.mdx +2 -2
- package/en/tutorials/first-app/c07-container.mdx +17 -17
- package/en/tutorials/first-app/c08-entries.mdx +23 -23
- package/package.json +3 -3
- package/zh/apis/app/commands.mdx +299 -0
- package/zh/apis/app/hooks/_category_.json +1 -1
- package/zh/apis/app/hooks/src/routes.mdx +2 -2
- package/zh/components/init-app.mdx +5 -5
- package/zh/configure/app/bff/prefix.mdx +1 -1
- package/zh/configure/app/bff/proxy.mdx +1 -1
- package/zh/configure/app/output/ssg.mdx +3 -3
- package/zh/configure/app/source/entries-dir.mdx +1 -1
- package/zh/guides/advanced-features/ssg.mdx +8 -8
- package/zh/guides/basic-features/alias.mdx +4 -4
- package/zh/guides/basic-features/routes.mdx +7 -7
- package/zh/guides/get-started/quick-start.mdx +2 -2
- package/zh/tutorials/first-app/c07-container.mdx +17 -17
- package/zh/tutorials/first-app/c08-entries.mdx +23 -23
- package/en/apis/app/commands/_category_.json +0 -5
- package/en/apis/app/commands/build.mdx +0 -39
- package/en/apis/app/commands/dev.mdx +0 -61
- package/en/apis/app/commands/inspect.mdx +0 -61
- package/en/apis/app/commands/lint.mdx +0 -19
- package/en/apis/app/commands/new.mdx +0 -55
- package/en/apis/app/commands/serve.mdx +0 -27
- package/en/apis/app/commands/test.mdx +0 -35
- package/en/apis/app/commands/upgrade.mdx +0 -18
- package/zh/apis/app/commands/_category_.json +0 -5
- package/zh/apis/app/commands/build.mdx +0 -39
- package/zh/apis/app/commands/dev.mdx +0 -61
- package/zh/apis/app/commands/inspect.mdx +0 -61
- package/zh/apis/app/commands/lint.mdx +0 -19
- package/zh/apis/app/commands/new.mdx +0 -54
- package/zh/apis/app/commands/serve.mdx +0 -27
- package/zh/apis/app/commands/test.mdx +0 -35
- package/zh/apis/app/commands/upgrade.mdx +0 -18
@@ -1,27 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sidebar_position: 6
|
3
|
-
---
|
4
|
-
# serve
|
5
|
-
|
6
|
-
```bash
|
7
|
-
Usage: modern serve [options]
|
8
|
-
|
9
|
-
run server
|
10
|
-
|
11
|
-
Options:
|
12
|
-
-c --config <config> 指定配置文件路径,可以为相对路径或绝对路径
|
13
|
-
-h, --help 显示命令帮助
|
14
|
-
--api-only 仅启动 API 接口服务
|
15
|
-
```
|
16
|
-
|
17
|
-
通常使用 `modern serve` 命令在生产环境下启用应用工程, 需要提前执行 [`build`](/apis/app/commands/build) 命令构建出对应产物。
|
18
|
-
|
19
|
-
默认情况下,应用将会在 `localhost:8080` 启动,可以通过 `server.port` 修改 Server 端口号:
|
20
|
-
|
21
|
-
```js
|
22
|
-
export default defineConfig({
|
23
|
-
server: {
|
24
|
-
port: 8081,
|
25
|
-
},
|
26
|
-
});
|
27
|
-
```
|
@@ -1,35 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sidebar_position: 3
|
3
|
-
---
|
4
|
-
# test
|
5
|
-
|
6
|
-
```bash
|
7
|
-
Usage: modern test [options]
|
8
|
-
|
9
|
-
Options:
|
10
|
-
-h, --help 显示命令帮助
|
11
|
-
```
|
12
|
-
|
13
|
-
:::caution 注意
|
14
|
-
`modern test` 命令需要先通过 [`new`](/apis/app/commands/new) 命令启用「单元测试 / 集成测试」功能
|
15
|
-
|
16
|
-
:::
|
17
|
-
|
18
|
-
`modern test` 命令会自动运行项目下的测试用例,效果如下:
|
19
|
-
|
20
|
-
```bash
|
21
|
-
$ npx modern test
|
22
|
-
PASS src/tests/index.test.ts
|
23
|
-
The add method
|
24
|
-
✓ should work fine. (2ms)
|
25
|
-
|
26
|
-
Test Suites: 1 passed, 1 total
|
27
|
-
Tests: 1 passed, 1 total
|
28
|
-
Snapshots: 0 total
|
29
|
-
Time: 0.994 s, estimated 1 s
|
30
|
-
```
|
31
|
-
|
32
|
-
:::info
|
33
|
-
`src` 和 `api` 目录下面 `*.test.(js|ts)` 都会默认识别为测试用例。
|
34
|
-
|
35
|
-
:::
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sidebar_position: 8
|
3
|
-
---
|
4
|
-
# upgrade
|
5
|
-
|
6
|
-
```
|
7
|
-
Usage: modern upgrade [options]
|
8
|
-
|
9
|
-
升级 Modern.js 到最新版本
|
10
|
-
|
11
|
-
Options:
|
12
|
-
--registry <registry> 定制 npm registry (default: "")
|
13
|
-
-d,--debug 开启 Debug 模式,打印调试日志信息 (default: false)
|
14
|
-
--cwd <cwd> 项目路径 (default: "")
|
15
|
-
-h, --help display help for command
|
16
|
-
```
|
17
|
-
|
18
|
-
在项目根目录下执行命令 `npx modern upgrade`,会默认将当前执行命令项目的 `package.json` 中的 Modern.js 相关依赖更新至最新版本。
|