From 1a01a851827e22c88c1bd55eb76695322ecec277 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 08:39:38 +0900 Subject: perf(reversi): improve performance of reversi backend --- packages/backend/src/core/ReversiService.ts | 215 ++++++++++++---------------- 1 file changed, 92 insertions(+), 123 deletions(-) diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts index f97f71eb43..39177322f3 100644 --- a/packages/backend/src/core/ReversiService.ts +++ b/packages/backend/src/core/ReversiService.ts @@ -12,18 +12,14 @@ import { IsNull } from 'typeorm'; import type { MiReversiGame, ReversiGamesRepository, - UsersRepository, } from '@/models/_.js'; import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; -import { MetaService } from '@/core/MetaService.js'; import { CacheService } from '@/core/CacheService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { GlobalEvents } from '@/core/GlobalEventService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { IdService } from '@/core/IdService.js'; -import type { Packed } from '@/misc/json-schema.js'; import { NotificationService } from '@/core/NotificationService.js'; import { Serialized } from '@/types.js'; import { ReversiGameEntityService } from './entities/ReversiGameEntityService.js'; @@ -58,7 +54,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { @bindThis private async cacheGame(game: MiReversiGame) { - await this.redisClient.setex(`reversi:game:cache:${game.id}`, 60 * 3, JSON.stringify(game)); + await this.redisClient.setex(`reversi:game:cache:${game.id}`, 60 * 60, JSON.stringify(game)); } @bindThis @@ -66,6 +62,33 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { await this.redisClient.del(`reversi:game:cache:${gameId}`); } + @bindThis + private getBakeProps(game: MiReversiGame) { + return { + startedAt: game.startedAt, + endedAt: game.endedAt, + // ゲームの途中からユーザーが変わることは無いので + //user1Id: game.user1Id, + //user2Id: game.user2Id, + user1Ready: game.user1Ready, + user2Ready: game.user2Ready, + black: game.black, + isStarted: game.isStarted, + isEnded: game.isEnded, + winnerId: game.winnerId, + surrenderedUserId: game.surrenderedUserId, + timeoutUserId: game.timeoutUserId, + isLlotheo: game.isLlotheo, + canPutEverywhere: game.canPutEverywhere, + loopedBoard: game.loopedBoard, + timeLimitForEachTurn: game.timeLimitForEachTurn, + logs: game.logs, + map: game.map, + bw: game.bw, + crc32: game.crc32, + } satisfies Partial; + } + @bindThis public async matchSpecificUser(me: MiUser, targetUser: MiUser): Promise { if (targetUser.id === me.id) { @@ -204,14 +227,10 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { let isBothReady = false; if (game.user1Id === user.id) { - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - user1Ready: ready, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); + const updatedGame = { + ...game, + user1Ready: ready, + }; this.cacheGame(updatedGame); this.globalEventService.publishReversiGameStream(game.id, 'changeReadyStates', { @@ -221,14 +240,10 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { if (ready && updatedGame.user2Ready) isBothReady = true; } else if (game.user2Id === user.id) { - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - user2Ready: ready, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); + const updatedGame = { + ...game, + user2Ready: ready, + }; this.cacheGame(updatedGame); this.globalEventService.publishReversiGameStream(game.id, 'changeReadyStates', { @@ -262,22 +277,15 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { bw = parseInt(game.bw, 10); } - function getRandomMap() { - const mapCount = Object.entries(Reversi.maps).length; - const rnd = Math.floor(Math.random() * mapCount); - return Object.values(Reversi.maps)[rnd].data; - } - - const map = game.map != null ? game.map : getRandomMap(); - const crc32 = CRC32.str(JSON.stringify(game.logs)).toString(); const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() .set({ + ...this.getBakeProps(game), startedAt: new Date(), isStarted: true, black: bw, - map: map, + map: game.map, crc32, }) .where('id = :id', { id: game.id }) @@ -287,38 +295,23 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { this.cacheGame(updatedGame); //#region 盤面に最初から石がないなどして始まった瞬間に勝敗が決定する場合があるのでその処理 - const engine = new Reversi.Game(map, { - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, + const engine = new Reversi.Game(updatedGame.map, { + isLlotheo: updatedGame.isLlotheo, + canPutEverywhere: updatedGame.canPutEverywhere, + loopedBoard: updatedGame.loopedBoard, }); if (engine.isEnded) { - let winner; + let winnerId; if (engine.winner === true) { - winner = bw === 1 ? game.user1Id : game.user2Id; + winnerId = bw === 1 ? updatedGame.user1Id : updatedGame.user2Id; } else if (engine.winner === false) { - winner = bw === 1 ? game.user2Id : game.user1Id; + winnerId = bw === 1 ? updatedGame.user2Id : updatedGame.user1Id; } else { - winner = null; + winnerId = null; } - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - isEnded: true, - endedAt: new Date(), - winnerId: winner, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'ended', { - winnerId: winner, - game: await this.reversiGameEntityService.packDetail(game.id), - }); + await this.endGame(updatedGame, winnerId, null); return; } @@ -327,7 +320,30 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { this.redisClient.setex(`reversi:game:turnTimer:${game.id}:1`, updatedGame.timeLimitForEachTurn, ''); this.globalEventService.publishReversiGameStream(game.id, 'started', { - game: await this.reversiGameEntityService.packDetail(game.id), + game: await this.reversiGameEntityService.packDetail(updatedGame), + }); + } + + @bindThis + private async endGame(game: MiReversiGame, winnerId: MiUser['id'] | null, reason: 'surrender' | 'timeout' | null) { + const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() + .set({ + ...this.getBakeProps(game), + isEnded: true, + endedAt: new Date(), + winnerId: winnerId, + surrenderedUserId: reason === 'surrender' ? (winnerId === game.user1Id ? game.user2Id : game.user1Id) : null, + timeoutUserId: reason === 'timeout' ? (winnerId === game.user1Id ? game.user2Id : game.user1Id) : null, + }) + .where('id = :id', { id: game.id }) + .returning('*') + .execute() + .then((response) => response.raw[0]); + this.cacheGame(updatedGame); + + this.globalEventService.publishReversiGameStream(game.id, 'ended', { + winnerId: winnerId, + game: await this.reversiGameEntityService.packDetail(updatedGame), }); } @@ -354,14 +370,10 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { // TODO: より厳格なバリデーション - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - [key]: value, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); + const updatedGame = { + ...game, + [key]: value, + }; this.cacheGame(updatedGame); this.globalEventService.publishReversiGameStream(game.id, 'updateSettings', { @@ -397,17 +409,6 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { engine.putStone(pos); - let winner; - if (engine.isEnded) { - if (engine.winner === true) { - winner = game.black === 1 ? game.user1Id : game.user2Id; - } else if (engine.winner === false) { - winner = game.black === 1 ? game.user2Id : game.user1Id; - } else { - winner = null; - } - } - const logs = Reversi.Serializer.deserializeLogs(game.logs); const log = { @@ -423,17 +424,11 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { const crc32 = CRC32.str(JSON.stringify(serializeLogs)).toString(); - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - crc32, - isEnded: engine.isEnded, - winnerId: winner, - logs: serializeLogs, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); + const updatedGame = { + ...game, + crc32, + logs: serializeLogs, + }; this.cacheGame(updatedGame); this.globalEventService.publishReversiGameStream(game.id, 'log', { @@ -442,10 +437,16 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { }); if (engine.isEnded) { - this.globalEventService.publishReversiGameStream(game.id, 'ended', { - winnerId: winner ?? null, - game: await this.reversiGameEntityService.packDetail(game.id), - }); + let winnerId; + if (engine.winner === true) { + winnerId = game.black === 1 ? game.user1Id : game.user2Id; + } else if (engine.winner === false) { + winnerId = game.black === 1 ? game.user2Id : game.user1Id; + } else { + winnerId = null; + } + + await this.endGame(updatedGame, winnerId, null); } else { this.redisClient.setex(`reversi:game:turnTimer:${game.id}:${engine.turn ? '1' : '0'}`, updatedGame.timeLimitForEachTurn, ''); } @@ -460,23 +461,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { const winnerId = game.user1Id === user.id ? game.user2Id : game.user1Id; - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - isEnded: true, - endedAt: new Date(), - winnerId: winnerId, - surrenderedUserId: user.id, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'ended', { - winnerId: winnerId, - game: await this.reversiGameEntityService.packDetail(game.id), - }); + await this.endGame(game, winnerId, 'surrender'); } @bindThis @@ -500,23 +485,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { if (timer === 0) { const winnerId = engine.turn ? (game.black === 1 ? game.user2Id : game.user1Id) : (game.black === 1 ? game.user1Id : game.user2Id); - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - isEnded: true, - endedAt: new Date(), - winnerId: winnerId, - timeoutUserId: engine.turn ? (game.black === 1 ? game.user1Id : game.user2Id) : (game.black === 1 ? game.user2Id : game.user1Id), - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'ended', { - winnerId: winnerId, - game: await this.reversiGameEntityService.packDetail(game.id), - }); + await this.endGame(game, winnerId, 'timeout'); } } -- cgit v1.2.3-freya From 9eb0468cd289bae09dc59a20b298e052d63350ac Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 09:14:45 +0900 Subject: 2024.2.0-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13d1cc8e22..b4aafbf94e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2023.12.2", + "version": "2024.2.0-beta.1", "codename": "nasubi", "repository": { "type": "git", -- cgit v1.2.3-freya From 4f95b8d9d2dec6dd1e9069372abd7cf605e63d9a Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:20:56 +0900 Subject: fix(frontend/pizzax): デフォルト値が適用できないことがあるのを修正 (#13057) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend/pizzax): デフォルト値が適用できないことがあるのを修正 * fix * いらんプロパティをけす --- packages/frontend/package.json | 3 +- packages/frontend/src/pages/timeline.vue | 20 ++-- packages/frontend/src/pizzax.ts | 19 +++- pnpm-lock.yaml | 167 +++++++++---------------------- 4 files changed, 75 insertions(+), 134 deletions(-) diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 6dffc2a3f4..fb819b2420 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -44,6 +44,7 @@ "crc-32": "^1.2.2", "cropperjs": "2.0.0-beta.4", "date-fns": "2.30.0", + "defu": "^6.1.4", "escape-regexp": "0.0.1", "estree-walker": "3.0.3", "eventemitter3": "5.0.1", @@ -53,9 +54,9 @@ "json5": "2.2.3", "matter-js": "0.19.0", "mfm-js": "0.24.0", + "misskey-bubble-game": "workspace:*", "misskey-js": "workspace:*", "misskey-reversi": "workspace:*", - "misskey-bubble-game": "workspace:*", "photoswipe": "5.4.3", "punycode": "2.3.1", "rollup": "4.9.6", diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 3481113f87..5a71b18afe 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -71,9 +71,8 @@ const src = computed({ set: (x) => saveSrc(x), }); const withRenotes = computed({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - get: () => (defaultStore.reactiveState.tl.value.filter?.withRenotes ?? saveTlFilter('withRenotes', true)), - set: (x) => saveTlFilter('withRenotes', x), + get: () => defaultStore.reactiveState.tl.value.filter.withRenotes, + set: (x: boolean) => saveTlFilter('withRenotes', x), }); const withReplies = computed({ get: () => { @@ -81,27 +80,24 @@ const withReplies = computed({ if (['local', 'social'].includes(src.value) && onlyFiles.value) { return false; } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return defaultStore.reactiveState.tl.value.filter?.withReplies ?? saveTlFilter('withReplies', true); + return defaultStore.reactiveState.tl.value.filter.withReplies; } }, - set: (x) => saveTlFilter('withReplies', x), + set: (x: boolean) => saveTlFilter('withReplies', x), }); const onlyFiles = computed({ get: () => { if (['local', 'social'].includes(src.value) && withReplies.value) { return false; } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return defaultStore.reactiveState.tl.value.filter?.onlyFiles ?? saveTlFilter('onlyFiles', false); + return defaultStore.reactiveState.tl.value.filter.onlyFiles; } }, - set: (x) => saveTlFilter('onlyFiles', x), + set: (x: boolean) => saveTlFilter('onlyFiles', x), }); const withSensitive = computed({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - get: () => (defaultStore.reactiveState.tl.value.filter?.withSensitive ?? saveTlFilter('withSensitive', true)), - set: (x) => { + get: () => defaultStore.reactiveState.tl.value.filter.withSensitive, + set: (x: boolean) => { saveTlFilter('withSensitive', x); // これだけはクライアント側で完結する処理なので手動でリロード diff --git a/packages/frontend/src/pizzax.ts b/packages/frontend/src/pizzax.ts index 8723110b08..b3d2374899 100644 --- a/packages/frontend/src/pizzax.ts +++ b/packages/frontend/src/pizzax.ts @@ -7,6 +7,7 @@ import { onUnmounted, Ref, ref, watch } from 'vue'; import { BroadcastChannel } from 'broadcast-channel'; +import { defu } from 'defu'; import { $i } from '@/account.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { get, set } from '@/scripts/idb-proxy.js'; @@ -80,6 +81,18 @@ export class Storage { this.loaded = this.ready.then(() => this.load()); } + private isPureObject(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); + } + + private mergeState(value: T, def: T): T { + if (this.isPureObject(value) && this.isPureObject(def)) { + if (_DEV_) console.log('Merging state. Incoming: ', value, ' Default: ', def); + return defu(value, def) as T; + } + return value; + } + private async init(): Promise { await this.migrate(); @@ -89,11 +102,11 @@ export class Storage { for (const [k, v] of Object.entries(this.def) as [keyof T, T[keyof T]['default']][]) { if (v.where === 'device' && Object.prototype.hasOwnProperty.call(deviceState, k)) { - this.reactiveState[k].value = this.state[k] = deviceState[k]; + this.reactiveState[k].value = this.state[k] = this.mergeState(deviceState[k], v.default); } else if (v.where === 'account' && $i && Object.prototype.hasOwnProperty.call(registryCache, k)) { - this.reactiveState[k].value = this.state[k] = registryCache[k]; + this.reactiveState[k].value = this.state[k] = this.mergeState(registryCache[k], v.default); } else if (v.where === 'deviceAccount' && Object.prototype.hasOwnProperty.call(deviceAccountState, k)) { - this.reactiveState[k].value = this.state[k] = deviceAccountState[k]; + this.reactiveState[k].value = this.state[k] = this.mergeState(deviceAccountState[k], v.default); } else { this.reactiveState[k].value = this.state[k] = v.default; if (_DEV_) console.log('Use default value', k, v.default); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b752b8ae40..83c51bd2db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -751,6 +751,9 @@ importers: date-fns: specifier: 2.30.0 version: 2.30.0 + defu: + specifier: ^6.1.4 + version: 6.1.4 escape-regexp: specifier: 0.0.1 version: 0.0.1 @@ -1009,7 +1012,7 @@ importers: version: 7.6.10 storybook-addon-misskey-theme: specifier: github:misskey-dev/storybook-addon-misskey-theme - version: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.10)(@storybook/components@7.6.5)(@storybook/core-events@7.6.10)(@storybook/manager-api@7.6.10)(@storybook/preview-api@7.6.10)(@storybook/theming@7.6.10)(@storybook/types@7.6.10)(react-dom@18.2.0)(react@18.2.0) + version: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.10)(@storybook/components@7.6.10)(@storybook/core-events@7.6.10)(@storybook/manager-api@7.6.10)(@storybook/preview-api@7.6.10)(@storybook/theming@7.6.10)(@storybook/types@7.6.10)(react-dom@18.2.0)(react@18.2.0) vite-plugin-turbosnap: specifier: 1.0.3 version: 1.0.3 @@ -1896,7 +1899,7 @@ packages: '@babel/traverse': 7.22.11 '@babel/types': 7.22.17 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -1919,7 +1922,7 @@ packages: '@babel/traverse': 7.23.5 '@babel/types': 7.23.5 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -2021,7 +2024,7 @@ packages: '@babel/core': 7.23.5 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -3420,7 +3423,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.5 '@babel/types': 7.22.17 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3438,7 +3441,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.6 '@babel/types': 7.23.5 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -4154,7 +4157,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) espree: 9.6.1 globals: 13.19.0 ignore: 5.2.4 @@ -4171,7 +4174,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) espree: 9.6.1 globals: 13.19.0 ignore: 5.2.4 @@ -4406,7 +4409,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -6787,17 +6790,6 @@ packages: tiny-invariant: 1.3.1 dev: true - /@storybook/channels@7.6.5: - resolution: {integrity: sha512-FIlNkyfQy9uHoJfAFL2/wO3ASGJELFvBzURBE2rcEF/TS7GcUiqWnBfiDxAbwSEjSOm2F0eEq3UXhaZEjpJHDw==} - dependencies: - '@storybook/client-logger': 7.6.5 - '@storybook/core-events': 7.6.5 - '@storybook/global': 5.0.0 - qs: 6.11.1 - telejson: 7.2.0 - tiny-invariant: 1.3.1 - dev: true - /@storybook/cli@7.6.10: resolution: {integrity: sha512-pK1MEseMm73OMO2OVoSz79QWX8ymxgIGM8IeZTCo9gImiVRChMNDFYcv8yPWkjuyesY8c15CoO48aR7pdA1OjQ==} hasBin: true @@ -6855,12 +6847,6 @@ packages: '@storybook/global': 5.0.0 dev: true - /@storybook/client-logger@7.6.5: - resolution: {integrity: sha512-S5aROWgssqg7tcs9lgW5wmCAz4SxMAtioiyVj5oFecmPCbQtFVIAREYzeoxE4GfJL+plrfRkum4BzziANn8EhQ==} - dependencies: - '@storybook/global': 5.0.0 - dev: true - /@storybook/codemod@7.6.10: resolution: {integrity: sha512-pzFR0nocBb94vN9QCJLC3C3dP734ZigqyPmd0ZCDj9Xce2ytfHK3v1lKB6TZWzKAZT8zztauECYxrbo4LVuagw==} dependencies: @@ -6905,29 +6891,6 @@ packages: - '@types/react-dom' dev: true - /@storybook/components@7.6.5(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-w4ZucbBBZ+NKMWlJKVj2I/bMBBq7gzDp9lzc4+8QaQ3vUPXKqc1ilIPYo/7UR5oxwDVMZocmMSgl9L8lvf7+Mw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - '@radix-ui/react-select': 1.2.2(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-toolbar': 1.0.4(react-dom@18.2.0)(react@18.2.0) - '@storybook/client-logger': 7.6.5 - '@storybook/csf': 0.1.2 - '@storybook/global': 5.0.0 - '@storybook/theming': 7.6.5(react-dom@18.2.0)(react@18.2.0) - '@storybook/types': 7.6.5 - memoizerific: 1.11.3 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - use-resize-observer: 9.1.0(react-dom@18.2.0)(react@18.2.0) - util-deprecate: 1.0.2 - transitivePeerDependencies: - - '@types/react' - - '@types/react-dom' - dev: true - /@storybook/core-client@7.6.10: resolution: {integrity: sha512-DjnzSzSNDmZyxyg6TxugzWQwOsW+n/iWVv6sHNEvEd5STr0mjuJjIEELmv58LIr5Lsre5+LEddqHsyuLyt8ubg==} dependencies: @@ -6972,12 +6935,6 @@ packages: ts-dedent: 2.2.0 dev: true - /@storybook/core-events@7.6.5: - resolution: {integrity: sha512-zk2q/qicYXAzHA4oV3GDbIql+Kd4TOHUgDE8e4jPCOPp856z2ScqEKUAbiJizs6eEJOH4nW9Db1kuzgrBVEykQ==} - dependencies: - ts-dedent: 2.2.0 - dev: true - /@storybook/core-server@7.6.10: resolution: {integrity: sha512-2icnqJkn3vwq0eJPP0rNaHd7IOvxYf5q4lSVl2AWTxo/Ae19KhokI6j/2vvS2XQJMGQszwshlIwrZUNsj5p0yw==} dependencies: @@ -7296,20 +7253,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@storybook/theming@7.6.5(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-RpcWT0YEgiobO41McVPDfQQHHFnjyr1sJnNTPJIvOUgSfURdgSj17mQVxtD5xcXcPWUdle5UhIOrCixHbL/NNw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - '@emotion/use-insertion-effect-with-fallbacks': 1.0.0(react@18.2.0) - '@storybook/client-logger': 7.6.5 - '@storybook/global': 5.0.0 - memoizerific: 1.11.3 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /@storybook/types@7.6.10: resolution: {integrity: sha512-hcS2HloJblaMpCAj2axgGV+53kgSRYPT0a1PG1IHsZaYQILfHSMmBqM8XzXXYTsgf9250kz3dqFX1l0n3EqMlQ==} dependencies: @@ -7319,15 +7262,6 @@ packages: file-system-cache: 2.3.0 dev: true - /@storybook/types@7.6.5: - resolution: {integrity: sha512-Q757v+fYZZSaEpks/zDL5YgXRozxkgKakXFc+BoQHK5q5sVhJ+0jvpLJiAQAniIIaMIkqY/G24Kd6Uo6UdKBCg==} - dependencies: - '@storybook/channels': 7.6.5 - '@types/babel__core': 7.20.0 - '@types/express': 4.17.17 - file-system-cache: 2.3.0 - dev: true - /@storybook/vue3-vite@7.6.10(typescript@5.3.3)(vite@5.0.12)(vue@3.4.15): resolution: {integrity: sha512-5f0Rh4PTVEeAI86ybihfN+rHGXXLNiRsoGKinpJSb7hkfsq/L7u3sVCXJwH/qsG+rUJlZyHs3kfa4/Kgyyi3Mg==} engines: {node: ^14.18 || >=16} @@ -8503,7 +8437,7 @@ packages: '@typescript-eslint/type-utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -8532,7 +8466,7 @@ packages: '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -8558,7 +8492,7 @@ packages: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.53.0 typescript: 5.3.3 transitivePeerDependencies: @@ -8579,7 +8513,7 @@ packages: '@typescript-eslint/types': 6.19.0 '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: @@ -8614,7 +8548,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.3.3) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.53.0 ts-api-utils: 1.0.1(typescript@5.3.3) typescript: 5.3.3 @@ -8634,7 +8568,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.56.0 ts-api-utils: 1.0.1(typescript@5.3.3) typescript: 5.3.3 @@ -8663,7 +8597,7 @@ packages: dependencies: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -8684,7 +8618,7 @@ packages: dependencies: '@typescript-eslint/types': 6.19.0 '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -8798,7 +8732,7 @@ packages: dependencies: '@ampproject/remapping': 2.2.1 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 @@ -9151,7 +9085,7 @@ packages: engines: {node: '>= 6.0.0'} requiresBuild: true dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -9159,7 +9093,7 @@ packages: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: false @@ -9545,7 +9479,7 @@ packages: resolution: {integrity: sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw==} dependencies: archy: 1.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) fastq: 1.15.0 transitivePeerDependencies: - supports-color @@ -10994,7 +10928,6 @@ packages: dependencies: ms: 2.1.2 supports-color: 5.5.0 - dev: true /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -11007,6 +10940,7 @@ packages: dependencies: ms: 2.1.2 supports-color: 8.1.1 + dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -11147,9 +11081,8 @@ packages: object-keys: 1.1.1 dev: true - /defu@6.1.2: - resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} - dev: true + /defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} /del@6.1.1: resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==} @@ -11223,7 +11156,7 @@ packages: hasBin: true dependencies: address: 1.2.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: true @@ -11547,7 +11480,7 @@ packages: peerDependencies: esbuild: '>=0.12 <1' dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) esbuild: 0.18.20 transitivePeerDependencies: - supports-color @@ -11856,7 +11789,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -11903,7 +11836,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -12533,7 +12466,7 @@ packages: debug: optional: true dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -12834,7 +12767,7 @@ packages: hasBin: true dependencies: colorette: 2.0.19 - defu: 6.1.2 + defu: 6.1.4 https-proxy-agent: 5.0.1 mri: 1.2.0 node-fetch-native: 1.0.2 @@ -13089,7 +13022,6 @@ packages: /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} - dev: true /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} @@ -13227,7 +13159,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: false @@ -13287,7 +13219,7 @@ packages: engines: {node: '>= 6.0.0'} dependencies: agent-base: 5.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: true @@ -13297,7 +13229,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -13306,7 +13238,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color dev: false @@ -13466,7 +13398,7 @@ packages: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -13912,7 +13844,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -17245,7 +17177,7 @@ packages: engines: {node: '>=8.16.0'} dependencies: '@types/mime-types': 2.1.4 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) extract-zip: 1.7.0 https-proxy-agent: 4.0.0 mime: 2.6.0 @@ -18245,7 +18177,7 @@ packages: dependencies: '@hapi/hoek': 10.0.1 '@hapi/wreck': 18.0.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) joi: 17.7.0 transitivePeerDependencies: - supports-color @@ -18445,7 +18377,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -18598,7 +18530,7 @@ packages: arg: 5.0.2 bluebird: 3.7.2 check-more-types: 2.24.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) execa: 5.1.1 lazy-ass: 1.6.0 ps-tree: 1.2.0 @@ -18856,7 +18788,6 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 - dev: true /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} @@ -19477,7 +19408,7 @@ packages: chalk: 4.1.2 cli-highlight: 2.1.11 dayjs: 1.11.10 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) dotenv: 16.0.3 glob: 10.3.10 ioredis: 5.3.2 @@ -19837,7 +19768,7 @@ packages: hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) pathe: 1.1.1 picocolors: 1.0.0 vite: 5.0.12(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0) @@ -19939,7 +19870,7 @@ packages: acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.3.10 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) execa: 8.0.1 happy-dom: 10.0.3 local-pkg: 0.5.0 @@ -20022,7 +19953,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.56.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -20541,7 +20472,7 @@ packages: engines: {vscode: ^1.83.0} dev: false - github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.10)(@storybook/components@7.6.5)(@storybook/core-events@7.6.10)(@storybook/manager-api@7.6.10)(@storybook/preview-api@7.6.10)(@storybook/theming@7.6.10)(@storybook/types@7.6.10)(react-dom@18.2.0)(react@18.2.0): + github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.10)(@storybook/components@7.6.10)(@storybook/core-events@7.6.10)(@storybook/manager-api@7.6.10)(@storybook/preview-api@7.6.10)(@storybook/theming@7.6.10)(@storybook/types@7.6.10)(react-dom@18.2.0)(react@18.2.0): resolution: {tarball: https://codeload.github.com/misskey-dev/storybook-addon-misskey-theme/tar.gz/cf583db098365b2ccc81a82f63ca9c93bc32b640} id: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640 name: storybook-addon-misskey-theme @@ -20563,7 +20494,7 @@ packages: optional: true dependencies: '@storybook/blocks': 7.6.10(react-dom@18.2.0)(react@18.2.0) - '@storybook/components': 7.6.5(react-dom@18.2.0)(react@18.2.0) + '@storybook/components': 7.6.10(react-dom@18.2.0)(react@18.2.0) '@storybook/core-events': 7.6.10 '@storybook/manager-api': 7.6.10(react-dom@18.2.0)(react@18.2.0) '@storybook/preview-api': 7.6.10 -- cgit v1.2.3-freya From a431dde53765fd362874dbf51810296e0952cb63 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 09:29:06 +0900 Subject: refactor(reversi): refactoring of reversi backend --- packages/backend/src/core/ReversiService.ts | 77 ++++++++++------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts index 39177322f3..0e59d0308d 100644 --- a/packages/backend/src/core/ReversiService.ts +++ b/packages/backend/src/core/ReversiService.ts @@ -104,23 +104,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { if (invitations.includes(targetUser.id)) { await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, targetUser.id); - const game = await this.reversiGamesRepository.insert({ - id: this.idService.gen(), - user1Id: targetUser.id, - user2Id: me.id, - user1Ready: false, - user2Ready: false, - isStarted: false, - isEnded: false, - logs: [], - map: Reversi.maps.eighteight.data, - bw: 'random', - isLlotheo: false, - }).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0])); - this.cacheGame(game); - - const packed = await this.reversiGameEntityService.packDetail(game, { id: targetUser.id }); - this.globalEventService.publishReversiStream(targetUser.id, 'matched', { game: packed }); + const game = await this.matched(targetUser.id, me.id); return game; } else { @@ -147,23 +131,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { const invitorId = invitations[Math.floor(Math.random() * invitations.length)]; await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, invitorId); - const game = await this.reversiGamesRepository.insert({ - id: this.idService.gen(), - user1Id: invitorId, - user2Id: me.id, - user1Ready: false, - user2Ready: false, - isStarted: false, - isEnded: false, - logs: [], - map: Reversi.maps.eighteight.data, - bw: 'random', - isLlotheo: false, - }).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0])); - this.cacheGame(game); - - const packed = await this.reversiGameEntityService.packDetail(game, { id: invitorId }); - this.globalEventService.publishReversiStream(invitorId, 'matched', { game: packed }); + const game = await this.matched(invitorId, me.id); return game; } @@ -183,23 +151,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { await this.redisClient.zrem('reversi:matchAny', me.id, matchedUserId); - const game = await this.reversiGamesRepository.insert({ - id: this.idService.gen(), - user1Id: matchedUserId, - user2Id: me.id, - user1Ready: false, - user2Ready: false, - isStarted: false, - isEnded: false, - logs: [], - map: Reversi.maps.eighteight.data, - bw: 'random', - isLlotheo: false, - }).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0])); - this.cacheGame(game); - - const packed = await this.reversiGameEntityService.packDetail(game, { id: matchedUserId }); - this.globalEventService.publishReversiStream(matchedUserId, 'matched', { game: packed }); + const game = await this.matched(matchedUserId, me.id); return game; } else { @@ -268,6 +220,29 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { } } + @bindThis + private async matched(parentId: MiUser['id'], childId: MiUser['id']): Promise { + const game = await this.reversiGamesRepository.insert({ + id: this.idService.gen(), + user1Id: parentId, + user2Id: childId, + user1Ready: false, + user2Ready: false, + isStarted: false, + isEnded: false, + logs: [], + map: Reversi.maps.eighteight.data, + bw: 'random', + isLlotheo: false, + }).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0])); + this.cacheGame(game); + + const packed = await this.reversiGameEntityService.packDetail(game, { id: parentId }); + this.globalEventService.publishReversiStream(parentId, 'matched', { game: packed }); + + return game; + } + @bindThis private async startGame(game: MiReversiGame) { let bw: number; -- cgit v1.2.3-freya From 0cfeb427864cdc394db11ed8f65e5324f6db0c67 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 09:29:26 +0900 Subject: New Crowdin updates (#13056) * New translations ja-jp.yml (French) * New translations ja-jp.yml (Thai) * New translations ja-jp.yml (Lao) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Romanian) * New translations ja-jp.yml (Spanish) * New translations ja-jp.yml (Arabic) * New translations ja-jp.yml (Catalan) * New translations ja-jp.yml (Czech) * New translations ja-jp.yml (Danish) * New translations ja-jp.yml (German) * New translations ja-jp.yml (Greek) * New translations ja-jp.yml (Hungarian) * New translations ja-jp.yml (Italian) * New translations ja-jp.yml (Korean) * New translations ja-jp.yml (Dutch) * New translations ja-jp.yml (Norwegian) * New translations ja-jp.yml (Polish) * New translations ja-jp.yml (Portuguese) * New translations ja-jp.yml (Russian) * New translations ja-jp.yml (Slovak) * New translations ja-jp.yml (Swedish) * New translations ja-jp.yml (Turkish) * New translations ja-jp.yml (Ukrainian) * New translations ja-jp.yml (Chinese Simplified) * New translations ja-jp.yml (English) * New translations ja-jp.yml (Vietnamese) * New translations ja-jp.yml (Indonesian) * New translations ja-jp.yml (Bengali) * New translations ja-jp.yml (Croatian) * New translations ja-jp.yml (Uyghur) * New translations ja-jp.yml (Lojban) * New translations ja-jp.yml (Sinhala) * New translations ja-jp.yml (Uzbek) * New translations ja-jp.yml (Kannada) * New translations ja-jp.yml (Haitian Creole) * New translations ja-jp.yml (Kabyle) * New translations ja-jp.yml (Japanese, Kansai) * New translations ja-jp.yml (Korean (Gyeongsang)) * New translations ja-jp.yml (Chinese Simplified) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) --- locales/ar-SA.yml | 1 + locales/bn-BD.yml | 1 + locales/ca-ES.yml | 1 + locales/cs-CZ.yml | 1 + locales/da-DK.yml | 1 + locales/de-DE.yml | 1 + locales/el-GR.yml | 1 + locales/en-US.yml | 1 + locales/es-ES.yml | 1 + locales/fr-FR.yml | 1 + locales/hr-HR.yml | 1 + locales/ht-HT.yml | 1 + locales/hu-HU.yml | 1 + locales/id-ID.yml | 1 + locales/it-IT.yml | 1 + locales/ja-KS.yml | 1 + locales/jbo-EN.yml | 1 + locales/kab-KAB.yml | 1 + locales/kn-IN.yml | 1 + locales/ko-GS.yml | 1 + locales/ko-KR.yml | 1 + locales/lo-LA.yml | 1 + locales/nl-NL.yml | 1 + locales/no-NO.yml | 1 + locales/pl-PL.yml | 1 + locales/pt-PT.yml | 1 + locales/ro-RO.yml | 1 + locales/ru-RU.yml | 1 + locales/si-LK.yml | 1 + locales/sk-SK.yml | 1 + locales/sv-SE.yml | 1 + locales/th-TH.yml | 1 + locales/tr-TR.yml | 1 + locales/ug-CN.yml | 1 + locales/uk-UA.yml | 1 + locales/uz-UZ.yml | 1 + locales/vi-VN.yml | 1 + locales/zh-CN.yml | 7 +++++++ locales/zh-TW.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 39 files changed, 90 insertions(+) diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml index a1e68691f9..47f131032a 100644 --- a/locales/ar-SA.yml +++ b/locales/ar-SA.yml @@ -1567,3 +1567,4 @@ _moderationLogTypes: createInvitation: "ولِّد دعوة" _reversi: total: "المجموع" + diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml index 427c2d90cc..42edad1fd0 100644 --- a/locales/bn-BD.yml +++ b/locales/bn-BD.yml @@ -1346,3 +1346,4 @@ _moderationLogTypes: resetPassword: "পাসওয়ার্ড রিসেট করুন" _reversi: total: "মোট" + diff --git a/locales/ca-ES.yml b/locales/ca-ES.yml index 7a4944cd1f..b2b0ee0d5a 100644 --- a/locales/ca-ES.yml +++ b/locales/ca-ES.yml @@ -1276,3 +1276,4 @@ _moderationLogTypes: resetPassword: "Restableix la contrasenya" _reversi: total: "Total" + diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index 025497a442..8620a1207c 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -2022,3 +2022,4 @@ _moderationLogTypes: createInvitation: "Vygenerovat pozvánku" _reversi: total: "Celkem" + diff --git a/locales/da-DK.yml b/locales/da-DK.yml index 08c15ed092..d1fbec9f67 100644 --- a/locales/da-DK.yml +++ b/locales/da-DK.yml @@ -1,2 +1,3 @@ --- _lang_: "Dansk" + diff --git a/locales/de-DE.yml b/locales/de-DE.yml index a4bf41d917..45e20d8541 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -2244,3 +2244,4 @@ _externalResourceInstaller: description: "Während der Installation des Farbschemas ist ein Problem aufgetreten. Bitte versuche es erneut. Detaillierte Fehlerinformationen können über die Javascript-Konsole abgerufen werden." _reversi: total: "Gesamt" + diff --git a/locales/el-GR.yml b/locales/el-GR.yml index 2098c7ef50..bb5639a741 100644 --- a/locales/el-GR.yml +++ b/locales/el-GR.yml @@ -398,3 +398,4 @@ _moderationLogTypes: suspend: "Αποβολή" _reversi: total: "Σύνολο" + diff --git a/locales/en-US.yml b/locales/en-US.yml index c5a8976d5d..fb4cb0a346 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2354,3 +2354,4 @@ _dataSaver: description: "If code highlighting notations are used in MFM, etc., they will not load until tapped. Syntax highlighting requires downloading the highlight definition files for each programming language. Therefore, disabling the automatic loading of these files is expected to reduce the amount of communication data." _reversi: total: "Total" + diff --git a/locales/es-ES.yml b/locales/es-ES.yml index ab29462804..d4c0d6c4ad 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -2428,3 +2428,4 @@ _dataSaver: description: "Si se usa resaltado de código en MFM, etc., no se cargará hasta pulsar en ello. El resaltado de sintaxis requiere la descarga de archivos de definición para cada lenguaje de programación. Debido a esto, al deshabilitar la carga automática de estos archivos reducirás el consumo de datos." _reversi: total: "Total" + diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index 50de0cd5a1..a10580bcf3 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -2085,3 +2085,4 @@ _dataSaver: description: "Si la notation de mise en évidence du code est utilisée, par exemple dans la MFM, elle ne sera pas chargée tant qu'elle n'aura pas été tapée. La mise en évidence du code nécessite le chargement du fichier de définition de chaque langue à mettre en évidence, mais comme ces fichiers ne sont plus chargés automatiquement, on peut s'attendre à une réduction du trafic de données." _reversi: total: "Total" + diff --git a/locales/hr-HR.yml b/locales/hr-HR.yml index 9cfebdd01a..881aa8464e 100644 --- a/locales/hr-HR.yml +++ b/locales/hr-HR.yml @@ -3,3 +3,4 @@ _lang_: "japanski" ok: "OK" gotIt: "Razumijem" cancel: "otkazati" + diff --git a/locales/ht-HT.yml b/locales/ht-HT.yml index e3595c79b6..1698c9f280 100644 --- a/locales/ht-HT.yml +++ b/locales/ht-HT.yml @@ -16,3 +16,4 @@ _2fa: renewTOTPCancel: "Sispann" _widgets: profile: "pwofil" + diff --git a/locales/hu-HU.yml b/locales/hu-HU.yml index 023a91494d..2f7006484a 100644 --- a/locales/hu-HU.yml +++ b/locales/hu-HU.yml @@ -102,3 +102,4 @@ _deck: _columns: notifications: "Értesítések" tl: "Idővonal" + diff --git a/locales/id-ID.yml b/locales/id-ID.yml index e6c92b423c..44a0503883 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -2321,3 +2321,4 @@ _dataSaver: description: "Jika notasi penyorotan kode digunakan di MFM, dll. Fungsi tersebut tidak akan dimuat apabila tidak diketuk. Penyorotan sintaks membutuhkan pengunduhan berkas definisi penyorotan untuk setiap bahasa pemrograman. Oleh sebab itu, menonaktifkan pemuatan otomatis dari berkas ini dilakukan untuk mengurangi jumlah komunikasi data." _reversi: total: "Jumlah" + diff --git a/locales/it-IT.yml b/locales/it-IT.yml index b7b3fb1833..5678ab7e34 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -2356,3 +2356,4 @@ _dataSaver: description: "Impedire che il codice sorgente sia automaticamente evidenziato. Evidenziare il codice richiede il caricamento di un file per ogni linguaggio. Puoi evidenziare soltanto il codice che intendi leggere e ridurre il traffico inutilizzato." _reversi: total: "Totale" + diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 79219a8b9f..74dcf5f815 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -2412,3 +2412,4 @@ _dataSaver: description: "MFMとかでコードハイライト記法が使われてるとき、タップするまで読み込まれへんくなるで。コードハイライトではハイライトする言語ごとにその決めてるファイルを読む必要はあんねんな。けどな、それは自動で読み込まれなくなるから、通信量を少なくできることができるねん。" _reversi: total: "合計" + diff --git a/locales/jbo-EN.yml b/locales/jbo-EN.yml index d4fea291d7..297ca53dd7 100644 --- a/locales/jbo-EN.yml +++ b/locales/jbo-EN.yml @@ -1,3 +1,4 @@ --- _lang_: "la .lojban." headlineMisskey: "lo se tcana noi jorne fi loi notci" + diff --git a/locales/kab-KAB.yml b/locales/kab-KAB.yml index 22e24d3baa..b976f028f0 100644 --- a/locales/kab-KAB.yml +++ b/locales/kab-KAB.yml @@ -104,3 +104,4 @@ _deck: _columns: notifications: "Ilɣuyen" list: "Tibdarin" + diff --git a/locales/kn-IN.yml b/locales/kn-IN.yml index b3ad46f2b1..bb6d1ee242 100644 --- a/locales/kn-IN.yml +++ b/locales/kn-IN.yml @@ -84,3 +84,4 @@ _deck: notifications: "ಅಧಿಸೂಚನೆಗಳು" tl: "ಸಮಯಸಾಲು" mentions: "ಹೆಸರಿಸಿದ" + diff --git a/locales/ko-GS.yml b/locales/ko-GS.yml index 9187c25827..1d6c6f7bbc 100644 --- a/locales/ko-GS.yml +++ b/locales/ko-GS.yml @@ -726,3 +726,4 @@ _moderationLogTypes: resolveAbuseReport: "신고 해겔하기" _reversi: total: "합계" + diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 673c7757df..5ac398475b 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -2415,3 +2415,4 @@ _dataSaver: description: "MFM 등으로 문자열 강조 기법을 사용할 때 누르기 전에는 불러오지 않습니다. 문자열 강조에서는 강조할 언어마다 그 정의 파일을 불러와야 하지만 이를 자동으로 불러오지 않으므로 데이터 사용량을 줄일 수 있습니다." _reversi: total: "합계" + diff --git a/locales/lo-LA.yml b/locales/lo-LA.yml index fa4b3b6f9a..6f03c914fd 100644 --- a/locales/lo-LA.yml +++ b/locales/lo-LA.yml @@ -466,3 +466,4 @@ _webhookSettings: name: "ຊື່" _moderationLogTypes: suspend: "ລະງັບ" + diff --git a/locales/nl-NL.yml b/locales/nl-NL.yml index e33b978bc8..e3ff426177 100644 --- a/locales/nl-NL.yml +++ b/locales/nl-NL.yml @@ -497,3 +497,4 @@ _webhookSettings: _moderationLogTypes: suspend: "Opschorten" resetPassword: "Wachtwoord terugzetten" + diff --git a/locales/no-NO.yml b/locales/no-NO.yml index 195b1d0717..85ccd62566 100644 --- a/locales/no-NO.yml +++ b/locales/no-NO.yml @@ -720,3 +720,4 @@ _webhookSettings: name: "Navn" _moderationLogTypes: suspend: "Suspender" + diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml index e075f40815..9de413eb3b 100644 --- a/locales/pl-PL.yml +++ b/locales/pl-PL.yml @@ -1399,3 +1399,4 @@ _moderationLogTypes: resetPassword: "Zresetuj hasło" _reversi: total: "Łącznie" + diff --git a/locales/pt-PT.yml b/locales/pt-PT.yml index 3d0dcfba8a..bf8a8ca38b 100644 --- a/locales/pt-PT.yml +++ b/locales/pt-PT.yml @@ -1500,3 +1500,4 @@ _moderationLogTypes: resetPassword: "Redefinir senha" _reversi: total: "Total" + diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml index 695eb2501f..c1158e47b7 100644 --- a/locales/ro-RO.yml +++ b/locales/ro-RO.yml @@ -729,3 +729,4 @@ _moderationLogTypes: resetPassword: "Resetează parola" _reversi: total: "Total" + diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index e5dc3a83cf..60682fe961 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -1972,3 +1972,4 @@ _moderationLogTypes: resetPassword: "Сброс пароля:" _reversi: total: "Всего" + diff --git a/locales/si-LK.yml b/locales/si-LK.yml index ed97d539c0..cd21505a47 100644 --- a/locales/si-LK.yml +++ b/locales/si-LK.yml @@ -1 +1,2 @@ --- + diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml index 00d5f5ff84..7856809bf8 100644 --- a/locales/sk-SK.yml +++ b/locales/sk-SK.yml @@ -1447,3 +1447,4 @@ _moderationLogTypes: resetPassword: "Resetovať heslo" _reversi: total: "Celkom" + diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml index 62bc71a13d..07d5509a6a 100644 --- a/locales/sv-SE.yml +++ b/locales/sv-SE.yml @@ -576,3 +576,4 @@ _webhookSettings: _moderationLogTypes: suspend: "Suspendera" resetPassword: "Återställ Lösenord" + diff --git a/locales/th-TH.yml b/locales/th-TH.yml index e17f06d0eb..ed776e5ec7 100644 --- a/locales/th-TH.yml +++ b/locales/th-TH.yml @@ -2440,3 +2440,4 @@ _dataSaver: description: "หากใช้สัญลักษณ์ไฮไลต์โค้ดใน MFM ฯลฯ สัญลักษณ์เหล่านั้นจะไม่โหลดจนกว่าจะแตะ การไฮไลต์ไวยากรณ์(syntax)จำเป็นต้องดาวน์โหลดไฟล์คำจำกัดความของไฮไลต์สำหรับแต่ละภาษา ดังนั้นการปิดใช้งานการโหลดไฟล์เหล่านี้โดยอัตโนมัติจึงคาดว่าจะช่วยลดปริมาณข้อมูลการสื่อสารได้" _reversi: total: "รวมทั้งหมด" + diff --git a/locales/tr-TR.yml b/locales/tr-TR.yml index 0793592d34..e93a6e43e1 100644 --- a/locales/tr-TR.yml +++ b/locales/tr-TR.yml @@ -455,3 +455,4 @@ _deck: _moderationLogTypes: suspend: "askıya al" resetPassword: "Şifre sıfırlama" + diff --git a/locales/ug-CN.yml b/locales/ug-CN.yml index e48f64511c..e06cee11a2 100644 --- a/locales/ug-CN.yml +++ b/locales/ug-CN.yml @@ -17,3 +17,4 @@ _2fa: renewTOTPCancel: "ئۇنى توختىتىڭ" _widgets: profile: "profile" + diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml index bc1dc419e9..7679ad56d7 100644 --- a/locales/uk-UA.yml +++ b/locales/uk-UA.yml @@ -1622,3 +1622,4 @@ _moderationLogTypes: resetPassword: "Скинути пароль" _reversi: total: "Всього" + diff --git a/locales/uz-UZ.yml b/locales/uz-UZ.yml index 809e785492..b87b596925 100644 --- a/locales/uz-UZ.yml +++ b/locales/uz-UZ.yml @@ -1090,3 +1090,4 @@ _moderationLogTypes: resetPassword: "Parolni tiklash" _reversi: total: "Jami" + diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index 43db0d246c..6de15fc11f 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -1852,3 +1852,4 @@ _moderationLogTypes: resetPassword: "Đặt lại mật khẩu" _reversi: total: "Tổng cộng" + diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 2f04920556..d14a77f5aa 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1200,6 +1200,8 @@ replaying: "重播中" ranking: "排行榜" lastNDays: "最近 {n} 天" backToTitle: "返回标题" +hemisphere: "居住地区" +withSensitive: "显示包含敏感媒体的帖子" enableHorizontalSwipe: "滑动切换标签页" _bubbleGame: howToPlay: "游戏说明" @@ -2427,9 +2429,14 @@ _dataSaver: _code: title: "代码高亮" description: "如果使用了代码高亮标记,例如在 MFM 中,则在点击之前不会加载。 代码高亮要求加载每种高亮语言的定义文件,由于这些文件不再自动加载,因此有望减少数据传输量。" +_hemisphere: + N: "北半球" + S: "南半球" + caption: "在某些客户端设置中用来确定季节" _reversi: reversi: "黑白棋" total: "总计" _offlineScreen: title: "离线——无法连接到服务器" header: "无法连接到服务器" + diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index e4ac043eb5..5e730202c9 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1202,6 +1202,9 @@ replaying: "重播中" ranking: "排行榜" lastNDays: "過去 {n} 天" backToTitle: "回到遊戲標題頁" +hemisphere: "您居住的地區" +withSensitive: "顯示包含敏感檔案的貼文" +userSaysSomethingSensitive: "包含 {name} 敏感檔案的貼文" enableHorizontalSwipe: "滑動切換時間軸" _bubbleGame: howToPlay: "玩法說明" @@ -2438,5 +2441,48 @@ _dataSaver: _code: title: "程式碼突出顯示" description: "如果使用了 MFM 的程式碼突顯標記,則在點擊之前不會載入。程式碼突顯要求加載每種程式語言的突顯定義檔案,但由於這些檔案不再自動載入,因此有望減少資料流量。" +_hemisphere: + N: "北半球" + S: "南半球" + caption: "在某些客戶端的設定中,用於判斷季節。" _reversi: + reversi: "黑白棋" + gameSettings: "對弈設定" + chooseBoard: "選擇棋盤" + blackOrWhite: "先手/後手" + blackIs: "{name} 為黑棋(先攻)" + rules: "規則" + thisGameIsStartedSoon: "對弈即將開始" + waitingForOther: "等待對手準備就緒" + waitingForMe: "等待您準備就緒" + waitingBoth: "請準備" + ready: "準備就緒" + cancelReady: "重新準備" + opponentTurn: "對手的回合" + myTurn: "您的回合" + turnOf: "{name} 的回合" + pastTurnOf: "{name} 的回合" + surrender: "認輸" + surrendered: "對手認輸" + timeout: "時間到" + drawn: "平手" + won: "{name} 獲勝" + black: "黑" + white: "白" total: "合計" + turnCount: "{count} 回合" + myGames: "我的對弈" + allGames: "所有對弈" + ended: "" + playing: "正在對弈" + isLlotheo: "子較少的一方為勝(顛倒規則)" + loopedMap: "循環棋盤" + canPutEverywhere: "隨意置放模式" + timeLimitForEachTurn: "每回合的時間限制" + freeMatch: "自由對戰" + lookingForPlayer: "正在搜尋對手" + gameCanceled: "對弈已被取消" +_offlineScreen: + title: "離線-無法連接伺服器" + header: "無法連接伺服器" + -- cgit v1.2.3-freya From 67f6157d4252c733867bd264d39cd2a43a00c9ee Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 09:30:00 +0900 Subject: 2024.2.0-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4aafbf94e..330bd33371 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.2.0-beta.1", + "version": "2024.2.0-beta.2", "codename": "nasubi", "repository": { "type": "git", -- cgit v1.2.3-freya From 259992c65f008c3df474970f087aba9716d3465c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 12:03:32 +0900 Subject: enhance(reversi): some tweaks --- .../src/server/api/stream/channels/reversi-game.ts | 8 +- packages/frontend/src/pages/reversi/game.board.vue | 96 +++++++++++++--------- packages/frontend/src/pages/reversi/game.vue | 40 ++++----- 3 files changed, 83 insertions(+), 61 deletions(-) diff --git a/packages/backend/src/server/api/stream/channels/reversi-game.ts b/packages/backend/src/server/api/stream/channels/reversi-game.ts index df92137f51..820c80006b 100644 --- a/packages/backend/src/server/api/stream/channels/reversi-game.ts +++ b/packages/backend/src/server/api/stream/channels/reversi-game.ts @@ -42,7 +42,7 @@ class ReversiGameChannel extends Channel { case 'updateSettings': this.updateSettings(body.key, body.value); break; case 'cancel': this.cancelGame(); break; case 'putStone': this.putStone(body.pos, body.id); break; - case 'checkState': this.checkState(body.crc32); break; + case 'resync': this.resync(body.crc32); break; case 'claimTimeIsUp': this.claimTimeIsUp(); break; } } @@ -76,12 +76,10 @@ class ReversiGameChannel extends Channel { } @bindThis - private async checkState(crc32: string | number) { - if (crc32 != null) return; - + private async resync(crc32: string | number) { const game = await this.reversiService.checkCrc(this.gameId!, crc32); if (game) { - this.send('rescue', game); + this.send('resynced', game); } } diff --git a/packages/frontend/src/pages/reversi/game.board.vue b/packages/frontend/src/pages/reversi/game.board.vue index 4d4450ed7d..d492296c16 100644 --- a/packages/frontend/src/pages/reversi/game.board.vue +++ b/packages/frontend/src/pages/reversi/game.board.vue @@ -163,7 +163,7 @@ const $i = signinRequired(); const props = defineProps<{ game: Misskey.entities.ReversiGameDetailed; - connection: Misskey.ChannelConnection; + connection?: Misskey.ChannelConnection | null; }>(); const showBoardLabels = ref(false); @@ -240,10 +240,10 @@ watch(logPos, (v) => { if (game.value.isStarted && !game.value.isEnded) { useInterval(() => { - if (game.value.isEnded) return; + if (game.value.isEnded || props.connection == null) return; const crc32 = CRC32.str(JSON.stringify(game.value.logs)).toString(); if (_DEV_) console.log('crc32', crc32); - props.connection.send('checkState', { + props.connection.send('resync', { crc32: crc32, }); }, 10000, { immediate: false, afterMounted: true }); @@ -267,7 +267,7 @@ function putStone(pos) { }); const id = Math.random().toString(36).slice(2); - props.connection.send('putStone', { + props.connection!.send('putStone', { pos: pos, id, }); @@ -283,22 +283,24 @@ const myTurnTimerRmain = ref(game.value.timeLimitForEachTurn); const opTurnTimerRmain = ref(game.value.timeLimitForEachTurn); const TIMER_INTERVAL_SEC = 3; -useInterval(() => { - if (myTurnTimerRmain.value > 0) { - myTurnTimerRmain.value = Math.max(0, myTurnTimerRmain.value - TIMER_INTERVAL_SEC); - } - if (opTurnTimerRmain.value > 0) { - opTurnTimerRmain.value = Math.max(0, opTurnTimerRmain.value - TIMER_INTERVAL_SEC); - } +if (!props.game.isEnded) { + useInterval(() => { + if (myTurnTimerRmain.value > 0) { + myTurnTimerRmain.value = Math.max(0, myTurnTimerRmain.value - TIMER_INTERVAL_SEC); + } + if (opTurnTimerRmain.value > 0) { + opTurnTimerRmain.value = Math.max(0, opTurnTimerRmain.value - TIMER_INTERVAL_SEC); + } - if (iAmPlayer.value) { - if ((isMyTurn.value && myTurnTimerRmain.value === 0) || (!isMyTurn.value && opTurnTimerRmain.value === 0)) { - props.connection.send('claimTimeIsUp', {}); + if (iAmPlayer.value) { + if ((isMyTurn.value && myTurnTimerRmain.value === 0) || (!isMyTurn.value && opTurnTimerRmain.value === 0)) { + props.connection!.send('claimTimeIsUp', {}); + } } - } -}, TIMER_INTERVAL_SEC * 1000, { immediate: false, afterMounted: true }); + }, TIMER_INTERVAL_SEC * 1000, { immediate: false, afterMounted: true }); +} -function onStreamLog(log: Reversi.Serializer.Log & { id: string | null }) { +async function onStreamLog(log: Reversi.Serializer.Log & { id: string | null }) { game.value.logs = Reversi.Serializer.serializeLogs([ ...Reversi.Serializer.deserializeLogs(game.value.logs), log, @@ -309,17 +311,25 @@ function onStreamLog(log: Reversi.Serializer.Log & { id: string | null }) { if (log.id == null || !appliedOps.includes(log.id)) { switch (log.operation) { case 'put': { + sound.playUrl('/client-assets/reversi/put.mp3', { + volume: 1, + playbackRate: 1, + }); + + if (log.player !== engine.value.turn) { // = desyncが発生している + const _game = await misskeyApi('reversi/show-game', { + gameId: props.game.id, + }); + restoreGame(_game); + return; + } + engine.value.putStone(log.pos); triggerRef(engine); myTurnTimerRmain.value = game.value.timeLimitForEachTurn; opTurnTimerRmain.value = game.value.timeLimitForEachTurn; - sound.playUrl('/client-assets/reversi/put.mp3', { - volume: 1, - playbackRate: 1, - }); - checkEnd(); break; } @@ -366,9 +376,7 @@ function checkEnd() { } } -function onStreamRescue(_game) { - console.log('rescue'); - +function restoreGame(_game) { game.value = deepClone(_game); engine.value = Reversi.Serializer.restoreGame({ @@ -384,6 +392,12 @@ function onStreamRescue(_game) { checkEnd(); } +function onStreamResynced(_game) { + console.log('resynced'); + + restoreGame(_game); +} + async function surrender() { const { canceled } = await os.confirm({ type: 'warning', @@ -434,27 +448,35 @@ function share() { } onMounted(() => { - props.connection.on('log', onStreamLog); - props.connection.on('rescue', onStreamRescue); - props.connection.on('ended', onStreamEnded); + if (props.connection != null) { + props.connection.on('log', onStreamLog); + props.connection.on('resynced', onStreamResynced); + props.connection.on('ended', onStreamEnded); + } }); onActivated(() => { - props.connection.on('log', onStreamLog); - props.connection.on('rescue', onStreamRescue); - props.connection.on('ended', onStreamEnded); + if (props.connection != null) { + props.connection.on('log', onStreamLog); + props.connection.on('resynced', onStreamResynced); + props.connection.on('ended', onStreamEnded); + } }); onDeactivated(() => { - props.connection.off('log', onStreamLog); - props.connection.off('rescue', onStreamRescue); - props.connection.off('ended', onStreamEnded); + if (props.connection != null) { + props.connection.off('log', onStreamLog); + props.connection.off('resynced', onStreamResynced); + props.connection.off('ended', onStreamEnded); + } }); onUnmounted(() => { - props.connection.off('log', onStreamLog); - props.connection.off('rescue', onStreamRescue); - props.connection.off('ended', onStreamEnded); + if (props.connection != null) { + props.connection.off('log', onStreamLog); + props.connection.off('resynced', onStreamResynced); + props.connection.off('ended', onStreamEnded); + } }); diff --git a/packages/frontend/src/pages/reversi/game.vue b/packages/frontend/src/pages/reversi/game.vue index 0bdbfbcf54..d1e4103919 100644 --- a/packages/frontend/src/pages/reversi/game.vue +++ b/packages/frontend/src/pages/reversi/game.vue @@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only --> @@ -47,23 +47,25 @@ async function fetchGame() { if (connection.value) { connection.value.dispose(); } - connection.value = useStream().useChannel('reversiGame', { - gameId: game.value.id, - }); - connection.value.on('started', x => { - game.value = x.game; - }); - connection.value.on('canceled', x => { - connection.value?.dispose(); - - if (x.userId !== $i.id) { - os.alert({ - type: 'warning', - text: i18n.ts._reversi.gameCanceled, - }); - router.push('/reversi'); - } - }); + if (!game.value.isEnded) { + connection.value = useStream().useChannel('reversiGame', { + gameId: game.value.id, + }); + connection.value.on('started', x => { + game.value = x.game; + }); + connection.value.on('canceled', x => { + connection.value?.dispose(); + + if (x.userId !== $i.id) { + os.alert({ + type: 'warning', + text: i18n.ts._reversi.gameCanceled, + }); + router.push('/reversi'); + } + }); + } } onMounted(() => { -- cgit v1.2.3-freya From 94e282b612ad3dc6fd336a82fff19b290e11d221 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 15:41:29 +0900 Subject: perf(reversi): improve performance of reversi backend --- packages/backend/src/core/ReversiService.ts | 37 ++++++++++++++++++++-- .../src/core/entities/ReversiGameEntityService.ts | 35 ++++++++++---------- .../backend/src/models/json-schema/reversi-game.ts | 16 ---------- .../src/server/api/endpoints/reversi/games.ts | 6 ++-- .../src/server/api/endpoints/reversi/match.ts | 2 +- .../src/server/api/endpoints/reversi/show-game.ts | 2 +- packages/backend/src/types.ts | 6 +++- packages/misskey-js/src/autogen/apiClientJSDoc.ts | 4 +-- packages/misskey-js/src/autogen/endpoint.ts | 4 +-- packages/misskey-js/src/autogen/entities.ts | 4 +-- packages/misskey-js/src/autogen/models.ts | 4 +-- packages/misskey-js/src/autogen/types.ts | 8 ++--- 12 files changed, 73 insertions(+), 55 deletions(-) diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts index 0e59d0308d..0d5f989c11 100644 --- a/packages/backend/src/core/ReversiService.ts +++ b/packages/backend/src/core/ReversiService.ts @@ -234,10 +234,13 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { map: Reversi.maps.eighteight.data, bw: 'random', isLlotheo: false, - }).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0])); + }).then(x => this.reversiGamesRepository.findOneOrFail({ + where: { id: x.identifiers[0].id }, + relations: ['user1', 'user2'], + })); this.cacheGame(game); - const packed = await this.reversiGameEntityService.packDetail(game, { id: parentId }); + const packed = await this.reversiGameEntityService.packDetail(game); this.globalEventService.publishReversiStream(parentId, 'matched', { game: packed }); return game; @@ -267,6 +270,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { .returning('*') .execute() .then((response) => response.raw[0]); + // キャッシュ効率化のためにユーザー情報は再利用 + updatedGame.user1 = game.user1; + updatedGame.user2 = game.user2; this.cacheGame(updatedGame); //#region 盤面に最初から石がないなどして始まった瞬間に勝敗が決定する場合があるのでその処理 @@ -314,6 +320,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { .returning('*') .execute() .then((response) => response.raw[0]); + // キャッシュ効率化のためにユーザー情報は再利用 + updatedGame.user1 = game.user1; + updatedGame.user2 = game.user2; this.cacheGame(updatedGame); this.globalEventService.publishReversiGameStream(game.id, 'ended', { @@ -483,14 +492,36 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { public async get(id: MiReversiGame['id']): Promise { const cached = await this.redisClient.get(`reversi:game:cache:${id}`); if (cached != null) { + // TODO: この辺りのデシリアライズ処理をどこか別のサービスに切り出したい const parsed = JSON.parse(cached) as Serialized; return { ...parsed, startedAt: parsed.startedAt != null ? new Date(parsed.startedAt) : null, endedAt: parsed.endedAt != null ? new Date(parsed.endedAt) : null, + user1: parsed.user1 != null ? { + ...parsed.user1, + avatar: null, + banner: null, + updatedAt: parsed.user1.updatedAt != null ? new Date(parsed.user1.updatedAt) : null, + lastActiveDate: parsed.user1.lastActiveDate != null ? new Date(parsed.user1.lastActiveDate) : null, + lastFetchedAt: parsed.user1.lastFetchedAt != null ? new Date(parsed.user1.lastFetchedAt) : null, + movedAt: parsed.user1.movedAt != null ? new Date(parsed.user1.movedAt) : null, + } : null, + user2: parsed.user2 != null ? { + ...parsed.user2, + avatar: null, + banner: null, + updatedAt: parsed.user2.updatedAt != null ? new Date(parsed.user2.updatedAt) : null, + lastActiveDate: parsed.user2.lastActiveDate != null ? new Date(parsed.user2.lastActiveDate) : null, + lastFetchedAt: parsed.user2.lastFetchedAt != null ? new Date(parsed.user2.lastFetchedAt) : null, + movedAt: parsed.user2.movedAt != null ? new Date(parsed.user2.movedAt) : null, + } : null, }; } else { - const game = await this.reversiGamesRepository.findOneBy({ id }); + const game = await this.reversiGamesRepository.findOne({ + where: { id }, + relations: ['user1', 'user2'], + }); if (game == null) return null; this.cacheGame(game); diff --git a/packages/backend/src/core/entities/ReversiGameEntityService.ts b/packages/backend/src/core/entities/ReversiGameEntityService.ts index bcb0fd5a6f..6c89a70599 100644 --- a/packages/backend/src/core/entities/ReversiGameEntityService.ts +++ b/packages/backend/src/core/entities/ReversiGameEntityService.ts @@ -9,7 +9,6 @@ import type { ReversiGamesRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; import type { } from '@/models/Blocking.js'; -import type { MiUser } from '@/models/User.js'; import type { MiReversiGame } from '@/models/ReversiGame.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; @@ -29,10 +28,14 @@ export class ReversiGameEntityService { @bindThis public async packDetail( src: MiReversiGame['id'] | MiReversiGame, - me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src }); + const users = await Promise.all([ + this.userEntityService.pack(game.user1 ?? game.user1Id), + this.userEntityService.pack(game.user2 ?? game.user2Id), + ]); + return await awaitAll({ id: game.id, createdAt: this.idService.parse(game.id).date.toISOString(), @@ -46,10 +49,10 @@ export class ReversiGameEntityService { user2Ready: game.user2Ready, user1Id: game.user1Id, user2Id: game.user2Id, - user1: this.userEntityService.pack(game.user1Id, me), - user2: this.userEntityService.pack(game.user2Id, me), + user1: users[0], + user2: users[1], winnerId: game.winnerId, - winner: game.winnerId ? this.userEntityService.pack(game.winnerId, me) : null, + winner: game.winnerId ? users.find(u => u.id === game.winnerId)! : null, surrenderedUserId: game.surrenderedUserId, timeoutUserId: game.timeoutUserId, black: game.black, @@ -66,18 +69,21 @@ export class ReversiGameEntityService { @bindThis public packDetailMany( xs: MiReversiGame[], - me?: { id: MiUser['id'] } | null | undefined, ) { - return Promise.all(xs.map(x => this.packDetail(x, me))); + return Promise.all(xs.map(x => this.packDetail(x))); } @bindThis public async packLite( src: MiReversiGame['id'] | MiReversiGame, - me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src }); + const users = await Promise.all([ + this.userEntityService.pack(game.user1 ?? game.user1Id), + this.userEntityService.pack(game.user2 ?? game.user2Id), + ]); + return await awaitAll({ id: game.id, createdAt: this.idService.parse(game.id).date.toISOString(), @@ -85,16 +91,12 @@ export class ReversiGameEntityService { endedAt: game.endedAt && game.endedAt.toISOString(), isStarted: game.isStarted, isEnded: game.isEnded, - form1: game.form1, - form2: game.form2, - user1Ready: game.user1Ready, - user2Ready: game.user2Ready, user1Id: game.user1Id, user2Id: game.user2Id, - user1: this.userEntityService.pack(game.user1Id, me), - user2: this.userEntityService.pack(game.user2Id, me), + user1: users[0], + user2: users[1], winnerId: game.winnerId, - winner: game.winnerId ? this.userEntityService.pack(game.winnerId, me) : null, + winner: game.winnerId ? users.find(u => u.id === game.winnerId)! : null, surrenderedUserId: game.surrenderedUserId, timeoutUserId: game.timeoutUserId, black: game.black, @@ -109,9 +111,8 @@ export class ReversiGameEntityService { @bindThis public packLiteMany( xs: MiReversiGame[], - me?: { id: MiUser['id'] } | null | undefined, ) { - return Promise.all(xs.map(x => this.packLite(x, me))); + return Promise.all(xs.map(x => this.packLite(x))); } } diff --git a/packages/backend/src/models/json-schema/reversi-game.ts b/packages/backend/src/models/json-schema/reversi-game.ts index 4ac4d165d8..8061d84ad6 100644 --- a/packages/backend/src/models/json-schema/reversi-game.ts +++ b/packages/backend/src/models/json-schema/reversi-game.ts @@ -34,22 +34,6 @@ export const packedReversiGameLiteSchema = { type: 'boolean', optional: false, nullable: false, }, - form1: { - type: 'any', - optional: false, nullable: true, - }, - form2: { - type: 'any', - optional: false, nullable: true, - }, - user1Ready: { - type: 'boolean', - optional: false, nullable: false, - }, - user2Ready: { - type: 'boolean', - optional: false, nullable: false, - }, user1Id: { type: 'string', optional: false, nullable: false, diff --git a/packages/backend/src/server/api/endpoints/reversi/games.ts b/packages/backend/src/server/api/endpoints/reversi/games.ts index 5322cd0987..f28fe5d987 100644 --- a/packages/backend/src/server/api/endpoints/reversi/games.ts +++ b/packages/backend/src/server/api/endpoints/reversi/games.ts @@ -43,7 +43,9 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId) - .andWhere('game.isStarted = TRUE'); + .andWhere('game.isStarted = TRUE') + .innerJoinAndSelect('game.user1', 'user1') + .innerJoinAndSelect('game.user2', 'user2'); if (ps.my && me) { query.andWhere(new Brackets(qb => { @@ -55,7 +57,7 @@ export default class extends Endpoint { // eslint- const games = await query.take(ps.limit).getMany(); - return await this.reversiGameEntityService.packLiteMany(games, me); + return await this.reversiGameEntityService.packLiteMany(games); }); } } diff --git a/packages/backend/src/server/api/endpoints/reversi/match.ts b/packages/backend/src/server/api/endpoints/reversi/match.ts index da5a3409ef..1065ce5a89 100644 --- a/packages/backend/src/server/api/endpoints/reversi/match.ts +++ b/packages/backend/src/server/api/endpoints/reversi/match.ts @@ -60,7 +60,7 @@ export default class extends Endpoint { // eslint- if (game == null) return; - return await this.reversiGameEntityService.packDetail(game, me); + return await this.reversiGameEntityService.packDetail(game); }); } } diff --git a/packages/backend/src/server/api/endpoints/reversi/show-game.ts b/packages/backend/src/server/api/endpoints/reversi/show-game.ts index de571053e1..86645ea4b4 100644 --- a/packages/backend/src/server/api/endpoints/reversi/show-game.ts +++ b/packages/backend/src/server/api/endpoints/reversi/show-game.ts @@ -48,7 +48,7 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.noSuchGame); } - return await this.reversiGameEntityService.packDetail(game, me); + return await this.reversiGameEntityService.packDetail(game); }); } } diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 361a4931eb..cfac5cd9d4 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -277,7 +277,11 @@ export type Serialized = { ? (string | null) : T[K] extends Record ? Serialized - : T[K]; + : T[K] extends (Record | null) + ? (Serialized | null) + : T[K] extends (Record | undefined) + ? (Serialized | undefined) + : T[K]; }; export type FilterUnionByProperty< diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts index ea41f2cb55..d81444e5df 100644 --- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts +++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts @@ -1,6 +1,6 @@ /* - * version: 2023.12.2 - * generatedAt: 2024-01-21T01:01:12.332Z + * version: 2024.2.0-beta.2 + * generatedAt: 2024-01-22T06:08:45.879Z */ import type { SwitchCaseResponseType } from '../api.js'; diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index f551053524..69f02b899f 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1,6 +1,6 @@ /* - * version: 2023.12.2 - * generatedAt: 2024-01-21T01:01:12.330Z + * version: 2024.2.0-beta.2 + * generatedAt: 2024-01-22T06:08:45.877Z */ import type { diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index b0adbeaf93..5d46ea6611 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -1,6 +1,6 @@ /* - * version: 2023.12.2 - * generatedAt: 2024-01-21T01:01:12.328Z + * version: 2024.2.0-beta.2 + * generatedAt: 2024-01-22T06:08:45.876Z */ import { operations } from './types.js'; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index 306f0cd6b4..3e795f2b86 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -1,6 +1,6 @@ /* - * version: 2023.12.2 - * generatedAt: 2024-01-21T01:01:12.327Z + * version: 2024.2.0-beta.2 + * generatedAt: 2024-01-22T06:08:45.875Z */ import { components } from './types.js'; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 5d2b6e2e3b..271ca41159 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -2,8 +2,8 @@ /* eslint @typescript-eslint/no-explicit-any: 0 */ /* - * version: 2023.12.2 - * generatedAt: 2024-01-21T01:01:12.246Z + * version: 2024.2.0-beta.2 + * generatedAt: 2024-01-22T06:08:45.796Z */ /** @@ -4469,10 +4469,6 @@ export type components = { endedAt: string | null; isStarted: boolean; isEnded: boolean; - form1: Record | null; - form2: Record | null; - user1Ready: boolean; - user2Ready: boolean; /** Format: id */ user1Id: string; /** Format: id */ -- cgit v1.2.3-freya From 4af3640bd327f62ababdaa20105ddb82b4a969a7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 17:44:03 +0900 Subject: fix lint --- packages/backend/src/core/AntennaService.ts | 12 +++++++++--- packages/backend/src/core/MetaService.ts | 5 ++++- packages/backend/src/core/RoleService.ts | 3 ++- packages/backend/src/core/WebhookService.ts | 9 ++++++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index 2c27a02559..2959153070 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -55,23 +55,29 @@ export class AntennaService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'antennaCreated': - this.antennas.push({ + this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, lastUsedAt: new Date(body.lastUsedAt), + user: null, // joinなカラムは通常取ってこないので + userList: null, // joinなカラムは通常取ってこないので }); break; case 'antennaUpdated': { const idx = this.antennas.findIndex(a => a.id === body.id); if (idx >= 0) { - this.antennas[idx] = { + this.antennas[idx] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, lastUsedAt: new Date(body.lastUsedAt), + user: null, // joinなカラムは通常取ってこないので + userList: null, // joinなカラムは通常取ってこないので }; } else { // サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり - this.antennas.push({ + this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, lastUsedAt: new Date(body.lastUsedAt), + user: null, // joinなカラムは通常取ってこないので + userList: null, // joinなカラムは通常取ってこないので }); } } diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts index 80e8020961..8e945e3d89 100644 --- a/packages/backend/src/core/MetaService.ts +++ b/packages/backend/src/core/MetaService.ts @@ -51,7 +51,10 @@ export class MetaService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'metaUpdated': { - this.cache = body; + this.cache = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい + ...body, + proxyAccount: null, // joinなカラムは通常取ってこないので + }; break; } default: diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index d354faa7c2..2c1a5280b8 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -177,9 +177,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { case 'userRoleAssigned': { const cached = this.roleAssignmentByUserIdCache.get(body.userId); if (cached) { - cached.push({ + cached.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, expiresAt: body.expiresAt ? new Date(body.expiresAt) : null, + user: null, // joinなカラムは通常取ってこないので }); } break; diff --git a/packages/backend/src/core/WebhookService.ts b/packages/backend/src/core/WebhookService.ts index 930e6ef64a..5937bf89b1 100644 --- a/packages/backend/src/core/WebhookService.ts +++ b/packages/backend/src/core/WebhookService.ts @@ -49,9 +49,10 @@ export class WebhookService implements OnApplicationShutdown { switch (type) { case 'webhookCreated': if (body.active) { - this.webhooks.push({ + this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + user: null, // joinなカラムは通常取ってこないので }); } break; @@ -59,14 +60,16 @@ export class WebhookService implements OnApplicationShutdown { if (body.active) { const i = this.webhooks.findIndex(a => a.id === body.id); if (i > -1) { - this.webhooks[i] = { + this.webhooks[i] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + user: null, // joinなカラムは通常取ってこないので }; } else { - this.webhooks.push({ + this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい ...body, latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + user: null, // joinなカラムは通常取ってこないので }); } } else { -- cgit v1.2.3-freya From 5c8888d6a82e3b2072bfcfbf1620ce6f3d0bb214 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 17:59:12 +0900 Subject: enhance(reversi): render ogp --- .../backend/src/server/web/ClientServerService.ts | 26 +++++++++++++++++++++- .../backend/src/server/web/views/reversi-game.pug | 20 +++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 packages/backend/src/server/web/views/reversi-game.pug diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 2de5156fec..65b21694f8 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -31,12 +31,13 @@ import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; -import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; +import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, ReversiGamesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { deepClone } from '@/misc/clone.js'; import { bindThis } from '@/decorators.js'; import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; import { RoleService } from '@/core/RoleService.js'; +import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; import { FeedService } from './FeedService.js'; import { UrlPreviewService } from './UrlPreviewService.js'; import { ClientLoggerService } from './ClientLoggerService.js'; @@ -83,6 +84,9 @@ export class ClientServerService { @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, + @Inject(DI.reversiGamesRepository) + private reversiGamesRepository: ReversiGamesRepository, + private flashEntityService: FlashEntityService, private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, @@ -90,6 +94,7 @@ export class ClientServerService { private galleryPostEntityService: GalleryPostEntityService, private clipEntityService: ClipEntityService, private channelEntityService: ChannelEntityService, + private reversiGameEntityService: ReversiGameEntityService, private metaService: MetaService, private urlPreviewService: UrlPreviewService, private feedService: FeedService, @@ -686,6 +691,25 @@ export class ClientServerService { return await renderBase(reply); } }); + + // Reversi game + fastify.get<{ Params: { channel: string; } }>('/reversi/g/:game', async (request, reply) => { + const game = await this.reversiGamesRepository.findOneBy({ + id: request.params.game, + }); + + if (game) { + const _game = await this.reversiGameEntityService.packDetail(game); + const meta = await this.metaService.fetch(); + reply.header('Cache-Control', 'public, max-age=3600'); + return await reply.view('reversi-game', { + game: _game, + ...this.generateCommonPugData(meta), + }); + } else { + return await renderBase(reply); + } + }); //#endregion fastify.get('/_info_card_', async (request, reply) => { diff --git a/packages/backend/src/server/web/views/reversi-game.pug b/packages/backend/src/server/web/views/reversi-game.pug new file mode 100644 index 0000000000..0b5ffb2bb0 --- /dev/null +++ b/packages/backend/src/server/web/views/reversi-game.pug @@ -0,0 +1,20 @@ +extends ./base + +block vars + - const user1 = game.user1; + - const user2 = game.user2; + - const title = `${user1.username} vs ${user2.username}`; + - const url = `${config.url}/reversi/g/${game.id}`; + +block title + = `${title} | ${instanceName}` + +block desc + meta(name='description' content='⚫⚪Misskey Reversi⚪⚫') + +block og + meta(property='og:type' content='article') + meta(property='og:title' content= title) + meta(property='og:description' content='⚫⚪Misskey Reversi⚪⚫') + meta(property='og:url' content= url) + meta(property='twitter:card' content='summary') -- cgit v1.2.3-freya From d380ed36de3f25f5b99590c0fb3b7ea33f8e074b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 18:00:46 +0900 Subject: fix lint --- packages/backend/src/core/RoleService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 2c1a5280b8..a3558ea9ed 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -181,6 +181,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { ...body, expiresAt: body.expiresAt ? new Date(body.expiresAt) : null, user: null, // joinなカラムは通常取ってこないので + role: null, // joinなカラムは通常取ってこないので }); } break; -- cgit v1.2.3-freya From 850d38414e44d0be380f5b0900b408b05d41b8c1 Mon Sep 17 00:00:00 2001 From: おさむのひと <46447427+samunohito@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:01:54 +0900 Subject: fix: 2024-01-22 10:50時点のdevelopにてCIがコケている (#13060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: バブルゲームのビルド失敗修正 * fix: api.jsonの定義誤りを修正 * fix: lint.yml(typecheck) * fix: fix eslint error * fix: frontend vitest version * fix: frontend vitest version * fix: * fix: cypress * fix: misskey-js test * fix: misskey-js tsd(tsdはpakcage.jsonのexportsをサポートしない?) * fix: conflict * fix: 間違えて上書きしたところを修正 * fix: 再 * fix: api.json * fix: api.json * fix: タイムアウト延長 * Update packages/misskey-js/jest.config.cjs Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> --------- Co-authored-by: syuilo Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> --- .github/workflows/lint.yml | 2 + cypress/e2e/basic.cy.js | 9 +- package.json | 4 +- packages/backend/package.json | 8 +- .../backend/src/models/json-schema/reversi-game.ts | 4 +- packages/frontend/package.json | 8 +- packages/misskey-bubble-game/package.json | 8 +- packages/misskey-js/jest.config.cjs | 12 +- packages/misskey-js/package.json | 9 +- packages/misskey-js/src/autogen/apiClientJSDoc.ts | 2 +- packages/misskey-js/src/autogen/endpoint.ts | 2 +- packages/misskey-js/src/autogen/entities.ts | 2 +- packages/misskey-js/src/autogen/models.ts | 2 +- packages/misskey-js/src/autogen/types.ts | 2 +- packages/misskey-reversi/package.json | 4 +- packages/sw/package.json | 2 +- pnpm-lock.yaml | 440 ++++++++++----------- 17 files changed, 262 insertions(+), 258 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 23cea7d565..fe2d7fce4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,4 +92,6 @@ jobs: - run: pnpm i --frozen-lockfile - run: pnpm --filter misskey-js run build if: ${{ matrix.workspace == 'backend' }} + - run: pnpm --filter misskey-reversi run build + if: ${{ matrix.workspace == 'backend' }} - run: pnpm --filter ${{ matrix.workspace }} run typecheck diff --git a/cypress/e2e/basic.cy.js b/cypress/e2e/basic.cy.js index 5ab07c7480..d20b28c49f 100644 --- a/cypress/e2e/basic.cy.js +++ b/cypress/e2e/basic.cy.js @@ -161,11 +161,13 @@ describe('After user signed in', () => { }); it('successfully loads', () => { - cy.get('[data-cy-user-setup-continue]').should('be.visible'); + // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする + cy.get('[data-cy-user-setup-continue]', { timeout: 12000 }).should('be.visible'); }); it('account setup wizard', () => { - cy.get('[data-cy-user-setup-continue]').click(); + // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする + cy.get('[data-cy-user-setup-continue]', { timeout: 12000 }).click(); cy.get('[data-cy-user-setup-user-name] input').type('ありす'); cy.get('[data-cy-user-setup-user-description] textarea').type('ほげ'); @@ -202,7 +204,8 @@ describe('After user setup', () => { cy.login('alice', 'alice1234'); // アカウント初期設定ウィザード - cy.get('[data-cy-user-setup] [data-cy-modal-window-close]').click(); + // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする + cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 12000 }).click(); cy.get('[data-cy-modal-dialog-ok]').click(); }); diff --git a/package.json b/package.json index 330bd33371..0cd25b2a53 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "typescript": "5.3.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "cross-env": "7.0.3", "cypress": "13.6.3", "eslint": "8.56.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index 61f2bef89f..412c7ab8e4 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -8,7 +8,7 @@ }, "scripts": { "start": "node ./built/boot/entry.js", - "start:test": "NODE_ENV=test node ./built/boot/entry.js", + "start:test": "cross-env NODE_ENV=test node ./built/boot/entry.js", "migrate": "pnpm typeorm migration:run -d ormconfig.js", "revert": "pnpm typeorm migration:revert -d ormconfig.js", "check:connect": "node ./check_connect.js", @@ -31,7 +31,7 @@ "test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e", "test-and-coverage": "pnpm jest-and-coverage", "test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e", - "generate-api-json": "node ./generate_api_json.js" + "generate-api-json": "pnpm build && node ./generate_api_json.js" }, "optionalDependencies": { "@swc/core-android-arm64": "1.3.11", @@ -227,8 +227,8 @@ "@types/vary": "1.1.3", "@types/web-push": "3.6.3", "@types/ws": "8.5.10", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "aws-sdk-client-mock": "3.0.1", "cross-env": "7.0.3", "eslint": "8.56.0", diff --git a/packages/backend/src/models/json-schema/reversi-game.ts b/packages/backend/src/models/json-schema/reversi-game.ts index 8061d84ad6..f8a5e7451c 100644 --- a/packages/backend/src/models/json-schema/reversi-game.ts +++ b/packages/backend/src/models/json-schema/reversi-game.ts @@ -133,11 +133,11 @@ export const packedReversiGameDetailedSchema = { optional: false, nullable: false, }, form1: { - type: 'any', + type: 'object', optional: false, nullable: true, }, form2: { - type: 'any', + type: 'object', optional: false, nullable: true, }, user1Ready: { diff --git a/packages/frontend/package.json b/packages/frontend/package.json index fb819b2420..a93679e359 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -110,9 +110,9 @@ "@types/tinycolor2": "1.4.6", "@types/uuid": "9.0.7", "@types/ws": "8.5.10", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", - "@vitest/coverage-v8": "1.2.1", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", + "@vitest/coverage-v8": "0.34.6", "@vue/runtime-core": "3.4.15", "acorn": "8.11.3", "cross-env": "7.0.3", @@ -134,7 +134,7 @@ "storybook": "7.6.10", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", "vite-plugin-turbosnap": "1.0.3", - "vitest": "1.2.1", + "vitest": "0.34.6", "vitest-fetch-mock": "0.2.2", "vue-eslint-parser": "9.4.0", "vue-tsc": "1.8.27" diff --git a/packages/misskey-bubble-game/package.json b/packages/misskey-bubble-game/package.json index 787a956185..1dfa7afcdd 100644 --- a/packages/misskey-bubble-game/package.json +++ b/packages/misskey-bubble-game/package.json @@ -24,11 +24,9 @@ }, "devDependencies": { "@misskey-dev/eslint-plugin": "1.0.0", - "@types/matter-js": "0.19.6", "@types/node": "20.11.5", - "@types/seedrandom": "3.0.8", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "eslint": "8.56.0", "nodemon": "3.0.2", "typescript": "5.3.3" @@ -37,6 +35,8 @@ "built" ], "dependencies": { + "@types/matter-js": "0.19.6", + "@types/seedrandom": "3.0.8", "eventemitter3": "5.0.1", "matter-js": "0.19.0", "seedrandom": "3.0.5" diff --git a/packages/misskey-js/jest.config.cjs b/packages/misskey-js/jest.config.cjs index e5a74170ea..1230a4b5e2 100644 --- a/packages/misskey-js/jest.config.cjs +++ b/packages/misskey-js/jest.config.cjs @@ -81,7 +81,17 @@ module.exports = { // ], // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module - // moduleNameMapper: {}, + moduleNameMapper: { + // Do not resolve .wasm.js to .wasm by the rule below + '^(.+)\\.wasm\\.js$': '$1.wasm.js', + // SWC converts @/foo/bar.js to `../../src/foo/bar.js`, and then this rule + // converts it again to `../../src/foo/bar` which then can be resolved to + // `.ts` files. + // See https://github.com/swc-project/jest/issues/64#issuecomment-1029753225 + // TODO: Use `--allowImportingTsExtensions` on TypeScript 5.0 so that we can + // directly import `.ts` files without this hack. + '^((?:\\.{1,2}|[A-Z:])*/.*)\\.js$': '$1', + }, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader // modulePathIgnorePatterns: [], diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 6419eec87d..7132d0896a 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -3,6 +3,7 @@ "name": "misskey-js", "version": "0.0.16", "description": "Misskey SDK for JavaScript", + "types": "./built/dts/index.d.ts", "exports": { ".": { "import": "./built/esm/index.js", @@ -39,8 +40,8 @@ "@swc/jest": "0.2.31", "@types/jest": "29.5.11", "@types/node": "20.11.5", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "eslint": "8.56.0", "jest": "29.7.0", "jest-fetch-mock": "3.0.3", @@ -52,7 +53,9 @@ "typescript": "5.3.3" }, "files": [ - "built" + "built", + "built/esm", + "built/dts" ], "dependencies": { "@swc/cli": "0.1.63", diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts index d81444e5df..17e3376be7 100644 --- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts +++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts @@ -1,6 +1,6 @@ /* * version: 2024.2.0-beta.2 - * generatedAt: 2024-01-22T06:08:45.879Z + * generatedAt: 2024-01-22T07:11:08.412Z */ import type { SwitchCaseResponseType } from '../api.js'; diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index 69f02b899f..97268268fc 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1,6 +1,6 @@ /* * version: 2024.2.0-beta.2 - * generatedAt: 2024-01-22T06:08:45.877Z + * generatedAt: 2024-01-22T07:11:08.410Z */ import type { diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index 5d46ea6611..8fc9b1db1d 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -1,6 +1,6 @@ /* * version: 2024.2.0-beta.2 - * generatedAt: 2024-01-22T06:08:45.876Z + * generatedAt: 2024-01-22T07:11:08.408Z */ import { operations } from './types.js'; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index 3e795f2b86..2402fd53ae 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -1,6 +1,6 @@ /* * version: 2024.2.0-beta.2 - * generatedAt: 2024-01-22T06:08:45.875Z + * generatedAt: 2024-01-22T07:11:08.408Z */ import { components } from './types.js'; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 271ca41159..3504f6fa7d 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -3,7 +3,7 @@ /* * version: 2024.2.0-beta.2 - * generatedAt: 2024-01-22T06:08:45.796Z + * generatedAt: 2024-01-22T07:11:08.327Z */ /** diff --git a/packages/misskey-reversi/package.json b/packages/misskey-reversi/package.json index 34b29f5b7c..e65e484b62 100644 --- a/packages/misskey-reversi/package.json +++ b/packages/misskey-reversi/package.json @@ -25,8 +25,8 @@ "devDependencies": { "@misskey-dev/eslint-plugin": "1.0.0", "@types/node": "20.11.5", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "eslint": "8.56.0", "nodemon": "3.0.2", "typescript": "5.3.3" diff --git a/packages/sw/package.json b/packages/sw/package.json index d0be929fb6..244a676e86 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@misskey-dev/eslint-plugin": "1.0.0", - "@typescript-eslint/parser": "6.19.0", + "@typescript-eslint/parser": "6.18.1", "@typescript/lib-webworker": "npm:@types/serviceworker@0.0.67", "eslint": "8.56.0", "eslint-plugin-import": "2.29.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83c51bd2db..fd6a58c0d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,11 +36,11 @@ importers: version: 4.4.0 devDependencies: '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) cross-env: specifier: 7.0.3 version: 7.0.3 @@ -501,7 +501,7 @@ importers: version: 29.7.0 '@misskey-dev/eslint-plugin': specifier: 1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@nestjs/platform-express': specifier: 10.3.0 version: 10.3.0(@nestjs/common@10.2.10)(@nestjs/core@10.2.10) @@ -629,11 +629,11 @@ importers: specifier: 8.5.10 version: 8.5.10 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) aws-sdk-client-mock: specifier: 3.0.1 version: 3.0.1 @@ -645,7 +645,7 @@ importers: version: 8.56.0 eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0) execa: specifier: 8.0.1 version: 8.0.1 @@ -850,7 +850,7 @@ importers: devDependencies: '@misskey-dev/eslint-plugin': specifier: ^1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@misskey-dev/summaly': specifier: ^5.0.3 version: 5.0.3 @@ -880,7 +880,7 @@ importers: version: 7.6.10 '@storybook/jest': specifier: 0.2.3 - version: 0.2.3(vitest@1.2.1) + version: 0.2.3(vitest@0.34.6) '@storybook/manager-api': specifier: 7.6.10 version: 7.6.10(react-dom@18.2.0)(react@18.2.0) @@ -945,14 +945,14 @@ importers: specifier: 8.5.10 version: 8.5.10 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) '@vitest/coverage-v8': - specifier: 1.2.1 - version: 1.2.1(vitest@1.2.1) + specifier: 0.34.6 + version: 0.34.6(vitest@0.34.6) '@vue/runtime-core': specifier: 3.4.15 version: 3.4.15 @@ -970,7 +970,7 @@ importers: version: 8.56.0 eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0) eslint-plugin-vue: specifier: 9.20.1 version: 9.20.1(eslint@8.56.0) @@ -1017,11 +1017,11 @@ importers: specifier: 1.0.3 version: 1.0.3 vitest: - specifier: 1.2.1 - version: 1.2.1(@types/node@20.11.5)(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) + specifier: 0.34.6 + version: 0.34.6(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) vitest-fetch-mock: specifier: 0.2.2 - version: 0.2.2(vitest@1.2.1) + version: 0.2.2(vitest@0.34.6) vue-eslint-parser: specifier: 9.4.0 version: 9.4.0(eslint@8.56.0) @@ -1031,6 +1031,12 @@ importers: packages/misskey-bubble-game: dependencies: + '@types/matter-js': + specifier: 0.19.6 + version: 0.19.6 + '@types/seedrandom': + specifier: 3.0.8 + version: 3.0.8 eventemitter3: specifier: 5.0.1 version: 5.0.1 @@ -1043,22 +1049,16 @@ importers: devDependencies: '@misskey-dev/eslint-plugin': specifier: 1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) - '@types/matter-js': - specifier: 0.19.6 - version: 0.19.6 + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@types/node': specifier: 20.11.5 version: 20.11.5 - '@types/seedrandom': - specifier: 3.0.8 - version: 3.0.8 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: 8.56.0 version: 8.56.0 @@ -1089,7 +1089,7 @@ importers: version: 7.39.1(@types/node@20.11.5) '@misskey-dev/eslint-plugin': specifier: 1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@swc/jest': specifier: 0.2.31 version: 0.2.31(@swc/core@1.3.105) @@ -1100,11 +1100,11 @@ importers: specifier: 20.11.5 version: 20.11.5 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: 8.56.0 version: 8.56.0 @@ -1173,16 +1173,16 @@ importers: devDependencies: '@misskey-dev/eslint-plugin': specifier: 1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@types/node': specifier: 20.11.5 version: 20.11.5 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: 8.56.0 version: 8.56.0 @@ -1207,10 +1207,10 @@ importers: devDependencies: '@misskey-dev/eslint-plugin': specifier: 1.0.0 - version: 1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) '@typescript/lib-webworker': specifier: npm:@types/serviceworker@0.0.67 version: /@types/serviceworker@0.0.67 @@ -1219,7 +1219,7 @@ importers: version: 8.56.0 eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0) nodemon: specifier: 3.0.3 version: 3.0.3 @@ -1899,7 +1899,7 @@ packages: '@babel/traverse': 7.22.11 '@babel/types': 7.22.17 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -1922,7 +1922,7 @@ packages: '@babel/traverse': 7.23.5 '@babel/types': 7.23.5 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -2024,7 +2024,7 @@ packages: '@babel/core': 7.23.5 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -3423,7 +3423,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.5 '@babel/types': 7.22.17 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3441,7 +3441,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.6 '@babel/types': 7.23.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3472,15 +3472,6 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - /@babel/types@7.23.6: - resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.23.4 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - dev: true - /@base2/pretty-print-object@1.0.1: resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} dev: true @@ -4157,7 +4148,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.19.0 ignore: 5.2.4 @@ -4174,7 +4165,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.19.0 ignore: 5.2.4 @@ -4409,7 +4400,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -4872,7 +4863,7 @@ packages: eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.11.0)(eslint@8.53.0) dev: true - /@misskey-dev/eslint-plugin@1.0.0(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + /@misskey-dev/eslint-plugin@1.0.0(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0): resolution: {integrity: sha512-dh6UbcrNDVg5DD8k8Qh4ab30OPpuEYIlJCqaBV/lkIV8wNN/AfCJ2V7iTP8V8KjryM4t+sf5IqzQLQnT0mWI4A==} peerDependencies: '@typescript-eslint/eslint-plugin': '>= 6' @@ -4880,10 +4871,10 @@ packages: eslint: '>= 3' eslint-plugin-import: '>= 2' dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0) dev: true /@misskey-dev/sharp-read-bmp@1.1.1: @@ -7046,11 +7037,11 @@ packages: resolution: {integrity: sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==} dev: true - /@storybook/jest@0.2.3(vitest@1.2.1): + /@storybook/jest@0.2.3(vitest@0.34.6): resolution: {integrity: sha512-ov5izrmbAFObzKeh9AOC5MlmFxAcf0o5i6YFGae9sDx6DGh6alXsRM+chIbucVkUwVHVlSzdfbLDEFGY/ShaYw==} dependencies: '@storybook/expect': 28.1.3-5 - '@testing-library/jest-dom': 6.1.2(@types/jest@28.1.3)(vitest@1.2.1) + '@testing-library/jest-dom': 6.1.2(@types/jest@28.1.3)(vitest@0.34.6) '@types/jest': 28.1.3 jest-mock: 27.5.1 transitivePeerDependencies: @@ -7746,7 +7737,7 @@ packages: pretty-format: 27.5.1 dev: true - /@testing-library/jest-dom@6.1.2(@types/jest@28.1.3)(vitest@1.2.1): + /@testing-library/jest-dom@6.1.2(@types/jest@28.1.3)(vitest@0.34.6): resolution: {integrity: sha512-NP9jl1Q2qDDtx+cqogowtQtmgD2OVs37iMSIsTv5eN5ETRkf26Kj6ugVwA93/gZzzFWQAsgkKkcftDe91BJCkQ==} engines: {node: '>=14', npm: '>=6', yarn: '>=1'} peerDependencies: @@ -7773,7 +7764,7 @@ packages: dom-accessibility-api: 0.5.16 lodash: 4.17.21 redent: 3.0.0 - vitest: 1.2.1(@types/node@20.11.5)(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) + vitest: 0.34.6(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) dev: true /@testing-library/user-event@14.4.3(@testing-library/dom@9.2.0): @@ -7898,6 +7889,16 @@ packages: cbor: 9.0.1 dev: true + /@types/chai-subset@1.3.5: + resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} + dependencies: + '@types/chai': 4.3.11 + dev: true + + /@types/chai@4.3.11: + resolution: {integrity: sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==} + dev: true + /@types/color-convert@2.0.3: resolution: {integrity: sha512-2Q6wzrNiuEvYxVQqhh7sXM2mhIhvZR/Paq4FdsQkOMgWsCIkKvSGj8Le1/XalulrmgOzPMqNa0ix+ePY4hTrfg==} dependencies: @@ -8106,7 +8107,6 @@ packages: /@types/matter-js@0.19.6: resolution: {integrity: sha512-ffk6tqJM5scla+ThXmnox+mdfCo3qYk6yMjQsNcrbo6eQ5DqorVdtnaL+1agCoYzxUjmHeiNB7poBMAmhuLY7w==} - dev: true /@types/mdx@2.0.3: resolution: {integrity: sha512-IgHxcT3RC8LzFLhKwP3gbMPeaK7BM9eBH46OdapPA7yvuIUJ8H6zHZV53J8hGZcTSnt95jANt+rTBNUUc22ACQ==} @@ -8295,7 +8295,7 @@ packages: /@types/seedrandom@3.0.8: resolution: {integrity: sha512-TY1eezMU2zH2ozQoAFAQFOPpvP15g+ZgSfTZt31AUUH/Rxtnz3H+A/Sv1Snw2/amp//omibc+AEkTaA8KUeOLQ==} - dev: true + dev: false /@types/semver@7.5.6: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} @@ -8437,7 +8437,7 @@ packages: '@typescript-eslint/type-utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -8449,8 +8449,8 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} + /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -8461,12 +8461,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/type-utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.18.1 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -8492,15 +8492,15 @@ packages: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} + /@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -8509,11 +8509,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.18.1 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: @@ -8528,12 +8528,12 @@ packages: '@typescript-eslint/visitor-keys': 6.11.0 dev: true - /@typescript-eslint/scope-manager@6.19.0: - resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} + /@typescript-eslint/scope-manager@6.18.1: + resolution: {integrity: sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/visitor-keys': 6.18.1 dev: true /@typescript-eslint/type-utils@6.11.0(eslint@8.53.0)(typescript@5.3.3): @@ -8548,7 +8548,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.3.3) '@typescript-eslint/utils': 6.11.0(eslint@8.53.0)(typescript@5.3.3) - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.53.0 ts-api-utils: 1.0.1(typescript@5.3.3) typescript: 5.3.3 @@ -8556,8 +8556,8 @@ packages: - supports-color dev: true - /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} + /@typescript-eslint/type-utils@6.18.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -8566,9 +8566,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 ts-api-utils: 1.0.1(typescript@5.3.3) typescript: 5.3.3 @@ -8581,8 +8581,8 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@6.19.0: - resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} + /@typescript-eslint/types@6.18.1: + resolution: {integrity: sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -8597,7 +8597,7 @@ packages: dependencies: '@typescript-eslint/types': 6.11.0 '@typescript-eslint/visitor-keys': 6.11.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -8607,8 +8607,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): - resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} + /@typescript-eslint/typescript-estree@6.18.1(typescript@5.3.3): + resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -8616,9 +8616,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/visitor-keys': 6.18.1 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -8648,8 +8648,8 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} + /@typescript-eslint/utils@6.18.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -8657,9 +8657,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -8675,11 +8675,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.19.0: - resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} + /@typescript-eslint/visitor-keys@6.18.1: + resolution: {integrity: sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/types': 6.18.1 eslint-visitor-keys: 3.4.3 dev: true @@ -8725,64 +8725,61 @@ packages: vue: 3.4.15(typescript@5.3.3) dev: false - /@vitest/coverage-v8@1.2.1(vitest@1.2.1): - resolution: {integrity: sha512-fJEhKaDwGMZtJUX7BRcGxooGwg1Hl0qt53mVup/ZJeznhvL5EodteVnb/mcByhEcvVWbK83ZF31c7nPEDi4LOQ==} + /@vitest/coverage-v8@0.34.6(vitest@0.34.6): + resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} peerDependencies: - vitest: ^1.0.0 + vitest: '>=0.32.0 <1' dependencies: '@ampproject/remapping': 2.2.1 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.4(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.6 magic-string: 0.30.5 - magicast: 0.3.3 picocolors: 1.0.0 std-env: 3.7.0 test-exclude: 6.0.0 v8-to-istanbul: 9.2.0 - vitest: 1.2.1(@types/node@20.11.5)(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) + vitest: 0.34.6(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) transitivePeerDependencies: - supports-color dev: true - /@vitest/expect@1.2.1: - resolution: {integrity: sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==} + /@vitest/expect@0.34.6: + resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} dependencies: - '@vitest/spy': 1.2.1 - '@vitest/utils': 1.2.1 + '@vitest/spy': 0.34.6 + '@vitest/utils': 0.34.6 chai: 4.3.10 dev: true - /@vitest/runner@1.2.1: - resolution: {integrity: sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==} + /@vitest/runner@0.34.6: + resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} dependencies: - '@vitest/utils': 1.2.1 - p-limit: 5.0.0 - pathe: 1.1.1 + '@vitest/utils': 0.34.6 + p-limit: 4.0.0 + pathe: 1.1.2 dev: true - /@vitest/snapshot@1.2.1: - resolution: {integrity: sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==} + /@vitest/snapshot@0.34.6: + resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} dependencies: magic-string: 0.30.5 - pathe: 1.1.1 + pathe: 1.1.2 pretty-format: 29.7.0 dev: true - /@vitest/spy@1.2.1: - resolution: {integrity: sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==} + /@vitest/spy@0.34.6: + resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} dependencies: tinyspy: 2.2.0 dev: true - /@vitest/utils@1.2.1: - resolution: {integrity: sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==} + /@vitest/utils@0.34.6: + resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} dependencies: diff-sequences: 29.6.3 - estree-walker: 3.0.3 loupe: 2.3.7 pretty-format: 29.7.0 dev: true @@ -9085,7 +9082,7 @@ packages: engines: {node: '>= 6.0.0'} requiresBuild: true dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -9093,7 +9090,7 @@ packages: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: false @@ -9479,7 +9476,7 @@ packages: resolution: {integrity: sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw==} dependencies: archy: 1.0.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) fastq: 1.15.0 transitivePeerDependencies: - supports-color @@ -10077,7 +10074,7 @@ packages: check-error: 1.0.3 deep-eql: 4.1.3 get-func-name: 2.0.2 - loupe: 2.3.6 + loupe: 2.3.7 pathval: 1.1.1 type-detect: 4.0.8 dev: true @@ -10826,7 +10823,7 @@ packages: cli-table3: 0.6.3 commander: 6.2.1 common-tags: 1.8.2 - dayjs: 1.11.7 + dayjs: 1.11.10 debug: 4.3.4(supports-color@8.1.1) enquirer: 2.3.6 eventemitter2: 6.4.7 @@ -10886,11 +10883,6 @@ packages: /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} - dev: false - - /dayjs@1.11.7: - resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==} - dev: true /de-indent@1.0.2: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} @@ -10928,6 +10920,7 @@ packages: dependencies: ms: 2.1.2 supports-color: 5.5.0 + dev: true /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -10940,7 +10933,6 @@ packages: dependencies: ms: 2.1.2 supports-color: 8.1.1 - dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -11156,7 +11148,7 @@ packages: hasBin: true dependencies: address: 1.2.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -11480,7 +11472,7 @@ packages: peerDependencies: esbuild: '>=0.12 <1' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) esbuild: 0.18.20 transitivePeerDependencies: - supports-color @@ -11639,7 +11631,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -11660,7 +11652,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7(supports-color@8.1.1) eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 @@ -11703,7 +11695,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -11713,7 +11705,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -11722,7 +11714,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -11789,7 +11781,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -11836,7 +11828,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -11908,6 +11900,7 @@ packages: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: '@types/estree': 1.0.5 + dev: false /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -12466,7 +12459,7 @@ packages: debug: optional: true dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -13022,6 +13015,7 @@ packages: /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + dev: true /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} @@ -13159,7 +13153,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: false @@ -13219,7 +13213,7 @@ packages: engines: {node: '>= 6.0.0'} dependencies: agent-base: 5.1.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -13229,7 +13223,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -13238,7 +13232,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: false @@ -13398,7 +13392,7 @@ packages: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -13812,7 +13806,7 @@ packages: '@babel/core': 7.23.5 '@babel/parser': 7.23.6 '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.0 + istanbul-lib-coverage: 3.2.2 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -13825,7 +13819,7 @@ packages: '@babel/core': 7.23.5 '@babel/parser': 7.23.6 '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.0 + istanbul-lib-coverage: 3.2.2 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -13844,7 +13838,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -14766,12 +14760,9 @@ packages: wrap-ansi: 7.0.0 dev: true - /local-pkg@0.5.0: - resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + /local-pkg@0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} - dependencies: - mlly: 1.5.0 - pkg-types: 1.0.3 dev: true /locate-path@3.0.0: @@ -14863,13 +14854,6 @@ packages: js-tokens: 4.0.0 dev: true - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} - deprecated: Please upgrade to 2.3.7 which fixes GHSA-4q6p-r6v2-jvc5 - dependencies: - get-func-name: 2.0.2 - dev: true - /loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: @@ -14938,14 +14922,6 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - /magicast@0.3.3: - resolution: {integrity: sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw==} - dependencies: - '@babel/parser': 7.23.6 - '@babel/types': 7.23.6 - source-map-js: 1.0.2 - dev: true - /mailcheck@1.1.1: resolution: {integrity: sha512-3WjL8+ZDouZwKlyJBMp/4LeziLFXgleOdsYu87piGcMLqhBzCsy2QFdbtAwv757TFC/rtqd738fgJw1tFQCSgA==} dev: false @@ -16077,9 +16053,9 @@ packages: dependencies: yocto-queue: 0.1.0 - /p-limit@5.0.0: - resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} - engines: {node: '>=18'} + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: yocto-queue: 1.0.0 dev: true @@ -16463,7 +16439,7 @@ packages: dependencies: jsonc-parser: 3.2.0 mlly: 1.5.0 - pathe: 1.1.1 + pathe: 1.1.2 dev: true /plimit-lit@1.5.0: @@ -17177,7 +17153,7 @@ packages: engines: {node: '>=8.16.0'} dependencies: '@types/mime-types': 2.1.4 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) extract-zip: 1.7.0 https-proxy-agent: 4.0.0 mime: 2.6.0 @@ -18177,7 +18153,7 @@ packages: dependencies: '@hapi/hoek': 10.0.1 '@hapi/wreck': 18.0.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) joi: 17.7.0 transitivePeerDependencies: - supports-color @@ -18377,7 +18353,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -18530,7 +18506,7 @@ packages: arg: 5.0.2 bluebird: 3.7.2 check-more-types: 2.24.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) execa: 5.1.1 lazy-ass: 1.6.0 ps-tree: 1.2.0 @@ -18788,6 +18764,7 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 + dev: true /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} @@ -19035,8 +19012,8 @@ packages: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} dev: false - /tinypool@0.8.2: - resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==} + /tinypool@0.7.0: + resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} engines: {node: '>=14.0.0'} dev: true @@ -19408,7 +19385,7 @@ packages: chalk: 4.1.2 cli-highlight: 2.1.11 dayjs: 1.11.10 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) dotenv: 16.0.3 glob: 10.3.10 ioredis: 5.3.2 @@ -19762,14 +19739,15 @@ packages: core-util-is: 1.0.2 extsprintf: 1.3.0 - /vite-node@1.2.1(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0): - resolution: {integrity: sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==} - engines: {node: ^18.0.0 || >=20.0.0} + /vite-node@0.34.6(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0): + resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} + engines: {node: '>=v14.18.0'} hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4(supports-color@5.5.0) - pathe: 1.1.1 + debug: 4.3.4(supports-color@8.1.1) + mlly: 1.5.0 + pathe: 1.1.2 picocolors: 1.0.0 vite: 5.0.12(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0) transitivePeerDependencies: @@ -19824,34 +19802,34 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vitest-fetch-mock@0.2.2(vitest@1.2.1): + /vitest-fetch-mock@0.2.2(vitest@0.34.6): resolution: {integrity: sha512-XmH6QgTSjCWrqXoPREIdbj40T7i1xnGmAsTAgfckoO75W1IEHKR8hcPCQ7SO16RsdW1t85oUm6pcQRLeBgjVYQ==} engines: {node: '>=14.14.0'} peerDependencies: vitest: '>=0.16.0' dependencies: cross-fetch: 3.1.5 - vitest: 1.2.1(@types/node@20.11.5)(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) + vitest: 0.34.6(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0) transitivePeerDependencies: - encoding dev: true - /vitest@1.2.1(@types/node@20.11.5)(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0): - resolution: {integrity: sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==} - engines: {node: ^18.0.0 || >=20.0.0} + /vitest@0.34.6(happy-dom@10.0.3)(sass@1.70.0)(terser@5.27.0): + resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} + engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': ^1.0.0 - '@vitest/ui': ^1.0.0 + '@vitest/browser': '*' + '@vitest/ui': '*' happy-dom: '*' jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true - '@types/node': - optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -19860,29 +19838,37 @@ packages: optional: true jsdom: optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true dependencies: + '@types/chai': 4.3.11 + '@types/chai-subset': 1.3.5 '@types/node': 20.11.5 - '@vitest/expect': 1.2.1 - '@vitest/runner': 1.2.1 - '@vitest/snapshot': 1.2.1 - '@vitest/spy': 1.2.1 - '@vitest/utils': 1.2.1 + '@vitest/expect': 0.34.6 + '@vitest/runner': 0.34.6 + '@vitest/snapshot': 0.34.6 + '@vitest/spy': 0.34.6 + '@vitest/utils': 0.34.6 + acorn: 8.11.3 acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.3.10 - debug: 4.3.4(supports-color@5.5.0) - execa: 8.0.1 + debug: 4.3.4(supports-color@8.1.1) happy-dom: 10.0.3 - local-pkg: 0.5.0 + local-pkg: 0.4.3 magic-string: 0.30.5 - pathe: 1.1.1 + pathe: 1.1.2 picocolors: 1.0.0 std-env: 3.7.0 strip-literal: 1.3.0 tinybench: 2.6.0 - tinypool: 0.8.2 + tinypool: 0.7.0 vite: 5.0.12(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0) - vite-node: 1.2.1(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0) + vite-node: 0.34.6(@types/node@20.11.5)(sass@1.70.0)(terser@5.27.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -19953,7 +19939,7 @@ packages: peerDependencies: eslint: '>=6.0.0' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 -- cgit v1.2.3-freya From 99fe03bd4d8ed4545ebc7cd5ade678397339f6e1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 18:31:59 +0900 Subject: :art: --- packages/frontend/assets/reversi/logo.png | Bin 96293 -> 142237 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/frontend/assets/reversi/logo.png b/packages/frontend/assets/reversi/logo.png index 7d807ef1dc..4b0d58dec1 100644 Binary files a/packages/frontend/assets/reversi/logo.png and b/packages/frontend/assets/reversi/logo.png differ -- cgit v1.2.3-freya From e0ad066382aff197feb7339ec337c21a5e228aa3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 18:32:32 +0900 Subject: fix lint --- packages/backend/src/server/web/ClientServerService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 65b21694f8..8e1a89d55f 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -693,7 +693,7 @@ export class ClientServerService { }); // Reversi game - fastify.get<{ Params: { channel: string; } }>('/reversi/g/:game', async (request, reply) => { + fastify.get<{ Params: { game: string; } }>('/reversi/g/:game', async (request, reply) => { const game = await this.reversiGamesRepository.findOneBy({ id: request.params.game, }); -- cgit v1.2.3-freya From 5e307e472dbcae5531d90e4d96c641db3d6211b8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 22 Jan 2024 18:33:40 +0900 Subject: 2024.2.0-beta.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0cd25b2a53..479d25f945 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.2.0-beta.2", + "version": "2024.2.0-beta.3", "codename": "nasubi", "repository": { "type": "git", -- cgit v1.2.3-freya From 31a39776f52783e6e7630604b86d2694cc9e9b94 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 23 Jan 2024 00:19:43 +0900 Subject: chore: publish misskey-js automatically (#13014) * chore: publish @misskey-dev/misskey-js * remove @misskey-dev/ * ?? * correct version * version --- .github/workflows/on-release-created.yml | 43 ++++++++++++++++++++++++++++++++ .github/workflows/test-misskey-js.yml | 14 +++++++++++ packages/misskey-js/LICENSE | 2 +- packages/misskey-js/package.json | 2 +- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/on-release-created.yml diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml new file mode 100644 index 0000000000..b4c2d843f3 --- /dev/null +++ b/.github/workflows/on-release-created.yml @@ -0,0 +1,43 @@ +name: Publish Node.js Package + +on: + release: + types: [created] + + workflow_dispatch: + +jobs: + publish-misskey-js: + name: Publish misskey-js + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + strategy: + matrix: + node-version: [20.10.0] + + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + registry-url: 'https://registry.npmjs.org' + - name: Publish package + run: | + corepack enable + pnpm i --frozen-lockfile + pnpm build + pnpm --filter misskey-js publish --access public --no-git-checks --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 10c7ccf4d3..5aed385df9 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -54,3 +54,17 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: ./packages/misskey-js/coverage/coverage-final.json + + check-version: + # ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する + name: Check version + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Check version + run: | + if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/misskey-js/package.json)" ]; then + echo "Version mismatch!" + exit 1 + fi diff --git a/packages/misskey-js/LICENSE b/packages/misskey-js/LICENSE index 11c1f9ce22..63762b85d8 100644 --- a/packages/misskey-js/LICENSE +++ b/packages/misskey-js/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2022 syuilo and other contributors +Copyright (c) 2021-2024 syuilo and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 7132d0896a..06c3ce6b54 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "0.0.16", + "version": "2024.2.0-beta.3", "description": "Misskey SDK for JavaScript", "types": "./built/dts/index.d.ts", "exports": { -- cgit v1.2.3-freya From 2ee5507d06c4a86001221b90efed5cf6facb074b Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 22 Jan 2024 15:25:22 +0000 Subject: fix of #13014 (misskey-js publish) --- .github/workflows/on-release-created.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml index b4c2d843f3..3cc0e5007b 100644 --- a/.github/workflows/on-release-created.yml +++ b/.github/workflows/on-release-created.yml @@ -1,4 +1,4 @@ -name: Publish Node.js Package +name: On Release Created (Publish misskey-js) on: release: @@ -21,6 +21,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: true - name: Install pnpm uses: pnpm/action-setup@v2 with: -- cgit v1.2.3-freya