kopia lustrzana https://github.com/elk-zone/elk
chore: migrate to projects + fix type issues
rodzic
7f7b480e7d
commit
b8289c3c79
|
|
@ -0,0 +1,19 @@
|
|||
export {}
|
||||
|
||||
declare module '#app' {
|
||||
interface PageMeta {
|
||||
wideLayout?: boolean
|
||||
}
|
||||
|
||||
interface RuntimeNuxtHooks {
|
||||
'elk-logo:click': () => void
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Process {
|
||||
mock?: Record<string, any>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,11 +19,11 @@ export default defineNuxtPlugin(async (nuxt) => {
|
|||
if (!supportLanguages.includes(lang.value))
|
||||
userSettings.value.language = getDefaultLanguage(supportLanguages)
|
||||
|
||||
if (lang.value !== i18n.locale)
|
||||
if (lang.value !== i18n.locale.value)
|
||||
await setLocale(userSettings.value.language as Locale)
|
||||
|
||||
watch([lang, isHydrated], () => {
|
||||
if (isHydrated.value && lang.value !== i18n.locale)
|
||||
if (isHydrated.value && lang.value !== i18n.locale.value)
|
||||
setLocale(lang.value)
|
||||
}, { immediate: true })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,13 +75,11 @@ export const countryLocaleVariants: Record<string, (LocaleObjectData & { country
|
|||
|
||||
const locales: LocaleObjectData[] = [
|
||||
{
|
||||
// @ts-expect-error en used as placeholder
|
||||
code: 'en',
|
||||
file: 'en.json',
|
||||
name: 'English',
|
||||
},
|
||||
{
|
||||
// @ts-expect-error ar used as placeholder
|
||||
code: 'ar',
|
||||
file: 'ar.json',
|
||||
name: 'العربية',
|
||||
|
|
@ -112,7 +110,6 @@ const locales: LocaleObjectData[] = [
|
|||
},
|
||||
} satisfies LocaleObjectData,
|
||||
{
|
||||
// @ts-expect-error ca used as placeholder
|
||||
code: 'ca',
|
||||
file: 'ca.json',
|
||||
name: 'Català',
|
||||
|
|
@ -153,7 +150,6 @@ const locales: LocaleObjectData[] = [
|
|||
name: 'Nederlands',
|
||||
},
|
||||
{
|
||||
// @ts-expect-error es used as placeholder
|
||||
code: 'es',
|
||||
file: 'es.json',
|
||||
name: 'Español',
|
||||
|
|
@ -207,7 +203,6 @@ const locales: LocaleObjectData[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
// @ts-expect-error pt used as placeholder
|
||||
code: 'pt',
|
||||
file: 'pt.json',
|
||||
name: 'Português',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { BuildInfo } from '#shared/types'
|
||||
import type { BuildInfo } from '../shared/types'
|
||||
import { createResolver, defineNuxtModule } from 'nuxt/kit'
|
||||
import { isCI } from 'std-env'
|
||||
import { getEnv, version } from '../config/env'
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export default defineNuxtConfig({
|
|||
compatibilityDate: '2025-07-11',
|
||||
typescript: {
|
||||
tsConfig: {
|
||||
include: ['../tests/nuxt'],
|
||||
exclude: ['../service-worker'],
|
||||
compilerOptions: {
|
||||
// TODO: enable this once we fix the issues
|
||||
|
|
@ -323,25 +324,6 @@ export default defineNuxtConfig({
|
|||
},
|
||||
})
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line ts/no-namespace
|
||||
namespace NodeJS {
|
||||
interface Process {
|
||||
mock?: Record<string, any>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module '#app' {
|
||||
interface PageMeta {
|
||||
wideLayout?: boolean
|
||||
}
|
||||
|
||||
interface RuntimeNuxtHooks {
|
||||
'elk-logo:click': () => void
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@nuxt/schema' {
|
||||
interface AppConfig {
|
||||
storage: any
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
"generate": "nuxt generate",
|
||||
"test:unit": "vitest",
|
||||
"test:unit:ci": "vitest run",
|
||||
"test:typecheck": "vue-tsc --noEmit && vue-tsc --noEmit --project service-worker/tsconfig.json",
|
||||
"test:typecheck": "vue-tsc -b --noEmit",
|
||||
"test": "nr test:unit",
|
||||
"test:ci": "nr test:unit:ci",
|
||||
"update:team:avatars": "tsx scripts/avatars.ts",
|
||||
|
|
@ -61,6 +61,7 @@
|
|||
"@tiptap/suggestion": "2.2.4",
|
||||
"@tiptap/vue-3": "2.2.4",
|
||||
"@unhead/schema": "^2.0.17",
|
||||
"@unlazy/nuxt": "^0.12.4",
|
||||
"@unocss/nuxt": "^66.5.2",
|
||||
"@upstash/redis": "^1.27.1",
|
||||
"@vercel/kv": "^3.0.0",
|
||||
|
|
@ -71,6 +72,7 @@
|
|||
"@vueuse/math": "^12.0.0",
|
||||
"@vueuse/motion": "2.2.6",
|
||||
"@vueuse/nuxt": "^13.9.0",
|
||||
"@vueuse/shared": "^13.9.0",
|
||||
"blurhash": "^2.0.5",
|
||||
"browser-fs-access": "^0.38.0",
|
||||
"cheerio": "^1.0.0",
|
||||
|
|
@ -93,6 +95,7 @@
|
|||
"masto": "^6.10.4",
|
||||
"mocked-exports": "^0.1.1",
|
||||
"node-emoji": "^2.1.3",
|
||||
"nuxt": "^4.1.2",
|
||||
"nuxt-security": "^2.4.0",
|
||||
"page-lifecycle": "^0.1.2",
|
||||
"pathe": "^2.0.3",
|
||||
|
|
@ -115,6 +118,7 @@
|
|||
"unstorage": "^1.17.1",
|
||||
"vite": "^7.1.7",
|
||||
"vite-plugin-pwa": "^0.21.0",
|
||||
"vue": "^3.5.4",
|
||||
"vue-advanced-cropper": "^2.8.9",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||
"workbox-build": "^7.1.1",
|
||||
|
|
@ -136,7 +140,6 @@
|
|||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/wicg-file-system-access": "^2023.10.6",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@unlazy/nuxt": "^0.12.4",
|
||||
"@unocss/eslint-config": "^66.4.2",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
"bumpp": "^10.2.3",
|
||||
|
|
@ -146,7 +149,6 @@
|
|||
"flat": "^6.0.1",
|
||||
"fs-extra": "^11.3.1",
|
||||
"lint-staged": "^16.1.6",
|
||||
"nuxt": "^4.1.2",
|
||||
"prettier": "^3.6.2",
|
||||
"sharp": "^0.34.3",
|
||||
"sharp-ico": "^0.1.5",
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ importers:
|
|||
'@unhead/schema':
|
||||
specifier: ^2.0.17
|
||||
version: 2.0.17
|
||||
'@unlazy/nuxt':
|
||||
specifier: ^0.12.4
|
||||
version: 0.12.4(magicast@0.3.5)
|
||||
'@unocss/nuxt':
|
||||
specifier: ^66.5.2
|
||||
version: 66.5.2(magicast@0.3.5)(postcss@8.5.6)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(webpack@5.101.3(esbuild@0.25.10))
|
||||
|
|
@ -129,6 +132,9 @@ importers:
|
|||
'@vueuse/nuxt':
|
||||
specifier: ^13.9.0
|
||||
version: 13.9.0(magicast@0.3.5)(nuxt@4.1.2(@parcel/watcher@2.5.1)(@types/node@24.5.2)(@upstash/redis@1.35.4)(@vercel/kv@3.0.0)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.4.1)(db0@0.3.2(better-sqlite3@12.4.1))(eslint@9.36.0(jiti@2.6.0))(idb-keyval@6.2.2)(ioredis@5.8.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.2)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@2.2.12(typescript@5.9.2))(yaml@2.8.1))(vue@3.5.22(typescript@5.9.2))
|
||||
'@vueuse/shared':
|
||||
specifier: ^13.9.0
|
||||
version: 13.9.0(vue@3.5.22(typescript@5.9.2))
|
||||
blurhash:
|
||||
specifier: ^2.0.5
|
||||
version: 2.0.5
|
||||
|
|
@ -195,6 +201,9 @@ importers:
|
|||
node-emoji:
|
||||
specifier: ^2.1.3
|
||||
version: 2.2.0
|
||||
nuxt:
|
||||
specifier: ^4.1.2
|
||||
version: 4.1.2(@parcel/watcher@2.5.1)(@types/node@24.5.2)(@upstash/redis@1.35.4)(@vercel/kv@3.0.0)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.4.1)(db0@0.3.2(better-sqlite3@12.4.1))(eslint@9.36.0(jiti@2.6.0))(idb-keyval@6.2.2)(ioredis@5.8.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.2)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@2.2.12(typescript@5.9.2))(yaml@2.8.1)
|
||||
nuxt-security:
|
||||
specifier: ^2.4.0
|
||||
version: 2.4.0(magicast@0.3.5)(rollup@4.52.2)
|
||||
|
|
@ -261,6 +270,9 @@ importers:
|
|||
vite-plugin-pwa:
|
||||
specifier: ^0.21.0
|
||||
version: 0.21.2(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(workbox-build@7.3.0)(workbox-window@7.3.0)
|
||||
vue:
|
||||
specifier: ^3.5.4
|
||||
version: 3.5.22(typescript@5.9.2)
|
||||
vue-advanced-cropper:
|
||||
specifier: ^2.8.9
|
||||
version: 2.8.9(vue@3.5.22(typescript@5.9.2))
|
||||
|
|
@ -319,9 +331,6 @@ importers:
|
|||
'@types/ws':
|
||||
specifier: ^8.18.1
|
||||
version: 8.18.1
|
||||
'@unlazy/nuxt':
|
||||
specifier: ^0.12.4
|
||||
version: 0.12.4(magicast@0.3.5)
|
||||
'@unocss/eslint-config':
|
||||
specifier: ^66.4.2
|
||||
version: 66.5.2(eslint@9.36.0(jiti@2.6.0))(typescript@5.9.2)
|
||||
|
|
@ -349,9 +358,6 @@ importers:
|
|||
lint-staged:
|
||||
specifier: ^16.1.6
|
||||
version: 16.2.1
|
||||
nuxt:
|
||||
specifier: ^4.1.2
|
||||
version: 4.1.2(@parcel/watcher@2.5.1)(@types/node@24.5.2)(@upstash/redis@1.35.4)(@vercel/kv@3.0.0)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.4.1)(db0@0.3.2(better-sqlite3@12.4.1))(eslint@9.36.0(jiti@2.6.0))(idb-keyval@6.2.2)(ioredis@5.8.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.2)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@2.2.12(typescript@5.9.2))(yaml@2.8.1)
|
||||
prettier:
|
||||
specifier: ^3.6.2
|
||||
version: 3.6.2
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"extends": "../.nuxt/tsconfig.app.json",
|
||||
"noEmit": true,
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "WebWorker", "DOM.Iterable"],
|
||||
"types": ["vite/client"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{"root":["./elk-sw.ts","./notification.ts","./share-target.ts","./types.ts","./web-push-notifications.ts"],"version":"5.9.2"}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference lib="WebWorker" />
|
||||
/// <reference types="vite/client" />
|
||||
import type { PushPayload } from '~~/service-worker/types'
|
||||
import type { PushPayload } from './types'
|
||||
import { ELK_PAGE_LIFECYCLE_FROZEN } from '../app/constants'
|
||||
import {
|
||||
closeDatabaseConnections,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { RouteLocationRaw } from '#vue-router'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { RouteLocationRaw } from 'vue-router'
|
||||
import type { MarkNonNullable, Mutable } from './utils'
|
||||
|
||||
export interface AppInfo {
|
||||
|
|
@ -43,8 +43,6 @@ export interface GroupedLikeNotifications {
|
|||
|
||||
export type NotificationSlot = GroupedNotifications | GroupedLikeNotifications | mastodon.v1.Notification
|
||||
|
||||
export type TranslateFn = ReturnType<typeof useI18n>['t']
|
||||
|
||||
export interface DraftItem {
|
||||
editingStatus?: mastodon.v1.Status
|
||||
initialText?: string
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
{
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
"references": [
|
||||
{
|
||||
"path": "./.nuxt/tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./.nuxt/tsconfig.server.json"
|
||||
},
|
||||
{
|
||||
"path": "./.nuxt/tsconfig.shared.json"
|
||||
},
|
||||
{
|
||||
"path": "./.nuxt/tsconfig.node.json"
|
||||
},
|
||||
{
|
||||
"path": "./service-worker/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue