Skip to content

Commit

Permalink
Merge branch 'develop' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
blarfoon committed Aug 15, 2019
2 parents d5c165a + 8eef424 commit f67ffd7
Show file tree
Hide file tree
Showing 4 changed files with 670 additions and 688 deletions.
29 changes: 17 additions & 12 deletions app/utils/mods.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import murmur from 'murmurhash-js';
import { downloadFile } from './downloader';
import { bin2string, isWhitespaceCharacter } from './strings';
import { PACKS_PATH } from '../constants';
import { getAddonFile, getAddonFiles } from './cursemeta';
import { getAddonFile, getAddonFiles, getAddon } from './cursemeta';

// Downloads a specific mod from curse using the addonID and fileID
export const downloadMod = async (
Expand Down Expand Up @@ -55,8 +55,15 @@ export const downloadDependancies = async (
const gameVersion = data.gameVersion[0];
await Promise.all(
data.dependencies.map(async dep => {
// type 1: embedded
// type 2: optional
// type 3: required
// type 4: tool
// type 5: incompatible
// type 6: include

// It looks like type 1 are required dependancies and type 3 are dependancies that are already embedded in the parent one
if (dep.type === 1) {
if (dep.type === 3) {
let toDownload = true;
try {
// See if the mod already exists in this instance
Expand All @@ -65,28 +72,26 @@ export const downloadDependancies = async (
path.join(PACKS_PATH, instanceName, 'config.json')
)
).mods;
console.log(installedMods)
if (installedMods.find(v => v.projectID === dep.addonId))
if (installedMods.find(v => v.projectID === dep.addonId)){
toDownload = false;
}
} catch {
toDownload = true;
}
if (toDownload) {
const depData = await getAddonFiles(dep.addonId);
const depData = await getAddon(dep.addonId);

const correctVersion = depData
.reverse()
.find(n => n.gameVersion.includes(gameVersion)) || {};
const { id, filename } = correctVersion;
const correctVersion = depData.gameVersionLatestFiles.find(v => v.gameVersion === gameVersion) || {};
const { projectFileId, projectFileName } = correctVersion;

if (Object.keys(correctVersion).length) {
const downloadedDep = await downloadMod(
dep.addonId,
id,
filename,
projectFileId,
projectFileName,
instanceName
);
const nestedDeps = await downloadDependancies(dep.addonId, id, instanceName);
const nestedDeps = await downloadDependancies(dep.addonId, projectFileId, instanceName);
deps = deps.concat(downloadedDep).concat(nestedDeps);
}

Expand Down
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = api => {
require('@babel/preset-env'),
{
targets: { node: 10 },
useBuiltIns: 'usage'
useBuiltIns: 'usage',
corejs: "3.2.1",
}
],
require('@babel/preset-flow'),
Expand Down
81 changes: 41 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gdlauncher",
"version": "0.11.16-beta",
"version": "0.11.17-beta",
"description": "GDLauncher is simple, yet powerful Minecraft custom launcher with a strong focus on the user experience",
"keywords": [
"minecraft",
Expand Down Expand Up @@ -107,7 +107,7 @@
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.5.5",
"@welldone-software/why-did-you-render": "^3.2.3",
"@welldone-software/why-did-you-render": "^3.3.3",
"asar": "^2.0.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.2",
Expand All @@ -119,36 +119,36 @@
"concurrently": "^4.1.1",
"cross-env": "^5.2.0",
"cross-spawn": "^6.0.5",
"css-loader": "^3.1.0",
"css-loader": "^3.2.0",
"detect-port": "^1.3.0",
"electron": "^6.0.0",
"electron-builder": "^21.1.5",
"electron": "^6.0.2",
"electron-builder": "^21.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-rebuild": "^1.8.5",
"electron-updater": "^4.1.2",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.3.5",
"enzyme-to-json": "^3.4.0",
"eslint": "^6.1.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-erb": "^0.0.2",
"eslint-config-prettier": "^6.0.0",
"eslint-formatter-pretty": "^2.1.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-compat": "^3.3.0",
"eslint-plugin-flowtype": "^3.12.2",
"eslint-plugin-flowtype": "^4.2.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.14.0",
"eslint-plugin-jest": "^22.15.1",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-testcafe": "^0.2.1",
"fbjs-scripts": "^1.2.0",
"file-loader": "^4.1.0",
"flow-bin": "^0.104.0",
"file-loader": "^4.2.0",
"flow-bin": "^0.105.2",
"flow-runtime": "^0.17.0",
"flow-typed": "^2.6.0",
"flow-typed": "^2.6.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"less": "^3.9.0",
Expand All @@ -160,70 +160,71 @@
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-syntax": "^0.36.2",
"prettier": "^1.18.2",
"react-test-renderer": "^16.8.6",
"react-test-renderer": "^16.9.0",
"redux-logger": "^3.0.6",
"rimraf": "^2.6.3",
"sass-loader": "^7.1.0",
"sinon": "^7.3.2",
"spectron": "^7.0.0",
"style-loader": "^0.23.1",
"rimraf": "^3.0.0",
"sass-loader": "^7.2.0",
"sinon": "^7.4.1",
"spectron": "^8.0.0",
"style-loader": "^1.0.0",
"stylefmt": "^6.0.3",
"stylelint": "^10.1.0",
"stylelint-config-prettier": "^5.2.0",
"stylelint-config-standard": "^18.3.0",
"terser-webpack-plugin": "^1.3.0",
"terser-webpack-plugin": "^1.4.1",
"url-loader": "^2.1.0",
"webpack": "^4.38.0",
"webpack": "^4.39.2",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2",
"webpack-dev-server": "^3.8.0",
"webpack-merge": "^4.2.1",
"yarn": "^1.17.3"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.20",
"@fortawesome/free-brands-svg-icons": "^5.10.0",
"@fortawesome/free-regular-svg-icons": "^5.10.0",
"@fortawesome/free-solid-svg-icons": "^5.10.0",
"@fortawesome/fontawesome-svg-core": "^1.2.21",
"@fortawesome/free-brands-svg-icons": "^5.10.1",
"@fortawesome/free-regular-svg-icons": "^5.10.1",
"@fortawesome/free-solid-svg-icons": "^5.10.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"@material-ui/core": "^4.3.0",
"@material-ui/core": "^4.3.2",
"@material-ui/styles": "^4.3.0",
"adm-zip": "^0.4.13",
"antd": "^3.20.7",
"antd": "^3.21.4",
"assert": "^2.0.0",
"axios": "^0.19.0",
"bluebird": "^3.5.5",
"cheerio": "^1.0.0-rc.2",
"compressing": "^1.4.0",
"connected-react-router": "^6.5.2",
"core-js": "^3.2.1",
"css-vars": "^2.2.0",
"devtron": "^1.4.0",
"directory-tree": "^2.2.3",
"directory-tree": "^2.2.4",
"discord-rpc": "^3.0.2",
"electron-debug": "^3.0.1",
"electron-log": "^3.0.6",
"electron-log": "^3.0.7",
"electron-store": "^4.0.0",
"extract-zip": "^1.6.7",
"fs-extra": "^8.1.0",
"history": "^4.9.0",
"i18next": "^17.0.7",
"i18next-browser-languagedetector": "^3.0.1",
"i18next-xhr-backend": "^3.0.0",
"i18next": "^17.0.11",
"i18next-browser-languagedetector": "^3.0.3",
"i18next-xhr-backend": "^3.1.2",
"jarfile": "^2.0.0",
"lodash": "^4.17.15",
"make-dir": "^3.0.0",
"murmurhash-js": "^1.0.0",
"node-watch": "^0.6.2",
"npm-check-updates": "^3.1.20",
"node-watch": "^0.6.3",
"npm-check-updates": "^3.1.21",
"ps-tree": "^1.2.0",
"react": "^16.8.6",
"react": "^16.9.0",
"react-color": "^2.17.3",
"react-content-loader": "^4.2.2",
"react-contextmenu": "^2.11.0",
"react-dom": "^16.8.6",
"react-hot-loader": "^4.12.10",
"react-dom": "^16.9.0",
"react-hot-loader": "^4.12.11",
"react-html-parser": "^2.0.2",
"react-i18next": "^10.11.4",
"react-i18next": "^10.12.2",
"react-icons": "3.7.0",
"react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.5.0",
Expand All @@ -232,7 +233,7 @@
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1",
"react-sortable-hoc": "^1.9.1",
"react-transition-group": "^4.2.1",
"react-transition-group": "^4.2.2",
"react-virtualized": "^9.21.1",
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "^1.8.5",
Expand All @@ -242,7 +243,7 @@
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"reselect": "^4.0.0",
"source-map-support": "^0.5.12",
"source-map-support": "^0.5.13",
"styled-components": "^4.3.2",
"sudo-prompt": "^9.0.0",
"universal-analytics": "^0.4.20",
Expand Down
Loading

0 comments on commit f67ffd7

Please sign in to comment.