Files
flipper/scripts/eslint.sh
Daniel Büchele 13f7444013 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
2019-02-21 02:46:12 -08:00

31 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
# This script is used by `arc lint`.
THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$THIS_DIR" && hg root)
cd "$ROOT_DIR/xplat/sonar"
# Sonar's Electron dependency downloads itself via a post-install script.
# When running in Sandcastle or devservers, the module install will fail
# because we can't reach the internet. Setting the fwdproxy is dangerous, so
# the next best thing is to install the modules with `--ignore-scripts`.
# However, we can't run `install-node-modules.sh` like this all of the time.
# `install-node-modules.sh` uses its args as keys for the "yarn watchman check"
# cache. So if we run `install-node-modules.sh` outside of this script without
# the flag, but then this script runs it with the flag, we're going to
# invalidate the cache.
# 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 --ignore-engines
fi
exec \
"$ROOT_DIR/xplat/third-party/node/bin/node" \
"$ROOT_DIR/xplat/sonar/node_modules/.bin/eslint" \
"$@"