diff --git a/README.md b/README.md index 2e7b1eed6f71ef1aa2b84d09aa3c10d02b64db5d..aa0b8aecb7b4fa6d8f9f60b66b7703b43e0cb378 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ yarn run ele:dev # Ctrl + c后输入y即可退出命令行启动预览环境 ``` +## 关于`electron`等基础API的引用 + +在TypeScript中可以使用[方案三](https://blog.csdn.net/qq_38333496/article/details/102474532?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task),直接在所需要的地方声明调用api + ## 文档 * [更新日志](./doc/UPDATE.md) diff --git a/doc/UPDATE.md b/doc/UPDATE.md index 286290259d8cb2ec7411fb96a501604e9a8204c4..1333a8e219bb6579e58b856539f9d0194c5e9234 100644 --- a/doc/UPDATE.md +++ b/doc/UPDATE.md @@ -1,5 +1,6 @@ # 更新日志 +* 2020/04/05更新: `electron --> 8.2.0`, 版本信息请参考[releases](https://www.electronjs.org/releases/stable) * 2020/03/17更新: 引入`electron-updater`配置自动更新,新增`dev-app-update.yml`对于开发环境获取自动更新配置,删除`package.json.bak`模板文件,请参考`package.json`修改 * 2020/03/16更新: 新增`.yarnclean`文件对依赖不必要的代码进行清理,缩小打包文件体积 * 2020/03/13更新: 引入`electron-builder`进行项目打包并且为打包配置了环境`windows only`,示例文件为`package.json`,模板文件为`package.json.bak`,并且修改了模板工程结构`main.js --> public/electron.js`(参考[#2404](https://github.com/electron-userland/electron-builder/issues/2404)),下面会详解打包原理和debug diff --git a/package.json b/package.json index 2b328e0451dc8b4ffabe58d4b4ff422d74dfd008..ada4755ea1e7ac81ceb24c7c947dff3cb8be153f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron-react-antd-antv-ts-cli", - "version": "0.1.4", + "version": "0.2.0", "author": { "name": "Herbert He", "email": "Herbert.He0229@gmail.com" @@ -123,7 +123,7 @@ "concurrently": "^5.1.0", "cross-env": "^7.0.0", "devtron": "^1.4.0", - "electron": "8.1.1", + "electron": "8.2.0", "electron-builder": "^22.4.1", "nodemon": "^2.0.2", "wait-on": "^4.0.0" diff --git a/public/electron.js b/public/electron.js index 1468f66353171b33175acca98ede1a7547735698..c629cf97d1f38b66e0855d49d5b19bc101db5742 100644 --- a/public/electron.js +++ b/public/electron.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow, ipcMain } = require("electron") +const { app, BrowserWindow } = require("electron") const path = require('path') const isDev = require("electron-is-dev") // 自动更新 @@ -18,7 +18,7 @@ let mainWindow // let webContents function createWindow() { - // require("devtron").install() + require("devtron").install() mainWindow = new BrowserWindow({ width: 800, height: 600, diff --git a/yarn.lock b/yarn.lock index af5108ca69e723a55196c75839f95a66e3470c7b..d4584c6ac15bcc91a682075432c78a7a5ec98ed7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4596,10 +4596,10 @@ electron-updater@^4.2.5: pako "^1.0.11" semver "^7.1.3" -electron@8.1.1: - version "8.1.1" - resolved "https://registry.npm.taobao.org/electron/download/electron-8.1.1.tgz?cache=0&sync_timestamp=1583805754952&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron%2Fdownload%2Felectron-8.1.1.tgz#737a5af03c7b4af60b49dff7bfe1203fcbd5bf89" - integrity sha1-c3pa8Dx7SvYLSd/3v+EgP8vVv4k= +electron@8.2.0: + version "8.2.0" + resolved "https://registry.npm.taobao.org/electron/download/electron-8.2.0.tgz#f3e3de23a6178b5ad7baa70f4814d6332a3212c2" + integrity sha1-8+PeI6YXi1rXuqcPSBTWMyoyEsI= dependencies: "@electron/get" "^1.0.1" "@types/node" "^12.0.12"