diff --git a/packages/frontend/@types/theme.d.ts b/packages/frontend/@types/theme.d.ts index f4ba42b89d..376bbb0e9c 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 d38611c2fc..a89bd84ff0 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", diff --git a/packages/frontend/src/_boot_.ts b/packages/frontend/src/_boot_.ts index a397e57ad3..efb78fe447 100644 --- a/packages/frontend/src/_boot_.ts +++ b/packages/frontend/src/_boot_.ts @@ -7,8 +7,8 @@ import 'vite/modulepreload-polyfill'; import '@/style.scss'; -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 43bda37b6c..0e4e4b50ff 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -5,14 +5,14 @@ import { defineAsyncComponent, reactive, ref } from 'vue'; import * as Misskey from 'misskey-js'; -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 { 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 8f5de88ccd..2175bd1a7f 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(`Misskey v${version}`); diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 9ab1f6e14c..f2af951d63 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -4,21 +4,21 @@ */ 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, toast } 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 { common } from './common.js'; +import { version, ui, lang, updateLocale } from '@/config.js'; +import { i18n, updateI18n } from '@/i18n.js'; +import { confirm, alert, post, popup, toast } 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'; 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 2cc19f2df3..9b4670e130 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 1f3d28ba57..25d2b3c15f 100644 --- a/packages/frontend/src/cache.ts +++ b/packages/frontend/src/cache.ts @@ -4,8 +4,8 @@ */ import * as Misskey from 'misskey-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 cb97875bcd..66114b8734 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/MkAbuseReportWindow.vue b/packages/frontend/src/components/MkAbuseReportWindow.vue index 6e0dee6973..7814681ea2 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.vue +++ b/packages/frontend/src/components/MkAbuseReportWindow.vue @@ -35,8 +35,8 @@ import * as Misskey from 'misskey-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 e68efb1a3b..155d9fe3a9 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 'misskey-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 fd971e5ac6..a67e1def13 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 f9d62773f5..bea0ed26d8 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/MkMiniChart.vue b/packages/frontend/src/components/MkMiniChart.vue index eee1e10399..8d2a147306 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 4ba078d4eb..ec5039c504 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