commit
150a1d63c4
|
@ -0,0 +1,17 @@
|
||||||
|
module.exports = function(api) {
|
||||||
|
|
||||||
|
api.cache(true);
|
||||||
|
|
||||||
|
const presets = [['@babel/env', {
|
||||||
|
targets: {
|
||||||
|
'node': '8.6.0'
|
||||||
|
}
|
||||||
|
}]];
|
||||||
|
|
||||||
|
const plugins = [];
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
module.exports = function(api) {
|
||||||
|
|
||||||
|
api.cache(true);
|
||||||
|
|
||||||
|
const presets = [['@babel/env', {
|
||||||
|
targets: {
|
||||||
|
'node': '8.6.0',
|
||||||
|
'chrome': '60'
|
||||||
|
}
|
||||||
|
}], '@babel/react'];
|
||||||
|
|
||||||
|
const plugins = [];
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins
|
||||||
|
}
|
||||||
|
}
|
|
@ -126,6 +126,7 @@ export default class DiscordApi {
|
||||||
static get currentGuild() {
|
static get currentGuild() {
|
||||||
const guild = Modules.GuildStore.getGuild(Modules.SelectedGuildStore.getGuildId());
|
const guild = Modules.GuildStore.getGuild(Modules.SelectedGuildStore.getGuildId());
|
||||||
if (guild) return Guild.from(guild);
|
if (guild) return Guild.from(guild);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,6 +136,7 @@ export default class DiscordApi {
|
||||||
static get currentChannel() {
|
static get currentChannel() {
|
||||||
const channel = Modules.ChannelStore.getChannel(Modules.SelectedChannelStore.getChannelId());
|
const channel = Modules.ChannelStore.getChannel(Modules.SelectedChannelStore.getChannelId());
|
||||||
if (channel) return Channel.from(channel);
|
if (channel) return Channel.from(channel);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,6 +146,7 @@ export default class DiscordApi {
|
||||||
static get currentUser() {
|
static get currentUser() {
|
||||||
const user = Modules.UserStore.getCurrentUser();
|
const user = Modules.UserStore.getCurrentUser();
|
||||||
if (user) return User.from(user);
|
if (user) return User.from(user);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -288,7 +288,7 @@ class Module {
|
||||||
if (this._require) return this._require;
|
if (this._require) return this._require;
|
||||||
|
|
||||||
const __webpack_require__ = this.getWebpackRequire();
|
const __webpack_require__ = this.getWebpackRequire();
|
||||||
if (!__webpack_require__) return;
|
if (!__webpack_require__) return null;
|
||||||
|
|
||||||
this.hookWebpackRequireCache(__webpack_require__);
|
this.hookWebpackRequireCache(__webpack_require__);
|
||||||
return this._require = __webpack_require__;
|
return this._require = __webpack_require__;
|
||||||
|
|
|
@ -272,7 +272,7 @@ class WebpackModules {
|
||||||
if (this._require) return this._require;
|
if (this._require) return this._require;
|
||||||
|
|
||||||
const __webpack_require__ = this.getWebpackRequire();
|
const __webpack_require__ = this.getWebpackRequire();
|
||||||
if (!__webpack_require__) return;
|
if (!__webpack_require__) return null;
|
||||||
|
|
||||||
this.hookWebpackRequireCache(__webpack_require__);
|
this.hookWebpackRequireCache(__webpack_require__);
|
||||||
return this._require = __webpack_require__;
|
return this._require = __webpack_require__;
|
||||||
|
|
|
@ -69,10 +69,11 @@ export default class Theme extends Content {
|
||||||
path: this.paths.mainPath.replace(/\\/g, '/')
|
path: this.paths.mainPath.replace(/\\/g, '/')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Why are these getters?
|
||||||
Logger.log(this.name, ['Finished compiling theme', new class Info {
|
Logger.log(this.name, ['Finished compiling theme', new class Info {
|
||||||
get SCSS_variables() { console.log(config); }
|
get SCSS_variables() { console.log(config); return ''; }
|
||||||
get Compiled_SCSS() { console.log(result.css.toString()); }
|
get Compiled_SCSS() { console.log(result.css.toString()); return ''; }
|
||||||
get Result() { console.log(result); }
|
get Result() { console.log(result); return ''; }
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -179,7 +179,7 @@ export class PermissionOverwrite {
|
||||||
}
|
}
|
||||||
|
|
||||||
get guild() {
|
get guild() {
|
||||||
if (this.channel) return this.channel.guild;
|
return this.channel ? this.channel.guild : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ export class RolePermissionOverwrite extends PermissionOverwrite {
|
||||||
get roleId() { return this.discordObject.id }
|
get roleId() { return this.discordObject.id }
|
||||||
|
|
||||||
get role() {
|
get role() {
|
||||||
if (this.guild) return this.guild.roles.find(r => r.id === this.roleId);
|
return this.guild ? this.guild.roles.find(r => r.id === this.roleId) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,14 +166,14 @@ export class Guild {
|
||||||
* The guild's AFK channel.
|
* The guild's AFK channel.
|
||||||
*/
|
*/
|
||||||
get afkChannel() {
|
get afkChannel() {
|
||||||
if (this.afkChannelId) return Channel.fromId(this.afkChannelId);
|
return this.afkChannelId ? Channel.fromId(this.afkChannelId) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The channel system messages are sent to.
|
* The channel system messages are sent to.
|
||||||
*/
|
*/
|
||||||
get systemChannel() {
|
get systemChannel() {
|
||||||
if (this.systemChannelId) return Channel.fromId(this.systemChannelId);
|
return this.systemChannelId ? Channel.fromId(this.systemChannelId) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,11 +42,11 @@ export class Reaction {
|
||||||
}
|
}
|
||||||
|
|
||||||
get message() {
|
get message() {
|
||||||
if (this.channel) return this.channel.messages.find(m => m.id === this.messageId);
|
return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get guild() {
|
get guild() {
|
||||||
if (this.channel) return this.channel.guild;
|
return this.channel ? this.channel.guild : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,11 +84,11 @@ export class Embed {
|
||||||
}
|
}
|
||||||
|
|
||||||
get message() {
|
get message() {
|
||||||
if (this.channel) return this.channel.messages.find(m => m.id === this.messageId);
|
return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get guild() {
|
get guild() {
|
||||||
if (this.channel) return this.channel.guild;
|
return this.channel ? this.channel.guild : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +143,7 @@ export class Message {
|
||||||
|
|
||||||
get author() {
|
get author() {
|
||||||
if (this.discordObject.author && !this.webhookId) return User.from(this.discordObject.author);
|
if (this.discordObject.author && !this.webhookId) return User.from(this.discordObject.author);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get channel() {
|
get channel() {
|
||||||
|
@ -150,7 +151,7 @@ export class Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
get guild() {
|
get guild() {
|
||||||
if (this.channel) return this.channel.guild;
|
return this.channel ? this.channel.guild : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -202,7 +203,7 @@ export class DefaultMessage extends Message {
|
||||||
get application() { return this.discordObject.application }
|
get application() { return this.discordObject.application }
|
||||||
|
|
||||||
get webhook() {
|
get webhook() {
|
||||||
if (this.webhookId) return this.discordObject.author;
|
return this.webhookId ? this.discordObject.author : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get mentions() {
|
get mentions() {
|
||||||
|
|
|
@ -77,7 +77,7 @@ export class User {
|
||||||
|
|
||||||
get note() {
|
get note() {
|
||||||
const note = Modules.UserNoteStore.getNote(this.id);
|
const note = Modules.UserNoteStore.getNote(this.id);
|
||||||
if (note) return note;
|
return note ? note : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default class {
|
||||||
|
|
||||||
get vueMount() {
|
get vueMount() {
|
||||||
const element = ReactDOM.findDOMNode(this);
|
const element = ReactDOM.findDOMNode(this);
|
||||||
if (!element) return;
|
if (!element) return null;
|
||||||
if (this.props.mountAtTop) return element;
|
if (this.props.mountAtTop) return element;
|
||||||
if (element.firstChild) return element.firstChild;
|
if (element.firstChild) return element.firstChild;
|
||||||
const newElement = document.createElement('span');
|
const newElement = document.createElement('span');
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
|
|
||||||
|
const jsLoader = {
|
||||||
|
test: /\.(js|jsx)$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const vueLoader = {
|
||||||
|
test: /\.(vue)$/,
|
||||||
|
use: 'vue-loader'
|
||||||
|
};
|
||||||
|
|
||||||
|
const scssLoader = {
|
||||||
|
test: /\.scss$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: ['css-loader', 'sass-loader']
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/index.js',
|
||||||
|
module: {
|
||||||
|
rules: [jsLoader, vueLoader, scssLoader]
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
electron: 'require("electron")',
|
||||||
|
asar: 'require("asar")',
|
||||||
|
fs: 'require("fs")',
|
||||||
|
path: 'require("path")',
|
||||||
|
util: 'require("util")',
|
||||||
|
process: 'require("process")',
|
||||||
|
net: 'require("net")',
|
||||||
|
request: 'require(require("path").join(require("electron").remote.app.getAppPath(), "node_modules", "request"))',
|
||||||
|
sparkplug: 'require("../../core/dist/sparkplug")',
|
||||||
|
'node-crypto': 'require("crypto")',
|
||||||
|
'child_process': 'require("child_process")'
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
|
||||||
|
},
|
||||||
|
modules: [
|
||||||
|
path.resolve('..', 'node_modules'),
|
||||||
|
path.resolve('..', 'common', 'modules'),
|
||||||
|
path.resolve('src', 'modules'),
|
||||||
|
path.resolve('src', 'ui'),
|
||||||
|
path.resolve('src', 'plugins'),
|
||||||
|
path.resolve('src', 'structs'),
|
||||||
|
path.resolve('src', 'builtin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
node: {
|
||||||
|
process: false,
|
||||||
|
__filename: false,
|
||||||
|
__dirname: false
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new VueLoaderPlugin()
|
||||||
|
]
|
||||||
|
};
|
|
@ -1,68 +1,19 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const baseconfig = require('./webpack.base.config');
|
||||||
|
|
||||||
|
const merge = require('webpack-merge');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
|
||||||
const jsLoader = {
|
const config = {
|
||||||
test: /\.(js|jsx)$/,
|
mode: 'development',
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
query: {
|
|
||||||
presets: ['react']
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const vueLoader = {
|
|
||||||
test: /\.(vue)$/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
};
|
|
||||||
|
|
||||||
const scssLoader = {
|
|
||||||
test: /\.scss$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: ['css-loader', 'sass-loader']
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: './src/index.js',
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'betterdiscord.client.js'
|
filename: 'betterdiscord.client.js'
|
||||||
},
|
},
|
||||||
module: {
|
|
||||||
loaders: [jsLoader, vueLoader, scssLoader]
|
|
||||||
},
|
|
||||||
externals: {
|
|
||||||
electron: 'require("electron")',
|
|
||||||
asar: 'require("asar")',
|
|
||||||
fs: 'require("fs")',
|
|
||||||
path: 'require("path")',
|
|
||||||
util: 'require("util")',
|
|
||||||
process: 'require("process")',
|
|
||||||
net: 'require("net")',
|
|
||||||
request: 'require(require("path").join(require("electron").remote.app.getAppPath(), "node_modules", "request"))',
|
|
||||||
sparkplug: 'require("../../core/dist/sparkplug")',
|
|
||||||
'node-crypto': 'require("crypto")'
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
|
|
||||||
},
|
|
||||||
modules: [
|
|
||||||
path.resolve('..', 'node_modules'),
|
|
||||||
path.resolve('..', 'common', 'modules'),
|
|
||||||
path.resolve('src', 'modules'),
|
|
||||||
path.resolve('src', 'ui'),
|
|
||||||
path.resolve('src', 'plugins'),
|
|
||||||
path.resolve('src', 'structs'),
|
|
||||||
path.resolve('src', 'builtin')
|
|
||||||
]
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
process: false,
|
|
||||||
__filename: false,
|
|
||||||
__dirname: false
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.NamedModulesPlugin(),
|
new webpack.NamedModulesPlugin()
|
||||||
new webpack.EvalSourceMapDevToolPlugin()
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = merge(baseconfig, config);
|
||||||
|
|
|
@ -1,71 +1,21 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const baseconfig = require('./webpack.base.config');
|
||||||
|
|
||||||
|
const merge = require('webpack-merge');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
||||||
|
|
||||||
const jsLoader = {
|
const config = {
|
||||||
test: /\.(js|jsx)$/,
|
mode: 'production',
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
query: {
|
|
||||||
presets: ['react']
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const vueLoader = {
|
|
||||||
test: /\.(vue)$/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
};
|
|
||||||
|
|
||||||
const scssLoader = {
|
|
||||||
test: /\.scss$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: ['css-loader', 'sass-loader']
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: './src/index.js',
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'betterdiscord.client-release.js'
|
filename: 'betterdiscord.client-release.js'
|
||||||
},
|
},
|
||||||
module: {
|
|
||||||
loaders: [jsLoader, vueLoader, scssLoader]
|
|
||||||
},
|
|
||||||
externals: {
|
|
||||||
electron: 'require("electron")',
|
|
||||||
fs: 'require("fs")',
|
|
||||||
path: 'require("path")',
|
|
||||||
util: 'require("util")',
|
|
||||||
process: 'require("process")',
|
|
||||||
net: 'require("net")',
|
|
||||||
request: 'require(require("path").join(require("electron").remote.app.getAppPath(), "node_modules", "request"))',
|
|
||||||
sparkplug: 'require("./sparkplug")',
|
|
||||||
'node-crypto': 'require("crypto")',
|
|
||||||
'child_process': 'require("child_process")'
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
|
|
||||||
},
|
|
||||||
modules: [
|
|
||||||
path.resolve('..', 'node_modules'),
|
|
||||||
path.resolve('..', 'common', 'modules'),
|
|
||||||
path.resolve('src', 'modules'),
|
|
||||||
path.resolve('src', 'ui'),
|
|
||||||
path.resolve('src', 'plugins'),
|
|
||||||
path.resolve('src', 'structs'),
|
|
||||||
path.resolve('src', 'builtin')
|
|
||||||
]
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
process: false,
|
|
||||||
__filename: false,
|
|
||||||
__dirname: false
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
PRODUCTION: JSON.stringify(true)
|
PRODUCTION: JSON.stringify(true)
|
||||||
}),
|
})
|
||||||
new UglifyJsPlugin()
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = merge(baseconfig, config);
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
module.exports = function(api) {
|
||||||
|
|
||||||
|
api.cache(true);
|
||||||
|
|
||||||
|
const presets = [['@babel/env', {
|
||||||
|
targets: {
|
||||||
|
'node': '8.6.0'
|
||||||
|
}
|
||||||
|
}]];
|
||||||
|
|
||||||
|
const plugins = [];
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,25 +1,26 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
|
|
||||||
const vueLoader = {
|
const vueLoader = {
|
||||||
test: /\.(vue)$/,
|
test: /\.(vue)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'vue-loader'
|
use: 'vue-loader'
|
||||||
};
|
};
|
||||||
|
|
||||||
const scssLoader = {
|
const scssLoader = {
|
||||||
test: /\.(css|scss)$/,
|
test: /\.(css|scss)$/,
|
||||||
loader: ['css-loader', 'sass-loader']
|
use: ['css-loader', 'sass-loader']
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
|
mode: 'development',
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'csseditor.js'
|
filename: 'csseditor.js'
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [vueLoader, scssLoader]
|
rules: [vueLoader, scssLoader]
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
electron: 'window.require("electron")',
|
electron: 'window.require("electron")',
|
||||||
|
@ -35,5 +36,8 @@ module.exports = {
|
||||||
path.resolve('..', 'node_modules'),
|
path.resolve('..', 'node_modules'),
|
||||||
path.resolve('..', 'common', 'modules')
|
path.resolve('..', 'common', 'modules')
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
plugins: [
|
||||||
|
new VueLoaderPlugin()
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,26 +1,27 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
|
|
||||||
const vueLoader = {
|
const vueLoader = {
|
||||||
test: /\.(vue)$/,
|
test: /\.(vue)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'vue-loader'
|
use: 'vue-loader'
|
||||||
};
|
};
|
||||||
|
|
||||||
const scssLoader = {
|
const scssLoader = {
|
||||||
test: /\.(css|scss)$/,
|
test: /\.(css|scss)$/,
|
||||||
loader: ['css-loader', 'sass-loader']
|
use: ['css-loader', 'sass-loader']
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
|
mode: 'production',
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'csseditor-release.js'
|
filename: 'csseditor-release.js'
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [vueLoader, scssLoader]
|
rules: [vueLoader, scssLoader]
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
electron: 'window.require("electron")',
|
electron: 'window.require("electron")',
|
||||||
|
@ -41,6 +42,6 @@ module.exports = {
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
PRODUCTION: JSON.stringify(true)
|
PRODUCTION: JSON.stringify(true)
|
||||||
}),
|
}),
|
||||||
new UglifyJsPlugin()
|
new VueLoaderPlugin()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
const path = require('path');
|
||||||
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
|
|
||||||
|
const vueLoader = {
|
||||||
|
test: /\.(vue)$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: 'vue-loader'
|
||||||
|
};
|
||||||
|
|
||||||
|
const scssLoader = {
|
||||||
|
test: /\.(css|scss)$/,
|
||||||
|
use: ['css-loader', 'sass-loader']
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/index.js',
|
||||||
|
module: {
|
||||||
|
rules: [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')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new VueLoaderPlugin()
|
||||||
|
]
|
||||||
|
};
|
|
@ -1,39 +1,16 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const baseconfig = require('./webpack.base.config');
|
||||||
|
|
||||||
|
const merge = require('webpack-merge');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
|
||||||
const vueLoader = {
|
const config = {
|
||||||
test: /\.(vue)$/,
|
mode: 'development',
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
};
|
|
||||||
|
|
||||||
const scssLoader = {
|
|
||||||
test: /\.(css|scss)$/,
|
|
||||||
loader: ['css-loader', 'sass-loader']
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: './src/index.js',
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'editor.js'
|
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')
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = merge(baseconfig, config);
|
||||||
|
|
|
@ -1,43 +1,16 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const baseconfig = require('./webpack.base.config');
|
||||||
|
|
||||||
|
const merge = require('webpack-merge');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
||||||
|
|
||||||
const vueLoader = {
|
const config = {
|
||||||
test: /\.(vue)$/,
|
mode: 'production',
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
};
|
|
||||||
|
|
||||||
const scssLoader = {
|
|
||||||
test: /\.(css|scss)$/,
|
|
||||||
loader: ['css-loader', 'sass-loader']
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: './src/index.js',
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'editor.release.js'
|
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')
|
|
||||||
]
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new UglifyJsPlugin()
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = merge(baseconfig, config);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import del from 'del';
|
||||||
import copy from 'gulp-copy';
|
import copy from 'gulp-copy';
|
||||||
import rename from 'gulp-rename';
|
import rename from 'gulp-rename';
|
||||||
import inject from 'gulp-inject-string';
|
import inject from 'gulp-inject-string';
|
||||||
import copydeps from 'gulp-npm-copy-deps';
|
import copydeps from './scripts/copydeps';
|
||||||
import file from 'gulp-file';
|
import file from 'gulp-file';
|
||||||
import editjson from 'gulp-json-editor';
|
import editjson from 'gulp-json-editor';
|
||||||
|
|
||||||
|
@ -111,8 +111,11 @@ gulp.task('editor-release', gulp.parallel('editor-main', 'editor-pkg'));
|
||||||
|
|
||||||
// Deps
|
// Deps
|
||||||
|
|
||||||
gulp.task('node-modules', function () {
|
gulp.task('node-modules', function() {
|
||||||
return copydeps('.', 'release/core');
|
return pump([
|
||||||
|
gulp.src(copydeps({ignore: ['fsevents']}), { base: '.' }),
|
||||||
|
gulp.dest('./release/core')
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('node-sass-bindings', gulp.series(function () {
|
gulp.task('node-sass-bindings', gulp.series(function () {
|
||||||
|
@ -141,4 +144,4 @@ gulp.task('del-release', function() {
|
||||||
|
|
||||||
gulp.task('dependencies', gulp.series('node-modules', gulp.parallel('node-sass-bindings', 'keytar-bindings')));
|
gulp.task('dependencies', gulp.series('node-modules', gulp.parallel('node-sass-bindings', 'keytar-bindings')));
|
||||||
gulp.task('build-release', gulp.parallel('core-release', 'client-release', 'editor-release', 'dependencies'));
|
gulp.task('build-release', gulp.parallel('core-release', 'client-release', 'editor-release', 'dependencies'));
|
||||||
gulp.task('release', gulp.series('del-release', 'build-release'));
|
gulp.task('release', gulp.series('del-release', 'build-release'));
|
|
@ -1,17 +1,18 @@
|
||||||
const
|
const
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
webpack = require('webpack'),
|
webpack = require('webpack'),
|
||||||
HtmlWebpackPlugin = require('html-webpack-plugin');
|
HtmlWebpackPlugin = require('html-webpack-plugin'),
|
||||||
|
VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
|
|
||||||
const vueLoader = {
|
const vueLoader = {
|
||||||
test: /\.(vue)$/,
|
test: /\.(vue)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'vue-loader'
|
use: 'vue-loader'
|
||||||
};
|
};
|
||||||
|
|
||||||
const scssLoader = {
|
const scssLoader = {
|
||||||
test: /\.(css|scss)$/,
|
test: /\.(css|scss)$/,
|
||||||
loader: ['css-loader', 'sass-loader']
|
use: ['css-loader', 'sass-loader']
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -21,7 +22,7 @@ module.exports = {
|
||||||
filename: 'installer.js'
|
filename: 'installer.js'
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [vueLoader, scssLoader]
|
rules: [vueLoader, scssLoader]
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
@ -31,6 +32,7 @@ module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: './src/index.html'
|
template: './src/index.html'
|
||||||
})
|
}),
|
||||||
|
new VueLoaderPlugin()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
75
package.json
75
package.json
|
@ -16,77 +16,74 @@
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"asar": "^0.14.6",
|
"asar": "^1.0.0",
|
||||||
"bdedit": "github:JsSucks/bdedit",
|
"chokidar": "^2.1.2",
|
||||||
"csp-parse": "github:macropodhq/csp-parse",
|
"csp-parse": "github:macropodhq/csp-parse",
|
||||||
"deepmerge": "^2.2.1",
|
"deepmerge": "^3.2.0",
|
||||||
"fs-extra": "^7.0.0",
|
"fs-extra": "^7.0.1",
|
||||||
"keytar": "^4.3.0",
|
"keytar": "^4.4.1",
|
||||||
"nedb": "^1.8.0",
|
"nedb": "^1.8.0",
|
||||||
"node-sass": "^4.10.0",
|
"node-sass": "^4.11.0",
|
||||||
"original-fs": "^1.0.0"
|
"original-fs": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.3.4",
|
||||||
|
"@babel/preset-env": "^7.3.4",
|
||||||
|
"@babel/preset-react": "^7.0.0",
|
||||||
|
"@babel/register": "^7.0.0",
|
||||||
"aes256": "^1.0.4",
|
"aes256": "^1.0.4",
|
||||||
"archiver": "^3.0.0",
|
"archiver": "^3.0.0",
|
||||||
"babel-core": "^6.26.3",
|
"babel-loader": "^8.0.5",
|
||||||
"babel-loader": "^7.1.5",
|
"bdedit": "github:JsSucks/bdedit",
|
||||||
"babel-preset-env": "^1.7.0",
|
|
||||||
"babel-preset-es2015": "^6.24.1",
|
|
||||||
"babel-preset-react": "^6.24.1",
|
|
||||||
"codemirror": "^5.39.2",
|
|
||||||
"combokeys": "^3.0.0",
|
"combokeys": "^3.0.0",
|
||||||
"css-loader": "^0.28.11",
|
"css-loader": "^2.1.0",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"electron": "4.0.0-beta.7",
|
"electron": "4.0.6",
|
||||||
"electron-rebuild": "^1.8.2",
|
"electron-rebuild": "^1.8.4",
|
||||||
"eslint": "^4.19.1",
|
"eslint": "^5.15.0",
|
||||||
"eslint-plugin-vue": "^4.7.1",
|
"eslint-plugin-vue": "^5.2.2",
|
||||||
"file-type": "^7.7.1",
|
"file-type": "^10.8.0",
|
||||||
"filewatcher": "^3.0.1",
|
"filewatcher": "^3.0.1",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.0",
|
||||||
"gulp-babel": "^7.0.0",
|
"gulp-babel": "^8.0.0",
|
||||||
"gulp-copy": "^1.1.0",
|
"gulp-copy": "^4.0.1",
|
||||||
"gulp-file": "^0.4.0",
|
"gulp-file": "^0.4.0",
|
||||||
"gulp-inject-string": "^1.1.1",
|
"gulp-inject-string": "^1.1.2",
|
||||||
"gulp-json-editor": "^2.4.2",
|
"gulp-json-editor": "^2.5.1",
|
||||||
"gulp-npm-copy-deps": "^1.0.2",
|
|
||||||
"gulp-rename": "^1.4.0",
|
"gulp-rename": "^1.4.0",
|
||||||
"gulp-watch": "^5.0.1",
|
"gulp-watch": "^5.0.1",
|
||||||
"hash-files": "^1.1.1",
|
"hash-files": "^1.1.1",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"jquery": "^3.2.1",
|
"jquery": "^3.3.1",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"node-gyp": "^3.7.0",
|
"node-gyp": "^3.8.0",
|
||||||
"pump": "^3.0.0",
|
"pump": "^3.0.0",
|
||||||
"request-promise-native": "^1.0.5",
|
"request-promise-native": "1.0.5",
|
||||||
"sass-lint": "^1.12.1",
|
"sass-lint": "^1.12.1",
|
||||||
"sass-loader": "^6.0.7",
|
"sass-loader": "^7.1.0",
|
||||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
|
||||||
"v-tooltip": "^2.0.0-rc.33",
|
"v-tooltip": "^2.0.0-rc.33",
|
||||||
"vue": "^2.5.17",
|
"vue": "^2.6.8",
|
||||||
"vue-codemirror": "^4.0.5",
|
"vue-color": "^2.7.0",
|
||||||
"vue-color": "^2.4.6",
|
|
||||||
"vue-context-menu": "^2.0.6",
|
"vue-context-menu": "^2.0.6",
|
||||||
"vue-loader": "^13.7.2",
|
"vue-loader": "^15.7.0",
|
||||||
"vue-material-design-icons": "^1.6.0",
|
"vue-material-design-icons": "^3.0.0",
|
||||||
"vue-template-compiler": "^2.5.17",
|
"vue-template-compiler": "^2.6.8",
|
||||||
"webpack": "^3.12.0"
|
"webpack": "^4.29.6",
|
||||||
|
"webpack-cli": "^3.2.3",
|
||||||
|
"webpack-merge": "^4.2.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "node scripts/install.js",
|
"install": "node scripts/install.js",
|
||||||
"build": "npm run build --prefix client && npm run build --prefix core && npm run build --prefix csseditor && npm run build --prefix installer",
|
"build": "npm run build --prefix client && npm run build --prefix core && npm run build --prefix editor",
|
||||||
"build_client": "npm run build --prefix client",
|
"build_client": "npm run build --prefix client",
|
||||||
"watch_client": "npm run watch --prefix client",
|
"watch_client": "npm run watch --prefix client",
|
||||||
"build_core": "npm run build --prefix core",
|
"build_core": "npm run build --prefix core",
|
||||||
"watch_core": "npm run watch --prefix core",
|
"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",
|
"build_editor": "npm run build --prefix editor",
|
||||||
"watch_editor": "npm run watch --prefix editor",
|
"watch_editor": "npm run watch --prefix editor",
|
||||||
"lint": "eslint -f unix client/src core/src editor/src common && npm run sasslint",
|
"lint": "eslint -f unix client/src core/src editor/src common && npm run sasslint",
|
||||||
"lint_fix": "eslint -f unix client/src core/src csseditor/src common --fix",
|
"lint_fix": "eslint -f unix client/src core/src",
|
||||||
"sasslint": "sass-lint client/src/styles/**/*.scss -v",
|
"sasslint": "sass-lint client/src/styles/**/*.scss -v",
|
||||||
"test": "npm run build && npm run lint",
|
"test": "npm run build && npm run lint",
|
||||||
"build_node-sass": "node scripts/build-node-sass.js",
|
"build_node-sass": "node scripts/build-node-sass.js",
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
|
||||||
|
function getDeps(module) {
|
||||||
|
var pkg = JSON.parse(fs.readFileSync(module.path + '/package.json'));
|
||||||
|
return pkg.dependencies ? Object.keys(pkg.dependencies) : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasChildren(module) {
|
||||||
|
try {
|
||||||
|
fs.statSync(module.path + '/node_modules');
|
||||||
|
return true;
|
||||||
|
} catch(err) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function locateDep(module, dep, rootnm = false) {
|
||||||
|
var mPath = (rootnm ? '.' : module.path) + '/node_modules/' + dep;
|
||||||
|
try {
|
||||||
|
fs.statSync(mPath);
|
||||||
|
return {
|
||||||
|
name: dep,
|
||||||
|
path: mPath
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
if(!rootnm) return locateDep(module, dep, true);
|
||||||
|
return {
|
||||||
|
name: dep,
|
||||||
|
path: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildDependencyTree(depsRef, module) {
|
||||||
|
if(module.name === null || module.path === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.statSync(module.path + '/package.json');
|
||||||
|
} catch(err) { return; }
|
||||||
|
|
||||||
|
var deps = getDeps(module);
|
||||||
|
|
||||||
|
for(var dep of deps) {
|
||||||
|
var located = locateDep(module, dep);
|
||||||
|
if(!depsRef.find(d => d.path === located.path)) {
|
||||||
|
buildDependencyTree(depsRef, located);
|
||||||
|
depsRef.push(located);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasChildren(located)) {
|
||||||
|
var childModules = fs.readdirSync(located.path + '/node_modules').map(name => located.path + '/node_modules/' + name).filter(source => fs.statSync(source).isDirectory());
|
||||||
|
for(var childModule of childModules) {
|
||||||
|
buildDependencyTree(depsRef, { name: '!child', path: childModule });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function(config) {
|
||||||
|
var depsRef = [];
|
||||||
|
|
||||||
|
buildDependencyTree(depsRef, {
|
||||||
|
name: '!root',
|
||||||
|
path: '.'
|
||||||
|
});
|
||||||
|
|
||||||
|
for(var dep of depsRef) {
|
||||||
|
if(!dep.path) {
|
||||||
|
if(!dep.name || !config.ignore.includes(dep.name)) {
|
||||||
|
console.warn('DEPENDENCY NOT FOUND:', dep.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var flatten = depsRef.filter(d => d.path && !d.path.replace('./node_modules', '').includes('node_modules'));
|
||||||
|
var star = flatten.map(d => d.path + '/**/*');
|
||||||
|
|
||||||
|
console.log('Found ' + star.length + ' dependencies');
|
||||||
|
return star;
|
||||||
|
}
|
Loading…
Reference in New Issue