chore(deps)!: upgrade all deps to new major versions (#3195)

* chore(deps): upgrade deps to latest in range

* feat: upgrade node engine minimum

Closes #3173

* fix: typing errors after dep upgrade

* chore(deps): upgrade benchmark typescript version

* feat: upgrade eslint, lint staged, and es version

* fix: lint-staged failures

* style: formatting

* chore(deps): major version upgrades

* chore(deps): upgrade yarn to 4.0

* fix: lock typescript to 5.2.2 until ts-node/mocha fix

bug: https://github.com/mochajs/mocha/issues/5031

* chore: remove old Deno file

Went through history and can't find any reference to this after Deno rewrite

* chore(deps): more dep updates

* feat: typedoc config upgrade

* fix: temporarily reset docusaurus to main

* chore(deps): minor range upgrades

* chore(deps)!: docusaurus major upgrade

* revert: go back to original 2.x docusaurus
This commit is contained in:
Matthew Hatcher
2023-12-04 07:57:15 -06:00
committed by GitHub
parent e7d32e4be6
commit a62f06c3e8
31 changed files with 9018 additions and 7342 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

893
.yarn/releases/yarn-4.0.2.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
afterInstall: yarn run setup-dd
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: '@yarnpkg/plugin-typescript'
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'
- path: .yarn/plugins/@yarnpkg/plugin-after-install.cjs
spec: 'https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.5.0/bundles/@yarnpkg/plugin-after-install.js'
spec: "https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.5.0/bundles/@yarnpkg/plugin-after-install.js"
yarnPath: .yarn/releases/yarn-3.6.4.cjs
afterInstall: yarn run setup-dd
yarnPath: .yarn/releases/yarn-4.0.2.cjs

View File

@@ -9,7 +9,7 @@
"scripts": {
"build": "turbo run build --no-daemon",
"build:watch": "echo \"Starting build in watch mode...\" && chokidar \"packages/**/*.ts\" --ignore \"packages/**/dist/**/*.d.ts\" -c \"yarn run build && yarn run build:type\"",
"build:doc": "typedoc --out ./website/docs/generated/ && node scripts/finalizeTypedocs.js",
"build:doc": "typedoc --options ./typedoc.json && node scripts/finalizeTypedocs.js",
"build:type": "turbo run build:type --no-daemon",
"dev": "turbo run dev --parallel --no-daemon",
"fmt": "turbo run fmt --no-daemon",
@@ -29,27 +29,27 @@
},
"devDependencies": {
"chokidar-cli": "^3.0.0",
"eslint": "^8.36.0",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"husky": "^8.0.3",
"lint-staged": "^13.2.0",
"prettier": "^3.0.3",
"turbo": "latest",
"typedoc": "^0.23.26",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.5"
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"turbo": "^1.10.16",
"typedoc": "0.25.4",
"typedoc-plugin-markdown": "3.17.1",
"typescript": "5.2.2"
},
"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,md,html,css}": "prettier --ignore-unknown --write",
"*.{js,jsx,ts,tsx,md,html,css}": "yarn run prettier --ignore-unknown --write",
"*.{js,ts,tsx}": [
"eslint --fix --config ./packages/eslint-config-discordeno/index.js --resolve-plugins-relative-to ."
"yarn run eslint --fix --config ./packages/eslint-config-discordeno/index.js --resolve-plugins-relative-to ."
]
},
"packageManager": "yarn@3.6.4",
"packageManager": "yarn@4.0.2",
"dependencies": {
"typedoc-plugin-missing-exports": "^1.0.0"
"typedoc-plugin-missing-exports": "^2.1.0"
}
}

View File

@@ -31,17 +31,17 @@
"@discordeno/utils": "19.0.0-alpha.1",
"benchmark": "^2.1.4",
"microtime": "^3.1.1",
"node-fetch": "^3.3.1"
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.21",
"@types/benchmark": "^2",
"@types/node": "^18.11.9",
"eslint": "^8.0.1",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/benchmark": "^2.1.5",
"@types/node": "^18.18.13",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.3"
"typescript": "5.2.2"
}
}

View File

@@ -142,9 +142,8 @@ export async function memoryBenchmark<O, E>(
for (const tableRow of tableRows) {
for (const [index, tableField] of tableFields.entries()) {
if (index === 0) humanReadable[tableRow] = {}
humanReadable[tableRow]![
tableField
] = `${processedResults[tableRow][tableField].value} MB (${processedResults[tableRow][tableField].min} MB … ${processedResults[tableRow][tableField].max} MB)`
humanReadable[tableRow]![tableField] =
`${processedResults[tableRow][tableField].value} MB (${processedResults[tableRow][tableField].min} MB … ${processedResults[tableRow][tableField].max} MB)`
}
}

View File

@@ -35,20 +35,20 @@
"@discordeno/utils": "19.0.0-alpha.1"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"c8": "^7.13.0",
"chai": "^4.3.7",
"eslint": "^8.36.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"c8": "^8.0.1",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"sinon": "^15.0.2",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5"
"typescript": "5.2.2"
}
}

View File

@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.ts"]
}

View File

@@ -34,23 +34,23 @@
"@discordeno/rest": "19.0.0-alpha.1",
"@discordeno/types": "19.0.0-alpha.1",
"@discordeno/utils": "19.0.0-alpha.1",
"commander": "^11.0.0"
"commander": "^11.1.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"c8": "^7.13.0",
"chai": "^4.3.7",
"eslint": "^8.36.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"c8": "^8.0.1",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"sinon": "^15.0.2",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5"
"typescript": "5.2.2"
}
}

View File

@@ -1,6 +1,6 @@
module.exports = {
env: {
es2021: true,
es2022: true,
node: true,
},
extends: ['standard-with-typescript', 'plugin:prettier/recommended', 'plugin:require-extensions/recommended'],

View File

@@ -4,17 +4,17 @@
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "8.7.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"eslint": "^8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-require-extensions": "^0.1.2",
"typescript": "^4.9.5"
"eslint-plugin-require-extensions": "^0.1.3",
"typescript": "5.2.2"
},
"publishConfig": {
"access": "public"

View File

@@ -31,25 +31,25 @@
"dependencies": {
"@discordeno/types": "19.0.0-alpha.1",
"@discordeno/utils": "19.0.0-alpha.1",
"ws": "^8.13.0"
"ws": "^8.14.2"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"@types/ws": "^8.5.4",
"c8": "^7.13.0",
"chai": "^4.3.7",
"eslint": "^8.36.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"@types/ws": "^8.5.10",
"c8": "^8.0.1",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"sinon": "^15.0.2",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5",
"typescript": "5.2.2",
"uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js.git#commit=42c9c0d5d31f46ca4115dc75672b0037ec970f28"
}
}

View File

@@ -72,7 +72,7 @@ export interface ShardHeart {
/** Interval between heartbeats requested by Discord. */
interval: number
/** Id of the interval, which is used for sending the heartbeats. */
intervalId?: NodeJS.Timer
intervalId?: NodeJS.Timeout
/** Unix (in milliseconds) timestamp when the last heartbeat ACK was received from Discord. */
lastAck?: number
/** Unix timestamp (in milliseconds) when the last heartbeat was sent. */

View File

@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.ts"]
}

View File

@@ -32,26 +32,26 @@
"dependencies": {
"@discordeno/types": "19.0.0-alpha.1",
"@discordeno/utils": "19.0.0-alpha.1",
"dotenv": "^16.0.3"
"dotenv": "^16.3.1"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"c8": "^7.13.0",
"chai": "^4.3.7",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"c8": "^8.0.1",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"eslint": "^8.36.0",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"sinon": "^15.0.2",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5",
"typescript": "5.2.2",
"why-is-node-running": "^2.2.2"
}
}

View File

@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.ts"]
}

View File

@@ -18,7 +18,6 @@
"skipLibCheck": true,
"strict": true,
"incremental": true,
"importsNotUsedAsValues": "error",
"resolveJsonModule": true
},
"exclude": ["node_modules", "dist", "tests", "test"],

View File

@@ -27,19 +27,19 @@
"test:type": "tsc --noEmit"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"c8": "^7.13.0",
"chai": "^4.3.7",
"eslint": "^8.36.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"c8": "^8.0.1",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5"
"typescript": "5.2.2"
}
}

View File

@@ -993,15 +993,15 @@ export type Camelize<T> = T extends any[]
? Array<Camelize<T[number]>>
: T
: T extends Record<any, any>
? { [K in keyof T as CamelCase<K & string>]: Camelize<T[K]> }
: T
? { [K in keyof T as CamelCase<K & string>]: Camelize<T[K]> }
: T
export type Snakelize<T> = T extends any[]
? T extends Array<Record<any, any>>
? Array<Snakelize<T[number]>>
: T
: T extends Record<any, any>
? { [K in keyof T as SnakeCase<K & string>]: Snakelize<T[K]> }
: T
? { [K in keyof T as SnakeCase<K & string>]: Snakelize<T[K]> }
: T
export type PickPartial<T, K extends keyof T> = { [P in keyof T]?: T[P] | undefined } & { [P in K]: T[P] }

View File

@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.ts"]
}

View File

@@ -33,20 +33,20 @@
"tweetnacl": "^1.0.3"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.40",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"c8": "^7.13.0",
"chai": "^4.3.7",
"eslint": "^8.36.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.99",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.13",
"@types/sinon": "^17.0.2",
"c8": "^8.0.1",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"mocha": "^10.2.0",
"sinon": "^15.0.2",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.9.5"
"typescript": "5.2.2"
}
}

View File

@@ -8,7 +8,7 @@ export class Collection<K, V> extends Map<K, V> {
*/
maxSize: number | undefined
/** Handler to remove items from the collection every so often. */
sweeper: (CollectionSweeper<K, V> & { intervalId?: NodeJS.Timer }) | undefined
sweeper: (CollectionSweeper<K, V> & { intervalId?: NodeJS.Timeout }) | undefined
constructor(entries?: (ReadonlyArray<readonly [K, V]> | null) | Map<K, V>, options?: CollectionOptions<K, V>) {
super(entries ?? [])
@@ -20,7 +20,7 @@ export class Collection<K, V> extends Map<K, V> {
this.startSweeper(options.sweeper)
}
startSweeper(options: CollectionSweeper<K, V>): NodeJS.Timer {
startSweeper(options: CollectionSweeper<K, V>): NodeJS.Timeout {
if (this.sweeper?.intervalId) clearInterval(this.sweeper.intervalId)
this.sweeper = options

View File

@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.ts"]
}

View File

@@ -1,40 +0,0 @@
const handlers: {
[index: string]: any
} = {}
const topDirs = ['./handlers']
const readDir = async (dirname: string, onContent: (content: string) => void) => {
const files: Deno.DirEntry[] = []
for (const dirEntry of Deno.readDirSync(dirname)) {
files.push(dirEntry)
}
await Promise.all(
files.map(async (file) => {
if (file.isFile) {
const content = await Deno.readTextFile(dirname + '/' + file.name)
onContent(content)
return
}
if (file.isDirectory) await readDir(`${dirname}/${file.name}`, onContent)
}),
)
}
await Promise.all(
topDirs.map((topDir) =>
readDir(topDir, (content) => {
const handler = content.match(/export function [A-z]+\(/g)
if (handler === null) return
const transformers = content.match(/bot.transformers.[A-z]+\(/g)
const event = content.match(/bot.events.[A-z]+\(/)
handlers[handler.map((handler) => handler.slice(16, -1))[0]] = {
transformers: transformers === null ? [] : transformers.map((result) => result.slice(4, -1)),
event: event === null ? undefined : event.map((result) => result.slice(4, -1))[0],
}
}),
),
)
console.log(handlers)

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPointStrategy": "packages",
"entryPoints": ["packages/bot", "packages/gateway", "packages/rest", "packages/types", "packages/utils"],
"logger": "console",
"skipErrorChecking": true,
"out": "./website/docs/generated/",
"cleanOutputDir": false,

View File

@@ -150,4 +150,4 @@ const config = {
],
}
module.exports = config
module.exports = config

View File

@@ -18,34 +18,34 @@
"setup-dd": ""
},
"dependencies": {
"@babel/plugin-syntax-flow": "^7.18.6",
"@docusaurus/core": "2.3.1",
"@docusaurus/preset-classic": "2.3.1",
"@babel/plugin-syntax-flow": "^7.23.3",
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@easyops-cn/docusaurus-search-local": "^0.34.0",
"@mdx-js/react": "^1.6.22",
"babel-plugin-styled-components": "^2.1.1",
"chart.js": "^4.2.1",
"babel-plugin-styled-components": "^2.1.4",
"chart.js": "^4.4.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-chartjs-2": "^5.2.0",
"react-dom": "^17.0.2",
"styled-components": "^5.3.9"
"styled-components": "^5.3.11"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.3.1",
"@tsconfig/docusaurus": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"@docusaurus/module-type-aliases": "2.4.3",
"@tsconfig/docusaurus": "^1.0.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^8.10.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.32.2",
"prettier": "^2.8.7",
"typescript": "^4.9.5"
"eslint-plugin-react": "^7.33.2",
"prettier": "^2.8.8",
"typescript": "5.2.2"
},
"browserslist": {
"production": [

File diff suppressed because it is too large Load Diff

4259
yarn.lock

File diff suppressed because it is too large Load Diff