add bdedit

This commit is contained in:
Jiiks 2019-02-24 12:28:29 +02:00
parent 5597c485d1
commit 99ef0d9f81
7 changed files with 112 additions and 3 deletions

23
editor/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "bdeditorwindow",
"description": "BetterDiscord editor window",
"author": "JsSucks",
"version": "0.4.0",
"homepage": "https://betterdiscord.net",
"license": "MIT",
"main": "dist/csseditor.js",
"contributors": [
"Jiiks",
"Pohky"
],
"repository": {
"type": "git",
"url": "https://github.com/JsSucks/BetterDiscordApp.git"
},
"private": false,
"scripts": {
"build": "webpack --progress --colors",
"watch": "webpack --progress --colors --watch",
"release": "webpack --progress --colors --config=webpack.production.config.js"
}
}

12
editor/src/Editor.vue Normal file
View File

@ -0,0 +1,12 @@
<template>
<div class="container"></div>
</template>
<script>
import { BDEdit } from 'bdedit';
export default {
components: { BDEdit }
}
</script>

22
editor/src/index.js Normal file
View File

@ -0,0 +1,22 @@
// const styles = require('./styles/index.scss');
import Vue from 'vue';
import Editor from './Editor.vue';
import styles from './styles/index.scss';
const mount = document.createElement('div');
mount.classList.add('container');
document.body.appendChild(mount);
const vue = new Vue({
el: mount,
components: { Editor },
template: '<Editor/>'
});
const style = document.createElement('style');
style.id = 'bd-main';
style.type = 'text/css';
style.appendChild(document.createTextNode(styles));
document.head.appendChild(style);

View File

39
editor/webpack.config.js Normal file
View File

@ -0,0 +1,39 @@
const path = require('path');
const webpack = require('webpack');
const vueLoader = {
test: /\.(vue)$/,
exclude: /node_modules/,
loader: 'vue-loader'
};
const scssLoader = {
test: /\.(css|scss)$/,
loader: ['css-loader', 'sass-loader']
};
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'editor.js'
},
module: {
loaders: [vueLoader, scssLoader]
},
externals: {
electron: 'window.require("electron")',
fs: 'window.require("fs")',
util: 'window.require("util")',
process: 'require("process")'
},
resolve: {
alias: {
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
},
modules: [
path.resolve('..', 'node_modules'),
path.resolve('..', 'common', 'modules')
]
}
};

16
package-lock.json generated
View File

@ -15,6 +15,12 @@
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg="
},
"ace-builds": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.4.3.tgz",
"integrity": "sha512-T+e4DQRQR8ReNPOUryXWdXRX1NBTb9rB1y42IhnH4mmFe0NIIpAQVu8BQ9tgU2K3EGaPFZeG7E87OOjaXDP8PQ==",
"dev": true
},
"acorn": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz",
@ -1581,6 +1587,13 @@
"tweetnacl": "0.14.5"
}
},
"bdedit": {
"version": "github:JsSucks/BDEdit#1ddc18aa4ae980cd0d50618ba4ffa73721a6819e",
"dev": true,
"requires": {
"ace-builds": "1.4.3"
}
},
"beeper": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz",
@ -2828,9 +2841,6 @@
"randomfill": "1.0.4"
}
},
"csp-parse": {
"version": "github:macropodhq/csp-parse#db7d5f954b420b527d7fb452a93bb6e2fa302c5a"
},
"css-color-names": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",

View File

@ -33,6 +33,7 @@
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"bdedit": "github:JsSucks/BDEdit",
"codemirror": "^5.39.2",
"combokeys": "^3.0.0",
"css-loader": "^0.28.11",
@ -82,6 +83,8 @@
"watch_core": "npm run watch --prefix core",
"build_csseditor": "npm run build --prefix csseditor",
"watch_csseditor": "npm run watch --prefix csseditor",
"build_editor": "npm run build --prefix editor",
"watch_editor": "npm run watch --prefix editor",
"lint": "eslint -f unix client/src core/src csseditor/src common && npm run sasslint",
"lint_fix": "eslint -f unix client/src core/src csseditor/src common --fix",
"sasslint": "sass-lint client/src/styles/**/*.scss -v",