seasun-cli
v2.0.7
Published
技术组前端项目脚手架
Downloads
45
Readme
Getting Started
npm install seasun-cli -g
Init Project
seasun-cli init xxx
Comparison
通过脚手架可以快速生成后台、h5 和小程序项目,原理上其实就是通过工具来分发获取模板工程,同时带有一定的自定义功能,比如选择包管理器、自动修改模板信息、选择构建版本等。 原先的开发流程是这样:
- 确认是什么类型项目
- 根据项目类型选择使用通用脚手架比如
umi-cli
创建后台项目taro-cli
创建小程序项目等 - 创建后开始整理代码 添加一些业务无关的工具代码比如
request
- 开始编写业务
使用本脚手架后:
- 脚手架创建项目(创建中直接确认项目类型)
- 开始编写业务
很明显主要是省去了脚手架选型、业务无关的一些编码工作
尤其是减少了很多hack
的代码 比如手游内嵌的项目 为了实现内容区滚动 对pro-layout
的样式做了很多覆盖 结果pro-layout
的新版本的样式直接写上了not-override
如果做升级就会直接报废掉了
Season-Cli
本质上还是基于对应的cli
来的项目 所以即使模板工程不满足需求 仍然可以直接查询对应cli
的文档来做自己的更改
Workflow
后台:
seasun-cli init xx
- 选择后台项目 选择构建版本
- 初始化完成打开项目
config/defaultSettings
修改对应静态设置(项目名称、logo 等)(如果有样式修改需求就打开appDefaultRender.tsx
修改一些默认渲染的函数或者components/framework
修改默认的一些组件) - 打开
src/pages
新建页面config/router/modules
新建路由模块 - 请求工具等基础工具已封装(未做权限管理 因为不同项目的权限结构不太一样 不好统一 可自行查询
umi
的access
添加) 到这儿基本可以开始编码了