mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Get rid of electron-json-storage and switch to our own solution
This commit is contained in:
parent
9d2a1190cf
commit
bac604a7cc
8 changed files with 125 additions and 215 deletions
193
package-lock.json
generated
193
package-lock.json
generated
|
@ -11,7 +11,6 @@
|
|||
"license": "OSL-3.0",
|
||||
"dependencies": {
|
||||
"electron-context-menu": "^3.1.2",
|
||||
"electron-json-storage": "^4.5.0",
|
||||
"electron-tabs": "^0.17.0",
|
||||
"v8-compile-cache": "^2.3.0"
|
||||
},
|
||||
|
@ -312,14 +311,6 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/async": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
||||
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.14"
|
||||
}
|
||||
},
|
||||
"node_modules/async-exit-hook": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz",
|
||||
|
@ -341,7 +332,8 @@
|
|||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bluebird": {
|
||||
"version": "3.7.2",
|
||||
|
@ -400,6 +392,7 @@
|
|||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
@ -633,7 +626,8 @@
|
|||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/concat-stream": {
|
||||
"version": "1.6.2",
|
||||
|
@ -1073,30 +1067,6 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-json-storage": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-json-storage/-/electron-json-storage-4.5.0.tgz",
|
||||
"integrity": "sha512-ML6Um4tZbJv938EbxvMJwzLA+v/wfWwEP+AXNum1zQF9RUFJ/SrRtIjGm9eFTFxURxn81r3ggdovuQikyF/m0Q==",
|
||||
"dependencies": {
|
||||
"async": "^2.0.0",
|
||||
"lockfile": "^1.0.4",
|
||||
"lodash": "^4.0.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"rimraf": "^2.5.1",
|
||||
"write-file-atomic": "^2.4.2"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-json-storage/node_modules/mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.6"
|
||||
},
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-publish": {
|
||||
"version": "22.5.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.5.1.tgz",
|
||||
|
@ -1359,7 +1329,8 @@
|
|||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
|
@ -1392,6 +1363,7 @@
|
|||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
|
@ -1519,7 +1491,8 @@
|
|||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.9",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
|
||||
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ=="
|
||||
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
|
@ -1609,6 +1582,7 @@
|
|||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.8.19"
|
||||
}
|
||||
|
@ -1617,6 +1591,7 @@
|
|||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
|
@ -1625,7 +1600,8 @@
|
|||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ini": {
|
||||
"version": "1.3.8",
|
||||
|
@ -1838,18 +1814,12 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lockfile": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz",
|
||||
"integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==",
|
||||
"dependencies": {
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/lowercase-keys": {
|
||||
"version": "1.0.1",
|
||||
|
@ -1933,6 +1903,7 @@
|
|||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
|
@ -1943,7 +1914,8 @@
|
|||
"node_modules/minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
|
@ -2069,6 +2041,7 @@
|
|||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
|
@ -2145,6 +2118,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
|
@ -2358,17 +2332,6 @@
|
|||
"lowercase-keys": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/roarr": {
|
||||
"version": "2.15.4",
|
||||
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
|
||||
|
@ -2467,7 +2430,8 @@
|
|||
"node_modules/signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/slice-ansi": {
|
||||
"version": "3.0.0",
|
||||
|
@ -2940,17 +2904,8 @@
|
|||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"node_modules/write-file-atomic": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
|
||||
"integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/xdg-basedir": {
|
||||
"version": "4.0.0",
|
||||
|
@ -3261,14 +3216,6 @@
|
|||
"resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
|
||||
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="
|
||||
},
|
||||
"async": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
||||
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.14"
|
||||
}
|
||||
},
|
||||
"async-exit-hook": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz",
|
||||
|
@ -3284,7 +3231,8 @@
|
|||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
|
@ -3336,6 +3284,7 @@
|
|||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
@ -3526,7 +3475,8 @@
|
|||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"concat-stream": {
|
||||
"version": "1.6.2",
|
||||
|
@ -3889,29 +3839,6 @@
|
|||
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-2.0.0.tgz",
|
||||
"integrity": "sha512-3X99K852Yoqu9AcW50qz3ibYBWY79/pBhlMCab8ToEWS48R0T9tyxRiQhwylE7zQdXrMnx2JKqUJyMPmt5FBqA=="
|
||||
},
|
||||
"electron-json-storage": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-json-storage/-/electron-json-storage-4.5.0.tgz",
|
||||
"integrity": "sha512-ML6Um4tZbJv938EbxvMJwzLA+v/wfWwEP+AXNum1zQF9RUFJ/SrRtIjGm9eFTFxURxn81r3ggdovuQikyF/m0Q==",
|
||||
"requires": {
|
||||
"async": "^2.0.0",
|
||||
"lockfile": "^1.0.4",
|
||||
"lodash": "^4.0.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"rimraf": "^2.5.1",
|
||||
"write-file-atomic": "^2.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||
"requires": {
|
||||
"minimist": "^1.2.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"electron-publish": {
|
||||
"version": "22.5.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.5.1.tgz",
|
||||
|
@ -4121,7 +4048,8 @@
|
|||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
|
@ -4148,6 +4076,7 @@
|
|||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
|
@ -4246,7 +4175,8 @@
|
|||
"graceful-fs": {
|
||||
"version": "4.2.9",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
|
||||
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ=="
|
||||
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==",
|
||||
"dev": true
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
|
@ -4308,12 +4238,14 @@
|
|||
"imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
|
||||
"dev": true
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
|
@ -4322,7 +4254,8 @@
|
|||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.8",
|
||||
|
@ -4487,18 +4420,12 @@
|
|||
"p-locate": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"lockfile": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz",
|
||||
"integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==",
|
||||
"requires": {
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"lowercase-keys": {
|
||||
"version": "1.0.1",
|
||||
|
@ -4555,6 +4482,7 @@
|
|||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
|
@ -4562,7 +4490,8 @@
|
|||
"minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
|
@ -4671,6 +4600,7 @@
|
|||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
|
@ -4725,7 +4655,8 @@
|
|||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.7",
|
||||
|
@ -4891,14 +4822,6 @@
|
|||
"lowercase-keys": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"roarr": {
|
||||
"version": "2.15.4",
|
||||
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
|
||||
|
@ -4982,7 +4905,8 @@
|
|||
"signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
||||
"dev": true
|
||||
},
|
||||
"slice-ansi": {
|
||||
"version": "3.0.0",
|
||||
|
@ -5358,17 +5282,8 @@
|
|||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"write-file-atomic": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
|
||||
"integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"xdg-basedir": {
|
||||
"version": "4.0.0",
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"electron-context-menu": "^3.1.2",
|
||||
"electron-json-storage": "^4.5.0",
|
||||
"electron-tabs": "^0.17.0",
|
||||
"v8-compile-cache": "^2.3.0"
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
import electron from "electron";
|
||||
import * as storage from "electron-json-storage";
|
||||
import {getConfig} from "../utils";
|
||||
const otherMods = {
|
||||
generic: {
|
||||
electronProxy: require("util").types.isProxy(electron) // Many modern mods overwrite electron with a proxy with a custom BrowserWindow (copied from PowerCord)
|
||||
|
@ -55,9 +55,9 @@ const unstrictCSP = () => {
|
|||
done({responseHeaders});
|
||||
});
|
||||
};
|
||||
storage.get("settings", function (error, data: any) {
|
||||
if (error) throw error;
|
||||
if (data.armcordCSP) {
|
||||
|
||||
electron.app.whenReady().then(async () => {
|
||||
if (await getConfig("armcordCSP")) {
|
||||
unstrictCSP();
|
||||
} else {
|
||||
console.log("ArmCord CSP is disabled. The CSP should be managed by third-party plugin.");
|
||||
|
|
25
src/ipc.ts
25
src/ipc.ts
|
@ -1,8 +1,8 @@
|
|||
//ipc stuff
|
||||
import {app, ipcMain, shell, desktopCapturer} from "electron";
|
||||
import {createTabsGuest, mainWindow} from "./window";
|
||||
import {setConfigBulk, getVersion} from "./utils";
|
||||
import {settings, customTitlebar, tabs} from "./main";
|
||||
import {setConfigBulk, getVersion, getConfig} from "./utils";
|
||||
import {customTitlebar, tabs} from "./main";
|
||||
import {createSettingsWindow} from "./settings/main";
|
||||
export function registerIpc() {
|
||||
ipcMain.on("get-app-path", (event, arg) => {
|
||||
|
@ -48,15 +48,14 @@ export function registerIpc() {
|
|||
ipcMain.on("saveSettings", (event, args) => {
|
||||
setConfigBulk(args);
|
||||
});
|
||||
ipcMain.on("minimizeToTray", (event) => {
|
||||
console.log(settings.minimizeToTray);
|
||||
event.returnValue = settings.minimizeToTray;
|
||||
ipcMain.on("minimizeToTray", async (event) => {
|
||||
event.returnValue = await getConfig("minimizeToTray");
|
||||
});
|
||||
ipcMain.on("channel", (event) => {
|
||||
event.returnValue = settings.channel;
|
||||
ipcMain.on("channel", async (event) => {
|
||||
event.returnValue = await getConfig("channel");
|
||||
});
|
||||
ipcMain.on("clientmod", (event, arg) => {
|
||||
event.returnValue = settings.mods;
|
||||
ipcMain.on("clientmod", async (event, arg) => {
|
||||
event.returnValue = await getConfig("mods");
|
||||
});
|
||||
ipcMain.on("titlebar", (event, arg) => {
|
||||
event.returnValue = customTitlebar;
|
||||
|
@ -64,14 +63,14 @@ export function registerIpc() {
|
|||
ipcMain.on("tabs", (event, arg) => {
|
||||
event.returnValue = tabs;
|
||||
});
|
||||
ipcMain.on("shouldPatch", (event, arg) => {
|
||||
event.returnValue = settings.automaticPatches;
|
||||
ipcMain.on("shouldPatch", async (event, arg) => {
|
||||
event.returnValue = await getConfig("automaticPatches");
|
||||
});
|
||||
ipcMain.on("openSettingsWindow", (event, arg) => {
|
||||
createSettingsWindow();
|
||||
});
|
||||
ipcMain.on("setting-armcordCSP", (event) => {
|
||||
if (settings.armcordCSP) {
|
||||
ipcMain.on("setting-armcordCSP", async (event) => {
|
||||
if (await getConfig("armcordCSP")) {
|
||||
event.returnValue = true;
|
||||
} else {
|
||||
event.returnValue = false;
|
||||
|
|
59
src/main.ts
59
src/main.ts
|
@ -1,50 +1,19 @@
|
|||
// Modules to control application life and create native browser window
|
||||
import {app, BrowserWindow, session, dialog} from "electron";
|
||||
import * as path from "path";
|
||||
import "v8-compile-cache";
|
||||
import * as storage from "electron-json-storage";
|
||||
import {getConfig, setup} from "./utils";
|
||||
import {getConfig, setup, checkIfConfigExists} from "./utils";
|
||||
import "./extensions/mods";
|
||||
import "./extensions/plugin";
|
||||
import "./tray";
|
||||
import {mainWindow, createCustomWindow, createNativeWindow, createTabsHost} from "./window";
|
||||
import {createCustomWindow, createNativeWindow, createTabsHost} from "./window";
|
||||
import "./shortcuts";
|
||||
export var contentPath: string;
|
||||
var channel: string;
|
||||
|
||||
export var settings: any;
|
||||
export var customTitlebar: boolean;
|
||||
export var tabs: boolean;
|
||||
async function appendSwitch() {
|
||||
if ((await getConfig("windowStyle")) == "glasstron") {
|
||||
console.log("Enabling transparency visuals.");
|
||||
app.commandLine.appendSwitch("enable-transparent-visuals");
|
||||
}
|
||||
}
|
||||
appendSwitch();
|
||||
storage.has("settings", function (error, hasKey) {
|
||||
if (error) throw error;
|
||||
|
||||
if (!hasKey) {
|
||||
console.log("First run of the ArmCord. Starting setup.");
|
||||
setup();
|
||||
contentPath = path.join(__dirname, "/content/setup.html");
|
||||
if (!contentPath.includes("ts-out")) {
|
||||
contentPath = path.join(__dirname, "/ts-out/content/setup.html");
|
||||
}
|
||||
} else {
|
||||
console.log("ArmCord has been run before. Skipping setup.");
|
||||
contentPath = path.join(__dirname, "/content/splash.html");
|
||||
if (!contentPath.includes("ts-out")) {
|
||||
contentPath = path.join(__dirname, "/ts-out/content/splash.html");
|
||||
}
|
||||
}
|
||||
});
|
||||
storage.get("settings", function (error, data: any) {
|
||||
if (error) throw error;
|
||||
console.log(data);
|
||||
channel = data.channel;
|
||||
settings = data;
|
||||
});
|
||||
checkIfConfigExists();
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
switch (await getConfig("windowStyle")) {
|
||||
case "default":
|
||||
|
@ -55,8 +24,11 @@ app.whenReady().then(async () => {
|
|||
createNativeWindow();
|
||||
break;
|
||||
case "glasstron":
|
||||
dialog.showErrorBox("Glasstron is unsupported.", "This build doesn't include Glasstron functionality, please edit windowStyle value in your settings.json to something different (default for example)")
|
||||
app.quit()
|
||||
dialog.showErrorBox(
|
||||
"Glasstron is unsupported.",
|
||||
"This build doesn't include Glasstron functionality, please edit windowStyle value in your settings.json to something different (default for example)"
|
||||
);
|
||||
app.quit();
|
||||
break;
|
||||
case "tabs":
|
||||
createTabsHost();
|
||||
|
@ -87,8 +59,15 @@ app.whenReady().then(async () => {
|
|||
createNativeWindow();
|
||||
break;
|
||||
case "glasstron":
|
||||
dialog.showErrorBox("Glasstron is unsupported.", "This build doesn't include Glasstron functionality, please edit windowStyle value in your settings.json to something different (default for example)")
|
||||
app.quit()
|
||||
dialog.showErrorBox(
|
||||
"Glasstron is unsupported.",
|
||||
"This build doesn't include Glasstron functionality, please edit windowStyle value in your settings.json to something different (default for example)"
|
||||
);
|
||||
app.quit();
|
||||
break;
|
||||
case "tabs":
|
||||
createTabsHost();
|
||||
tabs = true;
|
||||
break;
|
||||
default:
|
||||
createCustomWindow();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {BrowserWindow, shell, ipcMain, app} from "electron";
|
||||
import {BrowserWindow, shell, ipcMain} from "electron";
|
||||
import {getConfig, setConfigBulk, Settings} from "../utils";
|
||||
import path from "path";
|
||||
var settingsWindow: BrowserWindow;
|
||||
|
|
49
src/utils.ts
49
src/utils.ts
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||
import {app, dialog} from "electron";
|
||||
import path from "path";
|
||||
export var firstRun: boolean;
|
||||
|
||||
export var contentPath: string;
|
||||
//utillity functions that are used all over the codebase or just too obscure to be put in the file used in
|
||||
export function addStyle(styleString: string) {
|
||||
const style = document.createElement("style");
|
||||
|
@ -43,15 +43,11 @@ export function setup() {
|
|||
blurType: "acrylic",
|
||||
doneSetup: false
|
||||
};
|
||||
setConfigBulk(
|
||||
{
|
||||
...defaults,
|
||||
},
|
||||
|
||||
);
|
||||
setConfigBulk({
|
||||
...defaults
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getVersion() {
|
||||
//to-do better way of doing this
|
||||
return "3.1.0";
|
||||
|
@ -67,6 +63,7 @@ export async function injectJS(inject: string) {
|
|||
}
|
||||
|
||||
//ArmCord Settings/Storage manager
|
||||
|
||||
export interface Settings {
|
||||
windowStyle: string;
|
||||
channel: string;
|
||||
|
@ -81,7 +78,8 @@ export async function getConfig(object: string) {
|
|||
try {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
let rawdata = fs.readFileSync(storagePath + "settings.json", "utf-8");
|
||||
const settingsFile = storagePath + "settings.json";
|
||||
let rawdata = fs.readFileSync(settingsFile, "utf-8");
|
||||
let returndata = JSON.parse(rawdata);
|
||||
console.log(returndata[object]);
|
||||
return returndata[object];
|
||||
|
@ -95,11 +93,12 @@ export async function setConfig(object: string, toSet: any) {
|
|||
try {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
let rawdata = fs.readFileSync(storagePath + "settings.json", "utf-8");
|
||||
const settingsFile = storagePath + "settings.json";
|
||||
let rawdata = fs.readFileSync(settingsFile, "utf-8");
|
||||
let parsed = JSON.parse(rawdata);
|
||||
parsed[object] = toSet;
|
||||
let toSave = JSON.stringify(parsed)
|
||||
fs.writeFileSync(storagePath + "settings.json", toSave, "utf-8")
|
||||
let toSave = JSON.stringify(parsed);
|
||||
fs.writeFileSync(settingsFile, toSave, "utf-8");
|
||||
} catch (e) {
|
||||
console.log("Config probably doesn't exist yet. Returning setup value.");
|
||||
firstRun = true;
|
||||
|
@ -110,11 +109,31 @@ export async function setConfigBulk(object: Settings) {
|
|||
try {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
let toSave = JSON.stringify(object)
|
||||
fs.writeFileSync(storagePath + "settings.json", toSave, "utf-8")
|
||||
const settingsFile = storagePath + "settings.json";
|
||||
let toSave = JSON.stringify(object);
|
||||
fs.writeFileSync(settingsFile, toSave, "utf-8");
|
||||
} catch (e) {
|
||||
console.log("Config probably doesn't exist yet. Returning setup value.");
|
||||
firstRun = true;
|
||||
return "setup";
|
||||
}
|
||||
}
|
||||
}
|
||||
export async function checkIfConfigExists() {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
const settingsFile = storagePath + "settings.json";
|
||||
if (!fs.existsSync(settingsFile)) {
|
||||
console.log("First run of the ArmCord. Starting setup.");
|
||||
setup();
|
||||
contentPath = path.join(__dirname, "/content/setup.html");
|
||||
if (!contentPath.includes("ts-out")) {
|
||||
contentPath = path.join(__dirname, "/ts-out/content/setup.html");
|
||||
}
|
||||
} else {
|
||||
console.log("ArmCord has been run before. Skipping setup.");
|
||||
contentPath = path.join(__dirname, "/content/splash.html");
|
||||
if (!contentPath.includes("ts-out")) {
|
||||
contentPath = path.join(__dirname, "/ts-out/content/splash.html");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
// I'm sorry for this mess but I'm not sure how to fix it.
|
||||
import {BrowserWindow, shell, app, ipcMain, dialog} from "electron";
|
||||
import path from "path";
|
||||
import {contentPath} from "./main";
|
||||
import {checkIfConfigIsBroken, firstRun, getConfig} from "./utils";
|
||||
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath} from "./utils";
|
||||
import {registerIpc} from "./ipc";
|
||||
import contextMenu from "electron-context-menu";
|
||||
export let mainWindow: BrowserWindow;
|
||||
|
|
Loading…
Reference in a new issue