fecom

A magic component management tool

Build Status Build status Coverage Status Dependency Status


简介

fecom是依托于Gitlab的组件管理工具,只需要满足下面条件,就可以通过fecom管理组件:

组件示例可以参考:https://gitlab.com/u/icefox0801/projects

安装

npm install -g fecom

配置

首次执行fecom命令,会提示输入用户名邮箱Gitlab Token

icefox@icefoxmac:~ $ fecom
11:55:51 INFO  用户配置文件未找到,初始化"~/.fecomrc"
? 请输入您的用户名: icefox0801
? 请输入您的邮箱: icefox0801@hotmail.com
? 请输入您的Gitlab token: ********************
11:56:06 INFO  完成初始化用户配置文件

输入以上信息后,用户信息会被保存到~/.fecomrc文件中,以后每次执行fecom会读取~/.fecomrc中的用户配置

除此之外,还需要配置GitlabAPI地址和默认组件所属的用户/组。例如,Gitlab的地址为https://gitlab.exaplem.com,默认组件的仓库都放下fe-group下,那么还需执行:

icefox@icefoxmac:~ $ fecom p -d "domain=https://gitlab.example.com&owner=fe-group"

用法

Usage: fecom [options]

Commands:

init [options]                         初始化组件
install|i [options] [component...]     安装组件
uninstall|un [options] <component...>  卸载组件
list|ls [options] [component...]       列出组件版本
info <component>                       显示组件的详细信息
link [component]                       链接组件
search|s [options] <pattern>           搜索组件
profile|p [options] [query]            管理用户配置
tree|t [options] [component...]        打印组件依赖树
version|v [options] [releaseType]      组件版本更新
update|u [component...]                更新组件

A magic component management tool

Options:

-h, --help  output usage information

component.json

component.json配置文件可能存在于项目或者组件中,在不同的应用场景,并非所有的配置项都有用,请酌情进行配置!

fecom的默认配置项:

综上所述:

常用命令介绍

组件安装格式

组件名称格式 [source:][owner/]name[@version][?args],以group/compA为例