From 1f7a81aae71f85a47393491a7795b953e2427041 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 4 Sep 2023 13:33:38 +0900 Subject: [PATCH] update deps (#11764) * update deps * node16 * wip * wip * wip * Update test-utils.ts * wip * Update tsconfig.json * wip * Update package.json * wip * Update following.vue * Update followers.vue * Update index.vue * Update share.vue * Update MkUserPopup.vue * Update MkPostForm.vue * wip * Update MkTokenGenerateWindow.vue * Update MkPagination.vue * refactor * update deps * update deps * Update sw.ts * wip * wip * wip * Update FetchInstanceMetadataService.ts * Update FetchInstanceMetadataService.ts * update node * update deps * :art: --- .devcontainer/devcontainer.json | 2 +- .github/workflows/reviewer_lottery.yml | 13 - .github/workflows/storybook.yml | 112 - .node-version | 2 +- Dockerfile | 2 +- package.json | 14 +- packages/backend/package.json | 86 +- packages/backend/src/core/MetaService.ts | 2 +- .../src/core/chart/ChartManagementService.ts | 2 +- .../backend/src/daemons/JanitorService.ts | 2 +- .../backend/src/daemons/QueueStatsService.ts | 2 +- .../backend/src/daemons/ServerStatsService.ts | 2 +- packages/backend/src/misc/cache.ts | 2 +- .../backend/src/server/api/ApiCallService.ts | 2 +- .../server/api/stream/channels/user-list.ts | 2 +- .../backend/src/server/api/stream/index.ts | 2 +- .../src/server/web/ClientServerService.ts | 40 +- .../backend/src/server/web/views/base.pug | 8 +- packages/backend/test/tsconfig.json | 4 +- .../backend/test/unit/AnnouncementService.ts | 6 +- .../test/unit/FetchInstanceMetadataService.ts | 12 +- packages/backend/test/unit/RoleService.ts | 8 +- packages/backend/tsconfig.json | 7 +- .../frontend/.storybook/preview-head.html | 2 +- packages/frontend/.storybook/tsconfig.json | 1 + packages/frontend/package.json | 100 +- packages/frontend/src/account.ts | 12 +- packages/frontend/src/cache.ts | 8 +- .../src/components/MkAccountMoved.vue | 4 +- .../src/components/MkAchievements.vue | 4 +- .../src/components/MkAnnouncementDialog.vue | 4 +- .../frontend/src/components/MkAvatars.vue | 6 +- .../src/components/MkCropperDialog.vue | 8 +- .../frontend/src/components/MkCwButton.vue | 4 +- .../src/components/MkFileListForAdmin.vue | 4 +- .../src/components/MkFlashPreview.vue | 2 +- .../src/components/MkGalleryPostPreview.vue | 4 +- .../src/components/MkInstanceCardMini.vue | 4 +- .../frontend/src/components/MkInviteCode.vue | 4 +- .../frontend/src/components/MkMediaBanner.vue | 4 +- .../frontend/src/components/MkMediaImage.vue | 4 +- .../frontend/src/components/MkMediaList.vue | 6 +- .../frontend/src/components/MkMediaVideo.vue | 4 +- packages/frontend/src/components/MkNote.vue | 8 +- .../src/components/MkNoteDetailed.vue | 10 +- .../frontend/src/components/MkNoteHeader.vue | 4 +- .../frontend/src/components/MkNoteSimple.vue | 4 +- .../frontend/src/components/MkNoteSub.vue | 6 +- .../src/components/MkNotification.vue | 4 +- .../frontend/src/components/MkPagePreview.vue | 4 +- .../frontend/src/components/MkPagination.vue | 6 +- packages/frontend/src/components/MkPoll.vue | 4 +- .../frontend/src/components/MkPostForm.vue | 33 +- .../src/components/MkPostFormAttaches.vue | 12 +- .../src/components/MkPostFormDialog.vue | 18 +- .../src/components/MkReactedUsersDialog.vue | 6 +- .../components/MkReactionsViewer.reaction.vue | 4 +- .../src/components/MkReactionsViewer.vue | 4 +- .../src/components/MkRenotedUsersDialog.vue | 6 +- .../src/components/MkSubNoteContent.vue | 4 +- .../src/components/MkTokenGenerateWindow.vue | 4 +- .../MkUserAnnouncementEditDialog.vue | 4 +- .../src/components/MkUserCardMini.vue | 4 +- .../frontend/src/components/MkUserInfo.vue | 4 +- .../src/components/MkUserOnlineIndicator.vue | 4 +- .../frontend/src/components/MkUserPopup.vue | 7 +- .../src/components/MkUserSelectDialog.vue | 10 +- .../src/components/MkUserSetupDialog.User.vue | 4 +- .../src/components/MkVisibilityPicker.vue | 8 +- .../src/components/MkVisitorDashboard.vue | 4 +- .../frontend/src/components/global/MkAcct.vue | 4 +- .../src/components/global/MkAvatar.vue | 4 +- .../src/components/global/MkUserName.vue | 4 +- packages/frontend/src/filters/user.ts | 8 +- packages/frontend/src/os.ts | 3 +- packages/frontend/src/pages/_error_.vue | 4 +- packages/frontend/src/pages/admin-user.vue | 4 +- packages/frontend/src/pages/auth.form.vue | 5 +- packages/frontend/src/pages/auth.vue | 4 +- packages/frontend/src/pages/clip.vue | 4 +- .../frontend/src/pages/emoji-edit-dialog.vue | 4 +- packages/frontend/src/pages/follow.vue | 4 +- packages/frontend/src/pages/instance-info.vue | 6 +- packages/frontend/src/pages/invite.vue | 4 +- .../frontend/src/pages/my-antennas/editor.vue | 4 +- packages/frontend/src/pages/my-lists/list.vue | 6 +- packages/frontend/src/pages/note.vue | 4 +- .../src/pages/settings/2fa.qrdialog.vue | 2 +- packages/frontend/src/pages/settings/2fa.vue | 1 + .../frontend/src/pages/settings/migration.vue | 7 +- packages/frontend/src/pages/share.vue | 8 +- .../frontend/src/pages/user/achievements.vue | 4 +- .../src/pages/user/activity.following.vue | 4 +- .../src/pages/user/activity.heatmap.vue | 4 +- .../src/pages/user/activity.notes.vue | 4 +- .../frontend/src/pages/user/activity.pv.vue | 4 +- packages/frontend/src/pages/user/activity.vue | 4 +- packages/frontend/src/pages/user/clips.vue | 4 +- packages/frontend/src/pages/user/flashs.vue | 4 +- .../frontend/src/pages/user/follow-list.vue | 4 +- .../frontend/src/pages/user/followers.vue | 7 +- .../frontend/src/pages/user/following.vue | 7 +- packages/frontend/src/pages/user/gallery.vue | 4 +- packages/frontend/src/pages/user/home.vue | 4 +- .../src/pages/user/index.activity.vue | 4 +- .../frontend/src/pages/user/index.photos.vue | 10 +- .../src/pages/user/index.timeline.vue | 4 +- packages/frontend/src/pages/user/index.vue | 7 +- packages/frontend/src/pages/user/lists.vue | 4 +- packages/frontend/src/pages/user/pages.vue | 4 +- .../frontend/src/pages/user/reactions.vue | 4 +- .../frontend/src/pages/welcome.entrance.a.vue | 4 +- .../frontend/src/pages/welcome.timeline.vue | 4 +- packages/frontend/src/scripts/collapsed.ts | 4 +- .../frontend/src/scripts/gen-search-query.ts | 4 +- .../frontend/src/scripts/get-note-menu.ts | 14 +- .../frontend/src/scripts/get-note-summary.ts | 4 +- .../frontend/src/scripts/get-user-menu.ts | 4 +- .../frontend/src/scripts/isFfVisibleForMe.ts | 4 +- packages/frontend/src/scripts/lookup-user.ts | 4 +- .../frontend/src/scripts/page-metadata.ts | 6 +- packages/frontend/src/scripts/select-file.ts | 14 +- packages/frontend/src/scripts/test-utils.ts | 2 - .../frontend/src/scripts/use-note-capture.ts | 4 +- packages/frontend/src/store.ts | 10 +- packages/frontend/src/ui/_common_/common.vue | 4 +- .../frontend/src/ui/_common_/notification.vue | 4 +- .../src/ui/_common_/statusbar-federation.vue | 4 +- .../src/ui/_common_/statusbar-user-list.vue | 4 +- .../frontend/src/ui/deck/channel-column.vue | 4 +- packages/frontend/test/home.test.ts | 4 +- packages/frontend/test/note.test.ts | 4 +- packages/frontend/test/tsconfig.json | 4 +- packages/frontend/tsconfig.json | 11 +- packages/misskey-js/etc/misskey-js.api.md | 15 + packages/misskey-js/package.json | 24 +- packages/misskey-js/src/index.ts | 3 +- packages/misskey-js/tsconfig.json | 6 +- packages/sw/package.json | 10 +- packages/sw/src/sw.ts | 6 +- packages/sw/tsconfig.json | 8 +- pnpm-lock.yaml | 7781 ++++++++--------- 142 files changed, 4179 insertions(+), 4701 deletions(-) delete mode 100644 .github/workflows/reviewer_lottery.yml delete mode 100644 .github/workflows/storybook.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0eee9d503c..861b0008a0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "features": { "ghcr.io/devcontainers-contrib/features/pnpm:2": {}, "ghcr.io/devcontainers/features/node:1": { - "version": "20.5.0" + "version": "20.5.1" } }, "forwardPorts": [3000], diff --git a/.github/workflows/reviewer_lottery.yml b/.github/workflows/reviewer_lottery.yml deleted file mode 100644 index f281e6c3a1..0000000000 --- a/.github/workflows/reviewer_lottery.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Reviewer lottery" -on: - pull_request_target: - types: [opened, ready_for_review, reopened] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.6.0 - - uses: uesteibar/reviewer-lottery@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml deleted file mode 100644 index 8ab6d204bf..0000000000 --- a/.github/workflows/storybook.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Storybook - -on: - push: - branches: - - master - - develop - pull_request_target: - -jobs: - build: - runs-on: ubuntu-latest - - env: - NODE_OPTIONS: "--max_old_space_size=7168" - - steps: - - uses: actions/checkout@v3.6.0 - if: github.event_name != 'pull_request_target' - with: - fetch-depth: 0 - submodules: true - - uses: actions/checkout@v3.6.0 - if: github.event_name == 'pull_request_target' - with: - fetch-depth: 0 - submodules: true - ref: "refs/pull/${{ github.event.number }}/merge" - - name: Checkout actual HEAD - if: github.event_name == 'pull_request_target' - id: rev - run: | - echo "base=$(git rev-list --parents -n1 HEAD | cut -d" " -f2)" >> $GITHUB_OUTPUT - git checkout $(git rev-list --parents -n1 HEAD | cut -d" " -f3) - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Use Node.js 20.x - uses: actions/setup-node@v3.8.1 - with: - node-version-file: '.node-version' - cache: 'pnpm' - - run: corepack enable - - run: pnpm i --frozen-lockfile - - name: Check pnpm-lock.yaml - run: git diff --exit-code pnpm-lock.yaml - - name: Build misskey-js - run: pnpm --filter misskey-js build - - name: Build storybook - run: pnpm --filter frontend build-storybook - - name: Publish to Chromatic - if: github.event_name != 'pull_request_target' && github.ref == 'refs/heads/master' - run: pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Publish to Chromatic - if: github.event_name != 'pull_request_target' && github.ref != 'refs/heads/master' - id: chromatic_push - run: | - DIFF="${{ github.event.before }} HEAD" - if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then - DIFF="HEAD" - fi - CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))" - if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then - echo "skip=true" >> $GITHUB_OUTPUT - fi - if pnpm --filter frontend chromatic -d storybook-static $(echo "$CHROMATIC_PARAMETER"); then - echo "success=true" >> $GITHUB_OUTPUT - else - echo "success=false" >> $GITHUB_OUTPUT - fi - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Publish to Chromatic - if: github.event_name == 'pull_request_target' - id: chromatic_pull_request - run: | - DIFF="${{ steps.rev.outputs.base }} HEAD" - if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then - DIFF="HEAD" - fi - CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))" - if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then - echo "skip=true" >> $GITHUB_OUTPUT - fi - BRANCH="${{ github.event.pull_request.head.user.login }}:${{ github.event.pull_request.head.ref }}" - if [ "$BRANCH" = "misskey-dev:${{ github.event.pull_request.head.ref }}" ]; then - BRANCH="${{ github.event.pull_request.head.ref }}" - fi - pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static --branch-name $BRANCH $(echo "$CHROMATIC_PARAMETER") - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Notify that Chromatic detects changes - uses: actions/github-script@v6.4.0 - if: github.event_name != 'pull_request_target' && steps.chromatic_push.outputs.success == 'false' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.repos.createCommitComment({ - owner: context.repo.owner, - repo: context.repo.repo, - commit_sha: context.sha, - body: 'Chromatic detects changes. Please [review the changes on Chromatic](https://www.chromatic.com/builds?appId=6428f7d7b962f0b79f97d6e4).' - }) - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: storybook - path: packages/frontend/storybook-static diff --git a/.node-version b/.node-version index 6a148f2818..7cc2069986 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.5.0 +20.5.1 diff --git a/Dockerfile b/Dockerfile index ce9d740ab6..678b991e81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1.4 -ARG NODE_VERSION=20.5.0-bullseye +ARG NODE_VERSION=20.5.1-bullseye # build assets & compile TypeScript diff --git a/package.json b/package.json index 1c6d089e93..ff9a3ce738 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/misskey-dev/misskey.git" }, - "packageManager": "pnpm@8.6.10", + "packageManager": "pnpm@8.7.1", "workspaces": [ "packages/frontend", "packages/backend", @@ -44,23 +44,23 @@ "lodash": "4.17.21" }, "dependencies": { - "execa": "7.2.0", + "execa": "8.0.1", "gulp": "4.0.2", "gulp-cssnano": "2.1.3", "gulp-rename": "2.0.0", "gulp-replace": "1.1.4", "gulp-terser": "2.1.0", "js-yaml": "4.1.0", - "typescript": "5.1.6" + "typescript": "5.2.2" }, "devDependencies": { "@types/gulp": "4.0.13", "@types/gulp-rename": "2.0.2", - "@typescript-eslint/eslint-plugin": "6.2.0", - "@typescript-eslint/parser": "6.2.0", + "@typescript-eslint/eslint-plugin": "6.5.0", + "@typescript-eslint/parser": "6.5.0", "cross-env": "7.0.3", - "cypress": "12.17.2", - "eslint": "8.46.0", + "cypress": "13.1.0", + "eslint": "8.48.0", "start-server-and-test": "2.0.0" }, "optionalDependencies": { diff --git a/packages/backend/package.json b/packages/backend/package.json index 8c5b67ced6..e3611bec20 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -56,36 +56,36 @@ "utf-8-validate": "^6.0.3" }, "dependencies": { - "@aws-sdk/client-s3": "3.367.0", - "@aws-sdk/lib-storage": "3.367.0", - "@aws-sdk/node-http-handler": "3.360.0", - "@bull-board/api": "5.7.1", - "@bull-board/fastify": "5.7.1", - "@bull-board/ui": "5.7.1", + "@aws-sdk/client-s3": "3.400.0", + "@aws-sdk/lib-storage": "3.400.0", + "@aws-sdk/node-http-handler": "3.374.0", + "@bull-board/api": "5.8.0", + "@bull-board/fastify": "5.8.0", + "@bull-board/ui": "5.8.0", "@discordapp/twemoji": "14.1.2", "@fastify/accepts": "4.2.0", - "@fastify/cookie": "8.3.0", + "@fastify/cookie": "9.0.4", "@fastify/cors": "8.3.0", "@fastify/express": "2.3.0", "@fastify/http-proxy": "9.2.1", "@fastify/multipart": "7.7.3", - "@fastify/static": "6.10.2", + "@fastify/static": "6.11.0", "@fastify/view": "8.0.0", - "@nestjs/common": "10.1.2", - "@nestjs/core": "10.1.2", - "@nestjs/testing": "10.1.2", + "@nestjs/common": "10.2.4", + "@nestjs/core": "10.2.4", + "@nestjs/testing": "10.2.4", "@peertube/http-signature": "1.7.0", - "@sinonjs/fake-timers": "10.3.0", + "@sinonjs/fake-timers": "11.1.0", "@swc/cli": "0.1.62", - "@swc/core": "1.3.72", + "@swc/core": "1.3.82", "accepts": "1.3.8", "ajv": "8.12.0", - "archiver": "5.3.1", - "async-mutex": "^0.4.0", + "archiver": "6.0.0", + "async-mutex": "0.4.0", "bcryptjs": "2.4.3", "blurhash": "2.0.5", "body-parser": "1.20.2", - "bullmq": "4.6.3", + "bullmq": "4.8.0", "cacheable-lookup": "7.0.0", "cbor": "9.0.1", "chalk": "5.3.0", @@ -96,7 +96,7 @@ "content-disposition": "0.5.4", "date-fns": "2.30.0", "deep-email-validator": "0.1.21", - "fastify": "4.21.0", + "fastify": "4.22.2", "feed": "4.2.2", "file-type": "18.5.0", "fluent-ffmpeg": "2.1.2", @@ -112,9 +112,9 @@ "js-yaml": "4.1.0", "jsdom": "22.1.0", "json5": "2.2.3", - "jsonld": "8.2.0", + "jsonld": "8.2.1", "jsrsasign": "10.8.6", - "meilisearch": "0.33.0", + "meilisearch": "0.34.1", "mfm-js": "0.23.3", "microformats-parser": "1.4.1", "mime-types": "2.1.35", @@ -130,7 +130,7 @@ "os-utils": "0.0.14", "otpauth": "9.1.4", "parse5": "7.1.2", - "pg": "8.11.1", + "pg": "8.11.3", "pkce-challenge": "4.0.1", "probe-image-size": "7.2.3", "promise-limit": "2.7.0", @@ -140,84 +140,84 @@ "qrcode": "1.5.3", "random-seed": "0.3.0", "ratelimiter": "3.4.1", - "re2": "1.20.1", + "re2": "1.20.3", "redis-lock": "0.1.4", "reflect-metadata": "0.1.13", "rename": "1.0.4", "rss-parser": "3.13.0", "rxjs": "7.8.1", "sanitize-html": "2.11.0", - "sharp": "0.32.4", + "sharp": "0.32.5", "sharp-read-bmp": "github:misskey-dev/sharp-read-bmp", "slacc": "0.0.10", "strict-event-emitter-types": "2.0.0", "stringz": "2.1.0", "summaly": "github:misskey-dev/summaly", - "systeminformation": "5.18.9", + "systeminformation": "5.21.4", "tinycolor2": "1.6.0", "tmp": "0.2.1", "tsc-alias": "1.8.7", "tsconfig-paths": "4.2.0", "twemoji-parser": "14.0.0", "typeorm": "0.3.17", - "typescript": "5.1.6", + "typescript": "5.2.2", "ulid": "2.3.0", "vary": "1.1.2", - "web-push": "3.6.4", + "web-push": "3.6.5", "ws": "8.13.0", "xev": "3.0.2" }, "devDependencies": { - "@jest/globals": "29.6.2", - "@swc/jest": "0.2.27", + "@jest/globals": "29.6.4", + "@swc/jest": "0.2.29", "@types/accepts": "1.3.5", "@types/archiver": "5.3.2", - "@types/bcryptjs": "2.4.2", + "@types/bcryptjs": "2.4.3", "@types/body-parser": "1.19.2", "@types/cbor": "6.0.0", "@types/color-convert": "2.0.0", "@types/content-disposition": "0.5.5", "@types/fluent-ffmpeg": "2.1.21", "@types/http-link-header": "1.0.3", - "@types/jest": "29.5.3", + "@types/jest": "29.5.4", "@types/js-yaml": "4.0.5", - "@types/jsdom": "21.1.1", + "@types/jsdom": "21.1.2", "@types/jsonld": "1.5.9", "@types/jsrsasign": "10.5.8", "@types/mime-types": "2.1.1", "@types/ms": "0.7.31", - "@types/node": "20.4.5", + "@types/node": "20.5.9", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.9", - "@types/oauth": "0.9.1", - "@types/oauth2orize": "1.11.0", + "@types/oauth": "0.9.2", + "@types/oauth2orize": "1.11.1", "@types/oauth2orize-pkce": "0.1.0", "@types/pg": "8.10.2", "@types/pug": "2.0.6", "@types/punycode": "2.1.0", - "@types/qrcode": "1.5.1", + "@types/qrcode": "1.5.2", "@types/random-seed": "0.3.3", "@types/ratelimiter": "3.4.4", "@types/rename": "1.0.4", "@types/sanitize-html": "2.9.0", - "@types/semver": "7.5.0", + "@types/semver": "7.5.1", "@types/sharp": "0.32.0", "@types/simple-oauth2": "5.0.4", "@types/sinonjs__fake-timers": "8.1.2", "@types/tinycolor2": "1.4.3", "@types/tmp": "0.2.3", "@types/vary": "1.1.0", - "@types/web-push": "3.3.2", + "@types/web-push": "3.6.0", "@types/ws": "8.5.5", - "@typescript-eslint/eslint-plugin": "6.2.0", - "@typescript-eslint/parser": "6.2.0", + "@typescript-eslint/eslint-plugin": "6.5.0", + "@typescript-eslint/parser": "6.5.0", "aws-sdk-client-mock": "3.0.0", "cross-env": "7.0.3", - "eslint": "8.46.0", - "eslint-plugin-import": "2.28.0", - "execa": "7.2.0", - "jest": "29.6.2", - "jest-mock": "29.6.2", + "eslint": "8.48.0", + "eslint-plugin-import": "2.28.1", + "execa": "8.0.1", + "jest": "29.6.4", + "jest-mock": "29.6.3", "simple-oauth2": "5.0.0" } } diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts index f9619861bb..42ce4de432 100644 --- a/packages/backend/src/core/MetaService.ts +++ b/packages/backend/src/core/MetaService.ts @@ -16,7 +16,7 @@ import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class MetaService implements OnApplicationShutdown { private cache: MiMeta | undefined; - private intervalId: NodeJS.Timer; + private intervalId: NodeJS.Timeout; constructor( @Inject(DI.redisForSub) diff --git a/packages/backend/src/core/chart/ChartManagementService.ts b/packages/backend/src/core/chart/ChartManagementService.ts index 6b626d3980..f751a68cb4 100644 --- a/packages/backend/src/core/chart/ChartManagementService.ts +++ b/packages/backend/src/core/chart/ChartManagementService.ts @@ -23,7 +23,7 @@ import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class ChartManagementService implements OnApplicationShutdown { private charts; - private saveIntervalId: NodeJS.Timer; + private saveIntervalId: NodeJS.Timeout; constructor( private federationChart: FederationChart, diff --git a/packages/backend/src/daemons/JanitorService.ts b/packages/backend/src/daemons/JanitorService.ts index 6f5e5a7f3b..63c44e874f 100644 --- a/packages/backend/src/daemons/JanitorService.ts +++ b/packages/backend/src/daemons/JanitorService.ts @@ -14,7 +14,7 @@ const interval = 30 * 60 * 1000; @Injectable() export class JanitorService implements OnApplicationShutdown { - private intervalId: NodeJS.Timer; + private intervalId: NodeJS.Timeout; constructor( @Inject(DI.attestationChallengesRepository) diff --git a/packages/backend/src/daemons/QueueStatsService.ts b/packages/backend/src/daemons/QueueStatsService.ts index dc9482f022..5edc0f45ab 100644 --- a/packages/backend/src/daemons/QueueStatsService.ts +++ b/packages/backend/src/daemons/QueueStatsService.ts @@ -19,7 +19,7 @@ const interval = 10000; @Injectable() export class QueueStatsService implements OnApplicationShutdown { - private intervalId: NodeJS.Timer; + private intervalId: NodeJS.Timeout; constructor( @Inject(DI.config) diff --git a/packages/backend/src/daemons/ServerStatsService.ts b/packages/backend/src/daemons/ServerStatsService.ts index 95026099e8..d294628740 100644 --- a/packages/backend/src/daemons/ServerStatsService.ts +++ b/packages/backend/src/daemons/ServerStatsService.ts @@ -20,7 +20,7 @@ const round = (num: number) => Math.round(num * 10) / 10; @Injectable() export class ServerStatsService implements OnApplicationShutdown { - private intervalId: NodeJS.Timer | null = null; + private intervalId: NodeJS.Timeout | null = null; constructor( private metaService: MetaService, diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index 046d4d6c2f..c235871931 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -193,7 +193,7 @@ function nothingToDo(value: T): V { export class MemoryKVCache { public cache: Map; private lifetime: number; - private gcIntervalHandle: NodeJS.Timer; + private gcIntervalHandle: NodeJS.Timeout; private toMapConverter: (value: T) => V; private fromMapConverter: (cached: V) => T | undefined; diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index 5d5a8f3706..b90c8a5199 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -35,7 +35,7 @@ const accessDenied = { export class ApiCallService implements OnApplicationShutdown { private logger: Logger; private userIpHistories: Map>; - private userIpHistoriesClearIntervalId: NodeJS.Timer; + private userIpHistoriesClearIntervalId: NodeJS.Timeout; constructor( @Inject(DI.userIpsRepository) diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 557b934722..f7001e41cd 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -19,7 +19,7 @@ class UserListChannel extends Channel { public static requireCredential = false; private listId: string; public listUsers: MiUser['id'][] = []; - private listUsersClock: NodeJS.Timer; + private listUsersClock: NodeJS.Timeout; constructor( private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index 181aa5e2a3..232ec5700d 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -35,7 +35,7 @@ export default class Connection { public userIdsWhoMeMuting: Set = new Set(); public userIdsWhoBlockingMe: Set = new Set(); public userIdsWhoMeMutingRenotes: Set = new Set(); - private fetchIntervalId: NodeJS.Timer | null = null; + private fetchIntervalId: NodeJS.Timeout | null = null; constructor( private channelsService: ChannelsService, diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 56aa343632..75f305be5a 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -37,7 +37,6 @@ 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 manifest from './manifest.json' assert { type: 'json' }; import { FeedService } from './FeedService.js'; import { UrlPreviewService } from './UrlPreviewService.js'; import { ClientLoggerService } from './ClientLoggerService.js'; @@ -52,6 +51,45 @@ const assets = `${_dirname}/../../../../../built/_frontend_dist_/`; const swAssets = `${_dirname}/../../../../../built/_sw_dist_/`; const viteOut = `${_dirname}/../../../../../built/_vite_/`; +const manifest = { + 'short_name': 'Misskey', + 'name': 'Misskey', + 'start_url': '/', + 'display': 'standalone', + 'background_color': '#313a42', + 'theme_color': '#86b300', + 'icons': [ + { + 'src': '/static-assets/icons/192.png', + 'sizes': '192x192', + 'type': 'image/png', + 'purpose': 'maskable', + }, + { + 'src': '/static-assets/icons/512.png', + 'sizes': '512x512', + 'type': 'image/png', + 'purpose': 'maskable', + }, + { + 'src': '/static-assets/splash.png', + 'sizes': '300x300', + 'type': 'image/png', + 'purpose': 'any', + }, + ], + 'share_target': { + 'action': '/share/', + 'method': 'GET', + 'enctype': 'application/x-www-form-urlencoded', + 'params': { + 'title': 'title', + 'text': 'text', + 'url': 'url', + }, + }, +}; + @Injectable() export class ClientServerService { private logger: Logger; diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 2b61c6bc2f..c2053517d6 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -7,15 +7,15 @@ doctype html // - - _____ _ _ - | |_|___ ___| |_ ___ _ _ + _____ _ _ + | |_|___ ___| |_ ___ _ _ | | | | |_ -|_ -| '_| -_| | | |_|_|_|_|___|___|_,_|___|_ | |___| Thank you for using Misskey! If you are reading this message... how about joining the development? https://github.com/misskey-dev/misskey - + html @@ -35,7 +35,7 @@ html link(rel='prefetch' href=infoImageUrl) link(rel='prefetch' href=notFoundImageUrl) //- https://github.com/misskey-dev/misskey/issues/9842 - link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.25.0') + link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.32.0') link(rel='modulepreload' href=`/vite/${clientEntry.file}`) if !config.clientManifestExists diff --git a/packages/backend/test/tsconfig.json b/packages/backend/test/tsconfig.json index 21afe1aaf3..4597ff8780 100644 --- a/packages/backend/test/tsconfig.json +++ b/packages/backend/test/tsconfig.json @@ -10,8 +10,8 @@ "declaration": false, "sourceMap": true, "target": "ES2022", - "module": "es2020", - "moduleResolution": "node16", + "module": "nodenext", + "moduleResolution": "nodenext", "allowSyntheticDefaultImports": true, "removeComments": false, "noLib": false, diff --git a/packages/backend/test/unit/AnnouncementService.ts b/packages/backend/test/unit/AnnouncementService.ts index c97e081ba5..f09ae3e2f4 100644 --- a/packages/backend/test/unit/AnnouncementService.ts +++ b/packages/backend/test/unit/AnnouncementService.ts @@ -10,7 +10,7 @@ import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import { GlobalModule } from '@/GlobalModule.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; -import type { Announcement, AnnouncementsRepository, AnnouncementReadsRepository, UsersRepository, User } from '@/models/index.js'; +import type { MiAnnouncement, AnnouncementsRepository, AnnouncementReadsRepository, UsersRepository, MiUser } from '@/models/index.js'; import { DI } from '@/di-symbols.js'; import { genAid } from '@/misc/id/aid.js'; import { CacheService } from '@/core/CacheService.js'; @@ -30,7 +30,7 @@ describe('AnnouncementService', () => { let announcementReadsRepository: AnnouncementReadsRepository; let globalEventService: jest.Mocked; - function createUser(data: Partial = {}) { + function createUser(data: Partial = {}) { const un = secureRndstr(16); return usersRepository.insert({ id: genAid(new Date()), @@ -42,7 +42,7 @@ describe('AnnouncementService', () => { .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); } - function createAnnouncement(data: Partial = {}) { + function createAnnouncement(data: Partial = {}) { return announcementsRepository.insert({ id: genAid(new Date()), createdAt: new Date(), diff --git a/packages/backend/test/unit/FetchInstanceMetadataService.ts b/packages/backend/test/unit/FetchInstanceMetadataService.ts index 22ce023216..34200899d4 100644 --- a/packages/backend/test/unit/FetchInstanceMetadataService.ts +++ b/packages/backend/test/unit/FetchInstanceMetadataService.ts @@ -6,7 +6,6 @@ process.env.NODE_ENV = 'test'; import { jest } from '@jest/globals'; -import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import { Redis } from 'ioredis'; import { GlobalModule } from '@/GlobalModule.js'; @@ -18,7 +17,6 @@ import { UtilityService } from '@/core/UtilityService.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; import type { TestingModule } from '@nestjs/testing'; -import type { MockFunctionMetadata } from 'jest-mock'; function mockRedis() { const hash = {}; @@ -35,9 +33,9 @@ describe('FetchInstanceMetadataService', () => { let fetchInstanceMetadataService: jest.Mocked; let federatedInstanceService: jest.Mocked; let httpRequestService: jest.Mocked; - let redisClient: jest.Mocked; + let redisClient: jest.Mocked; - beforeAll(async () => { + beforeEach(async () => { app = await Test .createTestingModule({ imports: [ @@ -64,11 +62,11 @@ describe('FetchInstanceMetadataService', () => { fetchInstanceMetadataService = app.get(FetchInstanceMetadataService); federatedInstanceService = app.get(FederatedInstanceService) as jest.Mocked; - redisClient = app.get(DI.redis) as jest.Mocked; + redisClient = app.get(DI.redis) as jest.Mocked; httpRequestService = app.get(HttpRequestService) as jest.Mocked; }); - afterAll(async () => { + afterEach(async () => { await app.close(); }); @@ -85,6 +83,7 @@ describe('FetchInstanceMetadataService', () => { expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalled(); }); + test('Lock and don\'t update', async () => { redisClient.set = mockRedis(); const now = Date.now(); @@ -98,6 +97,7 @@ describe('FetchInstanceMetadataService', () => { expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); }); + test('Do nothing when lock not acquired', async () => { redisClient.set = mockRedis(); federatedInstanceService.fetch.mockReturnValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } }); diff --git a/packages/backend/test/unit/RoleService.ts b/packages/backend/test/unit/RoleService.ts index fc6e23382b..32a686c83a 100644 --- a/packages/backend/test/unit/RoleService.ts +++ b/packages/backend/test/unit/RoleService.ts @@ -11,7 +11,7 @@ import { Test } from '@nestjs/testing'; import * as lolex from '@sinonjs/fake-timers'; import { GlobalModule } from '@/GlobalModule.js'; import { RoleService } from '@/core/RoleService.js'; -import type { Role, RolesRepository, RoleAssignmentsRepository, UsersRepository, User } from '@/models/index.js'; +import type { MiRole, RolesRepository, RoleAssignmentsRepository, UsersRepository, MiUser } from '@/models/index.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; import { genAid } from '@/misc/id/aid.js'; @@ -34,7 +34,7 @@ describe('RoleService', () => { let metaService: jest.Mocked; let clock: lolex.InstalledClock; - function createUser(data: Partial = {}) { + function createUser(data: Partial = {}) { const un = secureRndstr(16); return usersRepository.insert({ id: genAid(new Date()), @@ -46,7 +46,7 @@ describe('RoleService', () => { .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); } - function createRole(data: Partial = {}) { + function createRole(data: Partial = {}) { return rolesRepository.insert({ id: genAid(new Date()), createdAt: new Date(), @@ -204,7 +204,7 @@ describe('RoleService', () => { createdAt: new Date(Date.now() - (1000 * 60 * 60 * 24 * 365)), followersCount: 10, }); - const role = await createRole({ + await createRole({ name: 'a', policies: { canManageCustomEmojis: { diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 93944a68d5..2b15a5cc7a 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -10,8 +10,8 @@ "declaration": false, "sourceMap": false, "target": "ES2022", - "module": "ESNext", - "moduleResolution": "node16", + "module": "nodenext", + "moduleResolution": "nodenext", "allowSyntheticDefaultImports": true, "removeComments": false, "noLib": false, @@ -33,8 +33,9 @@ "node" ], "typeRoots": [ + "./src/@types", "./node_modules/@types", - "./src/@types" + "./node_modules" ], "lib": [ "esnext" diff --git a/packages/frontend/.storybook/preview-head.html b/packages/frontend/.storybook/preview-head.html index f6a9a4875d..ed38e49647 100644 --- a/packages/frontend/.storybook/preview-head.html +++ b/packages/frontend/.storybook/preview-head.html @@ -1,6 +1,6 @@ - +