Skip to content

Commit

Permalink
Update Nuxt and deps to v3.13.0; fix server dir location (#4823)
Browse files Browse the repository at this point in the history
* Update Nuxt and related dependencies to v3.13.0

* Move server dir into src dir; Add healthcheck e2e test
  • Loading branch information
zackkrida authored Aug 27, 2024
1 parent 991a032 commit a3f5f6e
Show file tree
Hide file tree
Showing 10 changed files with 1,681 additions and 2,367 deletions.
5 changes: 2 additions & 3 deletions frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { LocaleObject } from "@nuxtjs/i18n"

export default defineNuxtConfig({
srcDir: "src/",
serverDir: "server/",
devServer: {
port: 8443,
host: "0.0.0.0",
Expand Down Expand Up @@ -100,15 +99,15 @@ export default defineNuxtConfig({
code: "en", // unique identifier for the locale in Vue i18n
dir: "ltr",
file: "en.json",
iso: "en", // used for SEO purposes (html lang attribute)
language: "en", // used for SEO purposes (html lang attribute)

/* Custom fields */

name: "English",
nativeName: "English",
},
...locales,
].filter((l) => Boolean(l.iso)) as LocaleObject[],
].filter((l) => Boolean(l.language)) as LocaleObject[],
lazy: true,
langDir: "locales",
defaultLocale: "en",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"jsdom": "^24.1.0",
"node-html-parser": "^6.1.13",
"npm-run-all2": "^6.2.2",
"nuxt": "3.12.4",
"nuxt": "3.13.0",
"rimraf": "^6.0.1",
"talkback": "^4.2.0",
"typescript": "5.5.4",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/scripts/get-validated-locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getValidatedLocales = async () => {
// Check for a language in all three versions of the ISO 639 spec,
// defaulting to the v1 two-character codes before checking for the
// three-character codes in the v2 and v3 specs.
iso:
language:
locale.langCodeIso_639_1 ??
locale.langCodeIso_639_2 ??
locale.langCodeIso_639_3 ??
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/locales/scripts/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ export interface I18nLocaleProps {
name: string
wpLocale?: string
file?: string
/** @deprecated use "language" instead */
iso?: string
language?: string
dir?: string
translated?: number
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRuntimeConfig, useAppConfig } from "#imports"
import { defineNitroPlugin } from "nitropack/runtime"
import * as Sentry from "@sentry/node"

import { logger } from "~~/server/utils/logger"
import { logger } from "~/server/utils/logger"

export default defineNitroPlugin((nitroApp) => {
const {
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions frontend/test/locales/valid-locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"code": "ar",
"name": "Arabic",
"nativeName": "العربية",
"iso": "ar",
"language": "ar",
"wpLocale": "ar",
"dir": "rtl",
"translated": 100,
Expand All @@ -13,7 +13,7 @@
"code": "es",
"name": "Spanish (Spain)",
"nativeName": "Español",
"iso": "es",
"language": "es",
"wpLocale": "es_ES",
"dir": "ltr",
"translated": 100,
Expand All @@ -23,7 +23,7 @@
"code": "ru",
"name": "Russian",
"nativeName": "Русский",
"iso": "ru",
"language": "ru",
"wpLocale": "ru_RU",
"dir": "ltr",
"translated": 48,
Expand Down
8 changes: 8 additions & 0 deletions frontend/test/playwright/e2e/healthcheck.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from "@playwright/test"

test("returns OK on healthcheck", async ({ page }) => {
await page.goto("/healthcheck")
const body = page.locator("body")

await expect(body).toHaveText("OK")
})
Loading

0 comments on commit a3f5f6e

Please sign in to comment.