chore: Upgrade Node and Nuxt (#6240)

This commit is contained in:
Michael Genson
2025-09-27 12:26:02 -05:00
committed by GitHub
parent 0e10ed8461
commit ecdf7de386
15 changed files with 3893 additions and 4257 deletions

View File

@@ -11,7 +11,7 @@
// Use -bullseye variants on local on arm64/Apple Silicon. // Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.12-bullseye", "VARIANT": "3.12-bullseye",
// Options // Options
"NODE_VERSION": "20" "NODE_VERSION": "22"
} }
}, },
"mounts": [ "mounts": [

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup node env 🏗 - name: Setup node env 🏗
uses: actions/setup-node@v4.0.0 uses: actions/setup-node@v4.0.0
with: with:
node-version: 20 node-version: 22
check-latest: true check-latest: true
- name: Get yarn cache directory path 🛠 - name: Get yarn cache directory path 🛠

View File

@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 22
cache: 'yarn' cache: 'yarn'
cache-dependency-path: ./tests/e2e/yarn.lock cache-dependency-path: ./tests/e2e/yarn.lock
- name: Set up Docker Buildx - name: Set up Docker Buildx

View File

@@ -14,7 +14,7 @@ jobs:
- name: Setup node env 🏗 - name: Setup node env 🏗
uses: actions/setup-node@v4.0.0 uses: actions/setup-node@v4.0.0
with: with:
node-version: 20 node-version: 22
check-latest: true check-latest: true
- name: Get yarn cache directory path 🛠 - name: Get yarn cache directory path 🛠

View File

@@ -1,7 +1,7 @@
############################################### ###############################################
# Frontend Build # Frontend Build
############################################### ###############################################
FROM node:20@sha256:abcf9c98af22ea2c5d33435143d9d8a5f6f191e1e1938a7650fc8b78c382b5a9 \ FROM node:22@sha256:4973262386dc1cb70f7d6fc48a855027d8f12d2d3b1fe559b9db9a4fcb74668f \
AS frontend-builder AS frontend-builder
WORKDIR /frontend WORKDIR /frontend

View File

@@ -34,7 +34,7 @@ Make sure the VSCode Dev Containers extension is installed, then select "Dev Con
- [Python 3.12](https://www.python.org/downloads/) - [Python 3.12](https://www.python.org/downloads/)
- [Poetry](https://python-poetry.org/docs/#installation) - [Poetry](https://python-poetry.org/docs/#installation)
- [Node v16.x](https://nodejs.org/en/) - [Node](https://nodejs.org/en/)
- [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) - [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)
- [task](https://taskfile.dev/#/installation) - [task](https://taskfile.dev/#/installation)

View File

@@ -1,16 +1,13 @@
import { useAsyncKey } from "../use-utils";
import type { AppInfo } from "~/lib/api/types/admin"; import type { AppInfo } from "~/lib/api/types/admin";
export function useAppInfo(): Ref<AppInfo | null> { export function useAppInfo(): Ref<AppInfo | null> {
const appInfo = ref<null | AppInfo>(null);
const i18n = useI18n(); const i18n = useI18n();
const { $axios } = useNuxtApp(); const { $axios } = useNuxtApp();
$axios.defaults.headers.common["Accept-Language"] = i18n.locale.value; $axios.defaults.headers.common["Accept-Language"] = i18n.locale.value;
useAsyncData(useAsyncKey(), async () => { const { data: appInfo } = useAsyncData("app-info", async () => {
const data = await $axios.get<AppInfo>("/api/app/about"); const data = await $axios.get<AppInfo>("/api/app/about");
appInfo.value = data.data; return data.data;
}); });
return appInfo; return appInfo;

View File

@@ -1,10 +1,10 @@
// @ts-check // @ts-check
import stylisticJs from "@stylistic/eslint-plugin-js"; import stylistic from "@stylistic/eslint-plugin";
import withNuxt from "./.nuxt/eslint.config.mjs"; import withNuxt from "./.nuxt/eslint.config.mjs";
export default withNuxt({ export default withNuxt({
plugins: { plugins: {
"@stylistic/js": stylisticJs, "@stylistic": stylistic,
}, },
// Your custom configs here // Your custom configs here
rules: { rules: {
@@ -14,11 +14,13 @@ export default withNuxt({
"object-curly-newline": "off", "object-curly-newline": "off",
"consistent-list-newline": "off", "consistent-list-newline": "off",
"vue/first-attribute-linebreak": "off", "vue/first-attribute-linebreak": "off",
"@stylistic/js/no-tabs": ["error", { allowIndentationTabs: true }],
"@stylistic/no-tabs": ["error", { allowIndentationTabs: true }], "@stylistic/no-tabs": ["error", { allowIndentationTabs: true }],
"@stylistic/no-mixed-spaces-and-tabs": ["error", "smart-tabs"], "@stylistic/no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"vue/max-attributes-per-line": "off", "vue/max-attributes-per-line": "off",
"vue/html-indent": "off", "vue/html-indent": "off",
"vue/html-closing-bracket-newline": "off", "vue/html-closing-bracket-newline": "off",
// TODO: temporarily off to get this PR in without a crazy diff
"@stylistic/indent": "off",
"@stylistic/operator-linebreak": "off",
}, },
}); });

View File

@@ -1,6 +1,6 @@
{ {
"name": "mealie", "name": "mealie",
"version": "3.2.1", "version": "3.2.1",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxt dev",
@@ -21,17 +21,17 @@
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",
"@nuxt/fonts": "^0.11.4", "@nuxt/fonts": "^0.11.4",
"@nuxtjs/i18n": "^9.2.1", "@nuxtjs/i18n": "^9.2.1",
"@sidebase/nuxt-auth": "0.10.0", "@sidebase/nuxt-auth": "^1.1.0",
"@vite-pwa/nuxt": "0.10.6", "@vite-pwa/nuxt": "^0.10.6",
"@vueuse/core": "^12.7.0", "@vueuse/core": "^12.7.0",
"axios": "^1.8.1", "axios": "^1.8.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"fuse.js": "^7.1.0", "fuse.js": "^7.1.0",
"isomorphic-dompurify": "^2.22.0", "isomorphic-dompurify": "^2.28.0",
"json-editor-vue": "^0.18.1", "json-editor-vue": "^0.18.1",
"marked": "^15.0.12", "marked": "^15.0.12",
"next-auth": "~4.24.0", "next-auth": "~4.24.0",
"nuxt": "^3.15.4", "nuxt": "^3.19.2",
"vite": "^6.2.0", "vite": "^6.2.0",
"vue-advanced-cropper": "^2.8.9", "vue-advanced-cropper": "^2.8.9",
"vue-draggable-plus": "^0.6.0", "vue-draggable-plus": "^0.6.0",
@@ -39,11 +39,11 @@
"vuetify-nuxt-module": "^0.18.3" "vuetify-nuxt-module": "^0.18.3"
}, },
"devDependencies": { "devDependencies": {
"@nuxt/eslint": "1.2.0", "@nuxt/eslint": "^1.2.0",
"@nuxt/types": "^2.18.1", "@nuxt/types": "^2.18.1",
"@nuxtjs/eslint-config-typescript": "^12.1.0", "@nuxtjs/eslint-config-typescript": "^12.1.0",
"@nuxtjs/eslint-module": "^4.1.0", "@nuxtjs/eslint-module": "^4.1.0",
"@stylistic/eslint-plugin-js": "^4.2.0", "@stylistic/eslint-plugin": "^5.4.0",
"@types/sortablejs": "^1.15.8", "@types/sortablejs": "^1.15.8",
"eslint": "^9.22.0", "eslint": "^9.22.0",
"eslint-config-prettier": "^10.0.2", "eslint-config-prettier": "^10.0.2",
@@ -54,7 +54,7 @@
"lint-staged": "^15.4.3", "lint-staged": "^15.4.3",
"prettier": "^3.5.2", "prettier": "^3.5.2",
"sass-embedded": "^1.85.1", "sass-embedded": "^1.85.1",
"typescript": "5.3", "typescript": "^5.3",
"vite-plugin-commonjs": "^0.10.4", "vite-plugin-commonjs": "^0.10.4",
"vitest": "^3.0.7" "vitest": "^3.0.7"
}, },

View File

@@ -110,7 +110,7 @@
</v-card-actions> </v-card-actions>
<div <div
v-if="allowOidc && allowPasswordLogin" v-if="appInfoLoaded && allowOidc && allowPasswordLogin"
class="d-flex my-4 justify-center align-center" class="d-flex my-4 justify-center align-center"
width="80%" width="80%"
> >
@@ -126,7 +126,7 @@
</span> </span>
</div> </div>
<v-card-actions <v-card-actions
v-if="allowOidc" v-if="appInfoLoaded && allowOidc"
class="justify-center" class="justify-center"
> >
<div class="max-button"> <div class="max-button">
@@ -270,6 +270,7 @@ export default defineNuxtComponent({
const { passwordIcon, inputType, togglePasswordShow } = usePasswordField(); const { passwordIcon, inputType, togglePasswordShow } = usePasswordField();
const appInfoLoaded = computed(() => appInfo.value !== null);
const allowSignup = computed(() => appInfo.value?.allowSignup || false); const allowSignup = computed(() => appInfo.value?.allowSignup || false);
const allowOidc = computed(() => appInfo.value?.enableOidc || false); const allowOidc = computed(() => appInfo.value?.enableOidc || false);
const oidcRedirect = computed(() => appInfo.value?.oidcRedirect || false); const oidcRedirect = computed(() => appInfo.value?.oidcRedirect || false);
@@ -277,7 +278,7 @@ export default defineNuxtComponent({
const allowPasswordLogin = computed(() => appInfo.value?.allowPasswordLogin ?? true); const allowPasswordLogin = computed(() => appInfo.value?.allowPasswordLogin ?? true);
whenever( whenever(
() => allowOidc.value && oidcRedirect.value && !isCallback() && !isDirectLogin() /* && !$auth.check().valid */, () => appInfoLoaded.value && allowOidc.value && oidcRedirect.value && !isCallback() && !isDirectLogin() /* && !$auth.check().valid */,
() => oidcAuthenticate(), () => oidcAuthenticate(),
{ immediate: true }, { immediate: true },
); );
@@ -359,6 +360,7 @@ export default defineNuxtComponent({
isDark, isDark,
form, form,
loggingIn, loggingIn,
appInfoLoaded,
allowSignup, allowSignup,
allowPasswordLogin, allowPasswordLogin,
allowOidc, allowOidc,

View File

@@ -6,16 +6,15 @@ export default defineNuxtPlugin(() => {
const axiosInstance = axios.create({ const axiosInstance = axios.create({
// timeout removed to allow backend to handle timeouts // timeout removed to allow backend to handle timeouts
baseURL: "/", // api calls already pass with /api baseURL: "/", // api calls already pass with /api
headers: {
Authorization: "Bearer " + useCookie(tokenName).value,
},
withCredentials: true, withCredentials: true,
}); });
// Add request interceptor
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
(config) => { (config) => {
// You can add auth tokens or other headers here const token = useCookie(tokenName).value;
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config; return config;
}, },
(error) => { (error) => {

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,7 @@ test('ldap login', async ({ page }) => {
await expect(page).toHaveURL(/\/g\/home/); await expect(page).toHaveURL(/\/g\/home/);
await expect(page.getByRole('navigation')).toContainText(name); await expect(page.getByRole('navigation')).toContainText(name);
await page.getByText('Settings', { exact: true }).click(); await page.getByText('Settings', { exact: true }).click();
await expect(page.getByRole('link', { name: 'Admin Settings' })).not.toBeVisible(); await expect(page.getByText('Admin Settings')).not.toBeVisible();
}); });
test('ldap admin login', async ({ page }) => { test('ldap admin login', async ({ page }) => {
@@ -42,7 +42,7 @@ test('ldap admin login', async ({ page }) => {
await page.getByRole('link', { name: "I'm already set up, just bring me to the homepage" }).click(); await page.getByRole('link', { name: "I'm already set up, just bring me to the homepage" }).click();
await expect(page.getByRole('navigation')).toContainText(name); await expect(page.getByRole('navigation')).toContainText(name);
await page.getByText('Settings', { exact: true }).click(); await page.getByText('Settings', { exact: true }).click();
await expect(page.getByRole('link', { name: 'Admin Settings' })).toBeVisible(); await expect(page.getByText('Admin Settings')).toBeVisible();
}); });
test('oidc initial login', async ({ page }) => { test('oidc initial login', async ({ page }) => {
@@ -64,7 +64,7 @@ test('oidc initial login', async ({ page }) => {
await expect(page).toHaveURL(/\/g\/home/); await expect(page).toHaveURL(/\/g\/home/);
await expect(page.getByRole('navigation')).toContainText(name); await expect(page.getByRole('navigation')).toContainText(name);
await page.getByText('Settings', { exact: true }).click(); await page.getByText('Settings', { exact: true }).click();
await expect(page.getByRole('link', { name: 'Admin Settings' })).not.toBeVisible(); await expect(page.getByText('Admin Settings')).not.toBeVisible();
}); });
test('oidc login with user not in propery group', async ({ page }) => { test('oidc login with user not in propery group', async ({ page }) => {
@@ -171,5 +171,5 @@ test('oidc admin user', async ({ page }) => {
await page.getByRole('link', { name: "I'm already set up, just bring me to the homepage" }).click(); await page.getByRole('link', { name: "I'm already set up, just bring me to the homepage" }).click();
await expect(page.getByRole('navigation')).toContainText(name); await expect(page.getByRole('navigation')).toContainText(name);
await page.getByText('Settings', { exact: true }).click(); await page.getByText('Settings', { exact: true }).click();
await expect(page.getByRole('link', { name: 'Admin Settings' })).toBeVisible(); await expect(page.getByText('Admin Settings')).toBeVisible();
}); });

View File

@@ -4,8 +4,8 @@
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.40.1", "@playwright/test": "^1.55.1",
"@types/node": "^20.10.4" "@types/node": "^22.10.2"
}, },
"scripts": {} "scripts": {}
} }

View File

@@ -2,40 +2,40 @@
# yarn lockfile v1 # yarn lockfile v1
"@playwright/test@^1.40.1": "@playwright/test@^1.55.1":
version "1.47.2" version "1.55.1"
resolved "https://registry.npmjs.org/@playwright/test/-/test-1.47.2.tgz" resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.55.1.tgz#80f775d5f948cd3ef550fcc45ef99986d3ffb36c"
integrity sha512-jTXRsoSPONAs8Za9QEQdyjFn+0ZQFjCiIztAIF6bi1HqhBzG9Ma7g1WotyiGqFSBRZjIEqMdT8RUlbk1QVhzCQ== integrity sha512-IVAh/nOJaw6W9g+RJVlIQJ6gSiER+ae6mKQ5CX1bERzQgbC1VSeBlwdvczT7pxb0GWiyrxH4TGKbMfDb4Sq/ig==
dependencies: dependencies:
playwright "1.47.2" playwright "1.55.1"
"@types/node@^22.13.10": "@types/node@^22.10.2":
version "22.13.10" version "22.18.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.10.tgz#df9ea358c5ed991266becc3109dc2dc9125d77e4" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.18.6.tgz#38172ef0b65e09d1a4fc715eb09a7d5decfdc748"
integrity sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw== integrity sha512-r8uszLPpeIWbNKtvWRt/DbVi5zbqZyj1PTmhRMqBMvDnaz1QpmSKujUtJLrqGZeoM8v72MfYggDceY4K1itzWQ==
dependencies: dependencies:
undici-types "~6.20.0" undici-types "~6.21.0"
fsevents@2.3.2: fsevents@2.3.2:
version "2.3.2" version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
playwright-core@1.47.2: playwright-core@1.55.1:
version "1.47.2" version "1.55.1"
resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz" resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.55.1.tgz#5d3bb1846bc4289d364ea1a9dcb33f14545802e9"
integrity sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ== integrity sha512-Z6Mh9mkwX+zxSlHqdr5AOcJnfp+xUWLCt9uKV18fhzA8eyxUd8NUWzAjxUh55RZKSYwDGX0cfaySdhZJGMoJ+w==
playwright@1.47.2: playwright@1.55.1:
version "1.47.2" version "1.55.1"
resolved "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz" resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.55.1.tgz#8a9954e9e61ed1ab479212af9be336888f8b3f0e"
integrity sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA== integrity sha512-cJW4Xd/G3v5ovXtJJ52MAOclqeac9S/aGGgRzLabuF8TnIb6xHvMzKIa6JmrRzUkeXJgfL1MhukP0NK6l39h3A==
dependencies: dependencies:
playwright-core "1.47.2" playwright-core "1.55.1"
optionalDependencies: optionalDependencies:
fsevents "2.3.2" fsevents "2.3.2"
undici-types@~6.20.0: undici-types@~6.21.0:
version "6.20.0" version "6.21.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==