diff --git a/CHANGELOG.md b/CHANGELOG.md index 683c0a85a5..d96556ec0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ - AiScriptを0.16.0に更新 - Mk:apiが失敗した時にエラー型の値(AiScript 0.16.0で追加)を返すように - タイムラインでリスト/アンテナ選択時のパフォーマンスを改善 +- ScratchpadでAsync:系関数やボタンのコールバックなどのエラーにもダイアログを出すように(試験的なためPlayなどには未実装) - 「Moderation note」、「Add moderation note」をローカライズできるように - 新しい実績を追加 - Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正 diff --git a/packages/frontend/@types/theme.d.ts b/packages/frontend/@types/theme.d.ts index 906c3ec723..8590da07ee 100644 --- a/packages/frontend/@types/theme.d.ts +++ b/packages/frontend/@types/theme.d.ts @@ -4,7 +4,7 @@ */ declare module '@/themes/*.json5' { - import { Theme } from '@/scripts/theme'; + import { Theme } from '@/scripts/theme.js'; const theme: Theme; diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 125a40ef52..3c0197538d 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -1,6 +1,7 @@ { "name": "frontend", "private": true, + "type": "module", "scripts": { "watch": "vite", "build": "vite build", @@ -102,6 +103,7 @@ "@types/matter-js": "0.19.0", "@types/micromatch": "4.0.2", "@types/node": "20.6.0", + "@types/prismjs": "^1.26.0", "@types/punycode": "2.1.0", "@types/sanitize-html": "2.9.0", "@types/throttle-debounce": "5.0.0", diff --git a/packages/frontend/src/_boot_.ts b/packages/frontend/src/_boot_.ts index 6ce5edf50b..61fd95f200 100644 --- a/packages/frontend/src/_boot_.ts +++ b/packages/frontend/src/_boot_.ts @@ -8,8 +8,8 @@ import 'vite/modulepreload-polyfill'; import '@/style.scss'; import '@/Temml-Latin-Modern.css'; -import { mainBoot } from './boot/main-boot'; -import { subBoot } from './boot/sub-boot'; +import { mainBoot } from '@/boot/main-boot.js'; +import { subBoot } from '@/boot/sub-boot.js'; const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete']; diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index 52c37cc152..3c46fca73d 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -5,15 +5,15 @@ import { defineAsyncComponent, reactive, ref } from 'vue'; import * as Misskey from 'cherrypick-js'; -import * as os from '@/os'; -import { showSuspendedDialog } from './scripts/show-suspended-dialog'; -import { i18n } from './i18n'; -import { miLocalStorage } from './local-storage'; -import { MenuButton } from './types/menu'; -import { del, get, set } from '@/scripts/idb-proxy'; -import { apiUrl } from '@/config'; -import { waiting, api, popup, popupMenu, success, alert } from '@/os'; -import { unisonReload, reloadChannel } from '@/scripts/unison-reload'; +import * as os from '@/os.js'; +import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js'; +import { i18n } from '@/i18n.js'; +import { miLocalStorage } from '@/local-storage.js'; +import { MenuButton } from '@/types/menu.js'; +import { del, get, set } from '@/scripts/idb-proxy.js'; +import { apiUrl } from '@/config.js'; +import { waiting, api, popup, popupMenu, success, alert } from '@/os.js'; +import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js'; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 058170e88f..8d6b432dcb 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -5,26 +5,26 @@ import { computed, createApp, watch, markRaw, version as vueVersion, defineAsyncComponent, App } from 'vue'; import { compareVersions } from 'compare-versions'; -import widgets from '@/widgets'; -import directives from '@/directives'; -import components from '@/components'; -import { version, ui, lang, updateLocale } from '@/config'; -import { applyTheme } from '@/scripts/theme'; -import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; -import { i18n, updateI18n } from '@/i18n'; -import { confirm, alert, post, popup, toast } from '@/os'; -import { $i, refreshAccount, login, updateAccount, signout } from '@/account'; -import { defaultStore, ColdDeviceStorage } from '@/store'; -import { fetchInstance, instance } from '@/instance'; -import { deviceKind } from '@/scripts/device-kind'; -import { reloadChannel } from '@/scripts/unison-reload'; -import { reactionPicker } from '@/scripts/reaction-picker'; -import { getUrlWithoutLoginId } from '@/scripts/login-id'; -import { getAccountFromId } from '@/scripts/get-account-from-id'; -import { deckStore } from '@/ui/deck/deck-store'; -import { miLocalStorage } from '@/local-storage'; -import { fetchCustomEmojis } from '@/custom-emojis'; -import { mainRouter } from '@/router'; +import widgets from '@/widgets/index.js'; +import directives from '@/directives/index.js'; +import components from '@/components/index.js'; +import { version, ui, lang, updateLocale } from '@/config.js'; +import { applyTheme } from '@/scripts/theme.js'; +import { isDeviceDarkmode } from '@/scripts/is-device-darkmode.js'; +import { i18n, updateI18n } from '@/i18n.js'; +import { confirm, alert, post, popup, toast } from '@/os.js'; +import { $i, refreshAccount, login, updateAccount, signout } from '@/account.js'; +import { defaultStore, ColdDeviceStorage } from '@/store.js'; +import { fetchInstance, instance } from '@/instance.js'; +import { deviceKind } from '@/scripts/device-kind.js'; +import { reloadChannel } from '@/scripts/unison-reload.js'; +import { reactionPicker } from '@/scripts/reaction-picker.js'; +import { getUrlWithoutLoginId } from '@/scripts/login-id.js'; +import { getAccountFromId } from '@/scripts/get-account-from-id.js'; +import { deckStore } from '@/ui/deck/deck-store.js'; +import { miLocalStorage } from '@/local-storage.js'; +import { fetchCustomEmojis } from '@/custom-emojis.js'; +import { mainRouter } from '@/router.js'; export async function common(createVue: () => App) { console.info(`CherryPick v${version}`); diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 912a1db7cb..1d527f7a52 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -4,22 +4,22 @@ */ import { computed, createApp, watch, markRaw, version as vueVersion, defineAsyncComponent } from 'vue'; -import { common } from './common'; -import { version, ui, lang, updateLocale } from '@/config'; -import { i18n, updateI18n } from '@/i18n'; -import { confirm, alert, post, popup, welcomeToast } from '@/os'; -import { useStream } from '@/stream'; -import * as sound from '@/scripts/sound'; -import { $i, refreshAccount, login, updateAccount, signout } from '@/account'; -import { defaultStore, ColdDeviceStorage } from '@/store'; -import { makeHotkey } from '@/scripts/hotkey'; -import { reactionPicker } from '@/scripts/reaction-picker'; -import { miLocalStorage } from '@/local-storage'; -import { claimAchievement, claimedAchievements } from '@/scripts/achievements'; -import { mainRouter } from '@/router'; -import { initializeSw } from '@/scripts/initialize-sw'; -import { deckStore } from '@/ui/deck/deck-store'; -import { userName } from '@/filters/user'; +import { common } from './common.js'; +import { version, ui, lang, updateLocale } from '@/config.js'; +import { i18n, updateI18n } from '@/i18n.js'; +import { confirm, alert, post, popup, welcomeToast } from '@/os.js'; +import { useStream } from '@/stream.js'; +import * as sound from '@/scripts/sound.js'; +import { $i, refreshAccount, login, updateAccount, signout } from '@/account.js'; +import { defaultStore, ColdDeviceStorage } from '@/store.js'; +import { makeHotkey } from '@/scripts/hotkey.js'; +import { reactionPicker } from '@/scripts/reaction-picker.js'; +import { miLocalStorage } from '@/local-storage.js'; +import { claimAchievement, claimedAchievements } from '@/scripts/achievements.js'; +import { mainRouter } from '@/router.js'; +import { initializeSw } from '@/scripts/initialize-sw.js'; +import { deckStore } from '@/ui/deck/deck-store.js'; +import { userName } from '@/filters/user.js'; export async function mainBoot() { const { isClientUpdated } = await common(() => createApp( diff --git a/packages/frontend/src/boot/sub-boot.ts b/packages/frontend/src/boot/sub-boot.ts index 40ae540776..2f9a9943bd 100644 --- a/packages/frontend/src/boot/sub-boot.ts +++ b/packages/frontend/src/boot/sub-boot.ts @@ -4,7 +4,7 @@ */ import { computed, createApp, watch, markRaw, version as vueVersion, defineAsyncComponent } from 'vue'; -import { common } from './common'; +import { common } from './common.js'; export async function subBoot() { const { isClientUpdated } = await common(() => createApp( diff --git a/packages/frontend/src/cache.ts b/packages/frontend/src/cache.ts index 1ec689f71e..c10ae24782 100644 --- a/packages/frontend/src/cache.ts +++ b/packages/frontend/src/cache.ts @@ -4,8 +4,8 @@ */ import * as Misskey from 'cherrypick-js'; -import { Cache } from '@/scripts/cache'; -import { api } from '@/os'; +import { Cache } from '@/scripts/cache.js'; +import { api } from '@/os.js'; export const clipsCache = new Cache(1000 * 60 * 30, () => api('clips/list')); export const rolesCache = new Cache(1000 * 60 * 30, () => api('admin/roles/list')); diff --git a/packages/frontend/src/components/MkAbuseReport.vue b/packages/frontend/src/components/MkAbuseReport.vue index 73222740e4..9e9a4b7257 100644 --- a/packages/frontend/src/components/MkAbuseReport.vue +++ b/packages/frontend/src/components/MkAbuseReport.vue @@ -44,9 +44,9 @@ SPDX-License-Identifier: AGPL-3.0-only import MkButton from '@/components/MkButton.vue'; import MkSwitch from '@/components/MkSwitch.vue'; import MkKeyValue from '@/components/MkKeyValue.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; -import { dateString } from '@/filters/date'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; +import { dateString } from '@/filters/date.js'; const props = defineProps<{ report: any; diff --git a/packages/frontend/src/components/MkAbuseReportResolver.vue b/packages/frontend/src/components/MkAbuseReportResolver.vue index c2d2735e61..0de2062b99 100644 --- a/packages/frontend/src/components/MkAbuseReportResolver.vue +++ b/packages/frontend/src/components/MkAbuseReportResolver.vue @@ -46,7 +46,7 @@ import { highlight, languages } from 'prismjs/components/prism-core'; import MkInput from '@/components/MkInput.vue'; import MkSelect from '@/components/MkSelect.vue'; import MkSwitch from '@/components/MkSwitch.vue'; -import { i18n } from '@/i18n'; +import { i18n } from '@/i18n.js'; import 'vue-prism-editor/dist/prismeditor.min.css'; import 'prismjs/components/prism-clike'; import 'prismjs/components/prism-regex'; diff --git a/packages/frontend/src/components/MkAbuseReportWindow.vue b/packages/frontend/src/components/MkAbuseReportWindow.vue index d308c166a1..c463c1c9eb 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.vue +++ b/packages/frontend/src/components/MkAbuseReportWindow.vue @@ -35,8 +35,8 @@ import * as Misskey from 'cherrypick-js'; import MkWindow from '@/components/MkWindow.vue'; import MkTextarea from '@/components/MkTextarea.vue'; import MkButton from '@/components/MkButton.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; const props = defineProps<{ user: Misskey.entities.User; diff --git a/packages/frontend/src/components/MkAccountMoved.vue b/packages/frontend/src/components/MkAccountMoved.vue index 85b92a0c0f..ab8df3ece8 100644 --- a/packages/frontend/src/components/MkAccountMoved.vue +++ b/packages/frontend/src/components/MkAccountMoved.vue @@ -15,9 +15,9 @@ SPDX-License-Identifier: AGPL-3.0-only import { ref } from 'vue'; import * as Misskey from 'cherrypick-js'; import MkMention from './MkMention.vue'; -import { i18n } from '@/i18n'; -import { host as localHost } from '@/config'; -import { api } from '@/os'; +import { i18n } from '@/i18n.js'; +import { host as localHost } from '@/config.js'; +import { api } from '@/os.js'; const user = ref(); diff --git a/packages/frontend/src/components/MkAchievements.stories.impl.ts b/packages/frontend/src/components/MkAchievements.stories.impl.ts index 6e7a270374..be608f150e 100644 --- a/packages/frontend/src/components/MkAchievements.stories.impl.ts +++ b/packages/frontend/src/components/MkAchievements.stories.impl.ts @@ -9,7 +9,7 @@ import { rest } from 'msw'; import { userDetailed } from '../../.storybook/fakes'; import { commonHandlers } from '../../.storybook/mocks'; import MkAchievements from './MkAchievements.vue'; -import { ACHIEVEMENT_TYPES } from '@/scripts/achievements'; +import { ACHIEVEMENT_TYPES } from '@/scripts/achievements.js'; export const Empty = { render(args) { return { diff --git a/packages/frontend/src/components/MkAchievements.vue b/packages/frontend/src/components/MkAchievements.vue index 4f1e98c3a9..c679d105bb 100644 --- a/packages/frontend/src/components/MkAchievements.vue +++ b/packages/frontend/src/components/MkAchievements.vue @@ -54,9 +54,9 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkMfmCheatSheetDialog.vue b/packages/frontend/src/components/MkMfmCheatSheetDialog.vue index bfa78d126b..dbec743ac8 100644 --- a/packages/frontend/src/components/MkMfmCheatSheetDialog.vue +++ b/packages/frontend/src/components/MkMfmCheatSheetDialog.vue @@ -15,7 +15,7 @@ import { shallowRef } from 'vue'; import MkModalWindow from '@/components/MkModalWindow.vue'; import XMfmCheatSheet from '@/pages/mfm-cheat-sheet.vue'; -import { i18n } from '@/i18n'; +import { i18n } from '@/i18n.js'; const emit = defineEmits<{ (ev: 'done'): void; diff --git a/packages/frontend/src/components/MkMiniChart.vue b/packages/frontend/src/components/MkMiniChart.vue index c517894106..08cfff5285 100644 --- a/packages/frontend/src/components/MkMiniChart.vue +++ b/packages/frontend/src/components/MkMiniChart.vue @@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only import { watch } from 'vue'; import { v4 as uuid } from 'uuid'; import tinycolor from 'tinycolor2'; -import { useInterval } from '@/scripts/use-interval'; +import { useInterval } from '@/scripts/use-interval.js'; const props = defineProps<{ src: number[]; diff --git a/packages/frontend/src/components/MkModal.vue b/packages/frontend/src/components/MkModal.vue index c1eda0ca91..af53c895eb 100644 --- a/packages/frontend/src/components/MkModal.vue +++ b/packages/frontend/src/components/MkModal.vue @@ -43,10 +43,10 @@ SPDX-License-Identifier: AGPL-3.0-only