1.1.8 • Published 6 months ago

@busm/cli v1.1.8

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

@busm/cli

欢迎使用@busm/cli快速生成快应用业务单元

安装

npm install @busm/cli -g 

用法

使用前 请配置业务模块的仓库地址

配置仓库

使用busm config命令

busm config -u <url>

参考:

$ busm config -u xxx.com
{ branch: 'g', folder: './components', url: 'xxx.com' }

busm config相关指令参数:

$ busm config --help
Usage: busm config [options]

修改配置文件

Options:
  -u, --url <string>     仓库地址
  -b, --branch <string>  分支
  -f, --folder <string>  文件目录
  -l, --list             文件内容
  -h, --help             display help for command

创建菜单内容

使用busm menu命令

$ busm menu -h
Usage: busm menu [options] [name...]

创建业务菜单

Options:
  -f, --fileUrl <string>  文件地址
  -h, --help              display help for command

例如将某个业务模块输出到某个菜单中

$ busm menu caipu -f ./src/pages/home/tab-1.ux

模块caipu暂未下载

开始下载模块caipu
创建模块: caipu

 [ 'caipu' ]

1. 收集manifest和pkg配置
2. 复制模块文件夹到目标文件夹
3. 修改manifest.json
4. 修改package.json
5. 生成注入配置
6. 注入配置到app.ux中
7. 下载依赖

将多个业务模块输出到某个菜单中, 以菜单的形式

$ busm menu caipu bizhi -f ./src/pages/home/tab-1.ux


开始下载模块bizhi
创建模块: bizhi

 [ 'bizhi' ]

1. 收集manifest和pkg配置
2. 复制模块文件夹到目标文件夹
3. 修改manifest.json
4. 修改package.json
5. 生成注入配置
6. 注入配置到app.ux中
7. 下载依赖

创建业务模块

使用 busm create 命令

busm create <bussiness-module>

<bussiness-module>: 业务组件文件夹名

创建业务模块主要实现下面几个过程:

  • 输出业务模块静态文件到src目录
  • 修改manifest.jsonpackage.json文件

    • manifest: 修改路由配置

    • package: 增加postinstall指令和绑定workspaces

  • 输出注入文件injectModuleConfig.js和git脚本文件removeNodeModules.js

    • injectModuleConfig: 将业务单元相关的全局状态及私有插件注入到主体项目的全局状态中

    • removeNodeModules: 删除冲突的依赖

  • 修改app.ux

    • 将注入配置合并到 export default 导出体中
  • 下载业务单元依赖

  • 删除冲突依赖

更新业务单元文件

使用 busm update

删除业务单元

删除主体项目引入的业务单元资源

使用 busm delete -a

配置文件

根目录使用 busm.config.js 配置多业务单元到相关菜单

module.exports = {
    menu: {
        template: {
            caipu: {
                icon: '',
                name: ''
            }
        }
    }
}
1.1.8

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago