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>
This commit is contained in:
Akos Kitta 2020-01-29 11:42:49 +01:00
parent 403fdbfdc0
commit d53d474243
5 changed files with 19 additions and 1 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ downloads/
build/
!electron/build/
src-gen/
*-app/*webpack.config.js
*webpack.config.js
.DS_Store
/workspace/static
.DS_Store

View File

@ -28,6 +28,14 @@
"// Notes:": [
"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"
],
"theia": {
"target": "electron",
"frontend": {
"config": {
"disallowReloadKeybinding": true
}
}
},
"build": {
"productName": "Arduino Pro IDE",
"appId": "arduino.ProIDE",

View File

@ -8,6 +8,7 @@
shell.env.THEIA_ELECTRON_SKIP_REPLACE_FFMPEG = '1'; // Do not run the ffmpeg validation for the packager.
shell.env.NODE_OPTIONS = '--max_old_space_size=4096'; // Increase heap size for the CI
const utils = require('./utils');
const merge = require('deepmerge');
const { version, release } = utils.versionInfo();
echo(`📦 Building ${release ? 'release ' : ''}version '${version}'...`);
@ -81,9 +82,12 @@
template.build.files = [...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`)];
pkg.dependencies = { ...pkg.dependencies, ...template.dependencies };
pkg.devDependencies = { ...pkg.devDependencies, ...template.devDependencies };
// 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)
const theia = merge((pkg.theia || {}), (template.theia || {}));
fs.writeFileSync(path('..', 'build', 'package.json'), JSON.stringify({
...pkg,
...template,
theia,
dependencies: pkg.dependencies,
devDependencies: pkg.devDependencies
}, null, 2));

View File

@ -12,6 +12,7 @@
"author": "Arduino SA",
"license": "MIT",
"dependencies": {
"deepmerge": "4.2.2",
"depcheck": "^0.7.1",
"shelljs": "^0.8.3",
"yargs": "^12.0.5"

View File

@ -200,6 +200,11 @@ decamelize@^1.2.0:
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
deepmerge@4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
depcheck@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/depcheck/-/depcheck-0.7.1.tgz#d4ef8511620fc5c783dafe27887cfdab533b1215"