Code Monkey home page Code Monkey logo

mp-cli's Introduction

mp-cli

基于微信小程序 miniprogram-ci 开发的上传小程序的自动化工具

miniprogram-ci 官方文档

密钥及 IP 白名单配置 参考文档。一般来说自己使用,可以关闭 IP 白名单,因为 IP 地址可能变。

支持的功能

支持的功能

显示帮助信息

显示帮助信息

上传效果

上传效果

预览效果就是在控制台显示二维码。

# 克隆我写的 mp-cli 工具
git clone https://github.com/lxchuan12/mp-cli.git
cd mp-cli
yarn install
# 没有自己的小程序可以克隆腾讯开源的电商小程序
git clone https://github.com/lxchuan12/tdesign-miniprogram-starter-retail.git
# 切到分支 feature/release-it
git checkout feature/release-it

可以克隆我的项目,到一个目录中,比如 projects 中。

再克隆我的另外一个小程序(腾讯开源的电商小程序),到同一个目录中。比如 projects 中。

按照微信小程序文档配置小程序密钥等,这样就能上传和预览了。如果没有微信小程序,可以自行免费开通个人的微信小程序

功能列表

# 查看帮助
node src/index.js --help
node src/index.js -h
# 查看版本号
node src/index.js -v
node src/index.js --version
  • 支持指定参数 如 robot 默认是 1,命令:yarn run upload --robot 2
  • 支持上传 yarn run upload
  • 支持预览 yarn run preview
  • 支持空跑,不执行 yarn run upload --dry
  • 支持指定 git commit hash 和作者
  • 支持单选多个小程序 yarn run upload --useSelect
  • 支持选择多个批量上传 yarn run upload --useMultiSelect
  • 支持自定义的 projectOptionsuploadOptionspreviewOptions 配置,参考 wx.config.js 配置
参数可以相互结合。
--robot 2 [ 可选 1-30 ]
--dry 空跑
--useSelect 单选
--useMultiSelect 多选批量上传

可自行开发

git clone https://github.com/lxchuan12/mp-cli.git
cd mp-cli
# npm i -g yarn
yarn install
# 建议使用 yarn install

支持 wx.config.js 配置(推荐)

在当前的目录下配置wx.config.js,这个优先于 .env

参考当前项目中的 wx.config.js

.env 默认配置

参考当前项目中的 .env

configPath json 配置

参考 当前项目中的 config/example.json

TODOs

  • 使用 ES Module 开发
  • 引入 TS
  • 加入测试
  • 支持可视化操作

写文章

文章已完成README-2,也已发布在掘金。

听说你还在用开发者工具上传小程序,我从尤雨溪那学会了基于 miniprogram-ci 开发脚手架工具,提效摸鱼

注意:文章是基于 tag v0.7.0 撰写。后续 mp-cli 会持续更新,文章可能不会更新。

mp-cli's People

Contributors

ruochuan12 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.