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(-) (limited to 'packages') 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 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(-) (limited to 'packages') 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(-) (limited to 'packages') 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 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(-) (limited to 'packages') 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(-) (limited to 'packages') 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(-) (limited to 'packages') 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 (limited to 'packages') 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(+) (limited to 'packages') 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(-) (limited to 'packages') 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(-) (limited to 'packages') 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(-) (limited to 'packages') 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 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 (limited to 'packages') 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