diff --git a/.gitignore b/.gitignore index 5e134baa..4116c624 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist .output .pnpm-store .nuxt +.data .env .DS_Store .idea/ diff --git a/.npmrc b/.npmrc deleted file mode 100644 index c6d7600b..00000000 --- a/.npmrc +++ /dev/null @@ -1,4 +0,0 @@ -shamefully-hoist=true -shell-emulator=true -ignore-workspace-root-check=true -package-manager-strict=false diff --git a/.nvmrc b/.nvmrc index 8fdd954d..2bd5a0a9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22 \ No newline at end of file +22 diff --git a/Dockerfile b/Dockerfile index 64974e1f..12661f15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,12 @@ RUN apk add git --no-cache # Prepare build deps ( ignore postinstall scripts for now ) COPY package.json ./ -COPY .npmrc ./ COPY pnpm-lock.yaml ./ -COPY patches ./patches RUN pnpm i --frozen-lockfile --ignore-scripts # Copy all source files COPY . ./ +RUN pnpm nuxt prepare # Run full install with every postinstall script ( This needs project file ) RUN pnpm i --frozen-lockfile diff --git a/app/augments.d.ts b/app/augments.d.ts new file mode 100644 index 00000000..e94466b0 --- /dev/null +++ b/app/augments.d.ts @@ -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 + } + } +} diff --git a/app/composables/tiptap/shiki-parser.ts b/app/composables/tiptap/shiki-parser.ts index 00c23a13..47daaac5 100644 --- a/app/composables/tiptap/shiki-parser.ts +++ b/app/composables/tiptap/shiki-parser.ts @@ -17,6 +17,7 @@ export const shikiParser: Parser = (options) => { return promise ?? [] if (!parser) + // @ts-expect-error will be fixed when shiki upgrades parser = createParser(highlighter) return parser(options) diff --git a/app/plugins/setup-i18n.ts b/app/plugins/setup-i18n.ts index 9c292159..18c3fbd9 100644 --- a/app/plugins/setup-i18n.ts +++ b/app/plugins/setup-i18n.ts @@ -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 }) } diff --git a/config/i18n.ts b/config/i18n.ts index 66356b47..092c2ed8 100644 --- a/config/i18n.ts +++ b/config/i18n.ts @@ -75,13 +75,11 @@ export const countryLocaleVariants: Record[]) + }, [] as LocaleObjectData[]) return useLocales.sort((a, b) => a.code.localeCompare(b.code)) } @@ -313,7 +308,7 @@ export const datetimeFormats = Object.values(currentLocales).reduce((acc, data) } return acc -}, {}) +}, {} as DateTimeFormats) export const numberFormats = Object.values(currentLocales).reduce((acc, data) => { const numberFormats = data.numberFormats @@ -345,7 +340,7 @@ export const numberFormats = Object.values(currentLocales).reduce((acc, data) => } return acc -}, {}) +}, {} as NumberFormats) export const pluralRules = Object.values(currentLocales).reduce((acc, data) => { const pluralRule = data.pluralRule @@ -355,4 +350,4 @@ export const pluralRules = Object.values(currentLocales).reduce((acc, data) => { } return acc -}, {}) +}, {} as PluralizationRules) diff --git a/docs/app.config.ts b/docs/app.config.ts index 1c7583dd..723909dd 100644 --- a/docs/app.config.ts +++ b/docs/app.config.ts @@ -1,35 +1,41 @@ export default defineAppConfig({ - docus: { + seo: { title: 'Elk', - description: 'A nimble Mastodon web client.', - image: 'https://docs.elk.zone/elk-screenshot.png', - socials: { - // twitter: 'elk_zone', - github: 'elk-zone/elk', - mastodon: { - label: 'Mastodon', - icon: 'IconMastodon', - href: 'https://elk.zone/@elk@webtoo.ls', - }, + description: 'A nimble Mastodon web client with modern features and elegant design.', + }, + header: { + title: 'Elk', + logo: { + alt: 'Elk', + light: '/logo.svg', + dark: '/logo.svg', }, - aside: { - level: 0, - exclude: [], - }, - header: { - logo: true, - showLinkIcon: true, - exclude: [], - }, - footer: { - iconLinks: [ + }, + socials: { + github: 'https://github.com/elk-zone/elk', + mastodon: 'https://elk.zone/@elk@webtoo.ls', + }, + github: { + url: 'https://github.com/elk-zone/elk', + branch: 'main', + rootDir: 'docs', + }, + toc: { + title: 'On this page', + bottom: { + title: 'Community', + links: [ { - href: 'https://nuxt.com', - icon: 'IconNuxtLabs', + icon: 'i-ph-shooting-star-duotone', + label: 'Star on GitHub', + to: 'https://github.com/elk-zone/elk', + target: '_blank', }, { - href: 'https://m.webtoo.ls/@elk', - icon: 'IconMastodon', + icon: 'i-simple-icons-mastodon', + label: 'Follow on Mastodon', + to: 'https://elk.zone/@elk@webtoo.ls', + target: '_blank', }, ], }, diff --git a/docs/app.vue b/docs/app.vue deleted file mode 100644 index e19315ee..00000000 --- a/docs/app.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/docs/app/assets/css/main.css b/docs/app/assets/css/main.css new file mode 100644 index 00000000..53994ce2 --- /dev/null +++ b/docs/app/assets/css/main.css @@ -0,0 +1,4 @@ +/* Elk brand colors for light and dark modes */ +:root { + --ui-primary: #f0943c; +} diff --git a/docs/components/global/ClipboardIcon.vue b/docs/app/components/content/ClipboardIcon.vue similarity index 100% rename from docs/components/global/ClipboardIcon.vue rename to docs/app/components/content/ClipboardIcon.vue diff --git a/docs/components/global/IconMastodon.vue b/docs/app/components/content/IconMastodon.vue similarity index 100% rename from docs/components/global/IconMastodon.vue rename to docs/app/components/content/IconMastodon.vue diff --git a/docs/components/global/Logo.vue b/docs/app/components/content/Logo.vue similarity index 100% rename from docs/components/global/Logo.vue rename to docs/app/components/content/Logo.vue diff --git a/docs/components/global/ToggleIcon.vue b/docs/app/components/content/ToggleIcon.vue similarity index 100% rename from docs/components/global/ToggleIcon.vue rename to docs/app/components/content/ToggleIcon.vue diff --git a/docs/components/global/TranslationState.vue b/docs/app/components/content/TranslationState.vue similarity index 97% rename from docs/components/global/TranslationState.vue rename to docs/app/components/content/TranslationState.vue index 0dd06865..63980fcf 100644 --- a/docs/components/global/TranslationState.vue +++ b/docs/app/components/content/TranslationState.vue @@ -1,9 +1,9 @@