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

@seer-bigdata/taro-plugin-command

v0.0.10

Published

Taro插件-用于扩展Taro项目的命令

Downloads

83

Readme

@seer-bigdata/taro-plugin-command

通过Taro 插件,在Taro项目注入命令,当前支持的命令有

  1. taro upload 上传小程序代码

  2. version 命令,用于生成版本号

  3. release 命令,用于生成正式版本号x.y.z,并上传小程序代码,是version (patch)命令和upload命令的组合

  4. pre-release 命令,用于生成体验版版本号x.y.z-<tag>.n,并上传小程序代码,是version (prerelease)命令和upload命令的组合

  5. gen-api 命令,用于根据Apifox项目生成API代码

基本使用

1. 接入插件

export default defineConfig({
  // ... 其他配置保持不变
  plugins: [
    '@seer-bigdata/taro-plugin-command',
    {
      // 插件配置参数,可配置默认值
      //   upload: {},
    },
  ],
});

2. 执行命令

taro upload 上传小程序代码

相关配置参考UploadOptionsType,命令行传入时,加上--前缀

  1. 上传当前小程序代码 npx taro upload

  2. 不需要build,直接上传当前小程序代码 npx taro upload --ignoreBuild

  3. 支持透传build参数 npx taro upload --type weapp --env production (不要传 --watch

  4. 支持环境变量透传给build 命令 TARP_APP_NAME=appA npx taro upload

  5. 绕过 git 工作区检查 npx taro upload --ignoreGitStatus

  6. 传入上传描述信息 npx taro upload --uploadMsg 修改xx模块 (默认基于commitLog 自动生成)

:::warning 如果 config.outputRoot 配置了 process.env.TARO_ENV ,请执行npx taro upload --type weapp 上传代码 ,或自行兜底config.outputRoot,否则upload 命令执行时,获取的config.outputRootprocess.env.TARO_ENV 为 undefined :::

配置上传秘钥

小程序通过CI 上传,需要先在小程序管理后台下载「小程序代码上传秘钥」 private.{appId}.key 和设置上传IP 白名单,操作详情请看:https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html

  1. 秘钥文件不建议上传到git ,当前是直接本地存储,通过gitignore 忽略,如需使用,需要找项目开发者获取秘钥信息
  2. IP白名单配置的是IP段 183.232.0.0/13 ,以确保不同开发者无需配置都可以上传

查看个人电脑的ip:https://ip138.com/

上传机器人说明

背景

  1. 当前体验版本的上传者发布的新版本默认为新的体验版本
    • 上传者A 发布了 1.0.1 版本,并设为体验版本
    • 上传者A 再发布 1.0.2 版本,1.0.2 版本默认成为体验版本
  2. miniprogram-ci 的上传函数支持robot 属性,用于表明当前的上传者是哪个机器人

处理

执行上传时,通过两个机器人上传同一个产物,机器人1 上传的作为体验版本,机器人X 上传的作为留存版本;(X 基于当前版本号计算得到)

  1. 生成版本1.0.1 ,机器人1 上传1.0.1 版本(作为体验版),机器人2上传1.0.1版本;管理页面的版本列表
  • 机器人1 1.0.1
  • 机器人2 1.0.1
  1. 生成版本1.0.2,机器人1上传1.0.2版本(覆盖原来的1.0.1版本,自动成为最新体验版),机器人3上传1.0.3版本
  • 机器人1 1.0.2
  • 机器人2 1.0.1
  • 机器人3 1.0.2 ... 以此类推
  1. 生成版本1.0.6,机器人1 上传1.0.6版本,机器人2上传1.0.6版本(脚本代码限制只保留就近5个版本)
  • 机器人1 1.0.6
  • 机器人2 1.0.6
  • 机器人3 1.0.2
  • 机器人4 1.0.3
  • 机器人5 1.0.4
  • 机器人6 1.0.5

taro version 生成版本号

基于release-it 生成版本号,内部默认定义 config文件,项目无需配置 config文件

  1. 基本使用 npx taro version ,会自动问询需要生成的版本和是否git commit

  2. 生成正式版本号 npx taro version --increment patch --ci 生成正式版本并跳过问询

  3. 生成体验版本 npx taro version --increment prerelease ---ci 生成体验版本并跳过问询

  4. 查看预期生成的changelog 信息 npx taro version --changelog

taro release 生成新正式版本并上传小程序代码

taro versiontaro upload 命令的组合,生成新正式版本(x.y.z)并上传小程序代码。

  1. 基本使用 npx taro release

taro pre-release 生成新体验版本并上传小程序代码

taro versiontaro upload 命令的组合,生成新体验版本(x.y.z-<tag>.0)并上传小程序代码。

  1. 基本使用 npx taro pre-release

taro gen-api 生成API代码

基于Apifox项目生成API代码,对@seer-bigdata/auto-gen-api 的封装,便于Taro项目的统一使用

  1. 基本使用 npx taro gen-api ,会自动问询需要生成的项目和接口