From db2f49cda4b08d9f95bfce01e728e1aaa4d8fdb1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 2 Sep 2023 13:16:05 +0900 Subject: [PATCH 01/45] Update about-misskey.vue --- packages/frontend/src/pages/about-misskey.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend/src/pages/about-misskey.vue b/packages/frontend/src/pages/about-misskey.vue index 3c123c9fd..7cc6040fa 100644 --- a/packages/frontend/src/pages/about-misskey.vue +++ b/packages/frontend/src/pages/about-misskey.vue @@ -285,6 +285,7 @@ const patrons = [ '越貝鯛丸', 'Nick / pprmint.', 'kino3277', + '美少女JKぐーちゃん', ]; let thereIsTreasure = $ref($i && !claimedAchievements.includes('foundTreasure')); From a53727f1a5a4d1fae1a5de600504ba85b6120fc0 Mon Sep 17 00:00:00 2001 From: xtex Date: Sun, 3 Sep 2023 15:42:32 +0800 Subject: [PATCH 02/45] Respond .well-known/host-meta.json with application/json (#11777) According to RFC 6415 appendix-A. The server MUST include the HTTP "Content-Type" response header field with a value of "application/json". Any other "Content-Type" value (or lack thereof) indicates that the server does not support the JRD format. "application/jrd+json" is only used by WebFinger (RFC 7033) --- packages/backend/src/server/WellKnownServerService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/WellKnownServerService.ts b/packages/backend/src/server/WellKnownServerService.ts index 43c8dcf2c..04e1a3a17 100644 --- a/packages/backend/src/server/WellKnownServerService.ts +++ b/packages/backend/src/server/WellKnownServerService.ts @@ -73,7 +73,7 @@ export class WellKnownServerService { }); fastify.get('/.well-known/host-meta.json', async (request, reply) => { - reply.header('Content-Type', jrd); + reply.header('Content-Type', 'application/json'); return { links: [{ rel: 'lrdd', From 1f7a81aae71f85a47393491a7795b953e2427041 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 4 Sep 2023 13:33:38 +0900 Subject: [PATCH 03/45] 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 0eee9d503..861b0008a 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 f281e6c3a..000000000 --- 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 8ab6d204b..000000000 --- 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 6a148f281..7cc206998 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.5.0 +20.5.1 diff --git a/Dockerfile b/Dockerfile index ce9d740ab..678b991e8 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 1c6d089e9..ff9a3ce73 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 8c5b67ced..e3611bec2 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 f9619861b..42ce4de43 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 6b626d398..f751a68cb 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 6f5e5a7f3..63c44e874 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 dc9482f02..5edc0f45a 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 95026099e..d29462874 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 046d4d6c2..c23587193 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 5d5a8f370..b90c8a519 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 557b93472..f7001e41c 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 181aa5e2a..232ec5700 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 56aa34363..75f305be5 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 2b61c6bc2..c2053517d 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 21afe1aaf..4597ff878 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 c97e081ba..f09ae3e2f 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 22ce02321..34200899d 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 fc6e23382..32a686c83 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 93944a68d..2b15a5cc7 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 f6a9a4875..ed38e4964 100644 --- a/packages/frontend/.storybook/preview-head.html +++ b/packages/frontend/.storybook/preview-head.html @@ -1,6 +1,6 @@ - + + - diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index f29995d84..9ee9ac9ba 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -629,6 +629,8 @@ function onDrop(ev): void { } function saveDraft() { + if (props.instant) return; + const draftData = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}'); draftData[draftKey] = { diff --git a/packages/frontend/src/scripts/aiscript/ui.ts b/packages/frontend/src/scripts/aiscript/ui.ts index 3d059b04d..7e17563ec 100644 --- a/packages/frontend/src/scripts/aiscript/ui.ts +++ b/packages/frontend/src/scripts/aiscript/ui.ts @@ -124,7 +124,14 @@ export type AsUiPostFormButton = AsUiComponentBase & { }; }; -export type AsUiComponent = AsUiRoot | AsUiContainer | AsUiText | AsUiMfm | AsUiButton | AsUiButtons | AsUiSwitch | AsUiTextarea | AsUiTextInput | AsUiNumberInput | AsUiSelect | AsUiFolder | AsUiPostFormButton; +export type AsUiPostForm = AsUiComponentBase & { + type: 'postForm'; + form?: { + text: string; + }; +}; + +export type AsUiComponent = AsUiRoot | AsUiContainer | AsUiText | AsUiMfm | AsUiButton | AsUiButtons | AsUiSwitch | AsUiTextarea | AsUiTextInput | AsUiNumberInput | AsUiSelect | AsUiFolder | AsUiPostFormButton | AsUiPostForm; export function patch(id: string, def: values.Value, call: (fn: values.VFn, args: values.Value[]) => Promise) { // TODO @@ -462,6 +469,27 @@ function getPostFormButtonOptions(def: values.Value | undefined, call: (fn: valu }; } +function getPostFormOptions(def: values.Value | undefined, call: (fn: values.VFn, args: values.Value[]) => Promise): Omit { + utils.assertObject(def); + + const form = def.value.get('form'); + if (form) utils.assertObject(form); + + const getForm = () => { + const text = form!.value.get('text'); + utils.assertString(text); + return { + text: text.value, + }; + }; + + return { + form: form ? getForm() : { + text: '', + }, + }; +} + export function registerAsUiLib(components: Ref[], done: (root: Ref) => void) { const instances = {}; @@ -569,5 +597,9 @@ export function registerAsUiLib(components: Ref[], done: (root: R 'Ui:C:postFormButton': values.FN_NATIVE(([def, id], opts) => { return createComponentInstance('postFormButton', def, id, getPostFormButtonOptions, opts.call); }), + + 'Ui:C:postForm': values.FN_NATIVE(([def, id], opts) => { + return createComponentInstance('postForm', def, id, getPostFormOptions, opts.call); + }), }; } From 874971670069976cb2dd6a7bd41ecc3f456379b8 Mon Sep 17 00:00:00 2001 From: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:14:31 +0900 Subject: [PATCH 35/45] =?UTF-8?q?enhance:=20=E3=82=BB=E3=83=B3=E3=82=B7?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=96=E3=83=81=E3=83=A3=E3=83=B3=E3=83=8D?= =?UTF-8?q?=E3=83=AB=E3=81=AF=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E4=B8=80=E8=A6=A7=E3=81=8B=E3=82=89?= =?UTF-8?q?=E9=99=A4=E5=A4=96=20(#11797)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance: センシティブチャンネルはユーザーのノート一覧から除外 * READMEに明記 * Update notes.ts --------- Co-authored-by: syuilo --- CHANGELOG.md | 1 + packages/backend/src/server/api/endpoints/users/notes.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b9ef0d35..fc8524c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - お知らせのアイコンを設定可能に - チャンネルをセンシティブ指定できるようになりました - センシティブチャンネルのNoteのReNoteはデフォルトでHome TLに流れるようになりました + - センシティブチャンネルのノートはユーザープロフィールに表示されません - 二要素認証のバックアップコードが生成されるようになりました ref. https://github.com/MisskeyIO/misskey/pull/121 - 二要素認証でパスキーをサポートするようになりました diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index ace50a54f..d9858eab5 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -80,9 +80,12 @@ export default class extends Endpoint { // eslint- .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote') + .leftJoinAndSelect('note.channel', 'channel') .leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('renote.user', 'renoteUser'); + query.andWhere('channel.isSensitive = false'); + this.queryService.generateVisibilityQuery(query, me); if (me) { this.queryService.generateMutedUserQuery(query, me, user); From 054ba3fea5ea91abaa2ec0c004937ace17b427ed Mon Sep 17 00:00:00 2001 From: xtex Date: Sun, 10 Sep 2023 15:16:00 +0800 Subject: [PATCH 36/45] feat: nodeinfo 2.1 (#11805) * feat: enable nodeinfo 2.1 Since 9dd06a7621d1745b30ed1c2b1d94d34143dd638e, nodeinfo 2.1 has been released. Signed-off-by: xtex * feat: only add software.repository to nodeinfo 2.1 https://github.com/jhass/nodeinfo/commit/e54c48e171b6f6bed6fbe2b6c0bdd8d3c16f7909 Signed-off-by: xtex * feat: add software.homepage url to nodeinfo 2.1 https://github.com/jhass/nodeinfo/commit/507822cb3c16d84dac884d878e32825ade54028d Signed-off-by: xtex * fix: set proper Content-Type for nodeinfo Signed-off-by: xtex * style: fix lint warnings Signed-off-by: xtex --------- Signed-off-by: xtex --- .../src/server/NodeinfoServerService.ts | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 95cc69776..1a1a3bf5a 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -35,10 +35,10 @@ export class NodeinfoServerService { @bindThis public getLinks() { - return [/* (awaiting release) { - rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1', - href: config.url + nodeinfo2_1path - }, */{ + return [{ + rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1', + href: this.config.url + nodeinfo2_1path + }, { rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: this.config.url + nodeinfo2_0path, }]; @@ -46,7 +46,7 @@ export class NodeinfoServerService { @bindThis public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) { - const nodeinfo2 = async () => { + const nodeinfo2 = async (version: number) => { const now = Date.now(); const notesChart = await this.notesChart.getChart('hour', 1, null); @@ -73,11 +73,11 @@ export class NodeinfoServerService { const basePolicies = { ...DEFAULT_POLICIES, ...meta.policies }; - return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const document: any = { software: { name: 'misskey', version: this.config.version, - repository: meta.repositoryUrl, }, protocols: ['activitypub'], services: { @@ -114,23 +114,36 @@ export class NodeinfoServerService { themeColor: meta.themeColor ?? '#86b300', }, }; + if (version >= 21) { + document.software.repository = meta.repositoryUrl; + document.software.homepage = meta.repositoryUrl; + } + return document; }; const cache = new MemorySingleCache>>(1000 * 60 * 10); fastify.get(nodeinfo2_1path, async (request, reply) => { - const base = await cache.fetch(() => nodeinfo2()); + const base = await cache.fetch(() => nodeinfo2(21)); - reply.header('Cache-Control', 'public, max-age=600'); + reply + .type( + 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.1#"', + ) + .header('Cache-Control', 'public, max-age=600'); return { version: '2.1', ...base }; }); fastify.get(nodeinfo2_0path, async (request, reply) => { - const base = await cache.fetch(() => nodeinfo2()); + const base = await cache.fetch(() => nodeinfo2(20)); delete (base as any).software.repository; - reply.header('Cache-Control', 'public, max-age=600'); + reply + .type( + 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.0#"', + ) + .header('Cache-Control', 'public, max-age=600'); return { version: '2.0', ...base }; }); From fd7d7318a7e797b1606fed2541cc2ccbf2948d61 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Sep 2023 16:17:11 +0900 Subject: [PATCH 37/45] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc8524c1c..da10522af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,13 +51,14 @@ - Fix: 他のサーバーのユーザーへ「メッセージを送信」した時の初期テキストのメンションが間違っている問題を修正 ### Server -- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように - cacheRemoteFilesの初期値はfalseになりました - ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善 - Webhookのペイロードにサーバーのurlが含まれるようになりました - Webhook設定でsecretを空に出来るように - 使われていないアンテナの自動停止を設定可能に +- nodeinfo 2.1対応 - 自分へのメンション一覧を取得する際のパフォーマンスを向上 +- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように - Fix: 一部のfeatured noteを照会できない問題を修正 - Fix: muteがapiからのuser list timeline取得で機能しない問題を修正 - Fix: ジョブキュー管理画面の認証を回避できる問題を修正 From 295665a177985e1f7c460e1de23b3d8a96afb2b0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Sep 2023 17:16:50 +0900 Subject: [PATCH 38/45] =?UTF-8?q?enhance(frontend):=20=E3=83=AA=E3=82=A2?= =?UTF-8?q?=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=82=92=E3=82=88=E3=82=8A=E5=A4=A7?= =?UTF-8?q?=E3=81=8D=E3=81=8F=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- locales/index.d.ts | 2 +- locales/ja-JP.yml | 2 +- .../components/MkReactionsViewer.reaction.vue | 34 +++++++++++++------ .../frontend/src/pages/settings/general.vue | 10 ++++-- packages/frontend/src/store.ts | 4 +-- 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b9ef0d35..ef5b55d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,6 @@ - メニューのスイッチの動作を改善 - 絵文字ピッカーの検索の表示件数を100件に増加 - 投稿フォームのプレビューの表示状態を記憶するように -- ノート詳細ページ読み込み時のパフォーマンスを改善 - AiScriptからMisskeyサーバーAPIを呼び出す際の制限を撤廃 - Playで直接投稿フォームを埋め込めるように(`Ui:C:postForm`) - Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように @@ -41,6 +40,8 @@ - Enhance: Renoteを管理者権限で削除可能に - `$[rainbow ]`記法が、動きのあるMFMが無効になっていても使用できるようになりました - Playの操作を行うAPI TokenをAPIコンソールから発行できるように +- リアクションの表示サイズをより大きくできるように +- ノート詳細ページ読み込み時のパフォーマンスを改善 - Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正 - Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正 - Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正 diff --git a/locales/index.d.ts b/locales/index.d.ts index 858736be6..771d5cf87 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1026,7 +1026,7 @@ export interface Locale { "enableChartsForRemoteUser": string; "enableChartsForFederatedInstances": string; "showClipButtonInNoteFooter": string; - "largeNoteReactions": string; + "reactionsDisplaySize": string; "noteIdOrUrl": string; "video": string; "videos": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 7e625b9ac..2b2cad8d7 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1023,7 +1023,7 @@ retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大するこ enableChartsForRemoteUser: "リモートユーザーのチャートを生成" enableChartsForFederatedInstances: "リモートサーバーのチャートを生成" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" -largeNoteReactions: "ノートのリアクションを大きく表示" +reactionsDisplaySize: "リアクションの表示サイズ" noteIdOrUrl: "ノートIDまたはURL" video: "動画" videos: "動画" diff --git a/packages/frontend/src/components/MkReactionsViewer.reaction.vue b/packages/frontend/src/components/MkReactionsViewer.reaction.vue index 2bc88907a..7da579012 100644 --- a/packages/frontend/src/components/MkReactionsViewer.reaction.vue +++ b/packages/frontend/src/components/MkReactionsViewer.reaction.vue @@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only ref="buttonEl" v-ripple="canToggle" class="_button" - :class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: canToggle, [$style.large]: defaultStore.state.largeNoteReactions }]" + :class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: canToggle, [$style.small]: defaultStore.state.reactionsDisplaySize === 'small', [$style.large]: defaultStore.state.reactionsDisplaySize === 'large' }]" @click="toggleReaction()" > @@ -115,10 +115,11 @@ useTooltip(buttonEl, async (showing) => { diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 3b39a5c00..85a3a2e2e 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -40,13 +40,18 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.showNoteActionsOnlyHover }} {{ i18n.ts.showClipButtonInNoteFooter }} - {{ i18n.ts.largeNoteReactions }} {{ i18n.ts.collapseRenotes }} {{ i18n.ts.enableAdvancedMfm }} {{ i18n.ts.enableAnimatedMfm }} {{ i18n.ts.showGapBetweenNotesInTimeline }} {{ i18n.ts.loadRawImages }} {{ i18n.ts.useReactionPickerForContextMenu }} + + + + + +
@@ -204,7 +209,7 @@ const overridedDeviceKind = computed(defaultStore.makeGetterSetter('overridedDev const serverDisconnectedBehavior = computed(defaultStore.makeGetterSetter('serverDisconnectedBehavior')); const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNoteActionsOnlyHover')); const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter')); -const largeNoteReactions = computed(defaultStore.makeGetterSetter('largeNoteReactions')); +const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize')); const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes')); const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v)); const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal')); @@ -264,6 +269,7 @@ watch([ instanceTicker, overridedDeviceKind, mediaListWithOneImageAppearance, + reactionsDisplaySize, ], async () => { await reloadAsk(); }); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 2b7a16b6b..787a584f8 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -316,9 +316,9 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: false, }, - largeNoteReactions: { + reactionsDisplaySize: { where: 'device', - default: false, + default: 'medium' as 'small' | 'medium' | 'large', }, forceShowAds: { where: 'device', From 85078601c2a98eef5683816783bc738ce319f201 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Sep 2023 17:40:59 +0900 Subject: [PATCH 39/45] enhance(frontend): cache user lists / antennas --- CHANGELOG.md | 1 + packages/frontend/src/local-storage.ts | 10 ++++++++++ packages/frontend/src/pages/timeline.vue | 17 +++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f950c46..b0ca091ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - Playの操作を行うAPI TokenをAPIコンソールから発行できるように - リアクションの表示サイズをより大きくできるように - ノート詳細ページ読み込み時のパフォーマンスを改善 +- タイムラインでリスト/アンテナ選択時のパフォーマンスを改善 - Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正 - Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正 - Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正 diff --git a/packages/frontend/src/local-storage.ts b/packages/frontend/src/local-storage.ts index d9dce2859..f4c11d613 100644 --- a/packages/frontend/src/local-storage.ts +++ b/packages/frontend/src/local-storage.ts @@ -30,6 +30,8 @@ type Keys = 'message_drafts' | 'scratchpad' | 'debug' | + 'userListsCache' | + 'antennasCache' | `miux:${string}` | `ui:folder:${string}` | `themes:${string}` | @@ -41,4 +43,12 @@ export const miLocalStorage = { getItem: (key: Keys): string | null => window.localStorage.getItem(key), setItem: (key: Keys, value: string): void => window.localStorage.setItem(key, value), removeItem: (key: Keys): void => window.localStorage.removeItem(key), + getItemAsJson: (key: Keys): any | undefined => { + const item = miLocalStorage.getItem(key); + if (item === null) { + return undefined; + } + return JSON.parse(item); + }, + setItemAsJson: (key: Keys, value: any): void => window.localStorage.setItem(key, JSON.stringify(value)), }; diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index f5fadb389..3ec4a6788 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -38,6 +38,7 @@ import { i18n } from '@/i18n'; import { instance } from '@/instance'; import { $i } from '@/account'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { miLocalStorage } from '@/local-storage'; provide('shouldOmitHeaderTitle', true); @@ -67,17 +68,24 @@ function top(): void { } async function chooseList(ev: MouseEvent): Promise { - const lists = await os.api('users/lists/list'); + const cachedLists = miLocalStorage.getItemAsJson('userListsCache'); + const lists = cachedLists ?? await os.api('users/lists/list'); const items = lists.map(list => ({ type: 'link' as const, text: list.name, to: `/timeline/list/${list.id}`, })); os.popupMenu(items, ev.currentTarget ?? ev.target); + if (cachedLists == null) { + miLocalStorage.setItemAsJson('userListsCache', lists); + } else { + miLocalStorage.setItemAsJson('userListsCache', await os.api('users/lists/list')); + } } async function chooseAntenna(ev: MouseEvent): Promise { - const antennas = await os.api('antennas/list'); + const cachedAntennas = miLocalStorage.getItemAsJson('antennasCache'); + const antennas = cachedAntennas ?? await os.api('antennas/list'); const items = antennas.map(antenna => ({ type: 'link' as const, text: antenna.name, @@ -85,6 +93,11 @@ async function chooseAntenna(ev: MouseEvent): Promise { to: `/timeline/antenna/${antenna.id}`, })); os.popupMenu(items, ev.currentTarget ?? ev.target); + if (cachedAntennas == null) { + miLocalStorage.setItemAsJson('antennasCache', antennas); + } else { + miLocalStorage.setItemAsJson('antennasCache', await os.api('antennas/list')); + } } async function chooseChannel(ev: MouseEvent): Promise { From c0838c473f3d51610d3545f5d4d8fe0dcb50567d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:40:20 +0900 Subject: [PATCH 40/45] =?UTF-8?q?enhance(frontend):=20=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=82=BB=E3=83=BC=E3=83=90=E3=83=BC=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=A7=E9=9A=A0=E3=82=8C=E3=82=8B=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E3=82=92=E5=A2=97=E3=82=84=E3=81=99=E7=AD=89=20(#11806)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance datasaver mode * サムネイルがないとき変な角丸にならんようにする * Avoid using wildcard selector * Avoid wildcard * Update MkMediaImage.vue * (fix) ノートの画像プレビューがでない * (fix) recent pages design --------- Co-authored-by: syuilo --- CHANGELOG.md | 1 + .../frontend/src/components/MkMediaImage.vue | 39 ++++++++++++----- .../frontend/src/components/MkPagePreview.vue | 43 ++++++++++--------- .../frontend/src/components/MkUrlPreview.vue | 3 +- .../src/components/page/page.image.vue | 12 ++++-- .../frontend/src/components/page/page.vue | 2 +- packages/frontend/src/pages/page.vue | 30 ++++++++++--- 7 files changed, 87 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ca091ad..cf78b54f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - Enhance: ノート検索にローカルのみ検索可能なオプションの追加 - Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように - Enhance: Renote自体を通報できるように +- Enhance: データセーバーモードの強化 - Enhance: Renoteを管理者権限で削除可能に - `$[rainbow ]`記法が、動きのあるMFMが無効になっていても使用できるようになりました - Playの操作を行うAPI TokenをAPIコンソールから発行できるように diff --git a/packages/frontend/src/components/MkMediaImage.vue b/packages/frontend/src/components/MkMediaImage.vue index edfd6a72e..346d76301 100644 --- a/packages/frontend/src/components/MkMediaImage.vue +++ b/packages/frontend/src/components/MkMediaImage.vue @@ -5,33 +5,40 @@ SPDX-License-Identifier: AGPL-3.0-only