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

mx-mini-ci-tool

v1.14.4

Published

微信小程序Ci工具

Downloads

15

Readme

mx-mini-ci-tool

微信小程序Ci工具

小程序CI工具提供了以下命令

  1. init: 对项目进行初始化。此过程会完成如下事情:

(1)在当前小程序项目的根目录下创建qrcode目录用于存放小程序的预览二维码。 (2)在当前小程序项目的根目录下创建.release-it.json文件用于配置release-it 。 (3)在当前小程序项目的根目录下创建CHANGELOG.md用于记录小程序代码的变本变更。 (4)为当前小程序项目安装必要的依赖(git-cz,release-it,@release-it/conventional-changelog)。 (5)修改当前小程序项目的package.json文件,并增加用于运行git-cz和release-it的npm scripts。 (6)在当前小程序项目的根目录下创建ci.config.js文件用于配置调用miniprogram-ci相关功能的配置以及调用飞书机器人的相关配置,详见配置文件章节。

  1. uploadCode:将小程序项目代码上传到gitlab(或者github等)。此命令会进行如下操作:

(1)执行 git add . 命令 (2)执行 npm run commit 命令,调用git-cz (3)执行 npm run release 命令,调用release-it

  1. preview: 获取小程序的预览二维码,并保存到init命令创建的qrcode目录下。
  2. upload: 将小程序代码上传到开发者后台。如果working tree不是clean状态则会调用uploadCode命令强制将代码先提交到Gitlab,然后再上传代码,为上传的代码提供可追溯的版本。
  3. send:获取预览二维码,将代码上传到小程序开发者后台,将二维码发送到飞书群聊。此命令会调用preview命令和upload命令。

配置文件详解

export default {
  // new ci.Project的参数
  newProjectSettings: {
    appid: 'wx42066******be8d19',
    type: 'miniProgram',
    projectPath: 'E:\/GitSpace\/fs-new\/lio-4s-applet',
    privateKeyPath: 'E:\/GitSpace\/fs-new\/lio-4s-applet\/private.wx420663f291be8d19.key',
    ignores: ['node_modules/**/*'],
  },
  // ci.upload的参数
  ciUploadSettings: {
    setting: {
      es6: true,
      minifyJS: true,
      minifyWXML: true,
      minifyWXSS: true
    },
    onProgressUpdate: console.log,
  },
  // ci.preview的参数
  ciPreviewSettings: {
    setting: {
      es6: true,
      minifyJS: true,
      minifyWXML: true,
      minifyWXSS: true
    },
    qrcodeFormat: 'image',
    qrcodeOutputDest: 'E:\/GitSpace\/fs-new\/lio-4s-applet\/qrcode\/destination.jpg',
    onProgressUpdate: console.log,
  },
  // 发送到飞书的参数
  feishuSendSettings: {
    //app_id和app_secret飞书机器人应用的凭证信息
    app_id: 'cli_a2*****f8100e',
    app_secret: 'UayK*******YTJVnEym3P',
    // 后台提供的对飞书根据图片获取image_key接口的封装接口,详见飞书文档
    uploadImgUrl: 'https://************tool/image/upload',
    // 飞书机器人 webhook 地址
    webhookUrl: 'https://open.*******745426f55',
    // 飞书消息要通知到的人
    receivers:[
      {
        tag: 'at',
        user_id: '70652****972',
        user_name: '惊鸿'
      },
      // {
      //   tag: 'at',
      //   user_id: '705224***96225',
      //   user_name: 'NewName'
      // }
    ]
  }
}

使用注意事项

  1. 由于本工具使用了 miniprogram-ci ,所以使用本工具之前应访问"微信公众平台-开发 - 开发设置"后下载代码上传密钥,并配置 IP 白名单 开发者可选择打开 IP 白名单,打开后只有白名单中的 IP 才能调用相关接口。
  2. 注意调用完init命令后要及时修改ci.config.js配置文件。
  3. 关于使用飞书机器人的注意事项:首先是你的飞书机器人要使用发送图片接口则要开通权限,这个可以参照飞书的开发者文档。其次是ci.config.js配置文件中的uploadImgUrl字段是后端开发人员对飞书接口的进一步封装的接口,接口返回格式需要为如下格式:
{
	"code": 0,
	"data": {
		"image_key": ""
	},
	"msg": ""
}

所以要使用send命令则需要后端为你开发一个接口。