Skip to content

Commit d53d474

Browse files
author
Akos Kitta
committed
Disabled the window reload in the bundled app.
This change is a NOOP for the electron application started in dev mode. Closes arduino/arduino-pro-ide#187 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent 403fdbf commit d53d474

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ downloads/
66
build/
77
!electron/build/
88
src-gen/
9-
*-app/*webpack.config.js
9+
*webpack.config.js
1010
.DS_Store
1111
/workspace/static
1212
.DS_Store

electron/build/template-package.json

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
"// Notes:": [
2929
"The resolution for `fs-extra` was required due to this: https://spectrum.chat/theia/general/our-theia-electron-builder-app-no-longer-starts~f5cf09a0-6d88-448b-8818-24ad0ec2ee7c"
3030
],
31+
"theia": {
32+
"target": "electron",
33+
"frontend": {
34+
"config": {
35+
"disallowReloadKeybinding": true
36+
}
37+
}
38+
},
3139
"build": {
3240
"productName": "Arduino Pro IDE",
3341
"appId": "arduino.ProIDE",

electron/packager/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
shell.env.THEIA_ELECTRON_SKIP_REPLACE_FFMPEG = '1'; // Do not run the ffmpeg validation for the packager.
99
shell.env.NODE_OPTIONS = '--max_old_space_size=4096'; // Increase heap size for the CI
1010
const utils = require('./utils');
11+
const merge = require('deepmerge');
1112
const { version, release } = utils.versionInfo();
1213

1314
echo(`📦 Building ${release ? 'release ' : ''}version '${version}'...`);
@@ -81,9 +82,12 @@
8182
template.build.files = [...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`)];
8283
pkg.dependencies = { ...pkg.dependencies, ...template.dependencies };
8384
pkg.devDependencies = { ...pkg.devDependencies, ...template.devDependencies };
85+
// Deep-merging the Theia application configuration. We enable the electron window reload in dev mode but not for the final product. (arduino/arduino-pro-ide#187)
86+
const theia = merge((pkg.theia || {}), (template.theia || {}));
8487
fs.writeFileSync(path('..', 'build', 'package.json'), JSON.stringify({
8588
...pkg,
8689
...template,
90+
theia,
8791
dependencies: pkg.dependencies,
8892
devDependencies: pkg.devDependencies
8993
}, null, 2));

electron/packager/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"author": "Arduino SA",
1313
"license": "MIT",
1414
"dependencies": {
15+
"deepmerge": "4.2.2",
1516
"depcheck": "^0.7.1",
1617
"shelljs": "^0.8.3",
1718
"yargs": "^12.0.5"

electron/packager/yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ decamelize@^1.2.0:
200200
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
201201
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
202202

203+
deepmerge@4.2.2:
204+
version "4.2.2"
205+
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
206+
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
207+
203208
depcheck@^0.7.1:
204209
version "0.7.1"
205210
resolved "https://registry.yarnpkg.com/depcheck/-/depcheck-0.7.1.tgz#d4ef8511620fc5c783dafe27887cfdab533b1215"

0 commit comments

Comments
 (0)