From 837a8e15d893a670ab2ce51b3ec87e6b62a51da7 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: Tue, 10 Sep 2024 18:39:53 +0900 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20frontend-embed/src/to-be-?= =?UTF-8?q?shared=E3=82=92=E5=85=B1=E9=80=9A=E5=8C=96=20(#14536)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): shouldCollapsedを共通化 * refactor(frontend): config.js, worker-multi-dispatch.js, intl-const.jsを共通化 * fix(frontend-shared): fix type error * refactor(frontend): is-link.jsと、同一の振る舞いをする記述を共通化 * fix * fix lint * lint fixes --- packages/frontend-embed/src/boot.ts | 2 +- .../frontend-embed/src/components/EmAcct.vue | 2 +- .../src/components/EmImgWithBlurhash.vue | 2 +- .../frontend-embed/src/components/EmLink.vue | 2 +- .../src/components/EmMention.vue | 2 +- .../frontend-embed/src/components/EmMfm.ts | 2 +- .../frontend-embed/src/components/EmNote.vue | 4 +- .../src/components/EmNoteDetailed.vue | 4 +- .../src/components/EmSubNoteContent.vue | 4 +- .../frontend-embed/src/components/EmTime.vue | 2 +- .../frontend-embed/src/components/EmUrl.vue | 2 +- packages/frontend-embed/src/i18n.ts | 2 +- packages/frontend-embed/src/misskey-api.ts | 2 +- packages/frontend-embed/src/pages/clip.vue | 4 +- packages/frontend-embed/src/pages/tag.vue | 4 +- .../src/pages/user-timeline.vue | 2 +- packages/frontend-embed/src/utils.ts | 2 +- packages/frontend-shared/@types/global.d.ts | 25 ++++++ packages/frontend-shared/eslint.config.js | 6 +- .../js}/collapsed.ts | 4 +- .../src => frontend-shared/js}/config.ts | 14 +++- packages/frontend-shared/js/emoji-base.ts | 4 +- .../js}/intl-const.ts | 3 +- .../js}/is-link.ts | 0 .../js}/worker-multi-dispatch.ts | 12 ++- packages/frontend-shared/tsconfig.json | 7 ++ packages/frontend/src/account.ts | 2 +- packages/frontend/src/boot/common.ts | 2 +- packages/frontend/src/boot/main-boot.ts | 2 +- .../src/components/MkAccountMoved.vue | 2 +- .../src/components/MkCropperDialog.vue | 2 +- .../frontend/src/components/MkDonation.vue | 2 +- .../src/components/MkEmbedCodeGenDialog.vue | 2 +- .../src/components/MkFollowButton.vue | 2 +- .../src/components/MkImgWithBlurhash.vue | 2 +- .../src/components/MkInstanceTicker.vue | 2 +- packages/frontend/src/components/MkLink.vue | 2 +- .../frontend/src/components/MkMention.vue | 2 +- packages/frontend/src/components/MkNote.vue | 15 +--- .../src/components/MkNoteDetailed.vue | 11 +-- .../frontend/src/components/MkPageWindow.vue | 2 +- packages/frontend/src/components/MkPoll.vue | 2 +- .../frontend/src/components/MkPostForm.vue | 2 +- .../frontend/src/components/MkPreview.vue | 2 +- packages/frontend/src/components/MkSignin.vue | 2 +- .../src/components/MkSignupDialog.form.vue | 2 +- .../components/MkSourceCodeAvailablePopup.vue | 2 +- .../src/components/MkSubNoteContent.vue | 2 +- .../src/components/MkTutorialDialog.vue | 2 +- .../frontend/src/components/MkUpdated.vue | 2 +- .../frontend/src/components/MkUrlPreview.vue | 4 +- .../src/components/MkUserSelectDialog.vue | 2 +- .../src/components/MkUserSetupDialog.vue | 2 +- .../src/components/MkVisitorDashboard.vue | 2 +- .../frontend/src/components/MkWidgets.vue | 8 +- .../src/components/MkYouTubePlayer.vue | 2 +- .../frontend/src/components/global/MkA.vue | 2 +- .../frontend/src/components/global/MkAcct.vue | 2 +- .../frontend/src/components/global/MkAd.vue | 2 +- .../global/MkMisskeyFlavoredMarkdown.ts | 2 +- .../components/global/MkTime.stories.impl.ts | 2 +- .../frontend/src/components/global/MkTime.vue | 2 +- .../frontend/src/components/global/MkUrl.vue | 2 +- packages/frontend/src/config.ts | 27 ------ packages/frontend/src/filters/date.ts | 2 +- packages/frontend/src/filters/number.ts | 2 +- packages/frontend/src/filters/user.ts | 2 +- packages/frontend/src/i18n.ts | 2 +- packages/frontend/src/navbar.ts | 2 +- packages/frontend/src/pages/_error_.vue | 2 +- packages/frontend/src/pages/about-misskey.vue | 2 +- .../frontend/src/pages/about.overview.vue | 2 +- packages/frontend/src/pages/admin-user.vue | 2 +- .../frontend/src/pages/admin/branding.vue | 2 +- packages/frontend/src/pages/admin/queue.vue | 2 +- packages/frontend/src/pages/channel.vue | 2 +- packages/frontend/src/pages/clip.vue | 2 +- .../src/pages/drop-and-fusion.game.vue | 2 +- packages/frontend/src/pages/flash/flash.vue | 2 +- packages/frontend/src/pages/gallery/post.vue | 2 +- .../src/pages/page-editor/page-editor.vue | 2 +- packages/frontend/src/pages/page.vue | 2 +- .../frontend/src/pages/reversi/game.board.vue | 2 +- packages/frontend/src/pages/reversi/game.vue | 2 +- packages/frontend/src/pages/role.vue | 2 +- .../frontend/src/pages/settings/general.vue | 2 +- .../pages/settings/preferences-backups.vue | 2 +- packages/frontend/src/pages/theme-editor.vue | 2 +- packages/frontend/src/pages/welcome.setup.vue | 2 +- packages/frontend/src/pages/welcome.vue | 2 +- packages/frontend/src/scripts/aiscript/api.ts | 2 +- packages/frontend/src/scripts/collapsed.ts | 22 ----- .../frontend/src/scripts/gen-search-query.ts | 2 +- .../frontend/src/scripts/get-embed-code.ts | 2 +- .../frontend/src/scripts/get-note-menu.ts | 2 +- .../frontend/src/scripts/get-user-menu.ts | 2 +- .../frontend/src/scripts/initialize-sw.ts | 2 +- packages/frontend/src/scripts/intl-const.ts | 2 +- packages/frontend/src/scripts/is-link.ts | 12 --- packages/frontend/src/scripts/media-proxy.ts | 2 +- packages/frontend/src/scripts/misskey-api.ts | 2 +- .../src/scripts/player-url-transform.ts | 2 +- packages/frontend/src/scripts/popout.ts | 2 +- packages/frontend/src/scripts/upload.ts | 2 +- .../src/scripts/worker-multi-dispatch.ts | 82 ------------------- packages/frontend/src/store.ts | 4 +- packages/frontend/src/stream.ts | 2 +- packages/frontend/src/ui/_common_/common.ts | 2 +- packages/frontend/src/ui/classic.sidebar.vue | 2 +- packages/frontend/src/ui/classic.vue | 10 +-- packages/frontend/src/ui/deck/main-column.vue | 7 +- packages/frontend/src/ui/minimum.vue | 2 +- packages/frontend/src/ui/universal.vue | 9 +- packages/frontend/src/ui/visitor.vue | 2 +- packages/frontend/src/ui/zen.vue | 2 +- .../src/widgets/WidgetInstanceInfo.vue | 2 +- packages/frontend/src/widgets/WidgetRss.vue | 2 +- .../frontend/src/widgets/WidgetRssTicker.vue | 2 +- 118 files changed, 181 insertions(+), 309 deletions(-) create mode 100644 packages/frontend-shared/@types/global.d.ts rename packages/{frontend-embed/src/to-be-shared => frontend-shared/js}/collapsed.ts (86%) rename packages/{frontend-embed/src => frontend-shared/js}/config.ts (58%) rename packages/{frontend-embed/src/to-be-shared => frontend-shared/js}/intl-const.ts (91%) rename packages/{frontend-embed/src/to-be-shared => frontend-shared/js}/is-link.ts (100%) rename packages/{frontend-embed/src/to-be-shared => frontend-shared/js}/worker-multi-dispatch.ts (84%) delete mode 100644 packages/frontend/src/config.ts delete mode 100644 packages/frontend/src/scripts/collapsed.ts delete mode 100644 packages/frontend/src/scripts/is-link.ts delete mode 100644 packages/frontend/src/scripts/worker-multi-dispatch.ts diff --git a/packages/frontend-embed/src/boot.ts b/packages/frontend-embed/src/boot.ts index 6c73fecd7..fcea7d32e 100644 --- a/packages/frontend-embed/src/boot.ts +++ b/packages/frontend-embed/src/boot.ts @@ -17,7 +17,7 @@ import { applyTheme, assertIsTheme } from '@/theme.js'; import { fetchCustomEmojis } from '@/custom-emojis.js'; import { DI } from '@/di.js'; import { serverMetadata } from '@/server-metadata.js'; -import { url } from '@/config.js'; +import { url } from '@@/js/config.js'; import { parseEmbedParams } from '@@/js/embed-page.js'; import { postMessageToParentWindow, setIframeId } from '@/post-message.js'; diff --git a/packages/frontend-embed/src/components/EmAcct.vue b/packages/frontend-embed/src/components/EmAcct.vue index 07315e6a8..6856b8272 100644 --- a/packages/frontend-embed/src/components/EmAcct.vue +++ b/packages/frontend-embed/src/components/EmAcct.vue @@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only