byted-vui
Version:
A Component Library for Vue.js.
110 lines (82 loc) • 3.79 kB
Markdown
## BytedVui
> byted-vui Toolkit for Web.
## Links
- bind host
- 127.0.0.1 vui.byted.org
- Homepage and documentation
- [Chinese users](http://vui.byted.org/#/zh-CN)
- [FAQ](./FAQ.md)
- Starter kit
- [byted-vui-starter](https://code.byted.org/ad/byted-vui-starter)
- Git
- [Chinese users](https://code.byted.org/ad/byted-vui)
## Install
```shell
npm install byed-vui -S
```
## Quick Start
``` javascript
import Vue from 'vue'
import BytedVui from 'byted-vui'
Vue.use(BytedVui)
// or
import {
Select,
Button
// ...
} from 'byted-vui'
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
```
For more information, please refer to [Quick Start](http://vui.byted.org/#/zh-CN/component/quickstart) in our documentation.
## Browser Support
Modern browsers and Internet Explorer 10+.
## Development
Skip this part if you just want to use BytedVui.
##npm
##git仓库(推荐)
npm install git+ssh://git@code.byted.org:ad/byted-vui.git#dev:^0.0.2ß
如果我们直接安装 github 上,使用网址的方式可以表示为:
看下 npm 安装 git 仓库的协议:
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
<protocol> is one of git, git+ssh, git+http, git+https, or git+file.
If #<commit-ish> is provided, it will be used to clone exactly that commit. If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither #<commit-ish>or #semver:<semver>is specified, then master is used.
即 protocol 支持 git, git+ssh, git+http, git+https, git+file,私有仓库需要用户名和密码时需要填写用户名和密码,semver 表示需要使用的版本号, 不过貌似不生效。(npm 中有个包 semver 是专门用于比较包的版本号大小)
直接写 #branch 表示需要安装的分支号。
所以在开发过程中我们可以这么写包:
npm i git+https://username:password@git.example.com/path/reposity#master
或者使用打的 tag
npm i git+https://username:password@git.example.com/path/reposity#1.0.0
可能存在的问题是:
由于新版的 npm install 在安装时会使用 package-lock.json, 有时候同一分支不会从 github 上拉取最新的,
可能需要手动再安装一下(拿自己的仓库试了下,果然不会更新),所以安装时尽量以 tag 为标签进行安装,这样确保代码是正确的
此外,由于私有仓库都是需要密码的,这个时候需要提供一个公共账号和密码,某种程度上不利于管理吧
###bnpm仓库 (不推荐,多余出@byted,还得改源码)
公司 npm 仓库 http://bnpm.byted.org,文档见 https://docs.bytedance.net/doc/FIxqy81645cCczBqeoPGaa
我们统一使用 @byted 作为 scope
package.json
name 改为 @byted/xxx
publishConfig.registry 改为 http://bnpm.byted.org
设置新源
yarn install --registry http://bnpm.byted.org
npm set registry http://bnpm.byted.org
或者在项目根目录新建 .npmrc 文件,内容为 registry=http://bnpm.byted.org(强烈推荐)
用户注册
npm adduser 进行 bnpm 的用户注册,请务必使用邮箱前缀进行注册,建议密码与之前相同
新的 bnpm 进行了权限校验,如需非 author 发包,请添加 maintainer
通知业务方新包名和版本号
npm login|adduser
npm version [<newversion> | major | minor | patch ]
npm publish|unpublish
成功后用包 @byted/byted-vui@0.0.2;
http://web-bnpm.byted.org/
## Changelog
## FAQ
## Special Thanks
Bytendance AD FE Team:
- [周国庆](zhouguoqing.917@bytedance.com)
- [李鑫]()
- [刘斌]()
- [武文静]()
## LICENSE
[MIT](LICENSE)