Skip to content

Commit a6e646d

Browse files
authored
Merge pull request #3 from oslabs-beta/travis-BE
Travis - small changes
2 parents 7ad070f + de2307d commit a6e646d

File tree

3 files changed

+28
-39
lines changed

3 files changed

+28
-39
lines changed

main.js

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// https://github.com/electron/electron/issues/10257
22
// Code fix to support NODE_EXTRA_CA_CERTS env. There is currently no other fixes to the NODE_TLS_REJECT_UNAUTHORIZED at the moment.
33

4-
(function(){
5-
if(!process.env.NODE_EXTRA_CA_CERTS) return;
6-
try{
7-
const extraca = require("fs").readFileSync(process.env.NODE_EXTRA_CA_CERTS);
8-
}catch(e){
9-
return;
10-
}
11-
12-
const NativeSecureContext = process.binding('crypto').SecureContext;
13-
const oldaddRootCerts = NativeSecureContext.prototype.addRootCerts;
14-
NativeSecureContext.prototype.addRootCerts = function(){
15-
const ret = oldaddRootCerts.apply(this, ...args);
16-
this.addCACert(extraca);
17-
return ret;
18-
};
4+
(function () {
5+
if (!process.env.NODE_EXTRA_CA_CERTS) return;
6+
try {
7+
const extraca = require('fs').readFileSync(process.env.NODE_EXTRA_CA_CERTS);
8+
} catch (e) {
9+
return;
10+
}
11+
12+
const NativeSecureContext = process.binding('crypto').SecureContext;
13+
const oldaddRootCerts = NativeSecureContext.prototype.addRootCerts;
14+
NativeSecureContext.prototype.addRootCerts = function () {
15+
const ret = oldaddRootCerts.apply(this, ...args);
16+
this.addCACert(extraca);
17+
return ret;
18+
};
1919
})();
2020

2121
// Allow self-signing HTTPS over TLS
@@ -85,7 +85,6 @@ if (process.argv.includes('--dev')) {
8585
isDev = true;
8686
}
8787

88-
8988
/** ***********************
9089
******* MODE DISPLAY ****
9190
************************ */
@@ -144,7 +143,7 @@ function createWindow() {
144143
});
145144

146145
// Dev mode title
147-
mainWindow.setTitle("Swell (devMode)")
146+
mainWindow.setTitle('Swell (devMode)');
148147

149148
// If we are in developer mode Add React & Redux DevTools to Electron App
150149
installExtension(REACT_DEVELOPER_TOOLS)
@@ -161,7 +160,6 @@ function createWindow() {
161160
pathname: path.join(__dirname, 'dist', 'index.html'),
162161
slashes: true,
163162
});
164-
165163
}
166164

167165
// our new app window will load content depending on the boolean value of the dev variable
@@ -226,10 +224,9 @@ const sendStatusToWindow = (text) => {
226224
};
227225

228226
ipcMain.on('login-via-github', async () => {
229-
const url = `http://github.com/login/oauth/authorize?scope=repo&redirect_uri=http://localhost:3000/signup/github/callback/&client_id=6e9d37a09ab8bda68d50` // ${process.env.GITHUB_CLIENT_ID};
227+
const url = `http://github.com/login/oauth/authorize?scope=repo&redirect_uri=http://localhost:3000/signup/github/callback/&client_id=6e9d37a09ab8bda68d50`; // ${process.env.GITHUB_CLIENT_ID};
230228
await shell.openExternal(url, { activate: true });
231-
232-
})
229+
});
233230

234231
ipcMain.on('check-for-update', () => {
235232
// listens to ipcRenderer in UpdatePopUpContainer.jsx
@@ -324,8 +321,8 @@ ipcMain.on('import-from-github', async (event, args) => {
324321
// requiring typescript type Workspace makes sanitation uncessesary
325322
const ids = {};
326323
let index = 0;
327-
const newCollectionArr = []
328-
for(let collection of args) {
324+
const newCollectionArr = [];
325+
for (let collection of args) {
329326
// console.log('main.js workspace\n', workspace)
330327
if (ids[collection.id]) {
331328
const result = await popOverwrite(collection);
@@ -336,9 +333,8 @@ ipcMain.on('import-from-github', async (event, args) => {
336333
}
337334
ids[collection.id] = index;
338335
index++;
339-
newCollectionArr.push(collection)
340-
341-
};
336+
newCollectionArr.push(collection);
337+
}
342338
// send full array of workspaces to chromium for state update
343339
event.sender.send('add-collections', newCollectionArr);
344340
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"chai-http": "^4.3.0",
134134
"chart.js": "^3.7.1",
135135
"classnames": "^2.3.1",
136-
"codemirror": "^5.65.3",
136+
"codemirror": "^5.65.6",
137137
"concurrently": "^7.1.0",
138138
"cookie-parser": "^1.4.6",
139139
"cross-fetch": "^3.1.5",
@@ -214,7 +214,7 @@
214214
"cross-env": "^7.0.3",
215215
"csp-html-webpack-plugin": "^5.1.0",
216216
"css-loader": "^6.7.1",
217-
"electron": "^18.1.0",
217+
"electron": "^18.3.5",
218218
"electron-builder": "^23.0.3",
219219
"electron-react-devtools": "^0.5.3",
220220
"eslint": "^8.14.0",

tsconfig.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@
2727
"./main_process/*.ts",
2828
"src/assets/**/*.ts"
2929
],
30-
"exclude": [
31-
"node_modules",
32-
"dist",
33-
"build",
34-
"coverage",
35-
"mocks"
36-
],
37-
"typeRoots": [
38-
"./node_modules/@types"
39-
]
40-
}
30+
"exclude": ["node_modules", "dist", "build", "coverage", "mocks"],
31+
"typeRoots": ["./node_modules/@types"]
32+
}
33+

0 commit comments

Comments
 (0)