1.0.0 • Published 3 years ago

mini-program-develop-tool v1.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago

小程序开发工具

Proposal plugins

  • @babel/plugin-proposal-class-static-block
  • @babel/plugin-proposal-decorators
  • @babel/plugin-proposal-do-expressions
  • @babel/plugin-proposal-export-default-from
  • @babel/plugin-proposal-export-namespace-from
  • @babel/plugin-proposal-function-bind
  • @babel/plugin-proposal-function-sent
  • @babel/plugin-proposal-partial-application
  • @babel/plugin-proposal-pipeline-operator, { "proposal": "minimal" }
  • @babel/plugin-proposal-throw-expressions
  • @babel/plugin-proposal-private-property-in-object
  • @babel/plugin-proposal-record-and-tuple

注意:其它所有分支请不要 merge 或者 pull trunk 分支代码,使用 git pull && git rebase trunk 来同步最新的 trunk 分支的代码

合并最新的 trunk 分支代码

git stash
git fetch origin
git rebase origin/trunk
git stash apply

需调整清除文件缓存 api, getRealPath 接口

主要模块:

  • main 其中 server 为 electron 后台,client 为 renderer 层代码
  • editor 编辑器模块
  • wechat 小程序 http 服务后台代码,包含监控功能
  • release 最终打包使用的代码

主要依赖:

https://cdn.v2ex.com/assets/sidebar/openinstall_20190910.gif

安装 & 运行

" 安装所有依赖然后开发版本的 js
npm install
npm run start

安装 electron 可能需要些时间

编辑 typescript 或 javascript 文件后需要编译文件,statics 模块使用 webpack 构建,编译时需要在目录下执行

./node_modules/.bin/webpack

其它模块都使用 esbuild 编译,需要在目录下执行:

node esbuild.js

编译当前目录下的 ts/js 文件,编译后文件保存在 release/build 目录下。

使用 -w 支持 watch build。

npm 脚本

  • build 生成生产环境 javascript 打包文件
  • bundle 使用 electron-builder 打包安装文件
  • publish 发布新版本到 git 和服务器:http://alcgdevtools.chigua.cn/, 支持正式版和测试版
  • start

发布新版本流程

  • npm run build 执行生产环境 js 编译
  • 修改 release/package.json 中版本号
  • npm run bundle 打包
  • npm run publish 发布

特别提示

  • 必须使用吃瓜帐号登录才能正常使用 api 相关功能
  • 小程序 project.config.json 中必须添加相应 CGCLIENTID 才能正常使用 api 相关功能
  • 预览功能暂时仅支持测试版服务器
  • 上传功能编辑器做了限制,现在必须是小程序创建者才能上传新版
  • IDE 不监听 node_modules 目录下文件变化
  • 编辑器和 Chrome Devtools 插件增强暂时还没加

编译可执行文件

npm run build
npm run bundle

该命令生成所需 javascript 文件的 production 打包文件,然后使用 electron-builder 将 release 目录下文件打包生成 exe 和 dmg 文件到 release/dist 目录下。

Resources for Learning Electron