Socket
Socket
Sign inDemoInstall

miniapp-ci

Package Overview
Dependencies
641
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    miniapp-ci

微信、百度、支付宝小程序上传、预览ci


Version published
Maintainers
1
Created

Readme

Source

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;
}

Keywords

FAQs

Last updated on 07 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc