0.0.22-beta.17 • Published 9 months ago

miniapp-ci v0.0.22-beta.17

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

miniapp-ci

小程序上传、预览的插件, 手动构建完毕后,上传作为体验版、生成预览二维码. 目前暂时仅支持微信、支付宝、百度小程序

使用

安装

npm i miniapp-ci -D

使用插件

/config/index.js

// 示例, 如果你使用 `vs code` 作为开发工具, 你还可以使用注释的语法引入插件包含的声明文件,可获得类似于typescript的友好提示
/**
 * @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
 * @type {CIOptions}
 */
const CIPluginOpt = {
    weapp: {
        appid: "微信小程序appid",
        projectPath: "/**/path",
        privateKeyPath: "密钥文件相对项目根目录的相对路径,例如 key/private.appid.key"
    },
    alipay: {
      appId: "支付宝小程序appId",
      projectPath: "/**/path",
      toolId: "工具id",
      privateKeyPath: "密钥文件相对项目根目录的相对路径,例如 key/pkcs8-private-pem"
    },
    swan: {
      token: "鉴权需要的token令牌",
      projectPath: "/**/path",
    },
    // 版本号
    version: "1.0.0",
    // 版本发布描述
    desc: "版本描述"
}

API

插件配置

参数类型说明
weappObject微信小程序CI配置
ttObject头条小程序配置
alipayObject支付宝小程序配置
swanObject百度小程序配置
versionstring上传版本号,不传时默认读取package.json下的taroConfig下的version字段
descstring上传时的描述信息,不传时默认读取package.json下的taroConfig下的desc字段

微信小程序CI配置

参数类型说明
appidstring小程序/小游戏项目的 appid
privateKeyPathstring私钥文件在项目中的相对路径,在获取项目属性和上传时用于鉴权使用
projectPathstring上传的小程序的路径
ignoresstring[]上传需要排除的目录(选填)

官方CI文档点这里

支付宝小程序CI配置

参数类型说明
appIdstring小程序appId
toolIdstring工具id,生成方式查看这里
privateKeyPathstring密钥文件相对项目根目录的相对路径, 支付宝生产的私钥文件名一般是 pkcs8-private-pem
projectPathstring上传的小程序的路径
clientTypestring上传的终端,终端类型见下表(默认值alipay)
终端类型值及其含义:

alipay: 支付宝

ampe:AMPE

amap:高德

genie:天猫精灵

alios:ALIOS

uc:UC

quark:夸克

taobao:淘宝

koubei:口碑

alipayiot:IoT

cainiao:菜鸟

alihealth:阿里健康

官方CI文档点这里

百度小程序CI配置

参数类型说明
tokenstring有该小程序发布权限的登录密钥
minSwanVersionstring最低基础库版本, 不传默认为 3.350.6

官方CI文档点这里

ts 接口描述

export interface IOptions {
  version?: string;
  desc?: string;
  weapp?: WeappConfig;
  alipay?: AlipayConfig;
  swan?: SwanConfig;
}

/** 微信小程序配置 */
export interface WeappConfig {
  /** 小程序/小游戏项目的 appid */
  appid: string;
  /** 私钥,在获取项目属性和上传时用于鉴权使用(必填) */
  privateKeyPath: string;
  /** 微信开发者工具安装路径 */
  devToolsInstallPath?: string;
  /** 上传的小程序的路径(默认 outputPath ) */
  projectPath: string;
  /** 类型,默认miniProgram 小程序 */
  type?: ProjectType;
  /** 上传需要排除的目录 */
  ignores?: Array<string>;
}


/** 终端类型 */
export type ClientType =
/** 支付宝 */'alipay' |
/** AMPE */'ampe' |
/** 高德 */'amap' |
/** 天猫精灵 */'genie'|
/** ALIOS */ 'alios'|
/** UC */'uc'|
/** 夸克 */ 'quark'|
/** 淘宝 */ 'taobao'|
/** 口碑 */'koubei' |
/** loT */'alipayiot'|
/** 菜鸟 */'cainiao' |
/** 阿里健康 */ 'alihealth'

/** 支付宝系列小程序配置 */
export interface AlipayConfig {
  /** 小程序appId */
  appId: string;
  /** 工具id */
  toolId: string;
  /** 工具私钥 */
  privateKey: string;
  /** 上传的小程序的路径*/
  projectPath: string;
  /** 服务代理地址(可选) */
  proxy?: string;
  /** 上传的终端, 默认alipay */
  clientType?: ClientType;
}

/** 百度小程序配置 */
export interface SwanConfig {
  /** 有该小程序发布权限的登录密钥 */
  token: string;
  /** 最低基础库版本, 不传默认为 3.350.6 */
  minSwanVersion?: string;
  /** 上传的小程序的路径*/
  projectPath: string;
}
0.0.22

10 months ago

0.0.22-beta.11

9 months ago

0.0.22-beta.10

10 months ago

0.0.22-beta.13

9 months ago

0.0.22-beta.12

9 months ago

0.0.22-beta.15

9 months ago

0.0.22-beta.14

9 months ago

0.0.22-beta.9

10 months ago

0.0.22-beta.17

9 months ago

0.0.22-beta.16

9 months ago

0.0.22-beta.6

10 months ago

0.0.22-beta.5

10 months ago

0.0.22-beta.8

10 months ago

0.0.22-beta.7

10 months ago

0.0.22-beta.2

10 months ago

0.0.22-beta.1

10 months ago

0.0.22-beta.4

10 months ago

0.0.22-beta.3

10 months ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.9

1 year ago

0.0.16

1 year ago

0.0.8

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.1

2 years ago