Skip to content

Commit 410adce

Browse files
committed
doc(command): update command
1 parent 47ece38 commit 410adce

File tree

26 files changed

+70
-70
lines changed

26 files changed

+70
-70
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ npm run dev
6262
```bash
6363
npm run link
6464
# 在项目中使用本地框架
65-
CLOUDBASE_FX_ENV=dev cloudbase framework:deploy
65+
CLOUDBASE_FX_ENV=dev cloudbase framework deploy
6666
```
6767

6868
### 执行完整端到端部署测试

README.en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cloudbase init
4444
4. **Deploy the application**
4545

4646
```bash
47-
cloudbase framework:deploy
47+
cloudbase framework deploy
4848
```
4949

5050
**Deploy a project created by Vue CLI with one click**
@@ -96,7 +96,7 @@ The configuration of the plug-in can be filled in manually or automatically gene
9696

9797
- `cloudbase init --without-template` generates project configuration·
9898

99-
- `cloudbase framework:deploy` automatically detects and generates plug-in configuration files and deploys
99+
- `cloudbase framework deploy` automatically detects and generates plug-in configuration files and deploys
100100

101101
### List of currently supported plugins
102102

@@ -116,13 +116,13 @@ The configuration of the plug-in can be filled in manually or automatically gene
116116

117117
For example, a Vue full-stack project, including website front-end and cloud functions
118118

119-
You can manually create a `cloudbaserc.json` under the project, fill in the following configuration file, and call `cloudbase framework:deploy` for deployment
119+
You can manually create a `cloudbaserc.json` under the project, fill in the following configuration file, and call `cloudbase framework deploy` for deployment
120120

121121
Or run directly
122122

123123
- `cloudbase init --without-template`
124124

125-
- `cloudbase framework:deploy` for automatic detection and deployment
125+
- `cloudbase framework deploy` for automatic detection and deployment
126126

127127
```json
128128
{

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ cloudbase init
6868
3. **部署应用**
6969

7070
```bash
71-
cloudbase framework:deploy
71+
cloudbase framework deploy
7272
```
7373

7474
**一键部署一个 Vue CLI 创建的 项目**
@@ -173,7 +173,7 @@ cloudbase
173173

174174
例如一个 Vue 的全栈项目,包含网站前端和云函数
175175

176-
可以在在项目下手动创建一个 `cloudbaserc.json`,填写如下配置文件,调用 `cloudbase framework:deploy` 进行部署
176+
可以在在项目下手动创建一个 `cloudbaserc.json`,填写如下配置文件,调用 `cloudbase framework deploy` 进行部署
177177

178178
或者直接运行 `cloudbase` 来进行自动检测并部署
179179

community/posts/2020-07-10-云开发推出前后端一体化部署工具CloudBaseFramework/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ tags:
9696
run: |
9797
npm i @cloudbase/cli
9898
cloudbase login --apiKeyId ${{secrets.SECRETID}} --apiKey ${{secrets.SECRETKEY}}
99-
cloudbase framework:deploy
99+
cloudbase framework deploy
100100
```
101101

102102
## 亮点 2: 一体化,易扩展
@@ -196,7 +196,7 @@ cloudbase init --template nuxt-ssr
196196
接下来,只需要进入到项目目录中调用命令进行部署
197197

198198
```bash
199-
cloudbase framework:deploy
199+
cloudbase framework deploy
200200
```
201201

202202
![](https://main.qcloudimg.com/raw/ae4a181e01c1f3278dc48940a5839551.png)

community/posts/2020-07-20-如何用 Cloudbase Framework 部署一个Vue项目/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ cloudbase
9090
接下来,输入以下命令,进行部署。
9191

9292
```
93-
cloudbase framework:deploy
93+
cloudbase framework deploy
9494
```
9595

9696
![](https://main.qcloudimg.com/raw/831e938cf46b4f3c160787b3c3fa8ca5.png)
@@ -170,7 +170,7 @@ cloudebaserc.json 里,会默认安装两个插件。之前提到的 [@cloudbas
170170
输入以下命令,进行部署。
171171

172172
```
173-
cloudbase framework:deploy
173+
cloudbase framework deploy
174174
```
175175

176176
部署成功

community/posts/2020-08-12-如何用云开发快速搭建实时 TodoList 应用/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ tags:
8888

8989
{
9090
"scripts": {
91-
"deploy:database": "cloudbase framework:deploy database"
91+
"deploy:database": "cloudbase framework deploy database"
9292
}
9393
}
9494

community/posts/2020-08-31-第一个Deno部署工具是如何打造的/index.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tags:
2626

2727
- cloudbase-framework deno 插件 [framework-plugin-deno](https://github.com/TencentCloudBase/cloudbase-framework/tree/master/packages/framework-plugin-deno)
2828
- [简易在线示例](https://test-1gxe3u9377a09734.service.tcloudbase.com/deno-app/)
29-
- 简易在线示例代码 [deno 模板](https://github.com/TencentCloudBase/cloudbase-templates/tree/master/deno)
29+
- 简易在线示例代码 [deno 模板](https://github.com/TencentCloudBase/cloudbase-templates/tree/master/deno)
3030

3131
开始着手 deno 插件开发时,CloudBase Framework 插件开发的文档暂缺,不过好在其他插件代码清晰易懂,可以参考其他插件进行开发。
3232

@@ -50,24 +50,26 @@ deno 生态有一个类似 node koa 的应用框架 [oak](https://github.com/oak
5050

5151
接下来考虑如何部署的问题,开始开发 CloudBase Framework deno 插件,`src/index.ts` 主要需要提供一个插件类给 CloudBase Framework 命令行组件使用。这个类需要继承自 `@cloudbase/framework-core` 的 Plugin。
5252

53-
参考其他插件写法,Plugin 是抽象类,需要自行实现抽象类的各个方法。其中在 build 方法中,需要构建中间产物,主要是编译过后的 Dockerfile 和需要包装到镜像的文件,然后通过 `framework-plugin-container` 提供 docker container 构建产物。
53+
参考其他插件写法,Plugin 是抽象类,需要自行实现抽象类的各个方法。其中在 build 方法中,需要构建中间产物,主要是编译过后的 Dockerfile 和需要包装到镜像的文件,然后通过 `framework-plugin-container` 提供 docker container 构建产物。
5454

5555
```js
56-
import { plugin as ContainerPlugin } from '@cloudbase/framework-plugin-container';
56+
import { plugin as ContainerPlugin } from "@cloudbase/framework-plugin-container";
5757
/*** code:other ***/
5858
class DenoPlugin extends Plugin {
5959
/*** code: 初始化处理 ***/
6060
async build() {
6161
// 构建 deno 中间产物
6262
this.buildOutput = await this.denoBuilder.build(
63-
this.resolvedInputs.projectPath || '.',
64-
{ /*** code: 给 buider 提供选项 ***/ }
63+
this.resolvedInputs.projectPath || ".",
64+
{
65+
/*** code: 给 buider 提供选项 ***/
66+
}
6567
);
6668

6769
// 提供 containerPlugin 对象
6870
const container = this.buildOutput.containers[0];
6971
this.containerPlugin = new ContainerPlugin(
70-
'container',
72+
"container",
7173
this.api,
7274
resolveInputs(
7375
{ localAbsolutePath: container.source },
@@ -99,19 +101,15 @@ class DenoPlugin extends Plugin {
99101
`src/builder.ts` 中,主要扩展 Builder 类,提供中间产物构建方法。其中 build 方法,参考其他插件,给出容器构建所需的固定返回即可。
100102

101103
```js
102-
import { Builder } from '@cloudbase/framework-core';
104+
import { Builder } from "@cloudbase/framework-core";
103105
/*** code: other ***/
104106
export class DenoBuilder extends Builder {
105107
/*** code: 初始化 ***/
106108
async build(localDir: string, options: BuilderBuildOptions) {
107109
/*** code: 选项处理,路径处理 ***/
108110
// 生成中间产物需要调用的方法
109111
await Promise.all([
110-
this.generator.generate(
111-
path.join(__dirname, '../assets'),
112-
appDir,
113-
spec
114-
),
112+
this.generator.generate(path.join(__dirname, "../assets"), appDir, spec),
115113
fs.copy(path.join(projectDir, localDir), appDir),
116114
]);
117115

@@ -127,7 +125,7 @@ export class DenoBuilder extends Builder {
127125
routes: [
128126
{
129127
path: options.path,
130-
targetType: 'container',
128+
targetType: "container",
131129
target: containerName,
132130
},
133131
],
@@ -144,7 +142,7 @@ export class DenoBuilder extends Builder {
144142

145143
本地需要部署的代码,需要提供一个 `cloudbaserc.json` 作为部署配置。如果是开发模板,需要配置属性 `"envId": "{{envId}}"``cloudbaserc.json` 参考 [CloudBase Framework 配置文档](https://github.com/TencentCloudBase/cloudbase-framework/blob/master/doc/config.md) 来配置属性。其中 inputs 属性将作为参数传递给插件。
146144

147-
以我个人模板调试为例,插件编写完毕后,需要在插件目录执行 `npm run build` 编译插件代码。然后在 cloudbase-framework 根目录执行 `npm run link` 实现插件的本地指向。最后在模板目录执行 `CLOUDBASE_FX_ENV=dev cloudbase framework:deploy -e test-1gxe3u9377a09734` 来进行部署。
145+
以我个人模板调试为例,插件编写完毕后,需要在插件目录执行 `npm run build` 编译插件代码。然后在 cloudbase-framework 根目录执行 `npm run link` 实现插件的本地指向。最后在模板目录执行 `CLOUDBASE_FX_ENV=dev cloudbase framework deploy -e test-1gxe3u9377a09734` 来进行部署。
148146

149147
test-1gxe3u9377a09734 为我个人的 envId,将会替换 `cloudbaserc.json` 中的 "{{envId}}" 部分。
150148

@@ -217,7 +215,7 @@ import { reset } from "https://deno.land/std@0.62.0/fmt/colors.ts";
217215

218216
### 总结
219217

220-
联系到 deno 的愿景是设计一款服务端运行的浏览器,忽然有了一些大胆的想法,想来在 ssr,测试,web资源编辑与创建方面,deno 未来可能会有一些独到的优势。总体来说,即便 deno 并非 node 的替代者,依靠其顺滑的开发部署体验,未来极有可能分走 node 相当一部分使用场景。而这个项目在 github 上的 start 数量,与社区参与人数的快速上涨,也证明其具有相当大的潜力。
218+
联系到 deno 的愿景是设计一款服务端运行的浏览器,忽然有了一些大胆的想法,想来在 ssr,测试,web 资源编辑与创建方面,deno 未来可能会有一些独到的优势。总体来说,即便 deno 并非 node 的替代者,依靠其顺滑的开发部署体验,未来极有可能分走 node 相当一部分使用场景。而这个项目在 github 上的 start 数量,与社区参与人数的快速上涨,也证明其具有相当大的潜力。
221219

222220
![Deno is coming!](https://main.qcloudimg.com/raw/236ff94b42f9872c71057fd045ebf30d.jpg)
223221

community/posts/2020-09-17-基于云开发 CloudBase 搭建在线视频会议应用/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ ENV_ID=tcb-demo-10cf5b
800800
执行 ClouBase Framework 的一键部署命令
801801

802802
```bash
803-
cloudbase framework:deploy
803+
cloudbase framework deploy
804804
```
805805

806806
![](https://tva1.sinaimg.cn/large/007S8ZIlgy1gib81yq9zlj30sq0gp44r.jpg)

doc/config.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 配置
22

3-
CloudBase Framework 部署需要创建一个 cloudbaserc.json,填写如下配置文件,调用 `cloudbase framework:deploy` 进行部署
3+
CloudBase Framework 部署需要创建一个 cloudbaserc.json,填写如下配置文件,调用 `cloudbase framework deploy` 进行部署
44

55
```json
66
{
@@ -28,7 +28,7 @@ CloudBase Framework 部署需要创建一个 cloudbaserc.json,填写如下配
2828
"name": "nuxt-ssr-echo",
2929
"timeout": 5,
3030
"envVariables": {},
31-
"runtime": "Nodejs10.15",
31+
"runtime": "Nodejs10.15"
3232
}
3333
],
3434
"servicePaths": {
@@ -94,7 +94,7 @@ framework 使用的插件配置,你可以配置多个插件,插件可以帮
9494

9595
类型:Object
9696

97-
插件别名,使用`cloudbase framework:deploy <deploy_name>`可以完成插件这个工作流
97+
插件别名,使用`cloudbase framework deploy <deploy_name>`可以完成插件这个工作流
9898

9999
### `framework.plugins.<deploy_name>.use`
100100

@@ -151,8 +151,7 @@ framework 部署阶段前后的钩子配置,可以在这里自定义应用不
151151
"version": "2.0",
152152
"framework": {
153153
"name": "nuxt-ssr",
154-
"plugins": {
155-
}
154+
"plugins": {}
156155
},
157156
"hooks": {
158157
"preDeploy": {
@@ -217,7 +216,7 @@ framework 部署阶段前后的钩子配置,可以在这里自定义应用不
217216
要调用的云函数列表,支持数组,例如
218217

219218
```json
220-
[
219+
[
221220
{
222221
"functionName": "nuxt-ssr-echo",
223222
"params": {
@@ -232,5 +231,3 @@ framework 部署阶段前后的钩子配置,可以在这里自定义应用不
232231
}
233232
]
234233
```
235-
236-

doc/mode.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44

55
## 模板变量
66

7-
* 第一步:在项目根目录下创建 **cloudbaserc.json****.env** 文件
7+
- 第一步:在项目根目录下创建 **cloudbaserc.json****.env** 文件
8+
89
```
910
.
1011
├─cloudbaserc.json
1112
├─.env
1213
1314
```
14-
* 第二步:在 **.env** 文件内添加变量
15+
16+
- 第二步:在 **.env** 文件内添加变量
17+
1518
```dotenv
1619
ENV_ID=pro-123
1720
DB_NAME=pro_user
1821
```
19-
* 第三步:在 **cloudbaserc.json** 文件内通过 `env` 注入模板变量
22+
23+
- 第三步:在 **cloudbaserc.json** 文件内通过 `env` 注入模板变量
2024

2125
```json
2226
{
@@ -46,31 +50,34 @@ DB_NAME=pro_user
4650

4751
> 注意:`version` 一定要大于 2.0 版本
4852
49-
* 第四步:一键部署应用
53+
- 第四步:一键部署应用
54+
5055
```sh
51-
cloudbase framework:deploy
56+
cloudbase framework deploy
5257
```
5358

5459
## 模式切换
5560

56-
* 假设你已经完成了以上**模板变量**的配置
61+
- 假设你已经完成了以上**模板变量**的配置
62+
63+
- 第一步:在项目根目录额外添加 **.env.dev** 文件
5764

58-
* 第一步:在项目根目录额外添加 **.env.dev** 文件
5965
```
6066
.
6167
├─cloudbaserc.json
6268
├─.env
6369
├─.env.dev
6470
```
65-
* 第二步:在 **.env.dev** 文件添加变量
71+
72+
- 第二步:在 **.env.dev** 文件添加变量
73+
6674
```dotenv
6775
ENV_ID=dev-123
6876
DB_NAME=dev_user
6977
```
70-
* 第三步:部署应用时使用 `--mode` 指定模式
71-
```sh
72-
cloudbase framework:deploy --mode dev
73-
```
74-
7578

79+
- 第三步:部署应用时使用 `--mode` 指定模式
7680

81+
```sh
82+
cloudbase framework deploy --mode dev
83+
```

0 commit comments

Comments
 (0)