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

zzh-module-1

v1.0.3

Published

* master 配置基本完善: * 配置文件移动到config文件夹\ * 添加eslint\ * 状态管理\ * 测试:冒烟|单元|覆盖率 * 持续集成和Trabis CI * git commit 规范 | changlog自动生成 * br1.0 基础多页面配置基本完成,分离打包dll * br1.0.1 基础多页面配置基本完成,HardSourceWebpackPlugin替换dll * br1.1 配置基本完善: * 配置文件移动到config文件夹\ * 添加

Downloads

2

Readme

webpackdemo版本分支

  • master 配置基本完善:
    • 配置文件移动到config文件夹\
    • 添加eslint\
    • 状态管理\
    • 测试:冒烟|单元|覆盖率
    • 持续集成和Trabis CI
    • git commit 规范 | changlog自动生成
  • br1.0 基础多页面配置基本完成,分离打包dll
  • br1.0.1 基础多页面配置基本完成,HardSourceWebpackPlugin替换dll
  • br1.1 配置基本完善:
    • 配置文件移动到config文件夹\
    • 添加eslint\
    • 状态管理\
    • 测试:冒烟|单元|覆盖率
    • 持续集成和Trabis CI

配置文件夹config

  • webpack.base.js
  • webpack.dev.js
  • webpack.pro.js
* 处理js:压缩、chunk
* 处理css\sass: 支持css module,压缩、抽离
* 处理图片和字体库等其他资源
* 生成html

代码规范

添加eslint

# 此处以react项目为例
npm i babel-eslint eslint-loader -D
npm i eslint eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y -D
npm i eslint-config-airbnb -D
添加.eslintrc.json文件

添加editorconfig

# 添加配置文件.editorconfig
# 安装vscode插件:EditorConfig for VS Code

测试:冒烟、单元、覆盖率

冒烟测试:test/smoke

使用如下:

npm run smoke

配置如下:

单元测试

使用如下;

npm i mocha -D

npm run unit

测试覆盖率

使用istanbul

持续集成和Travis CI

# 添加.travis.yml 文件
language: node_js

sudo: false

cache:
  apt: true
  directories:
    - node_modules

node_js: stable

install:
  - npm install -D

scripts:
  - npm run unit_rate

Commit message 和 Change log 编写指南

Commit message规范

常用的提交类型:

  • build: 打包静态资源
  • chore:构建过程或辅助工具的变动
  • docs:文档(documentation)表示 文档上传
  • feat:新功能(feature) 表示 新增加的功能
  • fix:修复bug
  • perf:优化相关,比如提升性能、体验
  • refactor:重构(即不是新增功能,也不是修改bug的代码变动)
  • revert:回滚到上一个版本
  • style:格式(不影响代码运行的变动)
  • test:增加测试 表示 增加测试用例
  • update: 更新 表示 优化更新的功能

实现如下:

npm i validate-commit-msg husky -D

package.json添加配置:

  "husky": {
    "hooks": {
      "commit-msg": "validate-commit-msg"
    }
  },

Change log生成

# 全局安装conventional-changelog-cli
npm i conventional-changelog-cli -g

# 写入package.json的scripts字段
{
  "scripts": {
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
  }
}

控制台显示自从上次发布以来的变动:conventional-changelog -p angular -i CHANGELOG.md -w
文件中添加自从上次发布以来的变动:conventional-changelog -p angular -i CHANGELOG.md -s
控制台生成所有发布的:conventional-changelog -p angular -i CHANGELOG.md -w -r 0
文件中添加生成所有发布的:conventional-changelog -p angular -i CHANGELOG.md -s -r 0