快速开始 —— 使用 steamerjs 安装与更新脚手架

安装 steamerjs 和脚手架管理插件

  1. npm i -g steamerjs
  2. // v2.0 之后已经内置,可不额外安装
  3. npm i -g steamer-plugin-kit

安装你喜欢的脚手架

  1. steamer kit --add https://github.com/steamerjs/steamer-react.git

本地部署脚手架

  1. steamer kit
  2. // 然后选择你喜欢的脚手架
  3. ? Which starterkit do you wanna install: (Use arrow keys)
  4. steamer-react - alloyteam react starterkit
  5. steamer-vue - alloyteam vue starterkit
  6. steamer-simple - alloyteam frameworkless starterkit
  7. steamer-react-component - react component development starter kit
  8. steamer-vue-component - vue component development starter kit
  9. steamer-simple-component - frameless component development starter kit
  10. steamer-logic-component - logic component development starterkit
  11. steamer-example - steamer starter kit example

脚手架自身命令

  1. // 安装依赖
  2. npm i
  3. // 开发
  4. npm start npm run dev
  5. // 打开链接
  6. localhost:9000
  7. // 代码规范扫描
  8. npm lint
  9. // 生产代码生成
  10. npm run dist npm run pub

基于模板生成页面

  1. steamer kit --template
  2. // 然后选择你想选的模板,进行页面生成
  3. ? type the template source folder: ./tools/template
  4. ? type your template destination folder: ./src/page
  5. ? type your npm command(npm|tnpm|cnpm etc): npm
  6. which template do you like: (Use arrow keys)
  7. index
  8. list
  9. preact-list
  10. spa
  11. ? type in your page name: detail

更新脚手架

  1. // 更新脚手架
  2. steamer kit --update --global
  3. // 更新你的项目构建
  4. cd project // 进入项目目录
  5. steamer kit --update

更新完毕,为将 toolspackage.json README.md 做备份,其它内容会进行覆盖。