npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

uni-miniapp-ci

v0.1.0

Published

多平台小程序 CI/CD 上传工具,支持微信、支付宝、抖音、百度智能小程序

Downloads

19

Readme

uni-miniapp-ci

多平台小程序 CI/CD 上传工具,支持微信、支付宝、抖音、百度智能小程序。

npm version license node

轻量级 CLI 工具与 Node.js 库,用于将小程序上传到各平台开发者后台,可无缝集成到任意 CI/CD 流程中。

支持平台

| 平台 | 上传 | 预览 | SDK | |---|---|---|---| | 微信小程序 | ✅ | ✅ | miniprogram-ci | | 支付宝小程序 | ✅ | ✅ | minidev | | 抖音小程序 | ✅ | ✅ | tt-ide-cli | | 百度智能小程序 | ✅ | ✅ | swan-toolkit |

安装

安装 uni-miniapp-ci 时,各平台 CI SDK(miniprogram-ciminidevtt-ide-cliswan-toolkit)会自动一并安装,无需额外操作。

各平台 SDK 会随小版本/补丁版本自动更新,如需获取最新版本,执行:

npm update uni-miniapp-ci

方式一:全局安装(推荐用于手动执行)

npm install -g uni-miniapp-ci

安装后可在任意目录直接使用 miniapp-ci 命令:

miniapp-ci upload --platform weixin
miniapp-ci preview --platform weixin

方式二:项目内安装(推荐用于 CI/CD 集成)

npm install -D uni-miniapp-ci

package.json 中配置 scripts,通过 npm run 调用:

{
  "scripts": {
    "upload:weixin":  "miniapp-ci upload --platform weixin",
    "upload:alipay":  "miniapp-ci upload --platform alipay",
    "upload:douyin":  "miniapp-ci upload --platform douyin",
    "upload:baidu":   "miniapp-ci upload --platform baidu",
    "preview:weixin": "miniapp-ci preview --platform weixin --output ./preview.jpg",
    "preview:alipay": "miniapp-ci preview --platform alipay --output ./preview.jpg",
    "preview:douyin": "miniapp-ci preview --platform douyin --output ./preview.jpg",
    "preview:baidu":  "miniapp-ci preview --platform baidu  --output ./preview.jpg"
  }
}

然后执行:

npm run upload:weixin
npm run preview:weixin

项目内安装不依赖全局环境,适合团队统一版本、在 CI 服务器上使用。

快速开始

1. 在项目根目录创建 .minicirc(包含密钥,切勿提交到 git):

{
  "version": "1.0.0",
  "desc": "发布说明",

  "weixin": {
    "appid": "wx__YOUR_APPID__",
    "privateKeyPath": "./private.wx.key",
    "projectPath": "./dist"
  }
}

完整配置示例见 .minicirc.example

2. 上传:

# 全局安装方式
miniapp-ci upload --platform weixin

# 项目内安装方式(package.json 已配置 scripts)
npm run upload:weixin

3. 生成预览二维码:

# 全局安装方式
miniapp-ci preview --platform weixin --output ./qr.jpg

# 项目内安装方式
npm run preview:weixin

CLI 参数说明

miniapp-ci upload -p <platform> [选项]
miniapp-ci preview -p <platform> [选项]

选项:
  -p, --platform <platform>   平台名称:weixin | alipay | douyin | baidu(必填)
  -v, --version  <version>    覆盖 .minicirc 中的版本号
  -d, --desc     <desc>       上传备注 / 发布说明
  -o, --output   <path>       预览二维码保存路径(仅 preview,默认:./preview.jpg)
      --cwd      <path>       工作目录(默认:当前目录)
  -h, --help                  显示帮助
      --version               显示版本号

Node.js API(编程式调用)

import { weixin, alipay, douyin, baidu, readConfig } from 'uni-miniapp-ci'

const config = readConfig()   // 读取当前目录下的 .minicirc

// 上传
await weixin.upload(config.weixin!, { version: '1.2.0', desc: '功能更新' })
await alipay.upload(config.alipay!, { version: '1.2.0', desc: '功能更新' })
await douyin.upload(config.douyin!, { version: '1.2.0', desc: '功能更新' })
await baidu.upload(config.baidu!,   { version: '1.2.0', desc: '功能更新' })

// 预览
await weixin.preview(config.weixin!, { version: '1.2.0', desc: '预览', outputPath: './qr.jpg' })
await alipay.preview(config.alipay!, { version: '1.2.0', desc: '预览', outputPath: './qr.jpg' })
await douyin.preview(config.douyin!, { version: '1.2.0', desc: '预览', outputPath: './qr.jpg' })
await baidu.preview(config.baidu!,   { version: '1.2.0', desc: '预览', outputPath: './qr.jpg' })

.minicirc 配置说明

{
  "version": "1.0.0",       // 必填,默认上传版本号
  "desc": "发布说明",        // 可选,默认上传备注

  // 微信小程序 — SDK: miniprogram-ci
  // privateKeyPath: 从微信公众平台下载的 .key 文件
  "weixin": {
    "appid": "wx...",
    "privateKeyPath": "./private.wx.key",
    "projectPath": "./dist/weixin",
    "robot": 1,             // 可选,CI 机器人编号 1-30
    "setting": {            // 可选,编译设置
      "minify": true,
      "uploadWithSourceMap": false
    },
    "pagePath": "pages/index/index",  // 可选,预览入口页
    "searchQuery": "a=1&b=2"          // 可选,预览页参数
  },

  // 支付宝小程序 — SDK: minidev
  // 鉴权方式二选一:identityKeyPath(密钥文件) 或 toolId + privateKey(适合 CI)
  "alipay": {
    "appId": "...",
    "identityKeyPath": "./alipay-identity.json",
    "projectPath": "./dist/alipay",
    "clientType": "alipay", // 可选,默认 alipay
    "experience": false     // 可选,上传后自动设为体验版
  },

  // 抖音小程序 — SDK: tt-ide-cli
  // token: 在抖音开放平台 → 开发管理 → CI Token 处获取
  "douyin": {
    "appid": "tt...",
    "token": "...",
    "projectPath": "./dist/douyin",
    "channel": "1",                   // 可选,测试通道
    "pagePath": "pages/index/index",  // 可选,预览入口页
    "pageQuery": "name=foo"           // 可选,预览页参数
  },

  // 百度智能小程序 — SDK: swan-toolkit(>= 3.22.1)
  // token: 在 https://smartprogram.baidu.com/mappconsole/api/secret 获取
  "baidu": {
    "token": "...",
    "projectPath": "./dist/baidu",
    "minSwanVersion": "3.150.14",  // 必填,最低基础库版本
    "sourcemap": false             // 可选,自动上传 sourcemap
  }
}

CI/CD 集成示例

GitHub Actions

name: 上传小程序

on:
  push:
    tags: ['v*']

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - run: npm ci

      - name: 写入 .minicirc
        run: echo '${{ secrets.MINIRC }}' > .minicirc

      - name: 上传微信小程序
        run: npm run upload:weixin

      - name: 上传支付宝小程序
        run: npm run upload:alipay

将完整的 .minicirc JSON(包含所有密钥)存入仓库 Secret,命名为 MINIRC

版本号自动从 package.json 读取示例

{
  "scripts": {
    "upload:weixin": "miniapp-ci upload --platform weixin --version $(node -p \"require('./package.json').version\")"
  }
}

贡献

欢迎提交 Pull Request。请先开 Issue 讨论你想做的改动。

许可证

MIT