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

@gwm-overseas-web/gwm-h5-components

v1.0.6

Published

H5常用组件库

Downloads

2

Readme

Gwm H5 Components

海外前端组件库

版本管理规范

SemVer 规范的标准版本号采用 X.Y.Z 的格式,其中 X、Y 和 Z 为非负的整数,且禁止在数字前方补零。X 是主版本号、Y 是次版本号、而 Z 为修订号。每个元素必须以数值来递增。

  • 主版本号(major):当你做了不兼容的 API 修改
  • 次版本号(minor):当你做了向下兼容的功能性新增
  • 修订号(patch):当你做了向下兼容的问题修正

命令

  • 升级主版本号: npm version major
  • 升级次版本号: npm version minor
  • 升级修订版本号: npm version patch

发布

切到项目目录下,登录你的 npm 账号

npm adduser 或者 npm login

你可能会遇到报错,注意检查你的 npm 源是否有问题,使用 taobao 的源会报错,切换回 npm 官方源

npm config set registry https://registry.npmjs.org/

最后执行发布

npm publish

本地调试

当我们开发一个组件库,大多数情况下我们会希望能够直接在业务项目中调试我们的组件(在组件项目中有任何变动可以直接在业务项目中看到效果,而不是发布到 npm 仓库中,然后在业务项目再更新 npm 包去查看)。

调试工具-yalc

yalc 将组件的包依赖提升至应用中,在全局添加组件依赖,在应用下新建文件拉取依赖,即使有共同的依赖也会从应用的 node_modules 去查找。使用 yalc 可以避免上述问题。

全局安装

npm i yalc -g

发布到本地

在组件库目录下,运行

yalc publish

在使用该组件库的项目中添加本地依赖。

yalc add 你项目的名字

可以在 package.json 中查看相关依赖,依赖发生了变化。

// add之前
"test": "^2.6.14",

// add之后
"test": "yalc:xxxxxx",

当组件库发生变更后

// 编译代码
npm run build

// 发布更新
yalc push

调试完成以后,在业务项目中执行清除命令

yalc remove --all

清除命令后,node_modules 中原本的依赖文件也会消失,所以要重新跑业务项目,需要重新安装相关依赖,npm install 或者执行依赖再安装一次

参考资料