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

test-diff-new

v1.3.19

Published

支持一键发布npm包,集成自动更新version、自动生成CHANGELOG.md、发布时自动指向京东npm私服、发布、发布后自动推送京ME机器人消息等功能

Downloads

2,580

Readme

@jd/icc-npm-publish-cli

简介

@jd/icc-npm-publish-cli 支持一键发布npm包,集成自动更新version、自动生成CHANGELOG.md、发布时自动指向京东npm私服、发布、发布后自动推送京ME机器人消息等功能

兼容:Node.js >= 12.0.0

安装

npm i @jd/icc-npm-publish-cli --save-dev --registry=http://registry.m.jd.com

使用

// package.json

"scripts": {
  "verdaccio": "verdaccio",
  "pub:local": "pub-service pub:local",
  "alpha": "pub-service pub --npm-tag=alpha",
  "beta": "pub-service pub --npm-tag=beta",
  "pub": "pub-service pub",
  "prepublishOnly": "pub-service prepublish"
}

pub.config.js

安装 @jd/icc-npm-publish-cli 后,执行 npx pub-service init 会在本地生成 pub.config.js

// pub.config.js

module.exports = function () {
  return {
    robotConfig: {
      groupId: '', // 京ME群号,不填则不推送机器人消息
      docUrl: '', // 组件文档,默认 https://npm.m.jd.com/package/{packageName@version}
      repositoryUrl: '' // 代码仓库地址,默认 package.json 中 repository.url
    }
  }
}

接入京ME机器人消息

1、在京ME群中搜索 app.g5fqktat,将 前端组件机器人 拉入京ME群

2、在pub.config.js 中传入群号给 robotConfig.groupId

3、组件发布时会自动推送机器人消息到所指定群

Command & Options

1. pub

使用: pub-service pub [options]

作用:发布 package

Options:
  -a, --npm-tag=alpha        发布 alpha 版本
  -b, --npm-tag=beta         发布 beta 版本
  --skip-git-status          跳过git status 检测
  --skip-fetch-tags          跳过拉取tags
  --custom-version           自定义版本号
  --skip-publish             跳过发布
  --skip-robot               跳过机器人消息推送
  -h, --help                 display help for command

pub 命令集成了以下几个工作流:

1、自动更新 version

2、自动生成 CHANGELOG.md

3、发布时自动指向京东npm私服

4、发布

5、推送京ME机器人消息

2. pub:local

使用: pub-service pub:local [--registry=http://localhost:4873/]

作用:发布组件包至本地私有npm注册表

Options:
	-r, --registry <url> 设置本地私有npm注册表地址
  -h, --help  display help for command

2.1 启动本地私有npm注册表

npm run verdaccio

2.2 登录本地私有npm注册表

npm adduser --registry http://localhost:4873/

2.3 发布组件包至本地私有npm注册表

npm run pub:local

2.4 安装本地私有npm注册表组件包

npm i xxx -registry http://localhost:4873/

3. prepublish

使用: pub-service prepublish [options]

作用:阻止用户使用 npm publish 发布,强制使用 pub-service pub

Options:
  -h, --help  display help for command

4. init

使用: npx @jd/icc-npm-publish-cli init [options]

作用:初始化 pub-service 配置

Options:
  -h, --help  display help for command