Skip to content

Commit

Permalink
4.x基本文档完成
Browse files Browse the repository at this point in the history
  • Loading branch information
funnyli committed Sep 10, 2020
1 parent b870b40 commit af02955
Show file tree
Hide file tree
Showing 13 changed files with 239 additions and 7 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added docs/.DS_Store
Binary file not shown.
Binary file added docs/.vuepress/.DS_Store
Binary file not shown.
7 changes: 4 additions & 3 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
title: 'fbi docs',
description: 'fbi文档, docs, doucument',
head: [['link', { rel: 'icon', href: '../logo.png' }]],
head: [['link', { rel: 'icon', href: '../logo.jpeg' }]],
themeConfig: {
logo: '../logo.png',
logo: '../logo.jpeg',
nav: [
{
text: '版本',
Expand All @@ -14,7 +14,8 @@ module.exports = {
}
],
sidebar: {
'/pages/3x/': ['', 'entry', 'advance', 'more']
'/pages/3x/': ['', 'entry', 'advance', 'more'],
'/pages/4x/': ['', 'entry', 'advance', 'more']
},
lastUpdated: '最近更新',
smoothScroll: true,
Expand Down
Binary file added docs/.vuepress/public/.DS_Store
Binary file not shown.
Binary file added docs/.vuepress/public/logo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/.vuepress/public/logo.png
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
home: true
heroImage: /logo.png
heroImage: /logo.jpeg
heroText: FBI
tagline: 开源的工作流工具
actionText: 快速上手 →
actionLink: /pages/3x/
features:
- title: 模板管理
details: 快速轻松地创建和构建项目。(版本 3.0 支持基于 git 的版本控制)
details: 快速轻松地创建和构建项目。(版本 3.x 支持基于 git 的版本控制)
- title: 任务管理
details: 轻松管理重复的流程。只需将重复的流程写进 js 文件里,并添加到 fbi 全局即可
- title: 依赖管理
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/4x/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# 4.x 文档

github: <https://github.com/fbi-js/fbi>

### Node:

- nodejs >= 12.x
- npm >= 6.x

> 为了避免与 3.x 版本的冲突,4.x 版本命令修改为 fbi-next
171 changes: 171 additions & 0 deletions docs/pages/4x/advance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# 进阶

## 查看信息

查看已添加的仓库及模板信息

```
$ fbi-next ls/list [factory] [flags]
```

**factory**

- 描述:仓库名字
- 类型:可选

**例子**

```
$ fbi-next ls factory-web
```

**flags**

- 描述:查看指定内容
- 类型:可选
- -a/--all:展示所有仓库信息
- -p/--projects:展示所有项目信息
- -v/--versions:展示 fbi 版本

**例子**

```
$ fbi-next ls -a
$ fbi-next ls -v
```

## 模板管理

### 通过远程仓库添加

```
$ fbi-next add <remote repositories...>
```

**remote repositories**

- 描述:模板仓库地址
- 类型:必需
- 取值:远程 git 仓库地址,如:https://github.com/fbi-js/factory-web
- 例子:

```
$ fbi-next add https://github.com/fbi-js/factory-web
```

### 添加本地模板

```
$ cd local-factory // 切到本地要link的仓库目录下
$ fbi-next link
$ cd .. // 切出当前仓库目录
$ fbi-next ls // 查看仓库是否关联成功
```

### 解除本地模板链接

```
$ fbi-next unlink [factory]
```

**factory**

- 描述:模板名称
- 类型:可选
- 例子:

```
$ fbi unlink factory-web
# OR
$ cd factory-web // 先切换到需要unlink的仓库目录下
$ fbi-next unlink
```

### 移除模板

解除模板与 fbi 的链接并移除模板的本地文件

```
$ fbi-next remove <repositorie name>
```

**repositorie name**

- 描述:模板仓库地址
- 类型:必需
- 取值:factory 名字,如:factory-web
- 例子:

```
$ fbi-next remove factory-web
```

## 项目管理

### 初始化

```
$ fbi create <template> [-p]
```

**template**

- 描述:模板名称
- 类型:必需
- 取值:本地模板名称,如:web
- 例子:

```shell
$ fbi-next create web
```

**-p**

- 描述:package manage, 指定创建模板后安装相关依赖使用的包管理器,如: pnpm、yarn、npm,默认为 npm
- 类型:可选
- 例子:

```shell
$ fbi-next create web -p yarn
```

## 其他命令

```bash
$ fbi-next info // 查看context信息
$ fbi-next -v/--version
$ fbi-next -h/--help
```

## 模板开发

### 创建目录结构

按需求创建目录结构,推荐结构:

```
|-- fbi-project-name
|--|-- src
|--|--|-- commands // 模板运行的命令
|--|--|--|-- ...
|--|--|-- templates // 模板运行文件
|--|--|--|-- ...
|--|-- templates // 放模板文件夹
|--|--|-- ...
|--|-- .fbi.config.js // fbi配置文件,配置文档待补充
|--|-- package.json
```

### 任务开发

功能待开发

### 测试

开发及测试方式请参照 <https://github.com/fbi-js/dev-workspace>

### 提交到 git 仓库

如果想共享给别人,请把 git 仓库地址告诉对方
43 changes: 43 additions & 0 deletions docs/pages/4x/entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 入门

## 安装

FBI 需安装在全局,以便在任意目录可开始你的工作流。

```shell
$ npm i -g fbi@next
# OR
$ yarn global add fbi@next
# OR
$ pnpm i -g fbi@next
```

## 快速开始

### 一、基于远程仓库添加 fbi 模板

```
$ fbi-next add <remote repositories...>
```

> 查看更多官方模板:[官方模板列表](/pages/4x/more.md)
### 二、通过添加的模板创建项目

```bash
$ fbi-next create <tempalate name>
```

> 使用 `$ fbi-next ls` 可以查看已添加和关联的仓库及模板
### 三、运行任务

```shell
$ cd my-project

$ fbi-next serve
# OR
$ fbi-next s
```

> `$ fbi-next ls` 可查看当前目录可用的任务和模板
8 changes: 8 additions & 0 deletions docs/pages/4x/more.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 官方模板列表

| 名称 | 类型 | 说明 |
| ------------------------------------------------------ | :--: | --------------------------------------: |
| [factory-node](https://github.com/fbi-js/factory-node) | 项目 | Node 服务或 npm 模块 |
| [factory-web](https://github.com/fbi-js/factory-web) | 项目 | web 模板,包括 react\vue2\vue3 前端项目 |

> 更多模板敬请期嗲
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repository": "http://git.code.oa.com/fbi-templates/fbi-docs.git",
"author": "funnyli",
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
"dev": "vuepress dev docs",
"build": "vuepress build docs"
},
"license": "MIT",
"devDependencies": {
Expand Down

0 comments on commit af02955

Please sign in to comment.