Skip to content

Commit

Permalink
Update tutorial docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia committed Oct 21, 2022
1 parent 47ee37c commit ca04ad5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ Development phase: Complete the front-end and service-side development under the
Publishing stage: Package the file resources required by the front-end and service-side, depending on the configuration of cyfs.config.json.
Installation and running phases: DEC Service starts, runs and terminates on OOD, depending on the configuration of service_package.cfg.

### cyfs.config.json

1. config_version: the version number of the configuration file
2. app_name: The name entered in `cyfs create -n` is also the name of the app. The app names of the same owner cannot be the same. Support non-ASCII characters such as Chinese, the name will be displayed on the app store and app management interface
3. version: Indicates the `current version` of the App. When cyfs deploy is executed, the current version of the App will be packaged and deployed. After deployment, the third digit of the version will be automatically incremented by one as the new current version
4. description: The description of the App. Each time it is deployed, the description text filled in here will be updated to the App object and displayed on the App Store.
5. icon: App icon, only supports cyfs link. Update every time you deploy, display on the App Store and App Admin UI
6. service: Configure Dec App Service related packaging and running configuration, the details are as follows
- pack: Indicates which directories need to be packaged when packaging the Service
- type: Specifies the type of service, currently supports "node" and "rust"
When specified as "node", the package directory of the service, the cyfs directory, and the package.json file will be copied to the ${dist}/service/${target} directory
When it is specified as "rust", only the package directory of the service is copied to ${dist}/service, and the compilation of the service needs to be manually performed by the user in advance
- dist_targets: Specifies which platforms the service supports. The default is the same as the platforms supported by ood. If the Dec App is installed on a platform that is supported by OOD but not supported by service, an installation failure error will be returned
- app_config: configure the run configuration of the service. You can configure a different run configuration for each platform by adding the [target_name]:[config_path] field. The default default indicates the default configuration used when there is no corresponding configuration for the platform
7. web: Configure the relevant packaging and runtime configuration of the Dec App Web section, as detailed below
- folder: The root directory for configuring the Dec App Web section
- entry: The file name of the configurable web home page, the current configuration modification is invalid, the home page file name must be index.html
8. dist: The name of the packaging temporary directory, the default is "dist". If the default value conflicts with other local directories, it can be changed to other non-conflicting directory names
9. owner_config: owner configuration file
10. ext_info: Other configurations unrelated to App deployment, installation, and running, generally related to App display. Details are as follows
- medias: Configure the media information related to the app, which is currently used in the DecApp details page of the app store
11. app_id: The app id calculated from owner id and app_name, cannot be modified by yourself. Anywhere in your code you need to use the Dec App Id, you need to use the ID shown here.

### service_package.cfg

1. id: identification
2. version: version number
3. install: install script
4. start: start the script
5. stop: stop the script
6. status: run the status query script

## file structure

In the project root directory, there are 4 folders and 11 files:
Expand Down
32 changes: 32 additions & 0 deletions doc/zh-CN/实战留言板系统/3.实现自己的留言服务.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ _cyfs-dapp-cli 使用注意_
发布阶段:打包前端和 Service 端所需的文件资源,依赖 cyfs.config.json 的配置。
安装和运行阶段:DEC Service 在 OOD 上从启动、运行到终止的各阶段,依赖 service_package.cfg 的配置。

### cyfs.config.json

1. config_version: 配置文件的版本号
2. app_name: 在 `cyfs create -n` 中输入的名字,也是该 app 的名字。同一个 owner 的 app 名字不能相同。支持中文等非 ASCII 字符,这个名字会显示在应用商店和 App 管理界面上
3. version: 表示 App 的`当前版本`,当执行 cyfs deploy 时,会打包并部署 App 的当前版本,部署后,会将该版本的第三位自动加一,作为新的当前版本
4. description:App 描述,每次部署时,此处填写的描述文字会更新到 App 对象中,在应用商店上显示。
5. icon: App 图标,只支持 cyfs 链接。每次部署时更新,在应用商店和 App 管理界面上展示
6. service:配置 Dec App Service 相关打包和运行配置,详情下述
- pack: 指示打包 Service 时,需要打包哪些目录
- type: 指定 service 的类型,目前支持"node"和"rust"两种
当指定为"node"时,会将 service 的打包目录,cyfs 目录,package.json 文件一起拷贝到${dist}/service/${target}目录下
当指定为"rust"时,只将 service 的打包目录拷贝到${dist}/service 下,service 的编译等工作需用户事先手动执行
- dist_targets:指定 service 支持哪些平台,默认和 ood 支持的平台一致。如果在 OOD 支持,但 service 不支持的平台上安装该 Dec App,会返回安装失败错误
- app_config: 配置 service 的运行配置。可以通过添加[target_name]:[config_path]字段的形式,给每个平台配置不同的运行配置。默认的 default 表示当没有该平台对应配置时,使用的默认配置
7. web: 配置 Dec App Web 部分的相关打包和运行配置,详情下述
- folder: 配置 Dec App Web 部分的根目录
- entry: 可配置 Web 首页的文件名,当前该配置修改无效,首页文件名必须为 index.html
8. dist: 打包临时目录的名字,默认为"dist"。如果该默认值与其他本地目录冲突,可以修改为其他不冲突的目录名
9. owner_config: owner 配置文件
10. ext_info:与 App 部署,安装,运行无关的其他配置,一般与 App 的展示有关。详情下述
- medias: 配置 App 相关的媒体信息,目前应用商店的 DecApp 详情页会使用该信息
11. app_id:由 owner id 和 app_name 计算得来的 app id,不能自行修改。在代码中任何需要使用 Dec App Id 的地方,需要用这里展示的 ID。

### service_package.cfg

1. id: 标识
2. version: 版本号
3. install:安装脚本
4. start:启动脚本
5. stop:停止脚本
6. status:运行状态查询脚本

## 文件结构

在项目根目录下,有 4 个文件夹及 11 个文件:
Expand Down

0 comments on commit ca04ad5

Please sign in to comment.