Skip to content

Commit

Permalink
Restructure BD into a small mono-repo
Browse files Browse the repository at this point in the history
This is a repo-wide refactor that introduces the injector to the main branch.

The new architecture is as such:
common/
injector/
renderer/
  • Loading branch information
zerebos committed Mar 6, 2021
1 parent 59f2025 commit 74b2dac
Show file tree
Hide file tree
Showing 165 changed files with 13,640 additions and 9,772 deletions.
61 changes: 2 additions & 59 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"extends": ["eslint:recommended", "plugin:react/recommended"],
"plugins": [
"react"
],
"settings": {
"react": {
"version": "16.12.0"
}
},
"env": {
"browser": true,
"node": true
},
"parserOptions": {
Expand Down Expand Up @@ -91,64 +81,17 @@
"template-curly-spacing": "error",
"wrap-iife": ["error", "inside"],
"yield-star-spacing": "error",
"yoda": "error",


"react/display-name": "off",
"react/prop-types": "off",
"react/jsx-key": "off",
"react/jsx-no-target-blank": "error",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error"
"yoda": "error"
},
"globals": {
"webpackJsonp": "readonly",
"Proxy": "readonly",
"Set": "readonly",
"WeakMap": "readonly",
"Map": "readonly",
"Promise": "readonly",
"ace": "readonly",
"Reflect": "readonly",
"DiscordNative": "readonly",
"__non_webpack_require__": "readonly",
"Symbol": "readonly",

"alert": "off",
"blur": "off",
"caches": "off",
"close": "off",
"closed": "off",
"confirm": "off",
"crypto": "off",
"defaultstatus": "off",
"event": "off",
"external": "off",
"find": "off",
"focus": "off",
"frames": "off",
"history": "off",
"length": "off",
"location": "off",
"locationbar": "off",
"menubar": "off",
"name": "off",
"navigator": "off",
"open": "off",
"opener": "off",
"origin": "off",
"parent": "off",
"personalbar": "off",
"print": "off",
"prompt": "off",
"screen": "off",
"scroll": "off",
"scrollbars": "off",
"self": "off",
"status": "off",
"statusbar": "off",
"stop": "off",
"toolbar": "off",
"top": "off"
"Symbol": "readonly"
}
}
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ This project and everyone participating in it is governed by the [Code of Conduc

### BetterDiscord Architecture

BetterDiscord is currently broken up into two main pieces--the local injector, and the remote application.
BetterDiscord is currently broken up into two main pieces--the local injector, and the renderer application.

#### Injector

The injector is the piece that runs on the user's computer, and the piece added by the [installer](https://github.com/rauenzi/BBDInstaller). The main job of this package is to inject into Discord and load the remote package. The injector and its code lives on the [injector branch](https://github.com/rauenzi/BetterDiscordApp/tree/injector).
The injector is the piece that runs on the user's computer, and the piece added by the [installer](https://github.com/rauenzi/BBDInstaller). The main job of this package is to inject into Discord and load the renderer package. The injector and its code lives in the `injector` folder.

#### Remote Application
#### Renderer Application

This is the main payload of BetterDiscord. This is what gets linked remotely by the [injector](#injector). This portion is where most of the user interaction and development will be. This module is responsible for loading plugins and themes, as well as handling settings, emotes and more.
This is the main payload of BetterDiscord. This is what gets linked executed in the renderer context by the [injector](#injector). This portion is where most of the user interaction and development will be. This module is responsible for loading plugins and themes, as well as handling settings, emotes and more.

## How Can I Contribute?

Expand Down
11 changes: 11 additions & 0 deletions common/constants/ipcevents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-multi-spaces */

export const MINIMIZE = "bd-window-minimize";
export const MAXIMIZE = "bd-window-maximize";
export const RELAUNCH = "bd-relaunch-app";
export const GET_PATH = "bd-get-path";
export const RUN_SCRIPT = "bd-run-script";
export const NAVIGATE = "bd-did-navigate-in-page";
export const OPEN_DEVTOOLS = "bd-open-devtools";
export const CLOSE_DEVTOOLS = "bd-close-devtools";
export const OPEN_WINDOW = "bd-open-window";
File renamed without changes.
1 change: 1 addition & 0 deletions injector/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions injector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BetterDiscord Injector

You're probably looking for the main app, [click here](https://github.com/rauenzi/BetterDiscordApp) to go there.
11 changes: 11 additions & 0 deletions injector/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es2020",
"allowSyntheticDefaultImports": false,
"baseUrl": "./",
"paths": {
"common": ["../common"]
}
},
"exclude": ["node_modules"]
}
Loading

0 comments on commit 74b2dac

Please sign in to comment.