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

npm-assistor

v1.0.0

Published

npm 包初始化和发布工具

Downloads

4

Readme

npm-assistor

npm-assistor

npm 包初始化和 git tag 辅助工具。源于搜车前端内部规范化改造,具体指内部功能模块 SDK 化和 GitFlow 流程规范化。Github: https://github.com/plusmancn/npm-assistor 欢迎 star 和 pr

Usage

全局安装

npm install -g npm-assistor

在项目根目录(package.json 所在文件夹)执行

npm-assistor

弹出如下选择界面

? 选择要执行的命令 (Use arrow keys)
  ❯ init (用于 npm 包初始化,请在 npm init 后执行) 
    tag (用于发布前 master 分支的 tag 标记)

选择 init 后的交互(Gif)
npm-assistor-init 选择 tag 后的交互(Gif)
npm-assistor-tag

Config(Important!!)

config 读取规则
优先读取用户目录下的 ~/.npm_assistor.yml 文件,如果不存在,则使用项目默认配置。
默认配置如下:

################### npm-assistor Configuration Example #########################

################## 公共模版库配置 #########################
templates:
    # github 远端配置库,会调用 api.github.com 相关 Api 进行内容获取
    # 支持多仓库
    github:
        # 可以 fork 示例模板,添加自己的配置
        - https://github.com/plusmancn/npm-assistor-template.git
        # - https://github.com/yourname/yourself-tempalte.git
    # Todo 最好支持下 gitlab,实现内网服务
    # gitlab:
        # - 
################## gitignore 服务器地址 #########################
#  项目地址: https://github.com/joeblau/gitignore.io
#  土豪大大们,可以选择在国内部署一份,屌丝只用得起国外便宜货
gitignore_server: http://gitignore.plusman.cn:8000

Init 说明

eslintrc
具体 IDE 集成参考:eslint.org

LICENSE(未做集成)
licenses list by name
并未做成命令行,具体可以参考,源码 licenses-files 文件夹,内含思维导图 xmind 格式
popular-license

Tag 说明

Tag说明
发布号部分遵循 semver 规范设计,简版说明如下

格式如 ${major}.${feature}.${patch},遵循 semver 规范的版本号
    选择需要递增的版本号
        major: 主版本号,用于断代更新或大版本发布
        feature: 特性版本号,用于向下兼容的特性新增
        patch: 修订版本号,用于 bug 修复
递增位的右侧位需要清零,如 1.1.2 => 1.2.0

发布日期部分遵循 {year}w{weeks}{a-z: 本周第几次发布},此部分可选,如果服务端项目发布必带;sdk 发布一般不带

周数定义

const moment = require('moment');
// 更新 week 设置
moment.locale('zh-cn', {
    // 每年第一周的定义:
    // 国内:包含1月4号的那周为每年第一周
    // 美国:包含1月1号的那周为每年第一周(苹果日历也是如此)
    // 更新了下 moment,现在规则是 包含1月1号的那周为每年第一周,新的一周起始于周一
    //(比较好理解,苹果日历也可设置,设置->高级->显示周数)
    week : {
        dow : 1, // Monday is the first day of the week.
        doy : 7  // The week that contains Jan 1th is the first week of the year.
    }
});

GitFlow 流程
附上团队内部修改过的GitFlow 流程。a-successful-git-branching-model/ 原博客结尾有 keynote 源码哈,可以在这基础上改出适合自己团队的 GitFlow GitFlowV2 Of souche

About

Have Fun!