每次我通过git更新可用包时,是否需要发布到npm? [英] Do I need to publish to npm every time I update a package available via git?

查看:187
本文介绍了每次我通过git更新可用包时,是否需要发布到npm?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我维持一个令人难以置信的螃蟹季节包裹。我有 npm publish ed版本0.1.0,其中包含 package.json 包含:

 repository:{
type:git,
url:https://github.com /example/crab-season.git
}

当我添加真棒新功能时,将版本升级到0.2.0,并推送到github将npmjs注册表通知我的新版本,还是每次都需要 npm publish

$ b $在发布了几个模块之后,答案是肯定的,你需要 npm publish 来获取新的npmjs上的版本。

这使得模块创作者可以在开始下一个版本的工作时,或者在版本完成之前的任何时间, 。



npm版本 通过检测git仓库,在 package.json 中提交版本,提交更改以及使用版本号标记更改。


Say I maintain an incredible crab-season package. I've npm published version 0.1.0 with a package.json containing:

"repository": {
  "type": "git",
  "url": "https://github.com/example/crab-season.git"
}

When I add awesome new features, bump the version to 0.2.0, and push to github will the npmjs registry notice my new version or do I need to npm publish each time?

解决方案

After publishing a few modules, the answer is yes, you need to npm publish to get new versions on npmjs.

This gives the module author the flexibility to bump their version number as soon as they start work on the next version, or any time before the version is finished.

npm version handily speeds up this flow by detecting a git repository, bumping the version in package.json, committing the change, and tagging the change with the version number.

这篇关于每次我通过git更新可用包时,是否需要发布到npm?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆