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

@haici/scripts

v1.0.3-beta.3

Published

## confirmBuildEnv

Downloads

6

Readme

海鹚脚本工具集

confirmBuildEnv

背景

小程序目前是通过开发者在本地进行编译然后上传。因为工程太多,或者项目太紧张时,很有可能把发布的环境搞错,导致生产环境发布了测试版本。因此这个工具的作用是在运行 build 命令时进行二次确认,并且提供把 Build 信息发送到企业微信群的功能方便他人检查。

配置

命令参数

-t: 用来作为识别的标识,在运行命令时会把带有这个 tag 标记的命令打印出来,让操作者进行二次确认。

{
  "scripts": {
    "build:dev": "cbe -t dev && umi build",
    "build:uat": "cbe -t uat && umi build",
    "build": "cbe -t production && umi build"
  }
}

执行上述:npm run build:uat 的命令时,控制台就会打印出:**编译命令**: cbe -t uat && umi build 进行确认。

企业微信群的 hooks 配置

需要在执行 build 命令时给企业微信群发送消息的话,要在 package.json 中增加配置,如下所示:

{
  "description": "广西区域 广西壮族自治区人民医院 4.0微信小程序 p45",
  "wxGroupHooks": {
    "groupName": "实施2部前端GitLab【机器人自动消息】",
    "hostname": "qyapi.weixin.qq.com", // 默认可以不传
    "path": "/cgi-bin/webhook/send?key=86235124-8424-4423-9534-844ce9c61305"
  }
}

发送消息时,脚本运行时会读取 description 字段,这样发到群里时方便悉知是哪个医院正在 build。