[everything] run prettier.
parent
d50b3ef708
commit
428886645f
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"presets": ["@babel/preset-flow", "@babel/preset-react"]
|
"presets": ["@babel/preset-flow", "@babel/preset-react"]
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import esbuild from 'esbuild'
|
import esbuild from "esbuild";
|
||||||
import babel from 'esbuild-plugin-babel'
|
import babel from "esbuild-plugin-babel";
|
||||||
|
|
||||||
(async ()=>{
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await esbuild.build({
|
await esbuild.build({
|
||||||
entryPoints: ["src/index.js"],
|
entryPoints: ["src/index.js"],
|
||||||
bundle: true,
|
bundle: true,
|
||||||
minify: true,
|
minify: true,
|
||||||
format: "iife",
|
format: "iife",
|
||||||
target: "es2021",
|
target: "es2021",
|
||||||
outfile: "dist/build.js",
|
outfile: "dist/build.js",
|
||||||
plugins: [babel()]
|
plugins: [babel()]
|
||||||
})
|
});
|
||||||
console.log("Build succeeded!")
|
console.log("Build succeeded!");
|
||||||
process.exit(0)
|
process.exit(0);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e);
|
||||||
console.log("Build failed!")
|
console.log("Build failed!");
|
||||||
process.exit(1)
|
process.exit(1);
|
||||||
}
|
}
|
||||||
})() //IIFE to shutup lsp
|
})(); //IIFE to shutup lsp
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "demoncord",
|
"name": "demoncord",
|
||||||
"version": "0.0.1-indev",
|
"version": "0.0.1-indev",
|
||||||
"description": "a devilesque client mod 😈",
|
"description": "a devilesque client mod 😈",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.mjs",
|
"build": "node build.mjs",
|
||||||
"flow": "flow"
|
"flow": "flow"
|
||||||
},
|
},
|
||||||
"author": "Drake",
|
"author": "Drake",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.16.7",
|
"@babel/core": "^7.16.7",
|
||||||
"@babel/preset-flow": "^7.16.7",
|
"@babel/preset-flow": "^7.16.7",
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@rollup/plugin-babel": "^5.3.0",
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
"@rollup/plugin-commonjs": "^21.0.1",
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"demonpatcher": "^0.1.0",
|
"demonpatcher": "^0.1.0",
|
||||||
"esbuild": "^0.14.11",
|
"esbuild": "^0.14.11",
|
||||||
"esbuild-plugin-babel": "^0.2.3",
|
"esbuild-plugin-babel": "^0.2.3",
|
||||||
"flow-bin": "^0.169.0",
|
"flow-bin": "^0.169.0",
|
||||||
"flow-remove-types": "^2.169.0",
|
"flow-remove-types": "^2.169.0",
|
||||||
"idb-keyval": "^6.0.3",
|
"idb-keyval": "^6.0.3",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"rollup": "^2.63.0",
|
"rollup": "^2.63.0",
|
||||||
"rollup-plugin-esbuild": "^4.8.2",
|
"rollup-plugin-esbuild": "^4.8.2",
|
||||||
"rollup-plugin-flow": "^1.1.1",
|
"rollup-plugin-flow": "^1.1.1",
|
||||||
"rollup-plugin-uglify": "^6.0.4",
|
"rollup-plugin-uglify": "^6.0.4",
|
||||||
"simian": "^1.4.3"
|
"simian": "^1.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
|||||||
import { React } from "../src/api/common.js"
|
import { React } from "../src/api/common.js";
|
||||||
|
|
||||||
export { React }
|
export { React };
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import webpack from "./webpack.js"
|
import webpack from "./webpack.js";
|
||||||
|
|
||||||
import * as idb from "idb-keyval";
|
import * as idb from "idb-keyval";
|
||||||
|
|
||||||
const common: {React: Object, ReactDOM: Object} = {
|
const common: { React: Object, ReactDOM: Object } = {
|
||||||
React: webpack.findByProps(
|
React: webpack.findByProps(
|
||||||
"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
|
"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
|
||||||
"createElement"
|
"createElement"
|
||||||
),
|
),
|
||||||
ReactDOM: webpack.findByProps(
|
ReactDOM: webpack.findByProps(
|
||||||
"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
|
"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
|
||||||
"hydrate"
|
"hydrate"
|
||||||
),
|
),
|
||||||
"idb_keyval": idb
|
idb_keyval: idb
|
||||||
}
|
};
|
||||||
|
|
||||||
export default common;
|
export default common;
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import webpack from "../../webpack.js"
|
import webpack from "../../webpack.js";
|
||||||
import common from "../../common.js"
|
import common from "../../common.js";
|
||||||
const React = common.React
|
const React = common.React;
|
||||||
|
|
||||||
const FormTitle = webpack.findByDisplayName("FormTitle")
|
const FormTitle = webpack.findByDisplayName("FormTitle");
|
||||||
const FormDivider = webpack.findByDisplayName("FormDivider")
|
const FormDivider = webpack.findByDisplayName("FormDivider");
|
||||||
const FormSection = webpack.findByDisplayName("FormSection")
|
const FormSection = webpack.findByDisplayName("FormSection");
|
||||||
|
|
||||||
export default function(): any {
|
export default function (): any {
|
||||||
return (
|
return (
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<FormTitle tag="h1">
|
<FormTitle tag="h1">Demoncord Settings</FormTitle>
|
||||||
Demoncord Settings
|
</FormSection>
|
||||||
</FormTitle>
|
);
|
||||||
</FormSection>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import tmp from "./settingsInj.js"
|
import tmp from "./settingsInj.js";
|
||||||
const registerSettingsEntry = tmp.registerSettingsEntry
|
const registerSettingsEntry = tmp.registerSettingsEntry;
|
||||||
import common from "../common.js"
|
import common from "../common.js";
|
||||||
const React = common.React
|
const React = common.React;
|
||||||
|
|
||||||
import Settings from "./components/settings.jsx"
|
import Settings from "./components/settings.jsx";
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
console.log(Settings)
|
console.log(Settings);
|
||||||
console.log(Settings())
|
console.log(Settings());
|
||||||
registerSettingsEntry("General Settings", undefined, Settings)
|
registerSettingsEntry("General Settings", undefined, Settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
init
|
init
|
||||||
}
|
};
|
||||||
|
@ -1,64 +1,64 @@
|
|||||||
// @flow
|
// @flow
|
||||||
type ModuleType = Object/* { [symbol]: any } */;
|
type ModuleType = Object /* { [symbol]: any } */;
|
||||||
type FilterFunc = (module: ModuleType) => boolean;
|
type FilterFunc = (module: ModuleType) => boolean;
|
||||||
|
|
||||||
function getModules(): any {
|
function getModules(): any {
|
||||||
let modules: { c: mixed[] } = {};
|
let modules: { c: mixed[] } = {};
|
||||||
|
|
||||||
window.webpackChunkdiscord_app.push([
|
window.webpackChunkdiscord_app.push([
|
||||||
[Math.random().toString(36)],
|
[Math.random().toString(36)],
|
||||||
{},
|
{},
|
||||||
(e) => {
|
(e) => {
|
||||||
modules = e;
|
modules = e;
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return modules.c;
|
return modules.c;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter(filter: FilterFunc, moduleList: any): Array<Object> {
|
function filter(filter: FilterFunc, moduleList: any): Array<Object> {
|
||||||
let modules: Array<mixed[]> = [];
|
let modules: Array<mixed[]> = [];
|
||||||
for (const mod in moduleList) {
|
for (const mod in moduleList) {
|
||||||
const module = moduleList[mod].exports;
|
const module = moduleList[mod].exports;
|
||||||
if (module) {
|
if (module) {
|
||||||
if (module.default && module.__esModule && filter(module.default)) {
|
if (module.default && module.__esModule && filter(module.default)) {
|
||||||
modules.push(module.default);
|
modules.push(module.default);
|
||||||
} else if (filter(module)) {
|
} else if (filter(module)) {
|
||||||
modules.push(module);
|
modules.push(module);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return modules;
|
||||||
return modules;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebpackModules = {
|
type WebpackModules = {
|
||||||
modules: () => any,
|
modules: () => any,
|
||||||
filter: (filter: FilterFunc, moduleList: any) => Object[],
|
filter: (filter: FilterFunc, moduleList: any) => Object[],
|
||||||
find: (filter: FilterFunc) => Object,
|
find: (filter: FilterFunc) => Object,
|
||||||
findAll: (filter: FilterFunc) => Object[],
|
findAll: (filter: FilterFunc) => Object[],
|
||||||
findByProps: (...props: string[]) => Object,
|
findByProps: (...props: string[]) => Object,
|
||||||
findByPropsAll: (...props: string[]) => Object[],
|
findByPropsAll: (...props: string[]) => Object[],
|
||||||
findByDisplayName: (prop: string) => Object[],
|
findByDisplayName: (prop: string) => Object[]
|
||||||
};
|
};
|
||||||
|
|
||||||
let webpack: WebpackModules = {
|
let webpack: WebpackModules = {
|
||||||
modules: getModules(),
|
modules: getModules(),
|
||||||
filter: filter,
|
filter: filter,
|
||||||
find: (filter: FilterFunc) => webpack.filter(filter, webpack.modules)[0],
|
find: (filter: FilterFunc) => webpack.filter(filter, webpack.modules)[0],
|
||||||
findAll: (filter: FilterFunc) => webpack.filter(filter, webpack.modules),
|
findAll: (filter: FilterFunc) => webpack.filter(filter, webpack.modules),
|
||||||
findByProps: (...props: Array<string>) => {
|
findByProps: (...props: Array<string>) => {
|
||||||
return webpack.find((module) => {
|
return webpack.find((module) => {
|
||||||
return props.every((prop) => module[prop] !== undefined);
|
return props.every((prop) => module[prop] !== undefined);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
findByPropsAll: (...props: Array<string>) => {
|
findByPropsAll: (...props: Array<string>) => {
|
||||||
return webpack.findAll((module) =>
|
return webpack.findAll((module) =>
|
||||||
props.every((prop) => module[prop] !== undefined)
|
props.every((prop) => module[prop] !== undefined)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
findByDisplayName: (prop: string) => {
|
findByDisplayName: (prop: string) => {
|
||||||
return webpack.find((m) => m?.default?.displayName === prop)
|
return webpack.find((m) => m?.default?.displayName === prop);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default webpack;
|
export default webpack;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import init from "./init.js"
|
import init from "./init.js";
|
||||||
|
|
||||||
if (window.demon) {
|
if (window.demon) {
|
||||||
delete window.demon; // this is a very good idea
|
delete window.demon; // this is a very good idea
|
||||||
}
|
}
|
||||||
|
|
||||||
init(window)
|
init(window);
|
||||||
|
Loading…
Reference in new issue