1.0.0 • Published 3 years ago
mini-program-develop-tool v1.0.0
小程序开发工具
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
- electronjs.org/docs - all of Electron's documentation
- electronjs.org/community#boilerplates - sample starter apps created by the community
- electron/electron-quick-start - a very basic starter Electron app
- electron/simple-samples - small applications with ideas for taking them further
- electron/electron-api-demos - an Electron app that teaches you how to use Electron
- hokein/electron-sample-apps - small demo apps for the various Electron APIs
1.0.0
3 years ago