Skip to content

Commit

Permalink
add travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
neikvon committed Dec 4, 2017
1 parent b2ee13e commit bb7170c
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 193 deletions.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### 1. Information

OS version | Node version | Dawn version
------------ | -------------| ---------------
your-version | your-version | your-version


### 2. Problem

Describe your problems in as much detail as possible


### 3. Recurrence

The steps of problem recurrence
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Files
*.log
node_modules
*.bak.js
.DS_Store

# Folders
tmp/
backup/

.nyc_output
coverage/
.travis.yml
yarn-error.log

*.bak.js
.nyc_output/
node_modules/
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- "7.6.0"
branches:
only:
- "v3.x"
install:
- npm install
script:
- npm test
after_success:
- npm run coveralls
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<a name="3.0.0-beta.20"></a>
# [3.0.0-beta.20](https://github.com/neikvon/fbi/compare/v3.0.0-beta.19...v3.0.0-beta.20) (2017-12-03)



<a name="3.0.0-beta.19"></a>
# [3.0.0-beta.19](https://github.com/neikvon/fbi/compare/v3.0.0-beta.18...v3.0.0-beta.19) (2017-11-30)


### Bug Fixes

* fullname of the template ([e65cb76](https://github.com/neikvon/fbi/commit/e65cb76))



<a name="3.0.0-beta.18"></a>
# [3.0.0-beta.18](https://github.com/neikvon/fbi/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2017-11-30)

Expand Down
223 changes: 38 additions & 185 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,205 +1,58 @@
<div align="center">
<h2>fbi</h2>
<p>Front-end & Back-end(node.js) development Intelligent</p>
</div>

<p align="center">
<a href="https://travis-ci.org/AlloyTeam/fbi/"><img src="https://img.shields.io/travis/AlloyTeam/fbi/v3.x.svg" alt="Build Status"></a>
<a href='https://coveralls.io/github/AlloyTeam/fbi?branch=v3.x'><img src='https://coveralls.io/repos/github/AlloyTeam/fbi/badge.svg?branch=v3.x' alt='Coverage Status'></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/dm/fbi.svg" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/v/fbi.svg" alt="Version"></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/l/fbi.svg" alt="License"></a>
</p>

# 安装和配置
$ tnpm i -g fbi@next
fbi is an open source workflow tool. It was designed to help developers improve productivity, unify and standardize teams workflows.

$ fbi set npm=yarn
[中文 README](./README_zh.md)


# 入门使用
$ fbi init https://github.com/fbi-templates/fbi-project-mod.git my-project
## Features

$ fbi ls
- **templates management**: create and build projects quickly and easily. (Version 3.0 supports git-based version control)
- **tasks management**: manage recurring processes easily. Just need to write the recurring processes into js file, and add it to fbi global.
- **dependencies management**: You can choose to let fbi to manage development dependencies, and shared between multiple projects, make the project directory more concise.
- **high scalability**: It's easy to create a workflow that suits your habits via fbi.

$ fbi s

## Quick start

# 进阶使用
```bash
# install globally
$ npm i -g fbi

$ cd path/to/workspace

## 模板管理
# Initialize a project
$ fbi init https://github.com/fbi-templates/fbi-project-vue.git my-project

**添加**
$ cd my-project

$ fbi add <repo> # 远程模板   
$ fbi add path/to/tmpl # 本地模板
$ fbi add . # 本地模板(当前目录)
# Start the development server
$ fbi s
```

**更新**
## Resources
- [Full documentation](https://neikvon.gitbooks.io/fbi/content/)
- [Official templates](https://github.com/fbi-templates)

$ fbi up <tmpl>

**删除**
## Changelog

$ fbi rm <tmpl>
- [CHANGELOG.md](./CHANGELOG.md)
- [release notes](https://github.com/AlloyTeam/fbi/releases)


## License
[MIT](https://opensource.org/licenses/MIT)

## 项目管理

**初始化**


$ fbi init <tmpl>[@<version>] [option]
| **option** | **说明** |
| ------------------- | --------------------------- |
|| 只有项目源码,和指定模板名称 |
| `-o` , `-option` | 带上项目配置 |
| `-t` , `-task` | 带上项目配置和任务 |
| `-a` , `-all` | 所有文件(除.git目录外),可用于基于已有模版生成新的模版 |

在已有项目上执行`fbi init [option]`, 只更新指定的options, 不更新src。


**版本控制**

$ fbi <task> # 自动切换
$ fbi use <version> # 手动切换        



## 查看信息
$ fbi ls [item] [item]
| **item** | **说明** |
| ---------------------- | -------------- |
|| 查看当前目录可用的任务和模板 |
| `util` / `utils` | 查看可用工具类 |
| `store` / `stores` | 模板仓库信息 |
| `config` / `configs` | FBI全局配置 |



## 执行任务
$ fbi ls
$ fbi <task> [params] # task: 任务名称或别名; params: 任务参数;            



# 模板开发
## 步骤
1. 创建目录结构
2. 任务开发
1. 项目模板:将任务文件置于fbi目录内
2. 任务模版:按照普通的npm模块开发方式进行即可
3. 测试
4. 提交到git仓库


## 推荐命名方式
- 项目模板:`fbi-project-*`
- 任务模板:`fbi-task-*`


## 如何更快地获取任务参数?
const params = ctx.task.getParams()


if(params.test) {}
server.port = params.port


## 如何使用FBI内置的工具类?
ctx.utils.x
ctx.logger.x


## 如何让任务可以并行执行?
1. module.export
2. return promise


# 模板列表

https://github.com/fbi-templates



# API Docs

**命令说明**

查看:`fbi` / `fbi -h`

| **** | **说明** |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `add <repo> [<repo> ...]` | 添加模板(项目模板和任务模板) |
| `init <template>[@<version>] [project] [options`] | 初始化项目。template: 模板名称; version: 模板版本; project: 项目路径; options: 选项(-o: 带选项; -t: 带任务; -a:带所有;) |
| `use <version>` | 指定项目所使用的模板版本。version: 模板版本号(可通过 `fbi ls store` 查看获得) |
| `install, i` | 安装依赖(会自动安装当前项目的生产依赖和对应模板的开发依赖) |
| `list, ls, l [item]` | 查看信息。空: 当前目录可用的任务和模板; config: 全局配置; store: 仓库信息; util: 工具类列表; |
| `remove, rm <template>` | 删除模板。template: 模板名称(可简写、可全称) |
| `update, up [template]` | 更新模板。template: 模板名称(可简写、可全称) |
| `set [key=value]` | 设置全局配置。空: 交互式填写所有配置; 不为空: 设置单项 |
| `reset` | 重置全局配置 |
| `--help, -h` | 显示帮助信息 |
| `--version, -v` | 显示FBI版本号 |



**全局配置说明**

查看: `$ fbi ls config`

设置: `$ fbi set`

使用:`ctx.configs`

| **** | **说明** | **默认值** |
| ------------------------ | ---------- | -------------------------------------------------------------------------------------- |
| _DATA_ROOT (只读) | 本地仓库目录 | /Users/{yourname}/.fbi |
| _STORE_FILE (只读) | 仓库信息文件路径 | /Users/{yourname}/.fbi/store.json |
| _CUSTOM_CONFIG_FILE (只读) | 自定义配置文件路径 | /Users/{yourname}/.fbi/configs.custom.json |
| LOG_LEVEL | 日志级别 | info |
| LOG_PREFIX | 日志前缀 | FBI··> |
| NPM | npm别名 | npm |
| NPM_OPTIONS | npm参数 ||
| TASK_PREFIX | 任务模板前缀 | fbi-task- |
| TEMPLATE_PREFIX | 项目模板前缀 | fbi-project- |
| TEMPLATE_TASK | 模板内任务文件目录名 | fbi |
| TEMPLATE_CONFIG | 模板配置文件路径 | fbi/options.js |
| TEMPLATE_INIT_IGNORE | 初始化项目时的忽略项 | node_modules,.DS_Store,.svn,.git,dst,dist,package.json,fbi,yarn.lock,package-lock.json |
| TEMPLATE_ADD_IGNORE | 添加模板时的忽略项 | .DS_Store,.svn,.git,dst,dist |
| VERSION_SEPARATOR | 版本分隔符 | @ |


**仓库信息说明**

查看: `$ fbi ls store`

使用:`ctx.stores`

| **** | **说明** | **示例** |
| ----------- | ------ | ------------------------------------------------------------------------------------------- |
| type | 模板类型 | project/task |
| path | 模板路径 | /Users/{yourname}/.fbi/fbi-project-simple |
| version | 模板版本信息 | false / {"latest":"v3.1.0","current":"v3.1.0","all":["v3.0.0","v3.1.0"]} (false则说明不支持版本控制) |
| repository | 模板来源路径 | https://github.com/fbi-templates/fbi-project-mod.git |
| description | 模板描述 | Node service, npm module template. |
| tasks | 模板内含任务 | build,serve |


**内置工具类说明**

查看: `$ fbi ls util`

使用:`ctx.utils[分类][方法]` / `ctx.utils[方法]`

| **分类** | **方法** | **说明** |
| ------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| fs | stat,mkdirp,exist,existSync,read,write,copy,remove,list,isEmptyDir,homeDir | 文件操作类 |
| style | bold,italic,underline,inverse,white,grey,black,blue,cyan,green,magenta,red,yellow,normal | 文本样式类 |
| type | isJson,isObject,isArray,isTaskFile,isPath,isGitUrl | 类型判断类 |
| git | is,clone,pull,tags,currentTag,currentBranch,checkout,getBranchs | git操作类 |
| path | isAbsolute,isRelative,normalize,cwd,join,dir | path操作类 |
| Logger | debug,info,success,warn,error,log | 日志类, 使用方法 :const log = new ctx.utils.Logger(); log.info(‘’) |
| 其他 | argvParse | 终端参数解析 |
| 其他 | assign | json深合并 |
| 其他 | dateFormat | 日期时间格式化 |
| 其他 | exec | spawn的promise版 |
| 其他 | flow | 终端交互方法 |
| 其他 | promisify | promise化 |
| 其他 | sequence | 顺序执行多个promise |

特殊工具类 logger
使用:`ctx.logger[方法]`

Copyright (c) 2015-present, neikvon@[AlloyTeam](https://github.com/AlloyTeam)
62 changes: 62 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<div align="center">
<h2>fbi</h2>
<p>Front-end & Back-end(node.js) development Intelligent</p>
</div>

<p align="center">
<a href="https://travis-ci.org/AlloyTeam/fbi/"><img src="https://img.shields.io/travis/AlloyTeam/fbi/v3.x.svg" alt="Build Status"></a>
<a href='https://coveralls.io/github/AlloyTeam/fbi?branch=v3.x'><img src='https://coveralls.io/repos/github/AlloyTeam/fbi/badge.svg?branch=v3.x' alt='Coverage Status'></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/dm/fbi.svg" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/v/fbi.svg" alt="Version"></a>
<a href="https://www.npmjs.com/package/fbi"><img src="https://img.shields.io/npm/l/fbi.svg" alt="License"></a>
</p>

fbi是一个开源的的工作流工具。它旨在帮助开发人员提高生产力,统一和标准化团队工作流程。

[README in English](./README.md)

## 特性

- **模板管理**:快速轻松地创建和构建项目。(版本3.0支持基于git的版本控制)
- **任务管理**:轻松管理重复的流程。只需将重复的流程写进js文件里,并添加到fbi全局即可。
- **依赖管理**:您可以选择让fbi管理开发依赖项,并在多个项目之间共享,使项目目录更加简洁。
- **高扩展性**:通过fbi创建适合您习惯的工作流程非常简单。


## 快速开始

```bash
# 全局安装
$ npm i -g fbi

# 切换到工作目录
$ cd path/to/workspace

# 初始化项目
$ fbi init https://github.com/fbi-templates/fbi-project-vue.git my-project

# 切换到项目目录
$ cd my-project

# 启动开发服务器
$ fbi s
```


## 资源

- [完整文档](https://neikvon.gitbooks.io/fbi/content/)
- [官方模板](https://github.com/fbi-templates)


## 变更日志

- [变更日志](./CHANGELOG.md)
- [发布日志](https://github.com/AlloyTeam/fbi/releases)


## 开源许可证

[MIT](https://opensource.org/licenses/MIT)

Copyright (c) 2015-present, neikvon@[AlloyTeam](https://github.com/AlloyTeam)
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"publish-minor": "npm version minor && git push && git push --tags && npm publish",
"publish-major": "npm version major && git push && git push --tags && npm publish",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"release-changelog": "git add CHANGELOG.md && git commit -m 'release CHANGELOG.md' && git push"
"release-changelog": "git add CHANGELOG.md && git commit -m 'release CHANGELOG.md' && git push",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {},
"devDependencies": {
"ava": "0.24.0",
"coveralls": "^3.0.0",
"cz-conventional-changelog": "^2.1.0",
"execa": "^0.8.0",
"nyc": "11.4.0",
Expand Down

0 comments on commit bb7170c

Please sign in to comment.