refactor(frontend): use ESM
This commit is contained in:
parent
299c9c4118
commit
b0f6c44f36
459 changed files with 1643 additions and 1642 deletions
|
@ -7,11 +7,11 @@
|
|||
* Notification manager for SW
|
||||
*/
|
||||
import type { BadgeNames, PushNotificationDataMap } from '@/types';
|
||||
import { char2fileName } from '@/scripts/twemoji-base';
|
||||
import { cli } from '@/scripts/operations';
|
||||
import { getAccountFromId } from '@/scripts/get-account-from-id';
|
||||
import { swLang } from '@/scripts/lang';
|
||||
import { getUserName } from '@/scripts/get-user-name';
|
||||
import { char2fileName } from '@/scripts/twemoji-base.js';
|
||||
import { cli } from '@/scripts/operations.js';
|
||||
import { getAccountFromId } from '@/scripts/get-account-from-id.js';
|
||||
import { swLang } from '@/scripts/lang.js';
|
||||
import { getUserName } from '@/scripts/get-user-name.js';
|
||||
|
||||
const closeNotificationsByTags = async (tags: string[]): Promise<void> => {
|
||||
for (const n of (await Promise.all(tags.map(tag => globalThis.registration.getNotifications({ tag })))).flat()) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* Language manager for SW
|
||||
*/
|
||||
import { get, set } from 'idb-keyval';
|
||||
import { I18n, type Locale } from '@/scripts/i18n';
|
||||
import { I18n, type Locale } from '@/scripts/i18n.js';
|
||||
|
||||
class SwLang {
|
||||
public cacheName = `mk-cache-${_VERSION_}`;
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
*/
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { SwMessage, SwMessageOrderType } from '@/types';
|
||||
import { getAccountFromId } from '@/scripts/get-account-from-id';
|
||||
import { getUrlWithLoginId } from '@/scripts/login-id';
|
||||
import { getAccountFromId } from '@/scripts/get-account-from-id.js';
|
||||
import { getUrlWithLoginId } from '@/scripts/login-id.js';
|
||||
|
||||
export const cli = new Misskey.api.APIClient({ origin, fetch: (...args): Promise<Response> => fetch(...args) });
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
import { get } from 'idb-keyval';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { PushNotificationDataMap } from '@/types';
|
||||
import { createEmptyNotification, createNotification } from '@/scripts/create-notification';
|
||||
import { swLang } from '@/scripts/lang';
|
||||
import * as swos from '@/scripts/operations';
|
||||
import { createEmptyNotification, createNotification } from '@/scripts/create-notification.js';
|
||||
import { swLang } from '@/scripts/lang.js';
|
||||
import * as swos from '@/scripts/operations.js';
|
||||
|
||||
globalThis.addEventListener('install', () => {
|
||||
// ev.waitUntil(globalThis.skipWaiting());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue