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 🙏

© 2024 – Pkg Stats / Ryan Hefner

taro-ci

v2.0.0-alpha.6

Published

基于[微信:miniprogram-ci](https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html)、[支付宝:miniu](https://opendocs.alipay.com/mini/miniu/command-intro)开发,使用 swan-toolkit 支持百度小程序自动上传,用于同时打包 weapp、alipay、swan、weapp.third 多版本发布管理;第一个横线后半部分会作为环境变量注入到 Taro

Downloads

450

Readme

taro-ci

基于微信:miniprogram-ci支付宝:miniu开发,使用 swan-toolkit 支持百度小程序自动上传,用于同时打包 weapp、alipay、swan、weapp.third 多版本发布管理;第一个横线后半部分会作为环境变量注入到 Taro 框架小程序中【process.env.MODE_ENV=third】;执行 taro build 时置入的环境变量还包括 process.env.ROOT_PATH=当前文件包输出路径,例:dist/weapp.dev;process.env.PLATFORM_ENV=weapp|alipay|swan;

扩展编译平台使用 taro-plugin-build,并在 taro-ci.config 中配置 useTaroPluginBuildBy="",插件编译时自动注册对应的编译平台,可实现多版本公用框架并针对特殊版本处理,具体可参考:Taro 跨平台开发

注意: 如需在项目中使用 MODE_ENV|PLATFORM_ENV

需要对 Taro 项目配置:

config/index.config.env.MODE_ENV=process.env.MODE_ENV

config/index.config.env.PLATFORM_ENV=process.env.PLATFORM_ENV

小程序开发必须基于Taro开发


小程序项目根目录下package.json 配置 script 命令 注意:目前 robot 仅支持[1,3]

{
  //...
  "script": {
    "dev": "taro-ci --watch", // 开发模式
    "build": "taro-ci", // 打包
    "ci:beta": "taro-ci --robot 1 --ci=toolId,privateKey,token --dd=accessToken,secret", // 发布 - 体验版
    "ci:rc": "taro-ci --robot 2 --ci=toolId,privateKey,token --dd=accessToken,secret", // 发布 - 候选版
    "ci:release": "taro-ci --robot 3 --ci=toolId,privateKey,token --dd=accessToken,secret", // 发布 - 正式版
    "build:branch": "taro-ci --branch=test", // 按分支打包不同项目,需要配置taro-ci.branchMap
    "upload": "taro-ci --upload" // 跳过build,仅上传
  }
}
/**
 * 根目录增加配置文件 taro-ci.config.js
 */

module.exports = {
  name: "miniapp",
  version: "1.0.0",
  description: "通用描述信息",
  type: ["weapp", "alipay", "weapp.pro", "alipay.pro"],
  sourceRoot: ".taro-ci-src", // 资源入口,不配置,默认 .taro-ci-src,需要在项目config中sourceRoot相关配置,改用process.env.SOURCE_ROOT_PATH
  modes: [''], // 支持的类型:重要:过滤以及查找文件时依赖此配置;
  modesExclude: [''], // 排除的路径,此路径的文件,不按照modes过滤更新文件名,即使用原有文件名;
  copy: () => ['文件路径',['文件路径','分包(空表示主包)']],
  insertImport: { // 为了兼容taro3.x 需要注入一些引用,别名位置可以是default或者alias.default,表示引入default
    '导入路径':(['导出名', '文件类型PAGE|COMPONENT|ENTRY|void', '导出别名.default']|'导出名')[],
  },
  info: {
    weapp: {
      patch404: true, // app.json缺少的文件,自动用src/404.jsx补充;
      version: "1.1.0",
      description: "对应版本的针对性描述",
      appId: "wx.................",
      subs:{
         'pages-0': {
            /**
             * 分包配置,
             * 配置后chunks路径内容打包到 pages-0/common.js;
             * chunksPages配置路径引入pages-0/common.js
             */
            chunks: ['components/*'],
            chunksPages: (pagesNames) => {
              const ls = [
                ...pagesNames.filter((pathname) => pathname.startsWith('pages/*')),
                'components/*',
              ];
              return ls;
            },
          },
      }
    },
    "weapp-third": {
      appId: "wx.................",
      label: "普通", // 特殊版本的标签
      tag: "N", // 特殊版本的标签体现在版本号上 N1.2.0
      robot: 1, // 特殊版本微信上传使用的robot计算依据 1 + (robot-1) *2
    },
    alipay: {
      appId: "支付宝的APPID",
    },
  },
  branchMap: {test:{type:'',robot:1}} | (branch) => ({type:'',robot:1}),  // 分支对应信息,可为对象或者方法
  minSwanVersion: "", // 最低基础库版本
  useTaroPluginBuildBy: "normal", // type|mode|normal 自定义编译模式:mode - 按照MODE_ENV对应编译,type - 按照传入的全指令编译
  git: "", // 当前项目对应的git地址
  // 支付宝工具id与私钥;百度上传token
  // ci: {
  //   toolId: "",
  //   privateKey: "",
  //   token: ""
  // },
  // 钉钉通知(可配置到git项目的CI/CD变量配置中)
  // dd: {
  //   accessToken: "",
  //   secret: ""
  // }
};
/**
 * 根目录增加发布配置文件 taro-ci.release.json/taro-ci.release.${PLATFORM_ENV}.${MODE_ENV}.json
 */
["0.0.2-最新版描述信息-20211021", "0.0.1-上个版本描述信息-20211020"]

微信小程序生成上传秘钥文件 private.wx..................key 放到项目根目录下


支付宝小程序生成工具 id 与私钥 配置到 taro-ci.config.json 中的 ci 配置项 或者配置到命令行 --ci=toolId,privateKey


获取的钉钉通知消息所需的token 与秘钥:找到对应的群 >点击群设置 >智能群助手 >添加机器人 >选择自定义 >确认添加后,选择加签即可获得对应的 accessToken 与 secret,将值配置到 taro-ci.config.json 中的 dd 配置项 或者配置到命令行 --dd=accessToken,secret

使用许可

MIT © yymzy