@tarojs/plugin-mini-ci 4.1.4-beta.2 → 4.1.4-beta.21

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @tarojs/plugin-mini-ci
2
2
 
3
- > Taro 小程序端构建后支持 CI(持续集成)的插件, 支持构建完毕后自动打开小程序开发这个工具、上传作为体验版、生成预览二维码. 目前支持(企业)微信、 京东、字节、支付宝、钉钉、百度小程序
3
+ > Taro 小程序端构建后支持 CI(持续集成)的插件,支持构建完毕后自动打开小程序开发这个工具、上传作为体验版、生成预览二维码。目前支持(企业)微信、京东、字节、支付宝、钉钉、百度小程序
4
4
 
5
5
  ## 使用
6
6
 
@@ -15,14 +15,14 @@ npm i @tarojs/plugin-mini-ci -D
15
15
  `/config/index.js`
16
16
 
17
17
  ```js
18
- // 示例, 如果你使用 `vs code` 作为开发工具, 你还可以使用注释的语法引入插件包含的声明文件,可获得类似于typescript的友好提示
18
+ // 示例,如果你使用 `vs code` 作为开发工具,你还可以使用注释的语法引入插件包含的声明文件,可获得类似于 typescript 的友好提示
19
19
  /**
20
20
  * @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
21
21
  * @type {CIOptions}
22
22
  */
23
23
  const CIPluginOpt = {
24
24
  weapp: {
25
- appid: '微信小程序appid',
25
+ appid: '微信小程序 appid',
26
26
  privateKeyPath: '密钥文件相对项目根目录的相对路径,例如 key/private.appid.key',
27
27
  },
28
28
  tt: {
@@ -30,16 +30,16 @@ const CIPluginOpt = {
30
30
  password: '字节小程序密码',
31
31
  },
32
32
  alipay: {
33
- appid: '支付宝小程序appid',
34
- toolId: '工具id',
33
+ appid: '支付宝小程序 appid',
34
+ toolId: '工具 id',
35
35
  privateKeyPath: '密钥文件相对项目根目录的相对路径,例如 key/pkcs8-private-pem',
36
36
  },
37
37
  dd: {
38
- appid: '钉钉小程序appid,即钉钉开放平台后台应用管理的 MiniAppId 选项',
38
+ appid: '钉钉小程序 appid,即钉钉开放平台后台应用管理的 MiniAppId 选项',
39
39
  token: '令牌,从钉钉后台获取',
40
40
  },
41
41
  swan: {
42
- token: '鉴权需要的token令牌',
42
+ token: '鉴权需要的 token 令牌',
43
43
  },
44
44
  jd: {
45
45
  privateKey: '京东小程序秘钥'
@@ -54,18 +54,18 @@ const config = {
54
54
  }
55
55
  ```
56
56
 
57
- 除了给插件传入对象, 你也可以传入一个异步函数,在编译时动态返回相关配置。
57
+ 除了给插件传入对象,你也可以传入一个异步函数,在编译时动态返回相关配置。
58
58
 
59
59
  ```js
60
60
  const CIPluginFn = async () => {
61
- // 可以在这里做一些异步事情, 比如请求接口获取配置
61
+ // 可以在这里做一些异步事情,比如请求接口获取配置
62
62
  /**
63
63
  * @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
64
64
  * @type {CIOptions}
65
65
  */
66
66
  return {
67
67
  weapp: {
68
- appid: "微信小程序appid",
68
+ appid: "微信小程序 appid",
69
69
  privateKeyPath: "密钥文件相对项目根目录的相对路径,例如 key/private.appid.key"
70
70
  },
71
71
  tt: {
@@ -73,16 +73,16 @@ const CIPluginFn = async () => {
73
73
  password: "字节小程序密码"
74
74
  },
75
75
  alipay: {
76
- appid: "支付宝小程序appid",
77
- toolId: "工具id",
76
+ appid: "支付宝小程序 appid",
77
+ toolId: "工具 id",
78
78
  privateKeyPath: "密钥文件相对项目根目录的相对路径,例如 key/pkcs8-private-pem"
79
79
  },
80
80
  dd: {
81
- appid: "钉钉小程序appid,即钉钉开放平台后台应用管理的 MiniAppId 选项"
81
+ appid: "钉钉小程序 appid,即钉钉开放平台后台应用管理的 MiniAppId 选项"
82
82
  token: "令牌,从钉钉后台获取"
83
83
  },
84
84
  swan: {
85
- token: "鉴权需要的token令牌"
85
+ token: "鉴权需要的 token 令牌"
86
86
  },
87
87
  jd: {
88
88
  privateKey: '京东小程序秘钥'
@@ -108,13 +108,13 @@ const config = {
108
108
  ```json
109
109
  {
110
110
  "scripts": {
111
- // 构建完后自动 “打开开发者工具”
111
+ // 构建完后自动“打开开发者工具”
112
112
  "build:weapp": "taro build --type weapp --open",
113
- // 构建完后自动 “上传代码作为开发版并生成预览二维码”
113
+ // 构建完后自动“上传代码作为开发版并生成预览二维码”
114
114
  "build:weapp:preview": "taro build --type weapp --preview",
115
115
  // 构建完后自动“上传代码作为体验版”
116
116
  "build:weapp:upload": "taro build --type weapp --upload",
117
- // 构建完后自动“上传 dist/xxx 目录的代码作为体验版”, `--projectPath` 参数 适用于 taro 和 原生混合的场景
117
+ // 构建完后自动“上传 dist/xxx 目录的代码作为体验版”,`--projectPath` 参数 适用于 taro 和 原生混合的场景
118
118
  "build:weapp:upload": "taro build --type weapp --upload --projectPath dist/xxx"
119
119
  },
120
120
  "taroConfig": {
@@ -136,20 +136,20 @@ const config = {
136
136
  此 3 个选项在一条命令里不能同时使用(互斥)
137
137
 
138
138
  - --projectPath
139
- 指定要操作(打开、预览、上传)的目录路径, 默认情况下是操作构建后目录路径,即 [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot);
139
+ 指定要操作(打开、预览、上传)的目录路径,默认情况下是操作构建后目录路径,即 [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot);
140
140
 
141
141
  此选项必须搭配上述三个选项之一一起使用;
142
142
 
143
- 此选项优先级为: 终端传入的`--projectPath` > CI 配置的`projectPath` 选项 > [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot)。
143
+ 此选项优先级为:终端传入的`--projectPath` > CI 配置的`projectPath` 选项 > [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot)。
144
144
 
145
145
  ### 作为命令单独使用
146
146
 
147
147
  ```json
148
148
  {
149
149
  "scripts": {
150
- // 直接 “打开开发者工具并载入项目”
150
+ // 直接“打开开发者工具并载入项目”
151
151
  "build:weapp": "taro open --type weapp --projectPath dist/xxx",
152
- // 直接 “上传代码作为开发版并生成预览二维码”
152
+ // 直接“上传代码作为开发版并生成预览二维码”
153
153
  "build:weapp:preview": "taro preview --type weapp",
154
154
  // 直接“上传代码作为体验版”
155
155
  "build:weapp:upload": "taro upload --type weapp",
@@ -170,11 +170,11 @@ const config = {
170
170
  - --type
171
171
  传入平台名称
172
172
  - --projectPath
173
- 传入路径。 此选项优先级为: 终端传入的`--projectPath` > CI 配置的`projectPath` 选项 > [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot)
173
+ 传入路径。此选项优先级为:终端传入的`--projectPath` > CI 配置的`projectPath` 选项 > [outputRoot 选项](https://taro-docs.jd.com/taro/docs/next/config-detail#outputroot)
174
174
 
175
175
  ### Hooks 使用
176
176
 
177
- 在插件执行完 `预览`、`上传` 操作后, 插件会触发 2 个钩子事件:
177
+ 在插件执行完 `预览`、`上传` 操作后,插件会触发 2 个钩子事件:
178
178
 
179
179
  | 事件名 | 传递参数对象 | 说明 |
180
180
  | :---------------- | :----------- | :---------------- |
@@ -278,7 +278,7 @@ module.exports = function (merge) {
278
278
  | swan | Object | 百度小程序配置 |
279
279
  | version | string | 上传版本号,不传时默认读取 package.json 下的 taroConfig 下的 version 字段 |
280
280
  | desc | string | 上传时的描述信息,不传时默认读取 package.json 下的 taroConfig 下的 desc 字段 |
281
- | projectPath | string | 目标项目目录,对所有小程序生效(不传默认取 outputRoot 字段 )(3.6.0 版本开始支持) |
281
+ | projectPath | string | 目标项目目录,对所有小程序生效(不传默认取 outputRoot 字段)(3.6.0 版本开始支持) |
282
282
 
283
283
  ### (企业)微信小程序 CI 配置
284
284
 
@@ -286,11 +286,11 @@ module.exports = function (merge) {
286
286
  | :------------------ | :------- | :--------------------------------------------------------------------------------------- |
287
287
  | appid | string | 小程序/小游戏项目的 appid |
288
288
  | privateKeyPath | string | 私钥文件在项目中的相对路径,在获取项目属性和上传时用于鉴权使用 |
289
- | devToolsInstallPath | string | 微信开发者工具安装路径,如果你安装微信开发者工具时选的默认路径,则不需要传入此参数(选填) |
290
- | projectPath | string | 上传的小程序的路径(默认取的 outputRoot )(3.6.0 版本已废弃) |
291
- | ignores | string[] | 上传需要排除的目录(选填) |
292
- | robot | number | 指定使用哪一个 ci 机器人,可选值:1 ~ 30(选填, 3.6.0 版本开始支持) |
293
- | setting | Object | 预览和上传时的编译设置,具体见下表(选填, 3.6.2 版本开始支持) |
289
+ | devToolsInstallPath | string | 微信开发者工具安装路径,如果你安装微信开发者工具时选的默认路径,则不需要传入此参数 (选填) |
290
+ | projectPath | string | 上传的小程序的路径(默认取的 outputRoot)(3.6.0 版本已废弃) |
291
+ | ignores | string[] | 上传需要排除的目录 (选填) |
292
+ | robot | number | 指定使用哪一个 ci 机器人,可选值:1 ~ 30(选填,3.6.0 版本开始支持) |
293
+ | setting | Object | 预览和上传时的编译设置,具体见下表 (选填,3.6.2 版本开始支持) |
294
294
 
295
295
  #### 编译设置选项说明
296
296
 
@@ -323,10 +323,10 @@ module.exports = function (merge) {
323
323
  | :------------------ | :----- | :------------------------------------------------------------------------------------------------------------------ |
324
324
  | appid | string | 小程序 appid(`3.6.0` 之前参数名是 `appId` , `3.6.0` 开始统一成`appid`) |
325
325
  | toolId | string | 工具 id,[查看这里复制](https://open.alipay.com/dev/workspace/key-manage/tool) |
326
- | privateKeyPath | string | 密钥文件相对项目根目录的相对路径, 私钥可通过[支付宝开放平台开发助手](https://opendocs.alipay.com/common/02kipl)生成 |
327
- | privateKey | string | 私钥文本内容, 生成方式同上(privateKeyPath 和 privateKey 之间必须要填写其中一个; 3.6.0 版本开始支持) |
328
- | devToolsInstallPath | string | 小程序开发者工具安装路径(选填, 3.6.0 版本开始支持) |
329
- | clientType | string | 上传的终端,终端类型见下表(选填,默认值 alipay) |
326
+ | privateKeyPath | string | 密钥文件相对项目根目录的相对路径,私钥可通过[支付宝开放平台开发助手](https://opendocs.alipay.com/common/02kipl)生成 |
327
+ | privateKey | string | 私钥文本内容,生成方式同上 (privateKeyPath 和 privateKey 之间必须要填写其中一个;3.6.0 版本开始支持) |
328
+ | devToolsInstallPath | string | 小程序开发者工具安装路径 (选填,3.6.0 版本开始支持) |
329
+ | clientType | string | 上传的终端,终端类型见下表(选填,默认值 alipay) |
330
330
  | deleteVersion | string | 在上传过程中删除指定的版本,即使该版本正在构建中或不存在。记录已上传的版本并使用这个参数能有效避免上传版本无法超过 20 个的问题(选填,默认自动删除上一个版本。可设置`0.0.0`,关闭自动删除) |
331
331
 
332
332
  ```
@@ -363,8 +363,8 @@ health: 阿里医院
363
363
 
364
364
  | 参数 | 类型 | 说明 |
365
365
  | :------------------ | :----- | :------------------------------------------------------------------- |
366
- | appid | string | 钉钉小程序 appid,即钉钉开放平台后台应用管理的 MiniAppId 选项(必填) |
367
- | token | string | 令牌,从钉钉后台获取 (必填) |
366
+ | appid | string | 钉钉小程序 appid,即钉钉开放平台后台应用管理的 MiniAppId 选项(必填) |
367
+ | token | string | 令牌,从钉钉后台获取(必填) |
368
368
  | devToolsInstallPath | string | 小程序开发者工具安装路径(选填) |
369
369
 
370
370
  `taro` 集成的钉钉 CI 使用了[钉钉官方仓库](https://github.com/open-dingtalk/dingtalk-design-cli)中的 `dingtalk-miniapp-opensdk` 包,查阅源码封装而成
@@ -374,7 +374,7 @@ health: 阿里医院
374
374
  | 参数 | 类型 | 说明 |
375
375
  | :------------- | :----- | :--------------------------------- |
376
376
  | token | string | 有该小程序发布权限的登录密钥 |
377
- | minSwanVersion | string | 最低基础库版本, 不传默认为 3.350.6 |
377
+ | minSwanVersion | string | 最低基础库版本,不传默认为 3.350.6 |
378
378
 
379
379
  官方 CI 文档[点这里](https://smartprogram.baidu.com/docs/develop/devtools/smartapp_cli_function/)
380
380
 
@@ -394,21 +394,21 @@ health: 阿里医院
394
394
  export interface CIOptions {
395
395
  /** 发布版本号,默认取 package.json 文件的 taroConfig.version 字段 */
396
396
  version?: string
397
- /** 版本发布描述, 默认取 package.json 文件的 taroConfig.desc 字段 */
397
+ /** 版本发布描述,默认取 package.json 文件的 taroConfig.desc 字段 */
398
398
  desc?: string
399
- /** 目标项目目录,对所有小程序生效(不传默认取 outputRoot 字段 */
399
+ /** 目标项目目录,对所有小程序生效(不传默认取 outputRoot 字段) */
400
400
  projectPath?: string
401
- /** 微信小程序CI配置, 官方文档地址:https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html */
401
+ /** 微信小程序 CI 配置,官方文档地址:https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html */
402
402
  weapp?: WeappConfig
403
- /** 头条小程序配置, 官方文档地址:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/developer-instrument/development-assistance/ide-order-instrument */
403
+ /** 头条小程序配置,官方文档地址:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/developer-instrument/development-assistance/ide-order-instrument */
404
404
  tt?: TTConfig
405
- /** 支付宝系列小程序配置,官方文档地址: https://opendocs.alipay.com/mini/miniu/api */
405
+ /** 支付宝系列小程序配置,官方文档地址:https://opendocs.alipay.com/mini/miniu/api */
406
406
  alipay?: AlipayConfig
407
407
  /** 钉钉小程序配置 */
408
408
  dd?: DingtalkConfig
409
- /** 百度小程序配置, 官方文档地址:https://smartprogram.baidu.com/docs/develop/devtools/commandtool/ */
409
+ /** 百度小程序配置,官方文档地址:https://smartprogram.baidu.com/docs/develop/devtools/commandtool/ */
410
410
  swan?: SwanConfig
411
- /** 京东小程序配置, 官方文档地址:https://mp-docs.jd.com/doc/dev/devtools/1597 */
411
+ /** 京东小程序配置,官方文档地址:https://mp-docs.jd.com/doc/dev/devtools/1597 */
412
412
  jd?: JdConfig
413
413
  }
414
414
 
@@ -422,7 +422,7 @@ export interface WeappConfig {
422
422
  privateKeyPath: string
423
423
  /** 微信开发者工具安装路径 */
424
424
  devToolsInstallPath?: string
425
- /** 类型,默认miniProgram 小程序 */
425
+ /** 类型,默认 miniProgram 小程序 */
426
426
  type?: ProjectType
427
427
  /** 上传需要排除的目录 */
428
428
  ignores?: Array<string>
@@ -434,7 +434,7 @@ export interface WeappConfig {
434
434
  es6: boolean
435
435
  /** 对应于微信开发者工具的 "增强编译" */
436
436
  es7: boolean
437
- /** "增强编译" 开启时,是否禁用JS文件严格模式,默认为false */
437
+ /** "增强编译" 开启时,是否禁用 JS 文件严格模式,默认为 false */
438
438
  disableUseStrict: boolean
439
439
  /** 上传时压缩 JS 代码 */
440
440
  minifyJS: boolean
@@ -480,24 +480,24 @@ export type AlipayClientType = /** 支付宝 */
480
480
  | 'alipayiot'
481
481
  /** 菜鸟 */
482
482
  | 'cainiao'
483
- /** 阿里健康(医蝶谷) */
483
+ /** 阿里健康 (医蝶谷) */
484
484
  | 'alihealth'
485
485
  /** 阿里医院 */
486
486
  | 'health'
487
487
 
488
488
  /** 支付宝系列小程序配置 */
489
489
  export interface AlipayConfig {
490
- /** 小程序appid */
490
+ /** 小程序 appid */
491
491
  appid: string
492
- /** 工具id */
492
+ /** 工具 id */
493
493
  toolId: string
494
- /** 私钥文件路径,在获取项目属性和上传时用于鉴权使用(privateKeyPath和privateKey之间必须要填写其中一个) */
494
+ /** 私钥文件路径,在获取项目属性和上传时用于鉴权使用 (privateKeyPath privateKey 之间必须要填写其中一个) */
495
495
  privateKeyPath: string
496
- /** 私钥文本内容,在获取项目属性和上传时用于鉴权使用(privateKeyPath和privateKey之间必须要填写其中一个) */
496
+ /** 私钥文本内容,在获取项目属性和上传时用于鉴权使用 (privateKeyPath privateKey 之间必须要填写其中一个) */
497
497
  privateKey: string
498
498
  /** 小程序开发者工具安装路径 */
499
499
  devToolsInstallPath?: string
500
- /** 上传的终端, 默认alipay */
500
+ /** 上传的终端,默认 alipay */
501
501
  clientType?: AlipayClientType
502
502
  }
503
503
 
@@ -513,13 +513,13 @@ export type DingtalkProjectType =
513
513
  /** 工作台组件 */
514
514
  | 'dingtalk-biz-worktab-plugin'
515
515
  export interface DingtalkConfig {
516
- /** 钉钉小程序appid,即钉钉开放平台后台应用管理的 MiniAppId 选项(必填) */
516
+ /** 钉钉小程序 appid,即钉钉开放平台后台应用管理的 MiniAppId 选项(必填) */
517
517
  appid: string
518
518
  /** 令牌,从钉钉后台获取 */
519
519
  token: string
520
520
  /** 小程序开发者工具安装路径 */
521
521
  devToolsInstallPath?: string
522
- /** 钉钉应用类型, 默认为:'dingtalk-biz' (企业内部应用) */
522
+ /** 钉钉应用类型,默认为:'dingtalk-biz' (企业内部应用) */
523
523
  projectType?: DingtalkProjectType
524
524
  }
525
525
 
@@ -527,7 +527,7 @@ export interface DingtalkConfig {
527
527
  export interface SwanConfig {
528
528
  /** 有该小程序发布权限的登录密钥 */
529
529
  token: string
530
- /** 最低基础库版本, 不传默认为 3.350.6 */
530
+ /** 最低基础库版本,不传默认为 3.350.6 */
531
531
  minSwanVersion?: string
532
532
  }
533
533
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-mini-ci",
3
- "version": "4.1.4-beta.2",
3
+ "version": "4.1.4-beta.21",
4
4
  "description": "Taro 小程序端构建后支持CI(持续集成)的插件",
5
5
  "keywords": [
6
6
  "Taro",
@@ -9,12 +9,10 @@
9
9
  "author": "O2Team",
10
10
  "homepage": "https://github.com/NervJS/taro#readme",
11
11
  "license": "MIT",
12
- "main": "index.js",
13
- "typings": "types/index.d.ts",
12
+ "main": "dist/index.js",
13
+ "types": "dist/index.d.ts",
14
14
  "files": [
15
- "dist",
16
- "index.js",
17
- "types"
15
+ "dist"
18
16
  ],
19
17
  "repository": {
20
18
  "type": "git",
@@ -38,7 +36,7 @@
38
36
  "devDependencies": {
39
37
  "@types/qrcode": "^1.5.5",
40
38
  "@types/shelljs": "^0.8.15",
41
- "@tarojs/service": "4.1.4-beta.2"
39
+ "@tarojs/service": "4.1.4-beta.21"
42
40
  },
43
41
  "peerDependencies": {
44
42
  "dingtalk-miniapp-opensdk": "^1.0.8",
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = require('./dist/index.js').default
2
-
3
- module.exports.default = module.exports
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes