Sync with rauenzi/BetterDiscordApp a84efe7
rework before upgrade
This commit is contained in:
parent
99a2336249
commit
588a0f6f3a
|
@ -1,33 +1,15 @@
|
||||||
const gulp = require("gulp");
|
const gulp = require("gulp");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const minify = require("gulp-babel-minify");
|
|
||||||
const csso = require("gulp-csso");
|
const csso = require("gulp-csso");
|
||||||
|
|
||||||
gulp.task("minify-js", minifyJS);
|
|
||||||
gulp.task("minify-css", minifyCSS);
|
gulp.task("minify-css", minifyCSS);
|
||||||
|
|
||||||
gulp.task("watch-js", function() {
|
|
||||||
return gulp.watch(["./dist/index.js"], minifyJS);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task("watch-css", function() {
|
gulp.task("watch-css", function() {
|
||||||
return gulp.watch(["./dist/style.css"], minifyCSS);
|
return gulp.watch(["./src/styles/index.css"], minifyCSS);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("watch", function() {
|
|
||||||
return gulp.watch(["./dist/index.js", "./dist/style.css"], gulp.series(minifyJS, minifyCSS));
|
|
||||||
});
|
|
||||||
|
|
||||||
function minifyJS() {
|
|
||||||
return gulp.src("./dist/index.js")
|
|
||||||
.pipe(minify({mangle: {keepClassName: true}}))
|
|
||||||
.pipe(rename("index.min.js"))
|
|
||||||
.pipe(gulp.dest("./dist"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function minifyCSS() {
|
function minifyCSS() {
|
||||||
return gulp.src("./dist/style.css")
|
return gulp.src("./src/styles/index.css")
|
||||||
.pipe(csso({restructure: false}))
|
.pipe(csso({restructure: false}))
|
||||||
.pipe(rename("style.min.css"))
|
.pipe(rename("style.css"))
|
||||||
.pipe(gulp.dest("./dist"));
|
.pipe(gulp.dest("./dist"));
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,19 +1,17 @@
|
||||||
{
|
{
|
||||||
"name": "bandagedbd",
|
"name": "bandagedbd",
|
||||||
"version": "0.2.3",
|
"version": "0.3.5",
|
||||||
"description": "Enhances Discord adding functionality and themes.",
|
"description": "Enhances Discord adding functionality and themes.",
|
||||||
"main": "js/main.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --colors",
|
"build": "webpack --progress --colors",
|
||||||
"watch": "webpack --progress --colors --watch",
|
"watch": "webpack --progress --colors --watch",
|
||||||
"build-prod": "webpack --progress --colors --mode production -o dist/index.min.js --devtool none",
|
"build-prod": "webpack --progress --colors --mode production -o dist/index.min.js --devtool none",
|
||||||
"watch-prod": "webpack --progress --colors --watch --mode production -o dist/index.min.js --devtool none",
|
"watch-prod": "webpack --progress --colors --watch --mode production -o dist/index.min.js --devtool none",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"minify": "gulp minify-js && gulp minify-css",
|
|
||||||
"minify-js": "gulp minify-js",
|
|
||||||
"minify-css": "gulp minify-css",
|
"minify-css": "gulp minify-css",
|
||||||
"watch-js": "gulp watch-js",
|
"watch-css": "gulp watch-css",
|
||||||
"watch-css": "gulp watch-css"
|
"deploy": "npm run build-prod && npm run minify-css"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -26,19 +24,17 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/rauenzi/BetterDiscordApp#readme",
|
"homepage": "https://github.com/rauenzi/BetterDiscordApp#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.10.5",
|
||||||
"@babel/preset-env": "^7.3.4",
|
"@babel/preset-env": "^7.10.4",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.10.4",
|
||||||
"@babel/register": "^7.0.0",
|
"@babel/register": "^7.10.5",
|
||||||
"babel-loader": "^8.0.6",
|
"babel-loader": "^8.1.0",
|
||||||
"circular-dependency-plugin": "^5.0.2",
|
"circular-dependency-plugin": "^5.2.0",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.2",
|
||||||
"gulp-babel-minify": "^0.5.1",
|
"gulp-csso": "^4.0.1",
|
||||||
"gulp-csso": "^3.0.1",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-rename": "^1.4.0",
|
"webpack": "^4.43.0",
|
||||||
"webpack": "^4.29.6",
|
"webpack-cli": "^3.3.12"
|
||||||
"webpack-cli": "^3.2.3",
|
|
||||||
"@types/react-dom": "^16.9.8"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^16.13.1"
|
"react": "^16.13.1"
|
||||||
|
|
|
@ -4,15 +4,6 @@ localStorageFix();
|
||||||
loadingIcon();
|
loadingIcon();
|
||||||
|
|
||||||
const deprecateGlobal = (key, value) => {
|
const deprecateGlobal = (key, value) => {
|
||||||
// value = typeof(value) !== "object" ? value : new Proxy(value, {
|
|
||||||
// get: function(obj, mod) {
|
|
||||||
// if (!obj.hasOwnProperty(mod)) return undefined;
|
|
||||||
// return obj[mod];
|
|
||||||
// },
|
|
||||||
// set: function(obj, mod) {
|
|
||||||
// if (obj.hasOwnProperty(mod)) return Utils.err("Deprecated Global", "Trying to overwrite deprecated BD globals");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
Object.defineProperty(window, key, {
|
Object.defineProperty(window, key, {
|
||||||
get() {
|
get() {
|
||||||
Utils.warn("Deprecated Global", `"${key}" will be removed in future versions. Please only use BdApi.`);
|
Utils.warn("Deprecated Global", `"${key}" will be removed in future versions. Please only use BdApi.`);
|
||||||
|
@ -53,6 +44,8 @@ window.BdApi = BdApi;
|
||||||
|
|
||||||
import Core from "./modules/core";
|
import Core from "./modules/core";
|
||||||
deprecateGlobal("mainCore", Core);
|
deprecateGlobal("mainCore", Core);
|
||||||
|
|
||||||
|
// TODO: Change Init mode and stop using CoreWrapper.
|
||||||
export default class CoreWrapper {
|
export default class CoreWrapper {
|
||||||
constructor(bdConfig, methods) {
|
constructor(bdConfig, methods) {
|
||||||
Core.setConfig(bdConfig);
|
Core.setConfig(bdConfig);
|
||||||
|
@ -63,39 +56,4 @@ export default class CoreWrapper {
|
||||||
// deprecateGlobal("mainCore", this.mainCore);
|
// deprecateGlobal("mainCore", this.mainCore);
|
||||||
Core.init();
|
Core.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// function patchModuleLoad() {
|
|
||||||
// const namespace = "betterdiscord";
|
|
||||||
// const prefix = `${namespace}/`;
|
|
||||||
// const Module = require("module");
|
|
||||||
// const load = Module._load;
|
|
||||||
// // const resolveFilename = Module._resolveFilename;
|
|
||||||
|
|
||||||
// Module._load = function(request) {
|
|
||||||
// if (request === namespace || request.startsWith(prefix)) {
|
|
||||||
// const requested = request.substr(prefix.length);
|
|
||||||
// if (requested == "api") return BdApi;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return load.apply(this, arguments);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // Module._resolveFilename = function (request, parent, isMain) {
|
|
||||||
// // if (request === "betterdiscord" || request.startsWith("betterdiscord/")) {
|
|
||||||
// // const contentPath = PluginManager.getPluginPathByModule(parent);
|
|
||||||
// // if (contentPath) return request;
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // return resolveFilename.apply(this, arguments);
|
|
||||||
// // };
|
|
||||||
|
|
||||||
// return function() {
|
|
||||||
// Module._load = load;
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// patchModuleLoad();
|
|
||||||
|
|
||||||
// var settingsPanel, voiceMode,, dMode, publicServersModule;
|
|
||||||
// var bdConfig = null;
|
|
Loading…
Reference in New Issue