forked from fbi-js/fbi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
151 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters