GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - New-Future/weappdevtools-cli: 微信小程序开发者工具命令行小秘书

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
upload-example.png
upload-example.png
 
 

Repository files navigation

weappdevtools-cli

NPM version changelog license

微信小程序开发者工具命令行小秘书

Why

通过工具规范化微信小程序上传代码时需要人为填写的 版本号 和 备注 upload-example

  • 生成的 版本号 规则
    • 尝试读取微信小程序项目根目录下的 package.json 文件中的版本号
    • 尝试读取微信小程序项目 GIT 最后提交的日志的 hash 值
    • 组合: ${pkg.version}.${hash}.${env}
    • 例如: 1.0.0.7004c7b.prod
  • 生成的 备注 规则
    • 读取命令行中传入的环境参数: --env
    • 读取命令行中传入的备注参数: --desc
    • 组合: env: ${env} ${desc}
    • 例如: env: test 补充信息

Installation

npm install weappdevtools-cli -g

Example usage

upload

cd /path/to/weapp-project-root-dir
weappdevtools-cli upload --env=test

or

weappdevtools-cli upload --projectRoot=/path/to/weapp-project-root-dir --env=test
√ Get last commit log: {"hash":"7004c7bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","date":"2018-09-28 13:42:26 +0800","message":"","author_name":"","author_email":""}
√ Find wechatdevtools process: {"name":"wechatdevtools.exe","pid":26096,"path":"E:\\Program Files\\Tencent\\微信web开发者工具\\wechatdevtools.exe"}
--------------------------
Use wechatdevtools cli: E:\Program Files\Tencent\微信web开发者工具\cli.bat
--------------------------
--------------------------
> cli.bat -u 1.0.0.7004c7b@E:\a\b\c\fe-weapp-xxx --upload-desc "env: test" --upload-info-output "E:\a\b\c\fe-weapp-xxx\upload-info.json"
--------------------------
Initializing...

idePortFile: C:\Users\xx\AppData\Local\微信web开发者工具\User Data\Default\.ide

IDE server has started, listening on http://127.0.0.1:60233
initialization finished
uploading project...
upload success

--------------------------
┌─────────────────────┬───────────────────────┬────────────────────┬────────────┐
│ 时间                │ 项目                   │ 版本号             │ 项目备注   │
├─────────────────────┼───────────────────────┼────────────────────┼────────────┤
│ 2018-12-26 11:45:26 │ E:\a\b\c\fe-weapp-xxx │ 1.0.0.7004c7b.test │ env: test  │
└─────────────────────┴───────────────────────┴────────────────────┴────────────┘
--------------------------
本次上传的额外信息: {"size":{"total":408.67,"packages":[{"name":"__FULL__","size":408.67}]}}

preview

weappdevtools-cli preview --projectRoot=/path/to/weapp-project-root-dir
√ Find wechatdevtools process: {"name":"wechatdevtools.exe","pid":26096,"path":"E:\\Program Files\\Tencent\\微信web开发者工具\\wechatdevtools.exe"}
--------------------------
Use wechatdevtools cli: E:\Program Files\Tencent\微信web开发者工具\cli.bat
--------------------------
--------------------------
> cli.bat -p E:\a\b\c\fe-weapp-xxx --preview-info-output "E:\a\b\c\fe-weapp-xxx\preview-info.json"
--------------------------
Initializing...

idePortFile: C:\Users\xx\AppData\Local\微信web开发者工具\User Data\Default\.ide

IDE server has started, listening on http://127.0.0.1:60233

initialization finished
preparing preview...
[qrcode]
preview success

--------------------------
本次预览的额外信息: {"size":{"total":408.67,"packages":[{"name":"__FULL__","size":408.67}]}}

Notice

  • 需要将目标项目从"微信web开发者工具"中删除掉一次(执行命令后会自动再加上该项目)
  • 如果你的项目的开发模式非微信小程序原生的开发模式, 例如使用了 min 或者其他(wepy/mpvue/taro/...)
    • 需要给 project.config.json 添加 miniprogramRoot 参数

About

微信小程序开发者工具命令行小秘书

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.