update deps (MisskeyIO#887)

(cherry picked from commit f7da2bad6f0b25652ded11e6a9f86efc40872200)
(cherry picked from commit d60c307c4e4c3eaba2a40b46ba41c4d684d5d370)

Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
あわわわとーにゅ 2025-01-14 02:19:05 +09:00 committed by GitHub
parent cf1952ac0d
commit 9792ea0223
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 2018 additions and 1861 deletions

View file

@ -6,7 +6,7 @@
"type": "git", "type": "git",
"url": "https://github.com/MisskeyIO/misskey.git" "url": "https://github.com/MisskeyIO/misskey.git"
}, },
"packageManager": "pnpm@9.15.0", "packageManager": "pnpm@9.15.3",
"workspaces": [ "workspaces": [
"packages/frontend", "packages/frontend",
"packages/backend", "packages/backend",
@ -56,8 +56,8 @@
"jpeg-js": "0.4.4", "jpeg-js": "0.4.4",
"lodash": "4.17.21", "lodash": "4.17.21",
"sharp": "0.33.5", "sharp": "0.33.5",
"tough-cookie": "5.0.0", "tough-cookie": "5.1.0",
"web-streams-polyfill": "4.0.0" "web-streams-polyfill": "4.1.0"
}, },
"dependencies": { "dependencies": {
"cssnano": "7.0.6", "cssnano": "7.0.6",
@ -65,10 +65,10 @@
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"postcss": "8.4.49", "postcss": "8.4.49",
"terser": "5.37.0", "terser": "5.37.0",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",

View file

@ -33,16 +33,16 @@
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js" "generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
}, },
"optionalDependencies": { "optionalDependencies": {
"@swc/core-darwin-arm64": "1.10.3", "@swc/core-darwin-arm64": "1.10.7",
"@swc/core-darwin-x64": "1.10.3", "@swc/core-darwin-x64": "1.10.7",
"@swc/core-linux-arm-gnueabihf": "1.10.3", "@swc/core-linux-arm-gnueabihf": "1.10.7",
"@swc/core-linux-arm64-gnu": "1.10.3", "@swc/core-linux-arm64-gnu": "1.10.7",
"@swc/core-linux-arm64-musl": "1.10.3", "@swc/core-linux-arm64-musl": "1.10.7",
"@swc/core-linux-x64-gnu": "1.10.3", "@swc/core-linux-x64-gnu": "1.10.7",
"@swc/core-linux-x64-musl": "1.10.3", "@swc/core-linux-x64-musl": "1.10.7",
"@swc/core-win32-arm64-msvc": "1.10.3", "@swc/core-win32-arm64-msvc": "1.10.7",
"@swc/core-win32-ia32-msvc": "1.10.3", "@swc/core-win32-ia32-msvc": "1.10.7",
"@swc/core-win32-x64-msvc": "1.10.3", "@swc/core-win32-x64-msvc": "1.10.7",
"@tensorflow/tfjs": "4.22.0", "@tensorflow/tfjs": "4.22.0",
"@tensorflow/tfjs-node": "4.22.0", "@tensorflow/tfjs-node": "4.22.0",
"bufferutil": "4.0.9", "bufferutil": "4.0.9",
@ -63,22 +63,22 @@
}, },
"dependencies": { "dependencies": {
"@authenio/samlify-node-xmllint": "2.0.0", "@authenio/samlify-node-xmllint": "2.0.0",
"@aws-sdk/client-s3": "3.717.0", "@aws-sdk/client-s3": "3.726.1",
"@aws-sdk/lib-storage": "3.717.0", "@aws-sdk/lib-storage": "3.726.1",
"@bull-board/api": "6.5.4", "@bull-board/api": "6.6.1",
"@bull-board/fastify": "6.5.4", "@bull-board/fastify": "6.6.1",
"@bull-board/ui": "6.5.4", "@bull-board/ui": "6.6.1",
"@discordapp/twemoji": "15.1.0", "@discordapp/twemoji": "15.1.0",
"@elastic/elasticsearch": "8.17.0", "@elastic/elasticsearch": "8.17.0",
"@fastify/accepts": "5.0.2", "@fastify/accepts": "5.0.2",
"@fastify/cookie": "11.0.1", "@fastify/cookie": "11.0.2",
"@fastify/cors": "10.0.1", "@fastify/cors": "10.0.2",
"@fastify/express": "4.0.1", "@fastify/express": "4.0.2",
"@fastify/formbody": "8.0.1", "@fastify/formbody": "8.0.2",
"@fastify/http-proxy": "11.0.0", "@fastify/http-proxy": "11.0.1",
"@fastify/multipart": "9.0.1", "@fastify/multipart": "9.0.2",
"@fastify/static": "8.0.3", "@fastify/static": "8.0.4",
"@fastify/view": "10.0.1", "@fastify/view": "10.0.2",
"@misskey-dev/sharp-read-bmp": "1.2.0", "@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3", "@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
"@napi-rs/canvas": "0.1.65", "@napi-rs/canvas": "0.1.65",
@ -86,11 +86,11 @@
"@nestjs/core": "10.4.15", "@nestjs/core": "10.4.15",
"@nestjs/testing": "10.4.15", "@nestjs/testing": "10.4.15",
"@peertube/http-signature": "1.7.0", "@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "13.0.0", "@simplewebauthn/server": "13.1.0",
"@sinonjs/fake-timers": "11.3.1", "@sinonjs/fake-timers": "11.3.1",
"@smithy/node-http-handler": "3.3.3", "@smithy/node-http-handler": "4.0.1",
"@swc/cli": "0.5.2", "@swc/cli": "0.6.0",
"@swc/core": "1.10.3", "@swc/core": "1.10.7",
"@twemoji/parser": "15.1.1", "@twemoji/parser": "15.1.1",
"accepts": "1.3.8", "accepts": "1.3.8",
"ajv": "8.17.1", "ajv": "8.17.1",
@ -99,7 +99,7 @@
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"blurhash": "2.0.5", "blurhash": "2.0.5",
"body-parser": "1.20.3", "body-parser": "1.20.3",
"bullmq": "5.34.5", "bullmq": "5.34.9",
"cacheable-lookup": "7.0.0", "cacheable-lookup": "7.0.0",
"cbor": "10.0.3", "cbor": "10.0.3",
"chalk": "5.4.1", "chalk": "5.4.1",
@ -110,8 +110,8 @@
"content-disposition": "0.5.4", "content-disposition": "0.5.4",
"date-fns": "4.1.0", "date-fns": "4.1.0",
"deep-email-validator": "0.1.21", "deep-email-validator": "0.1.21",
"fastify": "5.2.0", "fastify": "5.2.1",
"fastify-http-errors-enhanced": "6.0.0", "fastify-http-errors-enhanced": "6.0.1",
"fastify-raw-body": "5.0.0", "fastify-raw-body": "5.0.0",
"feed": "4.2.2", "feed": "4.2.2",
"file-type": "19.6.0", "file-type": "19.6.0",
@ -127,7 +127,7 @@
"is-svg": "5.1.0", "is-svg": "5.1.0",
"jose": "5.9.6", "jose": "5.9.6",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"jsdom": "25.0.1", "jsdom": "26.0.0",
"json5": "2.2.3", "json5": "2.2.3",
"jsonld": "8.3.3", "jsonld": "8.3.3",
"jsrsasign": "11.1.0", "jsrsasign": "11.1.0",
@ -170,18 +170,18 @@
"rxjs": "7.8.1", "rxjs": "7.8.1",
"samlify": "2.8.11", "samlify": "2.8.11",
"sanitize-html": "2.14.0", "sanitize-html": "2.14.0",
"secure-json-parse": "3.0.1", "secure-json-parse": "3.0.2",
"sharp": "0.33.5", "sharp": "0.33.5",
"slacc": "0.0.10", "slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0", "strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0", "stringz": "2.1.0",
"systeminformation": "5.23.23", "systeminformation": "5.25.11",
"tinycolor2": "1.6.0", "tinycolor2": "1.6.0",
"tmp": "0.2.3", "tmp": "0.2.3",
"tsc-alias": "1.8.10", "tsc-alias": "1.8.10",
"tsconfig-paths": "4.2.0", "tsconfig-paths": "4.2.0",
"typeorm": "0.3.20", "typeorm": "0.3.20",
"typescript": "5.7.2", "typescript": "5.7.3",
"ulid": "2.3.0", "ulid": "2.3.0",
"vary": "1.1.2", "vary": "1.1.2",
"web-push": "3.6.7", "web-push": "3.6.7",
@ -210,7 +210,7 @@
"@types/jsrsasign": "10.5.15", "@types/jsrsasign": "10.5.15",
"@types/mime-types": "2.1.4", "@types/mime-types": "2.1.4",
"@types/ms": "0.7.34", "@types/ms": "0.7.34",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@types/node-forge": "1.3.11", "@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.17", "@types/nodemailer": "6.4.17",
"@types/oauth": "0.9.6", "@types/oauth": "0.9.6",

View file

@ -27,11 +27,11 @@
"@rollup/plugin-typescript": "12.1.2", "@rollup/plugin-typescript": "12.1.2",
"@rollup/pluginutils": "5.1.4", "@rollup/pluginutils": "5.1.4",
"@syuilo/aiscript": "0.19.0", "@syuilo/aiscript": "0.19.0",
"@tabler/icons-webfont": "3.26.0", "@tabler/icons-webfont": "3.28.1",
"@twemoji/parser": "15.1.1", "@twemoji/parser": "15.1.1",
"@vitejs/plugin-vue": "5.2.1", "@vitejs/plugin-vue": "5.2.1",
"@vue/compiler-sfc": "3.5.13", "@vue/compiler-sfc": "3.5.13",
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.13", "aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.15",
"astring": "1.9.0", "astring": "1.9.0",
"broadcast-channel": "7.0.0", "broadcast-channel": "7.0.0",
"buraha": "0.0.1", "buraha": "0.0.1",
@ -41,7 +41,7 @@
"chartjs-chart-matrix": "2.0.1", "chartjs-chart-matrix": "2.0.1",
"chartjs-plugin-gradient": "0.6.1", "chartjs-plugin-gradient": "0.6.1",
"chartjs-plugin-zoom": "2.2.0", "chartjs-plugin-zoom": "2.2.0",
"chromatic": "11.20.2", "chromatic": "11.22.2",
"compare-versions": "6.1.1", "compare-versions": "6.1.1",
"cropperjs": "2.0.0-rc.0", "cropperjs": "2.0.0-rc.0",
"date-fns": "4.1.0", "date-fns": "4.1.0",
@ -59,21 +59,21 @@
"misskey-reversi": "workspace:*", "misskey-reversi": "workspace:*",
"photoswipe": "5.4.4", "photoswipe": "5.4.4",
"punycode.js": "2.3.1", "punycode.js": "2.3.1",
"rollup": "4.29.1", "rollup": "4.30.1",
"sanitize-html": "2.14.0", "sanitize-html": "2.14.0",
"sass": "1.83.0", "sass": "1.83.1",
"shiki": "1.24.4", "shiki": "1.26.2",
"strict-event-emitter-types": "2.0.0", "strict-event-emitter-types": "2.0.0",
"textarea-caret": "3.1.0", "textarea-caret": "3.1.0",
"three": "0.171.0", "three": "0.172.0",
"throttle-debounce": "5.0.2", "throttle-debounce": "5.0.2",
"tinycolor2": "1.6.0", "tinycolor2": "1.6.0",
"tsc-alias": "1.8.10", "tsc-alias": "1.8.10",
"tsconfig-paths": "4.2.0", "tsconfig-paths": "4.2.0",
"typescript": "5.7.2", "typescript": "5.7.3",
"uuid": "11.0.3", "uuid": "11.0.5",
"v-code-diff": "1.13.1", "v-code-diff": "1.13.1",
"vite": "6.0.6", "vite": "6.0.7",
"vue": "3.5.13", "vue": "3.5.13",
"vue-gtag": "2.0.1", "vue-gtag": "2.0.1",
"vuedraggable": "next", "vuedraggable": "next",
@ -105,10 +105,10 @@
"@types/estree": "1.0.6", "@types/estree": "1.0.6",
"@types/matter-js": "0.19.8", "@types/matter-js": "0.19.8",
"@types/micromatch": "4.0.9", "@types/micromatch": "4.0.9",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@types/punycode.js": "npm:@types/punycode@2.1.4", "@types/punycode.js": "npm:@types/punycode@2.1.4",
"@types/sanitize-html": "2.13.0", "@types/sanitize-html": "2.13.0",
"@types/three": "0.171.0", "@types/three": "0.172.0",
"@types/throttle-debounce": "5.0.2", "@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6", "@types/tinycolor2": "1.4.6",
"@types/ws": "8.5.13", "@types/ws": "8.5.13",
@ -122,8 +122,8 @@
"eslint": "8.57.1", "eslint": "8.57.1",
"eslint-plugin-import": "2.31.0", "eslint-plugin-import": "2.31.0",
"eslint-plugin-vue": "9.32.0", "eslint-plugin-vue": "9.32.0",
"fast-glob": "3.3.2", "fast-glob": "3.3.3",
"happy-dom": "16.0.1", "happy-dom": "16.5.3",
"intersection-observer": "0.12.2", "intersection-observer": "0.12.2",
"micromatch": "4.0.8", "micromatch": "4.0.8",
"msw": "2.7.0", "msw": "2.7.0",

View file

@ -3,7 +3,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { getHighlighterCore, loadWasm } from 'shiki/core'; import { createHighlighterCore } from 'shiki/core';
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
import darkPlus from 'shiki/themes/dark-plus.mjs'; import darkPlus from 'shiki/themes/dark-plus.mjs';
import { bundledThemesInfo } from 'shiki/themes'; import { bundledThemesInfo } from 'shiki/themes';
import { bundledLanguagesInfo } from 'shiki/langs'; import { bundledLanguagesInfo } from 'shiki/langs';
@ -60,8 +61,6 @@ export async function getHighlighter(): Promise<HighlighterCore> {
} }
async function initHighlighter() { async function initHighlighter() {
await loadWasm(import('shiki/onig.wasm?init'));
// テーマの重複を消す // テーマの重複を消す
const themes = unique([ const themes = unique([
darkPlus, darkPlus,
@ -69,7 +68,8 @@ async function initHighlighter() {
]); ]);
const jsLangInfo = bundledLanguagesInfo.find(t => t.id === 'javascript'); const jsLangInfo = bundledLanguagesInfo.find(t => t.id === 'javascript');
const highlighter = await getHighlighterCore({ const highlighter = await createHighlighterCore({
engine: createOnigurumaEngine(() => import('shiki/onig.wasm?init')),
themes, themes,
langs: [ langs: [
...(jsLangInfo ? [async () => await jsLangInfo.import()] : []), ...(jsLangInfo ? [async () => await jsLangInfo.import()] : []),

View file

@ -7,10 +7,10 @@ import { deepClone } from './clone.js';
import type { Cloneable } from './clone.js'; import type { Cloneable } from './clone.js';
type DeepPartial<T> = { type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Record<string | number | symbol, unknown> ? DeepPartial<T[P]> : T[P]; [P in keyof T]?: T[P] extends Record<PropertyKey, unknown> ? DeepPartial<T[P]> : T[P];
}; };
function isPureObject(value: unknown): value is Record<string | number | symbol, unknown> { function isPureObject(value: unknown): value is Record<PropertyKey, unknown> {
return typeof value === 'object' && value !== null && !Array.isArray(value); return typeof value === 'object' && value !== null && !Array.isArray(value);
} }
@ -18,14 +18,14 @@ function isPureObject(value: unknown): value is Record<string | number | symbol,
* valueにないキーをdefからもらう\ * valueにないキーをdefからもらう\
* nullはそのままundefinedはdefの値 * nullはそのままundefinedはdefの値
**/ **/
export function deepMerge<X extends Record<string | number | symbol, unknown>>(value: DeepPartial<X>, def: X): X { export function deepMerge<X extends Record<PropertyKey, unknown>>(value: DeepPartial<X>, def: X): X {
if (isPureObject(value) && isPureObject(def)) { if (isPureObject(value) && isPureObject(def)) {
const result = deepClone(value as Cloneable) as X; const result = deepClone(value as Cloneable) as X;
for (const [k, v] of Object.entries(def) as [keyof X, X[keyof X]][]) { for (const [k, v] of Object.entries(def) as [keyof X, X[keyof X]][]) {
if (!Object.hasOwn(value, k) || value[k] === undefined) { if (!Object.hasOwn(value, k) || value[k] === undefined) {
result[k] = v; result[k] = v;
} else if (isPureObject(v) && isPureObject(result[k])) { } else if (isPureObject(v) && isPureObject(result[k])) {
const child = deepClone(result[k] as Cloneable) as DeepPartial<X[keyof X] & Record<string | number | symbol, unknown>>; const child = deepClone(result[k] as Cloneable) as DeepPartial<X[keyof X] & Record<PropertyKey, unknown>>;
result[k] = deepMerge<typeof v>(child, v); result[k] = deepMerge<typeof v>(child, v);
} }
} }

View file

@ -10,8 +10,8 @@
"declaration": false, "declaration": false,
"sourceMap": false, "sourceMap": false,
"target": "es2022", "target": "es2022",
"module": "nodenext", "module": "es2022",
"moduleResolution": "nodenext", "moduleResolution": "bundler",
"removeComments": false, "removeComments": false,
"noLib": false, "noLib": false,
"strict": true, "strict": true,

View file

@ -26,13 +26,13 @@
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@types/matter-js": "0.19.8", "@types/matter-js": "0.19.8",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@types/seedrandom": "3.0.8", "@types/seedrandom": "3.0.8",
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1", "eslint": "8.57.1",
"nodemon": "3.1.9", "nodemon": "3.1.9",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"files": [ "files": [
"built" "built"
@ -40,7 +40,7 @@
"dependencies": { "dependencies": {
"esbuild": "0.24.2", "esbuild": "0.24.2",
"eventemitter3": "5.0.1", "eventemitter3": "5.0.1",
"glob": "11.0.0", "glob": "11.0.1",
"matter-js": "0.20.0", "matter-js": "0.20.0",
"seedrandom": "3.0.5" "seedrandom": "3.0.5"
} }

View file

@ -5,7 +5,7 @@
```ts ```ts
import { EventEmitter } from 'eventemitter3'; import { EventEmitter } from 'eventemitter3';
import _ReconnectingWebsocket from 'reconnecting-websocket'; import { Options } from 'reconnecting-websocket';
// Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts
// //
@ -3023,7 +3023,7 @@ export class Stream extends EventEmitter<StreamEvents> {
constructor(origin: string, user: { constructor(origin: string, user: {
token: string; token: string;
} | null, options?: { } | null, options?: {
WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; WebSocket?: Options['WebSocket'];
}); });
// (undocumented) // (undocumented)
close(): void; close(): void;

View file

@ -9,7 +9,7 @@
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@readme/openapi-parser": "2.6.0", "@readme/openapi-parser": "2.6.0",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1", "eslint": "8.57.1",
@ -17,7 +17,7 @@
"openapi-typescript": "6.7.6", "openapi-typescript": "6.7.6",
"ts-case-convert": "2.1.0", "ts-case-convert": "2.1.0",
"tsx": "4.19.2", "tsx": "4.19.2",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"files": [ "files": [
"built" "built"

View file

@ -35,11 +35,11 @@
"url": "git+https://github.com/misskey-dev/misskey.js.git" "url": "git+https://github.com/misskey-dev/misskey.js.git"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/api-extractor": "7.48.1", "@microsoft/api-extractor": "7.49.1",
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@swc/jest": "0.2.37", "@swc/jest": "0.2.37",
"@types/jest": "29.5.14", "@types/jest": "29.5.14",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1", "eslint": "8.57.1",
@ -50,7 +50,7 @@
"ncp": "2.0.0", "ncp": "2.0.0",
"nodemon": "3.1.9", "nodemon": "3.1.9",
"tsd": "0.31.2", "tsd": "0.31.2",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"files": [ "files": [
"built", "built",
@ -58,8 +58,8 @@
"built/dts" "built/dts"
], ],
"dependencies": { "dependencies": {
"@swc/cli": "0.5.2", "@swc/cli": "0.6.0",
"@swc/core": "1.10.3", "@swc/core": "1.10.7",
"eventemitter3": "5.0.1", "eventemitter3": "5.0.1",
"reconnecting-websocket": "4.4.0" "reconnecting-websocket": "4.4.0"
} }

View file

@ -1,8 +1,10 @@
import { EventEmitter } from 'eventemitter3'; import { EventEmitter } from 'eventemitter3';
import _ReconnectingWebsocket from 'reconnecting-websocket'; import _ReconnectingWebSocket, { Options } from 'reconnecting-websocket';
import type { BroadcastEvents, Channels } from './streaming.types.js'; import type { BroadcastEvents, Channels } from './streaming.types.js';
const ReconnectingWebsocket = _ReconnectingWebsocket as unknown as typeof _ReconnectingWebsocket['default']; // コンストラクタとクラスそのものの定義が上手く解決出来ないため再定義
const ReconnectingWebSocketConstructor = _ReconnectingWebSocket as unknown as typeof _ReconnectingWebSocket.default;
type ReconnectingWebSocket = _ReconnectingWebSocket.default;
export function urlQuery(obj: Record<string, string | number | boolean | undefined>): string { export function urlQuery(obj: Record<string, string | number | boolean | undefined>): string {
const params = Object.entries(obj) const params = Object.entries(obj)
@ -26,7 +28,7 @@ type StreamEvents = {
* Misskey stream connection * Misskey stream connection
*/ */
export default class Stream extends EventEmitter<StreamEvents> { export default class Stream extends EventEmitter<StreamEvents> {
private stream: _ReconnectingWebsocket.default; private stream: ReconnectingWebSocket;
public state: 'initializing' | 'reconnecting' | 'connected' = 'initializing'; public state: 'initializing' | 'reconnecting' | 'connected' = 'initializing';
private sharedConnectionPools: Pool[] = []; private sharedConnectionPools: Pool[] = [];
private sharedConnections: SharedConnection[] = []; private sharedConnections: SharedConnection[] = [];
@ -34,7 +36,7 @@ export default class Stream extends EventEmitter<StreamEvents> {
private idCounter = 0; private idCounter = 0;
constructor(origin: string, user: { token: string; } | null, options?: { constructor(origin: string, user: { token: string; } | null, options?: {
WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; WebSocket?: Options['WebSocket'];
}) { }) {
super(); super();
@ -62,7 +64,7 @@ export default class Stream extends EventEmitter<StreamEvents> {
const wsOrigin = origin.replace('http://', 'ws://').replace('https://', 'wss://'); const wsOrigin = origin.replace('http://', 'ws://').replace('https://', 'wss://');
this.stream = new ReconnectingWebsocket(`${wsOrigin}/streaming?${query}`, '', { this.stream = new ReconnectingWebSocketConstructor(`${wsOrigin}/streaming?${query}`, '', {
minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91 minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91
WebSocket: options.WebSocket, WebSocket: options.WebSocket,
}); });

View file

@ -25,17 +25,17 @@
}, },
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@types/node": "22.10.2", "@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1", "eslint": "8.57.1",
"nodemon": "3.1.9", "nodemon": "3.1.9",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"dependencies": { "dependencies": {
"crc-32": "1.2.2", "crc-32": "1.2.2",
"esbuild": "0.24.2", "esbuild": "0.24.2",
"glob": "11.0.0" "glob": "11.0.1"
}, },
"files": [ "files": [
"built" "built"

View file

@ -15,12 +15,12 @@
}, },
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@types/serviceworker": "0.0.108", "@types/serviceworker": "0.0.111",
"@typescript-eslint/parser": "7.10.0", "@typescript-eslint/parser": "7.10.0",
"eslint": "8.57.1", "eslint": "8.57.1",
"eslint-plugin-import": "2.31.0", "eslint-plugin-import": "2.31.0",
"nodemon": "3.1.9", "nodemon": "3.1.9",
"typescript": "5.7.2" "typescript": "5.7.3"
}, },
"type": "module" "type": "module"
} }

3705
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff