From 192b7f93364d0e76ff5c8c5929503edd3ce8fb38 Mon Sep 17 00:00:00 2001 From: jdpigeon Date: Sat, 27 Feb 2021 18:22:42 -0800 Subject: [PATCH] Define keys in build --- configs/webpack.config.main.prod.babel.js | 6 ++++++ keys.js | 6 ++---- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configs/webpack.config.main.prod.babel.js b/configs/webpack.config.main.prod.babel.js index c50767c3..776f6c28 100644 --- a/configs/webpack.config.main.prod.babel.js +++ b/configs/webpack.config.main.prod.babel.js @@ -55,12 +55,18 @@ export default merge(baseConfig, { * * NODE_ENV should be production so that modules do not perform certain * development checks + * + * The keys for emotiv SDK usage are piped into prod builds here via + * env variables set by secrets in Github Actions */ new webpack.EnvironmentPlugin({ NODE_ENV: 'production', DEBUG_PROD: false, START_MINIMIZED: false, E2E_BUILD: false, + CLIENT_ID: process.env.CLIENT_ID, + CLIENT_SECRET: process.env.CLIENT_SECRET, + LICENSE_ID: process.env.LICENSE_ID, }), ], diff --git a/keys.js b/keys.js index ba6834c4..90b96ba1 100644 --- a/keys.js +++ b/keys.js @@ -1,15 +1,13 @@ // These values must be filled with the appropriate Emotiv credentials to be able to use the Cortex SDK // We have our credentials stored in environement variables -const USERNAME = process.env.USERNAME; -const PASSWORD = process.env.PASSWORD; const CLIENT_ID = process.env.CLIENT_ID; // Created through Cortex Apps page on Emotiv.com const CLIENT_SECRET = process.env.CLIENT_SECRET; // Created through Cortex Apps page on Emotiv.com const LICENSE_ID = process.env.LICENSE_ID; // Visible on My Account page of Emotiv.com -const envVars = { USERNAME, PASSWORD, CLIENT_ID, CLIENT_SECRET, LICENSE_ID }; +const envVars = { CLIENT_ID, CLIENT_SECRET, LICENSE_ID }; Object.keys(envVars).forEach((k) => console.log(typeof envVars[k] === 'string') ); -module.exports = { USERNAME, PASSWORD, CLIENT_ID, CLIENT_SECRET, LICENSE_ID }; +module.exports = { CLIENT_ID, CLIENT_SECRET, LICENSE_ID }; diff --git a/package.json b/package.json index 226d4c2a..e89425a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "brainwaves", "productName": "BrainWaves", - "version": "0.14.2", + "version": "0.15.0-rc3", "description": "EEG Experiment Desktop Application", "scripts": { "build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",