From 1a5c3eb67167d61fd20811f7a117ae88b578da36 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 29 Sep 2025 19:37:53 +0300 Subject: [PATCH] chore(deps): update to use docus v4 + nuxt v4 (#3388) --- .gitignore | 1 + .npmrc | 4 - .nvmrc | 2 +- Dockerfile | 3 +- app/augments.d.ts | 19 + app/composables/tiptap/shiki-parser.ts | 1 + app/plugins/setup-i18n.ts | 4 +- config/i18n.ts | 13 +- docs/app.config.ts | 58 +- docs/app.vue | 5 - docs/app/assets/css/main.css | 4 + .../components/content}/ClipboardIcon.vue | 0 .../components/content}/IconMastodon.vue | 0 .../components/content}/Logo.vue | 0 .../components/content}/ToggleIcon.vue | 0 .../components/content}/TranslationState.vue | 8 +- docs/content/0.index.md | 36 - docs/content/1.guide/1.index.md | 9 +- docs/content/1.guide/2.features.md | 9 +- docs/content/1.guide/3.contributing.md | 5 + docs/content/1.guide/4.sponsoring.md | 5 + docs/content/2.deployment/1.netlify.md | 5 +- docs/content/80.pwa.md | 5 + docs/content/99.privacy.md | 7 +- docs/content/index.md | 158 + docs/nuxt.config.ts | 14 +- docs/package.json | 16 +- docs/tokens.config.ts | 17 - modules/build-env.ts | 4 +- modules/emoji-mart-translation.ts | 2 +- modules/purge-comments.ts | 2 +- modules/pwa/i18n.ts | 2 +- modules/pwa/index.ts | 2 +- nuxt.config.ts | 42 +- package.json | 90 +- patches/.gitkeep | 0 patches/pinceau.patch | 13 - pnpm-lock.yaml | 12774 ++++++++-------- pnpm-workspace.yaml | 19 + scripts/avatars.ts | 2 +- scripts/cleanup-translations.ts | 4 +- scripts/generate-themes.ts | 2 +- scripts/prepare-translation-status.ts | 6 +- scripts/prepare.ts | 4 +- service-worker/tsconfig.json | 3 +- service-worker/tsconfig.tsbuildinfo | 1 + service-worker/web-push-notifications.ts | 2 +- shared/types/index.ts | 4 +- tsconfig.json | 19 +- vitest.config.ts | 32 +- 50 files changed, 7204 insertions(+), 6233 deletions(-) delete mode 100644 .npmrc create mode 100644 app/augments.d.ts delete mode 100644 docs/app.vue create mode 100644 docs/app/assets/css/main.css rename docs/{components/global => app/components/content}/ClipboardIcon.vue (100%) rename docs/{components/global => app/components/content}/IconMastodon.vue (100%) rename docs/{components/global => app/components/content}/Logo.vue (100%) rename docs/{components/global => app/components/content}/ToggleIcon.vue (100%) rename docs/{components/global => app/components/content}/TranslationState.vue (97%) delete mode 100755 docs/content/0.index.md create mode 100755 docs/content/index.md delete mode 100644 docs/tokens.config.ts delete mode 100644 patches/.gitkeep delete mode 100644 patches/pinceau.patch create mode 100644 service-worker/tsconfig.tsbuildinfo 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 @@