[MM-42024] Enable React Developer Tools for nightly builds (#2018)

This commit is contained in:
Devin Binnie
2022-03-16 11:29:26 -04:00
committed by GitHub
parent 14197d1707
commit f79c445920
4 changed files with 8 additions and 3 deletions

View File

@@ -82,7 +82,8 @@
], ],
"globals": { "globals": {
"__HASH_VERSION__": "5.0.0", "__HASH_VERSION__": "5.0.0",
"__CAN_UPGRADE__": false "__CAN_UPGRADE__": false,
"__IS_NIGHTLY_BUILD__": false
}, },
"setupFiles": [ "setupFiles": [
"./src/jestSetup.js" "./src/jestSetup.js"

View File

@@ -302,7 +302,10 @@ function initializeAfterAppReady() {
AutoLauncher.upgradeAutoLaunch(); AutoLauncher.upgradeAutoLaunch();
} }
if (global.isDev) { // eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (global.isDev || __IS_NIGHTLY_BUILD__) {
installExtension(REACT_DEVELOPER_TOOLS). installExtension(REACT_DEVELOPER_TOOLS).
then((name) => log.info(`Added Extension: ${name}`)). then((name) => log.info(`Added Extension: ${name}`)).
catch((err) => log.error('An error occurred: ', err)); catch((err) => log.error('An error occurred: ', err));

View File

@@ -6,7 +6,7 @@
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */
import {contextBridge, ipcRenderer, webFrame, desktopCapturer} from 'electron'; import {contextBridge, ipcRenderer, webFrame} from 'electron';
// I've filed an issue in electron-log https://github.com/megahertz/electron-log/issues/267 // I've filed an issue in electron-log https://github.com/megahertz/electron-log/issues/267
// we'll be able to use it again if there is a workaround for the 'os' import // we'll be able to use it again if there is a workaround for the 'os' import

View File

@@ -19,6 +19,7 @@ const isRelease = process.env.CIRCLE_BRANCH && process.env.CIRCLE_BRANCH.startsW
const codeDefinitions = { const codeDefinitions = {
__HASH_VERSION__: !isRelease && JSON.stringify(VERSION), __HASH_VERSION__: !isRelease && JSON.stringify(VERSION),
__CAN_UPGRADE__: JSON.stringify(true), // we should set this to false when working on a store version. Hardcoding for now. __CAN_UPGRADE__: JSON.stringify(true), // we should set this to false when working on a store version. Hardcoding for now.
__IS_NIGHTLY_BUILD__: JSON.stringify(process.env.CIRCLE_BRANCH === 'nightly'),
}; };
codeDefinitions['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV); codeDefinitions['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV);