diff --git a/package.json b/package.json index 58507a799..31ec625d5 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ "dependencies": { "long": "^3.2.0", "prism-media": "^0.0.1", - "snekfetch": "^3.1.0", - "tweetnacl": "^0.14.0", - "ws": "^2.0.0" + "snekfetch": "^3.2.0", + "tweetnacl": "^1.0.0", + "ws": "^3.0.0" }, "peerDependencies": { "bufferutil": "^3.0.0", @@ -50,11 +50,10 @@ "devDependencies": { "@types/node": "^7.0.0", "discord.js-docgen": "hydrabolt/discord.js-docgen", - "eslint": "^3.19.0", - "parallel-webpack": "^1.6.0", - "uglify-js": "mishoo/UglifyJS2#harmony-v2.8.22", - "uglifyjs-webpack-plugin": "^0.4.3", - "webpack": "^2.2.0" + "eslint": "^4.2.0", + "parallel-webpack": "^2.0.0", + "uglifyjs-webpack-plugin": "^1.0.0-beta.1", + "webpack": "^3.0.0" }, "engines": { "node": ">=6.0.0" diff --git a/src/client/ClientDataResolver.js b/src/client/ClientDataResolver.js index 04d6b0b01..a7f3e2508 100644 --- a/src/client/ClientDataResolver.js +++ b/src/client/ClientDataResolver.js @@ -212,11 +212,11 @@ class ClientDataResolver { return new Promise((resolve, reject) => { if (/^https?:\/\//.test(resource)) { snekfetch.get(resource) - .end((err, res) => { - if (err) return reject(err); - if (!(res.body instanceof Buffer)) return reject(new TypeError('The response body isn\'t a Buffer.')); - return resolve(res.body); - }); + .end((err, res) => { + if (err) return reject(err); + if (!(res.body instanceof Buffer)) return reject(new TypeError('The response body isn\'t a Buffer.')); + return resolve(res.body); + }); } else { const file = path.resolve(resource); fs.stat(file, (err, stats) => { diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index 641468031..01ac61f62 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -838,7 +838,7 @@ class RESTMethods { 'put', Endpoints.Message(message).Reaction(emoji).User('@me'), true ).then(() => message._addReaction(Util.parseEmoji(emoji), message.client.user) - ); + ); } removeMessageReaction(message, emoji, userID) { diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 8fa1e20ef..8b0544d8e 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -1087,8 +1087,8 @@ class Guild { _sortPositionWithID(collection) { return collection.sort((a, b) => a.position !== b.position ? - a.position - b.position : - Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber() + a.position - b.position : + Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber() ); } } diff --git a/src/structures/MessageCollector.js b/src/structures/MessageCollector.js index fd5bebda4..cc77a86c0 100644 --- a/src/structures/MessageCollector.js +++ b/src/structures/MessageCollector.js @@ -12,7 +12,6 @@ const util = require('util'); * @extends {Collector} */ class MessageCollector extends Collector { - /** * @param {TextChannel|DMChannel|GroupDMChannel} channel The channel * @param {CollectorFilter} filter The filter to be applied to this collector diff --git a/src/structures/ReactionCollector.js b/src/structures/ReactionCollector.js index 5e0b7d5a1..a54687d32 100644 --- a/src/structures/ReactionCollector.js +++ b/src/structures/ReactionCollector.js @@ -13,7 +13,6 @@ const Collection = require('../util/Collection'); * @extends {Collector} */ class ReactionCollector extends Collector { - /** * @param {Message} message The message upon which to collect reactions * @param {CollectorFilter} filter The filter to apply to this collector diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index d9da21f7a..ad0372870 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -73,7 +73,7 @@ class TextChannel extends GuildChannel { resolve(this.client.rest.methods.createWebhook(this, name, avatar)); } else { this.client.resolver.resolveBuffer(avatar).then(data => - resolve(this.client.rest.methods.createWebhook(this, name, data)) + resolve(this.client.rest.methods.createWebhook(this, name, data)) ); } }); diff --git a/src/util/Permissions.js b/src/util/Permissions.js index 5e56f2ae9..c24337672 100644 --- a/src/util/Permissions.js +++ b/src/util/Permissions.js @@ -268,8 +268,8 @@ Permissions.prototype.missingPermissions = util.deprecate(Permissions.prototype. 'EvaluatedPermissions#missingPermissions is deprecated, use Permissions#missing instead'); Object.defineProperty(Permissions.prototype, 'member', { get: util - .deprecate(Object.getOwnPropertyDescriptor(Permissions.prototype, 'member').get, - 'EvaluatedPermissions#member is deprecated'), + .deprecate(Object.getOwnPropertyDescriptor(Permissions.prototype, 'member').get, + 'EvaluatedPermissions#member is deprecated'), }); module.exports = Permissions; diff --git a/webpack.config.js b/webpack.config.js index dd4000fd9..55d0e12f6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,9 +11,10 @@ const version = require('./package.json').version; const createConfig = options => { const plugins = [ new webpack.DefinePlugin({ 'global.GENTLY': false }), + new webpack.optimize.ModuleConcatenationPlugin(), ]; - if (options.minify) plugins.push(new UglifyJSPlugin({ minimize: true })); + if (options.minify) plugins.push(new UglifyJSPlugin({ uglifyOptions: { output: { comments: false } } })); const filename = `./webpack/discord${process.env.VERSIONED === 'false' ? '' : '.' + version}${options.minify ? '.min' : ''}.js`; // eslint-disable-line