一些时间没有用bower发布包,结果忘了如何去发布一个包,记个笔记方便以后使用。
1.初始化
bower init
这个过程中会输入一些信息。我的包是: https://github.com/phodal/showdown-fontawesome
? name: showdown-fontawesome
? version: 0.0.1
? description: Showdown Font Awesome Plugin
? main file: src/icons.js
? what types of modules does this package expose? amd
? keywords: showdown,markdown,font-awesome
? authors: Fengda HUANG <h@phodal.com>
? license: MIT
? homepage: https://github.com/phodal/showdown-fontawesome
? set currently installed components as dependencies? Yes
? add commonly ignored files to ignore list? Yes
? would you like to mark this package as private which prevents it from being accidentally published to the registry? (y/N)? would you like to mark this package as private which prevents it from being accidentally published to the registry? No
{
name: 'showdown-fontawesome',
version: '0.0.1',
homepage: 'https://github.com/phodal/showdown-fontawesome',
authors: [
'Fengda HUANG <h@phodal.com>'
],
description: 'Showdown Font Awesome Plugin',
main: 'src/icons.js',
moduleType: [
'amd'
],
keywords: [
'showdown',
'markdown',
'font-awesome'
],
license: 'MIT',
ignore: [
'**/.*',
'node_modules',
'bower_components',
'app/bower_components',
'test',
'tests'
]
}
? Looks good? Yes
2.注册包
bower register showdown-fontawesome git@github.com:phodal/showdown-fontawesome.git
3.修改bower.json中的版本
4.打tag,如
git tag v0.0.1
5.push tag
push一个tag
git push origin v0.0.1
push本地tags
git push --tags
列出所有tag的状态
git tag -l
6.查看包状态
bower info showdown-fontawesome
围观我的Github Idea墙, 也许,你会遇到心仪的项目