electron update

Summary:
Started with upgrading electron from 3.0.0 to 4.0.5. This required a bunch of subsequent updates:
* upgrading `electron-builder` to latest version, because the old version couldn't build electron 4 apps.
  * `appDir` is deprecated in builder config, `projectDir` is used instead, which we already had set, so its fine to just remove this ([see GitHub commit](a5e457163e)).
* upgrading `jest-runner/electron` because the old version couldn't run electron 4 tests.
  * upgrading our custom dependency resolution to use electron 4.0.5, because the test runner still resolves to 2.0.8 ([see GitHub issue](https://github.com/facebook-atom/jest-electron-runner/issues/31)).
* updating `sandcastle.sh` to use the new cache files from D14131344.
* removing `package-lock.json` as is was causing warnings. We use `yarn` and `yarn.lock` anyways. This file must have been committed by accident.
* updating our check to only run one version of Flipper at a time to use the new electron API `app.requestSingleInstanceLock` as the old one was removed in electron 4.
* updating the snapshot test that checks App rendering, which changed a little due to the electron upgrade.
* upgrading flow-type definitions to `electron-v4.0.5.js` generated by [electron-flowtype-definitions](https://github.com/danielbuechele/electron-flowtype-definitions).

**PS: Best new feature in Electron 4: Copy&paste working in dev tools**

Reviewed By: jknoxville

Differential Revision: D14131360

fbshipit-source-id: d7ed9643875629a1fa1860bb61b11dd0c64112ab
This commit is contained in:
Daniel Büchele
2019-02-21 02:43:37 -08:00
committed by Facebook Github Bot
parent 0a59dc2918
commit 13f7444013
9 changed files with 1279 additions and 11195 deletions

View File

@@ -78,7 +78,6 @@ function buildDist(buildFolder) {
return builder
.build({
appDir: buildFolder,
publish: 'never',
config: {
appId: `com.facebook.sonar`,

View File

@@ -21,7 +21,7 @@ cd "$ROOT_DIR/xplat/sonar"
# If `node_modules` exists, we can't tell if it was created with
# `--ignore-scripts` or not, so we play it safe, and avoid touching it.
if [[ ! -d "node_modules" ]]; then
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts --ignore-engines
fi
exec \

View File

@@ -21,7 +21,7 @@ cd "$ROOT_DIR/xplat/sonar"
# If `node_modules` exists, we can't tell if it was created with
# `--ignore-scripts` or not, so we play it safe, and avoid touching it.
if [[ ! -d "node_modules" ]]; then
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts --ignore-engines
fi
# Prefer the internal version of Flow, which should be in the PATH - but