Skip to content

Commit b07a165

Browse files
authored
chore: update to nuxt 3.20 (#4992)
* feat: nuxt 3.14 → 3.15.4 * feat: nuxt 3.15.4 → 3.16.2 (vite 6) * feat: bump nuxt-i18n * feat: nuxt 3.20 * fix: lint * feat: use rolldown-vite * fix: shut the fuck up * fix: silence for app as well * fix: vue-router mismatch --------- Signed-off-by: Calum H. <contact@cal.engineer>
1 parent 1a16d61 commit b07a165

File tree

31 files changed

+8131
-8031
lines changed

31 files changed

+8131
-8031
lines changed

apps/app-frontend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
"@tauri-apps/plugin-window-state": "^2.2.2",
3030
"@types/three": "^0.172.0",
3131
"intl-messageformat": "^10.7.7",
32-
"vue-i18n": "^9.14.0",
32+
"vue-i18n": "^10.0.0",
3333
"@vueuse/core": "^11.1.0",
3434
"dayjs": "^1.11.10",
3535
"floating-vue": "^5.2.2",
3636
"ofetch": "^1.3.4",
37-
"pinia": "^2.1.7",
37+
"pinia": "^3.0.0",
3838
"posthog-js": "^1.158.2",
3939
"three": "^0.172.0",
4040
"vite-svg-loader": "^5.1.0",
4141
"vue": "^3.5.13",
4242
"vue-multiselect": "3.0.0",
43-
"vue-router": "4.3.0",
43+
"vue-router": "^4.6.0",
4444
"vue-virtual-scroller": "v2.0.0-beta.8"
4545
},
4646
"devDependencies": {
@@ -49,7 +49,7 @@
4949
"@modrinth/tooling-config": "workspace:*",
5050
"@nuxt/eslint-config": "^0.5.6",
5151
"@taijased/vue-render-tracker": "^1.0.7",
52-
"@vitejs/plugin-vue": "^5.0.4",
52+
"@vitejs/plugin-vue": "^6.0.3",
5353
"autoprefixer": "^10.4.19",
5454
"eslint": "^9.9.1",
5555
"eslint-plugin-turbo": "^2.5.4",
@@ -58,7 +58,7 @@
5858
"sass": "^1.74.1",
5959
"tailwindcss": "^3.4.4",
6060
"typescript": "^5.5.4",
61-
"vite": "^5.4.6",
61+
"vite": "^6.0.0",
6262
"vue-component-type-helpers": "^3.1.8",
6363
"vue-tsc": "^2.1.6"
6464
},

apps/app-frontend/src/components/ui/InstanceCreationModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ const create_instance = async () => {
341341
creating.value = true
342342
const loader_version_value =
343343
loader_version.value === 'other' ? specified_loader_version.value : loader_version.value
344-
const loaderVersion = loader.value === 'vanilla' ? null : loader_version_value ?? 'stable'
344+
const loaderVersion = loader.value === 'vanilla' ? null : (loader_version_value ?? 'stable')
345345
346346
hide()
347347
creating.value = false
@@ -350,7 +350,7 @@ const create_instance = async () => {
350350
profile_name.value,
351351
game_version.value,
352352
loader.value,
353-
loader.value === 'vanilla' ? null : loader_version_value ?? 'stable',
353+
loader.value === 'vanilla' ? null : (loader_version_value ?? 'stable'),
354354
icon.value,
355355
).catch(handleError)
356356

apps/app-frontend/src/components/ui/ProjectCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const toTransparent = computed(() => {
6363
<div
6464
class="w-full aspect-[2/1] bg-cover bg-center bg-no-repeat"
6565
:style="{
66-
'background-color': project.featured_gallery ?? project.gallery[0] ? null : toColor,
66+
'background-color': (project.featured_gallery ?? project.gallery[0]) ? null : toColor,
6767
'background-image': `url(${
6868
project.featured_gallery ??
6969
project.gallery[0] ??

apps/app-frontend/src/components/ui/SplashScreen.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ const handleClose = async () => {
191191
position: absolute;
192192
height: 100vh;
193193
width: 100vw;
194-
background: linear-gradient(180deg, rgba(66, 131, 92, 0.275) 0%, rgba(17, 35, 43, 0.5) 97.29%),
194+
background:
195+
linear-gradient(180deg, rgba(66, 131, 92, 0.275) 0%, rgba(17, 35, 43, 0.5) 97.29%),
195196
linear-gradient(0deg, rgba(22, 24, 28, 0.64), rgba(22, 24, 28, 0.64));
196197
z-index: 9997;
197198
}

apps/app-frontend/src/components/ui/world/WorldItem.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ const messages = defineMessages({
189189
>
190190
<Avatar
191191
:src="
192-
world.type === 'server' && serverStatus ? serverStatus.favicon ?? world.icon : world.icon
192+
world.type === 'server' && serverStatus
193+
? (serverStatus.favicon ?? world.icon)
194+
: world.icon
193195
"
194196
size="48px"
195197
/>

apps/app-frontend/vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ const projectRootDir = resolve(__dirname)
99

1010
// https://vitejs.dev/config/
1111
export default defineConfig({
12+
css: {
13+
preprocessorOptions: {
14+
scss: {
15+
// TODO: dont forget about this
16+
silenceDeprecations: ['import'],
17+
},
18+
},
19+
},
1220
resolve: {
1321
alias: [
1422
{
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { buildLocaleMessages, createMessageCompiler, type CrowdinMessages } from '@modrinth/ui'
22

3-
const localeModules = import.meta.glob<{ default: CrowdinMessages }>('./locales/*/index.json', {
4-
eager: true,
5-
})
3+
const localeModules = import.meta.glob<{ default: CrowdinMessages }>(
4+
'../src/locales/*/index.json',
5+
{
6+
eager: true,
7+
},
8+
)
69

710
export default defineI18nConfig(() => ({
811
legacy: false,
@@ -11,5 +14,6 @@ export default defineI18nConfig(() => ({
1114
messageCompiler: createMessageCompiler(),
1215
missingWarn: false,
1316
fallbackWarn: false,
17+
// @ts-expect-error - buildLocaleMessages returns compatible format at runtime
1418
messages: buildLocaleMessages(localeModules),
1519
}))

apps/frontend/nuxt.config.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ export default defineNuxtConfig({
5656
},
5757
},
5858
vite: {
59+
css: {
60+
preprocessorOptions: {
61+
scss: {
62+
// TODO: dont forget about this
63+
silenceDeprecations: ['import'],
64+
},
65+
},
66+
},
67+
ssr: {
68+
// https://github.com/Akryum/floating-vue/issues/809#issuecomment-1002996240
69+
noExternal: ['v-tooltip'],
70+
},
5971
define: {
6072
global: {},
6173
},
@@ -196,21 +208,39 @@ export default defineNuxtConfig({
196208
},
197209
},
198210
},
199-
modules: ['@nuxtjs/i18n', '@pinia/nuxt'],
211+
modules: ['@nuxtjs/i18n', '@pinia/nuxt', 'floating-vue/nuxt'],
212+
floatingVue: {
213+
themes: {
214+
'ribbit-popout': {
215+
$extend: 'dropdown',
216+
placement: 'bottom-end',
217+
instantMove: true,
218+
distance: 8,
219+
},
220+
'dismissable-prompt': {
221+
$extend: 'dropdown',
222+
placement: 'bottom-start',
223+
},
224+
},
225+
},
200226
i18n: {
201227
defaultLocale: 'en-US',
228+
// @ts-expect-error - LocaleDefinition is compatible at runtime
202229
locales: LOCALES,
203230
strategy: 'no_prefix',
204231
detectBrowserLanguage: {
205232
useCookie: true,
206233
cookieKey: 'locale',
207234
fallbackLocale: 'en-US',
208235
},
209-
vueI18n: './src/i18n.config.ts',
236+
vueI18n: './i18n.config.ts',
237+
bundle: {
238+
optimizeTranslationDirective: false,
239+
},
210240
},
211241
nitro: {
212242
rollupConfig: {
213-
// @ts-expect-error it's not infinite.
243+
// @ts-expect-error because of rolldown-vite - completely fine though
214244
plugins: [serverSidedVue()],
215245
},
216246
},
@@ -255,7 +285,7 @@ export default defineNuxtConfig({
255285
},
256286
},
257287
},
258-
compatibilityDate: '2024-07-03',
288+
compatibilityDate: '2025-01-01',
259289
telemetry: false,
260290
})
261291

apps/frontend/package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@
1010
"postinstall": "nuxi prepare",
1111
"lint": "eslint . && prettier --check .",
1212
"fix": "eslint . --fix && prettier --write .",
13-
"intl:extract": "formatjs extract \"{,src/components,src/composables,src/layouts,src/middleware,src/modules,src/pages,src/plugins,src/utils}/**/*.{vue,ts,tsx,js,jsx,mts,cts,mjs,cjs}\" \"src/error.vue\" --ignore \"**/*.d.ts\" --ignore node_modules --out-file src/locales/en-US/index.json --format crowdin --preserve-whitespace",
13+
"intl:extract": "formatjs extract \"src/{components,composables,layouts,middleware,modules,pages,plugins,utils}/**/*.{vue,ts,tsx,js,jsx,mts,cts,mjs,cjs}\" \"src/error.vue\" --ignore \"**/*.d.ts\" --ignore node_modules --out-file src/locales/en-US/index.json --format crowdin --preserve-whitespace",
1414
"test": "nuxi build"
1515
},
1616
"devDependencies": {
1717
"@formatjs/cli": "^6.2.12",
18-
"@nuxt/devtools": "^1.3.3",
19-
"@nuxtjs/i18n": "^8.5.5",
18+
"@modrinth/tooling-config": "workspace:*",
19+
"@nuxtjs/i18n": "^9.0.0",
2020
"@types/dompurify": "^3.0.5",
2121
"@types/iso-3166-2": "^1.0.4",
2222
"@types/node": "^20.1.0",
2323
"autoprefixer": "^10.4.19",
24-
"eslint": "^8.57.0",
2524
"glob": "^10.2.7",
26-
"nuxt": "^3.14.1592",
25+
"nuxt": "^3.20.2",
2726
"postcss": "^8.4.39",
2827
"prettier-plugin-tailwindcss": "^0.6.5",
2928
"sass": "^1.58.0",
@@ -43,11 +42,10 @@
4342
"@modrinth/moderation": "workspace:*",
4443
"@modrinth/ui": "workspace:*",
4544
"@modrinth/utils": "workspace:*",
46-
"@pinia/nuxt": "^0.5.1",
45+
"@pinia/nuxt": "^0.11.3",
4746
"@tanstack/vue-query": "^5.90.7",
4847
"@types/three": "^0.172.0",
49-
"intl-messageformat": "^10.7.7",
50-
"@vitejs/plugin-vue": "^5.0.4",
48+
"@vitejs/plugin-vue": "^6.0.3",
5149
"@vue-email/components": "^0.0.21",
5250
"@vue-email/render": "^0.0.9",
5351
"@vueuse/core": "^11.1.0",
@@ -58,12 +56,13 @@
5856
"floating-vue": "^5.2.2",
5957
"fuse.js": "^6.6.2",
6058
"highlight.js": "^11.7.0",
59+
"intl-messageformat": "^10.7.7",
6160
"iso-3166-2": "1.0.0",
6261
"js-yaml": "^4.1.0",
6362
"jszip": "^3.10.1",
6463
"markdown-it": "14.1.0",
6564
"pathe": "^1.1.2",
66-
"pinia": "^2.1.7",
65+
"pinia": "^3.0.0",
6766
"pinia-plugin-persistedstate": "^4.4.1",
6867
"prettier": "^3.6.2",
6968
"qrcode.vue": "^3.4.0",

apps/frontend/src/app.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<NuxtLayout>
3+
<NuxtRouteAnnouncer />
34
<ModrinthLoadingIndicator />
45
<NotificationPanel />
56
<NuxtPage />

0 commit comments

Comments
 (0)