This commit is contained in:
Aaron Dewes 2021-10-18 03:21:34 -07:00 committed by GitHub
commit 6c784aae09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
70 changed files with 10365 additions and 33610 deletions

View File

@ -4,29 +4,29 @@ on: push
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12
- run: npm run devInstall
- run: npm run compile
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
node-version: 16
- name: Install dependencies and compile
run: |
yarn
yarn devInstall
yarn compile
yarn build
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: 'builds/*'

View File

@ -1,42 +0,0 @@
language: node_js
node_js: "12"
before_install:
- npm i
jobs:
include:
- stage: Linux & Mac Build
os: osx
osx_image: xcode10.2
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
before_cache:
- rm -rf $ELECTRON_BUILDER_CACHE/wine
script:
- npm run devInstall
- npm run build
# - stage: Windows Build
# os: windows
# script:
# - export NPM_CONFIG_PREFIX=C:\\npm_prefix
# - export PATH="/c/npm_prefix:$PATH"
# - npm i -g npm@latest
# - npm run devInstall
# - npm run build
# - stage: GitHub Release
# script:
# - export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
# - git tag $TRAVIS_TAG
# deploy:
# provider: releases
# prerelease: true
# api_key: "$GH_TOKEN"
# cleanup: false
# file:
# - builds/lightcord-win32-ia32.zip
# - builds/lightcord-win32.exe
# - builds/lightcord-linux-x64.zip
# - builds/lightcord-darwin.zip
# on:
# tags: true

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,14 @@
"description": "Enhances Discord adding functionality and themes.",
"main": "src/index.js",
"scripts": {
"build": "webpack --progress --colors",
"watch": "webpack --progress --colors --watch",
"build-prod": "webpack --progress --colors --config prod.config.js",
"watch-prod": "webpack --progress --colors --watch --config prod.config.js",
"build": "webpack --progress",
"watch": "webpack --progress --watch",
"build-prod": "webpack --progress --config prod.config.js",
"watch-prod": "webpack --progress --watch --config prod.config.js",
"test": "echo \"Error: no test specified\" && exit 1",
"minify-css": "node minify-css.js",
"watch-css": "node minify-css.js --watch",
"deploy": "npm run build-prod && npm run minify-css"
"deploy": "yarn build-prod && yarn minify-css"
},
"repository": {
"type": "git",
@ -24,14 +24,14 @@
},
"homepage": "https://github.com/rauenzi/BetterDiscordApp#readme",
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@babel/register": "^7.10.5",
"babel-loader": "^8.1.0",
"circular-dependency-plugin": "^5.2.0",
"clean-css": "^4.2.3",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.4",
"@babel/preset-react": "^7.14.5",
"@babel/register": "^7.15.3",
"babel-loader": "^8.2.2",
"circular-dependency-plugin": "^5.2.2",
"clean-css": "^5.1.5",
"webpack": "^5.52.0",
"webpack-cli": "^4.8.0"
}
}

View File

@ -118,157 +118,133 @@ export default new class V2_SettingsPanel {
updateSettings(id, enabled, sidebar) {
if(!["lightcord-8", "no_window_bound", "enable_glasstron", "lightcord-10", "lightcord-11"].includes(id))settingsCookie[id] = enabled;
if (id == "bda-gs-2") {
if (enabled) DOM.addClass(document.body, "bd-minimal");
else DOM.removeClass(document.body, "bd-minimal");
}
if (id == "bda-gs-3") {
if (enabled) DOM.addClass(document.body, "bd-minimal-chan");
else DOM.removeClass(document.body, "bd-minimal-chan");
}
if (id == "bda-gs-1") {
if (enabled) publicServersModule.addButton();
else publicServersModule.removeButton();
}
if (id == "bda-gs-4") {
if (enabled) voiceMode.start();
else voiceMode.stop();
}
if (id == "bda-gs-5") {
if (enabled) DOM.addClass(DOM.query("#app-mount"), "bda-dark");
else DOM.removeClass(DOM.query("#app-mount"), "bda-dark");
}
if (enabled && id == "bda-gs-6") tfHour.inject24Hour();
if (id == "bda-gs-7") {
if (enabled) coloredText.injectColoredText();
else coloredText.removeColoredText();
}
if (id == "fork-ps-4") {
if (enabled) ClassNormalizer.start();
else ClassNormalizer.stop();
}
if (id == "fork-ps-5") {
if (enabled) {
ContentManager.watchContent("plugin");
ContentManager.watchContent("theme");
}
else {
ContentManager.unwatchContent("plugin");
ContentManager.unwatchContent("theme");
}
}
if (id == "fork-wp-1") {
Utils.setWindowPreference("transparent", enabled);
if (enabled) Utils.setWindowPreference("backgroundColor", null);
else Utils.setWindowPreference("backgroundColor", "#2f3136");
}
if (id == "bda-gs-8") {
if (enabled) dMode.startDebugListener();
else dMode.stopDebugListener();
}
if (id == "fork-dm-1") {
if (enabled) dMode.startCopySelector();
else dMode.stopCopySelector();
}
if (id === "lightcord-1") {
if (enabled) window.Lightcord.Settings.devMode = true
else window.Lightcord.Settings.devMode = false
sidebar.forceUpdate()
}
if (id === "lightcord-2") {
if (enabled) window.Lightcord.Settings.callRingingBeat = true
else window.Lightcord.Settings.callRingingBeat = false
}
if (id === "lightcord-presence-1") {
if (enabled) {
CustomRichPresence.enable()
const settingsStore = BDModules.get(e => e.default && typeof e.default === "object" && "showCurrentGame" in e.default)[0]
if(settingsStore && !settingsStore.default.showCurrentGame){
BDModules.get(e => e.default && e.default.updateRemoteSettings)[0].default.updateRemoteSettings({
showCurrentGame: true
})
switch(id) {
case "bda-gs-1":
if (enabled) publicServersModule.addButton();
else publicServersModule.removeButton();
break;
case "bda-gs-2":
if (enabled) DOM.addClass(document.body, "bd-minimal");
else DOM.removeClass(document.body, "bd-minimal");
break;
case "bda-gs-3":
if (enabled) DOM.addClass(document.body, "bd-minimal-chan");
else DOM.removeClass(document.body, "bd-minimal-chan");
break;
case "bda-gs-4":
if (enabled) voiceMode.start();
else voiceMode.stop();
break;
case "bda-gs-5":
if (enabled) DOM.addClass(DOM.query("#app-mount"), "bda-dark");
else DOM.removeClass(DOM.query("#app-mount"), "bda-dark");
break;
case "bda-gs-6":
if (enabled) tfHour.inject24Hour();
break;
case "bda-gs-7":
if (enabled) coloredText.injectColoredText();
else coloredText.removeColoredText();
break;
case "bda-gs-8":
if (enabled) dMode.startDebugListener();
else dMode.stopDebugListener();
break;
case "fork-ps-4":
if (enabled) ClassNormalizer.start();
else ClassNormalizer.stop();
break;
case "fork-ps-5":
if (enabled) {
ContentManager.watchContent("plugin");
ContentManager.watchContent("theme");
}
}
else CustomRichPresence.disable()
}
if (id === "lightcord-3") {
ipcRenderer.sendSync("LIGHTCORD_SET_ALWAYS_ON_TOP", enabled)
}
if (id === "lightcord-4") {
if(enabled){
AntiAdDM.enable()
}else{
AntiAdDM.disable()
}
}
if (id === "lightcord-6") {
if(enabled){
blurPrivate.enable()
}else{
blurPrivate.disable()
}
}
if (id === "lightcord-7") {
if(enabled){
disableTyping.enable()
}else{
disableTyping.disable()
}
}
if (id === "lightcord-8"){
let appSettings = window.Lightcord.Api.settings
appSettings.set("isTabs", enabled)
appSettings.save()
DiscordNative.app.relaunch()
}
if (id === "lightcord-9") {
popoutWindow[enabled ? "enable" : "disable"]()
}
if (id === "lightcord-10"){
core.methods.NotificationsUseShim(enabled)
return
}
if (id === "no_window_bound"){
let appSettings = window.Lightcord.Api.settings
appSettings.set("NO_WINDOWS_BOUND", enabled)
appSettings.delete("IS_MAXIMIZED")
appSettings.delete("IS_MINIMIZED")
appSettings.delete("WINDOW_BOUNDS")
appSettings.save()
DiscordNative.app.relaunch()
}
if (id === "enable_glasstron"){
let appSettings = window.Lightcord.Api.settings
appSettings.set("GLASSTRON", enabled)
appSettings.save()
DiscordNative.app.relaunch()
}
if(id === "lightcord-11"){
let appSettings = window.Lightcord.Api.settings
if(!enabled){
appSettings.delete("BD_"+id)
else {
ContentManager.unwatchContent("plugin");
ContentManager.unwatchContent("theme");
}
break;
case "fork-wp-1":
Utils.setWindowPreference("transparent", enabled);
if (enabled) Utils.setWindowPreference("backgroundColor", null);
else Utils.setWindowPreference("backgroundColor", "#2f3136");
break;
case "fork-dm-1":
if (enabled) dMode.startCopySelector();
else dMode.stopCopySelector();
break;
case "lightcord-1":
if (enabled) window.Lightcord.Settings.devMode = true
else window.Lightcord.Settings.devMode = false
sidebar.forceUpdate()
break;
case "lightcord-2":
if (enabled) window.Lightcord.Settings.callRingingBeat = true
else window.Lightcord.Settings.callRingingBeat = false
break;
case "lightcord-3":
ipcRenderer.sendSync("LIGHTCORD_SET_ALWAYS_ON_TOP", enabled)
break;
case "lightcord-4":
enabled ? AntiAdDM.enable() : AntiAdDM.disable()
break;
case "lightcord-6":
enabled ? blurPrivate.enable() : blurPrivate.disable()
break;
case "lightcord-7":
enabled ? disableTyping.enable() : disableTyping.disable()
break;
case "lightcord-8":
let appSettings = window.Lightcord.Api.settings
appSettings.set("isTabs", enabled)
appSettings.save()
DiscordNative.app.relaunch()
break;
case "lightcord-9":
enabled ? popoutWindow.enable() : popoutWindow.disable()
break;
case "lightcord-10":
core.methods.NotificationsUseShim(enabled)
return;
case "lightcord-11":
let appSettings = window.Lightcord.Api.settings
if(!enabled){
appSettings.delete("BD_"+id)
appSettings.save()
return
}
appSettings.set("BD_"+id, enabled)
appSettings.save()
return
}
appSettings.set("BD_"+id, enabled)
appSettings.save()
return
case "lightcord-presence-1":
if (enabled) {
CustomRichPresence.enable()
const settingsStore = BDModules.get(e => e.default && typeof e.default === "object" && "showCurrentGame" in e.default)[0]
if(settingsStore && !settingsStore.default.showCurrentGame){
BDModules.get(e => e.default && e.default.updateRemoteSettings)[0].default.updateRemoteSettings({
showCurrentGame: true
})
}
}
else CustomRichPresence.disable()
break;
case "no_window_bound":
let appSettings = window.Lightcord.Api.settings
appSettings.set("NO_WINDOWS_BOUND", enabled)
appSettings.delete("IS_MAXIMIZED")
appSettings.delete("IS_MINIMIZED")
appSettings.delete("WINDOW_BOUNDS")
appSettings.save()
DiscordNative.app.relaunch()
break;
case "enable_glasstron":
let appSettings = window.Lightcord.Api.settings
appSettings.set("GLASSTRON", enabled)
appSettings.save()
DiscordNative.app.relaunch()
break;
}
this.saveSettings();

View File

@ -236,15 +236,15 @@
@keyframes emote-pulse {
0% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
50% {
-webkit-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
}
100% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
}
@ -550,12 +550,7 @@
}
.bd-layer {
-ms-flex-direction: column;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
bottom: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
flex-direction: column;
left: 0;
@ -1095,9 +1090,6 @@
}
.ui-switch-item .ui-switch-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;
width: 44px;

View File

@ -42,7 +42,7 @@ module.exports = {
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
options: {
presets: [["@babel/env", {
targets: {
node: "12.8.1",
@ -66,7 +66,6 @@ module.exports = {
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
compress: {drop_debugger:false}
},

2185
BetterDiscordApp/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,654 +0,0 @@
{
"name": "discord.js-lightcord",
"version": "11.6.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "discord.js-lightcord",
"version": "11.6.4",
"license": "ISC",
"dependencies": {
"@discordjs/collection": "0.1.5"
},
"devDependencies": {
"ts-loader": "^7.0.5",
"typescript": "^3.9.5"
}
},
"node_modules/@discordjs/collection": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true,
"engines": {
"node": "*"
}
},
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"dependencies": {
"fill-range": "^7.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"node_modules/core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
},
"node_modules/emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/enhanced-resolve": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.2.0.tgz",
"integrity": "sha512-S7eiFb/erugyd1rLb6mQ3Vuq+EXHv5cpCkNqqIkYkBgN2QdFnyCZzFBleqwGEx4lgNGYij81BWnCrFNK7vxvjQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.1.2",
"memory-fs": "^0.5.0",
"tapable": "^1.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
"integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
"dev": true,
"dependencies": {
"prr": "~1.0.1"
},
"bin": {
"errno": "cli.js"
}
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"node_modules/json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"dependencies": {
"minimist": "^1.2.0"
},
"bin": {
"json5": "lib/cli.js"
}
},
"node_modules/loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/memory-fs": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
"integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
"dev": true,
"dependencies": {
"errno": "^0.1.3",
"readable-stream": "^2.0.1"
},
"engines": {
"node": ">=4.3.0 <5.0.0 || >=5.10"
}
},
"node_modules/micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"dependencies": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
},
"engines": {
"node": ">=8"
}
},
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"node_modules/picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true,
"engines": {
"node": ">=8.6"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
},
"node_modules/prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
"dev": true
},
"node_modules/readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true,
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
},
"node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true,
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/ts-loader": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.5.tgz",
"integrity": "sha512-zXypEIT6k3oTc+OZNx/cqElrsbBtYqDknf48OZos0NQ3RTt045fBIU8RRSu+suObBzYB355aIPGOe/3kj9h7Ig==",
"dev": true,
"dependencies": {
"chalk": "^2.3.0",
"enhanced-resolve": "^4.0.0",
"loader-utils": "^1.0.2",
"micromatch": "^4.0.0",
"semver": "^6.0.0"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/typescript": {
"version": "3.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz",
"integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
}
},
"dependencies": {
"@discordjs/collection": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true
},
"enhanced-resolve": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.2.0.tgz",
"integrity": "sha512-S7eiFb/erugyd1rLb6mQ3Vuq+EXHv5cpCkNqqIkYkBgN2QdFnyCZzFBleqwGEx4lgNGYij81BWnCrFNK7vxvjQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"memory-fs": "^0.5.0",
"tapable": "^1.0.0"
}
},
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
"integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
"dev": true,
"requires": {
"prr": "~1.0.1"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
},
"memory-fs": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
"integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
"dev": true,
"requires": {
"errno": "^0.1.3",
"readable-stream": "^2.0.1"
}
},
"micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
},
"prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
"dev": true
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.0"
}
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==",
"dev": true
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
},
"ts-loader": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.5.tgz",
"integrity": "sha512-zXypEIT6k3oTc+OZNx/cqElrsbBtYqDknf48OZos0NQ3RTt045fBIU8RRSu+suObBzYB355aIPGOe/3kj9h7Ig==",
"dev": true,
"requires": {
"chalk": "^2.3.0",
"enhanced-resolve": "^4.0.0",
"loader-utils": "^1.0.2",
"micromatch": "^4.0.0",
"semver": "^6.0.0"
}
},
"typescript": {
"version": "3.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz",
"integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==",
"dev": true
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
}
}
}

View File

@ -10,10 +10,10 @@
"author": "jeanouina",
"license": "ISC",
"dependencies": {
"@discordjs/collection": "0.1.5"
"@discordjs/collection": "0.2.1"
},
"devDependencies": {
"ts-loader": "^7.0.5",
"typescript": "^3.9.5"
"ts-loader": "^9.2.5",
"typescript": "^4.4.2"
}
}

View File

@ -37,7 +37,7 @@ module.exports = {
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
options: {
presets: [
["@babel/env", {
targets: {

138
DiscordJS/yarn.lock Normal file
View File

@ -0,0 +1,138 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@discordjs/collection@0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.2.1.tgz#ea4bc7b41b7b7b6daa82e439141222ec95c469b2"
integrity sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==
ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
braces@^3.0.1:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
dependencies:
fill-range "^7.0.1"
chalk@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
enhanced-resolve@^5.0.0:
version "5.8.2"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b"
integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.2.0"
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
dependencies:
to-regex-range "^5.0.1"
graceful-fs@^4.2.4:
version "4.2.8"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
micromatch@^4.0.0:
version "4.0.4"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
dependencies:
braces "^3.0.1"
picomatch "^2.2.3"
picomatch@^2.2.3:
version "2.3.0"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
semver@^7.3.4:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
dependencies:
lru-cache "^6.0.0"
supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
has-flag "^4.0.0"
tapable@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==
to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
dependencies:
is-number "^7.0.0"
ts-loader@^9.2.5:
version "9.2.5"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.5.tgz#127733a5e9243bf6dafcb8aa3b8a266d8041dca9"
integrity sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^5.0.0"
micromatch "^4.0.0"
semver "^7.3.4"
typescript@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

File diff suppressed because it is too large Load Diff

View File

@ -4,39 +4,39 @@
"description": "Lightcord's scripting API",
"main": "js/main.js",
"scripts": {
"build": "webpack --progress --colors",
"watch": "webpack --progress --colors --watch",
"build-prod": "webpack --progress --colors --config prod.config.js",
"watch-prod": "webpack --progress --colors --watch --config prod.config.js",
"build": "webpack --progress",
"watch": "webpack --progress --watch",
"build-prod": "webpack --progress --config prod.config.js",
"watch-prod": "webpack --progress --watch --config prod.config.js",
"test": "echo \"Error: no test specified\" && exit 1",
"docs": "typedoc --out ./docs ./src --theme node_modules/eledoc/bin/default/ --sourcefile-url-map sourcefile-map.json"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@types/bandagedbd__bdapi": "^0.2.2",
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.4",
"@babel/preset-react": "^7.14.5",
"@babel/register": "^7.15.3",
"@types/bandagedbd__bdapi": "^0.3.1",
"@types/moment": "^2.13.0",
"@types/react": "^16.9.36",
"@types/react-datepicker": "^3.1.1",
"@types/react-dom": "^16.9.8",
"@types/uuid": "^8.0.0",
"babel-loader": "^8.0.6",
"date-fns": "^2.15.0",
"@types/react": "^17.0.20",
"@types/react-datepicker": "^4.1.6",
"@types/react-dom": "^17.0.9",
"@types/uuid": "^8.3.1",
"babel-loader": "^8.2.2",
"date-fns": "^2.23.0",
"eledoc": "^0.2.1",
"emotion": "^10.0.27",
"react-datepicker": "^3.1.3",
"terser-webpack-plugin": "^3.0.6",
"ts-loader": "^7.0.5",
"typedoc": "^0.17.8",
"emotion": "^11.0.0",
"react-datepicker": "^4.2.1",
"terser-webpack-plugin": "^5.2.3",
"ts-loader": "^9.2.5",
"typedoc": "^0.21.9",
"typedoc-plugin-sourcefile-url": "^1.0.6",
"typescript": "^3.9.5",
"uuid": "^8.1.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
"typescript": "^4.4.2",
"uuid": "^8.3.2",
"webpack": "^5.52.0",
"webpack-cli": "^4.8.0"
},
"types": "./types/index.ts",
"private": true

View File

@ -34,10 +34,11 @@ export function LazyLoad<T>(getObject: () => T):T{
delete mdl[prop]
return true
},
enumerate(target){
// Removed in TS 4.2
/*enumerate(target){
setModule()
return Object.keys(mdl)
},
},*/
ownKeys(target) {
setModule()
return Object.keys(mdl)

View File

@ -1,5 +1,4 @@
import * as uuidv1 from "uuid/v1"
import * as uuidv4 from "uuid/v4"
import {v1 as uuidv1, v4 as uuidv4} from "uuid";
type uuidFunc = () => string
let uuid:uuidFunc & {v1: uuidFunc, v4: uuidFunc} = Object.assign(function(){

View File

@ -39,7 +39,7 @@ module.exports = {
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
options: {
presets: [
["@babel/env", {
targets: {
@ -58,9 +58,7 @@ module.exports = {
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true,
terserOptions: {
mangle: false,
keep_classnames: true,

2605
LightcordApi/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -56,14 +56,14 @@ Alternatively, download the installer from the [releases tab](https://github.com
# Running From Source
Prerequisites: [Node.js](https://nodejs.org/en/) and NPM
Prerequisites: [Node.js](https://nodejs.org/en/) and yarn
To run from source, follow these instructions:
```bash
git clone https://github.com/Lightcord/Lightcord
cd Lightcord
npm run devInstall
npm test
yarn devInstall
yarn test
```
*You will have to do that every time you pull/clone*
@ -75,5 +75,5 @@ Lightcord will then launch. If you see the Lightcord icon, you're good to go!
Any time you want to launch, just run:
```bash
npm start
yarn start
```

View File

@ -1,5 +1,5 @@
const EventEmitter = require('events');
const {CloudSync: CloudSyncNative} = require('./discord_cloudsync_'+process.platform+'.node');
const {CloudSync: CloudSyncNative} = require('./discord_cloudsync.node');
const BACKSLASH_REGEX = /\\/g;
const ID_REGEX = /^[0-9]+$/;

View File

@ -385,7 +385,8 @@ async function privateInit(){
dispatcher.subscribe(constants.ActionTypes.CONNECTION_OPEN || "CONNECTION_OPEN", onConn)
}*/
const BetterDiscord = new(require(formatMinified("../../../../../BetterDiscordApp/dist/index{min}.js")).default)(BetterDiscordConfig, require("./betterdiscord"))
const BetterDiscordModule = await require(formatMinified("../../../../../BetterDiscordApp/dist/index{min}.js"));
const BetterDiscord = new BetterDiscordModule.BetterDiscord.default(BetterDiscordConfig, require("./betterdiscord"));
const Utils = window.Lightcord.BetterDiscord.Utils
const DOMTools = window.Lightcord.BetterDiscord.DOM

View File

@ -1,8 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.startup = startup;
exports.handleOpenUrl = handleOpenUrl;
exports.setMainWindowVisible = setMainWindowVisible;
@ -11,7 +8,7 @@ const {
Menu,
BrowserWindow
} = require('electron');
const fetch = require("node-fetch").default
const fetch = require("node-fetch");
let mainScreen

View File

@ -62,12 +62,8 @@ var _updater = _interopRequireDefault(require("./updater"));
var notificationScreen = _interopRequireWildcard(require("./notificationScreen"));
var paths = _interopRequireWildcard(require("./paths"));
var popoutWindows = _interopRequireWildcard(require("./popoutWindows"));
var splashScreen = _interopRequireWildcard(require("./splashScreen"));
var systemTray = _interopRequireWildcard(require("./systemTray"));
var _Constants = require("./Constants");
@ -469,6 +465,8 @@ function launchMainAppWindow(isVisible) {
const useGlasstron = settings.get("GLASSTRON", true)
const BrowserWindow = useGlasstron ? glasstron.BrowserWindow : _electron.BrowserWindow
mainWindow = new BrowserWindow(mainWindowOptions);
// Show devtools
mainWindow.webContents.openDevTools();
mainWindowId = mainWindow.id;
global.mainWindowId = mainWindowId;
@ -493,6 +491,7 @@ function launchMainAppWindow(isVisible) {
}
}
// TODO(@AaronDewes): This is deprecated
mainWindow.webContents.on('new-window', (e, windowURL, frameName, disposition, options) => {
e.preventDefault();

View File

@ -91,7 +91,7 @@ window.onload = () => {
favicon: faviconURL
})
let webview = document.createElement("webview")
webview.src = "https://discord.com/app"
webview.src = "https://canary.discord.com/app"
webview.classList.add("discord-webview")
webview.classList.add("webview-active")
webview.setAttribute("preload", pathToFileURL(join(__dirname, "../tabPreload.js")))

View File

@ -0,0 +1,784 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ajv@^6.12.3:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
dependencies:
fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
array.prototype.map@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/array.prototype.map/-/array.prototype.map-1.0.3.tgz#1609623618d3d84134a37d4a220030c2bd18420b"
integrity sha512-nNcb30v0wfDyIe26Yif3PcV1JXQp4zEeEfupG7L4SRjnD6HLbO5b2a7eVSba53bOx4YCHYMBHt+Fp4vYstneRA==
dependencies:
call-bind "^1.0.0"
define-properties "^1.1.3"
es-abstract "^1.18.0-next.1"
es-array-method-boxes-properly "^1.0.0"
is-string "^1.0.5"
asn1@~0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
dependencies:
safer-buffer "~2.1.0"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
aws4@^1.8.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
dependencies:
tweetnacl "^0.14.3"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
call-bind@^1.0.0, call-bind@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
dependencies:
function-bind "^1.1.1"
get-intrinsic "^1.0.2"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
chrome-tabs@^5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/chrome-tabs/-/chrome-tabs-5.4.0.tgz#8bffbc58ba080d9a317268f06f1a3bf81cbc1879"
integrity sha512-o2uzqwMleD0plpO4jghgkwIYGY/493/0DT+t8lvaGqGYUOstaKzYnkN/46Iv8LhPpR3S388TRQd7BveeOK8ECg==
dependencies:
draggabilly "2.2.0"
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
core-util-is@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
dependencies:
assert-plus "^1.0.0"
define-properties@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
dependencies:
object-keys "^1.0.12"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
draggabilly@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/draggabilly/-/draggabilly-2.2.0.tgz#9bac6849816c5cd4e4a59707f63f14ea7d863baf"
integrity sha512-SygXstYyzRgLcb7VGr03QYC7166wgoaUfBoA9y+hiI7Swkyct4NNFDrEmO6T4Sz35qo71j0QAmuTagUGcwxWbg==
dependencies:
get-size "^2.0.2"
unidragger "^2.3.0"
ecc-jsbn@~0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
dependencies:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2:
version "1.18.5"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19"
integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==
dependencies:
call-bind "^1.0.2"
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
get-intrinsic "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.2"
internal-slot "^1.0.3"
is-callable "^1.2.3"
is-negative-zero "^2.0.1"
is-regex "^1.1.3"
is-string "^1.0.6"
object-inspect "^1.11.0"
object-keys "^1.1.1"
object.assign "^4.1.2"
string.prototype.trimend "^1.0.4"
string.prototype.trimstart "^1.0.4"
unbox-primitive "^1.0.1"
es-array-method-boxes-properly@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e"
integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==
es-get-iterator@^1.0.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7"
integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==
dependencies:
call-bind "^1.0.2"
get-intrinsic "^1.1.0"
has-symbols "^1.0.1"
is-arguments "^1.1.0"
is-map "^2.0.2"
is-set "^2.0.2"
is-string "^1.0.5"
isarray "^2.0.5"
es-to-primitive@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==
dependencies:
is-callable "^1.1.4"
is-date-object "^1.0.1"
is-symbol "^1.0.2"
ev-emitter@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ev-emitter/-/ev-emitter-1.1.1.tgz#8f18b0ce5c76a5d18017f71c0a795c65b9138f2a"
integrity sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q==
extend@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
fast-deep-equal@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-json-stable-stringify@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
fd-slicer@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=
dependencies:
pend "~1.2.0"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
dependencies:
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.1"
get-size@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/get-size/-/get-size-2.0.3.tgz#54a1d0256b20ea7ac646516756202769941ad2ef"
integrity sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
dependencies:
assert-plus "^1.0.0"
glob@^7.1.3:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
har-validator@~5.1.0:
version "5.1.5"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd"
integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==
dependencies:
ajv "^6.12.3"
har-schema "^2.0.0"
has-bigints@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113"
integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==
has-symbols@^1.0.1, has-symbols@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
has@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
dependencies:
function-bind "^1.1.1"
http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
dependencies:
assert-plus "^1.0.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
internal-slot@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c"
integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==
dependencies:
get-intrinsic "^1.1.0"
has "^1.0.3"
side-channel "^1.0.4"
invariant@2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"
is-arguments@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9"
integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==
dependencies:
call-bind "^1.0.0"
is-bigint@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a"
integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==
is-boolean-object@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8"
integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==
dependencies:
call-bind "^1.0.2"
is-callable@^1.1.4, is-callable@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==
is-date-object@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5"
integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==
is-map@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127"
integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==
is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.5"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb"
integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==
is-regex@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f"
integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==
dependencies:
call-bind "^1.0.2"
has-symbols "^1.0.2"
is-set@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec"
integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==
is-string@^1.0.5, is-string@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f"
integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==
is-symbol@^1.0.2, is-symbol@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c"
integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==
dependencies:
has-symbols "^1.0.2"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
isarray@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
iterate-iterator@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/iterate-iterator/-/iterate-iterator-1.0.1.tgz#1693a768c1ddd79c969051459453f082fe82e9f6"
integrity sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==
iterate-value@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/iterate-value/-/iterate-value-1.0.2.tgz#935115bd37d006a52046535ebc8d07e9c9337f57"
integrity sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==
dependencies:
es-get-iterator "^1.0.2"
iterate-iterator "^1.0.1"
"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
dependencies:
assert-plus "1.0.0"
extsprintf "1.3.0"
json-schema "0.2.3"
verror "1.10.0"
"localstorage-polyfill@git+https://github.com/JeanOUINA/localstorage-polyfill.git":
version "1.0.1"
resolved "git+https://github.com/JeanOUINA/localstorage-polyfill.git#2c29b8a919c19a9b8e3170fdb3fbf91364bdc14a"
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
loose-envify@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
mime-db@1.49.0:
version "1.49.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed"
integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==
mime-types@^2.1.12, mime-types@~2.1.19:
version "2.1.32"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5"
integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==
dependencies:
mime-db "1.49.0"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
dependencies:
brace-expansion "^1.1.7"
mkdirp@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
oauth-sign@~0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
object-inspect@^1.11.0, object-inspect@^1.9.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==
object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
object.assign@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
dependencies:
call-bind "^1.0.0"
define-properties "^1.1.3"
has-symbols "^1.0.1"
object-keys "^1.1.1"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
pend@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
promise.allsettled@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/promise.allsettled/-/promise.allsettled-1.0.4.tgz#65e71f2a604082ed69c548b68603294090ee6803"
integrity sha512-o73CbvQh/OnPFShxHcHxk0baXR2a1m4ozb85ha0H14VEoi/EJJLa9mnPfEWJx9RjA9MLfhdjZ8I6HhWtBa64Ag==
dependencies:
array.prototype.map "^1.0.3"
call-bind "^1.0.2"
define-properties "^1.1.3"
es-abstract "^1.18.0-next.2"
get-intrinsic "^1.0.2"
iterate-value "^1.0.2"
psl@^1.1.24:
version "1.8.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
punycode@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
qs@~6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
request@2.88.0:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
caseless "~0.12.0"
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
har-validator "~5.1.0"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
oauth-sign "~0.9.0"
performance-now "^2.1.0"
qs "~6.5.2"
safe-buffer "^5.1.2"
tough-cookie "~2.4.3"
tunnel-agent "^0.6.0"
uuid "^3.3.2"
rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
dependencies:
glob "^7.1.3"
safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
sshpk@^1.7.0:
version "1.16.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
bcrypt-pbkdf "^1.0.0"
dashdash "^1.12.0"
ecc-jsbn "~0.1.1"
getpass "^0.1.1"
jsbn "~0.1.0"
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"
string.prototype.trimend@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80"
integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.3"
string.prototype.trimstart@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed"
integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.3"
tough-cookie@~2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
dependencies:
psl "^1.1.24"
punycode "^1.4.1"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
dependencies:
safe-buffer "^5.0.1"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==
dependencies:
function-bind "^1.1.1"
has-bigints "^1.0.1"
has-symbols "^1.0.2"
which-boxed-primitive "^1.0.2"
unidragger@^2.3.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/unidragger/-/unidragger-2.3.1.tgz#2e8c34feff61affa96dc895234ddfc1ea4ec7515"
integrity sha512-u+IgG7AG0MXJTKcdzAIYxCm+W5FcnA9M28203Awl6jIcE3/+9OtEyUX4Wv64y7XNKEVRKPot52IV4V6x7FlF5Q==
dependencies:
unipointer "^2.3.0"
unipointer@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/unipointer/-/unipointer-2.3.0.tgz#ba0dc462ce31c2a88e80810e19c3bae0ce47ed9f"
integrity sha512-m85sAoELCZhogI1owtJV3Dva7GxkHk2lI7A0otw3o0OwCuC/Q9gi7ehddigEYIAYbhkqNdri+dU1QQkrcBvirQ==
dependencies:
ev-emitter "^1.0.1"
uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
dependencies:
punycode "^2.1.0"
uuid@^3.3.2:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
dependencies:
assert-plus "^1.0.0"
core-util-is "1.0.2"
extsprintf "^1.2.0"
which-boxed-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==
dependencies:
is-bigint "^1.0.1"
is-boolean-object "^1.1.0"
is-number-object "^1.0.4"
is-string "^1.0.5"
is-symbol "^1.0.3"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
yauzl@^2.10.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
dependencies:
buffer-crc32 "~0.2.3"
fd-slicer "~1.1.0"

View File

@ -1 +1,24 @@
module.exports = require('./discord_game_utils_'+process.platform+'.node');
// On arm64, provide dummy functiona
/*
Provide dummys for
beforeUnload
identifyGame
findLaunchable
isProtocolSchemeRegistered
createShortcuts
removeShortcuts
setRecentGames
*/
if(process.arch === "arm64") {
module.exports = {
beforeUnload: (...args) => {console.log(`beforeUnload called with ${args.join(", ")}`);},
identifyGame: (...args) => {console.log(`identifyGame called with ${args.join(", ")}`);},
findLaunchable: (...args) => {console.log(`findLaunchable called with ${args.join(", ")}`);},
isProtocolSchemeRegistered: (...args) => {console.log(`isProtocolSchemeRegistered called with ${args.join(", ")}`);},
createShortcuts: (...args) => {console.log(`createShortcuts called with ${args.join(", ")}`);},
removeShortcuts: (...args) => {console.log(`removeShortcuts called with ${args.join(", ")}`);},
setRecentGames: (...args) => {console.log(`setRecentGames called with ${args.join(", ")}`);},
};
} else {
module.exports = require('./discord_game_utils_'+process.platform+'.node');
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -30,7 +30,9 @@ var ipcMain = {
}
};
ipcMain.on('OPEN_EXTERNAL_URL', function (e, externalUrl) {
saferShellOpenExternal(externalUrl);
saferShellOpenExternal(externalUrl)["catch"](function (_err) {
console.error('Failed to open external URL', externalUrl);
});
});
function webContentsSend(win, event) {

View File

@ -19,12 +19,12 @@ function saferShellOpenExternal(externalUrl) {
try {
parsedUrl = _url["default"].parse(externalUrl);
} catch (_) {
return;
return Promise.reject();
}
if (parsedUrl.protocol == null || BLOCKED_URL_PROTOCOLS.includes(parsedUrl.protocol.toLowerCase())) {
return;
return Promise.reject();
}
_electron.shell.openExternal(externalUrl);
return _electron.shell.openExternal(externalUrl);
}

View File

@ -1,6 +1,6 @@
"use strict";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

View File

@ -1,6 +1,6 @@
"use strict";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

View File

@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
exports.createSafeEmitter = createSafeEmitter;
exports["default"] = void 0;
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

View File

@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ws@^7.2.3:
version "7.5.3"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74"
integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==

View File

@ -1,24 +1,3 @@
// [adill] This is not context aware and, as such, won't load in newer Electron versions
// We can and should strip `discord_spellcheck` down to CLD only once all channels are on Electron 9
function getLegacySpellchecker() {
const Spellchecker = require('spellchecker').Spellchecker;
const instance = new Spellchecker();
return {
setDictionary: instance.setDictionary.bind(instance),
getAvailableDictionaries: instance.getAvailableDictionaries.bind(instance),
isMisspelled: instance.isMisspelled.bind(instance),
getCorrectionsForMisspelling: instance.getCorrectionsForMisspelling.bind(instance),
};
}
// [adill] This is not context aware and, as such, won't load in newer Electron versions
// We can and should strip `discord_spellcheck` down to CLD only once all channels are on Electron 9
function getKeyboardLayout() {
return require('keyboard-layout');
}
module.exports = {
cld: require('cld'),
getLegacySpellchecker,
getKeyboardLayout,
};

View File

@ -0,0 +1,53 @@
const updater = require('./updater');
const nativeUpdater = require('./updater.node');
const path = require('path');
const process = require('process');
// TODO(eiz): set things up so we can use desktop core constants properly.
const {ipcRenderer} = require('electron');
const ALLOWED_CHANNELS = ['stable', 'ptb', 'canary', 'development'];
const ALLOWED_PLATFORMS = ['win'];
let bootstrapUpdater;
async function bootstrap(releaseChannel, platform) {
if (!ALLOWED_CHANNELS.includes(releaseChannel) || !ALLOWED_PLATFORMS.includes(platform)) {
throw new Error('You tried.');
}
bootstrapUpdater = new updater.Updater({
nativeUpdaterModule: nativeUpdater,
release_channel: releaseChannel,
platform: platform,
// Sorry _app, you can't pass this in =)
repository_url: 'https://discord.com/api/updates/',
root_path: path.join(path.dirname(process.execPath), '..'),
});
let downloadedAnything = false;
bootstrapUpdater.on('host-updated', () => {
try {
ipcRenderer.send('DISCORD_UPDATE_OPEN_ON_STARTUP');
} catch (e) {
console.log('Failed to update autostart registration after bootstrap:', e);
}
});
await bootstrapUpdater.updateToLatest((progress) => {
const task = progress.task;
const downloadTask = task.HostDownload || task.ModuleDownload;
if (downloadTask != null) {
downloadedAnything = true;
}
});
}
async function finishBootstrap() {
const versions = await bootstrapUpdater.queryCurrentVersions();
ipcRenderer.send('DISCORD_NATIVE_MODULES_FINISH_UPDATER_BOOTSTRAP', versions.current_host);
}
module.exports.bootstrap = bootstrap;
module.exports.finishBootstrap = finishBootstrap;

View File

@ -1,65 +1,205 @@
const execa = require('execa');
const superagent = require('superagent');
const execa = require("execa");
const superagent = require("superagent");
const {
inputCaptureSetWatcher,
inputCaptureRegisterElement,
} = require('./input_capture');
} = require("./input_capture");
const {
wrapInputEventRegister,
wrapInputEventUnregister,
} = require('./input_event');
} = require("./input_event");
module.exports = require('./discord_utils_'+process.platform+'.node');
module.exports.clearCandidateGamesCallback = module.exports.setCandidateGamesCallback;
if (process.arch === "arm64") {
module.exports = {
/* Dummy replacement functions
This provides empty functions for
_keydown
keyup
focused
blurred
beforeUnload
inputEventRegister
inputEventUnregister
inputWatchAll
inputSetFocused
inputGetRegisteredEvents
setCandidateGamesCallback
setObservedGamesCallback
setGameCandidateOverrides
undetectPid
notifyGameLaunched
shouldDisplayNotifications
setProcessPriority
getPidFromWindowHandle
getWindowHandleFromPid
generateSessionFromPid
getAudioPid
setForegroundProcess
isSystemDarkMode
_generateLiveMinidump
nativePermssionRequestAuthorization
nativePermssionHasAuthorization
nativePermissionOpenSettings
*/
_keydown: (...args) => {
console.log(`_keydown called with ${args.join(", ")}`);
},
keyup: (...args) => {
console.log(`keyup called with ${args.join(", ")}`);
},
focused: (...args) => {
console.log(`focused called with ${args.join(", ")}`);
},
blurred: (...args) => {
console.log(`blurred called with ${args.join(", ")}`);
},
beforeUnload: (...args) => {
console.log(`beforeUnload called with ${args.join(", ")}`);
},
inputEventRegister: (eventId, buttons, callback, options) => {
console.log(
`inputEventRegister called with ${eventId}, ${buttons}, ${callback}, ${options}`
);
},
inputEventUnregister: (eventId) => {
console.log(`inputEventUnregister called with ${eventId}`);
},
inputWatchAll: (...args) => {
console.log(`inputWatchAll called with ${args.join(", ")}`);
},
inputSetFocused: (...args) => {
console.log(`inputSetFocused called with ${args.join(", ")}`);
},
inputGetRegisteredEvents: (...args) => {
console.log(`inputGetRegisteredEvents called with ${args.join(", ")}`);
},
setCandidateGamesCallback: (...args) => {
console.log(`setCandidateGamesCallback called with ${args.join(", ")}`);
},
setObservedGamesCallback: (...args) => {
console.log(`setObservedGamesCallback called with ${args.join(", ")}`);
},
setGameCandidateOverrides: (...args) => {
console.log(`setGameCandidateOverrides called with ${args.join(", ")}`);
},
setProcessPriority: (...args) => {
console.log(`setProcessPriority called with ${args.join(", ")}`);
},
getPidFromWindowHandle: (...args) => {
console.log(`getPidFromWindowHandle called with ${args.join(", ")}`);
},
getWindowHandleFromPid: (...args) => {
console.log(`getWindowHandleFromPid called with ${args.join(", ")}`);
},
generateSessionFromPid: (...args) => {
console.log(`generateSessionFromPid called with ${args.join(", ")}`);
},
getAudioPid: (...args) => {
console.log(`getAudioPid called with ${args.join(", ")}`);
},
setForegroundProcess: (...args) => {
console.log(`setForegroundProcess called with ${args.join(", ")}`);
},
isSystemDarkMode: (...args) => {
console.log(`isSystemDarkMode called with ${args.join(", ")}`);
return true;
},
_generateLiveMinidump: (...args) => {
console.log(`_generateLiveMinidump called with ${args.join(", ")}`);
},
nativePermissionRequestAuthorization: (...args) => {
console.log(
`nativePermissionRequestAuthorization called with ${args.join(", ")}`
);
},
nativePermissionHasAuthorization: (...args) => {
console.log(
`nativePermissionHasAuthorization called with ${args.join(", ")}`
);
},
nativePermissionOpenSettings: (...args) => {
console.log(
`nativePermissionOpenSettings called with ${args.join(", ")}`
);
},
shouldDisplayNotifications: (...args) => {
console.log(`shouldDisplayNotifications called with ${args.join(", ")}`);
return true;
},
// Defined below, not part of native code
submitLiveCrashReport: async (channel, sentryMetadata) => {
console.error("CRASH!");
console.info(JSON.stringify(sentryMetadata));
console.info(channel);
},
clearCandidateGamesCallback: (...args) => {
console.log(`clearCandidateGamesCallback called with ${args.join(", ")}`);
},
inputCaptureRegisterElement: inputCaptureRegisterElement,
getGPUDriverVersions: async () => {
return {};
},
};
} else {
module.exports = require("./discord_utils_" + process.platform + ".node");
module.exports.clearCandidateGamesCallback =
module.exports.setCandidateGamesCallback;
inputCaptureSetWatcher(module.exports.inputWatchAll);
delete module.exports.inputWatchAll;
module.exports.inputCaptureRegisterElement = inputCaptureRegisterElement;
inputCaptureSetWatcher(module.exports.inputWatchAll);
delete module.exports.inputWatchAll;
module.exports.inputCaptureRegisterElement = inputCaptureRegisterElement;
module.exports.inputEventRegister = wrapInputEventRegister(module.exports.inputEventRegister);
module.exports.inputEventUnregister = wrapInputEventUnregister(module.exports.inputEventUnregister);
module.exports.inputEventRegister = wrapInputEventRegister(
module.exports.inputEventRegister
);
module.exports.inputEventUnregister = wrapInputEventUnregister(
module.exports.inputEventUnregister
);
function parseNvidiaSmiOutput(result) {
if (!result || !result.stdout) {
return {error: 'nvidia-smi produced no output'};
function parseNvidiaSmiOutput(result) {
if (!result || !result.stdout) {
return { error: "nvidia-smi produced no output" };
}
const match = result.stdout.match(/Driver Version: (\d+)\.(\d+)/);
if (match.length === 3) {
return { major: parseInt(match[1], 10), minor: parseInt(match[2], 10) };
} else {
return { error: "failed to parse nvidia-smi output" };
}
}
const match = result.stdout.match(/Driver Version: (\d+)\.(\d+)/);
module.exports.getGPUDriverVersions = async () => {
if (process.platform !== "win32") {
return {};
}
if (match.length === 3) {
return {major: parseInt(match[1], 10), minor: parseInt(match[2], 10)};
} else {
return {error: 'failed to parse nvidia-smi output'};
}
const result = {};
const nvidiaSmiPath = `${process.env["ProgramW6432"]}/NVIDIA Corporation/NVSMI/nvidia-smi.exe`;
try {
result.nvidia = parseNvidiaSmiOutput(await execa(nvidiaSmiPath, []));
} catch (e) {
result.nvidia = { error: e.toString() };
}
return result;
};
module.exports.submitLiveCrashReport = async (channel, sentryMetadata) => {
const path = module.exports._generateLiveMinidump();
if (!path) {
return null;
}
await superagent
.post(
"https://sentry.io/api/146342/minidump/?sentry_key=f11e8c3e62cb46b5a006c339b2086ba3"
)
.attach("upload_file_minidump", path)
.field("channel", channel)
.field("sentry", JSON.stringify(sentryMetadata));
};
}
module.exports.getGPUDriverVersions = async () => {
if (process.platform !== 'win32') {
return {};
}
const result = {};
const nvidiaSmiPath = `${process.env['ProgramW6432']}/NVIDIA Corporation/NVSMI/nvidia-smi.exe`;
try {
result.nvidia = parseNvidiaSmiOutput(await execa(nvidiaSmiPath, []));
} catch (e) {
result.nvidia = {error: e.toString()};
}
return result;
};
module.exports.submitLiveCrashReport = async (channel, sentryMetadata) => {
const path = module.exports._generateLiveMinidump();
if (!path) {
return null;
}
await superagent
.post('https://sentry.io/api/146342/minidump/?sentry_key=f11e8c3e62cb46b5a006c339b2086ba3')
.attach('upload_file_minidump', path)
.field('channel', channel)
.field('sentry', JSON.stringify(sentryMetadata));
};

View File

@ -0,0 +1,400 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
call-bind@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
dependencies:
function-bind "^1.1.1"
get-intrinsic "^1.0.2"
combined-stream@^1.0.6, combined-stream@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"
component-emitter@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==
cookiejar@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c"
integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==
cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"
cross-spawn@^7.0.0:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
which "^2.0.1"
debug@^4.1.1, debug@^4.3.1:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
dependencies:
ms "2.1.2"
delayed-stream@^1.0.0, delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
end-of-stream@^1.1.0, end-of-stream@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
dependencies:
once "^1.4.0"
execa@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-2.1.0.tgz#e5d3ecd837d2a60ec50f3da78fd39767747bbe99"
integrity sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==
dependencies:
cross-spawn "^7.0.0"
get-stream "^5.0.0"
is-stream "^2.0.0"
merge-stream "^2.0.0"
npm-run-path "^3.0.0"
onetime "^5.1.0"
p-finally "^2.0.0"
signal-exit "^3.0.2"
strip-final-newline "^2.0.0"
fast-safe-stringify@^2.0.7:
version "2.0.8"
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz#dc2af48c46cf712b683e849b2bbd446b32de936f"
integrity sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==
form-data@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"
form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"
formidable@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9"
integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==
function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
get-intrinsic@^1.0.2:
version "1.1.1"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
dependencies:
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.1"
get-stream@^5.0.0, get-stream@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3"
integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==
dependencies:
pump "^3.0.0"
has-symbols@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
has@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
dependencies:
function-bind "^1.1.1"
inherits@^2.0.3, inherits@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
is-stream@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
methods@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
mime-db@1.49.0, mime-db@^1.46.0:
version "1.49.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed"
integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==
mime-types@^2.1.12, mime-types@^2.1.29:
version "2.1.32"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5"
integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==
dependencies:
mime-db "1.49.0"
mime@^2.4.6, mime@^2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe"
integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==
mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
nice-try@^1.0.4, nice-try@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
npm-run-path@^3.0.0, npm-run-path@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-3.1.0.tgz#7f91be317f6a466efed3c9f2980ad8a4ee8b0fa5"
integrity sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==
dependencies:
path-key "^3.0.0"
object-inspect@^1.9.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==
once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
onetime@^5.1.0:
version "5.1.2"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==
dependencies:
mimic-fn "^2.1.0"
p-finally@^2.0.0, p-finally@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561"
integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==
path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
path-key@^3.0.0, path-key@^3.1.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
qs@^6.9.4, qs@^6.9.6:
version "6.10.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a"
integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==
dependencies:
side-channel "^1.0.4"
readable-stream@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
safe-buffer@^5.2.1, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
semver@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
semver@^7.3.2:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
dependencies:
lru-cache "^6.0.0"
shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
dependencies:
shebang-regex "^1.0.0"
shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
dependencies:
shebang-regex "^3.0.0"
shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
shebang-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
signal-exit@^3.0.2, signal-exit@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
string_decoder@^1.1.1, string_decoder@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
strip-final-newline@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
superagent@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/superagent/-/superagent-5.3.1.tgz#d62f3234d76b8138c1320e90fa83dc1850ccabf1"
integrity sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==
dependencies:
component-emitter "^1.3.0"
cookiejar "^2.1.2"
debug "^4.1.1"
fast-safe-stringify "^2.0.7"
form-data "^3.0.0"
formidable "^1.2.2"
methods "^1.1.2"
mime "^2.4.6"
qs "^6.9.4"
readable-stream "^3.6.0"
semver "^7.3.2"
util-deprecate@^1.0.1, util-deprecate@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
which@^1.2.9, which@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
dependencies:
isexe "^2.0.0"
which@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
dependencies:
isexe "^2.0.0"
wrappy@1, wrappy@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

View File

@ -1,4 +1,8 @@
const VoiceEngine = require('./discord_voice_'+process.platform+'.node');
if(process.arch === 'arm64') {
const VoiceEngine = {};
} else {
const VoiceEngine = require('./discord_voice_'+process.platform+'.node');
}
const fs = require('fs');
const path = require('path');
const yargs = require('yargs');
@ -69,268 +73,395 @@ if (debugLogging && console.discordVoiceHooked == null) {
}
}
features.declareSupported('voice_panning');
features.declareSupported('voice_multiple_connections');
features.declareSupported('media_devices');
features.declareSupported('media_video');
features.declareSupported('debug_logging');
features.declareSupported('set_audio_device_by_id');
features.declareSupported('set_video_device_by_id');
features.declareSupported('loopback');
features.declareSupported('experiment_config');
features.declareSupported('remote_locus_network_control');
features.declareSupported('connection_replay');
features.declareSupported('simulcast');
features.declareSupported('direct_video');
// Do nothing on arm64 for now, we can't decompile native code (and recompile it for arm64) easily
// without breaking compatibility.
if (process.arch === 'arm64') {
console.warn("Voice engine: Not supported");
module.exports = {
if (process.platform === 'win32') {
features.declareSupported('voice_legacy_subsystem');
features.declareSupported('soundshare');
features.declareSupported('wumpus_video');
features.declareSupported('hybrid_video');
features.declareSupported('elevated_hook');
features.declareSupported('soundshare_loopback');
features.declareSupported('screen_previews');
features.declareSupported('window_previews');
features.declareSupported('audio_debug_state');
features.declareSupported('video_effects');
// NOTE(jvass): currently there's no experimental encoders! Add this back if you
// add one and want to re-enable the UI for them.
// features.declareSupported('experimental_encoders');
}
setOnVoiceCallback:(...args) => {},
setEmitVADLevel:(...args) => {},
setTransportOptions:(...args) => {},
setDeviceChangeCallback:(...args) => {},
setOutputDevice:(...args) => {},
setInputDevice:(...args) => {},
setVideoInputDevice:(...args) => {},
getOutputDevices:(...args) => {},
getInputDevices:(...args) => {},
getVideoInputDevices:(...args) => {},
setVideoOutputSink:(...args) => {},
addDirectVideoOutputSink:(...args) => {},
removeDirectVideoOutputSink:(...args) => {},
signalVideoOutputSinkReady:(...args) => {},
setImageDataAllocator:(...args) => {},
setInputVolume:(...args) => {},
setOutputVolume:(...args) => {},
setVolumeChangeCallback:(...args) => {},
setNoInputThreshold:(...args) => {},
setNoInputCallback:(...args) => {},
getSupportedVideoCodecs:(...args) => {},
setExperimentalAdm:(...args) => {},
getAudioSubsystem:(...args) => {},
getDesktopSources:(...args) => {},
pingVoiceThread:(...args) => {},
getScreenPreviews:(...args) => {},
getWindowPreviews:(...args) => {},
consoleLog:(...args) => {},
writeAudioDebugState:(...args) => {},
setAecDump:(...args) => {},
rankRtcRegions:(...args) => {},
getSoundshareStatus:(...args) => {},
enableSoundshare:(...args) => {},
setVideoInputInitializationCallback:(...args) => {},
setOnSpeakingCallback:(...args) => {},
setOnSpeakingWhileMutedCallback:(...args) => {},
setRemoteUserSpeakingStatus:(...args) => {},
setRemoteUserCanHavePriority:(...args) => {},
setPingCallback:(...args) => {},
setPingTimeoutCallback:(...args) => {},
setPingInterval:(...args) => {},
configureConnectionRetries:(...args) => {},
getEncryptionModes:(...args) => {},
destroy:(...args) => {},
mergeUsers:(...args) => {},
destroyUser:(...args) => {},
setVideoBroadcast:(...args) => {},
setOnVideoCallback:(...args) => {},
setOnDesktopSourceEnded:(...args) => {},
setDesktopSource:(...args) => {},
setDesktopSourceWithOptions:(...args) => {},
clearDesktopSource:(...args) => {},
setDesktopSourceStatusCallback:(...args) => {},
setOnSoundshare:(...args) => {},
setOnSoundshareEnded:(...args) => {},
setOnSoundshareFailed:(...args) => {},
setLocalPan:(...args) => {},
setLocalVolume:(...args) => {},
setLocalMute:(...args) => {},
setSelfMute:(...args) => {},
setSelfDeafen:(...args) => {},
setDisableLocalVideo:(...args) => {},
setMinimumOutputDelay:(...args) => {},
setPTTActive:(...args) => {},
getFilteredStats:(...args) => {},
startReplay:(...args) => {},
VoiceConnection:(...args) => {},
VoiceReplayConnection:(...args) => {},
inputMode:(...args) => {},
inputModeOptions:(...args) => {},
attenuation:(...args) => {},
attenuationFactor:(...args) => {},
attenuateWhileSpeakingSelf:(...args) => {},
attenuateWhileSpeakingOthers:(...args) => {},
encodingBitRate:(...args) => {},
encodingVoiceBitRate:(...args) => {},
encodingVideoBitRate:(...args) => {},
encodingVideoMaxBitRate:(...args) => {},
encodingVideoMinBitRate:(...args) => {},
encodingVideoWidth:(...args) => {},
encodingVideoHeight:(...args) => {},
encodingVideoFrameRate:(...args) => {},
remoteSinkWantsPixelCount:(...args) => {},
remoteSinkWantsMaxFramerate:(...args) => {},
encodingVideoDegradationPreference:(...args) => {},
experimentalEncoders:(...args) => {},
hardwareH264:(...args) => {},
minimumOutputDelay:(...args) => {},
simulatedPacketLoss:(...args) => {},
packetLossRate:(...args) => {},
callMinBitRate:(...args) => {},
callBitRate:(...args) => {},
callMaxBitRate:(...args) => {},
soundsharePid:(...args) => {},
soundshareLoopback:(...args) => {},
prioritySpeakerDucking:(...args) => {},
encryptionSettings:(...args) => {},
secretKey:(...args) => {},
videoEncoder:(...args) => {},
videoDecoders:(...args) => {},
audioEncoder:(...args) => {},
audioDecoders:(...args) => {},
enableVideoEffects:(...args) => {},
bypassVideoEffects:(...args) => {},
streamParameters:(...args) => {},
postponeDecodeLevel:(...args) => {},
reconnectInterval:(...args) => {},
rtxType:(...args) => {},
pacsize:(...args) => {},
rtxSsrc:(...args) => {},
maxBitrate:(...args) => {},
maxPixelCount:(...args) => {},
audioSsrc:(...args) => {},
videoSsrc:(...args) => {},
screen:(...args) => {},
useVideoHook:(...args) => {},
useQuartzCapturer:(...args) => {},
hdrCaptureMode:(...args) => {},
};
} else {
features.declareSupported('voice_panning');
features.declareSupported('voice_multiple_connections');
features.declareSupported('media_devices');
features.declareSupported('media_video');
features.declareSupported('debug_logging');
features.declareSupported('set_audio_device_by_id');
features.declareSupported('set_video_device_by_id');
features.declareSupported('loopback');
features.declareSupported('experiment_config');
features.declareSupported('remote_locus_network_control');
features.declareSupported('connection_replay');
features.declareSupported('simulcast');
features.declareSupported('direct_video');
function bindConnectionInstance(instance) {
return {
destroy: () => instance.destroy(),
setTransportOptions: (options) => instance.setTransportOptions(options),
setSelfMute: (mute) => instance.setSelfMute(mute),
setSelfDeafen: (deaf) => instance.setSelfDeafen(deaf),
mergeUsers: (users) => instance.mergeUsers(users),
destroyUser: (userId) => instance.destroyUser(userId),
setLocalVolume: (userId, volume) => instance.setLocalVolume(userId, volume),
setLocalMute: (userId, mute) => instance.setLocalMute(userId, mute),
setLocalPan: (userId, left, right) => instance.setLocalPan(userId, left, right),
setDisableLocalVideo: (userId, disabled) => instance.setDisableLocalVideo(userId, disabled),
setMinimumOutputDelay: (delay) => instance.setMinimumOutputDelay(delay),
getEncryptionModes: (callback) => instance.getEncryptionModes(callback),
configureConnectionRetries: (baseDelay, maxDelay, maxAttempts) =>
instance.configureConnectionRetries(baseDelay, maxDelay, maxAttempts),
setOnSpeakingCallback: (callback) => instance.setOnSpeakingCallback(callback),
setOnSpeakingWhileMutedCallback: (callback) => instance.setOnSpeakingWhileMutedCallback(callback),
setPingInterval: (interval) => instance.setPingInterval(interval),
setPingCallback: (callback) => instance.setPingCallback(callback),
setPingTimeoutCallback: (callback) => instance.setPingTimeoutCallback(callback),
setRemoteUserSpeakingStatus: (userId, speaking) => instance.setRemoteUserSpeakingStatus(userId, speaking),
setRemoteUserCanHavePriority: (userId, canHavePriority) =>
instance.setRemoteUserCanHavePriority(userId, canHavePriority),
setOnVideoCallback: (callback) => instance.setOnVideoCallback(callback),
setVideoBroadcast: (broadcasting) => instance.setVideoBroadcast(broadcasting),
setDesktopSource: (id, videoHook, type) => instance.setDesktopSource(id, videoHook, type),
setDesktopSourceStatusCallback: (callback) => instance.setDesktopSourceStatusCallback(callback),
setOnDesktopSourceEnded: (callback) => instance.setOnDesktopSourceEnded(callback),
setOnSoundshare: (callback) => instance.setOnSoundshare(callback),
setOnSoundshareEnded: (callback) => instance.setOnSoundshareEnded(callback),
setOnSoundshareFailed: (callback) => instance.setOnSoundshareFailed(callback),
setPTTActive: (active, priority) => instance.setPTTActive(active, priority),
getStats: (callback) => instance.getStats(callback),
getFilteredStats: (filter, callback) => instance.getFilteredStats(filter, callback),
startReplay: () => instance.startReplay(),
};
}
VoiceEngine.createTransport = VoiceEngine._createTransport;
if (isElectronRenderer) {
VoiceEngine.setImageDataAllocator((width, height) => new window.ImageData(width, height));
}
VoiceEngine.createVoiceConnection = function (audioSSRC, userId, address, port, onConnectCallback, experiments, rids) {
let instance = null;
if (rids != null) {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback, experiments, rids);
} else if (experiments != null) {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback, experiments);
} else {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback);
}
return bindConnectionInstance(instance);
};
VoiceEngine.createOwnStreamConnection = VoiceEngine.createVoiceConnection;
VoiceEngine.createReplayConnection = function (audioEngineId, callback, replayLog) {
if (replayLog == null) {
return null;
if (process.platform === 'win32') {
features.declareSupported('voice_legacy_subsystem');
features.declareSupported('soundshare');
features.declareSupported('wumpus_video');
features.declareSupported('hybrid_video');
features.declareSupported('elevated_hook');
features.declareSupported('soundshare_loopback');
features.declareSupported('screen_previews');
features.declareSupported('window_previews');
features.declareSupported('audio_debug_state');
features.declareSupported('video_effects');
// NOTE(jvass): currently there's no experimental encoders! Add this back if you
// add one and want to re-enable the UI for them.
// features.declareSupported('experimental_encoders');
}
return bindConnectionInstance(new VoiceEngine.VoiceReplayConnection(replayLog, audioEngineId, callback));
};
function bindConnectionInstance(instance) {
return {
destroy: () => instance.destroy(),
VoiceEngine.setAudioSubsystem = function (subsystem) {
if (appSettings == null) {
console.warn('Unable to access app settings.');
return;
setTransportOptions: (options) => instance.setTransportOptions(options),
setSelfMute: (mute) => instance.setSelfMute(mute),
setSelfDeafen: (deaf) => instance.setSelfDeafen(deaf),
mergeUsers: (users) => instance.mergeUsers(users),
destroyUser: (userId) => instance.destroyUser(userId),
setLocalVolume: (userId, volume) => instance.setLocalVolume(userId, volume),
setLocalMute: (userId, mute) => instance.setLocalMute(userId, mute),
setLocalPan: (userId, left, right) => instance.setLocalPan(userId, left, right),
setDisableLocalVideo: (userId, disabled) => instance.setDisableLocalVideo(userId, disabled),
setMinimumOutputDelay: (delay) => instance.setMinimumOutputDelay(delay),
getEncryptionModes: (callback) => instance.getEncryptionModes(callback),
configureConnectionRetries: (baseDelay, maxDelay, maxAttempts) =>
instance.configureConnectionRetries(baseDelay, maxDelay, maxAttempts),
setOnSpeakingCallback: (callback) => instance.setOnSpeakingCallback(callback),
setOnSpeakingWhileMutedCallback: (callback) => instance.setOnSpeakingWhileMutedCallback(callback),
setPingInterval: (interval) => instance.setPingInterval(interval),
setPingCallback: (callback) => instance.setPingCallback(callback),
setPingTimeoutCallback: (callback) => instance.setPingTimeoutCallback(callback),
setRemoteUserSpeakingStatus: (userId, speaking) => instance.setRemoteUserSpeakingStatus(userId, speaking),
setRemoteUserCanHavePriority: (userId, canHavePriority) =>
instance.setRemoteUserCanHavePriority(userId, canHavePriority),
setOnVideoCallback: (callback) => instance.setOnVideoCallback(callback),
setVideoBroadcast: (broadcasting) => instance.setVideoBroadcast(broadcasting),
setDesktopSource: (id, videoHook, type) => instance.setDesktopSource(id, videoHook, type),
setDesktopSourceStatusCallback: (callback) => instance.setDesktopSourceStatusCallback(callback),
setOnDesktopSourceEnded: (callback) => instance.setOnDesktopSourceEnded(callback),
setOnSoundshare: (callback) => instance.setOnSoundshare(callback),
setOnSoundshareEnded: (callback) => instance.setOnSoundshareEnded(callback),
setOnSoundshareFailed: (callback) => instance.setOnSoundshareFailed(callback),
setPTTActive: (active, priority) => instance.setPTTActive(active, priority),
getStats: (callback) => instance.getStats(callback),
getFilteredStats: (filter, callback) => instance.getFilteredStats(filter, callback),
startReplay: () => instance.startReplay(),
};
}
// TODO: With experiment controlling ADM selection, this may be incorrect since
// audioSubsystem is read from settings (or default if does not exists)
// and not the actual ADM used.
if (subsystem === audioSubsystem) {
return;
}
appSettings.set('audioSubsystem', subsystem);
appSettings.set('useLegacyAudioDevice', false);
VoiceEngine.createTransport = VoiceEngine._createTransport;
if (isElectronRenderer) {
window.DiscordNative.app.relaunch();
}
};
VoiceEngine.setDebugLogging = function (enable) {
if (appSettings == null) {
console.warn('Unable to access app settings.');
return;
VoiceEngine.setImageDataAllocator((width, height) => new window.ImageData(width, height));
}
if (debugLogging === enable) {
return;
}
appSettings.set('debugLogging', enable);
if (isElectronRenderer) {
window.DiscordNative.app.relaunch();
}
};
VoiceEngine.getDebugLogging = function () {
return debugLogging;
};
const videoStreams = {};
const ensureCanvasContext = function (sinkId) {
let canvas = document.getElementById(sinkId);
if (canvas == null) {
for (const popout of window.popouts.values()) {
const element = popout.document != null && popout.document.getElementById(sinkId);
if (element != null) {
canvas = element;
break;
}
VoiceEngine.createVoiceConnection = function (audioSSRC, userId, address, port, onConnectCallback, experiments, rids) {
let instance = null;
if (rids != null) {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback, experiments, rids);
} else if (experiments != null) {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback, experiments);
} else {
instance = new VoiceEngine.VoiceConnection(audioSSRC, userId, address, port, onConnectCallback);
}
return bindConnectionInstance(instance);
};
VoiceEngine.createOwnStreamConnection = VoiceEngine.createVoiceConnection;
if (canvas == null) {
VoiceEngine.createReplayConnection = function (audioEngineId, callback, replayLog) {
if (replayLog == null) {
return null;
}
}
const context = canvas.getContext('2d');
if (context == null) {
console.log(`Failed to initialize context for sinkId ${sinkId}`);
return null;
}
return bindConnectionInstance(new VoiceEngine.VoiceReplayConnection(replayLog, audioEngineId, callback));
};
return context;
};
VoiceEngine.setAudioSubsystem = function (subsystem) {
if (appSettings == null) {
console.warn('Unable to access app settings.');
return;
}
// [adill] NB: with context isolation it has become extremely costly (both memory & performance) to provide the image
// data directly to clients at any reasonably fast interval so we've replaced setVideoOutputSink with a direct canvas
// renderer via addVideoOutputSink
const setVideoOutputSink = VoiceEngine.setVideoOutputSink;
const clearVideoOutputSink = (streamId) => {
// [adill] NB: if you don't pass a frame callback setVideoOutputSink clears the sink
setVideoOutputSink(streamId);
};
const signalVideoOutputSinkReady = VoiceEngine.signalVideoOutputSinkReady;
delete VoiceEngine.setVideoOutputSink;
delete VoiceEngine.signalVideoOutputSinkReady;
// TODO: With experiment controlling ADM selection, this may be incorrect since
// audioSubsystem is read from settings (or default if does not exists)
// and not the actual ADM used.
if (subsystem === audioSubsystem) {
return;
}
function addVideoOutputSinkInternal(sinkId, streamId, frameCallback) {
let sinks = videoStreams[streamId];
if (sinks == null) {
sinks = videoStreams[streamId] = new Map();
}
appSettings.set('audioSubsystem', subsystem);
appSettings.set('useLegacyAudioDevice', false);
if (sinks.size === 0) {
console.log(`Subscribing to frames for streamId ${streamId}`);
const onFrame = (imageData) => {
const sinks = videoStreams[streamId];
if (sinks != null) {
for (const callback of sinks.values()) {
if (callback != null) {
callback(imageData);
}
if (isElectronRenderer) {
window.DiscordNative.app.relaunch();
}
};
VoiceEngine.setDebugLogging = function (enable) {
if (appSettings == null) {
console.warn('Unable to access app settings.');
return;
}
if (debugLogging === enable) {
return;
}
appSettings.set('debugLogging', enable);
if (isElectronRenderer) {
window.DiscordNative.app.relaunch();
}
};
VoiceEngine.getDebugLogging = function () {
return debugLogging;
};
const videoStreams = {};
const ensureCanvasContext = function (sinkId) {
let canvas = document.getElementById(sinkId);
if (canvas == null) {
for (const popout of window.popouts.values()) {
const element = popout.document != null && popout.document.getElementById(sinkId);
if (element != null) {
canvas = element;
break;
}
}
signalVideoOutputSinkReady(streamId);
};
setVideoOutputSink(streamId, onFrame, true);
}
sinks.set(sinkId, frameCallback);
}
VoiceEngine.addVideoOutputSink = function (sinkId, streamId, frameCallback) {
let canvasContext = null;
addVideoOutputSinkInternal(sinkId, streamId, (imageData) => {
if (canvasContext == null) {
canvasContext = ensureCanvasContext(sinkId);
if (canvasContext == null) {
return;
if (canvas == null) {
return null;
}
}
if (frameCallback != null) {
frameCallback(imageData.width, imageData.height);
}
// [adill] NB: Electron 9+ on macOS would show massive leaks in the the GPU helper process when a non-Discord
// window completely occludes the Discord window. Adding this tiny readback ameliorates the issue. We tried WebGL
// rendering which did not exhibit the issue, however, the context limit of 16 was too small to be a real
// alternative.
const leak = canvasContext.getImageData(0, 0, 1, 1);
canvasContext.putImageData(imageData, 0, 0);
});
};
VoiceEngine.removeVideoOutputSink = function (sinkId, streamId) {
const sinks = videoStreams[streamId];
if (sinks != null) {
sinks.delete(sinkId);
const context = canvas.getContext('2d');
if (context == null) {
console.log(`Failed to initialize context for sinkId ${sinkId}`);
return null;
}
return context;
};
// [adill] NB: with context isolation it has become extremely costly (both memory & performance) to provide the image
// data directly to clients at any reasonably fast interval so we've replaced setVideoOutputSink with a direct canvas
// renderer via addVideoOutputSink
const setVideoOutputSink = VoiceEngine.setVideoOutputSink;
const clearVideoOutputSink = (streamId) => {
// [adill] NB: if you don't pass a frame callback setVideoOutputSink clears the sink
setVideoOutputSink(streamId);
};
const signalVideoOutputSinkReady = VoiceEngine.signalVideoOutputSinkReady;
delete VoiceEngine.setVideoOutputSink;
delete VoiceEngine.signalVideoOutputSinkReady;
function addVideoOutputSinkInternal(sinkId, streamId, frameCallback) {
let sinks = videoStreams[streamId];
if (sinks == null) {
sinks = videoStreams[streamId] = new Map();
}
if (sinks.size === 0) {
delete videoStreams[streamId];
console.log(`Unsubscribing from frames for streamId ${streamId}`);
clearVideoOutputSink(streamId);
console.log(`Subscribing to frames for streamId ${streamId}`);
const onFrame = (imageData) => {
const sinks = videoStreams[streamId];
if (sinks != null) {
for (const callback of sinks.values()) {
if (callback != null) {
callback(imageData);
}
}
}
signalVideoOutputSinkReady(streamId);
};
setVideoOutputSink(streamId, onFrame, true);
}
sinks.set(sinkId, frameCallback);
}
};
let sinkId = 0;
VoiceEngine.getNextVideoOutputFrame = function (streamId) {
const nextVideoFrameSinkId = `getNextVideoFrame_${++sinkId}`;
VoiceEngine.addVideoOutputSink = function (sinkId, streamId, frameCallback) {
let canvasContext = null;
addVideoOutputSinkInternal(sinkId, streamId, (imageData) => {
if (canvasContext == null) {
canvasContext = ensureCanvasContext(sinkId);
if (canvasContext == null) {
return;
}
}
if (frameCallback != null) {
frameCallback(imageData.width, imageData.height);
}
// [adill] NB: Electron 9+ on macOS would show massive leaks in the the GPU helper process when a non-Discord
// window completely occludes the Discord window. Adding this tiny readback ameliorates the issue. We tried WebGL
// rendering which did not exhibit the issue, however, the context limit of 16 was too small to be a real
// alternative.
const leak = canvasContext.getImageData(0, 0, 1, 1);
canvasContext.putImageData(imageData, 0, 0);
});
};
return new Promise((resolve, reject) => {
setTimeout(() => {
VoiceEngine.removeVideoOutputSink(nextVideoFrameSinkId, streamId);
reject(new Error('getNextVideoOutputFrame timeout'));
}, 5000);
VoiceEngine.removeVideoOutputSink = function (sinkId, streamId) {
const sinks = videoStreams[streamId];
if (sinks != null) {
sinks.delete(sinkId);
if (sinks.size === 0) {
delete videoStreams[streamId];
console.log(`Unsubscribing from frames for streamId ${streamId}`);
clearVideoOutputSink(streamId);
}
}
};
addVideoOutputSinkInternal(nextVideoFrameSinkId, streamId, (imageData) => {
VoiceEngine.removeVideoOutputSink(nextVideoFrameSinkId, streamId);
resolve({
width: imageData.width,
height: imageData.height,
data: new Uint8ClampedArray(imageData.data.buffer),
let sinkId = 0;
VoiceEngine.getNextVideoOutputFrame = function (streamId) {
const nextVideoFrameSinkId = `getNextVideoFrame_${++sinkId}`;
return new Promise((resolve, reject) => {
setTimeout(() => {
VoiceEngine.removeVideoOutputSink(nextVideoFrameSinkId, streamId);
reject(new Error('getNextVideoOutputFrame timeout'));
}, 5000);
addVideoOutputSinkInternal(nextVideoFrameSinkId, streamId, (imageData) => {
VoiceEngine.removeVideoOutputSink(nextVideoFrameSinkId, streamId);
resolve({
width: imageData.width,
height: imageData.height,
data: new Uint8ClampedArray(imageData.data.buffer),
});
});
});
});
};
};
console.log(`Initializing voice engine with audio subsystem: ${audioSubsystem}`);
VoiceEngine.initialize({audioSubsystem, logLevel, dataDirectory});
console.log(`Initializing voice engine with audio subsystem: ${audioSubsystem}`);
VoiceEngine.initialize({audioSubsystem, logLevel, dataDirectory});
module.exports = VoiceEngine;
module.exports = VoiceEngine;
}

View File

@ -0,0 +1,109 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
cliui@^7.0.2:
version "7.0.4"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
dependencies:
ansi-regex "^5.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^5.0.5:
version "5.0.8"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
yargs-parser@^20.2.2:
version "20.2.9"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
yargs@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"

6854
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,9 @@
"main": "dist/index.js",
"scripts": {
"compile": "node scripts/compile.js",
"test": "npm run compile && electron .",
"test": "yarn compile && electron .",
"run": "electron .",
"build": "npm run build:minify && npm run build:electron",
"build": "yarn build:minify && yarn build:electron",
"build:electron": "node scripts/build_electron.js",
"build:electron_win": "electron-builder build --win",
"build:electron_linux": "electron-builder build --linux",
@ -24,9 +24,9 @@
"license": "MIT",
"dependencies": {
"auto-launch": "^5.0.5",
"glasstron": "0.0.4",
"glasstron": "0.1.0",
"mkdirp": "^1.0.4",
"node-fetch": "^2.6.0",
"node-fetch": "^3.0.0",
"request": "^2.88.2",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
@ -34,23 +34,23 @@
},
"private": true,
"devDependencies": {
"@types/auto-launch": "^5.0.1",
"@types/auto-launch": "^5.0.2",
"@types/electron-devtools-installer": "^2.2.0",
"@types/micromatch": "^4.0.1",
"@types/mkdirp": "^1.0.0",
"@types/node": "12.12.39",
"@types/rimraf": "^3.0.0",
"@types/uuid": "^8.0.0",
"@types/yauzl": "^2.9.1",
"@types/micromatch": "^4.0.2",
"@types/mkdirp": "^1.0.2",
"@types/node": "16.9.0",
"@types/rimraf": "^3.0.2",
"@types/uuid": "^8.3.1",
"@types/yauzl": "^2.9.2",
"asar": "^3.0.3",
"dotenv": "^8.2.0",
"electron": "^9.4.4",
"electron-builder": "^22.8.0",
"fast-glob": "^3.2.4",
"fs-extra": "^9.0.1",
"micromatch": "^4.0.2",
"terser": "^4.7.0",
"typescript": "^3.9.7",
"dotenv": "^10.0.0",
"electron": "^14.0.0",
"electron-builder": "^22.11.7",
"fast-glob": "^3.2.7",
"fs-extra": "^10.0.0",
"micromatch": "^4.0.4",
"terser": "^5.7.2",
"typescript": "^4.4.2",
"yazl": "^2.5.1"
}
}

View File

@ -1,286 +1,505 @@
const child_process = require("child_process")
const path = require("path")
const terser = require("terser")
const util = require("util")
const child_process = require("child_process");
const path = require("path");
const terser = require("terser");
const util = require("util");
const production = true
const includeSourcesMaps = true
const production = true;
const includeSourcesMaps = true;
let fs = require("fs")
let fs = require("fs");
exports.default = async function beforeBuild(context){
await main()
return true
}
exports.default = async function beforeBuild(context) {
await main();
return true;
};
const PROJECT_DIR = path.resolve(__dirname, "..");
console.log = (...args) => {
process.stdout.write(Buffer.from(util.formatWithOptions({colors: true}, ...args)+"\n", "binary").toString("utf8"))
}
process.stdout.write(
Buffer.from(
util.formatWithOptions({ colors: true }, ...args) + "\n",
"binary"
).toString("utf8")
);
};
console.info = (...args) => {
console.log(`\x1b[34m[INFO]\x1b[0m`, ...args)
}
let commit = child_process.execSync("git rev-parse HEAD").toString().split("\n")[0].trim()
console.info(`Obtained commit ${commit} for the build`)
async function processNextDir(folder, folders, predicate, compile, ignoreModules){
if(typeof ignoreModules === "undefined")ignoreModules = false
let files = fs.readdirSync(folder, {withFileTypes: true})
for(let file of files){
if(file.isFile()){
let isMinified = file.name.endsWith(".min.js") || file.name.endsWith(".min.css")
let filepath = path.join(folder, file.name)
let type = file.name.split(".").pop().toLowerCase()
if(type === file.name)type = ""
if([
"ts",
"md",
"gitignore",
"map"
].includes(type)){
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because of type ${type}\x1b[0m`)
continue
}
if([
"tsconfig.json",
"webpack.config.js"
].includes(file.name)){
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because of name ${file.name}\x1b[0m`)
continue
}
if(folders.exclude && folders.exclude.test(filepath)){
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because regex\x1b[0m`)
continue
}
let hasMinifiedVersion = (type === "js" || type === "css") && !isMinified && files.find(f => {
return f.name === file.name.split(".").slice(0, -1).join(".")+".min."+type
})
if(hasMinifiedVersion){
console.warn(`\x1b[33mIgnored file ${path.relative(folders.startDir, filepath)} because it has a minified version.\x1b[0m`)
continue
}
if(!isMinified && predicate(filepath) && filepath.split(/[\\/]+/).reverse()[1] !== "js"){
await compile(filepath, path.join(filepath.replace(folders.startDir, folders.newDir)), "..")
}else{
if(["js", "css"].includes(type)){
if(!includeSourcesMaps){
console.log(`We don't include sourcemap for this build. Skipping ${file.name}.`)
return await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
}
let fileContent = (await fs.promises.readFile(filepath, "utf8"))
let sourceMap = fileContent.split(/[\n\r]+/g).pop()
if(!sourceMap || !sourceMap.startsWith("//# sourceMappingURL=")){
console.log(`This file doesn't have sourcemap. ${file.name}.`)
await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
continue
}
let sourceMapContent
if(sourceMap.slice(21).startsWith("data:")){
console.log(`Extracting sourcemap from data uri. From file ${file.name}.`)
sourceMapContent = Buffer.from(sourceMap.split("=").slice(1).join("="), "base64").toString("utf-8")
}else{
console.log(`Extracting sourcemap from file ${file.name}.map.`)
await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
sourceMapContent = await fs.promises.readFile(path.join(folder, sourceMap.slice(21)), "utf8")
}
sourceMapContent = JSON.parse(sourceMapContent)
sourceMapContent.sourcesContent = []
let sourceMapPath = filepath + ".map"
fileContent = fileContent
// source map
.replace(sourceMap, "//# sourceMappingURL="+filepath.split(/[\\\/]+/g).pop()+".map")
await fs.promises.writeFile(filepath.replace(folders.startDir, folders.newDir), fileContent)
await fs.promises.writeFile(filepath.replace(folders.startDir, folders.newDir)+".map", JSON.stringify(sourceMapContent))
}else{
await fs.promises.copyFile(filepath, filepath.replace(folders.startDir, folders.newDir))
}
}
}else if(file.isDirectory()){
if(ignoreModules && file.name === "node_modules")continue
if(folders.exclude && folders.exclude.test(path.join(folder, file.name)))continue
await fs.promises.mkdir(path.join(folder, file.name).replace(folders.startDir, folders.newDir), {recursive: true})
await processNextDir(path.join(folder, file.name), ...Array.from(arguments).slice(1))
console.log(`\x1b[34m[INFO]\x1b[0m`, ...args);
};
let commit = child_process
.execSync("git rev-parse HEAD")
.toString()
.split("\n")[0]
.trim();
console.info(`Obtained commit ${commit} for the build`);
async function processNextDir(
folder,
folders,
predicate,
compile,
ignoreModules
) {
if (typeof ignoreModules === "undefined") ignoreModules = false;
let files = fs.readdirSync(folder, { withFileTypes: true });
for (let file of files) {
if (file.isFile()) {
let isMinified =
file.name.endsWith(".min.js") || file.name.endsWith(".min.css");
let filepath = path.join(folder, file.name);
let type = file.name.split(".").pop().toLowerCase();
if (type === file.name) type = "";
if (["ts", "md", "gitignore", "map"].includes(type)) {
console.warn(
`\x1b[33mIgnored file ${path.relative(
folders.startDir,
filepath
)} because of type ${type}\x1b[0m`
);
continue;
}
if (["tsconfig.json", "webpack.config.js"].includes(file.name)) {
console.warn(
`\x1b[33mIgnored file ${path.relative(
folders.startDir,
filepath
)} because of name ${file.name}\x1b[0m`
);
continue;
}
if (folders.exclude && folders.exclude.test(filepath)) {
console.warn(
`\x1b[33mIgnored file ${path.relative(
folders.startDir,
filepath
)} because regex\x1b[0m`
);
continue;
}
let hasMinifiedVersion =
(type === "js" || type === "css") &&
!isMinified &&
files.find((f) => {
return (
f.name ===
file.name.split(".").slice(0, -1).join(".") + ".min." + type
);
});
if (hasMinifiedVersion) {
console.warn(
`\x1b[33mIgnored file ${path.relative(
folders.startDir,
filepath
)} because it has a minified version.\x1b[0m`
);
continue;
}
if (
!isMinified &&
predicate(filepath) &&
filepath.split(/[\\/]+/).reverse()[1] !== "js"
) {
await compile(
filepath,
path.join(filepath.replace(folders.startDir, folders.newDir)),
".."
);
} else {
if (["js", "css"].includes(type)) {
if (!includeSourcesMaps) {
console.log(
`We don't include sourcemap for this build. Skipping ${file.name}.`
);
return await fs.promises.copyFile(
filepath,
filepath.replace(folders.startDir, folders.newDir)
);
}
let fileContent = await fs.promises.readFile(filepath, "utf8");
let sourceMap = fileContent.split(/[\n\r]+/g).pop();
if (!sourceMap || !sourceMap.startsWith("//# sourceMappingURL=")) {
console.log(`This file doesn't have sourcemap. ${file.name}.`);
await fs.promises.copyFile(
filepath,
filepath.replace(folders.startDir, folders.newDir)
);
continue;
}
let sourceMapContent;
if (sourceMap.slice(21).startsWith("data:")) {
console.log(
`Extracting sourcemap from data uri. From file ${file.name}.`
);
sourceMapContent = Buffer.from(
sourceMap.split("=").slice(1).join("="),
"base64"
).toString("utf-8");
} else {
console.log(`Extracting sourcemap from file ${file.name}.map.`);
await fs.promises.copyFile(
filepath,
filepath.replace(folders.startDir, folders.newDir)
);
sourceMapContent = await fs.promises.readFile(
path.join(folder, sourceMap.slice(21)),
"utf8"
);
}
sourceMapContent = JSON.parse(sourceMapContent);
sourceMapContent.sourcesContent = [];
let sourceMapPath = filepath + ".map";
fileContent = fileContent
// source map
.replace(
sourceMap,
"//# sourceMappingURL=" +
filepath.split(/[\\\/]+/g).pop() +
".map"
);
await fs.promises.writeFile(
filepath.replace(folders.startDir, folders.newDir),
fileContent
);
await fs.promises.writeFile(
filepath.replace(folders.startDir, folders.newDir) + ".map",
JSON.stringify(sourceMapContent)
);
} else {
await fs.promises.copyFile(
filepath,
filepath.replace(folders.startDir, folders.newDir)
);
}
}
} else if (file.isDirectory()) {
if (ignoreModules && file.name === "node_modules") continue;
if (folders.exclude && folders.exclude.test(path.join(folder, file.name)))
continue;
await fs.promises.mkdir(
path.join(folder, file.name).replace(folders.startDir, folders.newDir),
{ recursive: true }
);
await processNextDir(
path.join(folder, file.name),
...Array.from(arguments).slice(1)
);
}
}
}
async function main(){
let startTimestamp = Date.now()
console.info("Starting build")
console.info("Reseting existent directory...")
try{
await fs.promises.rmdir("./distApp", {"recursive": true})
} catch (error) {
console.error(error);
}
async function main() {
let startTimestamp = Date.now();
console.info("Starting build");
await fs.promises.mkdir(PROJECT_DIR+"/distApp/dist", {"recursive": true})
console.info("Executing command `npm run compile`")
child_process.execSync("npm run compile", {
encoding: "binary",
stdio: "inherit"
})
let startDir = path.join(PROJECT_DIR, "./dist")
let newDir = path.join(PROJECT_DIR, "./distApp/dist")
console.info("No error detected. Copying files from "+startDir+".")
await fs.promises.mkdir(startDir, {recursive: true})
console.info("Reseting existent directory...");
try {
await fs.promises.rm("./distApp", { recursive: true });
} catch (error) {
console.error(error);
}
await processNextDir(startDir, {
startDir,
newDir
}, ((filepath) => filepath.endsWith(".js")), async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`)
await fs.promises.mkdir(PROJECT_DIR + "/distApp/dist", { recursive: true });
if(filepath.endsWith("git.js")){
await fs.promises.writeFile(newpath, terser.minify(fs.readFileSync(filepath, "utf8").replace(/"{commit}"/g, `"${commit}"`)).code, "utf8")
}else{
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
console.info("Executing command `yarn compile`");
child_process.execSync("yarn compile", {
encoding: "binary",
stdio: "inherit",
});
let startDir = path.join(PROJECT_DIR, "./dist");
let newDir = path.join(PROJECT_DIR, "./distApp/dist");
console.info("No error detected. Copying files from " + startDir + ".");
await fs.promises.mkdir(startDir, { recursive: true });
await processNextDir(
startDir,
{
startDir,
newDir,
},
(filepath) => filepath.endsWith(".js"),
async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`);
if (filepath.endsWith("git.js")) {
await fs.promises.writeFile(
newpath,
(
await terser.minify(
fs
.readFileSync(filepath, "utf8")
.replace(/"{commit}"/g, `"${commit}"`)
)
).code,
"utf8"
);
} else {
await fs.promises.writeFile(
newpath,
(
await terser.minify(await fs.promises.readFile(filepath, "utf8"))
).code,
"utf8"
);
}
},
true
).then(() => {
console.info(`Copied files and minified them from ${startDir}.`);
});
await processNextDir(
path.join(PROJECT_DIR, "modules"),
{
startDir: path.join(PROJECT_DIR, "modules"),
newDir: path.join(PROJECT_DIR, "distApp", "modules"),
exclude: /discord_spellcheck/g,
},
(filepath) => filepath.endsWith(".js"),
async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`);
await fs.promises.writeFile(
newpath,
(await terser.minify(await fs.promises.readFile(filepath, "utf8"))).code,
"utf8"
);
},
true
).then(() => {
console.info(
`Copied files and minified them from ${path.join(
PROJECT_DIR,
"modules"
)}.`
);
});
await Promise.all(
(
await fs.promises.readdir(path.join(PROJECT_DIR, "distApp", "modules"))
).map(async (mdl) => {
let dir = path.join(PROJECT_DIR, "distApp", "modules", mdl);
if (!fs.existsSync(path.join(dir, "package.json"))) {
if (mdl === "discord_desktop_core") {
dir = path.join(dir, "core");
} else {
return;
}
}, true).then(() => {
console.info(`Copied files and minified them from ${startDir}.`)
})
await processNextDir(path.join(PROJECT_DIR, "modules"), {
startDir: path.join(PROJECT_DIR, "modules"),
newDir: path.join(PROJECT_DIR, "distApp", "modules"),
exclude: /discord_spellcheck/g
}, ((filepath) => filepath.endsWith(".js")), async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`)
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
}, true).then(() => {
console.info(`Copied files and minified them from ${path.join(PROJECT_DIR, "modules")}.`)
})
}
await Promise.all((await fs.promises.readdir(path.join(PROJECT_DIR, "distApp", "modules"))).map(async mdl => {
let dir = path.join(PROJECT_DIR, "distApp", "modules", mdl)
if(!fs.existsSync(path.join(dir, "package.json"))){
if(mdl === "discord_desktop_core"){
dir = path.join(dir, "core")
}else{
return
}
}
console.info(`Installing modules for ${mdl}`)
child_process.execSync("npm install --only=prod", {
encoding: "binary",
cwd: dir,
stdio: "inherit"
})
}))
await fs.promises.mkdir(path.join(PROJECT_DIR, "distApp", "modules", "discord_spellcheck"), {recursive: true})
await processNextDir(path.join(PROJECT_DIR, "modules", "discord_spellcheck"), {
startDir: path.join(PROJECT_DIR, "modules", "discord_spellcheck"),
newDir: path.join(PROJECT_DIR, "distApp", "modules", "discord_spellcheck")
}, ((filepath) => filepath.endsWith(".js")), async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`)
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
}, false).then(() => {
console.info(`Copied files and minified them from ${path.join(PROJECT_DIR, "modules")}.`)
})
await processNextDir(path.join(PROJECT_DIR, "LightcordApi"), {
startDir: path.join(PROJECT_DIR, "LightcordApi"),
newDir: path.join(PROJECT_DIR, "distApp", "LightcordApi"),
exclude: /(src|webpack\.config\.js|tsconfig\.json|dist|docs)/g
}, ((filepath) => filepath.endsWith(".js") && (!production ? !filepath.includes("node_modules") : true)), async (filepath, newpath) => {
await fs.promises.copyFile(filepath, newpath)
}, true).then(() => {
console.info(`Copied files and minified them from ${path.join(PROJECT_DIR, "LightcordApi")}.`)
})
child_process.execSync("npm install --only=prod", {
console.info(`Installing modules for ${mdl}`);
child_process.execSync("yarn --production", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp", "LightcordApi"),
stdio: "inherit"
cwd: dir,
stdio: "inherit",
});
})
);
function processDJS(dir){
fs.mkdirSync(path.join(PROJECT_DIR, "distApp", "DiscordJS", dir), {recursive: true})
return processNextDir(path.join(PROJECT_DIR, "DiscordJS", dir), {
startDir: path.join(PROJECT_DIR, "DiscordJS", dir),
newDir: path.join(PROJECT_DIR, "distApp", "DiscordJS", dir),
exclude: /node_modules/g
}, ((filepath) => filepath.endsWith(".js")), async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`)
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
}).then(() => {
console.info(`Copied files and minified them from ${path.join(PROJECT_DIR, "DiscordJS", dir)}.`)
})
}
async function copyFileDJS(file){
await fs.promises.writeFile(path.join(PROJECT_DIR, "distApp", "DiscordJS", file), await fs.promises.readFile(path.join(PROJECT_DIR, "DiscordJS", file)))
await fs.promises.mkdir(
path.join(PROJECT_DIR, "distApp", "modules", "discord_spellcheck"),
{ recursive: true }
);
await processNextDir(
path.join(PROJECT_DIR, "modules", "discord_spellcheck"),
{
startDir: path.join(PROJECT_DIR, "modules", "discord_spellcheck"),
newDir: path.join(
PROJECT_DIR,
"distApp",
"modules",
"discord_spellcheck"
),
},
(filepath) => filepath.endsWith(".js"),
async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`);
await fs.promises.writeFile(
newpath,
(await terser.minify(await fs.promises.readFile(filepath, "utf8"))).code,
"utf8"
);
},
false
).then(() => {
console.info(
`Copied files and minified them from ${path.join(
PROJECT_DIR,
"modules"
)}.`
);
});
await processNextDir(
path.join(PROJECT_DIR, "LightcordApi"),
{
startDir: path.join(PROJECT_DIR, "LightcordApi"),
newDir: path.join(PROJECT_DIR, "distApp", "LightcordApi"),
exclude: /(src|webpack\.config\.js|tsconfig\.json|dist|docs)/g,
},
(filepath) =>
filepath.endsWith(".js") &&
(!production ? !filepath.includes("node_modules") : true),
async (filepath, newpath) => {
await fs.promises.copyFile(filepath, newpath);
},
true
).then(() => {
console.info(
`Copied files and minified them from ${path.join(
PROJECT_DIR,
"LightcordApi"
)}.`
);
});
child_process.execSync("yarn --production", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp", "LightcordApi"),
stdio: "inherit",
});
function processDJS(dir) {
fs.mkdirSync(path.join(PROJECT_DIR, "distApp", "DiscordJS", dir), {
recursive: true,
});
return processNextDir(
path.join(PROJECT_DIR, "DiscordJS", dir),
{
startDir: path.join(PROJECT_DIR, "DiscordJS", dir),
newDir: path.join(PROJECT_DIR, "distApp", "DiscordJS", dir),
exclude: /node_modules/g,
},
(filepath) => filepath.endsWith(".js"),
async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`);
await fs.promises.writeFile(
newpath,
(await terser.minify(await fs.promises.readFile(filepath, "utf8"))).code,
"utf8"
);
}
).then(() => {
console.info(
`Copied files and minified them from ${path.join(
PROJECT_DIR,
"DiscordJS",
dir
)}.`
);
});
}
async function copyFileDJS(file) {
await fs.promises.writeFile(
path.join(PROJECT_DIR, "distApp", "DiscordJS", file),
await fs.promises.readFile(path.join(PROJECT_DIR, "DiscordJS", file))
);
}
await processDJS("dist");
await copyFileDJS("package.json");
child_process.execSync("yarn --production", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp", "DiscordJS"),
stdio: "inherit",
});
fs.mkdirSync(path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist"), {
recursive: true,
});
const BDPackageJSON = require("../BetterDiscordApp/package.json");
fs.writeFileSync(
path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "package.json"),
JSON.stringify(BDPackageJSON),
"utf8"
);
const files = ["index.min.js", "style.min.css"];
files.forEach((e) => {
files.push(e + ".map");
});
files.forEach((e) => {
const pth = path.join(PROJECT_DIR, "BetterDiscordApp", "dist", e);
if (!fs.existsSync(pth))
return console.error(
`\x1b[31mFile ${pth} from betterdiscord does not exist.\x1b[0m`
);
if (e.endsWith(".map")) {
const data = JSON.parse(fs.readFileSync(pth, "utf8"));
data.sourcesContent = [];
fs.writeFileSync(
path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist", e),
JSON.stringify(data)
);
} else {
fs.copyFileSync(
pth,
path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist", e)
);
}
});
await processDJS("dist")
await copyFileDJS("package.json")
child_process.execSync("npm install --only=prod", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp", "DiscordJS"),
stdio: "inherit"
})
fs.mkdirSync(path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist"), {recursive: true})
const BDPackageJSON = require("../BetterDiscordApp/package.json")
fs.writeFileSync(path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "package.json"), JSON.stringify(BDPackageJSON), "utf8")
const files = [
"index.min.js",
"style.min.css"
]
files.forEach(e => {
files.push(e + ".map")
})
files.forEach(e => {
const pth = path.join(PROJECT_DIR, "BetterDiscordApp", "dist", e)
if(!fs.existsSync(pth))return console.error(`\x1b[31mFile ${pth} from betterdiscord does not exist.\x1b[0m`)
if(e.endsWith(".map")){
const data = JSON.parse(fs.readFileSync(pth, "utf8"))
data.sourcesContent = []
fs.writeFileSync(path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist", e), JSON.stringify(data))
}else{
fs.copyFileSync(pth, path.join(PROJECT_DIR, "distApp", "BetterDiscordApp", "dist", e))
}
})
await fs.promises.mkdir(path.join(PROJECT_DIR, "distApp", "splash", "videos"), {recursive: true})
await processNextDir(path.join(PROJECT_DIR, "splash"), {
startDir: path.join(PROJECT_DIR, "splash"),
newDir: path.join(PROJECT_DIR, "distApp", "splash"),
exclude: /node_modules/g
}, (filepath) => {
if(filepath.endsWith(".js"))return true
return false
}, async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`)
await fs.promises.writeFile(newpath, terser.minify(await fs.promises.readFile(filepath, "utf8")).code, "utf8")
}).then(() => {
console.info(`Copied files and minified them from ${path.join(PROJECT_DIR, "splash")}.`)
})
fs.writeFileSync(path.join(PROJECT_DIR, "distApp", "LICENSE"), fs.readFileSync(path.join(PROJECT_DIR, "LICENSE")))
let packageJSON = require("../package.json")
packageJSON.scripts["build:electron_linux"] = packageJSON.scripts["build:electron_linux"].replace("./distApp", ".")
packageJSON.scripts["build:electron_win"] = packageJSON.scripts["build:electron_win"].replace("./distApp", ".")
packageJSON.scripts["build:electron_mac"] = packageJSON.scripts["build:electron_mac"].replace("./distApp", ".")
fs.writeFileSync(path.join(PROJECT_DIR, "distApp", "package.json"), JSON.stringify(packageJSON), "utf8")
console.info(`Installing ${Object.keys(packageJSON.dependencies).length} packages...`)
child_process.execSync("npm install --only=prod", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp"),
stdio: "inherit"
})
console.info("Build took "+(Date.now() - startTimestamp) +"ms.")
await fs.promises.mkdir(
path.join(PROJECT_DIR, "distApp", "splash", "videos"),
{ recursive: true }
);
await processNextDir(
path.join(PROJECT_DIR, "splash"),
{
startDir: path.join(PROJECT_DIR, "splash"),
newDir: path.join(PROJECT_DIR, "distApp", "splash"),
exclude: /node_modules/g,
},
(filepath) => {
if (filepath.endsWith(".js")) return true;
return false;
},
async (filepath, newpath) => {
console.info(`Minifying ${filepath} to ${newpath}`);
await fs.promises.writeFile(
newpath,
(await terser.minify(await fs.promises.readFile(filepath, "utf8"))).code,
"utf8"
);
}
).then(() => {
console.info(
`Copied files and minified them from ${path.join(PROJECT_DIR, "splash")}.`
);
});
fs.writeFileSync(
path.join(PROJECT_DIR, "distApp", "LICENSE"),
fs.readFileSync(path.join(PROJECT_DIR, "LICENSE"))
);
let packageJSON = require("../package.json");
packageJSON.scripts["build:electron_linux"] = packageJSON.scripts[
"build:electron_linux"
].replace("./distApp", ".");
packageJSON.scripts["build:electron_win"] = packageJSON.scripts[
"build:electron_win"
].replace("./distApp", ".");
packageJSON.scripts["build:electron_mac"] = packageJSON.scripts[
"build:electron_mac"
].replace("./distApp", ".");
fs.writeFileSync(
path.join(PROJECT_DIR, "distApp", "package.json"),
JSON.stringify(packageJSON),
"utf8"
);
console.info(
`Installing ${Object.keys(packageJSON.dependencies).length} packages...`
);
child_process.execSync("yarn --production", {
encoding: "binary",
cwd: path.join(PROJECT_DIR, "distApp"),
stdio: "inherit",
});
console.info("Build took " + (Date.now() - startTimestamp) + "ms.");
}
main()
.catch(err => {
console.error(err)
process.exit(1)
})
main().catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -10,19 +10,19 @@ const Platforms = {
linux: {
name: "linux",
run: () => {
return awaitExec("npm", ["run", "build:electron_linux"])
return awaitExec("yarn", ["build:electron_linux"])
}
},
win: {
name: "win",
run: () => {
return awaitExec("npm", ["run", "build:electron_win"])
return awaitExec("yarn", ["build:electron_win"])
}
},
mac: {
name: "mac",
run: () => {
return awaitExec("npm", ["run", "build:electron_mac"])
return awaitExec("yarn", ["build:electron_mac"])
}
},
mac_experimental: {

View File

@ -2,7 +2,7 @@
This script removes ignored directories
By default it only removes all the "node_modules" directories.
Using it with "all" removes the "dist", "distApp", and "builds" dirs too.
To run this script, use `npm run clean` or `npm run clean:all`.
To run this script, use `yarn clean` or `yarn clean:all`.
*/
let test;
try {

View File

@ -14,14 +14,14 @@ spawnSync("tsc", PROJECT_DIR)
if (!existsSync(join(PROJECT_DIR, "BetterDiscordApp", "dist"))){
mkdirSync(join(PROJECT_DIR, "BetterDiscordApp", "dist"))
}
spawnSync("npm run build", join(PROJECT_DIR, "BetterDiscordApp"))
spawnSync("npm run build-prod", join(PROJECT_DIR, "BetterDiscordApp"))
spawnSync("npm run minify-css", join(PROJECT_DIR, "BetterDiscordApp"))
spawnSync("yarn build", join(PROJECT_DIR, "BetterDiscordApp"))
spawnSync("yarn build-prod", join(PROJECT_DIR, "BetterDiscordApp"))
spawnSync("yarn minify-css", join(PROJECT_DIR, "BetterDiscordApp"))
/** DiscordJS */
spawnSync("npm run build", join(PROJECT_DIR, "DiscordJS"))
spawnSync("yarn build", join(PROJECT_DIR, "DiscordJS"))
/** LightcordApi */
spawnSync("npm run build", join(PROJECT_DIR, "LightcordApi"))
spawnSync("npm run build-prod", join(PROJECT_DIR, "LightcordApi"))
spawnSync("yarn build", join(PROJECT_DIR, "LightcordApi"))
spawnSync("yarn build-prod", join(PROJECT_DIR, "LightcordApi"))
spawnSync("tsc", join(PROJECT_DIR, "LightcordApi"))
var exitedWithErrorProcessList = [];

View File

@ -19,12 +19,9 @@ function spawnProcess(cmd, ...args) {
}
}
spawnProcess("npm", "rm", "electron")
spawnProcess("npm", "i")
const arch = process.platform === "win32" ? "ia32" : "x64"
spawnProcess("npm", "i", "--save-dev", "--arch="+arch, "electron@9")
spawnProcess("yarn")
spawnProcess("node", join(PROJECT_DIRNAME, "scripts", "installSubModules.js"))
console.log("Everything is installed. You should be able to do `npm test` to compile everything and launch.")
console.log("Everything is installed. You should be able to do `yarn test` to compile everything and launch.")

View File

@ -9,12 +9,12 @@ const MODULES_DIRNAME = path.join(PROJECT_DIR, "modules")
var exitedWithErrorProcessList = [];
function spawnNpmInstallProcess (targetDir) {
child_process.spawn((process.platform === "win32" ? "npm.cmd" : "npm"), ["i"], {
child_process.spawn((process.platform === "win32" ? "yarn.cmd" : "yarn"), [], {
cwd: targetDir,
env: process.env,
stdio: "inherit"
}).on("error", (err) => {
console.log("Error while running 'npm i' in target directory " + targetDir)
console.log("Error while running 'yarn' in target directory " + targetDir)
console.error(err)
exitedWithErrorProcessList.push(targetDir)
})
@ -44,7 +44,7 @@ spawnNpmInstallProcess(DISCORDJS_DIRNAME)
process.on("beforeExit", () => {
if (exitedWithErrorProcessList.length != 0){
console.error("Failed to run 'npm install' on:\n")
console.error("Failed to run 'yarn' on:\n")
exitedWithErrorProcessList.forEach((val)=>{
console.error(val)
});

View File

@ -1,24 +1,25 @@
import { getCommitID } from "./common/git"
const pak = require("../package.json")
import { getCommitID } from "./common/git";
const pak = require("../package.json");
type branch = "stable"|"canary"|"ptb"|"development";
type branch = "stable" | "canary" | "ptb" | "development";
const buildTargets = {
"darwin":"0.0.259",
"linux":"0.0.12",
}
darwin: "0.0.259",
linux: "0.0.12",
};
export const releaseChannel:branch = "stable"
export let version = buildTargets[process.platform] || "0.0.308"
export const commit = getCommitID()
// Use Discord Canary for even more features and experiments;
export const releaseChannel: branch = "canary";
export let version = buildTargets[process.platform] || "0.0.308";
export const commit = getCommitID();
export default {
releaseChannel,
version,
commit
}
releaseChannel,
version,
commit,
};
global["BuildInfo"] = {
releaseChannel,
version: pak.version,
commit
}
releaseChannel,
version: pak.version,
commit,
};

View File

@ -102,7 +102,8 @@ function launchSplashWindow(startMinimized = false) {
show: false,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true
enableRemoteModule: true,
contextIsolation: false
},
icon: path.join(__dirname, "..", "modules", "discord_desktop_core", "core", "app", "images", "discord.png")
};
@ -116,12 +117,9 @@ function launchSplashWindow(startMinimized = false) {
// prevent users from dropping links to navigate in splash window
splashWindow.webContents.on('will-navigate', e => e.preventDefault());
splashWindow.webContents.on('new-window', (e, windowURL) => {
e.preventDefault();
electron.shell.openExternal(windowURL);
// exit, but delay half a second because openExternal is about to fire
// some events to things that are freed by app.quit.
setTimeout(electron.app.quit, 500);
splashWindow.webContents.setWindowOpenHandler((details) => {
electron.shell.openExternal(details.url);
return { action: 'deny' };
});
if (process.platform !== 'darwin') {
@ -141,9 +139,7 @@ function launchSplashWindow(startMinimized = false) {
webContentsSend(splashWindow, 'SPLASH_SCREEN_QUOTE', cachedQuote);
}
if (splashWindow && !startMinimized) {
splashWindow.show();
}
splashWindow.show();
moduleUpdater.installPendingUpdates();

2355
yarn.lock Normal file

File diff suppressed because it is too large Load Diff