Skip to content

Commit

Permalink
remove useless files and dependencies - update package to resolve sec…
Browse files Browse the repository at this point in the history
…urity issues - move files around, `needsHome` is gone
  • Loading branch information
mworzala committed Jul 16, 2019
1 parent 1178480 commit 124024d
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 178 deletions.
129 changes: 31 additions & 98 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"follow-redirects": "^1.7.0",
"fs-extra": "^7.0.1",
"getos": "^3.1.1",
"lockfile": "^1.0.4",
"mocha": "^6.1.4",
"nedb": "^1.8.0",
"node-fetch": "^2.6.0",
Expand Down Expand Up @@ -57,10 +56,14 @@
"src/**",
"*.js"
],
"protocols": [{
"name": "Proton Launcher",
"schemes": ["proton"]
}],
"protocols": [
{
"name": "Proton Launcher",
"schemes": [
"proton"
]
}
],
"extends": null,
"directories": {
"buildResources": "assets"
Expand Down
4 changes: 2 additions & 2 deletions src/main/needsHome/profile.js → src/main/app/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ SOFTWARE.
*/

const { app, shell, ipcMain, Notification } = require('electron');
const Database = require('../app/database');
const installer = require('./installer');
const Database = require('../util/database');
const installer = require('../game/installer');
const config = require('../config/config');
const path = require('path');
const fs = require('fs-extra');
Expand Down
2 changes: 1 addition & 1 deletion src/main/app/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOFTWARE.
*/

const { app, ipcMain } = require('electron');
const profile = require('../needsHome/profile');
const profile = require('./profile');

// Handle `proton://` protocol.
app.setAsDefaultProtocolClient('proton');
Expand Down
2 changes: 1 addition & 1 deletion src/main/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { app, ipcMain } = require('electron');
const os = require('os');
const fs = require('fs-extra');
const path = require('path');
const Database = require('../app/database');
const Database = require('../util/database');

const baseDir = app.getPath('userData');
const config = new Database(path.join(baseDir, 'config.db'));
Expand Down
2 changes: 1 addition & 1 deletion src/main/config/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
*/

const { app, ipcMain } = require('electron');
const Database = require('../app/database');
const Database = require('../util/database');
const path = require('path');
const fs = require('fs-extra');

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const fs = require('fs-extra');
const path = require('path');
const files = require('../util/files');
const fetch = require('node-fetch');
const cache = require('../game/versionCache');
const cache = require('./cache/versions');
const config = require('../config/config');
const java = require('../config/java');
const tasks = require('../task/taskmaster');
Expand All @@ -41,7 +41,7 @@ fs.mkdirs(tempDir);
* //todo remove
* @deprecated 1.2.3
*/
const sendTaskUpdate = (id, task, progress) => require('./profile').sendTaskUpdate(id, task, progress);
const sendTaskUpdate = (id, task, progress) => require('../app/profile').sendTaskUpdate(id, task, progress);

/**
* Installs a vanilla version.
Expand Down Expand Up @@ -203,7 +203,7 @@ exports.installForge = async (version, validate) => {
* @return {Promise<string>} the final name of the version.
*/
exports.installFabric = async (mappings, loader, validate) => {
const fabric = require('../util/fabric');
const fabric = require('./fabric');
const version = fabric.fabricify(mappings);
const versionName = `${fabric.LOADER_NAME}-${loader}-${version.version}`;
const versionDir = path.join(installDir, 'versions', versionName);
Expand Down
2 changes: 1 addition & 1 deletion src/main/game/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOFTWARE.
*/

const { app } = require('electron');
const profiles = require('../needsHome/profile');
const profiles = require('../app/profile');
const artifact = require('../util/artifact');
const config = require('../config/config');
const sendSnack = require('../main').sendSnack;
Expand Down
8 changes: 4 additions & 4 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ app.on('ready', async () => {
console.debug = message => { if (debug) log.debug(message); };

require('./app/protocol');
require('./app/reporter');
require('./util/reporter');
require('./app/updater');
require('./task/taskmaster');
require('./needsHome/profile');
require('./app/profile');
require('./config/java');
require('./mojang/accounts');
require('./game/versionCache');
require('./game/curseCache');
require('./game/cache/versions');
require('./game/cache/curse');
require('./app/rpc');

//todo why is this settimeout here?
Expand Down
2 changes: 1 addition & 1 deletion src/main/mojang/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SOFTWARE.
*/

const { app, ipcMain, BrowserWindow } = require('electron');
const Database = require('../app/database');
const Database = require('../util/database');
const mojang = require('../mojang/mojang');
const config = require('../config/config');
const fs = require('fs-extra');
Expand Down
File renamed without changes.
30 changes: 0 additions & 30 deletions src/main/util/ipcMainSync.js

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/util/lockfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/app/reporter.js → src/main/util/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SOFTWARE.
*/

const { app, ipcMain } = require('electron');
const updater = require('./updater');
const updater = require('../app/updater');
const fetch = require('node-fetch');
const fs = require('fs-extra');
const path = require('path');
Expand Down

0 comments on commit 124024d

Please sign in to comment.