问题描述
假设我维持一个令人难以置信的螃蟹季节
包裹。我有 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
?
npm publish
来获取新的npmjs上的版本。 这使得模块创作者可以在开始下一个版本的工作时,或者在版本完成之前的任何时间, 。
通过检测git仓库,在 package.json
中提交版本,提交更改以及使用版本号标记更改。
Say I maintain an incredible crab-season
package. I've npm publish
ed 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!