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

upload-miniprogram

v1.2.0

Published

chatlabs 集成 微信小程序CI/CD上传工具,支持自动上传代码和生成预览二维码

Downloads

48

Readme

upload-miniprogram

微信小程序CI/CD上传工具,支持自动上传代码和生成预览二维码。

功能特性

  • ✅ 自动上传小程序代码到微信开发者平台
  • ✅ 生成预览二维码
  • ✅ 支持多环境配置 (开发/测试/预发布/生产)
  • ✅ 集成Jenkins CI/CD环境
  • ✅ 在本地环境自动获取Git用户信息

安装

npm install -g upload-miniprogram

或者作为开发依赖安装:

npm install --save-dev upload-miniprogram

使用方法

命令行方式

# 基本用法
upload-miniprogram --appid your-appid --project-path ./dist --app-version V0.0.1 --env development --desc "功能更新"

# 完整参数
upload-miniprogram \
  --appid your-appid \
  --project-path ./dist \
  --env development \
  --app-version V0.0.1 \
  --desc "功能更新" 

参数说明

| 参数 | 缩写 | 必填 | 说明 | 参数修改说明| |------|------|------|------|------| | --appid | -a | 是 | 小程序ID |每个项目固定1-2个,可能跟环境不同,确定后不需再修改| | --project-path | -p | 是 | 小程序项目打包后的代码路径 |一般是 ./dist 或 ./dist/weapp 每个项目固定1个路径,确定后不需再修改| | --env | -e | 是 | 环境变量 (development|staging|uat|production) | 按每个Jerkins链接的环境设置| | --app-version | -V | 是 | 上传至小程序的版本号 |每次构建时需要重新填写| | --desc | -d | 否 | 版本描述 |每次构建时需要重新填写| | --robot | -r | 否 | 机器人编号 |每个环境有默认值,支持部分范围输入|

编程方式

const uploadMiniprogram = require('upload-miniprogram');

// 使用默认配置
uploadMiniprogram({
  appid: 'your-appid',
  projectPath: './dist',
  version: '1.0.0',
  desc: '功能更新',
  env: 'production'
});

// 或者使用类方式
const { UploadMiniprogram } = require('upload-miniprogram');
const uploader = new UploadMiniprogram(options);
await uploader.run();

环境配置

私钥配置

工具需要微信小程序的私钥文件才能上传代码。私钥文件应该放在以下位置:

本地开发环境:

./scripts/private.{appid}.key

Jenkins环境:

${WORKSPACE}/../mp-ci-upload-key/private.{appid}.key

环境变量

支持以下环境:

| 环境 | 版本后缀 | 机器人 | 描述 | |------|----------|--------|------| | development | .dev | 默认 1,支持传入 6-10| 开发环境 | | staging | .staging | 默认 2,支持传入 11-15 | 测试环境 | | uat | .uat | 默认 3,支持传入 15-20 | 预发布环境 | | 自定义(如xxx) | .xxx | 默认 4,支持传入 21-25 | 自定义环境 | | production | (无) | 默认 5,支持传入 26-30 | 生产环境 |

Jenkins集成

在Jenkins中配置环境变量:

  1. 增加 version 和 desc 参数,每次构建时使用
  2. 运行命令 yarn upload:mp:dev -- --app-version=${version} --desc="${desc}"

许可证

MIT