chore(Deps): upgrade deps (#4701)

This commit is contained in:
Noel
2020-08-14 21:46:23 +02:00
committed by GitHub
parent 178439ef8c
commit dea48d64a5
12 changed files with 11320 additions and 51 deletions

View File

@@ -26,7 +26,8 @@
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
"endOfLine": "lf",
"arrowParens": "avoid"
}
],
"strict": ["error", "global"],

1
.gitignore vendored
View File

@@ -1,7 +1,6 @@
# Packages
node_modules/
yarn.lock
package-lock.json
# Log files
logs/

1
.npmrc
View File

@@ -1 +0,0 @@
package-lock=false

11262
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint:typings": "tslint typings/index.d.ts",
"prettier": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf src/**/*.js typings/**/*.ts",
"prettier": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf --arrow-parens avoid src/**/*.js typings/**/*.ts",
"build:browser": "webpack",
"prepublishOnly": "npm run test && cross-env NODE_ENV=production npm run build:browser"
},
@@ -47,37 +47,37 @@
"runkitExampleFilename": "./docs/examples/ping.js",
"unpkg": "./webpack/discord.min.js",
"dependencies": {
"@discordjs/collection": "^0.1.5",
"@discordjs/collection": "^0.1.6",
"@discordjs/form-data": "^3.0.1",
"abort-controller": "^3.0.0",
"node-fetch": "^2.6.0",
"prism-media": "^1.2.0",
"prism-media": "^1.2.2",
"setimmediate": "^1.0.5",
"tweetnacl": "^1.0.3",
"ws": "^7.2.1"
"ws": "^7.3.1"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-angular": "^8.3.4",
"@types/node": "^10.12.24",
"@types/ws": "^7.2.1",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-angular": "^9.1.1",
"@types/node": "^12.12.6",
"@types/ws": "^7.2.6",
"cross-env": "^7.0.2",
"discord.js-docgen": "discordjs/docgen",
"dtslint": "^3.0.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-prettier": "^3.1.2",
"husky": "^4.2.3",
"jest": "^25.1.0",
"dtslint": "^3.6.14",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.2.5",
"jest": "^26.4.0",
"json-filter-loader": "^1.0.0",
"lint-staged": "^10.0.8",
"prettier": "^1.19.1",
"terser-webpack-plugin": "^1.2.2",
"tslint": "^6.0.0",
"typescript": "^3.8.2",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11"
"lint-staged": "^10.2.11",
"prettier": "^2.0.5",
"terser-webpack-plugin": "^4.1.0",
"tslint": "^6.1.3",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
},
"engines": {
"node": ">=12.0.0"
@@ -122,7 +122,7 @@
},
"lint-staged": {
"*.js": "eslint --fix",
"*.ts": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf"
"*.ts": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf --arrow-parens avoid"
},
"commitlint": {
"extends": [

View File

@@ -18,9 +18,7 @@ const BeforeReadyWhitelist = [
WSEvents.GUILD_MEMBER_REMOVE,
];
const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes)
.slice(1)
.map(Number);
const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes).slice(1).map(Number);
const UNRESUMABLE_CLOSE_CODES = [1000, 4006, 4007];
/**

View File

@@ -121,10 +121,7 @@ class MessageManager extends BaseManager {
async delete(message, reason) {
message = this.resolveID(message);
if (message) {
await this.client.api
.channels(this.channel.id)
.messages(message)
.delete({ reason });
await this.client.api.channels(this.channel.id).messages(message).delete({ reason });
}
}

View File

@@ -74,10 +74,7 @@ class GuildEmoji extends BaseGuildEmoji {
throw new Error('MISSING_MANAGE_EMOJIS_PERMISSION', this.guild);
}
}
const data = await this.client.api
.guilds(this.guild.id)
.emojis(this.id)
.get();
const data = await this.client.api.guilds(this.guild.id).emojis(this.id).get();
this._patch(data);
return this.author;
}

View File

@@ -330,10 +330,7 @@ class TextBasedChannel {
}
if (messageIDs.length === 0) return new Collection();
if (messageIDs.length === 1) {
await this.client.api
.channels(this.id)
.messages(messageIDs[0])
.delete();
await this.client.api.channels(this.id).messages(messageIDs[0]).delete();
const message = this.client.actions.MessageDelete.getMessage(
{
message_id: messageIDs[0],

View File

@@ -64,9 +64,7 @@ class SnowflakeUtil {
* @returns {DeconstructedSnowflake} Deconstructed snowflake
*/
static deconstruct(snowflake) {
const BINARY = Util.idToBinary(snowflake)
.toString(2)
.padStart(64, '0');
const BINARY = Util.idToBinary(snowflake).toString(2).padStart(64, '0');
const res = {
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
workerID: parseInt(BINARY.substring(42, 47), 2),

28
typings/index.d.ts vendored
View File

@@ -699,7 +699,10 @@ declare module 'discord.js' {
): Promise<Guild>;
public setDiscoverySplash(discoverySplash: Base64Resolvable | null, reason?: string): Promise<Guild>;
public setEmbed(embed: GuildWidgetData, reason?: string): Promise<Guild>;
public setExplicitContentFilter(explicitContentFilter: ExplicitContentFilterLevel | number, reason?: string): Promise<Guild>;
public setExplicitContentFilter(
explicitContentFilter: ExplicitContentFilterLevel | number,
reason?: string,
): Promise<Guild>;
public setIcon(icon: Base64Resolvable | null, reason?: string): Promise<Guild>;
public setName(name: string, reason?: string): Promise<Guild>;
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
@@ -2928,7 +2931,17 @@ declare module 'discord.js' {
interface PartialGuildMember
extends Partialize<
GuildMember,
'bannable' | 'displayColor' | 'displayHexColor' | 'displayName' | 'guild' | 'kickable' | 'permissions' | 'roles' | 'manageable' | 'presence' | 'voice'
| 'bannable'
| 'displayColor'
| 'displayHexColor'
| 'displayName'
| 'guild'
| 'kickable'
| 'permissions'
| 'roles'
| 'manageable'
| 'presence'
| 'voice'
> {
readonly bannable: boolean;
readonly displayColor: number;
@@ -2948,7 +2961,16 @@ declare module 'discord.js' {
interface PartialMessage
extends Partialize<
Message,
'attachments' | 'channel' | 'deletable' | 'editable' | 'mentions' | 'pinnable' | 'url' | 'flags' | 'edits' | 'embeds'
| 'attachments'
| 'channel'
| 'deletable'
| 'editable'
| 'mentions'
| 'pinnable'
| 'url'
| 'flags'
| 'edits'
| 'embeds'
> {
attachments: Message['attachments'];
channel: Message['channel'];

View File

@@ -2,7 +2,6 @@
const path = require('path');
const TerserJSPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
const version = require('./package.json').version;
const prod = process.env.NODE_ENV === 'production';
@@ -47,17 +46,17 @@ module.exports = {
zlib: 'empty',
},
optimization: {
minimize: true,
minimizer: [
new TerserJSPlugin({
cache: false,
terserOptions: {
mangle: { keep_classnames: true },
compress: { keep_classnames: true },
mangle: { keep_classnames: true, keep_fnames: true },
keep_classnames: true,
keep_fnames: true,
output: { comments: false },
},
}),
],
},
plugins: [new webpack.optimize.ModuleConcatenationPlugin()],
};