[update] electron 14 にアップデート・ビルトイン remote 廃止に対応

This commit is contained in:
ocogeclub 2021-09-03 23:12:32 +09:00
parent 1be8d97e28
commit 28bdb59693
7 changed files with 602 additions and 745 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ bin/
build/
*.zip
push.sh
n

View File

@ -1,4 +1,5 @@
const { app, BrowserWindow, Menu, session } = require('electron');
require('@electron/remote/main').initialize();
/** Force disable security warning */
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';

View File

@ -3,7 +3,7 @@
# install node.js (=electron node version) via n (https://github.com/tj/n)
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
sudo bash n 14.16.0
sudo bash n 14.17.0
# install python code formatter
python3 -m pip install black
# install desktop entry

1330
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,11 @@
},
"homepage": "https://github.com/ocogeclub/ocoge#readme",
"devDependencies": {
"electron": "^13.2.2",
"electron-rebuild": "^2.3.5"
"electron": "^14.0.0",
"electron-rebuild": "^3.2.3"
},
"dependencies": {
"@electron/remote": "^1.2.1",
"axios": "^0.21.1",
"nodemailer": "^6.6.0",
"ocoge_lgpio": "file:local_modules/ocoge_lgpio"

View File

@ -10,12 +10,12 @@ const mascotDefPath = '/home/pi/Applications/ocoge/img/';
// Require
const fs = require('fs');
const path = require("path");
const mainWin = require('electron').remote.getCurrentWindow();
const dialog = require('electron').remote.dialog;
const mainWin = require('@electron/remote').getCurrentWindow();
const dialog = require('@electron/remote').dialog;
const shell = require('electron').shell;
const clipboard = require('electron').clipboard;
var saveFilepath = null;
var wsChanged = false;
var mascotFilePath = mascotDefPath + 'cogechee.png';

View File

@ -619,7 +619,7 @@ Blockly.Blocks['ugj_serial_read'] = {
};
Blockly.JavaScript['ugj_serial_read'] = function (block) {
var value_count = Blockly.JavaScript.valueToCode(block, 'count', Blockly.JavaScript.ORDER_ATOMIC);
var code = `pi.serial_read(ser_hand, ${value_count});\n`;
var code = `pi.serial_read(ser_hand, ${value_count})\n`;
return [code, Blockly.JavaScript.ORDER_NONE];
};
Blockly.Python['ugj_serial_read'] = function (block) {