m-app-ci

0.2.0 • Public • Published

m-app-ci

基于 Node.js 的 CLI 工具,用于上传小程序代码。最新的参考文档,请参考 金山文档

使用

npm i -g m-app-ci

使用 Git Bash 运行 m-app-ci 即可。

如果你在 Windows 上通过 minTTY 使用 Git Bash,交互提示符并不工作。你必须通过 winpty m-app-ci.cmd 启动这个命令。

配置

在项目根目录下创建 .mprc 文件,以下为配置示例:

{
"weixin": {
"project": {
"appid": "appid",
"privateKeyPath": "./private.appid.key",
"projectPath": "./"
},
"upload": {
"version": "1.0.0",
"desc": "description"
}
},
"alipay": {},
"baidu": {}
}

以下为具体的 project 配置参数:

| 键 | 类型 | 说明 | | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | appid | 属性 | 小程序/小游戏项目的 appid | | type | 属性 | 项目的类型,有效值 miniProgram/miniProgramPlugin/miniGame/miniGamePlugin | | projectPath | 属性 | 项目的路径,即 project.config.json 所在的目录 | | privateKey | 属性 | 私钥,在获取项目属性和上传时用于鉴权使用,在 微信公众平台 上使用小程序管理员登录后下载 | | attr | 异步方法 | 项目的属性,如指定了 privateKey 则会使用真实的项目属性 | | stat | 同步方法 | 特定目录下前缀下(prefix)文件路径 (filePath) 的 stat, 如果不存在则返回 undefined | | getFile | 异步方法 | 特定目录下前缀下(prefix)文件路径 (filePath) 的 Buffer | | getFileList | 同步方法 | 特定目录下前缀下(prefix)文件路径 (filePath) 下的文件列表 | | updateFile | 同步方法 | 更新项目文件 |

以下为具体的 upload 配置参数:

类型 必填 说明
project IProject #项目对象
version string 自定义版本号
desc string 自定义备注
setting object #编译设置
onProgressUpdate function 进度更新监听函数
robot number 指定使用哪一个 ci 机器人,可选值:1 ~ 30
threads number 指定本地编译过程中开启的线程数
useCOS boolean 使用异步方式上传,当代码包大于 5MB 时,默认开启
allowIgnoreUnusedFiles boolean 允许过滤无依赖文件,默认开启

Readme

Keywords

Package Sidebar

Install

npm i m-app-ci

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

6.11 kB

Total Files

5

Last publish

Collaborators

  • william-xu-web