-
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
funnyli
committed
Sep 10, 2020
1 parent
b870b40
commit af02955
Showing
13 changed files
with
239 additions
and
7 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 +1,10 @@ | ||
# 4.x 文档 | ||
|
||
github: <https://github.com/fbi-js/fbi> | ||
|
||
### Node: | ||
|
||
- nodejs >= 12.x | ||
- npm >= 6.x | ||
|
||
> 为了避免与 3.x 版本的冲突,4.x 版本命令修改为 fbi-next |
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,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 仓库地址告诉对方 |
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,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` 可查看当前目录可用的任务和模板 |
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,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 前端项目 | | ||
|
||
> 更多模板敬请期嗲 |
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